summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tkbltVecCmd.C2
1 files changed, 1 insertions, 1 deletions
diff --git a/generic/tkbltVecCmd.C b/generic/tkbltVecCmd.C
index 7bcfd4f..8a03fe6 100644
--- a/generic/tkbltVecCmd.C
+++ b/generic/tkbltVecCmd.C
@@ -1652,7 +1652,7 @@ static Blt_OpSpec vectorInstOps[] =
{"+", 1, (void*)ArithOp, 3, 3, "item",}, /*Deprecated*/
{"-", 1, (void*)ArithOp, 3, 3, "item",}, /*Deprecated*/
{"/", 1, (void*)ArithOp, 3, 3, "item",}, /*Deprecated*/
- {"append", 1, (void*)AppendOp, 3, 0, "item ?item...?",},
+ {"append", 1, (void*)AppendOp, 3, 0, "items ?items...?",},
{"binread", 1, (void*)BinreadOp, 3, 0, "channel ?numValues? ?flags?",},
{"clear", 1, (void*)ClearOp, 2, 2, "",},
{"delete", 2, (void*)DeleteOp, 2, 0, "index ?index...?",},
(#) $Id: tkDecls.h,v 1.31 2008/04/01 16:30:53 dgp Exp $ */ #ifndef _TKDECLS @@ -1982,6 +1982,8 @@ typedef struct TkStubs { void (*tk_CreateOldPhotoImageFormat) (Tk_PhotoImageFormat * formatPtr); /* 273 */ } TkStubs; +#if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) + #ifdef __cplusplus extern "C" { #endif @@ -1990,6 +1992,8 @@ extern TkStubs *tkStubsPtr; } #endif +#endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */ + #if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) /* diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h index e4df446..5729545 100644 --- a/generic/tkIntDecls.h +++ b/generic/tkIntDecls.h @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkIntDecls.h,v 1.31 2007/12/13 15:24:14 dgp Exp $ + * RCS: @(#) $Id: tkIntDecls.h,v 1.32 2008/04/01 16:30:53 dgp Exp $ */ #ifndef _TKINTDECLS @@ -1222,6 +1222,8 @@ typedef struct TkIntStubs { int (*tkpTesttextCmd) (ClientData dummy, Tcl_Interp * interp, int argc, CONST char ** argv); /* 157 */ } TkIntStubs; +#if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) + #ifdef __cplusplus extern "C" { #endif @@ -1230,6 +1232,8 @@ extern TkIntStubs *tkIntStubsPtr; } #endif +#endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */ + #if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) /* diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index e21516e..95881cd 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -9,7 +9,7 @@ * Copyright (c) 1998-1999 by Scriptics Corporation. * All rights reserved. * - * RCS: @(#) $Id: tkIntPlatDecls.h,v 1.29 2007/12/13 15:24:14 dgp Exp $ + * RCS: @(#) $Id: tkIntPlatDecls.h,v 1.30 2008/04/01 16:30:53 dgp Exp $ */ #ifndef _TKINTPLATDECLS @@ -670,6 +670,8 @@ typedef struct TkIntPlatStubs { #endif /* X11 */ } TkIntPlatStubs; +#if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) + #ifdef __cplusplus extern "C" { #endif @@ -678,6 +680,8 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr; } #endif +#endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */ + #if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) /* diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h index aadd545..759f162 100644 --- a/generic/tkIntXlibDecls.h +++ b/generic/tkIntXlibDecls.h @@ -9,7 +9,7 @@ * Copyright (c) 1998-1999 by Scriptics Corporation. * All rights reserved. * - * RCS: @(#) $Id: tkIntXlibDecls.h,v 1.23 2007/12/13 15:24:15 dgp Exp $ + * RCS: @(#) $Id: tkIntXlibDecls.h,v 1.24 2008/04/01 16:30:53 dgp Exp $ */ #ifndef _TKINTXLIBDECLS @@ -1419,6 +1419,8 @@ typedef struct TkIntXlibStubs { #endif /* AQUA */ } TkIntXlibStubs; +#if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) + #ifdef __cplusplus extern "C" { #endif @@ -1427,6 +1429,8 @@ extern TkIntXlibStubs *tkIntXlibStubsPtr; } #endif +#endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */ + #if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) /* diff --git a/generic/tkMain.c b/generic/tkMain.c index df3e215..9f6a73c 100644 --- a/generic/tkMain.c +++ b/generic/tkMain.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMain.c,v 1.28 2007/12/13 15:24:15 dgp Exp $ + * RCS: @(#) $Id: tkMain.c,v 1.29 2008/04/01 16:30:54 dgp Exp $ */ #include @@ -106,11 +106,11 @@ Tk_MainEx( Tcl_DString appName; /* - * Ensure that we are getting the matching version of Tcl. This is really + * Ensure that we are getting a compatible version of Tcl. This is really * only an issue when Tk is loaded dynamically. */ - if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) { + if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { abort(); } diff --git a/generic/tkPlatDecls.h b/generic/tkPlatDecls.h index e311c12..8502923 100644 --- a/generic/tkPlatDecls.h +++ b/generic/tkPlatDecls.h @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkPlatDecls.h,v 1.15 2007/12/13 15:24:16 dgp Exp $ + * RCS: @(#) $Id: tkPlatDecls.h,v 1.16 2008/04/01 16:30:54 dgp Exp $ */ #ifndef _TKPLATDECLS @@ -156,6 +156,8 @@ typedef struct TkPlatStubs { #endif /* AQUA */ } TkPlatStubs; +#if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) + #ifdef __cplusplus extern "C" { #endif @@ -164,6 +166,8 @@ extern TkPlatStubs *tkPlatStubsPtr; } #endif +#endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */ + #if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) /* diff --git a/generic/tkStubLib.c b/generic/tkStubLib.c index fbf1ed1..e54c3ef 100644 --- a/generic/tkStubLib.c +++ b/generic/tkStubLib.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkStubLib.c,v 1.20 2008/03/19 17:31:35 das Exp $ + * RCS: @(#) $Id: tkStubLib.c,v 1.21 2008/04/01 16:30:54 dgp Exp $ */ /* @@ -20,11 +20,6 @@ * including the rest of the stub functions. */ -#ifndef USE_TCL_STUBS -#define USE_TCL_STUBS -#endif -#undef USE_TCL_STUB_PROCS - #ifndef USE_TK_STUBS #define USE_TK_STUBS #endif diff --git a/generic/tkWindow.c b/generic/tkWindow.c index 0c5e3e9..4063819 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWindow.c,v 1.89 2007/12/13 15:24:21 dgp Exp $ + * RCS: @(#) $Id: tkWindow.c,v 1.90 2008/04/01 16:30:54 dgp Exp $ */ #include "tkInt.h" @@ -2944,11 +2944,11 @@ Initialize( ThreadSpecificData *tsdPtr; /* - * Ensure that we are getting the matching version of Tcl. This is really + * Ensure that we are getting a compatible version of Tcl. This is really * only an issue when Tk is loaded dynamically. */ - if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) { + if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { return TCL_ERROR; } diff --git a/library/tk.tcl b/library/tk.tcl index 7c31b92..c0e0e25 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -3,7 +3,7 @@ # Initialization script normally executed in the interpreter for each # Tk-based application. Arranges class bindings for widgets. # -# RCS: @(#) $Id: tk.tcl,v 1.73 2008/03/28 18:13:39 dgp Exp $ +# RCS: @(#) $Id: tk.tcl,v 1.74 2008/04/01 16:30:54 dgp Exp $ # # Copyright (c) 1992-1994 The Regents of the University of California. # Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -15,9 +15,9 @@ package require Tcl 8.5 ;# Guard against [source] in an 8.4- interp ;# before using 8.5 [package] features. # Insist on running with compatible version of Tcl -package require Tcl 8.5.0-8.6 +package require Tcl 8.5.0 # Verify that we have Tk binary and script components from the same release -package require -exact Tk 8.5.2 +package require -exact Tk 8.6a0 # Create a ::tk namespace namespace eval ::tk { diff --git a/macosx/Wish-Common.xcconfig b/macosx/Wish-Common.xcconfig index 7d210c3..33ed148 100644 --- a/macosx/Wish-Common.xcconfig +++ b/macosx/Wish-Common.xcconfig @@ -9,7 +9,7 @@ // See the file "license.terms" for information on usage and redistribution // of this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// RCS: @(#) $Id: Wish-Common.xcconfig,v 1.10 2008/03/12 22:18:01 das Exp $ +// RCS: @(#) $Id: Wish-Common.xcconfig,v 1.11 2008/04/01 16:30:54 dgp Exp $ // HEADER_SEARCH_PATHS = $(TK_SRCROOT)/generic $(TK_SRCROOT)/xlib "$(DERIVED_FILE_DIR)/tcl" "$(DERIVED_FILE_DIR)/tk" $(HEADER_SEARCH_PATHS) @@ -48,4 +48,4 @@ TCL_PACKAGE_PATH = "$(LIBDIR)" TCL_DEFS = HAVE_TCL_CONFIG_H TK_LIBRARY = $(LIBDIR)/tk$(VERSION) TK_DEFS = HAVE_TK_CONFIG_H TCL_NO_DEPRECATED -VERSION = 8.5 +VERSION = 8.6 diff --git a/unix/configure b/unix/configure index 71b4a73..feee89d 100755 --- a/unix/configure +++ b/unix/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for tk 8.5. +# Generated by GNU Autoconf 2.59 for tk 8.6. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation @@ -267,8 +267,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='tk' PACKAGE_TARNAME='tk' -PACKAGE_VERSION='8.5' -PACKAGE_STRING='tk 8.5' +PACKAGE_VERSION='8.6' +PACKAGE_STRING='tk 8.6' PACKAGE_BUGREPORT='' # Factoring default headers for most tests. @@ -777,7 +777,7 @@ if test "$ac_init_help" = "long"; then # 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 <<_ACEOF -\`configure' configures tk 8.5 to adapt to many kinds of systems. +\`configure' configures tk 8.6 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -838,7 +838,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of tk 8.5:";; + short | recursive ) echo "Configuration of tk 8.6:";; esac cat <<\_ACEOF @@ -980,7 +980,7 @@ fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -tk configure 8.5 +tk configure 8.6 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. @@ -994,7 +994,7 @@ cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by tk $as_me 8.5, which was +It was created by tk $as_me 8.6, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -1334,10 +1334,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -TK_VERSION=8.5 +TK_VERSION=8.6 TK_MAJOR_VERSION=8 -TK_MINOR_VERSION=5 -TK_PATCH_LEVEL=".2" +TK_MINOR_VERSION=6 +TK_PATCH_LEVEL="a0" VERSION=${TK_VERSION} LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv" @@ -1583,16 +1583,6 @@ echo "${ECHO_T}$BUILD_TCLSH" >&6 -if test "${TCL_VERSION}" != "${TK_VERSION}"; then - { { echo "$as_me:$LINENO: error: ${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. -Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl ${TK_VERSION}. -Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl ${TK_VERSION}." >&5 -echo "$as_me: error: ${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. -Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl ${TK_VERSION}. -Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl ${TK_VERSION}." >&2;} - { (exit 1); exit 1; }; } -fi - #------------------------------------------------------------------------ # Handle the --prefix=... option #------------------------------------------------------------------------ @@ -11172,7 +11162,7 @@ _ASBOX } >&5 cat >&5 <<_CSEOF -This file was extended by tk $as_me 8.5, which was +This file was extended by tk $as_me 8.6, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -11230,7 +11220,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -tk config.status 8.5 +tk config.status 8.6 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" diff --git a/unix/configure.in b/unix/configure.in index d2ca8d1..05b4cdb 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -3,9 +3,9 @@ dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tk installation dnl to configure the system for the local environment. # -# RCS: @(#) $Id: configure.in,v 1.153 2008/03/28 18:13:41 dgp Exp $ +# RCS: @(#) $Id: configure.in,v 1.154 2008/04/01 16:30:55 dgp Exp $ -AC_INIT([tk],[8.5]) +AC_INIT([tk],[8.6]) AC_PREREQ(2.59) dnl This is only used when included from macosx/configure.ac @@ -24,10 +24,10 @@ m4_ifdef([SC_USE_CONFIG_HEADERS], [ #endif /* _TKCONFIG */]) ]) -TK_VERSION=8.5 +TK_VERSION=8.6 TK_MAJOR_VERSION=8 -TK_MINOR_VERSION=5 -TK_PATCH_LEVEL=".2" +TK_MINOR_VERSION=6 +TK_PATCH_LEVEL="a0" VERSION=${TK_VERSION} LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv" @@ -41,12 +41,6 @@ SC_LOAD_TCLCONFIG SC_PROG_TCLSH SC_BUILD_TCLSH -if test "${TCL_VERSION}" != "${TK_VERSION}"; then - AC_MSG_ERROR([${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. -Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl ${TK_VERSION}. -Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl ${TK_VERSION}.]) -fi - #------------------------------------------------------------------------ # Handle the --prefix=... option #------------------------------------------------------------------------ diff --git a/unix/tk.spec b/unix/tk.spec index d93a62a..977b37e 100644 --- a/unix/tk.spec +++ b/unix/tk.spec @@ -1,19 +1,19 @@ -# $Id: tk.spec,v 1.34 2008/03/28 18:13:42 dgp Exp $ +# $Id: tk.spec,v 1.35 2008/04/01 16:30:56 dgp Exp $ # This file is the basis for a binary Tk Linux RPM. %{!?directory:%define directory /usr/local} Name: tk Summary: Tk graphical toolkit for the Tcl scripting language. -Version: 8.5.2 +Version: 8.6a0 Release: 2 License: BSD Group: Development/Languages Source: http://prdownloads.sourceforge.net/tcl/tk%{version}-src.tar.gz URL: http://www.tcl.tk/ Buildroot: /var/tmp/%{name}%{version} -Buildrequires: XFree86-devel tcl = %version -Requires: tcl = %version +Buildrequires: XFree86-devel tcl >= 8.5 +Requires: tcl >= 8.5 %description The Tcl (Tool Command Language) provides a powerful platform for diff --git a/win/README b/win/README index a7781bc..98e58e9 100644 --- a/win/README +++ b/win/README @@ -1,8 +1,8 @@ -Tk 8.5 for Windows +Tk 8.6 for Windows Originally by Scott Stanton while at Sun Microsystems Labs -RCS: @(#) $Id: README,v 1.17 2003/03/04 23:50:45 dgp Exp $ +RCS: @(#) $Id: README,v 1.18 2008/04/01 16:30:56 dgp Exp $ This is the directory where you configure and compile the Windows version of Tk. This directory also contains source files for Tk diff --git a/win/configure b/win/configure index 5932de2..c9f2be5 100755 --- a/win/configure +++ b/win/configure @@ -1306,10 +1306,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # /bin/sh. The bash shell seems to suffer from some strange failures. SHELL=/bin/sh -TK_VERSION=8.5 +TK_VERSION=8.6 TK_MAJOR_VERSION=8 -TK_MINOR_VERSION=5 -TK_PATCH_LEVEL=".2" +TK_MINOR_VERSION=6 +TK_PATCH_LEVEL="a0" VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION #------------------------------------------------------------------------ diff --git a/win/configure.in b/win/configure.in index ff948ec..48ee9ed 100644 --- a/win/configure.in +++ b/win/configure.in @@ -3,7 +3,7 @@ # generate the file "configure", which is run during Tk installation # to configure the system for the local environment. # -# RCS: @(#) $Id: configure.in,v 1.77 2008/03/28 18:13:42 dgp Exp $ +# RCS: @(#) $Id: configure.in,v 1.78 2008/04/01 16:30:56 dgp Exp $ AC_INIT(../generic/tk.h) AC_PREREQ(2.59) @@ -13,10 +13,10 @@ AC_PREREQ(2.59) # /bin/sh. The bash shell seems to suffer from some strange failures. SHELL=/bin/sh -TK_VERSION=8.5 +TK_VERSION=8.6 TK_MAJOR_VERSION=8 -TK_MINOR_VERSION=5 -TK_PATCH_LEVEL=".2" +TK_MINOR_VERSION=6 +TK_PATCH_LEVEL="a0" VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION #------------------------------------------------------------------------ diff --git a/win/tcl.m4 b/win/tcl.m4 index 833680f..59b51c9 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -20,15 +20,15 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [ AC_MSG_CHECKING([the location of tclConfig.sh]) - if test -d ../../tcl8.5$1/win; then - TCL_BIN_DIR_DEFAULT=../../tcl8.5$1/win - elif test -d ../../tcl8.5/win; then - TCL_BIN_DIR_DEFAULT=../../tcl8.5/win + if test -d ../../tcl8.6$1/win; then + TCL_BIN_DIR_DEFAULT=../../tcl8.6$1/win + elif test -d ../../tcl8.6/win; then + TCL_BIN_DIR_DEFAULT=../../tcl8.6/win else TCL_BIN_DIR_DEFAULT=../../tcl/win fi - AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.5 binaries from DIR], + AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.6 binaries from DIR], TCL_BIN_DIR=$withval, TCL_BIN_DIR=`cd $TCL_BIN_DIR_DEFAULT; pwd`) if test ! -d $TCL_BIN_DIR; then AC_MSG_ERROR(Tcl directory $TCL_BIN_DIR does not exist) @@ -60,15 +60,15 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [ AC_DEFUN([SC_PATH_TKCONFIG], [ AC_MSG_CHECKING([the location of tkConfig.sh]) - if test -d ../../tk8.5$1/win; then - TK_BIN_DIR_DEFAULT=../../tk8.5$1/win - elif test -d ../../tk8.5/win; then - TK_BIN_DIR_DEFAULT=../../tk8.5/win + if test -d ../../tk8.6$1/win; then + TK_BIN_DIR_DEFAULT=../../tk8.6$1/win + elif test -d ../../tk8.6/win; then + TK_BIN_DIR_DEFAULT=../../tk8.6/win else TK_BIN_DIR_DEFAULT=../../tk/win fi - AC_ARG_WITH(tk, [ --with-tk=DIR use Tk 8.5 binaries from DIR], + AC_ARG_WITH(tk, [ --with-tk=DIR use Tk 8.6 binaries from DIR], TK_BIN_DIR=$withval, TK_BIN_DIR=`cd $TK_BIN_DIR_DEFAULT; pwd`) if test ! -d $TK_BIN_DIR; then AC_MSG_ERROR(Tk directory $TK_BIN_DIR does not exist) @@ -796,13 +796,13 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ #------------------------------------------------------------------------ AC_DEFUN([SC_WITH_TCL], [ - if test -d ../../tcl8.5$1/win; then - TCL_BIN_DEFAULT=../../tcl8.5$1/win + if test -d ../../tcl8.6$1/win; then + TCL_BIN_DEFAULT=../../tcl8.6$1/win else - TCL_BIN_DEFAULT=../../tcl8.5/win + TCL_BIN_DEFAULT=../../tcl8.6/win fi - AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.5 binaries from DIR], + AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.6 binaries from DIR], TCL_BIN_DIR=$withval, TCL_BIN_DIR=`cd $TCL_BIN_DEFAULT; pwd`) if test ! -d $TCL_BIN_DIR; then AC_MSG_ERROR(Tcl directory $TCL_BIN_DIR does not exist) -- cgit v0.12 From 4746ce24ce36fe6e90d71d55d4933c3b0d0312da Mon Sep 17 00:00:00 2001 From: das Date: Tue, 1 Apr 2008 21:42:59 +0000 Subject: sync with tcl/unix/tcl.m4 changes --- unix/tcl.m4 | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 6270d24..6b09a17 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1927,6 +1927,24 @@ dnl AC_CHECK_TOOL(AR, ar) ], [AC_MSG_WARN([64bit mode not supported for $arch])])]) ]) + #-------------------------------------------------------------------- + # On Solaris 5.x i386 with the sunpro compiler we need to link + # with sunmath to get floating point rounding control + #-------------------------------------------------------------------- + AS_IF([test "$GCC" = yes],[use_sunmath=no],[ + arch=`isainfo` + AC_MSG_CHECKING([whether to use -lsunmath for fp rounding control]) + AS_IF([test "$arch" = "amd64 i386"], [ + AC_MSG_RESULT([yes]) + MATH_LIBS="-lsunmath $MATH_LIBS" + AC_CHECK_HEADER(sunmath.h) + use_sunmath=yes + ], [ + AC_MSG_RESULT([no]) + use_sunmath=no + ]) + ]) + # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. @@ -1948,11 +1966,12 @@ dnl AC_CHECK_TOOL(AR, ar) #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" ]) ], [ + AS_IF([test "$use_sunmath" = yes], [textmode=textoff],[textmode=text]) case $system in SunOS-5.[[1-9]][[0-9]]*) - SHLIB_LD='${CC} -G -z text ${LDFLAGS}';; + SHLIB_LD="\${CC} -G -z $textmode \${LDFLAGS}";; *) - SHLIB_LD='/usr/ccs/bin/ld -G -z text';; + SHLIB_LD="/usr/ccs/bin/ld -G -z $textmode";; esac CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' -- cgit v0.12 From 75e61094c52d15415001b986ab464880604da592 Mon Sep 17 00:00:00 2001 From: das Date: Tue, 1 Apr 2008 21:43:42 +0000 Subject: autoconf-2.59 --- unix/configure | 191 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 183 insertions(+), 8 deletions(-) diff --git a/unix/configure b/unix/configure index feee89d..08f5241 100755 --- a/unix/configure +++ b/unix/configure @@ -6638,6 +6638,175 @@ fi fi + #-------------------------------------------------------------------- + # On Solaris 5.x i386 with the sunpro compiler we need to link + # with sunmath to get floating point rounding control + #-------------------------------------------------------------------- + if test "$GCC" = yes; then + use_sunmath=no +else + + arch=`isainfo` + echo "$as_me:$LINENO: checking whether to use -lsunmath for fp rounding control" >&5 +echo $ECHO_N "checking whether to use -lsunmath for fp rounding control... $ECHO_C" >&6 + if test "$arch" = "amd64 i386"; then + + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + MATH_LIBS="-lsunmath $MATH_LIBS" + if test "${ac_cv_header_sunmath_h+set}" = set; then + echo "$as_me:$LINENO: checking for sunmath.h" >&5 +echo $ECHO_N "checking for sunmath.h... $ECHO_C" >&6 +if test "${ac_cv_header_sunmath_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_sunmath_h" >&5 +echo "${ECHO_T}$ac_cv_header_sunmath_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking sunmath.h usability" >&5 +echo $ECHO_N "checking sunmath.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking sunmath.h presence" >&5 +echo $ECHO_N "checking sunmath.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: sunmath.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: sunmath.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: sunmath.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: sunmath.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: sunmath.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: sunmath.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: sunmath.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: sunmath.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: sunmath.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: sunmath.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: sunmath.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: sunmath.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: sunmath.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: sunmath.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: sunmath.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: sunmath.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ----------------------------- ## +## Report this to the tk lists. ## +## ----------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for sunmath.h" >&5 +echo $ECHO_N "checking for sunmath.h... $ECHO_C" >&6 +if test "${ac_cv_header_sunmath_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_sunmath_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_sunmath_h" >&5 +echo "${ECHO_T}$ac_cv_header_sunmath_h" >&6 + +fi + + + use_sunmath=yes + +else + + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + use_sunmath=no + +fi + + +fi + + # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. @@ -6665,11 +6834,17 @@ fi else + if test "$use_sunmath" = yes; then + textmode=textoff +else + textmode=text +fi + case $system in SunOS-5.[1-9][0-9]*) - SHLIB_LD='${CC} -G -z text ${LDFLAGS}';; + SHLIB_LD="\${CC} -G -z $textmode \${LDFLAGS}";; *) - SHLIB_LD='/usr/ccs/bin/ld -G -z text';; + SHLIB_LD="/usr/ccs/bin/ld -G -z $textmode";; esac CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' @@ -9388,7 +9563,7 @@ ac_x_header_dirs=' /usr/openwin/share/include' if test "$ac_x_includes" = no; then - # Guess where to find include files, by looking for Xlib.h. + # Guess where to find include files, by looking for Intrinsic.h. # First, try using that file with no special directory specified. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -9396,7 +9571,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 @@ -9423,7 +9598,7 @@ else sed 's/^/| /' conftest.$ac_ext >&5 for ac_dir in $ac_x_header_dirs; do - if test -r "$ac_dir/X11/Xlib.h"; then + if test -r "$ac_dir/X11/Intrinsic.h"; then ac_x_includes=$ac_dir break fi @@ -9437,18 +9612,18 @@ if test "$ac_x_libraries" = no; then # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS - LIBS="-lX11 $LIBS" + LIBS="-lXt $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include int main () { -XrmInitialize () +XtMalloc (0) ; return 0; } -- cgit v0.12 From a7fb3ccca3786f584d415e800a6ef4904d4d3ba9 Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 2 Apr 2008 03:55:38 +0000 Subject: * generic/tkWindow.c: Revised package initialization so that * unix/Makefile.in: "tkStubsPtr" is not present in libtk.so, but is present only in libtkstub.a. This tightens up the rules for users of the stubs interfaces. [Tcl Bug 1819422]. --- ChangeLog | 8 +++++--- generic/tkStubLib.c | 7 ++++++- generic/tkWindow.c | 8 +------- unix/Makefile.in | 6 +++--- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 47e1053..932f1d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2008-04-01 Don Porter + * generic/tkWindow.c: Revised package initialization so that + * unix/Makefile.in: "tkStubsPtr" is not present in libtk.so, but + is present only in libtkstub.a. This tightens up the rules for users + of the stubs interfaces. [Tcl Bug 1819422]. + * README: Bump version number to 8.6a0 * generic/tk.h: * library/tk.tcl: @@ -17,9 +22,6 @@ * generic/tkMain.c: might [load] into a Tcl 8.5 interp. * generic/tkWindow.c: - * generic/tkStubLib.c: Update to compatibility with a libtcl.so - that contains no "tclStubsPtr" [Tcl Bug 1819422]. - * generic/tkDecls.h: make genstubs * generic/tkIntDecls.h: * generic/tkIntPlatDecls.h: diff --git a/generic/tkStubLib.c b/generic/tkStubLib.c index e54c3ef..e38d63d 100644 --- a/generic/tkStubLib.c +++ b/generic/tkStubLib.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkStubLib.c,v 1.21 2008/04/01 16:30:54 dgp Exp $ + * RCS: @(#) $Id: tkStubLib.c,v 1.22 2008/04/02 03:55:39 dgp Exp $ */ /* @@ -20,6 +20,11 @@ * including the rest of the stub functions. */ +#ifndef USE_TCL_STUBS +#define USE_TCL_STUBS +#endif +#undef USE_TCL_STUB_PROCS + #ifndef USE_TK_STUBS #define USE_TK_STUBS #endif diff --git a/generic/tkWindow.c b/generic/tkWindow.c index 4063819..9be8885 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWindow.c,v 1.90 2008/04/01 16:30:54 dgp Exp $ + * RCS: @(#) $Id: tkWindow.c,v 1.91 2008/04/02 03:55:39 dgp Exp $ */ #include "tkInt.h" @@ -3205,12 +3205,6 @@ Initialize( Tcl_SetMainLoop(Tk_MainLoop); -#ifdef Tk_InitStubs -#undef Tk_InitStubs -#endif - - Tk_InitStubs(interp, TK_VERSION, 1); - /* * Initialized the themed widget set */ diff --git a/unix/Makefile.in b/unix/Makefile.in index 96df504..ee34dec 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -5,7 +5,7 @@ # "autoconf" program (constructs like "@foo@" will get replaced in the # actual Makefile. # -# RCS: @(#) $Id: Makefile.in,v 1.143 2008/03/21 21:49:12 jenglish Exp $ +# RCS: @(#) $Id: Makefile.in,v 1.144 2008/04/02 03:55:39 dgp Exp $ # Current Tk version; used in various names. @@ -372,7 +372,7 @@ TTK_OBJS = \ ttkTagSet.o ttkTheme.o ttkTrace.o ttkTrack.o ttkTreeview.o \ ttkWidget.o ttkStubInit.o -STUB_OBJS = tkStubInit.o tkStubLib.o +STUB_OBJS = tkStubInit.o STUB_LIB_OBJS = tkStubLib.o ttkStubLib.o @@ -446,7 +446,7 @@ GENERIC_SRCS = \ $(GENERIC_DIR)/tkTextTag.c $(GENERIC_DIR)/tkTextWind.c \ $(GENERIC_DIR)/tkOldConfig.c $(GENERIC_DIR)/tkOldTest.c \ $(GENERIC_DIR)/tkSquare.c $(GENERIC_DIR)/tkTest.c \ - $(GENERIC_DIR)/tkStubInit.c $(GENERIC_DIR)/tkStubLib.c + $(GENERIC_DIR)/tkStubInit.c TTK_SRCS = \ $(TTK_DIR)/ttkBlink.c \ -- cgit v0.12 From da81f8f0edc0e5d70e7e76ed8804a86b77f5aca0 Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 2 Apr 2008 04:06:38 +0000 Subject: typo --- generic/tkStubLib.c | 15 +++------------ generic/tkWindow.c | 4 +++- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/generic/tkStubLib.c b/generic/tkStubLib.c index e38d63d..45fc9ef 100644 --- a/generic/tkStubLib.c +++ b/generic/tkStubLib.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkStubLib.c,v 1.22 2008/04/02 03:55:39 dgp Exp $ + * RCS: @(#) $Id: tkStubLib.c,v 1.23 2008/04/02 04:06:38 dgp Exp $ */ /* @@ -20,15 +20,8 @@ * including the rest of the stub functions. */ -#ifndef USE_TCL_STUBS #define USE_TCL_STUBS -#endif -#undef USE_TCL_STUB_PROCS - -#ifndef USE_TK_STUBS #define USE_TK_STUBS -#endif -#undef USE_TK_STUB_PROCS #include "tkInt.h" @@ -81,10 +74,6 @@ static int isDigit(const int c) *---------------------------------------------------------------------- */ -#ifdef Tk_InitStubs -#undef Tk_InitStubs -#endif - CONST char * Tk_InitStubs( Tcl_Interp *interp, @@ -114,6 +103,8 @@ Tk_InitStubs( p++; q++; } if (*p) { + /* Construct error message */ + Tcl_PkgRequireEx(interp, "Tk", version, 1, NULL); return NULL; } } else { diff --git a/generic/tkWindow.c b/generic/tkWindow.c index 9be8885..b021f49 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWindow.c,v 1.91 2008/04/02 03:55:39 dgp Exp $ + * RCS: @(#) $Id: tkWindow.c,v 1.92 2008/04/02 04:06:38 dgp Exp $ */ #include "tkInt.h" @@ -3302,6 +3302,8 @@ Tk_PkgInitStubsCheck( } if (count == 1) { if (0 != strncmp(version, actualVersion, strlen(version))) { + /* Construct error message */ + Tcl_PkgPresent(interp, "Tk", version, 1); return NULL; } } else { -- cgit v0.12 From 88057339325da657e84cc9218b7bcb673338902c Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 2 Apr 2008 04:08:43 +0000 Subject: * generic/tkStubLib.c (Tk_InitStubs): Added missing error message and * generic/tkWindow.c (Tk_PkgInitStubsCheck): removed needless $ifdef complexity. --- ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index 932f1d9..1899931 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2008-04-01 Don Porter + * generic/tkStubLib.c (Tk_InitStubs): Added missing error message and + * generic/tkWindow.c (Tk_PkgInitStubsCheck): removed needless $ifdef + complexity. + * generic/tkWindow.c: Revised package initialization so that * unix/Makefile.in: "tkStubsPtr" is not present in libtk.so, but is present only in libtkstub.a. This tightens up the rules for users -- cgit v0.12 From 3049ef70d8cbcbb5385fd71872c3b74dd3808680 Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 2 Apr 2008 04:30:40 +0000 Subject: * generic/tkWindow.c: Revised package initialization so that * unix/Makefile.in: "tkStubsPtr" is not present in libtk.so, but * win/Makefile.in: is present only in libtkstub.a. This tightens * win/makefile.bc: up the rules for users of the stubs interfaces. * win/makefile.vc: [Tcl Bug 1819422]. --- ChangeLog | 5 +++-- win/Makefile.in | 3 +-- win/makefile.bc | 3 +-- win/makefile.vc | 3 +-- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1899931..e513ce0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,8 +6,9 @@ * generic/tkWindow.c: Revised package initialization so that * unix/Makefile.in: "tkStubsPtr" is not present in libtk.so, but - is present only in libtkstub.a. This tightens up the rules for users - of the stubs interfaces. [Tcl Bug 1819422]. + * win/Makefile.in: is present only in libtkstub.a. This tightens + * win/makefile.bc: up the rules for users of the stubs interfaces. + * win/makefile.vc: [Tcl Bug 1819422]. * README: Bump version number to 8.6a0 * generic/tk.h: diff --git a/win/Makefile.in b/win/Makefile.in index 42c1312..96343c3 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -4,7 +4,7 @@ # "autoconf" program (constructs like "@foo@" will get replaced in the # actual Makefile. # -# RCS: @(#) $Id: Makefile.in,v 1.78 2008/03/18 06:59:04 jenglish Exp $ +# RCS: @(#) $Id: Makefile.in,v 1.79 2008/04/02 04:30:42 dgp Exp $ TCLVERSION = @TCL_VERSION@ TCLPATCHL = @TCL_PATCH_LEVEL@ @@ -348,7 +348,6 @@ TK_OBJS = \ tkUtil.$(OBJEXT) \ tkVisual.$(OBJEXT) \ tkStubInit.$(OBJEXT) \ - tkStubLib.$(OBJEXT) \ tkWindow.$(OBJEXT) \ $(TTK_OBJS) diff --git a/win/makefile.bc b/win/makefile.bc index 2454156..3575582 100644 --- a/win/makefile.bc +++ b/win/makefile.bc @@ -13,7 +13,7 @@ # Copyright (c) 1995-1997 Sun Microsystems, Inc. # Copyright (c) 1998-2000 Ajuba Solutions. # -# RCS: @(#) $Id: makefile.bc,v 1.14 2007/05/14 20:58:31 dgp Exp $ +# RCS: @(#) $Id: makefile.bc,v 1.15 2008/04/02 04:30:44 dgp Exp $ # Does not depend on the presence of any environment variables in # order to compile tcl; all needed information is derived from @@ -227,7 +227,6 @@ TKOBJS = \ $(TMPDIR)\tkUtil.obj \ $(TMPDIR)\tkVisual.obj \ $(TMPDIR)\tkStubInit.obj \ - $(TMPDIR)\tkStubLib.obj \ $(TMPDIR)\tkWindow.obj # Maintenance hint: Please have multiple members of TKSTUBOBJS be separated diff --git a/win/makefile.vc b/win/makefile.vc index 9690013..f85bd02 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -12,7 +12,7 @@ # Copyright (c) 2001-2004 David Gravereaux. # #------------------------------------------------------------------------------ -# RCS: @(#) $Id: makefile.vc,v 1.117 2008/03/18 06:59:04 jenglish Exp $ +# RCS: @(#) $Id: makefile.vc,v 1.118 2008/04/02 04:30:44 dgp Exp $ #------------------------------------------------------------------------------ # Check to see we are configured to build with MSVC (MSDEVDIR or MSVCDIR) @@ -353,7 +353,6 @@ TKOBJS = \ $(TMP_DIR)\tkUtil.obj \ $(TMP_DIR)\tkVisual.obj \ $(TMP_DIR)\tkStubInit.obj \ - $(TMP_DIR)\tkStubLib.obj \ $(TMP_DIR)\tkWindow.obj \ $(TTK_OBJS) \ !if !$(STATIC_BUILD) -- cgit v0.12 From b6df8edd277a05f344f63aa110f3fafd5e2171dc Mon Sep 17 00:00:00 2001 From: patthoyts Date: Wed, 2 Apr 2008 14:39:36 +0000 Subject: Tweak the debug targets --- win/makefile.vc | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/win/makefile.vc b/win/makefile.vc index f85bd02..c27beff 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -12,7 +12,7 @@ # Copyright (c) 2001-2004 David Gravereaux. # #------------------------------------------------------------------------------ -# RCS: @(#) $Id: makefile.vc,v 1.118 2008/04/02 04:30:44 dgp Exp $ +# RCS: @(#) $Id: makefile.vc,v 1.119 2008/04/02 14:39:36 patthoyts Exp $ #------------------------------------------------------------------------------ # Check to see we are configured to build with MSVC (MSDEVDIR or MSVCDIR) @@ -543,9 +543,9 @@ test-classic: setup $(TKTEST) $(TKLIB) $(CAT32) @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) !endif !if "$(OS)" == "Windows_NT" || "$(MSVCDIR)" == "IDE" - $(TKTEST) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) | $(CAT32) + $(DEBUGGER) $(TKTEST) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) | $(CAT32) !else - $(TKTEST) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) | $(CAT32) + $(DEBUGGER) $(TKTEST) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) | $(CAT32) !endif test-ttk: setup $(TKTEST) $(TKLIB) $(CAT32) @@ -558,9 +558,9 @@ test-ttk: setup $(TKTEST) $(TKLIB) $(CAT32) @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) !endif !if "$(OS)" == "Windows_NT" || "$(MSVCDIR)" == "IDE" - $(TKTEST) "$(ROOT)/tests/ttk/all.tcl" $(TESTFLAGS) | $(CAT32) + $(DEBUGGER) $(TKTEST) "$(ROOT)/tests/ttk/all.tcl" $(TESTFLAGS) | $(CAT32) !else - $(TKTEST) "$(ROOT)/tests/ttk/all.tcl" $(TESTFLAGS) | $(CAT32) + $(DEBUGGER) $(TKTEST) "$(ROOT)/tests/ttk/all.tcl" $(TESTFLAGS) | $(CAT32) !endif runtest: setup $(TKTEST) $(TKLIB) $(CAT32) @@ -572,7 +572,7 @@ runtest: setup $(TKTEST) $(TKLIB) $(CAT32) !else @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) !endif - $(TKTEST) + $(DEBUGGER) $(TKTEST) rundemo: setup $(TKTEST) $(TKLIB) $(CAT32) @set TCL_LIBRARY=$(TCL_LIBRARY:\=/) @@ -594,21 +594,10 @@ shell: setup $(WISH) !else @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) !endif - $(WISH) << + $(DEBUGGER) $(WISH) << console show << -dbgshell: setup $(WISH) - @set TCL_LIBRARY=$(TCL_LIBRARY:\=/) - @set TK_LIBRARY=$(TK_LIBRARY:\=/) - @set TCLLIBPATH= -!if $(TCLINSTALL) - @set PATH=$(_TCLDIR)\bin;$(PATH) -!else - @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) -!endif - windbg $(WISH) - setup: @if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR) @if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR) -- cgit v0.12 From 3657c9cadc9e99c4a708db858e60ee5f87c68df1 Mon Sep 17 00:00:00 2001 From: das Date: Wed, 2 Apr 2008 21:31:17 +0000 Subject: * generic/tk.decls: remove 'export' declarations of symbols now only in libtkstub and no longer in libtk. --- generic/tk.decls | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/generic/tk.decls b/generic/tk.decls index 4c7d675..9ff3c87 100644 --- a/generic/tk.decls +++ b/generic/tk.decls @@ -11,7 +11,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: tk.decls,v 1.38 2008/03/27 12:03:33 das Exp $ +# RCS: @(#) $Id: tk.decls,v 1.39 2008/04/02 21:31:17 das Exp $ library tk @@ -1154,28 +1154,6 @@ declare 10 aqua { # Public functions that are not accessible via the stubs table. export { - CONST char *Tk_InitStubs(Tcl_Interp *interp, CONST char *version, - int exact) -} -export { CONST char *Tk_PkgInitStubsCheck(Tcl_Interp *interp, CONST char *version, int exact) } - -# Global variables that need to be exported from the tcl shared library. - -export { - TkStubs *tkStubsPtr (fool checkstubs) -} -export { - TkPlatStubs *tkPlatStubsPtr (fool checkstubs) -} -export { - TkIntStubs *tkIntStubsPtr (fool checkstubs) -} -export { - TkIntPlatStubs *tkIntPlatStubsPtr (fool checkstubs) -} -export { - TkIntXlibStubs *tkIntXlibStubsPtr (fool checkstubs) -} -- cgit v0.12 From d80afd9403e34db5407b5d005f40f1b69aae8267 Mon Sep 17 00:00:00 2001 From: das Date: Wed, 2 Apr 2008 21:31:58 +0000 Subject: * generic/tkStubLib.c: make symbols in libtkstub.a MODULE_SCOPE to avoid exporting them from libraries that link with -ltkstub; constify tk*StubsPtr and stub table hook pointers. [Bug 1819422] * generic/tkStubLib.c: undef USE_TCL_STUBS before defining it * generic/ttk/ttkStubLib.c: unconditionally; remove needless #ifdef --- ChangeLog | 27 ++++++++++++++++++++++++++- generic/tkStubLib.c | 24 ++++++++++++++++-------- generic/ttk/ttkStubLib.c | 6 ++---- 3 files changed, 44 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index e513ce0..e3edfc1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,32 @@ +2008-04-02 Daniel Steffen + + * generic/tk.decls: remove 'export' declarations of symbols now + only in libtkstub and no longer in libtk. + + * generic/tkStubLib.c: make symbols in libtkstub.a MODULE_SCOPE to + avoid exporting them from libraries that link + with -ltkstub; constify tk*StubsPtr and stub + table hook pointers. [Bug 1819422] + + * generic/tkStubLib.c: undef USE_TCL_STUBS before defining it + * generic/ttk/ttkStubLib.c: unconditionally; remove needless #ifdef + + * generic/tkDecls.h: make genstubs + * generic/tkIntDecls.h: + * generic/tkIntPlatDecls.h: + * generic/tkIntXlibDecls.h: + * generic/tkPlatDecls.h: + * generic/tkStubInit.c: + + * unix/configure.in (Darwin): remove now unnecessary unexporting + of libtclstub symbols from libtk. + + * unix/configure: autoconf-2.59 + 2008-04-01 Don Porter * generic/tkStubLib.c (Tk_InitStubs): Added missing error message and - * generic/tkWindow.c (Tk_PkgInitStubsCheck): removed needless $ifdef + * generic/tkWindow.c (Tk_PkgInitStubsCheck): removed needless #ifdef complexity. * generic/tkWindow.c: Revised package initialization so that diff --git a/generic/tkStubLib.c b/generic/tkStubLib.c index 45fc9ef..ddfd986 100644 --- a/generic/tkStubLib.c +++ b/generic/tkStubLib.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkStubLib.c,v 1.23 2008/04/02 04:06:38 dgp Exp $ + * RCS: @(#) $Id: tkStubLib.c,v 1.24 2008/04/02 21:31:58 das Exp $ */ /* @@ -20,7 +20,9 @@ * including the rest of the stub functions. */ +#undef USE_TCL_STUBS #define USE_TCL_STUBS + #define USE_TK_STUBS #include "tkInt.h" @@ -41,11 +43,17 @@ #include "tkPlatDecls.h" #include "tkIntXlibDecls.h" -TkStubs *tkStubsPtr = NULL; -TkPlatStubs *tkPlatStubsPtr = NULL; -TkIntStubs *tkIntStubsPtr = NULL; -TkIntPlatStubs *tkIntPlatStubsPtr = NULL; -TkIntXlibStubs *tkIntXlibStubsPtr = NULL; +MODULE_SCOPE const TkStubs *tkStubsPtr; +MODULE_SCOPE const TkPlatStubs *tkPlatStubsPtr; +MODULE_SCOPE const TkIntStubs *tkIntStubsPtr; +MODULE_SCOPE const TkIntPlatStubs *tkIntPlatStubsPtr; +MODULE_SCOPE const TkIntXlibStubs *tkIntXlibStubsPtr; + +const TkStubs *tkStubsPtr = NULL; +const TkPlatStubs *tkPlatStubsPtr = NULL; +const TkIntStubs *tkIntStubsPtr = NULL; +const TkIntPlatStubs *tkIntPlatStubsPtr = NULL; +const TkIntXlibStubs *tkIntXlibStubsPtr = NULL; /* * Use our own isdigit to avoid linking to libc on windows @@ -74,14 +82,14 @@ static int isDigit(const int c) *---------------------------------------------------------------------- */ -CONST char * +MODULE_SCOPE CONST char * Tk_InitStubs( Tcl_Interp *interp, CONST char *version, int exact) { CONST char *actualVersion; - TkStubs **stubsPtrPtr = &tkStubsPtr; /* squelch warning */ + const TkStubs **stubsPtrPtr = &tkStubsPtr; /* squelch warning */ actualVersion = Tcl_PkgRequireEx(interp, "Tk", version, 0, (ClientData *) stubsPtrPtr); diff --git a/generic/ttk/ttkStubLib.c b/generic/ttk/ttkStubLib.c index 15d4d28..5087a18 100644 --- a/generic/ttk/ttkStubLib.c +++ b/generic/ttk/ttkStubLib.c @@ -1,5 +1,5 @@ /* - * $Id: ttkStubLib.c,v 1.5 2008/03/27 12:04:02 das Exp $ + * $Id: ttkStubLib.c,v 1.6 2008/04/02 21:31:58 das Exp $ * SOURCE: tk/generic/tkStubLib.c, version 1.9 2004/03/17 */ @@ -8,10 +8,8 @@ * contains no references to any of the tcl stub functions. */ -#ifndef USE_TCL_STUBS +#undef USE_TCL_STUBS #define USE_TCL_STUBS -#endif -#undef USE_TCL_STUB_PROCS #include "tk.h" -- cgit v0.12 From b6aa2d67518ad50fdd96a64bd175d9ab6d8cbf02 Mon Sep 17 00:00:00 2001 From: das Date: Wed, 2 Apr 2008 21:32:32 +0000 Subject: * generic/tkDecls.h: make genstubs * generic/tkIntDecls.h: * generic/tkIntPlatDecls.h: * generic/tkIntXlibDecls.h: * generic/tkPlatDecls.h: * generic/tkStubInit.c: --- generic/tkDecls.h | 22 +++++++--------------- generic/tkInt.h | 4 ++-- generic/tkIntDecls.h | 14 +++----------- generic/tkIntPlatDecls.h | 14 +++----------- generic/tkIntXlibDecls.h | 14 +++----------- generic/tkPlatDecls.h | 14 +++----------- generic/tkStubInit.c | 4 ++-- 7 files changed, 23 insertions(+), 63 deletions(-) diff --git a/generic/tkDecls.h b/generic/tkDecls.h index b0dca8b..c0e0ac5 100644 --- a/generic/tkDecls.h +++ b/generic/tkDecls.h @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkDecls.h,v 1.31 2008/04/01 16:30:53 dgp Exp $ + * RCS: @(#) $Id: tkDecls.h,v 1.32 2008/04/02 21:32:32 das Exp $ */ #ifndef _TKDECLS @@ -1696,15 +1696,15 @@ EXTERN void Tk_CreateOldPhotoImageFormat ( #endif typedef struct TkStubHooks { - struct TkPlatStubs *tkPlatStubs; - struct TkIntStubs *tkIntStubs; - struct TkIntPlatStubs *tkIntPlatStubs; - struct TkIntXlibStubs *tkIntXlibStubs; + CONST struct TkPlatStubs *tkPlatStubs; + CONST struct TkIntStubs *tkIntStubs; + CONST struct TkIntPlatStubs *tkIntPlatStubs; + CONST struct TkIntXlibStubs *tkIntXlibStubs; } TkStubHooks; typedef struct TkStubs { int magic; - struct TkStubHooks *hooks; + CONST struct TkStubHooks *hooks; void (*tk_MainLoop) (void); /* 0 */ XColor * (*tk_3DBorderColor) (Tk_3DBorder border); /* 1 */ @@ -1983,15 +1983,7 @@ typedef struct TkStubs { } TkStubs; #if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) - -#ifdef __cplusplus -extern "C" { -#endif -extern TkStubs *tkStubsPtr; -#ifdef __cplusplus -} -#endif - +EXTERN CONST TkStubs *tkStubsPtr; #endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */ #if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) diff --git a/generic/tkInt.h b/generic/tkInt.h index 7ae4bee..039d28e 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: $Id: tkInt.h,v 1.82 2008/03/26 19:04:09 jenglish Exp $ + * RCS: $Id: tkInt.h,v 1.83 2008/04/02 21:32:32 das Exp $ */ #ifndef _TKINT @@ -43,7 +43,7 @@ # ifdef BIG_ENDIAN # if BYTE_ORDER == BIG_ENDIAN # undef WORDS_BIGENDIAN -# define WORDS_BIGENDIAN +# define WORDS_BIGENDIAN 1 # endif # endif # ifdef LITTLE_ENDIAN diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h index 5729545..3dc3cbf 100644 --- a/generic/tkIntDecls.h +++ b/generic/tkIntDecls.h @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkIntDecls.h,v 1.32 2008/04/01 16:30:53 dgp Exp $ + * RCS: @(#) $Id: tkIntDecls.h,v 1.33 2008/04/02 21:32:32 das Exp $ */ #ifndef _TKINTDECLS @@ -961,7 +961,7 @@ EXTERN int TkpTesttextCmd (ClientData dummy, typedef struct TkIntStubs { int magic; - struct TkIntStubHooks *hooks; + CONST struct TkIntStubHooks *hooks; TkWindow * (*tkAllocWindow) (TkDisplay * dispPtr, int screenNum, TkWindow * parentPtr); /* 0 */ void (*tkBezierPoints) (double control[], int numSteps, double * coordPtr); /* 1 */ @@ -1223,15 +1223,7 @@ typedef struct TkIntStubs { } TkIntStubs; #if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) - -#ifdef __cplusplus -extern "C" { -#endif -extern TkIntStubs *tkIntStubsPtr; -#ifdef __cplusplus -} -#endif - +EXTERN CONST TkIntStubs *tkIntStubsPtr; #endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */ #if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index 95881cd..84720fa 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -9,7 +9,7 @@ * Copyright (c) 1998-1999 by Scriptics Corporation. * All rights reserved. * - * RCS: @(#) $Id: tkIntPlatDecls.h,v 1.30 2008/04/01 16:30:53 dgp Exp $ + * RCS: @(#) $Id: tkIntPlatDecls.h,v 1.31 2008/04/02 21:32:32 das Exp $ */ #ifndef _TKINTPLATDECLS @@ -556,7 +556,7 @@ EXTERN int TkpTestsendCmd (ClientData clientData, typedef struct TkIntPlatStubs { int magic; - struct TkIntPlatStubHooks *hooks; + CONST struct TkIntPlatStubHooks *hooks; #ifdef __WIN32__ /* WIN */ char * (*tkAlignImageData) (XImage * image, int alignment, int bitOrder); /* 0 */ @@ -671,15 +671,7 @@ typedef struct TkIntPlatStubs { } TkIntPlatStubs; #if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) - -#ifdef __cplusplus -extern "C" { -#endif -extern TkIntPlatStubs *tkIntPlatStubsPtr; -#ifdef __cplusplus -} -#endif - +EXTERN CONST TkIntPlatStubs *tkIntPlatStubsPtr; #endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */ #if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h index 759f162..2dae5b6 100644 --- a/generic/tkIntXlibDecls.h +++ b/generic/tkIntXlibDecls.h @@ -9,7 +9,7 @@ * Copyright (c) 1998-1999 by Scriptics Corporation. * All rights reserved. * - * RCS: @(#) $Id: tkIntXlibDecls.h,v 1.24 2008/04/01 16:30:53 dgp Exp $ + * RCS: @(#) $Id: tkIntXlibDecls.h,v 1.25 2008/04/02 21:32:32 das Exp $ */ #ifndef _TKINTXLIBDECLS @@ -1212,7 +1212,7 @@ EXTERN int XSync (Display * display, Bool flag); typedef struct TkIntXlibStubs { int magic; - struct TkIntXlibStubHooks *hooks; + CONST struct TkIntXlibStubHooks *hooks; #ifdef __WIN32__ /* WIN */ void (*xSetDashes) (Display * display, GC gc, int dash_offset, _Xconst char * dash_list, int n); /* 0 */ @@ -1420,15 +1420,7 @@ typedef struct TkIntXlibStubs { } TkIntXlibStubs; #if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) - -#ifdef __cplusplus -extern "C" { -#endif -extern TkIntXlibStubs *tkIntXlibStubsPtr; -#ifdef __cplusplus -} -#endif - +EXTERN CONST TkIntXlibStubs *tkIntXlibStubsPtr; #endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */ #if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) diff --git a/generic/tkPlatDecls.h b/generic/tkPlatDecls.h index 8502923..d1219cc 100644 --- a/generic/tkPlatDecls.h +++ b/generic/tkPlatDecls.h @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkPlatDecls.h,v 1.16 2008/04/01 16:30:54 dgp Exp $ + * RCS: @(#) $Id: tkPlatDecls.h,v 1.17 2008/04/02 21:32:33 das Exp $ */ #ifndef _TKPLATDECLS @@ -131,7 +131,7 @@ EXTERN int Tk_MacOSXIsAppInFront (void); typedef struct TkPlatStubs { int magic; - struct TkPlatStubHooks *hooks; + CONST struct TkPlatStubHooks *hooks; #ifdef __WIN32__ /* WIN */ Window (*tk_AttachHWND) (Tk_Window tkwin, HWND hwnd); /* 0 */ @@ -157,15 +157,7 @@ typedef struct TkPlatStubs { } TkPlatStubs; #if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) - -#ifdef __cplusplus -extern "C" { -#endif -extern TkPlatStubs *tkPlatStubsPtr; -#ifdef __cplusplus -} -#endif - +EXTERN CONST TkPlatStubs *tkPlatStubsPtr; #endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */ #if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index 5480540..ef40e30 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkStubInit.c,v 1.60 2007/12/13 15:24:16 dgp Exp $ + * RCS: @(#) $Id: tkStubInit.c,v 1.61 2008/04/02 21:32:33 das Exp $ */ #include "tkInt.h" @@ -666,7 +666,7 @@ TkPlatStubs tkPlatStubs = { #endif /* AQUA */ }; -static TkStubHooks tkStubHooks = { +static const TkStubHooks tkStubHooks = { &tkPlatStubs, &tkIntStubs, &tkIntPlatStubs, -- cgit v0.12 From b24f5ab3603d85f3e4e4f42b4ba2ac03726374ef Mon Sep 17 00:00:00 2001 From: das Date: Wed, 2 Apr 2008 21:32:56 +0000 Subject: * unix/configure.in (Darwin): remove now unnecessary unexporting of libtclstub symbols from libtk. --- unix/configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unix/configure.in b/unix/configure.in index 05b4cdb..914ee08 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -3,7 +3,7 @@ dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tk installation dnl to configure the system for the local environment. # -# RCS: @(#) $Id: configure.in,v 1.154 2008/04/01 16:30:55 dgp Exp $ +# RCS: @(#) $Id: configure.in,v 1.155 2008/04/02 21:32:56 das Exp $ AC_INIT([tk],[8.6]) AC_PREREQ(2.59) @@ -567,7 +567,7 @@ WISH_RSRC_FILE='wish$(VERSION).rsrc' if test "`uname -s`" = "Darwin" ; then SC_ENABLE_FRAMEWORK TK_SHLIB_LD_EXTRAS="-compatibility_version ${TK_VERSION} -current_version ${TK_VERSION}`echo ${TK_PATCH_LEVEL} | awk ['{match($0, "\\\.[0-9]+"); print substr($0,RSTART,RLENGTH)}']`" - TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -install_name "${DYLIB_INSTALL_DIR}"/${TK_LIB_FILE} -unexported_symbols_list $$(f=$(TCL_STUB_LIB_FILE).E && nm -gjp "$(TCL_BIN_DIR)"/$(TCL_STUB_LIB_FILE) | grep ^_[[^_]] > $$f && echo $$f)' + TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -install_name "${DYLIB_INSTALL_DIR}"/${TK_LIB_FILE}' echo "$LDFLAGS " | grep -q -- '-prebind ' && TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -seg1addr 0xb000000' TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -sectcreate __TEXT __info_plist Tk-Info.plist' EXTRA_WISH_LIBS='-sectcreate __TEXT __info_plist Wish-Info.plist' -- cgit v0.12 From c4a0c966c004ed51ba97d37abb3b5e2387e8dc9a Mon Sep 17 00:00:00 2001 From: das Date: Wed, 2 Apr 2008 21:33:20 +0000 Subject: * unix/configure: autoconf-2.59 --- unix/configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix/configure b/unix/configure index 08f5241..77c6f4d 100755 --- a/unix/configure +++ b/unix/configure @@ -10764,7 +10764,7 @@ echo "${ECHO_T}static library" >&6 fi TK_SHLIB_LD_EXTRAS="-compatibility_version ${TK_VERSION} -current_version ${TK_VERSION}`echo ${TK_PATCH_LEVEL} | awk '{match($0, "\\\.[0-9]+"); print substr($0,RSTART,RLENGTH)}'`" - TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -install_name "${DYLIB_INSTALL_DIR}"/${TK_LIB_FILE} -unexported_symbols_list $$(f=$(TCL_STUB_LIB_FILE).E && nm -gjp "$(TCL_BIN_DIR)"/$(TCL_STUB_LIB_FILE) | grep ^_[^_] > $$f && echo $$f)' + TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -install_name "${DYLIB_INSTALL_DIR}"/${TK_LIB_FILE}' echo "$LDFLAGS " | grep -q -- '-prebind ' && TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -seg1addr 0xb000000' TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -sectcreate __TEXT __info_plist Tk-Info.plist' EXTRA_WISH_LIBS='-sectcreate __TEXT __info_plist Wish-Info.plist' -- cgit v0.12 From 24fefa78acd936fd521c2a354142716dd494a284 Mon Sep 17 00:00:00 2001 From: patthoyts Date: Thu, 3 Apr 2008 11:52:42 +0000 Subject: Fix the foreground colour for labelframe in xp --- ChangeLog | 4 ++++ library/ttk/xpTheme.tcl | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e3edfc1..47892e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-04-03 Pat Thoyts + + * library/ttk/xpTheme.tcl: fix the colour of labelframe in xp + 2008-04-02 Daniel Steffen * generic/tk.decls: remove 'export' declarations of symbols now diff --git a/library/ttk/xpTheme.tcl b/library/ttk/xpTheme.tcl index 14d8ae8..a82315b 100644 --- a/library/ttk/xpTheme.tcl +++ b/library/ttk/xpTheme.tcl @@ -1,5 +1,5 @@ # -# $Id: xpTheme.tcl,v 1.6 2007/12/13 15:27:08 dgp Exp $ +# $Id: xpTheme.tcl,v 1.7 2008/04/03 11:52:42 patthoyts Exp $ # # Settings for 'xpnative' theme # @@ -43,7 +43,7 @@ namespace eval ttk::theme::xpnative { -background [list selected SystemHighlight] \ -foreground [list selected SystemHighlightText] ; - ttk::style configure TLabelframe -foreground "#0046d5" + ttk::style configure TLabelframe.Label -foreground "#0046d5" # OR: -padding {3 3 3 6}, which some apps seem to use. ttk::style configure TEntry -padding {2 2 2 4} -- cgit v0.12 From 4aaeef4ab3e62901320ee961372c34e4527092e7 Mon Sep 17 00:00:00 2001 From: patthoyts Date: Thu, 3 Apr 2008 17:04:54 +0000 Subject: Fixed stubs usage --- ChangeLog | 1 + win/makefile.vc | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 47892e5..6e687bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 2008-04-03 Pat Thoyts + * win/makefile.vc: Fixed stubs usage * library/ttk/xpTheme.tcl: fix the colour of labelframe in xp 2008-04-02 Daniel Steffen diff --git a/win/makefile.vc b/win/makefile.vc index c27beff..079ae3b 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -12,7 +12,7 @@ # Copyright (c) 2001-2004 David Gravereaux. # #------------------------------------------------------------------------------ -# RCS: @(#) $Id: makefile.vc,v 1.119 2008/04/02 14:39:36 patthoyts Exp $ +# RCS: @(#) $Id: makefile.vc,v 1.120 2008/04/03 17:04:55 patthoyts Exp $ #------------------------------------------------------------------------------ # Check to see we are configured to build with MSVC (MSDEVDIR or MSVCDIR) @@ -460,11 +460,14 @@ crt = -MT !endif BASE_CFLAGS = $(cdebug) $(cflags) $(crt) $(TK_INCLUDES) -TK_CFLAGS = $(BASE_CFLAGS) $(TK_DEFINES) -DUSE_TCL_STUBS +TK_CFLAGS = $(BASE_CFLAGS) $(TK_DEFINES) CON_CFLAGS = $(cdebug) $(cflags) $(crt) -DCONSOLE WISH_CFLAGS = $(BASE_CFLAGS) $(TK_DEFINES) STUB_CFLAGS = $(cflags) $(cdebug) $(TK_DEFINES) +!if !$(STATIC_BUILD) +TK_CFLAGS = $(TK_CFLAGS) -DUSE_TCL_STUBS +!endif #--------------------------------------------------------------------- # Link flags @@ -499,6 +502,11 @@ dlllflags = $(lflags) -dll conlflags = $(lflags) -subsystem:console guilflags = $(lflags) -subsystem:windows +tcllibs = $(TCLIMPLIB) +!if !$(STATIC_BUILD) +tcllibs = $(TCLSTUBLIB) $(tcllibs) +!endif + baselibs = kernel32.lib user32.lib # Avoid 'unresolved external symbol __security_cookie' errors. # c.f. http://support.microsoft.com/?id=894573 @@ -626,17 +634,17 @@ $(TKSTUBLIB): $(TKSTUBOBJS) $(WISH): $(WISHOBJS) $(TKIMPLIB) - $(link32) $(guilflags) -stack:2300000 -out:$@ $(guilibs) $(TCLIMPLIB) $** + $(link32) $(guilflags) -stack:2300000 -out:$@ $(guilibs) $(tcllibs) $** $(_VC_MANIFEST_EMBED_EXE) $(WISHC): $(WISHOBJS) $(TKIMPLIB) - $(link32) $(conlflags) -stack:2300000 -out:$@ $(guilibs) $(TCLIMPLIB) $** + $(link32) $(conlflags) -stack:2300000 -out:$@ $(guilibs) $(tcllibs) $** $(_VC_MANIFEST_EMBED_EXE) $(TKTEST): $(TKTESTOBJS) $(TKIMPLIB) - $(link32) $(guilflags) -stack:2300000 -out:$@ $(guilibs) $(TCLIMPLIB) $** + $(link32) $(guilflags) -stack:2300000 -out:$@ $(guilibs) $(tcllibs) $** $(_VC_MANIFEST_EMBED_EXE) -- cgit v0.12 From 71c2e7e5d1b9156ee1ca34123a863a594c730b31 Mon Sep 17 00:00:00 2001 From: patthoyts Date: Fri, 4 Apr 2008 14:18:30 +0000 Subject: Don't resize the window if the toplevel is not resizable or the sizegrip is disabled --- ChangeLog | 5 +++++ library/ttk/sizegrip.tcl | 22 +++++++++++++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6e687bc..ca91bfd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-04-04 Pat Thoyts + + * library/ttk/sizegrip.tcl: Don't resize if the toplevel is not resizable + or the sizegrip has been disabled. + 2008-04-03 Pat Thoyts * win/makefile.vc: Fixed stubs usage diff --git a/library/ttk/sizegrip.tcl b/library/ttk/sizegrip.tcl index f1b87b1..51667dd 100644 --- a/library/ttk/sizegrip.tcl +++ b/library/ttk/sizegrip.tcl @@ -1,5 +1,5 @@ # -# $Id: sizegrip.tcl,v 1.1 2006/10/31 01:42:27 hobbs Exp $ +# $Id: sizegrip.tcl,v 1.2 2008/04/04 14:18:30 patthoyts Exp $ # # Ttk widget set -- sizegrip widget bindings. # @@ -20,6 +20,8 @@ namespace eval ttk::sizegrip { height 0 widthInc 1 heightInc 1 + resizeX 1 + resizeY 1 toplevel {} } } @@ -31,8 +33,16 @@ bind TSizegrip { ttk::sizegrip::Release %W %X %Y } proc ttk::sizegrip::Press {W X Y} { variable State + if {[$W instate disabled]} { return } + set top [winfo toplevel $W] + # If the toplevel is not resizable then bail + foreach {State(resizeX) State(resizeY)} [wm resizable $top] break + if {!$State(resizeX) && !$State(resizeY)} { + return + } + # Sanity-checks: # If a negative X or Y position was specified for [wm geometry], # just bail out -- there's no way to handle this cleanly. @@ -62,8 +72,14 @@ proc ttk::sizegrip::Press {W X Y} { proc ttk::sizegrip::Drag {W X Y} { variable State if {!$State(pressed)} { return } - set w [expr {$State(width) + ($X - $State(pressX))/$State(widthInc)}] - set h [expr {$State(height) + ($Y - $State(pressY))/$State(heightInc)}] + set w $State(width) + set h $State(height) + if {$State(resizeX)} { + set w [expr {$w + ($X - $State(pressX))/$State(widthInc)}] + } + if {$State(resizeY)} { + set h [expr {$h + ($Y - $State(pressY))/$State(heightInc)}] + } if {$w <= 0} { set w 1 } if {$h <= 0} { set h 1 } wm geometry $State(toplevel) ${w}x${h} -- cgit v0.12 From 7bf46e6b4c9454ac734d721fce7fc42e1304a4ca Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 7 Apr 2008 15:50:55 +0000 Subject: autoconf-2.59 --- win/configure | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/win/configure b/win/configure index c9f2be5..4172c39 100755 --- a/win/configure +++ b/win/configure @@ -850,7 +850,7 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-celib=DIR use Windows/CE support library from DIR - --with-tcl=DIR use Tcl 8.5 binaries from DIR + --with-tcl=DIR use Tcl 8.6 binaries from DIR Some influential environment variables: CC C compiler command @@ -3874,10 +3874,10 @@ TK_DBGX=${DBGX} echo "$as_me:$LINENO: checking the location of tclConfig.sh" >&5 echo $ECHO_N "checking the location of tclConfig.sh... $ECHO_C" >&6 - if test -d ../../tcl8.5$TK_PATCH_LEVEL/win; then - TCL_BIN_DIR_DEFAULT=../../tcl8.5$TK_PATCH_LEVEL/win - elif test -d ../../tcl8.5/win; then - TCL_BIN_DIR_DEFAULT=../../tcl8.5/win + if test -d ../../tcl8.6$TK_PATCH_LEVEL/win; then + TCL_BIN_DIR_DEFAULT=../../tcl8.6$TK_PATCH_LEVEL/win + elif test -d ../../tcl8.6/win; then + TCL_BIN_DIR_DEFAULT=../../tcl8.6/win else TCL_BIN_DIR_DEFAULT=../../tcl/win fi -- cgit v0.12 From c2b55e4312dad7264c31f53fdfc1db949a23bf7d Mon Sep 17 00:00:00 2001 From: hobbs Date: Mon, 7 Apr 2008 18:39:36 +0000 Subject: * generic/tkArgv.c: fix -help mem explosion. [Bug 1936238] (bachmann) --- ChangeLog | 8 ++++++-- generic/tkArgv.c | 5 +++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index ca91bfd..34a0585 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,11 @@ +2008-04-07 Jeff Hobbs + + * generic/tkArgv.c: fix -help mem explosion. [Bug 1936238] (bachmann) + 2008-04-04 Pat Thoyts - * library/ttk/sizegrip.tcl: Don't resize if the toplevel is not resizable - or the sizegrip has been disabled. + * library/ttk/sizegrip.tcl: Don't resize if the toplevel is not + resizable or the sizegrip has been disabled. 2008-04-03 Pat Thoyts diff --git a/generic/tkArgv.c b/generic/tkArgv.c index 95991ee..55fe45e 100644 --- a/generic/tkArgv.c +++ b/generic/tkArgv.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkArgv.c,v 1.11 2007/12/13 15:24:13 dgp Exp $ + * RCS: @(#) $Id: tkArgv.c,v 1.12 2008/04/07 18:39:36 hobbs Exp $ */ #include "tkInt.h" @@ -337,7 +337,8 @@ PrintUsage( * for default options. */ { register Tk_ArgvInfo *infoPtr; - size_t width, i, numSpaces; + size_t width, i; + int numSpaces; /* must be int to allow for negative values */ #define NUM_SPACES 20 static char spaces[] = " "; char tmp[TCL_DOUBLE_SPACE]; -- cgit v0.12 From 96a6fac144d34cba9596355d01ac7983ed948f43 Mon Sep 17 00:00:00 2001 From: hobbs Date: Mon, 7 Apr 2008 22:27:40 +0000 Subject: use kenny variant for 1936238 fix --- ChangeLog | 2 +- generic/tkArgv.c | 16 ++++------------ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 34a0585..46e072d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,6 @@ 2008-04-07 Jeff Hobbs - * generic/tkArgv.c: fix -help mem explosion. [Bug 1936238] (bachmann) + * generic/tkArgv.c: fix -help mem explosion. [Bug 1936238] (kenny) 2008-04-04 Pat Thoyts diff --git a/generic/tkArgv.c b/generic/tkArgv.c index 55fe45e..0e60295 100644 --- a/generic/tkArgv.c +++ b/generic/tkArgv.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkArgv.c,v 1.12 2008/04/07 18:39:36 hobbs Exp $ + * RCS: @(#) $Id: tkArgv.c,v 1.13 2008/04/07 22:27:41 hobbs Exp $ */ #include "tkInt.h" @@ -337,10 +337,7 @@ PrintUsage( * for default options. */ { register Tk_ArgvInfo *infoPtr; - size_t width, i; - int numSpaces; /* must be int to allow for negative values */ -#define NUM_SPACES 20 - static char spaces[] = " "; + size_t width, i, numSpaces; char tmp[TCL_DOUBLE_SPACE]; /* @@ -373,13 +370,8 @@ PrintUsage( } Tcl_AppendResult(interp, "\n ", infoPtr->key, ":", NULL); numSpaces = width + 1 - strlen(infoPtr->key); - while (numSpaces > 0) { - if (numSpaces >= NUM_SPACES) { - Tcl_AppendResult(interp, spaces, NULL); - } else { - Tcl_AppendResult(interp, spaces+NUM_SPACES-numSpaces,NULL); - } - numSpaces -= NUM_SPACES; + while (numSpaces-- > 0) { + Tcl_AppendResult(interp, " ", NULL); } Tcl_AppendResult(interp, infoPtr->help, NULL); switch (infoPtr->type) { -- cgit v0.12 From 336c6a7ae7557bae330981e3ff138b77bd428bfd Mon Sep 17 00:00:00 2001 From: hobbs Date: Mon, 7 Apr 2008 23:14:36 +0000 Subject: * generic/tkWindow.c (Initialize): fix double-free on Tk_ParseArgv * tests/main.test (main-3.*): error. [Bug 1937135] --- ChangeLog | 3 +++ generic/tkWindow.c | 3 +-- tests/main.test | 26 +++++++++++++++++++++++++- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 46e072d..46b00ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-04-07 Jeff Hobbs + * generic/tkWindow.c (Initialize): fix double-free on Tk_ParseArgv + * tests/main.test (main-3.*): error. [Bug 1937135] + * generic/tkArgv.c: fix -help mem explosion. [Bug 1936238] (kenny) 2008-04-04 Pat Thoyts diff --git a/generic/tkWindow.c b/generic/tkWindow.c index b021f49..854bb82 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWindow.c,v 1.92 2008/04/02 04:06:38 dgp Exp $ + * RCS: @(#) $Id: tkWindow.c,v 1.93 2008/04/07 23:14:36 hobbs Exp $ */ #include "tkInt.h" @@ -3080,7 +3080,6 @@ Initialize( if (Tk_ParseArgv(interp, (Tk_Window) NULL, &argc, argv, argTable, TK_ARGV_DONT_SKIP_FIRST_ARG|TK_ARGV_NO_DEFAULTS) != TCL_OK) { - ckfree((char *) argv); goto argError; } p = Tcl_Merge(argc, argv); diff --git a/tests/main.test b/tests/main.test index d37240f..ede20f3 100644 --- a/tests/main.test +++ b/tests/main.test @@ -8,7 +8,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: main.test,v 1.10 2004/12/08 03:03:06 dgp Exp $ +# RCS: @(#) $Id: main.test,v 1.11 2008/04/07 23:14:39 hobbs Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -99,6 +99,30 @@ test main-2.3 {Tk_MainEx: -encoding option} -constraints { removeFile script } -result {0 {-enc utf-8 script}} +test main-3.1 {Tk_ParseArgv: -help option} -constraints unix -body { + # Run only on unix as Win32 pops up native dialog + list [catch {exec [interpreter] -help} msg] $msg +} -match glob -result {1 {% Application initialization failed: Command-specific options:*}} + +test main-3.2 {Tk_ParseArgv: -help option} -setup { + set maininterp [interp create] +} -body { + $maininterp eval { set argc 1 ; set argv -help } + list [catch {load {} Tk $maininterp} msg] $msg +} -cleanup { + interp delete $maininterp +} -match glob -result {1 {Command-specific options:*}} + +test main-3.3 {Tk_ParseArgv: -help option} -setup { + set maininterp [interp create] +} -body { + # Repeat of 3.2 to catch cleanup, eg Bug 1927135 + $maininterp eval { set argc 1 ; set argv -help } + list [catch {load {} Tk $maininterp} msg] $msg +} -cleanup { + interp delete $maininterp +} -match glob -result {1 {Command-specific options:*}} + # cleanup cleanupTests return -- cgit v0.12 From cf6cbd25cb59c0002784a0a740d36481be63abf8 Mon Sep 17 00:00:00 2001 From: Kevin B Kenny Date: Tue, 8 Apr 2008 03:28:04 +0000 Subject: * tkDecls.h: Reverted das's change of Tk's stubs pointers * tkIntDecls.h: from 'extern' to 'EXTERN'. Since the stubs pointer * tkPlatDecls.h: is always linked statically, its wrong to import or export it from a DLL, and the change causes trouble for extensions that build with -DUSE_TK_STUBS. * tkWinEmbed.c: Removed #if 0 code. Trust the revision control system, if you need it again, you can find it. * tkWinSend.c: Added conditional compilation to silence several compiler warnings. --- ChangeLog | 12 ++++++++++++ generic/tkDecls.h | 9 +++++++-- generic/tkIntDecls.h | 4 ++-- generic/tkPlatDecls.h | 4 ++-- win/tkWinEmbed.c | 37 +------------------------------------ win/tkWinSend.c | 12 +++++++++++- 6 files changed, 35 insertions(+), 43 deletions(-) diff --git a/ChangeLog b/ChangeLog index 46b00ae..5d16c9b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-04-08 Kevin Kenny + + * tkDecls.h: Reverted das's change of Tk's stubs pointers + * tkIntDecls.h: from 'extern' to 'EXTERN'. Since the stubs pointer + * tkPlatDecls.h: is always linked statically, its wrong to import + or export it from a DLL, and the change causes + trouble for extensions that build with -DUSE_TK_STUBS. + * tkWinEmbed.c: Removed #if 0 code. Trust the revision control system, + if you need it again, you can find it. + * tkWinSend.c: Added conditional compilation to silence several + compiler warnings. + 2008-04-07 Jeff Hobbs * generic/tkWindow.c (Initialize): fix double-free on Tk_ParseArgv diff --git a/generic/tkDecls.h b/generic/tkDecls.h index c0e0ac5..250a3e0 100644 --- a/generic/tkDecls.h +++ b/generic/tkDecls.h @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkDecls.h,v 1.32 2008/04/02 21:32:32 das Exp $ + * RCS: @(#) $Id: tkDecls.h,v 1.33 2008/04/08 03:28:04 kennykb Exp $ */ #ifndef _TKDECLS @@ -1983,7 +1983,12 @@ typedef struct TkStubs { } TkStubs; #if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) -EXTERN CONST TkStubs *tkStubsPtr; +/* + * The following declaration has to be 'extern', not EXTERN. The + * stubs pointer is always static-linked, and never exported from + * a DLL. + */ +extern const TkStubs *tkStubsPtr; #endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */ #if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h index 3dc3cbf..d5f1266 100644 --- a/generic/tkIntDecls.h +++ b/generic/tkIntDecls.h @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkIntDecls.h,v 1.33 2008/04/02 21:32:32 das Exp $ + * RCS: @(#) $Id: tkIntDecls.h,v 1.34 2008/04/08 03:28:05 kennykb Exp $ */ #ifndef _TKINTDECLS @@ -1223,7 +1223,7 @@ typedef struct TkIntStubs { } TkIntStubs; #if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) -EXTERN CONST TkIntStubs *tkIntStubsPtr; +extern CONST TkIntStubs *tkIntStubsPtr; #endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */ #if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) diff --git a/generic/tkPlatDecls.h b/generic/tkPlatDecls.h index d1219cc..d2cc339 100644 --- a/generic/tkPlatDecls.h +++ b/generic/tkPlatDecls.h @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkPlatDecls.h,v 1.17 2008/04/02 21:32:33 das Exp $ + * RCS: @(#) $Id: tkPlatDecls.h,v 1.18 2008/04/08 03:28:05 kennykb Exp $ */ #ifndef _TKPLATDECLS @@ -157,7 +157,7 @@ typedef struct TkPlatStubs { } TkPlatStubs; #if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) -EXTERN CONST TkPlatStubs *tkPlatStubsPtr; +extern CONST TkPlatStubs *tkPlatStubsPtr; #endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */ #if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) diff --git a/win/tkWinEmbed.c b/win/tkWinEmbed.c index 63e837a..80b1204 100644 --- a/win/tkWinEmbed.c +++ b/win/tkWinEmbed.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinEmbed.c,v 1.33 2007/12/13 15:28:55 dgp Exp $ + * RCS: @(#) $Id: tkWinEmbed.c,v 1.34 2008/04/08 03:28:05 kennykb Exp $ */ #include "tkWinInt.h" @@ -45,8 +45,6 @@ static Tcl_ThreadDataKey dataKey; static void ContainerEventProc(ClientData clientData, XEvent *eventPtr); -static void EmbeddedEventProc(ClientData clientData, - XEvent *eventPtr); static void EmbedGeometryRequest(Container *containerPtr, int width, int height); static void EmbedWindowDeleted(TkWindow *winPtr); @@ -389,39 +387,6 @@ TkpMakeContainer( ContainerEventProc, (ClientData) containerPtr); } -#if 0 -/* - *---------------------------------------------------------------------- - * - * EmbeddedEventProc -- - * - * This procedure is invoked by the Tk event dispatcher when various - * useful events are received for a window that is embedded in another - * application. - * - * Results: - * None. - * - * Side effects: - * Our internal state gets cleaned up when an embedded window is - * destroyed. - * - *---------------------------------------------------------------------- - */ - -static void -EmbeddedEventProc( - ClientData clientData, /* Token for container window. */ - XEvent *eventPtr) /* ResizeRequest event. */ -{ - TkWindow *winPtr = (TkWindow *) clientData; - - if (eventPtr->type == DestroyNotify) { - EmbedWindowDeleted(winPtr); - } -} -#endif - /* *---------------------------------------------------------------------- * diff --git a/win/tkWinSend.c b/win/tkWinSend.c index 086d55e..ac94c0b 100644 --- a/win/tkWinSend.c +++ b/win/tkWinSend.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinSend.c,v 1.15 2007/12/13 15:28:56 dgp Exp $ + * RCS: @(#) $Id: tkWinSend.c,v 1.16 2008/04/08 03:28:05 kennykb Exp $ */ #include "tkInt.h" @@ -63,13 +63,17 @@ static Tcl_ThreadDataKey dataKey; * Functions internal to this file. */ +#ifdef TK_SEND_ENABLED_ON_WINDOWS static void CmdDeleteProc(ClientData clientData); static void InterpDeleteProc(ClientData clientData, Tcl_Interp *interp); +#endif static void RevokeObjectRegistration(RegisteredInterp *riPtr); static HRESULT BuildMoniker(const char *name, LPMONIKER *pmk); +#ifdef TK_SEND_ENABLED_ON_WINDOWS static HRESULT RegisterInterp(const char *name, RegisteredInterp *riPtr); +#endif static int FindInterpreterObject(Tcl_Interp *interp, const char *name, LPDISPATCH *ppdisp); static int Send(LPDISPATCH pdispInterp, Tcl_Interp *interp, @@ -471,6 +475,7 @@ FindInterpreterObject( *-------------------------------------------------------------- */ +#ifdef TK_SEND_ENABLED_ON_WINDOWS static void CmdDeleteProc( ClientData clientData) @@ -506,6 +511,7 @@ CmdDeleteProc( ckfree(clientData); } +#endif /* *-------------------------------------------------------------- @@ -568,6 +574,7 @@ RevokeObjectRegistration( * ---------------------------------------------------------------------- */ +#ifdef TK_SEND_ENABLED_ON_WINDOWS static void InterpDeleteProc( ClientData clientData, @@ -575,6 +582,7 @@ InterpDeleteProc( { CoUninitialize(); } +#endif /* * ---------------------------------------------------------------------- @@ -638,6 +646,7 @@ BuildMoniker( * ---------------------------------------------------------------------- */ +#ifdef TK_SEND_ENABLED_ON_WINDOWS static HRESULT RegisterInterp( const char *name, @@ -694,6 +703,7 @@ RegisterInterp( Tcl_DStringFree(&dString); return hr; } +#endif /* * ---------------------------------------------------------------------- -- cgit v0.12 From 3cc3f93973c2ef7c8b753e222d3e2012c75e3da7 Mon Sep 17 00:00:00 2001 From: das Date: Tue, 8 Apr 2008 15:00:36 +0000 Subject: * generic/tkDecls.h: make genstubs (genStubs.tcl changes). * generic/tkIntPlatDecls.h: * generic/tkIntXlibDecls.h: --- ChangeLog | 14 +++++++++----- generic/tkDecls.h | 9 ++------- generic/tkIntPlatDecls.h | 4 ++-- generic/tkIntXlibDecls.h | 4 ++-- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5d16c9b..0c6a696 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,12 +1,16 @@ +2008-04-08 Daniel Steffen + + * generic/tkDecls.h: make genstubs (genStubs.tcl changes). + * generic/tkIntDecls.h: + * generic/tkIntPlatDecls.h: + * generic/tkIntXlibDecls.h: + * generic/tkPlatDecls.h: + 2008-04-08 Kevin Kenny - * tkDecls.h: Reverted das's change of Tk's stubs pointers - * tkIntDecls.h: from 'extern' to 'EXTERN'. Since the stubs pointer - * tkPlatDecls.h: is always linked statically, its wrong to import - or export it from a DLL, and the change causes - trouble for extensions that build with -DUSE_TK_STUBS. * tkWinEmbed.c: Removed #if 0 code. Trust the revision control system, if you need it again, you can find it. + * tkWinSend.c: Added conditional compilation to silence several compiler warnings. diff --git a/generic/tkDecls.h b/generic/tkDecls.h index 250a3e0..abf2739 100644 --- a/generic/tkDecls.h +++ b/generic/tkDecls.h @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkDecls.h,v 1.33 2008/04/08 03:28:04 kennykb Exp $ + * RCS: @(#) $Id: tkDecls.h,v 1.34 2008/04/08 15:00:37 das Exp $ */ #ifndef _TKDECLS @@ -1983,12 +1983,7 @@ typedef struct TkStubs { } TkStubs; #if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) -/* - * The following declaration has to be 'extern', not EXTERN. The - * stubs pointer is always static-linked, and never exported from - * a DLL. - */ -extern const TkStubs *tkStubsPtr; +extern CONST TkStubs *tkStubsPtr; #endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */ #if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index 84720fa..1d8c391 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -9,7 +9,7 @@ * Copyright (c) 1998-1999 by Scriptics Corporation. * All rights reserved. * - * RCS: @(#) $Id: tkIntPlatDecls.h,v 1.31 2008/04/02 21:32:32 das Exp $ + * RCS: @(#) $Id: tkIntPlatDecls.h,v 1.32 2008/04/08 15:00:43 das Exp $ */ #ifndef _TKINTPLATDECLS @@ -671,7 +671,7 @@ typedef struct TkIntPlatStubs { } TkIntPlatStubs; #if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) -EXTERN CONST TkIntPlatStubs *tkIntPlatStubsPtr; +extern CONST TkIntPlatStubs *tkIntPlatStubsPtr; #endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */ #if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h index 2dae5b6..0a7974a 100644 --- a/generic/tkIntXlibDecls.h +++ b/generic/tkIntXlibDecls.h @@ -9,7 +9,7 @@ * Copyright (c) 1998-1999 by Scriptics Corporation. * All rights reserved. * - * RCS: @(#) $Id: tkIntXlibDecls.h,v 1.25 2008/04/02 21:32:32 das Exp $ + * RCS: @(#) $Id: tkIntXlibDecls.h,v 1.26 2008/04/08 15:00:47 das Exp $ */ #ifndef _TKINTXLIBDECLS @@ -1420,7 +1420,7 @@ typedef struct TkIntXlibStubs { } TkIntXlibStubs; #if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) -EXTERN CONST TkIntXlibStubs *tkIntXlibStubsPtr; +extern CONST TkIntXlibStubs *tkIntXlibStubsPtr; #endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */ #if defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) -- cgit v0.12 From f901ea03dc9acd499f20f98ab06198c27c0f410f Mon Sep 17 00:00:00 2001 From: patthoyts Date: Tue, 8 Apr 2008 23:30:44 +0000 Subject: Provide a visual-styles API element engine to permit scripts to create any available windows xp/vista element. Plus basic tests. --- ChangeLog | 6 ++ doc/ttk_vsapi.n | 83 +++++++++++++++++++++++++++ win/ttkWinXPTheme.c | 161 +++++++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 247 insertions(+), 3 deletions(-) create mode 100644 doc/ttk_vsapi.n diff --git a/ChangeLog b/ChangeLog index 0c6a696..6d5578c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-04-08 Pat Thoyts + + * win/ttkWinXpTheme.c: Provide a visual-styles API element engine + * tests/ttk/vsapi.test: to permit scripts to create any available + * doc/ttk_vsapi.n: windows xp/vista element. Plus basic tests. + 2008-04-08 Daniel Steffen * generic/tkDecls.h: make genstubs (genStubs.tcl changes). diff --git a/doc/ttk_vsapi.n b/doc/ttk_vsapi.n new file mode 100644 index 0000000..8bd40d1 --- /dev/null +++ b/doc/ttk_vsapi.n @@ -0,0 +1,83 @@ +'\" -*- nroff -*- +'\" Copyright (c) 2008 Pat Thoyts +'\" +'\" See the file "license.terms" for information on usage and redistribution +'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. +'\" +'\" RCS: @(#) $Id: ttk_vsapi.n,v 1.1 2008/04/08 23:30:45 patthoyts Exp $ +'\" +.so man.macros +.TH ttk::vsapi n 8.5 Tk "Tk Themed Widget" +.BS +.SH NAME +ttk::vsapi \- Define a Microsoft Visual Styles element +.SH SYNOPSIS +\fBttk::style element create \fIname\fR \fBvsapi\fR \fIclassName\fR +\fIpartId\fR ?\fIstateMap\fR? ?\fIoptions\fR? +.BE +.SH DESCRIPTION +The \fIvsapi\fR element factory creates a new element +in the current theme whose visual appearance is drawn using the +Microsoft Visual Styles API which is reponsible for the themed styles +on Windows XP and Vista. This factory permits any of the Visual +Styles parts to be declared as ttk elements that can then be +included in a style layout to modify the appearance of ttk widgets. +.PP +\fIclassName\fR and \fIpartId\fR are required parameters and specify +the Visual Styles class and part as given in the Microsoft +documentation. The \fIstateMap\fR may be provided to map ttk states to +Visual Styles API states (see \fBSTATE MAP\fR). +.SH "OPTIONS" +Valid \fIoptions\fR are: +.TP +\fB\-padding\fR \fIpadding\fR +Specify the element's interior padding. +\fIpadding\fR is a list of up to four integers specifying +the left, top, right and bottom borders respectively. This option +cannot be mixed with any other options. +.TP +\fB\-margins\fR \fIpadding\fR +Specifies the elements exterior padding. The \fIpadding\fR is as +described for the \fI-padding\fR option. This option may not be mixed +with any other options. +.TP +\fB\-width\fR \fIwidth\fR +Specifies the height for the element. If this option is set then +the Visual Styles API will not be queried for the recommended +size. If this option is set then \fI-height\fR should also be set. +The \fI-width\fR and \fI-height\fR options cannot be mixed with +the \fI-padding\fR or \fI-margins\fR options. +.TP +\fB\-height\fR \fIheight\fR +Specifies the height of the element. See the comments for \fI-width\fR. +.SH "STATE MAP" +The \fIstateMap\fR parameter is a list of ttk states and the +corresponding Visual Styles API state value. +This permits the element appearence to respond to changes in the +widget state such as becoming active or being pressed. The list should +be as described for the \fBttk::style map\fR command but note that the +last pair in the list should be the default state and is typically and +empty list and 1. +.PP +If no \fIstateMap\fR parameter is given there is an implicit default +\fIstateMap\fR of {{} 1} +.SH "EXAMPLE" +Change the appearence of a ttk::checkbutton to use the Explorer pin +part. +.CS +# EXPLORERBAR EBP_HEADERPIN +ttk::style element create pin vsapi EXPLORERBAR 3 { + {pressed !selected} 3 + {active !selected} 2 + {pressed selected} 6 + {active selected} 5 + {selected} 4 + {} 1 +} +ttk::style layout Explorer.Pin {Explorer.Pin.pin -sticky news} +pack [ttk::checkbutton .pin -style Explorer.Pin] +.CE +.SH "SEE ALSO" +ttk::intro(n), ttk::widget(n), ttk::style(n), ttk::image(n) +.SH "KEYWORDS" +style, theme, appearance, windows diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c index 11a8269..a0a485c 100644 --- a/win/ttkWinXPTheme.c +++ b/win/ttkWinXPTheme.c @@ -1,5 +1,5 @@ /* - * $Id: ttkWinXPTheme.c,v 1.18 2007/12/13 15:28:56 dgp Exp $ + * $Id: ttkWinXPTheme.c,v 1.19 2008/04/08 23:30:46 patthoyts Exp $ * * Tk theme engine which uses the Windows XP "Visual Styles" API * Adapted from Georgios Petasis' XP theme patch. @@ -372,6 +372,7 @@ typedef struct /* XP element specifications */ int flags; # define IGNORE_THEMESIZE 0x80000000 /* See NOTE-GetThemePartSize */ # define PAD_MARGINS 0x40000000 /* See NOTE-GetThemeMargins */ +# define HEAP_ELEMENT 0x20000000 /* ElementInfo is on heap */ } ElementInfo; typedef struct @@ -406,9 +407,21 @@ NewElementData(XPThemeProcs *procs, ElementInfo *info) return elementData; } -static void DestroyElementData(void *elementData) +/* + * Destroy elements. If the element was created by the element factory + * then the info member is dynamically allocated. Otherwise it was + * static data from the C object and only the ElementData needs freeing. + */ +static void DestroyElementData(void *clientData) { - ckfree(elementData); + ElementData *elementData = clientData; + if (elementData->info->flags & HEAP_ELEMENT) { + ckfree((char *)elementData->info->statemap); + ckfree((char *)elementData->info->className); + ckfree((char *)elementData->info->elementName); + ckfree((char *)elementData->info); + } + ckfree(clientData); } /* @@ -962,6 +975,147 @@ static ElementInfo ElementInfoTable[] = { #undef PAD /*---------------------------------------------------------------------- + * Windows Visual Styles API Element Factory + * + * The Vista release has shown that the Windows Visual Styles can be + * extended with additional elements. This element factory can permit + * the programmer to create elements for use with script-defined layouts + * + * eg: to create the small close button: + * style element create smallclose vsapi \ + * WINDOW 19 {disabled 4 pressed 3 active 2 {} 1} + */ + +static int +Ttk_CreateVsapiElement( + Tcl_Interp *interp, + void *clientData, + Ttk_Theme theme, + const char *elementName, + int objc, Tcl_Obj *CONST objv[]) +{ + XPThemeData *themeData = clientData; + ElementInfo *elementPtr = NULL; + ClientData elementData; + Tcl_UniChar *className; + int partId = 0; + Ttk_StateTable *stateTable; + Ttk_Padding pad = {0, 0, 0, 0}; + int flags = 0; + int length = 0; + char *name; + LPWSTR wname; + + const char *optionStrings[] = + { "-padding","-width","-height","-margins",NULL }; + enum { O_PADDING, O_WIDTH, O_HEIGHT, O_MARGINS }; + + if (objc < 2) { + Tcl_AppendResult(interp, + "missing required arguments 'class' and/or 'partId'", NULL); + return TCL_ERROR; + } + + if (Tcl_GetIntFromObj(interp, objv[1], &partId) != TCL_OK) { + return TCL_ERROR; + } + className = Tcl_GetUnicodeFromObj(objv[0], &length); + + /* flags or padding */ + if (objc > 3) { + int i = 3, option = 0; + for (i = 3; i < objc; i += 2) { + int tmp = 0; + if (i == objc -1) { + Tcl_AppendResult(interp, "Missing value for \"", + Tcl_GetString(objv[i]), "\".", NULL); + return TCL_ERROR; + } + if (Tcl_GetIndexFromObj(interp, objv[i], optionStrings, + "option", 0, &option) != TCL_OK) + return TCL_ERROR; + switch (option) { + case O_PADDING: + if (Ttk_GetBorderFromObj(interp, objv[i+1], &pad) != TCL_OK) + return TCL_ERROR; + break; + case O_MARGINS: + if (Ttk_GetBorderFromObj(interp, objv[i+1], &pad) != TCL_OK) + return TCL_ERROR; + flags |= PAD_MARGINS; + break; + case O_WIDTH: + if (Tcl_GetIntFromObj(interp, objv[i+1], &tmp) != TCL_OK) + return TCL_ERROR; + pad.left = pad.right = tmp; + flags |= IGNORE_THEMESIZE; + break; + case O_HEIGHT: + if (Tcl_GetIntFromObj(interp, objv[i+1], &tmp) != TCL_OK) + return TCL_ERROR; + pad.top = pad.bottom = tmp; + flags |= IGNORE_THEMESIZE; + break; + } + } + } + + /* convert a statemap into a state table */ + if (objc > 2) { + Tcl_Obj **specs; + int n,j,count, status = TCL_OK; + if (Tcl_ListObjGetElements(interp, objv[2], &count, &specs) != TCL_OK) + return TCL_ERROR; + /* we over-allocate to ensure there is a terminating entry */ + stateTable = (Ttk_StateTable *) + ckalloc(sizeof(Ttk_StateTable) * (count + 1)); + memset(stateTable, 0, sizeof(Ttk_StateTable) * (count + 1)); + for (n = 0, j = 0; status == TCL_OK && n < count; n += 2, ++j) { + Ttk_StateSpec spec = {0,0}; + status = Ttk_GetStateSpecFromObj(interp, specs[n], &spec); + if (status == TCL_OK) { + stateTable[j].onBits = spec.onbits; + stateTable[j].offBits = spec.offbits; + status = Tcl_GetIntFromObj(interp, specs[n+1], + &stateTable[j].index); + } + } + if (status != TCL_OK) { + ckfree((char *)stateTable); + return status; + } + } else { + stateTable = (Ttk_StateTable *)ckalloc(sizeof(Ttk_StateTable)); + memset(stateTable, 0, sizeof(Ttk_StateTable)); + } + + elementPtr = (ElementInfo *)ckalloc(sizeof(ElementInfo)); + elementPtr->elementSpec = &GenericElementSpec; + elementPtr->partId = partId; + elementPtr->statemap = stateTable; + elementPtr->padding = pad; + elementPtr->flags = HEAP_ELEMENT | flags; + + /* set the element name to an allocated copy */ + name = ckalloc(strlen(elementName) + 1); + strcpy(name, elementName); + elementPtr->elementName = name; + + /* set the class name to an allocated copy */ + wname = (LPWSTR)ckalloc(sizeof(WCHAR) * (length + 1)); + wcscpy(wname, className); + elementPtr->className = wname; + + elementData = NewElementData(themeData->procs, elementPtr); + Ttk_RegisterElementSpec( + theme, elementName, elementPtr->elementSpec, elementData); + + Ttk_RegisterCleanup(interp, elementData, DestroyElementData); + Tcl_SetObjResult(interp, Tcl_NewStringObj(elementName, -1)); + return TCL_OK; +} + +/*---------------------------------------------------------------------- * +++ Initialization routine: */ @@ -997,6 +1151,7 @@ MODULE_SCOPE int TtkXPTheme_Init(Tcl_Interp *interp, HWND hwnd) Ttk_SetThemeEnabledProc(themePtr, XPThemeEnabled, themeData); Ttk_RegisterCleanup(interp, themeData, XPThemeDeleteProc); + Ttk_RegisterElementFactory(interp, "vsapi", Ttk_CreateVsapiElement, themeData); /* * New elements: -- cgit v0.12 From 2d81bb0e842d88af1cb7b5bb2234bcf0acce836e Mon Sep 17 00:00:00 2001 From: patthoyts Date: Wed, 9 Apr 2008 09:27:22 +0000 Subject: Forgot to add this yesterday --- tests/ttk/vsapi.test | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 tests/ttk/vsapi.test diff --git a/tests/ttk/vsapi.test b/tests/ttk/vsapi.test new file mode 100644 index 0000000..5ce2b13 --- /dev/null +++ b/tests/ttk/vsapi.test @@ -0,0 +1,48 @@ +# -*- tcl -*- +# $Id: vsapi.test,v 1.1 2008/04/09 09:27:22 patthoyts Exp $ +# + +package require Tk 8.5 +package require tcltest ; namespace import -force tcltest::* +loadTestedCommands + +testConstraint xpnative \ + [expr {[lsearch -exact [ttk::style theme names] xpnative] != -1}] + +test vsapi-1.1 "WINDOW WP_SMALLCLOSEBUTTON" -constraints {xpnative} -body { + ttk::style element create smallclose vsapi \ + WINDOW 19 {disabled 4 pressed 3 active 2 {} 1} + ttk::style layout CloseButton {CloseButton.smallclose -sticky news} + ttk::button .b -style CloseButton + pack .b -expand true -fill both + list [winfo reqwidth .b] [winfo reqheight .b] +} -cleanup { destroy .b } -result [list 13 13] + +test vsapi-1.2 "EXPLORERBAR EBP_HEADERPIN" -constraints {xpnative} -body { + ttk::style element create pin vsapi \ + EXPLORERBAR 3 { + {pressed !selected} 3 + {active !selected} 2 + {pressed selected} 6 + {active selected} 5 + {selected} 4 + {} 1 + } + ttk::style layout Explorer.Pin {Explorer.Pin.pin -sticky news} + ttk::checkbutton .pin -style Explorer.Pin + pack .pin -expand true -fill both + list [winfo reqwidth .pin] [winfo reqheight .pin] +} -cleanup { destroy .pin } -result [list 16 16] + +test vsapi-1.3 "EXPLORERBAR EBP_HEADERCLOSE" -constraints {xpnative} -body { + ttk::style element create headerclose vsapi \ + EXPLORERBAR 2 {pressed 3 active 2 {} 1} + ttk::style layout Explorer.CloseButton { + Explorer.CloseButton.headerclose -sticky news + } + ttk::button .b -style Explorer.CloseButton + pack .b -expand true -fill both + list [winfo reqwidth .b] [winfo reqheight .b] +} -cleanup { destroy .b } -result [list 16 16] + +tcltest::cleanupTests -- cgit v0.12 From 679c6b232167c53eed33c0823d4e6341de1f1db8 Mon Sep 17 00:00:00 2001 From: patthoyts Date: Wed, 9 Apr 2008 09:28:05 +0000 Subject: Improved the element factory documentation and cross-links --- doc/ttk_image.n | 10 +++++----- doc/ttk_style.n | 10 ++++++---- doc/ttk_vsapi.n | 52 +++++++++++++++++++++++++++++++++------------------- 3 files changed, 44 insertions(+), 28 deletions(-) diff --git a/doc/ttk_image.n b/doc/ttk_image.n index a84247a..4d9a840 100644 --- a/doc/ttk_image.n +++ b/doc/ttk_image.n @@ -4,13 +4,13 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_image.n,v 1.12 2007/12/13 15:23:44 dgp Exp $ +'\" RCS: @(#) $Id: ttk_image.n,v 1.13 2008/04/09 09:28:05 patthoyts Exp $ '\" .so man.macros -.TH ttk::image n 8.5 Tk "Tk Themed Widget" +.TH ttk_image n 8.5 Tk "Tk Themed Widget" .BS .SH NAME -ttk::image \- Define an element based on an image +ttk_image \- Define an element based on an image .SH SYNOPSIS \fBttk::style element create \fIname\fR \fBimage\fR \fIimageSpec\fR ?\fIoptions\fR? .BE @@ -72,6 +72,6 @@ style element create Button.button image \e \-border {2 4} \-sticky we .CE .SH "SEE ALSO" -image(n), photo(n) +ttk::intro(n), ttk::style(n), ttk_vsapi(n), image(n), photo(n) .SH KEYWORDS -pixmap theme, image +style, theme, appearance, pixmap theme, image diff --git a/doc/ttk_style.n b/doc/ttk_style.n index dcc74ad..0fc1e92 100644 --- a/doc/ttk_style.n +++ b/doc/ttk_style.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_style.n,v 1.13 2008/03/16 22:37:45 dkf Exp $ +'\" RCS: @(#) $Id: ttk_style.n,v 1.14 2008/04/09 09:28:05 patthoyts Exp $ '\" .so man.macros .TH ttk::style n 8.5 Tk "Tk Themed Widget" @@ -58,9 +58,11 @@ for style \fIstyle\fR. .TP \fBttk::style element create\fR \fIelementName\fR \fItype\fR ?\fIargs...\fR? Creates a new element in the current theme of type \fItype\fR. -The only built-in element type is \fIimage\fR (see \fBttk_image\fR(n)), -although themes may define other element types -(see \fBTtk_RegisterElementFactory\fR). +The only cross-platform built-in element type is \fIimage\fR +(see \fBttk_image\fR(n)) but themes may define other element types +(see \fBTtk_RegisterElementFactory\fR). On suitable versions of Windows +an element factory is registered to create Windows theme elements +(see \fBttk_vsapi\fR(n)). .TP \fBttk::style element names\fR Returns the list of elements defined in the current theme. diff --git a/doc/ttk_vsapi.n b/doc/ttk_vsapi.n index 8bd40d1..e03f7f8 100644 --- a/doc/ttk_vsapi.n +++ b/doc/ttk_vsapi.n @@ -4,16 +4,15 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_vsapi.n,v 1.1 2008/04/08 23:30:45 patthoyts Exp $ +'\" RCS: @(#) $Id: ttk_vsapi.n,v 1.2 2008/04/09 09:28:05 patthoyts Exp $ '\" .so man.macros -.TH ttk::vsapi n 8.5 Tk "Tk Themed Widget" +.TH ttk_vsapi n 8.5 Tk "Tk Themed Widget" .BS .SH NAME -ttk::vsapi \- Define a Microsoft Visual Styles element +ttk_vsapi \- Define a Microsoft Visual Styles element .SH SYNOPSIS -\fBttk::style element create \fIname\fR \fBvsapi\fR \fIclassName\fR -\fIpartId\fR ?\fIstateMap\fR? ?\fIoptions\fR? +\fBttk::style element create \fIname\fR \fBvsapi\fR \fIclassName\fR \fIpartId\fR ?\fIstateMap\fR? ?\fIoptions\fR? .BE .SH DESCRIPTION The \fIvsapi\fR element factory creates a new element @@ -33,20 +32,21 @@ Valid \fIoptions\fR are: \fB\-padding\fR \fIpadding\fR Specify the element's interior padding. \fIpadding\fR is a list of up to four integers specifying -the left, top, right and bottom borders respectively. This option -cannot be mixed with any other options. +the left, top, right and bottom padding quantities respectively. +This option may not be mixed with any other options. .TP \fB\-margins\fR \fIpadding\fR -Specifies the elements exterior padding. The \fIpadding\fR is as -described for the \fI-padding\fR option. This option may not be mixed -with any other options. +Specifies the elements exterior padding. +\fIpadding\fR is a list of up to four integers specifying +the left, top, right and bottom padding quantities respectively. +This option may not be mixed with any other options. .TP \fB\-width\fR \fIwidth\fR Specifies the height for the element. If this option is set then the Visual Styles API will not be queried for the recommended -size. If this option is set then \fI-height\fR should also be set. -The \fI-width\fR and \fI-height\fR options cannot be mixed with -the \fI-padding\fR or \fI-margins\fR options. +size or the part. If this option is set then \fI-height\fR should +also be set. The \fI-width\fR and \fI-height\fR options cannot +be mixed with the \fI-padding\fR or \fI-margins\fR options. .TP \fB\-height\fR \fIheight\fR Specifies the height of the element. See the comments for \fI-width\fR. @@ -57,15 +57,29 @@ This permits the element appearence to respond to changes in the widget state such as becoming active or being pressed. The list should be as described for the \fBttk::style map\fR command but note that the last pair in the list should be the default state and is typically and -empty list and 1. +empty list and 1. Unfortunately all the Visual Styles parts have +different state values and these must be looked up either in the +Microsoft documentation or more likely in the header files. The +original header to use was \fItmschema.h\fR but in more recent +versions of the Windows Development Kit this is \fIvssym32.h\fR. .PP If no \fIstateMap\fR parameter is given there is an implicit default -\fIstateMap\fR of {{} 1} +map of {{} 1} .SH "EXAMPLE" -Change the appearence of a ttk::checkbutton to use the Explorer pin -part. +Create a correctly themed close button by changing the layout of +a \fBttk::button\fR(n). This uses the WINDOW part WP_SMALLCLOSEBUTTON +and as documented the states CBS_DISABLED, CBS_HOT, CBS_NORMAL and +CBS_PUSHED are mapped from ttk states. +.CS +ttk::style element create smallclose vsapi WINDOW 19 \\ + {disabled 4 pressed 3 active 2 {} 1} +ttk::style layout CloseButton {CloseButton.smallclose -sticky news} +pack [ttk::button .close -style CloseButton] +.CE +.PP +Change the appearence of a \fBttk::checkbutton\fR(n) to use the +Explorer pin part EBP_HEADERPIN. .CS -# EXPLORERBAR EBP_HEADERPIN ttk::style element create pin vsapi EXPLORERBAR 3 { {pressed !selected} 3 {active !selected} 2 @@ -78,6 +92,6 @@ ttk::style layout Explorer.Pin {Explorer.Pin.pin -sticky news} pack [ttk::checkbutton .pin -style Explorer.Pin] .CE .SH "SEE ALSO" -ttk::intro(n), ttk::widget(n), ttk::style(n), ttk::image(n) +ttk::intro(n), ttk::widget(n), ttk::style(n), ttk_image(n) .SH "KEYWORDS" style, theme, appearance, windows -- cgit v0.12 From 1cc312402e4bf74f11762bf1ac91f17a6bbf425e Mon Sep 17 00:00:00 2001 From: nijtmans Date: Wed, 9 Apr 2008 20:48:10 +0000 Subject: eliminate a few gcc 4.3 warnings --- win/tkWinTest.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/win/tkWinTest.c b/win/tkWinTest.c index 57792ec..f92a8cc 100644 --- a/win/tkWinTest.c +++ b/win/tkWinTest.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinTest.c,v 1.14 2007/12/13 15:28:56 dgp Exp $ + * RCS: @(#) $Id: tkWinTest.c,v 1.15 2008/04/09 20:48:10 nijtmans Exp $ */ #include "tkWinInt.h" @@ -182,7 +182,6 @@ TestclipboardObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *CONST objv[]) /* Argument values. */ { - TkWindow *winPtr = (TkWindow *) clientData; HGLOBAL handle; char *data; int code = TCL_OK; @@ -348,7 +347,7 @@ TestwineventCmd( wParam = MAKEWPARAM(id, 0); lParam = (LPARAM)child; } - sprintf(buf, "%d", SendMessage(hwnd, message, wParam, lParam)); + sprintf(buf, "%d", (int) SendMessage(hwnd, message, wParam, lParam)); Tcl_SetResult(interp, buf, TCL_VOLATILE); break; } @@ -356,7 +355,7 @@ TestwineventCmd( char buf[TCL_INTEGER_SPACE]; sprintf(buf, "%d", - SendDlgItemMessage(hwnd, id, message, wParam, lParam)); + (int)SendDlgItemMessage(hwnd, id, message, wParam, lParam)); Tcl_SetResult(interp, buf, TCL_VOLATILE); break; } @@ -382,7 +381,6 @@ TestfindwindowObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *CONST objv[]) /* Argument values. */ { - TkWindow *winPtr = (TkWindow *) clientData; const char *title = NULL, *class = NULL; HWND hwnd = NULL; int r = TCL_OK; -- cgit v0.12 From 5f217f0c3d4c5fa33cbf685f3aa89c8afc016ab3 Mon Sep 17 00:00:00 2001 From: nijtmans Date: Wed, 9 Apr 2008 20:52:16 +0000 Subject: a little cleanup, in preparation for replacing the gif compressor with a real LZW one. --- generic/tkImgGIF.c | 177 +++++++++++++++++++++++++---------------------------- 1 file changed, 85 insertions(+), 92 deletions(-) diff --git a/generic/tkImgGIF.c b/generic/tkImgGIF.c index b31c64d..b2b337c 100644 --- a/generic/tkImgGIF.c +++ b/generic/tkImgGIF.c @@ -32,7 +32,7 @@ * This file also contains code from miGIF. See lower down in file for the * applicable copyright notice for that portion. * - * RCS: @(#) $Id: tkImgGIF.c,v 1.41 2008/02/01 16:53:53 rmax Exp $ + * RCS: @(#) $Id: tkImgGIF.c,v 1.42 2008/04/09 20:52:16 nijtmans Exp $ */ #include "tkInt.h" @@ -1436,8 +1436,6 @@ Fread( * Types, defines and variables needed to write and compress a GIF. */ -typedef int (* ifunptr) (ClientData clientData); - #define LSB(a) ((unsigned char) (((short)(a)) & 0x00FF)) #define MSB(a) ((unsigned char) (((short)(a)) >> 8)) @@ -1458,22 +1456,21 @@ typedef struct { unsigned char mapa[MAXCOLORMAPSIZE][3]; } GifWriterState; +typedef int (* ifunptr) (GifWriterState *statePtr); + /* * Definition of new functions to write GIFs */ static int color(GifWriterState *statePtr, - int red, int green, int blue, - unsigned char mapa[MAXCOLORMAPSIZE][3]); + int red, int green, int blue); static void compress(int initBits, Tcl_Channel handle, - ifunptr readValue, ClientData clientData); + ifunptr readValue, GifWriterState *statePtr); static int nuevo(GifWriterState *statePtr, - int red, int green, int blue, - unsigned char mapa[MAXCOLORMAPSIZE][3]); + int red, int green, int blue); static void savemap(GifWriterState *statePtr, - Tk_PhotoImageBlock *blockPtr, - unsigned char mapa[MAXCOLORMAPSIZE][3]); -static int ReadValue(ClientData clientData); + Tk_PhotoImageBlock *blockPtr); +static int ReadValue(GifWriterState *statePtr); static int FileWriteGIF( @@ -1510,7 +1507,7 @@ CommonWriteGIF( Tcl_Obj *format, Tk_PhotoImageBlock *blockPtr) { - GifWriterState state, *statePtr = &state; + GifWriterState state; int resolution; long width, height, x; unsigned char c; @@ -1519,40 +1516,40 @@ CommonWriteGIF( top = 0; left = 0; - memset(statePtr, 0, sizeof(state)); + memset(&state, 0, sizeof(state)); - statePtr->pixelSize = blockPtr->pixelSize; - statePtr->greenOffset = blockPtr->offset[1]-blockPtr->offset[0]; - statePtr->blueOffset = blockPtr->offset[2]-blockPtr->offset[0]; - statePtr->alphaOffset = blockPtr->offset[0]; - if (statePtr->alphaOffset < blockPtr->offset[2]) { - statePtr->alphaOffset = blockPtr->offset[2]; + state.pixelSize = blockPtr->pixelSize; + state.greenOffset = blockPtr->offset[1]-blockPtr->offset[0]; + state.blueOffset = blockPtr->offset[2]-blockPtr->offset[0]; + state.alphaOffset = blockPtr->offset[0]; + if (state.alphaOffset < blockPtr->offset[2]) { + state.alphaOffset = blockPtr->offset[2]; } - if (++statePtr->alphaOffset < statePtr->pixelSize) { - statePtr->alphaOffset -= blockPtr->offset[0]; + if (++state.alphaOffset < state.pixelSize) { + state.alphaOffset -= blockPtr->offset[0]; } else { - statePtr->alphaOffset = 0; + state.alphaOffset = 0; } - Tcl_Write(handle, (char *) (statePtr->alphaOffset ? GIF89a : GIF87a), 6); + Tcl_Write(handle, (char *) (state.alphaOffset ? GIF89a : GIF87a), 6); for (x=0 ; xmapa[x][CM_RED] = 255; - statePtr->mapa[x][CM_GREEN] = 255; - statePtr->mapa[x][CM_BLUE] = 255; + state.mapa[x][CM_RED] = 255; + state.mapa[x][CM_GREEN] = 255; + state.mapa[x][CM_BLUE] = 255; } width = blockPtr->width; height = blockPtr->height; - statePtr->pixelo = blockPtr->pixelPtr + blockPtr->offset[0]; - statePtr->pixelPitch = blockPtr->pitch; - savemap(statePtr, blockPtr, statePtr->mapa); - if (statePtr->num >= MAXCOLORMAPSIZE) { + state.pixelo = blockPtr->pixelPtr + blockPtr->offset[0]; + state.pixelPitch = blockPtr->pitch; + savemap(&state, blockPtr); + if (state.num >= MAXCOLORMAPSIZE) { Tcl_AppendResult(interp, "too many colors", NULL); return TCL_ERROR; } - if (statePtr->num<2) { - statePtr->num = 2; + if (state.num<2) { + state.num = 2; } c = LSB(width); Tcl_Write(handle, (char *) &c, 1); @@ -1564,13 +1561,13 @@ CommonWriteGIF( Tcl_Write(handle, (char *) &c, 1); resolution = 0; - while (statePtr->num >> resolution) { + while (state.num >> resolution) { resolution++; } c = 111 + resolution * 17; Tcl_Write(handle, (char *) &c, 1); - statePtr->num = 1 << resolution; + state.num = 1 << resolution; /* * Background color @@ -1585,12 +1582,12 @@ CommonWriteGIF( Tcl_Write(handle, (char *) &c, 1); - for (x=0 ; xnum ; x++) { - c = statePtr->mapa[x][CM_RED]; + for (x=0 ; xmapa[x][CM_GREEN]; + c = state.mapa[x][CM_GREEN]; Tcl_Write(handle, (char *) &c, 1); - c = statePtr->mapa[x][CM_BLUE]; + c = state.mapa[x][CM_BLUE]; Tcl_Write(handle, (char *) &c, 1); } @@ -1598,7 +1595,7 @@ CommonWriteGIF( * Write out extension for transparent colour index, if necessary. */ - if (statePtr->alphaOffset) { + if (state.alphaOffset) { c = GIF_EXTENSION; Tcl_Write(handle, (char *) &c, 1); Tcl_Write(handle, "\371\4\1\0\0\0", 7); @@ -1630,9 +1627,9 @@ CommonWriteGIF( c = resolution; Tcl_Write(handle, (char *) &c, 1); - statePtr->ssize = statePtr->rsize = blockPtr->width; - statePtr->csize = blockPtr->height; - compress(resolution+1, handle, ReadValue, (ClientData) statePtr); + state.ssize = state.rsize = blockPtr->width; + state.csize = blockPtr->height; + compress(resolution+1, handle, ReadValue, &state); c = 0; Tcl_Write(handle, (char *) &c, 1); @@ -1645,14 +1642,13 @@ CommonWriteGIF( static int color( GifWriterState *statePtr, - int red, int green, int blue, - unsigned char mapa[MAXCOLORMAPSIZE][3]) + int red, int green, int blue) { int x = (statePtr->alphaOffset != 0); for (; x<=MAXCOLORMAPSIZE ; x++) { - if ((mapa[x][CM_RED] == red) && (mapa[x][CM_GREEN] == green) && - (mapa[x][CM_BLUE] == blue)) { + if ((statePtr->mapa[x][CM_RED] == red) && (statePtr->mapa[x][CM_GREEN] == green) && + (statePtr->mapa[x][CM_BLUE] == blue)) { return x; } } @@ -1662,14 +1658,13 @@ color( static int nuevo( GifWriterState *statePtr, - int red, int green, int blue, - unsigned char mapa[MAXCOLORMAPSIZE][3]) + int red, int green, int blue) { int x = (statePtr->alphaOffset != 0); for (; x<=statePtr->num ; x++) { - if ((mapa[x][CM_RED] == red) && (mapa[x][CM_GREEN] == green) && - (mapa[x][CM_BLUE] == blue)) { + if ((statePtr->mapa[x][CM_RED] == red) && (statePtr->mapa[x][CM_GREEN] == green) && + (statePtr->mapa[x][CM_BLUE] == blue)) { return 0; } } @@ -1679,8 +1674,7 @@ nuevo( static void savemap( GifWriterState *statePtr, - Tk_PhotoImageBlock *blockPtr, - unsigned char mapa[MAXCOLORMAPSIZE][3]) + Tk_PhotoImageBlock *blockPtr) { unsigned char *colores; int x, y; @@ -1688,9 +1682,9 @@ savemap( if (statePtr->alphaOffset) { statePtr->num = 0; - mapa[0][CM_RED] = 0xd9; - mapa[0][CM_GREEN] = 0xd9; - mapa[0][CM_BLUE] = 0xd9; + statePtr->mapa[0][CM_RED] = 0xd9; + statePtr->mapa[0][CM_GREEN] = 0xd9; + statePtr->mapa[0][CM_BLUE] = 0xd9; } else { statePtr->num = -1; } @@ -1702,14 +1696,14 @@ savemap( red = colores[0]; green = colores[statePtr->greenOffset]; blue = colores[statePtr->blueOffset]; - if (nuevo(statePtr, red, green, blue, mapa)) { + if (nuevo(statePtr, red, green, blue)) { statePtr->num++; if (statePtr->num >= MAXCOLORMAPSIZE) { return; } - mapa[statePtr->num][CM_RED] = red; - mapa[statePtr->num][CM_GREEN] = green; - mapa[statePtr->num][CM_BLUE] = blue; + statePtr->mapa[statePtr->num][CM_RED] = red; + statePtr->mapa[statePtr->num][CM_GREEN] = green; + statePtr->mapa[statePtr->num][CM_BLUE] = blue; } } colores += statePtr->pixelSize; @@ -1719,9 +1713,8 @@ savemap( static int ReadValue( - ClientData clientData) + GifWriterState *statePtr) { - GifWriterState *statePtr = (GifWriterState *) clientData; unsigned int col; if (statePtr->csize == 0) { @@ -1732,7 +1725,7 @@ ReadValue( } else { col = color(statePtr, statePtr->pixelo[0], statePtr->pixelo[statePtr->greenOffset], - statePtr->pixelo[statePtr->blueOffset], statePtr->mapa); + statePtr->pixelo[statePtr->blueOffset]); } statePtr->pixelo += statePtr->pixelSize; if (--statePtr->ssize <= 0) { @@ -2175,63 +2168,63 @@ compress( int initBits, Tcl_Channel handle, ifunptr readValue, - ClientData clientData) + GifWriterState *statePtr) { int c; - miGIFState_t state, *statePtr = &state; + miGIFState_t state; - memset(statePtr, 0, sizeof(state)); + memset(&state, 0, sizeof(state)); - statePtr->ofile = handle; - statePtr->obuf = 0; - statePtr->obits = 0; - statePtr->oblen = 0; - statePtr->codeClear = 1 << (initBits - 1); - statePtr->codeEOF = statePtr->codeClear + 1; - statePtr->runlengthBaseCode = statePtr->codeEOF + 1; - statePtr->outputBumpInit = (1 << (initBits - 1)) - 1; + state.ofile = handle; + state.obuf = 0; + state.obits = 0; + state.oblen = 0; + state.codeClear = 1 << (initBits - 1); + state.codeEOF = state.codeClear + 1; + state.runlengthBaseCode = state.codeEOF + 1; + state.outputBumpInit = (1 << (initBits - 1)) - 1; /* * For images with a lot of runs, making outputClearInit larger will give * better compression. */ - statePtr->outputClearInit = - (initBits <= 3) ? 9 : (statePtr->outputBumpInit-1); + state.outputClearInit = + (initBits <= 3) ? 9 : (state.outputBumpInit-1); #ifdef MIGIF_DEBUGGING_ENVARS { const char *ocienv = getenv("MIGIF_OUT_CLEAR_INIT"); if (ocienv) { - statePtr->outputClearInit = atoi(ocienv); + state.outputClearInit = atoi(ocienv); DEBUGMSG(("[overriding outputClearInit to %d]\n", - statePtr->outputClearInit)); + state.outputClearInit)); } } #endif - statePtr->outputBitsInit = initBits; - statePtr->maxOcodes = - (1 << GIFBITS) - ((1 << (statePtr->outputBitsInit - 1)) + 3); - didClear(statePtr); - output(statePtr, statePtr->codeClear); - statePtr->runlengthCount = 0; + state.outputBitsInit = initBits; + state.maxOcodes = + (1 << GIFBITS) - ((1 << (state.outputBitsInit - 1)) + 3); + didClear(&state); + output(&state, state.codeClear); + state.runlengthCount = 0; while (1) { - c = readValue(clientData); - if (statePtr->runlengthCount>0 && statePtr->runlengthPixel!=c) { - runlengthFlush(statePtr); + c = readValue(statePtr); + if (state.runlengthCount>0 && state.runlengthPixel!=c) { + runlengthFlush(&state); } if (c == EOF) { break; } - if (statePtr->runlengthPixel == c) { - statePtr->runlengthCount++; + if (state.runlengthPixel == c) { + state.runlengthCount++; } else { - statePtr->runlengthPixel = c; - statePtr->runlengthCount = 1; + state.runlengthPixel = c; + state.runlengthCount = 1; } } - output(statePtr, statePtr->codeEOF); - outputFlush(statePtr); + output(&state, state.codeEOF); + outputFlush(&state); } /* -- cgit v0.12 From e9704ff6d001b364f815e856576c9a0446fc8190 Mon Sep 17 00:00:00 2001 From: nijtmans Date: Wed, 9 Apr 2008 21:00:54 +0000 Subject: Let the GIF writer use a real LZW compressor. --- ChangeLog | 4 + generic/tkImgGIF.c | 765 ++++++++++++++++++++++------------------------------- 2 files changed, 325 insertions(+), 444 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6d5578c..610e634 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-04-09 Jan Nijtmans + + * generic/tkImgGIF.c: Let the GIF writer use a real LZW compressor. + 2008-04-08 Pat Thoyts * win/ttkWinXpTheme.c: Provide a visual-styles API element engine diff --git a/generic/tkImgGIF.c b/generic/tkImgGIF.c index b2b337c..9a823bf 100644 --- a/generic/tkImgGIF.c +++ b/generic/tkImgGIF.c @@ -32,7 +32,7 @@ * This file also contains code from miGIF. See lower down in file for the * applicable copyright notice for that portion. * - * RCS: @(#) $Id: tkImgGIF.c,v 1.42 2008/04/09 20:52:16 nijtmans Exp $ + * RCS: @(#) $Id: tkImgGIF.c,v 1.43 2008/04/09 21:00:54 nijtmans Exp $ */ #include "tkInt.h" @@ -1739,501 +1739,378 @@ ReadValue( } /* - *----------------------------------------------------------------------- * - * miGIF Compression - mouse and ivo's GIF-compatible compression + * GIF Image compression - modified 'compress' * - * -run length encoding compression routines- + * Based on: compress.c - File compression ala IEEE Computer, June 1984. * - * Copyright (C) 1998 Hutchison Avenue Software Corporation - * http://www.hasc.com - * info@hasc.com + * By Authors: Spencer W. Thomas (decvax!harpo!utah-cs!utah-gr!thomas) + * Jim McKie (decvax!mcvax!jim) + * Steve Davies (decvax!vax135!petsd!peora!srd) + * Ken Turkowski (decvax!decwrl!turtlevax!ken) + * James A. Woods (decvax!ihnp4!ames!jaw) + * Joe Orost (decvax!vax135!petsd!joe) * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, provided - * that the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation. This software is provided "AS IS." The Hutchison Avenue - * Software Corporation disclaims all warranties, either express or implied, - * including but not limited to implied warranties of merchantability and - * fitness for a particular purpose, with respect to this code and - * accompanying documentation. - * - * The miGIF compression routines do not, strictly speaking, generate files - * conforming to the GIF spec, since the image data is not LZW-compressed - * (this is the point: in order to avoid transgression of the Unisys patent on - * the LZW algorithm.) However, miGIF generates data streams that any - * reasonably sane LZW decompresser will decompress to what we want. - * - * miGIF compression uses run length encoding. It compresses horizontal runs - * of pixels of the same color. This type of compression gives good results on - * images with many runs, for example images with lines, text and solid shapes - * on a solid-colored background. It gives little or no compression on images - * with few runs, for example digital or scanned photos. - * - * der Mouse - * mouse@rodents.montreal.qc.ca - * 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B - * - * ivo@hasc.com - * - * The Graphics Interchange Format(c) is the Copyright property of CompuServe - * Incorporated. GIF(sm) is a Service Mark property of CompuServe Incorporated. - * - *----------------------------------------------------------------------- */ +#define MAXCODE(n_bits) (((long) 1 << (n_bits)) - 1) + typedef struct { - int runlengthPixel; - int runlengthBaseCode; - int runlengthCount; - int runlengthTablePixel; - int runlengthTableMax; - int justCleared; - int outputBits; - int outputBitsInit; - int outputCount; - int outputBump; - int outputBumpInit; - int outputClear; - int outputClearInit; - int maxOcodes; - int codeClear; - int codeEOF; - unsigned int obuf; - int obits; - Tcl_Channel ofile; - unsigned char oblock[256]; - int oblen; -} miGIFState_t; - + int n_bits; /* number of bits/code */ + long maxcode; /* maximum code, given n_bits */ + int htab[HSIZE]; + unsigned int codetab[HSIZE]; + + long hsize; /* for dynamic table sizing */ + /* - * Used only when debugging GIF compression code + * To save much memory, we overlay the table used by compress() with those + * used by decompress(). The tab_prefix table is the same size and type + * as the codetab. The tab_suffix table needs 2**GIFBITS characters. We + * get this from the beginning of htab. The output stack uses the rest + * of htab, and contains characters. There is plenty of room for any + * possible stack (stack used to be 8000 characters). */ -/* #define MIGIF_DEBUGGING_ENVARS */ -#ifdef MIGIF_DEBUGGING_ENVARS + int free_ent; /* first unused entry */ /* - * This debugging code is _absolutely_ not thread-safe. It's also not normally - * enabled either. + * block compression parameters -- after all codes are used up, + * and compression rate changes, start over. */ + int clear_flg; -static int verboseSet = 0; -static int verbose; -#define MIGIF_VERBOSE (verboseSet?verbose:setVerbose()) -#define DEBUGMSG(printfArgs) if (MIGIF_VERBOSE) { printf printfArgs; } + int offset; + unsigned int in_count; /* length of input */ + unsigned int out_count; /* # of codes output (for debugging) */ -static int -setVerbose(void) -{ - verbose = !!getenv("MIGIF_VERBOSE"); - verboseSet = 1; - return verbose; -} +/* + * compress stdin to stdout + * + * Algorithm: use open addressing double hashing (no chaining) on the + * prefix code / next character combination. We do a variant of Knuth's + * algorithm D (vol. 3, sec. 6.4) along with G. Knott's relatively-prime + * secondary probe. Here, the modular division first probe is gives way + * to a faster exclusive-or manipulation. Also do block compression with + * an adaptive reset, whereby the code table is cleared when the compression + * ratio decreases, but after the table fills. The variable-length output + * codes are re-sized at this point, and a special CLEAR code is generated + * for the decompressor. Late addition: construct the table according to + * file size for noticeable speed improvement on small files. Please direct + * questions about this implementation to ames!jaw. + */ + + int g_init_bits; + Tcl_Channel g_outfile; + + int ClearCode; + int EOFCode; + + unsigned long cur_accum; + int cur_bits; + +/* + * Number of characters so far in this 'packet' + */ + int a_count; + +/* + * Define the storage for the packet accumulator + */ + unsigned char accum[256]; +} GIFState_t; + +static void output _ANSI_ARGS_((GIFState_t *statePtr, long code)); +static void cl_block _ANSI_ARGS_((GIFState_t *statePtr)); +static void cl_hash _ANSI_ARGS_((GIFState_t *statePtr, int hsize)); +static void char_init _ANSI_ARGS_((GIFState_t *statePtr)); +static void char_out _ANSI_ARGS_((GIFState_t *statePtr, int c)); +static void flush_char _ANSI_ARGS_((GIFState_t *statePtr)); + +static void compress(int initBits, Tcl_Channel handle, + ifunptr readValue, GifWriterState *statePtr); -static const char * -binformat( - unsigned int v, - int nbits) +static void compress(init_bits, handle, readValue, statePtr) + int init_bits; + Tcl_Channel handle; + ifunptr readValue; + GifWriterState *statePtr; { - static char bufs[8][64]; - static int bhand = 0; - unsigned int bit; - int bno; - char *bp; - - bhand--; - if (bhand < 0) { - bhand = (sizeof(bufs) / sizeof(bufs[0])) - 1; - } - bp = &bufs[bhand][0]; - for (bno=nbits-1,bit=((unsigned int)1)<=0 ; bno--,bit>>=1) { - *bp++ = (v & bit) ? '1' : '0'; - if (((bno&3) == 0) && (bno != 0)) { - *bp++ = '.'; - } - } - *bp = '\0'; - return &bufs[bhand][0]; -} -#else /* !MIGIF_DEBUGGING_ENVARS */ -#define DEBUGMSG(printfArgs) /* do nothing */ + register long fcode; + register long i = 0; + register int c; + register long ent; + register long disp; + register long hsize_reg; + register int hshift; + GIFState_t state; + + memset(&state, 0, sizeof(state)); + /* + * Set up the globals: g_init_bits - initial number of bits + * g_outfile - pointer to output file + */ + state.g_init_bits = init_bits; + state.g_outfile = handle; + + /* + * Set up the necessary values + */ + state.offset = 0; + state.hsize = HSIZE; + state.out_count = 0; + state.clear_flg = 0; + state.in_count = 1; + state.maxcode = MAXCODE(state.n_bits = state.g_init_bits); + + state.ClearCode = (1 << (init_bits - 1)); + state.EOFCode = state.ClearCode + 1; + state.free_ent = state.ClearCode + 2; + + char_init(&state); + + ent = readValue(statePtr); + + hshift = 0; + for ( fcode = (long) state.hsize; fcode < 65536L; fcode *= 2L ) + hshift++; + hshift = 8 - hshift; /* set hash code range bound */ + + hsize_reg = state.hsize; + cl_hash(&state, (int) hsize_reg); /* clear hash table */ + + output(&state, (long)state.ClearCode); + +#ifdef SIGNED_COMPARE_SLOW + while ( (c = readValue(statePtr) ) != (unsigned) EOF ) { +#else + while ( (c = readValue(statePtr)) != EOF ) { #endif - -static void -writeBlock( - miGIFState_t *statePtr) -{ - unsigned char c; -#ifdef MIGIF_DEBUGGING_ENVARS - if (MIGIF_VERBOSE) { - int i; - printf("writeBlock %d:", statePtr->oblen); - for (i=0 ; ioblen ; i++) { - printf(" %02x", statePtr->oblock[i]); - } - printf("\n"); - } + state.in_count++; + + fcode = (long) (((long) c << GIFBITS) + ent); + i = (((long)c << hshift) ^ ent); /* xor hashing */ + + if (state.htab[i] == fcode) { + ent = state.codetab[i]; + continue; + } else if ( (long) state.htab[i] < 0 ) /* empty slot */ + goto nomatch; + disp = hsize_reg - i; /* secondary hash (after G. Knott) */ + if ( i == 0 ) + disp = 1; +probe: + if ( (i -= disp) < 0 ) + i += hsize_reg; + + if (state.htab[i] == fcode) { + ent = state.codetab[i]; + continue; + } + if ( (long) state.htab[i] > 0 ) + goto probe; +nomatch: + output (&state, (long) ent); + state.out_count++; + ent = c; +#ifdef SIGNED_COMPARE_SLOW + if ( (unsigned) free_ent < (unsigned) ((long)1 << GIFBITS)) { +#else + if (state.free_ent < ((long)1 << GIFBITS)) { #endif - c = statePtr->oblen; - Tcl_Write(statePtr->ofile, (char *) &c, 1); - Tcl_Write(statePtr->ofile, (char *) &statePtr->oblock[0], statePtr->oblen); - statePtr->oblen = 0; -} - -static void -blockOut( - miGIFState_t *statePtr, - unsigned c) -{ - DEBUGMSG(("blockOut %s\n", binformat(c, 8))); - statePtr->oblock[statePtr->oblen++] = (unsigned char) c; - if (statePtr->oblen >= 255) { - writeBlock(statePtr); + state.codetab[i] = state.free_ent++; /* code -> hashtable */ + state.htab[i] = fcode; + } else + cl_block(&state); } + /* + * Put out the final code. + */ + output(&state, (long)ent); + state.out_count++; + output(&state, (long) state.EOFCode); + + return; } - -static void -blockFlush( - miGIFState_t *statePtr) -{ - DEBUGMSG(("blockFlush\n")); - if (statePtr->oblen > 0) { - writeBlock(statePtr); - } -} - -static void -output( - miGIFState_t *statePtr, - int val) -{ - DEBUGMSG(("output %s [%s %d %d]\n", binformat(val, statePtr->outputBits), - binformat(statePtr->obuf, statePtr->obits), statePtr->obits, - statePtr->outputBits)); - statePtr->obuf |= val << statePtr->obits; - statePtr->obits += statePtr->outputBits; - while (statePtr->obits >= 8) { - blockOut(statePtr, statePtr->obuf & 0xff); - statePtr->obuf >>= 8; - statePtr->obits -= 8; - } - DEBUGMSG(("output leaving [%s %d]\n", - binformat(statePtr->obuf, statePtr->obits), statePtr->obits)); -} - -static void -outputFlush( - miGIFState_t *statePtr) -{ - DEBUGMSG(("outputFlush\n")); - if (statePtr->obits > 0) { - blockOut(statePtr, statePtr->obuf); - } - blockFlush(statePtr); -} - -static void -didClear( - miGIFState_t *statePtr) -{ - DEBUGMSG(("didClear\n")); - statePtr->outputBits = statePtr->outputBitsInit; - statePtr->outputBump = statePtr->outputBumpInit; - statePtr->outputClear = statePtr->outputClearInit; - statePtr->outputCount = 0; - statePtr->runlengthTableMax = 0; - statePtr->justCleared = 1; -} - + +/***************************************************************** + * TAG( output ) + * + * Output the given code. + * Inputs: + * code: A n_bits-bit integer. If == -1, then EOF. This assumes + * that n_bits =< (long) wordsize - 1. + * Outputs: + * Outputs code to the file. + * Assumptions: + * Chars are 8 bits long. + * Algorithm: + * Maintain a GIFBITS character long buffer (so that 8 codes will + * fit in it exactly). Use the VAX insv instruction to insert each + * code in turn. When the buffer fills up empty it and start over. + */ + +static const +unsigned long masks[] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000F, + 0x001F, 0x003F, 0x007F, 0x00FF, + 0x01FF, 0x03FF, 0x07FF, 0x0FFF, + 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF }; + static void -outputPlain( - miGIFState_t *statePtr, - int c) +output(statePtr, code) + GIFState_t *statePtr; + long code; { - DEBUGMSG(("outputPlain %s\n", binformat(c, statePtr->outputBits))); - statePtr->justCleared = 0; - output(statePtr, c); - statePtr->outputCount++; - if (statePtr->outputCount >= statePtr->outputBump) { - statePtr->outputBits++; - statePtr->outputBump += 1 << (statePtr->outputBits - 1); - } - if (statePtr->outputCount >= statePtr->outputClear) { - output(statePtr, statePtr->codeClear); - didClear(statePtr); - } -} - -static unsigned int -isqrt( - unsigned int x) -{ - unsigned int r; - unsigned int v; + statePtr->cur_accum &= masks[statePtr->cur_bits]; - if (x < 2) { - return x; - } - for (v=x,r=1 ; v ; v>>=2,r<<=1); - while (1) { - v = ((x / r) + r) / 2; - if (v==r || v==r+1) { - return r; - } - r = v; + if (statePtr->cur_bits > 0) { + statePtr->cur_accum |= ((long) code << statePtr->cur_bits); + } else { + statePtr->cur_accum = code; } -} - -static int -computeTriangleCount( - unsigned int count, - unsigned int nrepcodes) -{ - unsigned int perrep; - unsigned int cost; - cost = 0; - perrep = (nrepcodes * (nrepcodes+1)) / 2; - while (count >= perrep) { - cost += nrepcodes; - count -= perrep; + statePtr->cur_bits += statePtr->n_bits; + + while (statePtr->cur_bits >= 8 ) { + char_out(statePtr, (unsigned int)(statePtr->cur_accum & 0xff)); + statePtr->cur_accum >>= 8; + statePtr->cur_bits -= 8; } - if (count > 0) { - unsigned int n = isqrt(count); - while (n*(n+1) >= 2*count) { - n--; - } - while (n*(n+1) < 2*count) { - n++; + /* + * If the next entry is going to be too big for the code size, + * then increase it, if possible. + */ + + if ((statePtr->free_ent > statePtr->maxcode)|| statePtr->clear_flg ) { + if (statePtr->clear_flg) { + statePtr->maxcode = MAXCODE(statePtr->n_bits = statePtr->g_init_bits); + statePtr->clear_flg = 0; + } else { + statePtr->n_bits++; + if (statePtr->n_bits == GIFBITS) { + statePtr->maxcode = (long)1 << GIFBITS; + } else { + statePtr->maxcode = MAXCODE(statePtr->n_bits); + } } - cost += n; } - return (int) cost + 1; -} - -static void -maxOutputClear( - miGIFState_t *statePtr) -{ - statePtr->outputClear = statePtr->maxOcodes; -} - -static void -resetOutputClear( - miGIFState_t *statePtr) -{ - statePtr->outputClear = statePtr->outputClearInit; - if (statePtr->outputCount >= statePtr->outputClear) { - output(statePtr, statePtr->codeClear); - didClear(statePtr); + + if (code == statePtr->EOFCode) { + /* + * At EOF, write the rest of the buffer. + */ + while (statePtr->cur_bits > 0) { + char_out(statePtr, (unsigned int)(statePtr->cur_accum & 0xff)); + statePtr->cur_accum >>= 8; + statePtr->cur_bits -= 8; + } + flush_char(statePtr); } } - + +/* + * Clear out the hash table + */ static void -runlengthFlushFromClear( - miGIFState_t *statePtr, - int count) +cl_block(statePtr) /* table clear for block compress */ + GIFState_t *statePtr; { - int n; - - DEBUGMSG(("runlengthFlushFromClear %d\n", count)); - maxOutputClear(statePtr); - statePtr->runlengthTablePixel = statePtr->runlengthPixel; - n = 1; - while (count > 0) { - if (n == 1) { - statePtr->runlengthTableMax = 1; - outputPlain(statePtr, statePtr->runlengthPixel); - count--; - } else if (count >= n) { - statePtr->runlengthTableMax = n; - outputPlain(statePtr, statePtr->runlengthBaseCode+n-2); - count -= n; - } else if (count == 1) { - statePtr->runlengthTableMax++; - outputPlain(statePtr, statePtr->runlengthPixel); - count = 0; - } else { - statePtr->runlengthTableMax++; - outputPlain(statePtr, statePtr->runlengthBaseCode+count-2); - count = 0; - } - if (statePtr->outputCount == 0) { - n = 1; - } else { - n++; - } - } - resetOutputClear(statePtr); - DEBUGMSG(("runlengthFlushFromClear leaving tableMax=%d\n", - statePtr->runlengthTableMax)); + + cl_hash (statePtr, (int) statePtr->hsize); + statePtr->free_ent = statePtr->ClearCode + 2; + statePtr->clear_flg = 1; + + output(statePtr, (long) statePtr->ClearCode); } - + static void -runlengthFlushClearOrRep( - miGIFState_t *statePtr, - int count) +cl_hash(statePtr, hsize) /* reset code table */ + GIFState_t *statePtr; + int hsize; { - int withclr; - - DEBUGMSG(("runlengthFlushClearOrRep %d\n", count)); - withclr = computeTriangleCount((unsigned) count, - (unsigned) statePtr->maxOcodes); - if (withclr < count) { - output(statePtr, statePtr->codeClear); - didClear(statePtr); - runlengthFlushFromClear(statePtr, count); - } else { - for (; count>0 ; count--) { - outputPlain(statePtr, statePtr->runlengthPixel); - } + register int *htab_p = statePtr->htab+hsize; + register long i; + register long m1 = -1; + + i = hsize - 16; + do { /* might use Sys V memset(3) here */ + *(htab_p-16) = m1; + *(htab_p-15) = m1; + *(htab_p-14) = m1; + *(htab_p-13) = m1; + *(htab_p-12) = m1; + *(htab_p-11) = m1; + *(htab_p-10) = m1; + *(htab_p-9) = m1; + *(htab_p-8) = m1; + *(htab_p-7) = m1; + *(htab_p-6) = m1; + *(htab_p-5) = m1; + *(htab_p-4) = m1; + *(htab_p-3) = m1; + *(htab_p-2) = m1; + *(htab_p-1) = m1; + htab_p -= 16; + } while ((i -= 16) >= 0); + + for (i += 16; i > 0; i--) { + *--htab_p = m1; } } - + + +/****************************************************************************** + * + * GIF Specific routines + * + ******************************************************************************/ + +/* + * Set up the 'byte output' routine + */ static void -runlengthFlushWithTable( - miGIFState_t *statePtr, - int count) +char_init(statePtr) + GIFState_t *statePtr; { - int repmax; - int repleft; - int leftover; - - DEBUGMSG(("runlengthFlushWithTable %d\n", count)); - repmax = count / statePtr->runlengthTableMax; - leftover = count % statePtr->runlengthTableMax; - repleft = (leftover ? 1 : 0); - if (statePtr->outputCount+repmax+repleft > statePtr->maxOcodes) { - repmax = statePtr->maxOcodes - statePtr->outputCount; - leftover = count - (repmax * statePtr->runlengthTableMax); - repleft = computeTriangleCount((unsigned) leftover, - (unsigned) statePtr->maxOcodes); - } - DEBUGMSG(("runlengthFlushWithTable repmax=%d leftover=%d repleft=%d\n", - repmax, leftover, repleft)); - if (computeTriangleCount((unsigned) count, (unsigned) statePtr->maxOcodes) - < repmax+repleft) { - output(statePtr, statePtr->codeClear); - didClear(statePtr); - runlengthFlushFromClear(statePtr, count); - return; - } - maxOutputClear(statePtr); - for (; repmax>0 ; repmax--) { - outputPlain(statePtr, - statePtr->runlengthBaseCode + statePtr->runlengthTableMax - 2); - } - if (leftover) { - if (statePtr->justCleared) { - runlengthFlushFromClear(statePtr, leftover); - } else if (leftover == 1) { - outputPlain(statePtr, statePtr->runlengthPixel); - } else { - outputPlain(statePtr, statePtr->runlengthBaseCode + leftover - 2); - } - } - resetOutputClear(statePtr); + statePtr->a_count = 0; + statePtr->cur_accum = 0; + statePtr->cur_bits = 0; } - + +/* + * Add a character to the end of the current packet, and if it is 254 + * characters, flush the packet to disk. + */ static void -runlengthFlush( - miGIFState_t *statePtr) +char_out(statePtr, c) + GIFState_t *statePtr; + int c; { - DEBUGMSG(("runlengthFlush [ %d %d\n", statePtr->runlengthCount, - statePtr->runlengthPixel)); - if (statePtr->runlengthCount == 1) { - outputPlain(statePtr, statePtr->runlengthPixel); - statePtr->runlengthCount = 0; - DEBUGMSG(("runlengthFlush ]\n")); - return; - } - if (statePtr->justCleared) { - runlengthFlushFromClear(statePtr, statePtr->runlengthCount); - } else if ((statePtr->runlengthTableMax < 2) - || (statePtr->runlengthTablePixel != statePtr->runlengthPixel)) { - runlengthFlushClearOrRep(statePtr, statePtr->runlengthCount); - } else { - runlengthFlushWithTable(statePtr, statePtr->runlengthCount); + statePtr->accum[statePtr->a_count++] = c; + if (statePtr->a_count >= 254) { + flush_char(statePtr); } - DEBUGMSG(("runlengthFlush ]\n")); - statePtr->runlengthCount = 0; } - + +/* + * Flush the packet to disk, and reset the accumulator + */ static void -compress( - int initBits, - Tcl_Channel handle, - ifunptr readValue, - GifWriterState *statePtr) +flush_char(statePtr) + GIFState_t *statePtr; { - int c; - miGIFState_t state; - - memset(&state, 0, sizeof(state)); - - state.ofile = handle; - state.obuf = 0; - state.obits = 0; - state.oblen = 0; - state.codeClear = 1 << (initBits - 1); - state.codeEOF = state.codeClear + 1; - state.runlengthBaseCode = state.codeEOF + 1; - state.outputBumpInit = (1 << (initBits - 1)) - 1; - - /* - * For images with a lot of runs, making outputClearInit larger will give - * better compression. - */ - - state.outputClearInit = - (initBits <= 3) ? 9 : (state.outputBumpInit-1); -#ifdef MIGIF_DEBUGGING_ENVARS - { - const char *ocienv = getenv("MIGIF_OUT_CLEAR_INIT"); - - if (ocienv) { - state.outputClearInit = atoi(ocienv); - DEBUGMSG(("[overriding outputClearInit to %d]\n", - state.outputClearInit)); - } - } -#endif - state.outputBitsInit = initBits; - state.maxOcodes = - (1 << GIFBITS) - ((1 << (state.outputBitsInit - 1)) + 3); - didClear(&state); - output(&state, state.codeClear); - state.runlengthCount = 0; - while (1) { - c = readValue(statePtr); - if (state.runlengthCount>0 && state.runlengthPixel!=c) { - runlengthFlush(&state); - } - if (c == EOF) { - break; - } - if (state.runlengthPixel == c) { - state.runlengthCount++; - } else { - state.runlengthPixel = c; - state.runlengthCount = 1; - } + unsigned char c; + if (statePtr->a_count > 0) { + c = statePtr->a_count; + Tcl_Write(statePtr->g_outfile, (CONST char *) &c, 1); + Tcl_Write(statePtr->g_outfile, (CONST char *) statePtr->accum, statePtr->a_count); + statePtr->a_count = 0; } - output(&state, state.codeEOF); - outputFlush(&state); } -/* - *----------------------------------------------------------------------- - * - * End of miGIF section - See copyright notice at start of section. - * - *----------------------------------------------------------------------- - */ +/* The End */ /* * Local Variables: -- cgit v0.12 From 96cf871d54db54453e7e29dca5a64b7da157a22f Mon Sep 17 00:00:00 2001 From: patthoyts Date: Mon, 14 Apr 2008 20:48:50 +0000 Subject: Fixed bug #1941740: tk_chooseColor -title was broken in revision 1.40 after some code cleanup. Added tests for this windows dialog to avoid regression. --- ChangeLog | 6 ++++ tests/winDialog.test | 80 ++++++++++++++++++++++++++++++++++++++++++++++++---- win/tkWinDialog.c | 6 ++-- win/tkWinTest.c | 5 +++- 4 files changed, 89 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 610e634..288b1a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-04-14 Pat Thoyts + + * win/tkWinDialog.c: Fix bug #1941740: tk_chooseColor -title broken + * win/tkWinTest.c: Added parent to testgetwininfo + * tests/winDialog.test: Created some tk_chooseColor win tests. + 2008-04-09 Jan Nijtmans * generic/tkImgGIF.c: Let the GIF writer use a real LZW compressor. diff --git a/tests/winDialog.test b/tests/winDialog.test index d4e24e5..2ba2873 100644 --- a/tests/winDialog.test +++ b/tests/winDialog.test @@ -6,7 +6,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # Copyright (c) 1998-1999 ActiveState Corporation. # -# RCS: @(#) $Id: winDialog.test,v 1.15 2007/12/13 15:27:55 dgp Exp $ +# RCS: @(#) $Id: winDialog.test,v 1.16 2008/04/14 20:48:50 patthoyts Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -57,10 +57,80 @@ proc SetText {button text} { return [testwinevent $::tk_dialog $button WM_SETTEXT $text] } -test winDialog-1.1 {Tk_ChooseColorObjCmd} {nt} { -} {} - -test winDialog-2.1 {ColorDlgHookProc} {nt} { +test winDialog-1.1.0 {Tk_ChooseColorObjCmd} -constraints { + testwinevent +} -body { + start {tk_chooseColor} + then { + Click cancel + } +} -result {0} +test winDialog-1.1.1 {Tk_ChooseColorObjCmd} -constraints { + testwinevent +} -body { + start {set clr [tk_chooseColor -initialcolor "#ff9933"]} + then { + set x [Click cancel] + } + list $x $clr +} -result {0 {}} +test winDialog-1.1.2 {Tk_ChooseColorObjCmd} -constraints { + testwinevent +} -body { + start {set clr [tk_chooseColor -initialcolor "#ff9933"]} + then { + set x [Click 1] + } + list $x $clr +} -result [list 0 "#ff9933"] +test winDialog-1.1.3 {Tk_ChooseColorObjCmd: -title} -constraints { + testwinevent +} -body { + set x {} + start {set clr [tk_chooseColor -initialcolor "#ff9933" -title "Hello"]} + then { + array set a [testgetwindowinfo $::tk_dialog] + if {[info exists a(text)]} {lappend x $a(text)} + lappend x [Click 1] + } + lappend x $clr +} -result [list Hello 0 "#ff9933"] +test winDialog-1.1.4 {Tk_ChooseColorObjCmd: -title} -constraints { + testwinevent +} -body { + set x {} + start { + set clr [tk_chooseColor -initialcolor "#ff9933" \ + -title "\u041f\u0440\u0438\u0432\u0435\u0442"] + } + then { + array set a [testgetwindowinfo $::tk_dialog] + if {[info exists a(text)]} {lappend x $a(text)} + lappend x [Click 1] + } + lappend x $clr +} -result [list "\u041f\u0440\u0438\u0432\u0435\u0442" 0 "#ff9933"] +test winDialog-1.1.5 {Tk_ChooseColorObjCmd: -parent} -constraints { + testwinevent +} -body { + start {set clr [tk_chooseColor -initialcolor "#ff9933" -parent .]} + set x {} + then { + array set a [testgetwindowinfo $::tk_dialog] + if {[info exists a(parent)]} { + append x [expr {$a(parent) == [wm frame .]}] + } + Click 1 + } + list $x $clr +} -result [list 1 "#ff9933"] +test winDialog-1.1.6 {Tk_ChooseColorObjCmd: -parent} -constraints { + testwinevent +} -body { + tk_chooseColor -initialcolor "#ff9933" -parent .xyzzy12 +} -returnCodes error -match glob -result {bad window path name*} + +test winDialog-2.1 {ColorDlgHookProc} {emptyTest nt} { } {} test winDialog-3.1 {Tk_GetOpenFileObjCmd} {nt testwinevent} { diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c index ec6ede9..da88672 100644 --- a/win/tkWinDialog.c +++ b/win/tkWinDialog.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinDialog.c,v 1.50 2008/01/31 23:31:02 hobbs Exp $ + * RCS: @(#) $Id: tkWinDialog.c,v 1.51 2008/04/14 20:48:50 patthoyts Exp $ * */ @@ -455,13 +455,15 @@ ColorDlgHookProc( const char *title; CHOOSECOLOR *ccPtr; - switch (uMsg) { + if (WM_INITDIALOG == uMsg) { + /* * Set the title string of the dialog. */ ccPtr = (CHOOSECOLOR *) lParam; title = (const char *) ccPtr->lCustData; + if ((title != NULL) && (title[0] != '\0')) { Tcl_DString ds; diff --git a/win/tkWinTest.c b/win/tkWinTest.c index f92a8cc..0cdcb58 100644 --- a/win/tkWinTest.c +++ b/win/tkWinTest.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinTest.c,v 1.15 2008/04/09 20:48:10 nijtmans Exp $ + * RCS: @(#) $Id: tkWinTest.c,v 1.16 2008/04/14 20:48:51 patthoyts Exp $ */ #include "tkWinInt.h" @@ -464,6 +464,9 @@ TestgetwindowinfoObjCmd( Tcl_ListObjAppendElement(interp, resObj, Tcl_NewStringObj("text", -1)); Tcl_ListObjAppendElement(interp, resObj, textObj); + Tcl_ListObjAppendElement(interp, resObj, Tcl_NewStringObj("parent", -1)); + Tcl_ListObjAppendElement(interp, resObj, + Tcl_NewLongObj((long)GetParent(hwnd))); childrenObj = Tcl_NewListObj(0, NULL); EnumChildWindows(hwnd, EnumChildrenProc, (LPARAM)childrenObj); -- cgit v0.12 From f4a2a378897fa69d2d7f86f96f00c8282d5a34b5 Mon Sep 17 00:00:00 2001 From: das Date: Tue, 15 Apr 2008 10:55:49 +0000 Subject: * configure tktest-X11 with --disable-corefoundation to enable testing of both notifiers from Xcode * add vsapi.test * sync Wish.xcode with Wish.xcodeproj --- macosx/Wish.xcode/project.pbxproj | 24 ++++++++++++++++++++---- macosx/Wish.xcodeproj/project.pbxproj | 8 +++++--- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/macosx/Wish.xcode/project.pbxproj b/macosx/Wish.xcode/project.pbxproj index 69b1de0..71045b7 100644 --- a/macosx/Wish.xcode/project.pbxproj +++ b/macosx/Wish.xcode/project.pbxproj @@ -598,6 +598,7 @@ F9099B8A0CC67D30005A9580 /* textpeer.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = textpeer.tcl; sourceTree = ""; }; F9099B8B0CC67D3E005A9580 /* ttkbut.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ttkbut.tcl; sourceTree = ""; }; F91E62260C1AE686006C9D96 /* Tclsh-Info.plist.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "Tclsh-Info.plist.in"; sourceTree = ""; }; + F92240290D7C620F005EC715 /* knightstour.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = knightstour.tcl; sourceTree = ""; }; F936FCD70CCD984500716967 /* ttkprogress.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ttkprogress.tcl; sourceTree = ""; }; F936FCD80CCD984600716967 /* tree.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tree.tcl; sourceTree = ""; }; F936FCD90CCD984600716967 /* toolbar.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = toolbar.tcl; sourceTree = ""; }; @@ -605,6 +606,7 @@ F936FCDB0CCD984600716967 /* combo.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = combo.tcl; sourceTree = ""; }; F93E5EFD09CF8711008FA367 /* tkMacOSXFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSXFont.h; sourceTree = ""; }; F95FAFF90B34F1130072E431 /* macOSXLoad.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = macOSXLoad.test; sourceTree = ""; }; + F962F7C60DADC26200648DB8 /* vsapi.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = vsapi.test; sourceTree = ""; }; F966BA0408F27A37005CB29B /* error.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = error.xbm; sourceTree = ""; }; F966BA0508F27A37005CB29B /* gray12.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = gray12.xbm; sourceTree = ""; }; F966BA0608F27A37005CB29B /* gray25.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = gray25.xbm; sourceTree = ""; }; @@ -2093,7 +2095,7 @@ F966C06F08F281DC005CB29B /* Frameworks */, 1AB674ADFE9D54B511CA2CBB /* Products */, ); - comments = "Copyright (c) 2004-2007 Daniel A. Steffen \n\nSee the file \"license.terms\" for information on usage and redistribution of\nthis file, and for a DISCLAIMER OF ALL WARRANTIES.\n\nRCS: @(#) $Id: project.pbxproj,v 1.23 2007/12/13 15:27:53 dgp Exp $\n"; + comments = "Copyright (c) 2004-2007 Daniel A. Steffen \n\nSee the file \"license.terms\" for information on usage and redistribution of\nthis file, and for a DISCLAIMER OF ALL WARRANTIES.\n\nRCS: @(#) $Id: project.pbxproj,v 1.24 2008/04/15 10:55:49 das Exp $\n"; name = Wish; path = .; sourceTree = SOURCE_ROOT; @@ -2487,6 +2489,7 @@ F966BB3508F27A39005CB29B /* image2.tcl */, F966BB4208F27A3A005CB29B /* items.tcl */, F966BB4308F27A3A005CB29B /* ixset */, + F92240290D7C620F005EC715 /* knightstour.tcl */, F966BB4408F27A3A005CB29B /* label.tcl */, F966BB4508F27A3A005CB29B /* labelframe.tcl */, F9D1360A0CDC252C00DBE0B5 /* mclist.tcl */, @@ -2948,6 +2951,7 @@ F96888610AF7880C000797B5 /* treeview.test */, F96888620AF7880C000797B5 /* ttk.test */, F96888630AF7880C000797B5 /* validate.test */, + F962F7C60DADC26200648DB8 /* vsapi.test */, ); path = ttk; sourceTree = ""; @@ -3965,12 +3969,14 @@ files = ( ); inputPaths = ( + "${TARGET_TEMP_DIR}/.none", ); outputPaths = ( + "${TARGET_BUILD_DIR}/${WRAPPER_NAME}", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/bash; - shellScript = "gnumake -C \"${TK_SRCROOT}/macosx\" -j \"$(sysctl -n hw.activecpu)\" \"$(echo \"${ACTION}\" | sed -e s/build// -e s/clean/distclean/ -e s/..\\*/\\&-/)${MAKE_TARGET}\" CFLAGS_WARNING=\"${WARNING_CFLAGS}\" SYMROOT=\"${BUILT_PRODUCTS_DIR}\" OBJ_DIR=\"${OBJECT_FILE_DIR}\" INSTALL_ROOT=\"${DSTROOT}\" PREFIX=\"${PREFIX}\" BINDIR=\"${BINDIR}\" LIBDIR=\"${FRAMEWORK_INSTALL_PATH}\" MANDIR=\"${MANDIR}\" EXTRA_CONFIGURE_ARGS=\"${CONFIGURE_ARGS}\" APPLICATION_INSTALL_PATH=\"${APPLICATION_INSTALL_PATH}\" TCL_BUILD_DIR=\"${TCL_BUILD_DIR}\" TCL_FRAMEWORK_DIR=\"${TCL_FRAMEWORK_DIR}\" ${EXTRA_MAKE_FLAGS}\nresult=$?\nif [ -e \"${BUILT_PRODUCTS_DIR}/tktest\" ]; then\n\trm -f \"${BUILT_PRODUCTS_DIR}/tktest\"\nfi\necho \"Done\"\nexit ${result}\n"; + shellScript = "gnumake -C \"${TK_SRCROOT}/macosx\" -j \"$(sysctl -n hw.activecpu)\" \"$(echo \"${ACTION}\" | sed -e s/build// -e s/clean/distclean/ -e s/..\\*/\\&-/)${MAKE_TARGET}\" CFLAGS_WARNING=\"${WARNING_CFLAGS}\" CFLAGS_OPTIMIZE=\"-O${GCC_OPTIMIZATION_LEVEL}\" SYMROOT=\"${BUILT_PRODUCTS_DIR}\" OBJ_DIR=\"${OBJECT_FILE_DIR}\" INSTALL_ROOT=\"${DSTROOT}\" PREFIX=\"${PREFIX}\" BINDIR=\"${BINDIR}\" LIBDIR=\"${FRAMEWORK_INSTALL_PATH}\" MANDIR=\"${MANDIR}\" EXTRA_CONFIGURE_ARGS=\"${CONFIGURE_ARGS}\" APPLICATION_INSTALL_PATH=\"${APPLICATION_INSTALL_PATH}\" TCL_BUILD_DIR=\"${TCL_BUILD_DIR}\" TCL_FRAMEWORK_DIR=\"${TCL_FRAMEWORK_DIR}\" ${EXTRA_MAKE_FLAGS}\nresult=$?\nif [ -e \"${BUILT_PRODUCTS_DIR}/tktest\" ]; then\n\trm -f \"${BUILT_PRODUCTS_DIR}/tktest\"\nfi\necho \"Done\"\nrm -f \"${SCRIPT_INPUT_FILE_0}\"\nexit ${result}\n"; }; F9A5C5F508F651A2008AE941 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; @@ -4031,7 +4037,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/bash; - shellScript = "## tcl configure shell script phase\n\ncd \"${TCL_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tcl/macosx\"\n rm -rf autom4te.cache\n ${AUTOCONF:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tcl && cd tcl &&\nif [ \"${TCL_SRCROOT}\"/macosx/configure -nt config.status ]; then\n echo \"Configuring Tcl\"\n \"${TCL_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi\n"; + shellScript = "## tcl configure shell script phase\n\ncd \"${TCL_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tcl/macosx\"\n rm -rf autom4te.cache\n ${AUTOCONF:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tcl && cd tcl &&\nif [ \"${TCL_SRCROOT}\"/macosx/configure -nt config.status ]; then\n echo \"Configuring Tcl\"\n \"${TCL_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared --disable-corefoundation ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi\n"; }; F9FD30B50CC1AD070073837D /* ShellScript */ = { isa = PBXShellScriptBuildPhase; @@ -4050,7 +4056,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/bash; - shellScript = "## tk configure shell script phase\n\ncd \"${TK_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tk/macosx\"\n rm -rf autom4te.cache\n ${AUTOCONF:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tk && cd tk &&\nif [ \"${TK_SRCROOT}\"/macosx/configure -nt config.status ]; then\n echo \"Configuring Tk\"\n PATH=\"${PATH}:/usr/X11R6/bin\" \"${TK_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared --enable-xft --with-tcl=../tcl ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi"; + shellScript = "## tk configure shell script phase\n\ncd \"${TK_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tk/macosx\"\n rm -rf autom4te.cache\n ${AUTOCONF:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tk && cd tk &&\nif [ \"${TK_SRCROOT}\"/macosx/configure -nt config.status ]; then\n echo \"Configuring Tk\"\n PATH=\"${PATH}:/usr/X11R6/bin\" \"${TK_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared --disable-corefoundation --enable-xft --with-tcl=../tcl ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi"; }; /* End PBXShellScriptBuildPhase section */ @@ -4646,6 +4652,7 @@ isa = XCBuildConfiguration; buildSettings = { PRODUCT_NAME = Wish; + SKIP_INSTALL = NO; }; name = ReleaseUniversal; }; @@ -4678,6 +4685,7 @@ isa = XCBuildConfiguration; buildSettings = { PRODUCT_NAME = Wish; + SKIP_INSTALL = NO; }; name = DebugMemCompile; }; @@ -4706,6 +4714,7 @@ isa = XCBuildConfiguration; buildSettings = { PRODUCT_NAME = Wish; + SKIP_INSTALL = NO; }; name = Debug; }; @@ -4713,6 +4722,7 @@ isa = XCBuildConfiguration; buildSettings = { PRODUCT_NAME = Wish; + SKIP_INSTALL = NO; }; name = Release; }; @@ -4720,6 +4730,7 @@ isa = XCBuildConfiguration; buildSettings = { PRODUCT_NAME = Wish; + SKIP_INSTALL = NO; }; name = DebugNoFixZL; }; @@ -4796,6 +4807,7 @@ isa = XCBuildConfiguration; buildSettings = { PRODUCT_NAME = Wish; + SKIP_INSTALL = NO; }; name = DebugUnthreaded; }; @@ -4803,6 +4815,7 @@ isa = XCBuildConfiguration; buildSettings = { PRODUCT_NAME = Wish; + SKIP_INSTALL = NO; }; name = DebugLeaks; }; @@ -4855,6 +4868,7 @@ isa = XCBuildConfiguration; buildSettings = { PRODUCT_NAME = Wish; + SKIP_INSTALL = NO; }; name = ReleaseUniversal10.4uSDK; }; @@ -4890,6 +4904,7 @@ buildSettings = { LDFLAGS = "-force_cpusubtype_ALL $(LDFLAGS)"; PRODUCT_NAME = Wish; + SKIP_INSTALL = NO; }; name = ReleasePPC10.3.9SDK; }; @@ -4921,6 +4936,7 @@ isa = XCBuildConfiguration; buildSettings = { PRODUCT_NAME = Wish; + SKIP_INSTALL = NO; }; name = ReleasePPC10.2.8SDK; }; diff --git a/macosx/Wish.xcodeproj/project.pbxproj b/macosx/Wish.xcodeproj/project.pbxproj index 12f68e1..559f323 100644 --- a/macosx/Wish.xcodeproj/project.pbxproj +++ b/macosx/Wish.xcodeproj/project.pbxproj @@ -608,6 +608,7 @@ F936FCDB0CCD984600716967 /* combo.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = combo.tcl; sourceTree = ""; }; F93E5EFD09CF8711008FA367 /* tkMacOSXFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSXFont.h; sourceTree = ""; }; F95FAFF90B34F1130072E431 /* macOSXLoad.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = macOSXLoad.test; sourceTree = ""; }; + F962F7C60DADC26200648DB8 /* vsapi.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = vsapi.test; sourceTree = ""; }; F966BA0408F27A37005CB29B /* error.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = error.xbm; sourceTree = ""; }; F966BA0508F27A37005CB29B /* gray12.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = gray12.xbm; sourceTree = ""; }; F966BA0608F27A37005CB29B /* gray25.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = gray25.xbm; sourceTree = ""; }; @@ -2097,7 +2098,7 @@ F966C06F08F281DC005CB29B /* Frameworks */, 1AB674ADFE9D54B511CA2CBB /* Products */, ); - comments = "Copyright (c) 2004-2008 Daniel A. Steffen \n\nSee the file \"license.terms\" for information on usage and redistribution of\nthis file, and for a DISCLAIMER OF ALL WARRANTIES.\n\nRCS: @(#) $Id: project.pbxproj,v 1.37 2008/03/12 22:18:02 das Exp $\n"; + comments = "Copyright (c) 2004-2008 Daniel A. Steffen \n\nSee the file \"license.terms\" for information on usage and redistribution of\nthis file, and for a DISCLAIMER OF ALL WARRANTIES.\n\nRCS: @(#) $Id: project.pbxproj,v 1.38 2008/04/15 10:55:49 das Exp $\n"; name = Wish; path = .; sourceTree = SOURCE_ROOT; @@ -2953,6 +2954,7 @@ F96888610AF7880C000797B5 /* treeview.test */, F96888620AF7880C000797B5 /* ttk.test */, F96888630AF7880C000797B5 /* validate.test */, + F962F7C60DADC26200648DB8 /* vsapi.test */, ); path = ttk; sourceTree = ""; @@ -4047,7 +4049,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/bash; - shellScript = "## tcl configure shell script phase\n\ncd \"${TCL_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tcl/macosx\"\n rm -rf autom4te.cache\n ${AUTOCONF:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tcl && cd tcl &&\nif [ \"${TCL_SRCROOT}\"/macosx/configure -nt config.status ]; then\n echo \"Configuring Tcl\"\n \"${TCL_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi\n"; + shellScript = "## tcl configure shell script phase\n\ncd \"${TCL_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tcl/macosx\"\n rm -rf autom4te.cache\n ${AUTOCONF:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tcl && cd tcl &&\nif [ \"${TCL_SRCROOT}\"/macosx/configure -nt config.status ]; then\n echo \"Configuring Tcl\"\n \"${TCL_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared --disable-corefoundation ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi\n"; showEnvVarsInLog = 0; }; F9FD30B50CC1AD070073837D /* ShellScript */ = { @@ -4067,7 +4069,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/bash; - shellScript = "## tk configure shell script phase\n\ncd \"${TK_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tk/macosx\"\n rm -rf autom4te.cache\n ${AUTOCONF:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tk && cd tk &&\nif [ \"${TK_SRCROOT}\"/macosx/configure -nt config.status ]; then\n echo \"Configuring Tk\"\n PATH=\"${PATH}:/usr/X11R6/bin\" \"${TK_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared --enable-xft --with-tcl=../tcl ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi"; + shellScript = "## tk configure shell script phase\n\ncd \"${TK_SRCROOT}\"/macosx &&\nif [ configure.ac -nt configure -o ../unix/configure.in -nt configure -o ../unix/tcl.m4 -nt configure -o ../unix/aclocal.m4 -nt configure ]; then\n echo \"Running autoconf & autoheader in tk/macosx\"\n rm -rf autom4te.cache\n ${AUTOCONF:-${DEVELOPER_DIR}/usr/bin/autoconf} && ${AUTOHEADER:-${DEVELOPER_DIR}/usr/bin/autoheader} || exit $?\n rm -rf autom4te.cache\nfi\n\ncd \"${DERIVED_FILE_DIR}\" && mkdir -p tk && cd tk &&\nif [ \"${TK_SRCROOT}\"/macosx/configure -nt config.status ]; then\n echo \"Configuring Tk\"\n PATH=\"${PATH}:/usr/X11R6/bin\" \"${TK_SRCROOT}\"/macosx/configure --cache-file=../config.cache --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} --mandir=${MANDIR} --includedir=${INCLUDEDIR} --disable-shared --disable-corefoundation --enable-xft --with-tcl=../tcl ${CONFIGURE_ARGS}\nelse\n ./config.status\nfi"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ -- cgit v0.12 From 54bfce14793fed20c259085043af7e9ab0579aef Mon Sep 17 00:00:00 2001 From: das Date: Wed, 16 Apr 2008 14:51:28 +0000 Subject: * generic/tkStubInit.c: make stubs tables static const * generic/tkWindow.c (Initialize): and export only a module-scope pointer to to the main stubs table (for package init). [Patch 1938497] --- ChangeLog | 14 ++++++++++---- generic/tkStubInit.c | 28 +++++++++++++++------------- generic/tkWindow.c | 6 +++--- 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 288b1a4..8955434 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,12 +1,18 @@ +2008-04-16 Daniel Steffen + + * generic/tkStubInit.c: make stubs tables static const + * generic/tkWindow.c (Initialize): and export only a module-scope + pointer to to the main stubs table (for package init). [Patch 1938497] + 2008-04-14 Pat Thoyts - * win/tkWinDialog.c: Fix bug #1941740: tk_chooseColor -title broken - * win/tkWinTest.c: Added parent to testgetwininfo - * tests/winDialog.test: Created some tk_chooseColor win tests. + * win/tkWinDialog.c: Fix [tk_chooseColor -title]. [Bug 1941740] + * win/tkWinTest.c: Added parent to testgetwininfo + * tests/winDialog.test: Created some tk_chooseColor win tests. 2008-04-09 Jan Nijtmans - * generic/tkImgGIF.c: Let the GIF writer use a real LZW compressor. + * generic/tkImgGIF.c: Let the GIF writer use a real LZW compressor. 2008-04-08 Pat Thoyts diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index ef40e30..c7f02e7 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkStubInit.c,v 1.61 2008/04/02 21:32:33 das Exp $ + * RCS: @(#) $Id: tkStubInit.c,v 1.62 2008/04/16 14:51:29 das Exp $ */ #include "tkInt.h" @@ -41,12 +41,6 @@ #define Tk_GetCanvasVisitor \ ((VOID * (*)(Tcl_Interp * interp, CONST char * name)) NULL) -MODULE_SCOPE TkIntStubs tkIntStubs; -MODULE_SCOPE TkIntPlatStubs tkIntPlatStubs; -MODULE_SCOPE TkIntXlibStubs tkIntXlibStubs; -MODULE_SCOPE TkPlatStubs tkPlatStubs; -MODULE_SCOPE TkStubs tkStubs; - /* * WARNING: The contents of this file is automatically generated by the * tools/genStubs.tcl script. Any modifications to the function declarations @@ -55,7 +49,7 @@ MODULE_SCOPE TkStubs tkStubs; /* !BEGIN!: Do not edit below this line. */ -TkIntStubs tkIntStubs = { +static const TkIntStubs tkIntStubs = { TCL_STUB_MAGIC, NULL, TkAllocWindow, /* 0 */ @@ -317,7 +311,7 @@ TkIntStubs tkIntStubs = { TkpTesttextCmd, /* 157 */ }; -TkIntPlatStubs tkIntPlatStubs = { +static const TkIntPlatStubs tkIntPlatStubs = { TCL_STUB_MAGIC, NULL, #ifdef __WIN32__ /* WIN */ @@ -432,7 +426,7 @@ TkIntPlatStubs tkIntPlatStubs = { #endif /* X11 */ }; -TkIntXlibStubs tkIntXlibStubs = { +static const TkIntXlibStubs tkIntXlibStubs = { TCL_STUB_MAGIC, NULL, #ifdef __WIN32__ /* WIN */ @@ -640,7 +634,7 @@ TkIntXlibStubs tkIntXlibStubs = { #endif /* AQUA */ }; -TkPlatStubs tkPlatStubs = { +static const TkPlatStubs tkPlatStubs = { TCL_STUB_MAGIC, NULL, #ifdef __WIN32__ /* WIN */ @@ -673,7 +667,7 @@ static const TkStubHooks tkStubHooks = { &tkIntXlibStubs }; -TkStubs tkStubs = { +static const TkStubs tkStubs = { TCL_STUB_MAGIC, &tkStubHooks, Tk_MainLoop, /* 0 */ @@ -954,5 +948,13 @@ TkStubs tkStubs = { /* !END!: Do not edit above this line. */ +/* + * Module-scope pointer to the main static stubs table, used for package + * initialization via Tcl_PkgProvideEx(). + */ + +MODULE_SCOPE const TkStubs * const tkConstStubsPtr; + +const TkStubs * const tkConstStubsPtr = &tkStubs; + #undef UNIX_TK -#undef MAC_OSX_TK diff --git a/generic/tkWindow.c b/generic/tkWindow.c index 854bb82..c73b950 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWindow.c,v 1.93 2008/04/07 23:14:36 hobbs Exp $ + * RCS: @(#) $Id: tkWindow.c,v 1.94 2008/04/16 14:51:29 das Exp $ */ #include "tkInt.h" @@ -2912,7 +2912,7 @@ Tk_SafeInit( return Initialize(interp); } -extern TkStubs tkStubs; +MODULE_SCOPE const TkStubs * const tkConstStubsPtr; /* *---------------------------------------------------------------------- @@ -3190,7 +3190,7 @@ Initialize( */ code = Tcl_PkgProvideEx(interp, "Tk", TK_PATCH_LEVEL, - (ClientData) &tkStubs); + (ClientData) tkConstStubsPtr); if (code != TCL_OK) { goto done; } -- cgit v0.12 From 455c2fea891b8241693775517339ef116487f3a6 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 17 Apr 2008 14:53:43 +0000 Subject: * generic/tkCanvas.c: Fix logic that determines when canvas item event should fire. Thanks to Sebastian Wangnick. [Bug 1327482] --- ChangeLog | 5 +++++ generic/tkCanvas.c | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8955434..b7cb845 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-04-17 Don Porter + + * generic/tkCanvas.c: Fix logic that determines when canvas item + event should fire. Thanks to Sebastian Wangnick. [Bug 1327482] + 2008-04-16 Daniel Steffen * generic/tkStubInit.c: make stubs tables static const diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index 85c37c9..e6cc864 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCanvas.c,v 1.46 2007/12/13 15:24:13 dgp Exp $ + * RCS: @(#) $Id: tkCanvas.c,v 1.47 2008/04/17 14:53:44 dgp Exp $ */ /* #define USE_OLD_TAG_SEARCH 1 */ @@ -4483,9 +4483,6 @@ PickCurrentItem( buttonDown = canvasPtr->state & (Button1Mask|Button2Mask|Button3Mask|Button4Mask|Button5Mask); - if (!buttonDown) { - canvasPtr->flags &= ~LEFT_GRABBED_ITEM; - } /* * Save information about this event in the canvas. The event in the @@ -4560,6 +4557,10 @@ PickCurrentItem( return; } + if (!buttonDown) { + canvasPtr->flags &= ~LEFT_GRABBED_ITEM; + } + /* * Simulate a LeaveNotify event on the previous current item and an * EnterNotify event on the new current item. Remove the "current" tag -- cgit v0.12 From 068857d3d21a5adefbb76687cd4090f7605335f3 Mon Sep 17 00:00:00 2001 From: dkf Date: Thu, 17 Apr 2008 15:27:12 +0000 Subject: Corrected description of when tag -relief is ignored. --- ChangeLog | 5 +++++ doc/text.n | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b7cb845..031d50c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-04-17 Donal K. Fellows + + * doc/text.n: Correct description of when -relief option is ignored on + a tag. Thanks to emiliano for spotting. + 2008-04-17 Don Porter * generic/tkCanvas.c: Fix logic that determines when canvas item diff --git a/doc/text.n b/doc/text.n index 8236a36..926f896 100644 --- a/doc/text.n +++ b/doc/text.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: text.n,v 1.53 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: text.n,v 1.54 2008/04/17 15:27:12 dkf Exp $ '\" .so man.macros .TH text n 8.5 Tk "Tk Built-In Commands" @@ -572,7 +572,7 @@ the middle of characters. in any of the forms accepted by \fBTk_GetRelief\fR. This option is used in conjunction with the \fB\-borderwidth\fR option to give a 3-D appearance to the background for characters; -it is ignored unless the \fB\-background\fR option +it is ignored unless the \fB\-borderwidth\fR option has been set for the tag. .TP \fB\-rmargin \fIpixels\fR -- cgit v0.12 From 1f2e3e1ab8ee0753f0f180384de004b31b38793c Mon Sep 17 00:00:00 2001 From: patthoyts Date: Sun, 20 Apr 2008 19:19:23 +0000 Subject: Minor clarification of the button flash command (1926223) --- ChangeLog | 4 ++++ doc/button.n | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 031d50c..851cde0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-04-20 Pat Thoyts + + * doc/button.n: Minor clarification of button flash [Bug 1926223] + 2008-04-17 Donal K. Fellows * doc/text.n: Correct description of when -relief option is ignored on diff --git a/doc/button.n b/doc/button.n index 5855c49..2935c48 100644 --- a/doc/button.n +++ b/doc/button.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: button.n,v 1.15 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: button.n,v 1.16 2008/04/20 19:19:23 patthoyts Exp $ '\" .so man.macros .TH button n 4.4 Tk "Tk Built-In Commands" @@ -139,9 +139,9 @@ command. .TP \fIpathName \fBflash\fR Flash the button. This is accomplished by redisplaying the button -several times, alternating between active and normal colors. At -the end of the flash the button is left in the same normal/active -state as when the command was invoked. +several times, alternating between the configured activebackground +and background colors. At the end of the flash the button is left +in the same normal/active state as when the command was invoked. This command is ignored if the button's state is \fBdisabled\fR. .TP \fIpathName \fBinvoke\fR -- cgit v0.12 From 714b003638f256fba3960819b2017df1297f0cc6 Mon Sep 17 00:00:00 2001 From: patthoyts Date: Sun, 20 Apr 2008 19:42:31 +0000 Subject: Minor change regarding the system menu on windows (1887169) --- ChangeLog | 1 + doc/menu.n | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 851cde0..5e83856 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 2008-04-20 Pat Thoyts + * doc/menu.n: Minor change regarding the system menu [Bug 1887169] * doc/button.n: Minor clarification of button flash [Bug 1926223] 2008-04-17 Donal K. Fellows diff --git a/doc/menu.n b/doc/menu.n index 48d0855..a00d7ff 100644 --- a/doc/menu.n +++ b/doc/menu.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: menu.n,v 1.23 2008/01/30 09:58:57 dkf Exp $ +'\" RCS: @(#) $Id: menu.n,v 1.24 2008/04/20 19:42:34 patthoyts Exp $ '\" .so man.macros .TH menu n 4.1 Tk "Tk Built-In Commands" @@ -252,8 +252,8 @@ whenever the window's menubar is in front. The first items in the menu are provided by Mac OS X. .PP When Tk sees a System menu on Windows, its items are appended to the -system menu that the menubar is attached to. This menu has an icon -representing a spacebar, and can be invoked with the mouse or by typing +system menu that the menubar is attached to. This menu is tied to the +application icon and can be invoked with the mouse or by typing Alt+Spacebar. Due to limitations in the Windows API, any font changes, colors, images, bitmaps, or tearoff images will not appear in the system menu. -- cgit v0.12 From 765719e0119f14483f903787b6edc92219c4647f Mon Sep 17 00:00:00 2001 From: patthoyts Date: Sun, 20 Apr 2008 19:57:03 +0000 Subject: Include ws2_32 in the link list [Bug 19200872] --- ChangeLog | 1 + win/makefile.vc | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5e83856..920f88b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 2008-04-20 Pat Thoyts + * win/makefile.vc: Include ws2_32 in the link list [Bug 1900872] * doc/menu.n: Minor change regarding the system menu [Bug 1887169] * doc/button.n: Minor clarification of button flash [Bug 1926223] diff --git a/win/makefile.vc b/win/makefile.vc index 079ae3b..a945084 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -12,7 +12,7 @@ # Copyright (c) 2001-2004 David Gravereaux. # #------------------------------------------------------------------------------ -# RCS: @(#) $Id: makefile.vc,v 1.120 2008/04/03 17:04:55 patthoyts Exp $ +# RCS: @(#) $Id: makefile.vc,v 1.121 2008/04/20 19:57:03 patthoyts Exp $ #------------------------------------------------------------------------------ # Check to see we are configured to build with MSVC (MSDEVDIR or MSVCDIR) @@ -507,7 +507,7 @@ tcllibs = $(TCLIMPLIB) tcllibs = $(TCLSTUBLIB) $(tcllibs) !endif -baselibs = kernel32.lib user32.lib +baselibs = kernel32.lib user32.lib ws2_32.lib # Avoid 'unresolved external symbol __security_cookie' errors. # c.f. http://support.microsoft.com/?id=894573 !if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64" -- cgit v0.12 From 33172e259f5b60a5a62dec41eb5515fe735cc410 Mon Sep 17 00:00:00 2001 From: jenglish Date: Fri, 25 Apr 2008 19:08:31 +0000 Subject: BUGFIX: [$tv selection] takes a list of items, not a single item [Bug 1951733]. --- ChangeLog | 5 +++++ library/ttk/treeview.tcl | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 920f88b..2a6f4c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-04-25 Joe English + + * library/ttk/treeview.tcl: BUGFIX: [$tv selection] takes + a list of items, not a single item [Bug 1951733]. + 2008-04-20 Pat Thoyts * win/makefile.vc: Include ws2_32 in the link list [Bug 1900872] diff --git a/library/ttk/treeview.tcl b/library/ttk/treeview.tcl index 473e21b..d2a1015 100644 --- a/library/ttk/treeview.tcl +++ b/library/ttk/treeview.tcl @@ -1,4 +1,4 @@ -# $Id: treeview.tcl,v 1.4 2008/01/30 05:33:19 jenglish Exp $ +# $Id: treeview.tcl,v 1.5 2008/04/25 19:08:32 jenglish Exp $ # # ttk::treeview widget bindings and utilities. # @@ -280,7 +280,7 @@ proc ttk::treeview::select.choose.extended {w item} { BrowseTo $w $item } proc ttk::treeview::select.toggle.extended {w item} { - $w selection toggle $item + $w selection toggle [list $item] } proc ttk::treeview::select.extend.extended {w item} { if {[set anchor [$w focus]] ne ""} { -- cgit v0.12 From 1876f5f7ee429456ad89540bcf659c092245bf1b Mon Sep 17 00:00:00 2001 From: das Date: Fri, 25 Apr 2008 21:28:41 +0000 Subject: remove ioUtil.test, llvm-gcc fix --- macosx/Wish.xcodeproj/project.pbxproj | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/macosx/Wish.xcodeproj/project.pbxproj b/macosx/Wish.xcodeproj/project.pbxproj index 559f323..cf60902 100644 --- a/macosx/Wish.xcodeproj/project.pbxproj +++ b/macosx/Wish.xcodeproj/project.pbxproj @@ -1839,7 +1839,6 @@ F96D437B08F272B6004A47F5 /* io.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = io.test; sourceTree = ""; }; F96D437C08F272B6004A47F5 /* ioCmd.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ioCmd.test; sourceTree = ""; }; F96D437D08F272B6004A47F5 /* iogt.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = iogt.test; sourceTree = ""; }; - F96D437E08F272B6004A47F5 /* ioUtil.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ioUtil.test; sourceTree = ""; }; F96D437F08F272B6004A47F5 /* join.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = join.test; sourceTree = ""; }; F96D438008F272B6004A47F5 /* lindex.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = lindex.test; sourceTree = ""; }; F96D438108F272B6004A47F5 /* link.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = link.test; sourceTree = ""; }; @@ -2098,7 +2097,7 @@ F966C06F08F281DC005CB29B /* Frameworks */, 1AB674ADFE9D54B511CA2CBB /* Products */, ); - comments = "Copyright (c) 2004-2008 Daniel A. Steffen \n\nSee the file \"license.terms\" for information on usage and redistribution of\nthis file, and for a DISCLAIMER OF ALL WARRANTIES.\n\nRCS: @(#) $Id: project.pbxproj,v 1.38 2008/04/15 10:55:49 das Exp $\n"; + comments = "Copyright (c) 2004-2008 Daniel A. Steffen \n\nSee the file \"license.terms\" for information on usage and redistribution of\nthis file, and for a DISCLAIMER OF ALL WARRANTIES.\n\nRCS: @(#) $Id: project.pbxproj,v 1.39 2008/04/25 21:28:41 das Exp $\n"; name = Wish; path = .; sourceTree = SOURCE_ROOT; @@ -3622,7 +3621,6 @@ F96D437B08F272B6004A47F5 /* io.test */, F96D437C08F272B6004A47F5 /* ioCmd.test */, F96D437D08F272B6004A47F5 /* iogt.test */, - F96D437E08F272B6004A47F5 /* ioUtil.test */, F96D437F08F272B6004A47F5 /* join.test */, F96D438008F272B6004A47F5 /* lindex.test */, F96D438108F272B6004A47F5 /* link.test */, @@ -4895,12 +4893,6 @@ F98A2A2F0D85F1EC002A40A7 /* ReleaseUniversal llvmgcc42 */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = ( - ppc, - i386, - x86_64, - ); - CFLAGS = "-arch ppc -arch i386 -arch x86_64 $(CFLAGS)"; HEADER_SEARCH_PATHS = ( /usr/X11R6/include, /usr/X11R6/include/freetype2, -- cgit v0.12 From 4513cb9f431ea8c6b151913a016ec6c75bcac559 Mon Sep 17 00:00:00 2001 From: dkf Date: Sun, 27 Apr 2008 22:38:54 +0000 Subject: Get rid of pre-C89-isms (esp. CONST vs const). --- ChangeLog | 8 + generic/tk3d.c | 10 +- generic/tkArgv.c | 12 +- generic/tkAtom.c | 6 +- generic/tkCanvArc.c | 48 +- generic/tkCanvBmap.c | 32 +- generic/tkCanvImg.c | 30 +- generic/tkCanvLine.c | 68 +- generic/tkCanvPoly.c | 44 +- generic/tkCanvPs.c | 12 +- generic/tkCanvText.c | 36 +- generic/tkCanvUtil.c | 210 +++--- generic/tkCanvWind.c | 37 +- generic/tkCanvas.c | 152 ++-- generic/tkClipboard.c | 46 +- generic/tkColor.c | 38 +- generic/tkConfig.c | 42 +- generic/tkConsole.c | 164 +++-- generic/tkCursor.c | 53 +- generic/tkEntry.c | 216 +++--- generic/tkFileFilter.c | 59 +- generic/tkFocus.c | 125 ++-- generic/tkFont.c | 98 ++- generic/tkFrame.c | 177 ++--- generic/tkGeometry.c | 26 +- generic/tkGet.c | 32 +- generic/tkGrab.c | 29 +- generic/tkGrid.c | 122 ++-- generic/tkImage.c | 47 +- generic/tkImgBmap.c | 49 +- generic/tkImgGIF.c | 325 +++++---- generic/tkImgPPM.c | 14 +- generic/tkImgPhoto.c | 102 ++- generic/tkMain.c | 31 +- generic/tkMenu.c | 131 ++-- generic/tkMenubutton.c | 77 +- generic/tkMessage.c | 66 +- generic/tkObj.c | 12 +- generic/tkOldConfig.c | 44 +- generic/tkOldTest.c | 22 +- generic/tkOption.c | 77 +- generic/tkPack.c | 118 ++- generic/tkPanedWindow.c | 124 ++-- generic/tkPlace.c | 44 +- generic/tkRectOval.c | 61 +- generic/tkScale.c | 62 +- generic/tkScrollbar.c | 38 +- generic/tkSelect.c | 52 +- generic/tkSquare.c | 44 +- generic/tkStubInit.c | 6 +- generic/tkStubLib.c | 16 +- generic/tkStyle.c | 103 ++- generic/tkTest.c | 74 +- generic/tkText.c | 188 ++--- generic/tkTextDisp.c | 64 +- generic/tkTextIndex.c | 92 ++- generic/tkTextTag.c | 42 +- generic/tkVisual.c | 8 +- generic/tkWindow.c | 103 ++- generic/ttk/ttkButton.c | 6 +- generic/ttk/ttkImage.c | 4 +- generic/ttk/ttkInit.c | 4 +- generic/ttk/ttkNotebook.c | 20 +- generic/ttk/ttkPanedwindow.c | 18 +- generic/ttk/ttkProgress.c | 10 +- generic/ttk/ttkScale.c | 8 +- generic/ttk/ttkScrollbar.c | 10 +- generic/ttk/ttkTheme.c | 30 +- generic/ttk/ttkTrace.c | 6 +- generic/ttk/ttkTreeview.c | 6 +- generic/ttk/ttkWidget.c | 16 +- macosx/tkMacOSXBitmap.c | 12 +- macosx/tkMacOSXConfig.c | 6 +- macosx/tkMacOSXCursor.c | 162 +++-- macosx/tkMacOSXDialog.c | 821 ++++++++++----------- macosx/tkMacOSXEmbed.c | 500 ++++++------- macosx/tkMacOSXInit.c | 129 ++-- macosx/tkMacOSXSend.c | 395 +++++----- macosx/tkMacOSXWm.c | 1638 +++++++++++++++++++++--------------------- macosx/tkMacOSXXStubs.c | 277 +++---- unix/tkAppInit.c | 8 +- unix/tkUnix.c | 6 +- unix/tkUnixConfig.c | 6 +- unix/tkUnixCursor.c | 34 +- unix/tkUnixDialog.c | 16 +- unix/tkUnixEmbed.c | 6 +- unix/tkUnixEvent.c | 4 +- unix/tkUnixFont.c | 123 ++-- unix/tkUnixInit.c | 9 +- unix/tkUnixMenu.c | 52 +- unix/tkUnixRFont.c | 12 +- unix/tkUnixSend.c | 109 ++- unix/tkUnixWm.c | 197 +++-- unix/tkUnixXId.c | 22 +- win/stubs.c | 2 +- win/tkWinConfig.c | 6 +- win/tkWinCursor.c | 8 +- win/tkWinDialog.c | 38 +- win/tkWinDraw.c | 4 +- win/tkWinEmbed.c | 6 +- win/tkWinFont.c | 100 +-- win/tkWinInit.c | 8 +- win/tkWinTest.c | 18 +- win/tkWinWindow.c | 4 +- win/tkWinWm.c | 172 ++--- win/tkWinX.c | 12 +- win/ttkWinXPTheme.c | 63 +- win/winMain.c | 6 +- 108 files changed, 4644 insertions(+), 4653 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2a6f4c6..b954a8c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-04-27 Donal K. Fellows + + * */*.c: A large tranche of getting rid of pre-C89-isms; if your + compiler doesn't support things like proper function declarations, + 'void' and 'const', borrow a proper one when building Tcl. (The header + files allow building things that link against Tcl with really ancient + compilers still; the requirement is just when building Tcl itself.) + 2008-04-25 Joe English * library/ttk/treeview.tcl: BUGFIX: [$tv selection] takes diff --git a/generic/tk3d.c b/generic/tk3d.c index 3922fc8..c36631a 100644 --- a/generic/tk3d.c +++ b/generic/tk3d.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tk3d.c,v 1.19 2007/12/13 15:24:13 dgp Exp $ + * RCS: @(#) $Id: tk3d.c,v 1.20 2008/04/27 22:38:55 dkf Exp $ */ #include "tkInt.h" @@ -21,7 +21,7 @@ * by Tk_GetReliefFromObj. */ -static CONST char *reliefStrings[] = { +static const char *reliefStrings[] = { "flat", "groove", "raised", "ridge", "solid", "sunken", NULL }; @@ -320,7 +320,7 @@ Tk_Draw3DRectangle( *-------------------------------------------------------------- */ -CONST char * +const char * Tk_NameOf3DBorder( Tk_3DBorder border) /* Token for border. */ { @@ -645,7 +645,7 @@ Tk_GetReliefFromObj( int Tk_GetRelief( Tcl_Interp *interp, /* For error messages. */ - CONST char *name, /* Name of a relief type. */ + const char *name, /* Name of a relief type. */ int *reliefPtr) /* Where to store converted relief. */ { char c; @@ -694,7 +694,7 @@ Tk_GetRelief( *-------------------------------------------------------------- */ -CONST char * +const char * Tk_NameOfRelief( int relief) /* One of TK_RELIEF_FLAT, TK_RELIEF_RAISED, or * TK_RELIEF_SUNKEN. */ diff --git a/generic/tkArgv.c b/generic/tkArgv.c index 0e60295..039b4d1 100644 --- a/generic/tkArgv.c +++ b/generic/tkArgv.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkArgv.c,v 1.13 2008/04/07 22:27:41 hobbs Exp $ + * RCS: @(#) $Id: tkArgv.c,v 1.14 2008/04/27 22:38:55 dkf Exp $ */ #include "tkInt.h" @@ -63,7 +63,7 @@ Tk_ParseArgv( * means ignore Tk option specs. */ int *argcPtr, /* Number of arguments in argv. Modified to * hold # args left in argv at end. */ - CONST char **argv, /* Array of arguments. Modified to hold those + const char **argv, /* Array of arguments. Modified to hold those * that couldn't be processed here. */ Tk_ArgvInfo *argTable, /* Array of option descriptions */ int flags) /* Or'ed combination of various flag bits, @@ -73,7 +73,7 @@ Tk_ParseArgv( /* Pointer to the current entry in the table * of argument descriptions. */ Tk_ArgvInfo *matchPtr; /* Descriptor that matches current argument. */ - CONST char *curArg; /* Current argument */ + const char *curArg; /* Current argument */ register char c; /* Second character of current arg (used for * quick check for matching; use 2nd char. * because first char. will almost always be @@ -195,7 +195,7 @@ Tk_ParseArgv( if (argc == 0) { goto missingArg; } - *((CONST char **)infoPtr->dst) = argv[srcIndex]; + *((const char **)infoPtr->dst) = argv[srcIndex]; srcIndex++; argc--; break; @@ -228,7 +228,7 @@ Tk_ParseArgv( } break; case TK_ARGV_FUNC: { - typedef int (ArgvFunc)(char *, char *, CONST char *); + typedef int (ArgvFunc)(char *, char *, const char *); ArgvFunc *handlerProc = (ArgvFunc *) infoPtr->src; if ((*handlerProc)(infoPtr->dst, infoPtr->key, argv[srcIndex])) { @@ -239,7 +239,7 @@ Tk_ParseArgv( } case TK_ARGV_GENFUNC: { typedef int (ArgvGenFunc)(char *, Tcl_Interp *, char *, int, - CONST char **); + const char **); ArgvGenFunc *handlerProc = (ArgvGenFunc *) infoPtr->src; argc = (*handlerProc)(infoPtr->dst, interp, infoPtr->key, diff --git a/generic/tkAtom.c b/generic/tkAtom.c index ae35527..1028ea0 100644 --- a/generic/tkAtom.c +++ b/generic/tkAtom.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkAtom.c,v 1.7 2007/12/13 15:24:13 dgp Exp $ + * RCS: @(#) $Id: tkAtom.c,v 1.8 2008/04/27 22:38:55 dkf Exp $ */ #include "tkInt.h" @@ -78,7 +78,7 @@ Atom Tk_InternAtom( Tk_Window tkwin, /* Window token; map name to atom for this * window's display. */ - CONST char *name) /* Name to turn into atom. */ + const char *name) /* Name to turn into atom. */ { register TkDisplay *dispPtr; register Tcl_HashEntry *hPtr; @@ -123,7 +123,7 @@ Tk_InternAtom( *-------------------------------------------------------------- */ -CONST char * +const char * Tk_GetAtomName( Tk_Window tkwin, /* Window token; map atom to name relative to * this window's display. */ diff --git a/generic/tkCanvArc.c b/generic/tkCanvArc.c index db323d1..eb2217f 100644 --- a/generic/tkCanvArc.c +++ b/generic/tkCanvArc.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCanvArc.c,v 1.16 2007/12/13 15:24:13 dgp Exp $ + * RCS: @(#) $Id: tkCanvArc.c,v 1.17 2008/04/27 22:38:55 dkf Exp $ */ #include @@ -81,7 +81,7 @@ typedef struct ArcItem { */ static int StyleParseProc(ClientData clientData, Tcl_Interp *interp, - Tk_Window tkwin, CONST char *value, + Tk_Window tkwin, const char *value, char *widgRec, int offset); static char * StylePrintProc(ClientData clientData, Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr); @@ -183,17 +183,17 @@ static Tk_ConfigSpec configSpecs[] = { static void ComputeArcBbox(Tk_Canvas canvas, ArcItem *arcPtr); static int ConfigureArc(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, int objc, - Tcl_Obj *CONST objv[], int flags); + Tcl_Obj *const objv[], int flags); static int CreateArc(Tcl_Interp *interp, Tk_Canvas canvas, struct Tk_Item *itemPtr, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static void DeleteArc(Tk_Canvas canvas, Tk_Item *itemPtr, Display *display); static void DisplayArc(Tk_Canvas canvas, Tk_Item *itemPtr, Display *display, Drawable dst, int x, int y, int width, int height); static int ArcCoords(Tcl_Interp *interp, Tk_Canvas canvas, - Tk_Item *itemPtr, int objc, Tcl_Obj *CONST objv[]); + Tk_Item *itemPtr, int objc, Tcl_Obj *const objv[]); static int ArcToArea(Tk_Canvas canvas, Tk_Item *itemPtr, double *rectPtr); static double ArcToPoint(Tk_Canvas canvas, @@ -273,7 +273,7 @@ CreateArc( Tk_Item *itemPtr, /* Record to hold new item; header has been * initialized by caller. */ int objc, /* Number of arguments in objv. */ - Tcl_Obj *CONST objv[]) /* Arguments describing arc. */ + Tcl_Obj *const objv[]) /* Arguments describing arc. */ { ArcItem *arcPtr = (ArcItem *) itemPtr; int i; @@ -351,7 +351,7 @@ ArcCoords( Tk_Item *itemPtr, /* Item whose coordinates are to be read or * modified. */ int objc, /* Number of coordinates supplied in objv. */ - Tcl_Obj *CONST objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */ + Tcl_Obj *const objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */ { ArcItem *arcPtr = (ArcItem *) itemPtr; @@ -426,7 +426,7 @@ ConfigureArc( Tk_Canvas canvas, /* Canvas containing itemPtr. */ Tk_Item *itemPtr, /* Arc item to reconfigure. */ int objc, /* Number of elements in objv. */ - Tcl_Obj *CONST objv[], /* Arguments describing things to configure. */ + Tcl_Obj *const objv[], /* Arguments describing things to configure. */ int flags) /* Flags to pass to Tk_ConfigureWidget. */ { ArcItem *arcPtr = (ArcItem *) itemPtr; @@ -442,7 +442,7 @@ ConfigureArc( tkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, - (CONST char **) objv, (char *) arcPtr, flags|TK_CONFIG_OBJS)) { + (const char **) objv, (char *) arcPtr, flags|TK_CONFIG_OBJS)) { return TCL_ERROR; } @@ -503,7 +503,7 @@ ConfigureArc( arcPtr->outline.gc = newGC; if(state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } if (state==TK_STATE_HIDDEN) { ComputeArcBbox(canvas, arcPtr); @@ -512,7 +512,7 @@ ConfigureArc( color = arcPtr->fillColor; stipple = arcPtr->fillStipple; - if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { + if (Canvas(canvas)->currentItemPtr == itemPtr) { if (arcPtr->activeFillColor!=NULL) { color = arcPtr->activeFillColor; } @@ -653,7 +653,7 @@ ComputeArcBbox( Tk_State state = arcPtr->header.state; if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } width = arcPtr->outline.width; @@ -664,7 +664,7 @@ ComputeArcBbox( arcPtr->header.x1 = arcPtr->header.x2 = arcPtr->header.y1 = arcPtr->header.y2 = -1; return; - } else if (((TkCanvas *)canvas)->currentItemPtr == (Tk_Item *) arcPtr) { + } else if (Canvas(canvas)->currentItemPtr == (Tk_Item *) arcPtr) { if (arcPtr->outline.activeWidth>width) { width = arcPtr->outline.activeWidth; } @@ -796,7 +796,7 @@ DisplayArc( Pixmap stipple; if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } lineWidth = arcPtr->outline.width; if (lineWidth < 1.0) { @@ -804,7 +804,7 @@ DisplayArc( } dashnumber = arcPtr->outline.dash.number; stipple = arcPtr->fillStipple; - if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { + if (Canvas(canvas)->currentItemPtr == itemPtr) { if (arcPtr->outline.activeWidth>lineWidth) { lineWidth = arcPtr->outline.activeWidth; } @@ -972,11 +972,11 @@ ArcToPoint( Tk_State state = itemPtr->state; if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } width = (double) arcPtr->outline.width; - if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { + if (Canvas(canvas)->currentItemPtr == itemPtr) { if (arcPtr->outline.activeWidth>width) { width = (double) arcPtr->outline.activeWidth; } @@ -1148,10 +1148,10 @@ ArcToArea( Tk_State state = itemPtr->state; if(state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } width = (double) arcPtr->outline.width; - if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { + if (Canvas(canvas)->currentItemPtr == itemPtr) { if (arcPtr->outline.activeWidth>width) { width = (double) arcPtr->outline.activeWidth; } @@ -1470,7 +1470,7 @@ ComputeArcOutline( outlinePtr = arcPtr->outlinePtr; if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } /* @@ -1528,7 +1528,7 @@ ComputeArcOutline( */ width = arcPtr->outline.width; - if (((TkCanvas *)canvas)->currentItemPtr == (Tk_Item *) arcPtr) { + if (Canvas(canvas)->currentItemPtr == (Tk_Item *) arcPtr) { if (arcPtr->outline.activeWidth>arcPtr->outline.width) { width = arcPtr->outline.activeWidth; } @@ -1854,13 +1854,13 @@ ArcToPostscript( } if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } color = arcPtr->outline.color; stipple = arcPtr->outline.stipple; fillColor = arcPtr->fillColor; fillStipple = arcPtr->fillStipple; - if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { + if (Canvas(canvas)->currentItemPtr == itemPtr) { if (arcPtr->outline.activeColor!=NULL) { color = arcPtr->outline.activeColor; } @@ -2004,7 +2004,7 @@ StyleParseProc( ClientData clientData, /* some flags.*/ Tcl_Interp *interp, /* Used for reporting errors. */ Tk_Window tkwin, /* Window containing canvas widget. */ - CONST char *value, /* Value of option. */ + const char *value, /* Value of option. */ char *widgRec, /* Pointer to record for item. */ int offset) /* Offset into item. */ { diff --git a/generic/tkCanvBmap.c b/generic/tkCanvBmap.c index da4ba12..72afa99 100644 --- a/generic/tkCanvBmap.c +++ b/generic/tkCanvBmap.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCanvBmap.c,v 1.14 2007/12/13 15:24:13 dgp Exp $ + * RCS: @(#) $Id: tkCanvBmap.c,v 1.15 2008/04/27 22:38:55 dkf Exp $ */ #include @@ -90,7 +90,7 @@ static Tk_ConfigSpec configSpecs[] = { static int BitmapCoords(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int BitmapToArea(Tk_Canvas canvas, Tk_Item *itemPtr, double *rectPtr); static double BitmapToPoint(Tk_Canvas canvas, @@ -101,10 +101,10 @@ static void ComputeBitmapBbox(Tk_Canvas canvas, BitmapItem *bmapPtr); static int ConfigureBitmap(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, int objc, - Tcl_Obj *CONST objv[], int flags); + Tcl_Obj *const objv[], int flags); static int TkcCreateBitmap(Tcl_Interp *interp, Tk_Canvas canvas, struct Tk_Item *itemPtr, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static void DeleteBitmap(Tk_Canvas canvas, Tk_Item *itemPtr, Display *display); static void DisplayBitmap(Tk_Canvas canvas, @@ -170,7 +170,7 @@ TkcCreateBitmap( Tk_Item *itemPtr, /* Record to hold new item; header has been * initialized by caller. */ int objc, /* Number of arguments in objv. */ - Tcl_Obj *CONST objv[]) /* Arguments describing rectangle. */ + Tcl_Obj *const objv[]) /* Arguments describing rectangle. */ { BitmapItem *bmapPtr = (BitmapItem *) itemPtr; int i; @@ -246,7 +246,7 @@ BitmapCoords( Tk_Item *itemPtr, /* Item whose coordinates are to be read or * modified. */ int objc, /* Number of coordinates supplied in objv. */ - Tcl_Obj *CONST objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */ + Tcl_Obj *const objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */ { BitmapItem *bmapPtr = (BitmapItem *) itemPtr; @@ -312,7 +312,7 @@ ConfigureBitmap( Tk_Canvas canvas, /* Canvas containing itemPtr. */ Tk_Item *itemPtr, /* Bitmap item to reconfigure. */ int objc, /* Number of elements in objv. */ - Tcl_Obj *CONST objv[], /* Arguments describing things to configure. */ + Tcl_Obj *const objv[], /* Arguments describing things to configure. */ int flags) /* Flags to pass to Tk_ConfigureWidget. */ { BitmapItem *bmapPtr = (BitmapItem *) itemPtr; @@ -327,7 +327,7 @@ ConfigureBitmap( tkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, - (CONST char **) objv, (char *) bmapPtr, flags|TK_CONFIG_OBJS)) { + (const char **) objv, (char *) bmapPtr, flags|TK_CONFIG_OBJS)) { return TCL_ERROR; } @@ -347,7 +347,7 @@ ConfigureBitmap( } if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } if (state == TK_STATE_HIDDEN) { ComputeBitmapBbox(canvas, bmapPtr); @@ -356,7 +356,7 @@ ConfigureBitmap( fgColor = bmapPtr->fgColor; bgColor = bmapPtr->bgColor; bitmap = bmapPtr->bitmap; - if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { + if (Canvas(canvas)->currentItemPtr == itemPtr) { if (bmapPtr->activeFgColor!=NULL) { fgColor = bmapPtr->activeFgColor; } @@ -488,10 +488,10 @@ ComputeBitmapBbox( Tk_State state = bmapPtr->header.state; if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } bitmap = bmapPtr->bitmap; - if (((TkCanvas *)canvas)->currentItemPtr == (Tk_Item *)bmapPtr) { + if (Canvas(canvas)->currentItemPtr == (Tk_Item *)bmapPtr) { if (bmapPtr->activeBitmap!=None) { bitmap = bmapPtr->activeBitmap; } @@ -598,10 +598,10 @@ DisplayBitmap( */ if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } bitmap = bmapPtr->bitmap; - if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { + if (Canvas(canvas)->currentItemPtr == itemPtr) { if (bmapPtr->activeBitmap!=None) { bitmap = bmapPtr->activeBitmap; } @@ -864,12 +864,12 @@ BitmapToPostscript( Tk_State state = itemPtr->state; if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } fgColor = bmapPtr->fgColor; bgColor = bmapPtr->bgColor; bitmap = bmapPtr->bitmap; - if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { + if (Canvas(canvas)->currentItemPtr == itemPtr) { if (bmapPtr->activeFgColor!=NULL) { fgColor = bmapPtr->activeFgColor; } diff --git a/generic/tkCanvImg.c b/generic/tkCanvImg.c index 04cbf9e..02cce14 100644 --- a/generic/tkCanvImg.c +++ b/generic/tkCanvImg.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCanvImg.c,v 1.11 2007/12/13 15:24:13 dgp Exp $ + * RCS: @(#) $Id: tkCanvImg.c,v 1.12 2008/04/27 22:38:55 dkf Exp $ */ #include @@ -80,7 +80,7 @@ static void ImageChangedProc(ClientData clientData, int imgHeight); static int ImageCoords(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, int argc, - Tcl_Obj *CONST argv[]); + Tcl_Obj *const argv[]); static int ImageToArea(Tk_Canvas canvas, Tk_Item *itemPtr, double *rectPtr); static double ImageToPoint(Tk_Canvas canvas, @@ -90,10 +90,10 @@ static int ImageToPostscript(Tcl_Interp *interp, static void ComputeImageBbox(Tk_Canvas canvas, ImageItem *imgPtr); static int ConfigureImage(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, int argc, - Tcl_Obj *CONST argv[], int flags); + Tcl_Obj *const argv[], int flags); static int CreateImage(Tcl_Interp *interp, Tk_Canvas canvas, struct Tk_Item *itemPtr, - int argc, Tcl_Obj *CONST argv[]); + int argc, Tcl_Obj *const argv[]); static void DeleteImage(Tk_Canvas canvas, Tk_Item *itemPtr, Display *display); static void DisplayImage(Tk_Canvas canvas, @@ -159,7 +159,7 @@ CreateImage( Tk_Item *itemPtr, /* Record to hold new item; header has been * initialized by caller. */ int objc, /* Number of arguments in objv. */ - Tcl_Obj *CONST objv[]) /* Arguments describing rectangle. */ + Tcl_Obj *const objv[]) /* Arguments describing rectangle. */ { ImageItem *imgPtr = (ImageItem *) itemPtr; int i; @@ -231,7 +231,7 @@ ImageCoords( Tk_Item *itemPtr, /* Item whose coordinates are to be read or * modified. */ int objc, /* Number of coordinates supplied in objv. */ - Tcl_Obj *CONST objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */ + Tcl_Obj *const objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */ { ImageItem *imgPtr = (ImageItem *) itemPtr; @@ -296,7 +296,7 @@ ConfigureImage( Tk_Canvas canvas, /* Canvas containing itemPtr. */ Tk_Item *itemPtr, /* Image item to reconfigure. */ int objc, /* Number of elements in objv. */ - Tcl_Obj *CONST objv[], /* Arguments describing things to configure. */ + Tcl_Obj *const objv[], /* Arguments describing things to configure. */ int flags) /* Flags to pass to Tk_ConfigureWidget. */ { ImageItem *imgPtr = (ImageItem *) itemPtr; @@ -305,7 +305,7 @@ ConfigureImage( tkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, - (CONST char **) objv, (char *) imgPtr, flags|TK_CONFIG_OBJS)) { + (const char **) objv, (char *) imgPtr, flags|TK_CONFIG_OBJS)) { return TCL_ERROR; } @@ -439,10 +439,10 @@ ComputeImageBbox( Tk_State state = imgPtr->header.state; if(state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } image = imgPtr->image; - if (((TkCanvas *)canvas)->currentItemPtr == (Tk_Item *)imgPtr) { + if (Canvas(canvas)->currentItemPtr == (Tk_Item *)imgPtr) { if (imgPtr->activeImage != NULL) { image = imgPtr->activeImage; } @@ -542,11 +542,11 @@ DisplayImage( Tk_State state = itemPtr->state; if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } image = imgPtr->image; - if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { + if (Canvas(canvas)->currentItemPtr == itemPtr) { if (imgPtr->activeImage != NULL) { image = imgPtr->activeImage; } @@ -699,7 +699,7 @@ ImageToPostscript( * information; 0 means final Postscript is * being created.*/ { - ImageItem *imgPtr = (ImageItem *)itemPtr; + ImageItem *imgPtr = (ImageItem *) itemPtr; Tk_Window canvasWin = Tk_CanvasTkwin(canvas); char buffer[256]; @@ -709,11 +709,11 @@ ImageToPostscript( Tk_State state = itemPtr->state; if(state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } image = imgPtr->image; - if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { + if (Canvas(canvas)->currentItemPtr == itemPtr) { if (imgPtr->activeImage != NULL) { image = imgPtr->activeImage; } diff --git a/generic/tkCanvLine.c b/generic/tkCanvLine.c index b0e122c..21f7fc5 100644 --- a/generic/tkCanvLine.c +++ b/generic/tkCanvLine.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCanvLine.c,v 1.22 2007/12/13 15:24:13 dgp Exp $ + * RCS: @(#) $Id: tkCanvLine.c,v 1.23 2008/04/27 22:38:55 dkf Exp $ */ #include @@ -82,11 +82,11 @@ static int ArrowheadPostscript(Tcl_Interp *interp, static void ComputeLineBbox(Tk_Canvas canvas, LineItem *linePtr); static int ConfigureLine(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, int objc, - Tcl_Obj *CONST objv[], int flags); + Tcl_Obj *const objv[], int flags); static int ConfigureArrows(Tk_Canvas canvas, LineItem *linePtr); static int CreateLine(Tcl_Interp *interp, Tk_Canvas canvas, struct Tk_Item *itemPtr, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static void DeleteLine(Tk_Canvas canvas, Tk_Item *itemPtr, Display *display); static void DisplayLine(Tk_Canvas canvas, @@ -97,7 +97,7 @@ static int GetLineIndex(Tcl_Interp *interp, Tcl_Obj *obj, int *indexPtr); static int LineCoords(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static void LineDeleteCoords(Tk_Canvas canvas, Tk_Item *itemPtr, int first, int last); static void LineInsert(Tk_Canvas canvas, @@ -110,13 +110,13 @@ static int LineToPostscript(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, int prepass); static int ArrowParseProc(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, - CONST char *value, char *recordPtr, int offset); + const char *value, char *recordPtr, int offset); static char * ArrowPrintProc(ClientData clientData, Tk_Window tkwin, char *recordPtr, int offset, Tcl_FreeProc **freeProcPtr); static int ParseArrowShape(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, - CONST char *value, char *recordPtr, int offset); + const char *value, char *recordPtr, int offset); static char * PrintArrowShape(ClientData clientData, Tk_Window tkwin, char *recordPtr, int offset, Tcl_FreeProc **freeProcPtr); @@ -285,7 +285,7 @@ CreateLine( Tk_Item *itemPtr, /* Record to hold new item; header has been * initialized by caller. */ int objc, /* Number of arguments in objv. */ - Tcl_Obj *CONST objv[]) /* Arguments describing line. */ + Tcl_Obj *const objv[]) /* Arguments describing line. */ { LineItem *linePtr = (LineItem *) itemPtr; int i; @@ -364,7 +364,7 @@ LineCoords( Tk_Item *itemPtr, /* Item whose coordinates are to be read or * modified. */ int objc, /* Number of coordinates supplied in objv. */ - Tcl_Obj *CONST objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */ + Tcl_Obj *const objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */ { LineItem *linePtr = (LineItem *) itemPtr; int i, numPoints; @@ -477,7 +477,7 @@ ConfigureLine( Tk_Canvas canvas, /* Canvas containing itemPtr. */ Tk_Item *itemPtr, /* Line item to reconfigure. */ int objc, /* Number of elements in objv. */ - Tcl_Obj *CONST objv[], /* Arguments describing things to configure. */ + Tcl_Obj *const objv[], /* Arguments describing things to configure. */ int flags) /* Flags to pass to Tk_ConfigureWidget. */ { LineItem *linePtr = (LineItem *) itemPtr; @@ -489,7 +489,7 @@ ConfigureLine( tkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, - (CONST char **) objv, (char *) linePtr, flags|TK_CONFIG_OBJS)) { + (const char **) objv, (char *) linePtr, flags|TK_CONFIG_OBJS)) { return TCL_ERROR; } @@ -501,7 +501,7 @@ ConfigureLine( state = itemPtr->state; if(state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } if (linePtr->outline.activeWidth > linePtr->outline.width || @@ -663,7 +663,7 @@ ComputeLineBbox( Tk_TSOffset *tsoffset; if(state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } if (!(linePtr->numPoints) || (state==TK_STATE_HIDDEN)) { @@ -675,7 +675,7 @@ ComputeLineBbox( } width = linePtr->outline.width; - if (((TkCanvas *)canvas)->currentItemPtr == (Tk_Item *)linePtr) { + if (Canvas(canvas)->currentItemPtr == (Tk_Item *)linePtr) { if (linePtr->outline.activeWidth>width) { width = linePtr->outline.activeWidth; } @@ -853,10 +853,10 @@ DisplayLine( } if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } linewidth = linePtr->outline.width; - if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { + if (Canvas(canvas)->currentItemPtr == itemPtr) { if (linePtr->outline.activeWidth != linewidth) { linewidth = linePtr->outline.activeWidth; } @@ -967,7 +967,7 @@ LineInsert( Tcl_Obj **objv; if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } if (!obj || (Tcl_ListObjGetElements(NULL, obj, &objc, &objv) != TCL_OK) @@ -997,7 +997,7 @@ LineInsert( for (i=0; iinterp); + Tcl_ResetResult(Canvas(canvas)->interp); ckfree((char *) newCoordPtr); return; } @@ -1099,7 +1099,7 @@ LineInsert( } } width = linePtr->outline.width; - if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { + if (Canvas(canvas)->currentItemPtr == itemPtr) { if (linePtr->outline.activeWidth>width) { width = linePtr->outline.activeWidth; } @@ -1152,7 +1152,7 @@ LineDeleteCoords( Tk_State state = itemPtr->state; if(state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } first &= -2; @@ -1264,7 +1264,7 @@ LineDeleteCoords( } } width = linePtr->outline.width; - if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { + if (Canvas(canvas)->currentItemPtr == itemPtr) { if (linePtr->outline.activeWidth>width) { width = linePtr->outline.activeWidth; } @@ -1331,11 +1331,11 @@ LineToPoint( */ if(state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } width = linePtr->outline.width; - if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { + if (Canvas(canvas)->currentItemPtr == itemPtr) { if (linePtr->outline.activeWidth>width) { width = linePtr->outline.activeWidth; } @@ -1547,10 +1547,10 @@ LineToArea( Tk_State state = itemPtr->state; if(state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } width = linePtr->outline.width; - if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { + if (Canvas(canvas)->currentItemPtr == itemPtr) { if (linePtr->outline.activeWidth>width) { width = linePtr->outline.activeWidth; } @@ -1863,7 +1863,7 @@ ParseArrowShape( ClientData clientData, /* Not used. */ Tcl_Interp *interp, /* Used for error reporting. */ Tk_Window tkwin, /* Not used. */ - CONST char *value, /* Textual specification of arrow shape. */ + const char *value, /* Textual specification of arrow shape. */ char *recordPtr, /* Pointer to item record in which to store * arrow information. */ int offset) /* Offset of shape information in widget @@ -1872,7 +1872,7 @@ ParseArrowShape( LineItem *linePtr = (LineItem *) recordPtr; double a, b, c; int argc; - CONST char **argv = NULL; + const char **argv = NULL; if (offset != Tk_Offset(LineItem, arrowShapeA)) { Tcl_Panic("ParseArrowShape received bogus offset"); @@ -1967,7 +1967,7 @@ ArrowParseProc( ClientData clientData, /* some flags.*/ Tcl_Interp *interp, /* Used for reporting errors. */ Tk_Window tkwin, /* Window containing canvas widget. */ - CONST char *value, /* Value of option. */ + const char *value, /* Value of option. */ char *widgRec, /* Pointer to record for item. */ int offset) /* Offset into item. */ { @@ -2097,11 +2097,11 @@ ConfigureArrows( } if(state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } width = linePtr->outline.width; - if (((TkCanvas *)canvas)->currentItemPtr == (Tk_Item *)linePtr) { + if (Canvas(canvas)->currentItemPtr == (Tk_Item *)linePtr) { if (linePtr->outline.activeWidth>width) { width = linePtr->outline.activeWidth; } @@ -2250,13 +2250,13 @@ LineToPostscript( Tk_State state = itemPtr->state; if(state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } width = linePtr->outline.width; color = linePtr->outline.color; stipple = linePtr->outline.stipple; - if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { + if (Canvas(canvas)->currentItemPtr == itemPtr) { if (linePtr->outline.activeWidth>width) { width = linePtr->outline.activeWidth; } @@ -2422,12 +2422,12 @@ ArrowheadPostscript( Pixmap stipple; Tk_State state = linePtr->header.state; - if(state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + if (state == TK_STATE_NULL) { + state = Canvas(canvas)->canvas_state; } stipple = linePtr->outline.stipple; - if (((TkCanvas *)canvas)->currentItemPtr == (Tk_Item *)linePtr) { + if (Canvas(canvas)->currentItemPtr == (Tk_Item *) linePtr) { if (linePtr->outline.activeStipple!=None) { stipple = linePtr->outline.activeStipple; } diff --git a/generic/tkCanvPoly.c b/generic/tkCanvPoly.c index 1e61367..8050857 100644 --- a/generic/tkCanvPoly.c +++ b/generic/tkCanvPoly.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCanvPoly.c,v 1.18 2007/12/13 15:24:13 dgp Exp $ + * RCS: @(#) $Id: tkCanvPoly.c,v 1.19 2008/04/27 22:38:55 dkf Exp $ */ #include @@ -160,10 +160,10 @@ static void ComputePolygonBbox(Tk_Canvas canvas, PolygonItem *polyPtr); static int ConfigurePolygon(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, int objc, - Tcl_Obj *CONST objv[], int flags); + Tcl_Obj *const objv[], int flags); static int CreatePolygon(Tcl_Interp *interp, Tk_Canvas canvas, struct Tk_Item *itemPtr, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static void DeletePolygon(Tk_Canvas canvas, Tk_Item *itemPtr, Display *display); static void DisplayPolygon(Tk_Canvas canvas, @@ -174,7 +174,7 @@ static int GetPolygonIndex(Tcl_Interp *interp, Tcl_Obj *obj, int *indexPtr); static int PolygonCoords(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static void PolygonDeleteCoords(Tk_Canvas canvas, Tk_Item *itemPtr, int first, int last); static void PolygonInsert(Tk_Canvas canvas, @@ -253,7 +253,7 @@ CreatePolygon( Tk_Item *itemPtr, /* Record to hold new item; header has been * initialized by caller. */ int objc, /* Number of arguments in objv. */ - Tcl_Obj *CONST objv[]) /* Arguments describing polygon. */ + Tcl_Obj *const objv[]) /* Arguments describing polygon. */ { PolygonItem *polyPtr = (PolygonItem *) itemPtr; int i; @@ -336,7 +336,7 @@ PolygonCoords( Tk_Item *itemPtr, /* Item whose coordinates are to be read or * modified. */ int objc, /* Number of coordinates supplied in objv. */ - Tcl_Obj *CONST objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */ + Tcl_Obj *const objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */ { PolygonItem *polyPtr = (PolygonItem *) itemPtr; int i, numPoints; @@ -435,7 +435,7 @@ ConfigurePolygon( Tk_Canvas canvas, /* Canvas containing itemPtr. */ Tk_Item *itemPtr, /* Polygon item to reconfigure. */ int objc, /* Number of elements in objv. */ - Tcl_Obj *CONST objv[], /* Arguments describing things to configure. */ + Tcl_Obj *const objv[], /* Arguments describing things to configure. */ int flags) /* Flags to pass to Tk_ConfigureWidget. */ { PolygonItem *polyPtr = (PolygonItem *) itemPtr; @@ -449,7 +449,7 @@ ConfigurePolygon( tkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, - (CONST char **) objv, (char *) polyPtr, flags|TK_CONFIG_OBJS)) { + (const char **) objv, (char *) polyPtr, flags|TK_CONFIG_OBJS)) { return TCL_ERROR; } @@ -472,7 +472,7 @@ ConfigurePolygon( } if(state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } if (state==TK_STATE_HIDDEN) { ComputePolygonBbox(canvas, polyPtr); @@ -495,7 +495,7 @@ ConfigurePolygon( color = polyPtr->fillColor; stipple = polyPtr->fillStipple; - if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { + if (Canvas(canvas)->currentItemPtr == itemPtr) { if (polyPtr->activeFillColor!=NULL) { color = polyPtr->activeFillColor; } @@ -632,7 +632,7 @@ ComputePolygonBbox( Tk_TSOffset *tsoffset; if(state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } width = polyPtr->outline.width; if (polyPtr->coordPtr == NULL || (polyPtr->numPoints < 1) || (state==TK_STATE_HIDDEN)) { @@ -640,7 +640,7 @@ ComputePolygonBbox( polyPtr->header.y1 = polyPtr->header.y2 = -1; return; } - if (((TkCanvas *)canvas)->currentItemPtr == (Tk_Item *)polyPtr) { + if (Canvas(canvas)->currentItemPtr == (Tk_Item *)polyPtr) { if (polyPtr->outline.activeWidth>width) { width = polyPtr->outline.activeWidth; } @@ -894,9 +894,9 @@ DisplayPolygon( } if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } - if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { + if (Canvas(canvas)->currentItemPtr == itemPtr) { if (polyPtr->outline.activeWidth>linewidth) { linewidth = polyPtr->outline.activeWidth; } @@ -1028,7 +1028,7 @@ PolygonInsert( Tk_State state = itemPtr->state; if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } if (!obj || (Tcl_ListObjGetElements(NULL, obj, &objc, &objv) != TCL_OK) @@ -1129,7 +1129,7 @@ PolygonInsert( TkIncludePoint(itemPtr, polyPtr->coordPtr+j); } width = polyPtr->outline.width; - if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { + if (Canvas(canvas)->currentItemPtr == itemPtr) { if (polyPtr->outline.activeWidth > width) { width = polyPtr->outline.activeWidth; } @@ -1263,10 +1263,10 @@ PolygonToPoint( bestDist = 1.0e36; if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } width = polyPtr->outline.width; - if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { + if (Canvas(canvas)->currentItemPtr == itemPtr) { if (polyPtr->outline.activeWidth>width) { width = polyPtr->outline.activeWidth; } @@ -1460,11 +1460,11 @@ PolygonToArea( Tk_State state = itemPtr->state; if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } width = polyPtr->outline.width; - if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { + if (Canvas(canvas)->currentItemPtr == itemPtr) { if (polyPtr->outline.activeWidth>width) { width = polyPtr->outline.activeWidth; } @@ -1820,14 +1820,14 @@ PolygonToPostscript( } if(state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } width = polyPtr->outline.width; color = polyPtr->outline.color; stipple = polyPtr->fillStipple; fillColor = polyPtr->fillColor; fillStipple = polyPtr->fillStipple; - if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { + if (Canvas(canvas)->currentItemPtr == itemPtr) { if (polyPtr->outline.activeWidth>width) { width = polyPtr->outline.activeWidth; } diff --git a/generic/tkCanvPs.c b/generic/tkCanvPs.c index d8d60a5..a5efd72 100644 --- a/generic/tkCanvPs.c +++ b/generic/tkCanvPs.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCanvPs.c,v 1.19 2007/12/13 15:24:13 dgp Exp $ + * RCS: @(#) $Id: tkCanvPs.c,v 1.20 2008/04/27 22:38:55 dkf Exp $ */ #include "tkInt.h" @@ -156,7 +156,7 @@ TkCanvPostscriptCmd( TkCanvas *canvasPtr, /* Information about canvas widget. */ Tcl_Interp *interp, /* Current interpreter. */ int argc, /* Number of arguments. */ - CONST char **argv) /* Argument strings. Caller has already parsed + const char **argv) /* Argument strings. Caller has already parsed * this command enough to know that argv[1] is * "postscript". */ { @@ -166,7 +166,7 @@ TkCanvPostscriptCmd( Tk_Item *itemPtr; #define STRING_LENGTH 400 char string[STRING_LENGTH+1]; - CONST char *p; + const char *p; time_t now; size_t length; Tk_Window tkwin = canvasPtr->tkwin; @@ -640,7 +640,7 @@ Tk_PostscriptColor( */ if (psInfoPtr->colorVar != NULL) { - CONST char *cmdString; + const char *cmdString; cmdString = Tcl_GetVar2(interp, psInfoPtr->colorVar, Tk_NameOfColor(colorPtr), 0); @@ -715,14 +715,14 @@ Tk_PostscriptFont( */ if (psInfoPtr->fontVar != NULL) { - CONST char *name = Tk_NameOfFont(tkfont); + const char *name = Tk_NameOfFont(tkfont); Tcl_Obj **objv; int objc; double size; Tcl_Obj *list = Tcl_GetVar2Ex(interp, psInfoPtr->fontVar, name, 0); if (list != NULL) { - CONST char *fontname; + const char *fontname; if (Tcl_ListObjGetElements(interp, list, &objc, &objv) != TCL_OK || objc != 2 diff --git a/generic/tkCanvText.c b/generic/tkCanvText.c index 1dfdc7f..34206ea 100644 --- a/generic/tkCanvText.c +++ b/generic/tkCanvText.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCanvText.c,v 1.26 2007/12/13 15:24:13 dgp Exp $ + * RCS: @(#) $Id: tkCanvText.c,v 1.27 2008/04/27 22:38:55 dkf Exp $ */ #include @@ -139,10 +139,10 @@ static Tk_ConfigSpec configSpecs[] = { static void ComputeTextBbox(Tk_Canvas canvas, TextItem *textPtr); static int ConfigureText(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, int argc, - Tcl_Obj *CONST objv[], int flags); + Tcl_Obj *const objv[], int flags); static int CreateText(Tcl_Interp *interp, Tk_Canvas canvas, struct Tk_Item *itemPtr, - int argc, Tcl_Obj *CONST objv[]); + int argc, Tcl_Obj *const objv[]); static void DeleteText(Tk_Canvas canvas, Tk_Item *itemPtr, Display *display); static void DisplayCanvText(Tk_Canvas canvas, @@ -161,7 +161,7 @@ static void SetTextCursor(Tk_Canvas canvas, Tk_Item *itemPtr, int index); static int TextCoords(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, - int argc, Tcl_Obj *CONST objv[]); + int argc, Tcl_Obj *const objv[]); static void TextDeleteChars(Tk_Canvas canvas, Tk_Item *itemPtr, int first, int last); static void TextInsert(Tk_Canvas canvas, @@ -228,7 +228,7 @@ CreateText( Tk_Item *itemPtr, /* Record to hold new item; header has been * initialized by caller. */ int objc, /* Number of arguments in objv. */ - Tcl_Obj *CONST objv[]) /* Arguments describing rectangle. */ + Tcl_Obj *const objv[]) /* Arguments describing rectangle. */ { TextItem *textPtr = (TextItem *) itemPtr; int i; @@ -322,7 +322,7 @@ TextCoords( Tk_Item *itemPtr, /* Item whose coordinates are to be read or * modified. */ int objc, /* Number of coordinates supplied in objv. */ - Tcl_Obj *CONST objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */ + Tcl_Obj *const objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */ { TextItem *textPtr = (TextItem *) itemPtr; @@ -389,7 +389,7 @@ ConfigureText( Tk_Canvas canvas, /* Canvas containing itemPtr. */ Tk_Item *itemPtr, /* Rectangle item to reconfigure. */ int objc, /* Number of elements in objv. */ - Tcl_Obj *CONST objv[], /* Arguments describing things to configure. */ + Tcl_Obj *const objv[], /* Arguments describing things to configure. */ int flags) /* Flags to pass to Tk_ConfigureWidget. */ { TextItem *textPtr = (TextItem *) itemPtr; @@ -405,7 +405,7 @@ ConfigureText( tkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, - (CONST char **) objv, (char *) textPtr, flags|TK_CONFIG_OBJS)) { + (const char **) objv, (char *) textPtr, flags|TK_CONFIG_OBJS)) { return TCL_ERROR; } @@ -423,12 +423,12 @@ ConfigureText( } if(state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } color = textPtr->color; stipple = textPtr->stipple; - if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { + if (Canvas(canvas)->currentItemPtr == itemPtr) { if (textPtr->activeColor!=NULL) { color = textPtr->activeColor; } @@ -615,7 +615,7 @@ ComputeTextBbox( Tk_State state = textPtr->header.state; if(state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } Tk_FreeTextLayout(textPtr->textLayout); @@ -729,10 +729,10 @@ DisplayCanvText( textInfoPtr = textPtr->textInfoPtr; if(state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } stipple = textPtr->stipple; - if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { + if (Canvas(canvas)->currentItemPtr == itemPtr) { if (textPtr->activeStipple!=None) { stipple = textPtr->activeStipple; } @@ -1087,7 +1087,7 @@ TextToPoint( double value; if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } textPtr = (TextItem *) itemPtr; value = (double) Tk_DistanceToTextLayout(textPtr->textLayout, @@ -1132,7 +1132,7 @@ TextToArea( Tk_State state = itemPtr->state; if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } textPtr = (TextItem *) itemPtr; @@ -1377,7 +1377,7 @@ GetSelText( TextItem *textPtr = (TextItem *) itemPtr; int byteCount; char *text; - CONST char *selStart, *selEnd; + const char *selStart, *selEnd; Tk_CanvasTextInfo *textInfoPtr = textPtr->textInfoPtr; if ((textInfoPtr->selectFirst < 0) || @@ -1438,14 +1438,14 @@ TextToPostscript( Tk_State state = itemPtr->state; if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } color = textPtr->color; stipple = textPtr->stipple; if (state == TK_STATE_HIDDEN || textPtr->color == NULL || textPtr->text == NULL || *textPtr->text == 0) { return TCL_OK; - } else if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { + } else if (Canvas(canvas)->currentItemPtr == itemPtr) { if (textPtr->activeColor!=NULL) { color = textPtr->activeColor; } diff --git a/generic/tkCanvUtil.c b/generic/tkCanvUtil.c index e0c9a3a..5c14d48 100644 --- a/generic/tkCanvUtil.c +++ b/generic/tkCanvUtil.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCanvUtil.c,v 1.19 2008/03/11 22:31:19 das Exp $ + * RCS: @(#) $Id: tkCanvUtil.c,v 1.20 2008/04/27 22:38:55 dkf Exp $ */ #include "tkInt.h" @@ -47,7 +47,7 @@ static Tk_SmoothMethod tkRawSmoothMethod = { static void SmoothMethodCleanupProc(ClientData clientData, Tcl_Interp *interp); static SmoothAssocData *InitSmoothMethods(Tcl_Interp *interp); -static int DashConvert(char *l, CONST char *p, int n, +static int DashConvert(char *l, const char *p, int n, double width); static void TranslateAndAppendCoords(TkCanvas *canvPtr, double x, double y, XPoint *outArr, int numOut); @@ -75,8 +75,7 @@ Tk_Window Tk_CanvasTkwin( Tk_Canvas canvas) /* Token for the canvas. */ { - TkCanvas *canvasPtr = (TkCanvas *) canvas; - return canvasPtr->tkwin; + return Canvas(canvas)->tkwin; } /* @@ -108,10 +107,9 @@ Tk_CanvasDrawableCoords( short *drawableXPtr, /* Screen coordinates are stored here. */ short *drawableYPtr) { - TkCanvas *canvasPtr = (TkCanvas *) canvas; double tmp; - tmp = x - canvasPtr->drawableXOrigin; + tmp = x - Canvas(canvas)->drawableXOrigin; if (tmp > 0) { tmp += 0.5; } else { @@ -125,7 +123,7 @@ Tk_CanvasDrawableCoords( *drawableXPtr = (short) tmp; } - tmp = y - canvasPtr->drawableYOrigin; + tmp = y - Canvas(canvas)->drawableYOrigin; if (tmp > 0) { tmp += 0.5; } else { @@ -168,10 +166,9 @@ Tk_CanvasWindowCoords( short *screenXPtr, /* Screen coordinates are stored here. */ short *screenYPtr) { - TkCanvas *canvasPtr = (TkCanvas *) canvas; double tmp; - tmp = x - canvasPtr->xOrigin; + tmp = x - Canvas(canvas)->xOrigin; if (tmp > 0) { tmp += 0.5; } else { @@ -185,7 +182,7 @@ Tk_CanvasWindowCoords( *screenXPtr = (short) tmp; } - tmp = y - canvasPtr->yOrigin; + tmp = y - Canvas(canvas)->yOrigin; if (tmp > 0) { tmp += 0.5; } else { @@ -224,17 +221,15 @@ int Tk_CanvasGetCoord( Tcl_Interp *interp, /* Interpreter for error reporting. */ Tk_Canvas canvas, /* Canvas to which coordinate applies. */ - CONST char *string, /* Describes coordinate (any screen coordinate + const char *string, /* Describes coordinate (any screen coordinate * form may be used here). */ double *doublePtr) /* Place to store converted coordinate. */ { - TkCanvas *canvasPtr = (TkCanvas *) canvas; - - if (Tk_GetScreenMM(canvasPtr->interp, canvasPtr->tkwin, string, + if (Tk_GetScreenMM(Canvas(canvas)->interp, Canvas(canvas)->tkwin, string, doublePtr) != TCL_OK) { return TCL_ERROR; } - *doublePtr *= canvasPtr->pixelsPerMM; + *doublePtr *= Canvas(canvas)->pixelsPerMM; return TCL_OK; } @@ -266,13 +261,11 @@ Tk_CanvasGetCoordFromObj( * form may be used here). */ double *doublePtr) /* Place to store converted coordinate. */ { - TkCanvas *canvasPtr = (TkCanvas *) canvas; - - if (Tk_GetMMFromObj(canvasPtr->interp, canvasPtr->tkwin, obj, + if (Tk_GetMMFromObj(Canvas(canvas)->interp, Canvas(canvas)->tkwin, obj, doublePtr) != TCL_OK) { return TCL_ERROR; } - *doublePtr *= canvasPtr->pixelsPerMM; + *doublePtr *= Canvas(canvas)->pixelsPerMM; return TCL_OK; } @@ -301,10 +294,9 @@ Tk_CanvasSetStippleOrigin( * to draw a stippled pattern as part of * redisplaying the canvas. */ { - TkCanvas *canvasPtr = (TkCanvas *) canvas; - - XSetTSOrigin(canvasPtr->display, gc, -canvasPtr->drawableXOrigin, - -canvasPtr->drawableYOrigin); + XSetTSOrigin(Canvas(canvas)->display, gc, + -Canvas(canvas)->drawableXOrigin, + -Canvas(canvas)->drawableYOrigin); } /* @@ -333,7 +325,7 @@ Tk_CanvasSetOffset( * redisplaying the canvas. */ Tk_TSOffset *offset) /* Offset (may be NULL pointer)*/ { - TkCanvas *canvasPtr = (TkCanvas *) canvas; + register TkCanvas *canvasPtr = Canvas(canvas); int flags = 0; int x = - canvasPtr->drawableXOrigin; int y = - canvasPtr->drawableYOrigin; @@ -377,7 +369,7 @@ Tk_CanvasTextInfo * Tk_CanvasGetTextInfo( Tk_Canvas canvas) /* Token for the canvas widget. */ { - return &((TkCanvas *) canvas)->textInfo; + return &Canvas(canvas)->textInfo; } /* @@ -403,13 +395,13 @@ Tk_CanvasTagsParseProc( ClientData clientData, /* Not used.*/ Tcl_Interp *interp, /* Used for reporting errors. */ Tk_Window tkwin, /* Window containing canvas widget. */ - CONST char *value, /* Value of option (list of tag names). */ + const char *value, /* Value of option (list of tag names). */ char *widgRec, /* Pointer to record for item. */ int offset) /* Offset into item (ignored). */ { register Tk_Item *itemPtr = (Tk_Item *) widgRec; int argc, i; - CONST char **argv; + const char **argv; Tk_Uid *newPtr; /* @@ -486,7 +478,7 @@ Tk_CanvasTagsPrintProc( return (char *) itemPtr->tagPtr[0]; } *freeProcPtr = TCL_DYNAMIC; - return Tcl_Merge(itemPtr->numTags, (CONST char **) itemPtr->tagPtr); + return Tcl_Merge(itemPtr->numTags, (const char **) itemPtr->tagPtr); } /* @@ -512,11 +504,11 @@ TkCanvasDashParseProc( ClientData clientData, /* Not used.*/ Tcl_Interp *interp, /* Used for reporting errors. */ Tk_Window tkwin, /* Window containing canvas widget. */ - CONST char *value, /* Value of option. */ + const char *value, /* Value of option. */ char *widgRec, /* Pointer to record for item. */ int offset) /* Offset into item. */ { - return Tk_GetDash(interp, value, (Tk_Dash *)(widgRec+offset)); + return Tk_GetDash(interp, value, (Tk_Dash *) (widgRec+offset)); } /* @@ -552,8 +544,7 @@ TkCanvasDashPrintProc( * for return string. */ { Tk_Dash *dash = (Tk_Dash *) (widgRec+offset); - char *buffer; - char *p; + char *buffer, *p; int i = dash->number; if (i < 0) { @@ -568,12 +559,12 @@ TkCanvasDashPrintProc( *freeProcPtr = NULL; return ""; } - buffer = (char *)ckalloc((unsigned int) (4*i)); + buffer = (char *) ckalloc((unsigned int) (4*i)); *freeProcPtr = TCL_DYNAMIC; p = (i > (int)sizeof(char *)) ? dash->pattern.pt : dash->pattern.array; sprintf(buffer, "%d", *p++ & 0xff); - while(--i) { + while (--i) { sprintf(buffer+strlen(buffer), " %d", *p++ & 0xff); } return buffer; @@ -617,8 +608,7 @@ InitSmoothMethods( ptr->smooth.postscriptProc = tkBezierSmoothMethod.postscriptProc; ptr->nextPtr = NULL; - Tcl_SetAssocData(interp, "smoothMethod", SmoothMethodCleanupProc, - (ClientData) methods); + Tcl_SetAssocData(interp, "smoothMethod", SmoothMethodCleanupProc,methods); return methods; } @@ -646,8 +636,7 @@ Tk_CreateSmoothMethod( Tk_SmoothMethod *smooth) { SmoothAssocData *methods, *typePtr2, *prevPtr, *ptr; - methods = (SmoothAssocData *) Tcl_GetAssocData(interp, "smoothMethod", - NULL); + methods = Tcl_GetAssocData(interp, "smoothMethod", NULL); /* * Initialize if we were not previously initialized. @@ -678,8 +667,7 @@ Tk_CreateSmoothMethod( ptr->smooth.coordProc = smooth->coordProc; ptr->smooth.postscriptProc = smooth->postscriptProc; ptr->nextPtr = methods; - Tcl_SetAssocData(interp, "smoothMethod", SmoothMethodCleanupProc, - (ClientData) ptr); + Tcl_SetAssocData(interp, "smoothMethod", SmoothMethodCleanupProc, ptr); } /* @@ -705,10 +693,11 @@ SmoothMethodCleanupProc( * interpreter. */ Tcl_Interp *interp) /* Interpreter that is being deleted. */ { - SmoothAssocData *ptr, *methods = (SmoothAssocData *) clientData; + SmoothAssocData *ptr, *methods = clientData; while (methods != NULL) { - methods = (ptr = methods)->nextPtr; + ptr = methods; + methods = methods->nextPtr; ckfree((char *) ptr); } } @@ -735,7 +724,7 @@ TkSmoothParseProc( ClientData clientData, /* some flags.*/ Tcl_Interp *interp, /* Used for reporting errors. */ Tk_Window tkwin, /* Window containing canvas widget. */ - CONST char *value, /* Value of option. */ + const char *value, /* Value of option. */ char *widgRec, /* Pointer to record for item. */ int offset) /* Offset into item. */ { @@ -751,8 +740,7 @@ TkSmoothParseProc( return TCL_OK; } length = strlen(value); - methods = (SmoothAssocData *) Tcl_GetAssocData(interp, "smoothMethod", - NULL); + methods = Tcl_GetAssocData(interp, "smoothMethod", NULL); /* * Not initialized yet; fix that now. @@ -857,15 +845,15 @@ TkSmoothPrintProc( int Tk_GetDash( Tcl_Interp *interp, /* Used for error reporting. */ - CONST char *value, /* Textual specification of dash list. */ + const char *value, /* Textual specification of dash list. */ Tk_Dash *dash) /* Pointer to record in which to store dash * information. */ { int argc, i; - CONST char **largv, **argv = NULL; + const char **largv, **argv = NULL; char *pt; - if ((value==NULL) || (*value==0) ) { + if ((value == NULL) || (*value == '\0')) { dash->number = 0; return TCL_OK; } @@ -877,17 +865,16 @@ Tk_GetDash( switch (*value) { case '.': case ',': case '-': case '_': i = DashConvert(NULL, value, -1, 0.0); - if (i>0) { - i = strlen(value); - } else { + if (i <= 0) { goto badDashList; } - if (i > (int)sizeof(char *)) { - dash->pattern.pt = pt = (char *) ckalloc(strlen(value)); + i = strlen(value); + if (i > (int) sizeof(char *)) { + dash->pattern.pt = pt = ckalloc(strlen(value)); } else { pt = dash->pattern.array; } - memcpy(pt,value, (unsigned int) i); + memcpy(pt, value, (unsigned) i); dash->number = -i; return TCL_OK; } @@ -897,11 +884,11 @@ Tk_GetDash( goto badDashList; } - if ((unsigned int)ABS(dash->number) > sizeof(char *)) { + if ((unsigned) ABS(dash->number) > sizeof(char *)) { ckfree((char *) dash->pattern.pt); } if (argc > (int)sizeof(char *)) { - dash->pattern.pt = pt = (char *) ckalloc((unsigned int) argc); + dash->pattern.pt = pt = ckalloc((unsigned) argc); } else { pt = dash->pattern.array; } @@ -932,13 +919,12 @@ Tk_GetDash( badDashList: Tcl_AppendResult(interp, "bad dash list \"", value, - "\": must be a list of integers or a format like \"-..\"", - NULL); + "\": must be a list of integers or a format like \"-..\"", NULL); syntaxError: if (argv != NULL) { ckfree((char *) argv); } - if ((unsigned int)ABS(dash->number) > sizeof(char *)) { + if ((unsigned) ABS(dash->number) > sizeof(char *)) { ckfree((char *) dash->pattern.pt); } dash->number = 0; @@ -1010,13 +996,13 @@ Tk_DeleteOutline( if (outline->gc != None) { Tk_FreeGC(display, outline->gc); } - if ((unsigned int)ABS(outline->dash.number) > sizeof(char *)) { + if ((unsigned) ABS(outline->dash.number) > sizeof(char *)) { ckfree((char *) outline->dash.pattern.pt); } - if ((unsigned int)ABS(outline->activeDash.number) > sizeof(char *)) { + if ((unsigned) ABS(outline->activeDash.number) > sizeof(char *)) { ckfree((char *) outline->activeDash.pattern.pt); } - if ((unsigned int)ABS(outline->disabledDash.number) > sizeof(char *)) { + if ((unsigned) ABS(outline->disabledDash.number) > sizeof(char *)) { ckfree((char *) outline->disabledDash.pattern.pt); } if (outline->color != NULL) { @@ -1094,9 +1080,9 @@ Tk_ConfigOutlineGC( color = outline->color; stipple = outline->stipple; if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } - if (((TkCanvas *)canvas)->currentItemPtr == item) { + if (Canvas(canvas)->currentItemPtr == item) { if (outline->activeWidth>width) { width = outline->activeWidth; } @@ -1177,7 +1163,7 @@ Tk_ChangeOutlineGC( Tk_Item *item, Tk_Outline *outline) { - CONST char *p; + const char *p; double width; Tk_Dash *dash; XColor *color; @@ -1192,9 +1178,9 @@ Tk_ChangeOutlineGC( color = outline->color; stipple = outline->stipple; if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } - if (((TkCanvas *)canvas)->currentItemPtr == item) { + if (Canvas(canvas)->currentItemPtr == item) { if (outline->activeWidth > width) { width = outline->activeWidth; } @@ -1231,25 +1217,25 @@ Tk_ChangeOutlineGC( int i = -dash->number; p = (i > (int)sizeof(char *)) ? dash->pattern.pt : dash->pattern.array; - q = (char *) ckalloc(2*(unsigned int)i); + q = (char *) ckalloc(2 * (unsigned) i); i = DashConvert(q, p, i, width); - XSetDashes(((TkCanvas *)canvas)->display, outline->gc, - outline->offset, q, i); + XSetDashes(Canvas(canvas)->display, outline->gc, outline->offset, q,i); ckfree(q); } else if (dash->number>2 || (dash->number==2 && (dash->pattern.array[0]!=dash->pattern.array[1]))) { - p = (dash->number > (int)sizeof(char *)) + p = (dash->number > (int) sizeof(char *)) ? dash->pattern.pt : dash->pattern.array; - XSetDashes(((TkCanvas *)canvas)->display, outline->gc, - outline->offset, p, dash->number); + XSetDashes(Canvas(canvas)->display, outline->gc, outline->offset, p, + dash->number); } if (stipple!=None) { - int w=0; int h=0; + int w = 0; int h = 0; Tk_TSOffset *tsoffset = &outline->tsoffset; int flags = tsoffset->flags; + if (!(flags & TK_OFFSET_INDEX) && (flags & (TK_OFFSET_CENTER|TK_OFFSET_MIDDLE))) { - Tk_SizeOfBitmap(((TkCanvas *)canvas)->display, stipple, &w, &h); + Tk_SizeOfBitmap(Canvas(canvas)->display, stipple, &w, &h); if (flags & TK_OFFSET_CENTER) { w /= 2; } else { @@ -1311,9 +1297,9 @@ Tk_ResetOutlineGC( color = outline->color; stipple = outline->stipple; if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } - if (((TkCanvas *)canvas)->currentItemPtr == item) { + if (Canvas(canvas)->currentItemPtr == item) { if (outline->activeWidth>width) { width = outline->activeWidth; } @@ -1354,11 +1340,11 @@ Tk_ResetOutlineGC( } else { dashList = 4; } - XSetDashes(((TkCanvas *)canvas)->display, outline->gc, - outline->offset, &dashList , 1); + XSetDashes(Canvas(canvas)->display, outline->gc, outline->offset, + &dashList , 1); } if (stipple != None) { - XSetTSOrigin(((TkCanvas *)canvas)->display, outline->gc, 0, 0); + XSetTSOrigin(Canvas(canvas)->display, outline->gc, 0, 0); return 1; } return 0; @@ -1388,28 +1374,21 @@ Tk_CanvasPsOutline( Tk_Item *item, Tk_Outline *outline) { - char string[41]; - char pattern[11]; + char string[41], pattern[11]; int i; - char *ptr; - char *str = string; - char *lptr = pattern; - Tcl_Interp *interp = ((TkCanvas *)canvas)->interp; - double width; - Tk_Dash *dash; - XColor *color; - Pixmap stipple; + char *ptr, *str = string, *lptr = pattern; + Tcl_Interp *interp = Canvas(canvas)->interp; + double width = outline->width; + Tk_Dash *dash = &outline->dash; + XColor *color = outline->color; + Pixmap stipple = outline->stipple; Tk_State state = item->state; - width = outline->width; - dash = &(outline->dash); - color = outline->color; - stipple = outline->stipple; if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } - if (((TkCanvas *)canvas)->currentItemPtr == item) { + if (Canvas(canvas)->currentItemPtr == item) { if (outline->activeWidth > width) { width = outline->activeWidth; } @@ -1440,12 +1419,12 @@ Tk_CanvasPsOutline( Tcl_AppendResult(interp, string, NULL); if (dash->number > 10) { - str = (char *)ckalloc((unsigned int) (1 + 4*dash->number)); + str = (char *) ckalloc((unsigned) (1 + 4*dash->number)); } else if (dash->number < -5) { - str = (char *)ckalloc((unsigned int) (1 - 8*dash->number)); - lptr = (char *)ckalloc((unsigned int) (1 - 2*dash->number)); + str = (char *) ckalloc((unsigned) (1 - 8*dash->number)); + lptr = (char *) ckalloc((unsigned) (1 - 2*dash->number)); } - ptr = ((unsigned int)ABS(dash->number) > sizeof(char *)) ? + ptr = ((unsigned) ABS(dash->number) > sizeof(char *)) ? dash->pattern.pt : dash->pattern.array; if (dash->number > 0) { char *ptr0 = ptr; @@ -1523,7 +1502,7 @@ static int DashConvert( char *l, /* Must be at least 2*n chars long, or NULL to * indicate "just check syntax". */ - CONST char *p, /* String to parse. */ + const char *p, /* String to parse. */ int n, /* Length of string to parse, or -1 to * indicate that strlen() should be used. */ double width) /* Width of line. */ @@ -1531,7 +1510,7 @@ DashConvert( int result = 0; int size, intWidth; - if (n<0) { + if (n < 0) { n = strlen(p); } intWidth = (int) (width + 0.5); @@ -1713,7 +1692,7 @@ TkCanvTranslatePath( double x, y; x = coordArr[i*2]; - y = coordArr[i*2+1]; + y = coordArr[i*2 + 1]; if (xrgh || ybtm) { break; } @@ -1731,10 +1710,10 @@ TkCanvTranslatePath( * b[]. Initialize a[] to be equal to coordArr[]. */ - if (numVertex*12 <= (int)(sizeof(staticSpace)/sizeof(staticSpace[0]))) { + if (numVertex*12 <= (int) (sizeof(staticSpace) / sizeof(double))) { tempArr = staticSpace; } else { - tempArr = (double *)ckalloc(numVertex*12*sizeof(tempArr[0])); + tempArr = (double *) ckalloc(numVertex * 12 * sizeof(double)); } for (i=0; i= xClip) { /* @@ -1799,11 +1778,11 @@ TkCanvTranslatePath( double x0, y0, yN; assert(i > 0); - x0 = a[i*2-2]; - y0 = a[i*2-1]; + x0 = a[i*2 - 2]; + y0 = a[i*2 - 1]; yN = y0 + (y - y0)*(xClip-x0)/(x-x0); b[numOutput*2] = -yN; - b[numOutput*2+1] = xClip; + b[numOutput*2 + 1] = xClip; numOutput++; assert(numOutput <= maxOutput); priorY = yN; @@ -1825,7 +1804,8 @@ TkCanvTranslatePath( * The current vertex is to the left of xClip */ if (!inside) { - /* If the current vertex is on the left of xClip and one + /* + * If the current vertex is on the left of xClip and one * or more prior vertices where to the right, then we have * to draw a line segment along xClip that extends from * the spot where we first crossed from left to right to @@ -1835,19 +1815,19 @@ TkCanvTranslatePath( double x0, y0, yN; assert(i > 0); - x0 = a[i*2-2]; - y0 = a[i*2-1]; + x0 = a[i*2 - 2]; + y0 = a[i*2 - 1]; yN = y0 + (y - y0)*(xClip-x0)/(x-x0); if (yN != priorY) { b[numOutput*2] = -yN; - b[numOutput*2+1] = xClip; + b[numOutput*2 + 1] = xClip; numOutput++; assert(numOutput <= maxOutput); } inside = 1; } b[numOutput*2] = -y; - b[numOutput*2+1] = x; + b[numOutput*2 + 1] = x; numOutput++; assert(numOutput <= maxOutput); } diff --git a/generic/tkCanvWind.c b/generic/tkCanvWind.c index 550a7d3..405c81e 100644 --- a/generic/tkCanvWind.c +++ b/generic/tkCanvWind.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCanvWind.c,v 1.16 2007/12/13 15:24:13 dgp Exp $ + * RCS: @(#) $Id: tkCanvWind.c,v 1.17 2008/04/27 22:38:55 dkf Exp $ */ #include @@ -73,10 +73,10 @@ static void ComputeWindowBbox(Tk_Canvas canvas, WindowItem *winItemPtr); static int ConfigureWinItem(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, int objc, - Tcl_Obj *CONST objv[], int flags); + Tcl_Obj *const objv[], int flags); static int CreateWinItem(Tcl_Interp *interp, Tk_Canvas canvas, struct Tk_Item *itemPtr, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static void DeleteWinItem(Tk_Canvas canvas, Tk_Item *itemPtr, Display *display); static void DisplayWinItem(Tk_Canvas canvas, @@ -89,7 +89,7 @@ static void TranslateWinItem(Tk_Canvas canvas, Tk_Item *itemPtr, double deltaX, double deltaY); static int WinItemCoords(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static void WinItemLostSlaveProc(ClientData clientData, Tk_Window tkwin); static void WinItemRequestProc(ClientData clientData, @@ -174,7 +174,7 @@ CreateWinItem( Tk_Item *itemPtr, /* Record to hold new item; header has been * initialized by caller. */ int objc, /* Number of arguments in objv. */ - Tcl_Obj *CONST objv[]) /* Arguments describing window. */ + Tcl_Obj *const objv[]) /* Arguments describing window. */ { WindowItem *winItemPtr = (WindowItem *) itemPtr; int i; @@ -202,6 +202,7 @@ CreateWinItem( i = 1; } else { char *arg = Tcl_GetString(objv[1]); + i = 2; if ((arg[0] == '-') && (arg[1] >= 'a') && (arg[1] <= 'z')) { i = 1; @@ -244,7 +245,7 @@ WinItemCoords( Tk_Item *itemPtr, /* Item whose coordinates are to be read or * modified. */ int objc, /* Number of coordinates supplied in objv. */ - Tcl_Obj *CONST objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */ + Tcl_Obj *const objv[]) /* Array of coordinates: x1, y1, x2, y2, ... */ { WindowItem *winItemPtr = (WindowItem *) itemPtr; @@ -308,7 +309,7 @@ ConfigureWinItem( Tk_Canvas canvas, /* Canvas containing itemPtr. */ Tk_Item *itemPtr, /* Window item to reconfigure. */ int objc, /* Number of elements in objv. */ - Tcl_Obj *CONST objv[], /* Arguments describing things to configure. */ + Tcl_Obj *const objv[], /* Arguments describing things to configure. */ int flags) /* Flags to pass to Tk_ConfigureWidget. */ { WindowItem *winItemPtr = (WindowItem *) itemPtr; @@ -318,7 +319,7 @@ ConfigureWinItem( oldWindow = winItemPtr->tkwin; canvasTkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, canvasTkwin, configSpecs, objc, - (CONST char **) objv, (char *) winItemPtr, flags|TK_CONFIG_OBJS)) { + (const char **) objv, (char *) winItemPtr, flags|TK_CONFIG_OBJS)) { return TCL_ERROR; } @@ -453,7 +454,7 @@ ComputeWindowBbox( y = (int) (winItemPtr->y + ((winItemPtr->y >= 0) ? 0.5 : - 0.5)); if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } if ((winItemPtr->tkwin == NULL) || (state == TK_STATE_HIDDEN)) { /* @@ -578,7 +579,7 @@ DisplayWinItem( return; } if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } /* @@ -759,8 +760,7 @@ xerrorhandler( { return 0; } -#endif - +#endif /* X_GetImage */ /* *-------------------------------------------------------------- @@ -790,8 +790,7 @@ WinItemToPostscript( * information; 0 means final Postscript is * being created. */ { - WindowItem *winItemPtr = (WindowItem *)itemPtr; - + WindowItem *winItemPtr = (WindowItem *) itemPtr; double x, y; int width, height; Tk_Window tkwin = winItemPtr->tkwin; @@ -890,7 +889,7 @@ CanvasPsWindow( */ ximage = XGetImage(Tk_Display(tkwin), Tk_WindowId(tkwin), 0, 0, - (unsigned int)width, (unsigned int)height, AllPlanes, ZPixmap); + (unsigned) width, (unsigned) height, AllPlanes, ZPixmap); #ifdef X_GetImage Tk_DeleteErrorHandler(handle); @@ -900,8 +899,8 @@ CanvasPsWindow( return TCL_OK; } - result = TkPostscriptImage(interp, tkwin, - ((TkCanvas *)canvas)->psInfo, ximage, 0, 0, width, height); + result = TkPostscriptImage(interp, tkwin, Canvas(canvas)->psInfo, ximage, + 0, 0, width, height); XDestroyImage(ximage); return result; @@ -1069,11 +1068,11 @@ WinItemLostSlaveProc( * was stolen away. */ Tk_Window tkwin) /* Tk's handle for the slave window. */ { - WindowItem *winItemPtr = (WindowItem *) clientData; + WindowItem *winItemPtr = clientData; Tk_Window canvasTkwin = Tk_CanvasTkwin(winItemPtr->canvas); Tk_DeleteEventHandler(winItemPtr->tkwin, StructureNotifyMask, - WinItemStructureProc, (ClientData) winItemPtr); + WinItemStructureProc, winItemPtr); if (canvasTkwin != Tk_Parent(winItemPtr->tkwin)) { Tk_UnmaintainGeometry(winItemPtr->tkwin, canvasTkwin); } diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index e6cc864..3d5240e 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCanvas.c,v 1.47 2008/04/17 14:53:44 dgp Exp $ + * RCS: @(#) $Id: tkCanvas.c,v 1.48 2008/04/27 22:38:55 dkf Exp $ */ /* #define USE_OLD_TAG_SEARCH 1 */ @@ -266,12 +266,12 @@ static void CanvasSetOrigin(TkCanvas *canvasPtr, static void CanvasUpdateScrollbars(TkCanvas *canvasPtr); static int CanvasWidgetCmd(ClientData clientData, Tcl_Interp *interp, int argc, - Tcl_Obj *CONST *argv); + Tcl_Obj *const *argv); static void CanvasWorldChanged( ClientData instanceData); static int ConfigureCanvas(Tcl_Interp *interp, TkCanvas *canvasPtr, int argc, - Tcl_Obj *CONST *argv, int flags); + Tcl_Obj *const *argv, int flags); static void DestroyCanvas(char *memPtr); static void DisplayCanvas(ClientData clientData); static void DoItem(Tcl_Interp *interp, @@ -280,18 +280,18 @@ static void EventuallyRedrawItem(Tk_Canvas canvas, Tk_Item *itemPtr); #ifdef USE_OLD_TAG_SEARCH static int FindItems(Tcl_Interp *interp, TkCanvas *canvasPtr, - int argc, Tcl_Obj *CONST *argv, + int argc, Tcl_Obj *const *argv, Tcl_Obj *newTagObj, int first); #else /* USE_OLD_TAG_SEARCH */ static int FindItems(Tcl_Interp *interp, TkCanvas *canvasPtr, - int argc, Tcl_Obj *CONST *argv, + int argc, Tcl_Obj *const *argv, Tcl_Obj *newTagObj, int first, TagSearch **searchPtrPtr); #endif /* USE_OLD_TAG_SEARCH */ static int FindArea(Tcl_Interp *interp, TkCanvas *canvasPtr, - Tcl_Obj *CONST *argv, Tk_Uid uid, int enclosed); + Tcl_Obj *const *argv, Tk_Uid uid, int enclosed); static double GridAlign(double coord, double spacing); -static CONST char** TkGetStringsFromObjs(int argc, Tcl_Obj *CONST *objv); +static const char** TkGetStringsFromObjs(int argc, Tcl_Obj *const *objv); static void InitCanvas(void); #ifdef USE_OLD_TAG_SEARCH static Tk_Item * NextItem(TagSearch *searchPtr); @@ -377,7 +377,7 @@ Tk_CanvasObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int argc, /* Number of arguments. */ - Tcl_Obj *CONST argv[]) /* Argument objects. */ + Tcl_Obj *const argv[]) /* Argument objects. */ { Tk_Window tkwin = (Tk_Window) clientData; TkCanvas *canvasPtr; @@ -527,9 +527,9 @@ CanvasWidgetCmd( ClientData clientData, /* Information about canvas widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { - TkCanvas *canvasPtr = (TkCanvas *) clientData; + TkCanvas *canvasPtr = clientData; int c, result; Tk_Item *itemPtr = NULL; /* Initialization needed only to prevent * compiler warning. */ @@ -541,7 +541,7 @@ CanvasWidgetCmd( #endif /* USE_OLD_TAG_SEARCH */ int index; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "addtag", "bbox", "bind", "canvasx", "canvasy", "cget", "configure", "coords", "create", "dchars", "delete", "dtag", @@ -778,12 +778,12 @@ CanvasWidgetCmd( goto done; } } else if (objc == 4) { - CONST char *command; + const char *command; command = Tk_GetBinding(interp, canvasPtr->bindingTable, object, Tcl_GetString(objv[3])); if (command == NULL) { - CONST char *string; + const char *string; string = Tcl_GetStringResult(interp); @@ -900,7 +900,8 @@ CanvasWidgetCmd( result = (*itemPtr->typePtr->coordProc)(interp, (Tk_Canvas) canvasPtr, itemPtr, objc-3, objv+3); } else { - CONST char **args = TkGetStringsFromObjs(objc-3, objv+3); + const char **args = TkGetStringsFromObjs(objc-3, objv+3); + result = (*itemPtr->typePtr->coordProc)(interp, (Tk_Canvas) canvasPtr, itemPtr, objc-3, (Tcl_Obj **) args); @@ -977,7 +978,8 @@ CanvasWidgetCmd( result = (*typePtr->createProc)(interp, (Tk_Canvas) canvasPtr, itemPtr, objc-3, objv+3); } else { - CONST char **args = TkGetStringsFromObjs(objc-3, objv+3); + const char **args = TkGetStringsFromObjs(objc-3, objv+3); + result = (*typePtr->createProc)(interp, (Tk_Canvas) canvasPtr, itemPtr, objc-3, (Tcl_Obj **) args); if (args != NULL) { @@ -1373,7 +1375,8 @@ CanvasWidgetCmd( (Tk_Canvas) canvasPtr, itemPtr, objc-3, objv+3, TK_CONFIG_ARGV_ONLY); } else { - CONST char **args = TkGetStringsFromObjs(objc-3, objv+3); + const char **args = TkGetStringsFromObjs(objc-3, objv+3); + result = (*itemPtr->typePtr->configProc)(interp, (Tk_Canvas) canvasPtr, itemPtr, objc-3, (Tcl_Obj **) args, TK_CONFIG_ARGV_ONLY); @@ -1444,7 +1447,7 @@ CanvasWidgetCmd( break; } case CANV_POSTSCRIPT: { - CONST char **args = TkGetStringsFromObjs(objc, objv); + const char **args = TkGetStringsFromObjs(objc, objv); result = TkCanvPostscriptCmd(canvasPtr, interp, objc, args); if (args != NULL) { @@ -1519,7 +1522,7 @@ CanvasWidgetCmd( } case CANV_SCAN: { int x, y, gain = 10; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "mark", "dragto", NULL }; @@ -1563,7 +1566,7 @@ CanvasWidgetCmd( } case CANV_SELECT: { int index, optionindex; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "adjust", "clear", "from", "item", "to", NULL }; enum options { @@ -1696,7 +1699,8 @@ CanvasWidgetCmd( - canvasPtr->inset, canvasPtr->scrollX1, canvasPtr->scrollX2)); } else { - CONST char **args = TkGetStringsFromObjs(objc, objv); + const char **args = TkGetStringsFromObjs(objc, objv); + type = Tk_GetScrollInfo(interp, objc, args, &fraction, &count); if (args != NULL) { ckfree((char *) args); @@ -1742,7 +1746,8 @@ CanvasWidgetCmd( - canvasPtr->inset, canvasPtr->scrollY1, canvasPtr->scrollY2)); } else { - CONST char **args = TkGetStringsFromObjs(objc, objv); + const char **args = TkGetStringsFromObjs(objc, objv); + type = Tk_GetScrollInfo(interp, objc, args, &fraction, &count); if (args != NULL) { ckfree((char *) args); @@ -1881,14 +1886,14 @@ ConfigureCanvas( TkCanvas *canvasPtr, /* Information about widget; may or may not * already have values for some fields. */ int objc, /* Number of valid entries in objv. */ - Tcl_Obj *CONST objv[], /* Argument objects. */ + Tcl_Obj *const objv[], /* Argument objects. */ int flags) /* Flags to pass to Tk_ConfigureWidget. */ { XGCValues gcValues; GC newGC; if (Tk_ConfigureWidget(interp, canvasPtr->tkwin, configSpecs, - objc, (CONST char **) objv, (char *) canvasPtr, + objc, (const char **) objv, (char *) canvasPtr, flags|TK_CONFIG_OBJS) != TCL_OK) { return TCL_ERROR; } @@ -1941,7 +1946,7 @@ ConfigureCanvas( canvasPtr->scrollY2 = 0; if (canvasPtr->regionString != NULL) { int argc2; - CONST char **argv2; + const char **argv2; if (Tcl_SplitList(canvasPtr->interp, canvasPtr->regionString, &argc2, &argv2) != TCL_OK) { @@ -2023,11 +2028,10 @@ static void CanvasWorldChanged( ClientData instanceData) /* Information about widget. */ { - TkCanvas *canvasPtr; + TkCanvas *canvasPtr = (TkCanvas *) instanceData; Tk_Item *itemPtr; int result; - canvasPtr = (TkCanvas *) instanceData; itemPtr = canvasPtr->firstItemPtr; for ( ; itemPtr != NULL; itemPtr = itemPtr->nextPtr) { result = (*itemPtr->typePtr->configProc)(canvasPtr->interp, @@ -2066,7 +2070,7 @@ static void DisplayCanvas( ClientData clientData) /* Information about widget. */ { - TkCanvas *canvasPtr = (TkCanvas *) clientData; + TkCanvas *canvasPtr = clientData; Tk_Window tkwin = canvasPtr->tkwin; Tk_Item *itemPtr; Pixmap pixmap; @@ -2307,7 +2311,7 @@ CanvasEventProc( ClientData clientData, /* Information about window. */ XEvent *eventPtr) /* Information about event. */ { - TkCanvas *canvasPtr = (TkCanvas *) clientData; + TkCanvas *canvasPtr = clientData; if (eventPtr->type == Expose) { int x, y; @@ -2399,7 +2403,7 @@ static void CanvasCmdDeletedProc( ClientData clientData) /* Pointer to widget record for widget. */ { - TkCanvas *canvasPtr = (TkCanvas *) clientData; + TkCanvas *canvasPtr = clientData; Tk_Window tkwin = canvasPtr->tkwin; /* @@ -2440,7 +2444,7 @@ Tk_CanvasEventuallyRedraw( int x2, int y2) /* Lower right corner of area to redraw. * Pixels on edge are not redrawn. */ { - TkCanvas *canvasPtr = (TkCanvas *) canvas; + TkCanvas *canvasPtr = Canvas(canvas); /* * If tkwin is NULL, the canvas has been destroyed, so we can't really @@ -2505,7 +2509,8 @@ EventuallyRedrawItem( Tk_Canvas canvas, /* Information about widget. */ Tk_Item *itemPtr) /* Item to be redrawn. */ { - TkCanvas *canvasPtr = (TkCanvas *) canvas; + TkCanvas *canvasPtr = Canvas(canvas); + if ((itemPtr->x1 >= itemPtr->x2) || (itemPtr->y1 >= itemPtr->y2) || (itemPtr->x2 < canvasPtr->xOrigin) || (itemPtr->y2 < canvasPtr->yOrigin) || @@ -3900,7 +3905,7 @@ FindItems( TkCanvas *canvasPtr, /* Canvas whose items are to be searched. */ int objc, /* Number of entries in argv. Must be greater * than zero. */ - Tcl_Obj *CONST *objv, /* Arguments that describe what items to + Tcl_Obj *const *objv, /* Arguments that describe what items to * search for (see user doc on "find" and * "addtag" options). */ Tcl_Obj *newTag, /* If non-NULL, gives new tag to set on all @@ -3921,7 +3926,7 @@ FindItems( Tk_Item *itemPtr; Tk_Uid uid; int index, result; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "above", "all", "below", "closest", "enclosed", "overlapping", "withtag", NULL }; @@ -4148,7 +4153,7 @@ FindArea( Tcl_Interp *interp, /* Interpreter for error reporting and result * storing. */ TkCanvas *canvasPtr, /* Canvas whose items are to be searched. */ - Tcl_Obj *CONST *objv, /* Array of four arguments that give the + Tcl_Obj *const *objv, /* Array of four arguments that give the * coordinates of the rectangular area to * search. */ Tk_Uid uid, /* If non-NULL, gives new tag to set on all @@ -4354,9 +4359,9 @@ CanvasBindProc( ClientData clientData, /* Pointer to canvas structure. */ XEvent *eventPtr) /* Pointer to X event that just happened. */ { - TkCanvas *canvasPtr = (TkCanvas *) clientData; + TkCanvas *canvasPtr = clientData; - Tcl_Preserve((ClientData) canvasPtr); + Tcl_Preserve(canvasPtr); /* * This code below keeps track of the current modifier state in @@ -4433,7 +4438,7 @@ CanvasBindProc( CanvasDoEvent(canvasPtr, eventPtr); done: - Tcl_Release((ClientData) canvasPtr); + Tcl_Release(canvasPtr); } /* @@ -4643,8 +4648,8 @@ PickCurrentItem( #else /* USE_OLD_TAG_SEARCH */ DoItem(NULL, canvasPtr->currentItemPtr, searchUids->currentUid); #endif /* USE_OLD_TAG_SEA */ - if ((canvasPtr->currentItemPtr->redraw_flags & TK_ITEM_STATE_DEPENDANT && - prevItemPtr != canvasPtr->currentItemPtr)) { + if ((canvasPtr->currentItemPtr->redraw_flags & TK_ITEM_STATE_DEPENDANT + && prevItemPtr != canvasPtr->currentItemPtr)) { (*canvasPtr->currentItemPtr->typePtr->configProc)(canvasPtr->interp, (Tk_Canvas) canvasPtr, canvasPtr->currentItemPtr, 0, NULL, TK_CONFIG_ARGV_ONLY); @@ -4806,14 +4811,14 @@ CanvasDoEvent( (numObjects * sizeof(ClientData))); } #ifdef USE_OLD_TAG_SEARCH - objectPtr[0] = (ClientData) Tk_GetUid("all"); + objectPtr[0] = Tk_GetUid("all"); #else /* USE_OLD_TAG_SEARCH */ - objectPtr[0] = (ClientData) searchUids->allUid; + objectPtr[0] = searchUids->allUid; #endif /* USE_OLD_TAG_SEARCH */ for (i = itemPtr->numTags-1; i >= 0; i--) { - objectPtr[i+1] = (ClientData) itemPtr->tagPtr[i]; + objectPtr[i+1] = itemPtr->tagPtr[i]; } - objectPtr[itemPtr->numTags+1] = (ClientData) itemPtr; + objectPtr[itemPtr->numTags+1] = itemPtr; #ifndef USE_OLD_TAG_SEARCH /* @@ -4866,7 +4871,7 @@ static void CanvasBlinkProc( ClientData clientData) /* Pointer to record describing entry. */ { - TkCanvas *canvasPtr = (TkCanvas *) clientData; + TkCanvas *canvasPtr = clientData; if (!canvasPtr->textInfo.gotFocus || (canvasPtr->insertOffTime == 0)) { return; @@ -4874,13 +4879,11 @@ CanvasBlinkProc( if (canvasPtr->textInfo.cursorOn) { canvasPtr->textInfo.cursorOn = 0; canvasPtr->insertBlinkHandler = Tcl_CreateTimerHandler( - canvasPtr->insertOffTime, CanvasBlinkProc, - (ClientData) canvasPtr); + canvasPtr->insertOffTime, CanvasBlinkProc, canvasPtr); } else { canvasPtr->textInfo.cursorOn = 1; canvasPtr->insertBlinkHandler = Tcl_CreateTimerHandler( - canvasPtr->insertOnTime, CanvasBlinkProc, - (ClientData) canvasPtr); + canvasPtr->insertOnTime, CanvasBlinkProc, canvasPtr); } if (canvasPtr->textInfo.focusItemPtr != NULL) { EventuallyRedrawItem((Tk_Canvas) canvasPtr, @@ -4918,8 +4921,7 @@ CanvasFocusProc( canvasPtr->textInfo.cursorOn = 1; if (canvasPtr->insertOffTime != 0) { canvasPtr->insertBlinkHandler = Tcl_CreateTimerHandler( - canvasPtr->insertOffTime, CanvasBlinkProc, - (ClientData) canvasPtr); + canvasPtr->insertOffTime, CanvasBlinkProc, canvasPtr); } } else { canvasPtr->textInfo.gotFocus = 0; @@ -4933,7 +4935,7 @@ CanvasFocusProc( if (canvasPtr->highlightWidth > 0) { canvasPtr->flags |= REDRAW_BORDERS; if (!(canvasPtr->flags & REDRAW_PENDING)) { - Tcl_DoWhenIdle(DisplayCanvas, (ClientData) canvasPtr); + Tcl_DoWhenIdle(DisplayCanvas, canvasPtr); canvasPtr->flags |= REDRAW_PENDING; } } @@ -4976,7 +4978,7 @@ CanvasSelectTo( if (canvasPtr->textInfo.selItemPtr == NULL) { Tk_OwnSelection(canvasPtr->tkwin, XA_PRIMARY, CanvasLostSelection, - (ClientData) canvasPtr); + canvasPtr); } else if (canvasPtr->textInfo.selItemPtr != itemPtr) { EventuallyRedrawItem((Tk_Canvas) canvasPtr, canvasPtr->textInfo.selItemPtr); @@ -5032,7 +5034,7 @@ CanvasFetchSelection( * not including terminating NULL * character. */ { - TkCanvas *canvasPtr = (TkCanvas *) clientData; + TkCanvas *canvasPtr = clientData; if (canvasPtr->textInfo.selItemPtr == NULL) { return -1; @@ -5067,7 +5069,7 @@ static void CanvasLostSelection( ClientData clientData) /* Information about entry widget. */ { - TkCanvas *canvasPtr = (TkCanvas *) clientData; + TkCanvas *canvasPtr = clientData; if (canvasPtr->textInfo.selItemPtr != NULL) { EventuallyRedrawItem((Tk_Canvas) canvasPtr, @@ -5196,14 +5198,14 @@ CanvasUpdateScrollbars( */ interp = canvasPtr->interp; - Tcl_Preserve((ClientData) interp); + Tcl_Preserve(interp); xScrollCmd = canvasPtr->xScrollCmd; if (xScrollCmd != NULL) { - Tcl_Preserve((ClientData) xScrollCmd); + Tcl_Preserve(xScrollCmd); } yScrollCmd = canvasPtr->yScrollCmd; if (yScrollCmd != NULL) { - Tcl_Preserve((ClientData) yScrollCmd); + Tcl_Preserve(yScrollCmd); } xOrigin = canvasPtr->xOrigin; yOrigin = canvasPtr->yOrigin; @@ -5218,6 +5220,7 @@ CanvasUpdateScrollbars( if (canvasPtr->xScrollCmd != NULL) { Tcl_Obj *fractions = ScrollFractions(xOrigin + inset, xOrigin + width - inset, scrollX1, scrollX2); + result = Tcl_VarEval(interp, xScrollCmd, " ", Tcl_GetString(fractions), NULL); Tcl_DecrRefCount(fractions); @@ -5225,12 +5228,13 @@ CanvasUpdateScrollbars( Tcl_BackgroundError(interp); } Tcl_ResetResult(interp); - Tcl_Release((ClientData) xScrollCmd); + Tcl_Release(xScrollCmd); } if (yScrollCmd != NULL) { Tcl_Obj *fractions = ScrollFractions(yOrigin + inset, yOrigin + height - inset, scrollY1, scrollY2); + result = Tcl_VarEval(interp, yScrollCmd, " ", Tcl_GetString(fractions), NULL); Tcl_DecrRefCount(fractions); @@ -5238,9 +5242,9 @@ CanvasUpdateScrollbars( Tcl_BackgroundError(interp); } Tcl_ResetResult(interp); - Tcl_Release((ClientData) yScrollCmd); + Tcl_Release(yScrollCmd); } - Tcl_Release((ClientData) interp); + Tcl_Release(interp); } /* @@ -5389,17 +5393,18 @@ CanvasSetOrigin( */ /* ARGSUSED */ -static CONST char ** +static const char ** TkGetStringsFromObjs( int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { register int i; - CONST char **argv; + const char **argv; + if (objc <= 0) { return NULL; } - argv = (CONST char **) ckalloc((objc+1) * sizeof(char *)); + argv = (const char **) ckalloc((objc+1) * sizeof(char *)); for (i = 0; i < objc; i++) { argv[i] = Tcl_GetString(objv[i]); } @@ -5435,8 +5440,7 @@ Tk_CanvasPsColor( Tk_Canvas canvas, /* Information about canvas. */ XColor *colorPtr) /* Information about color. */ { - return Tk_PostscriptColor(interp, ((TkCanvas *) canvas)->psInfo, - colorPtr); + return Tk_PostscriptColor(interp, Canvas(canvas)->psInfo, colorPtr); } /* @@ -5469,7 +5473,7 @@ Tk_CanvasPsFont( Tk_Font tkfont) /* Information about font in which text is to * be printed. */ { - return Tk_PostscriptFont(interp, ((TkCanvas *) canvas)->psInfo, tkfont); + return Tk_PostscriptFont(interp, Canvas(canvas)->psInfo, tkfont); } /* @@ -5502,9 +5506,8 @@ Tk_CanvasPsBitmap( * rectangular region to output. */ int width, int height) /* Size of rectangular region. */ { - return Tk_PostscriptBitmap(interp, ((TkCanvas *) canvas)->tkwin, - ((TkCanvas *) canvas)->psInfo, bitmap, startX, startY, - width, height); + return Tk_PostscriptBitmap(interp, Canvas(canvas)->tkwin, + Canvas(canvas)->psInfo, bitmap, startX, startY, width, height); } /* @@ -5536,8 +5539,8 @@ Tk_CanvasPsStipple( Tk_Canvas canvas, /* Information about canvas. */ Pixmap bitmap) /* Bitmap to use for stippling. */ { - return Tk_PostscriptStipple(interp, ((TkCanvas *) canvas)->tkwin, - ((TkCanvas *) canvas)->psInfo, bitmap); + return Tk_PostscriptStipple(interp, Canvas(canvas)->tkwin, + Canvas(canvas)->psInfo, bitmap); } /* @@ -5563,7 +5566,7 @@ Tk_CanvasPsY( * is being generated. */ double y) /* Y-coordinate in canvas coords. */ { - return Tk_PostscriptY(y, ((TkCanvas *) canvas)->psInfo); + return Tk_PostscriptY(y, Canvas(canvas)->psInfo); } /* @@ -5593,8 +5596,7 @@ Tk_CanvasPsPath( * coordinates giving points for path. */ int numPoints) /* Number of points at *coordPtr. */ { - Tk_PostscriptPath(interp, ((TkCanvas *) canvas)->psInfo, - coordPtr, numPoints); + Tk_PostscriptPath(interp, Canvas(canvas)->psInfo, coordPtr, numPoints); } /* diff --git a/generic/tkClipboard.c b/generic/tkClipboard.c index cd0455b..c4e6c23 100644 --- a/generic/tkClipboard.c +++ b/generic/tkClipboard.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkClipboard.c,v 1.18 2007/12/13 15:24:13 dgp Exp $ + * RCS: @(#) $Id: tkClipboard.c,v 1.19 2008/04/27 22:38:55 dkf Exp $ */ #include "tkInt.h" @@ -58,7 +58,7 @@ ClipboardHandler( char *buffer, /* Place to store converted selection. */ int maxBytes) /* Maximum # of bytes to store at buffer. */ { - TkClipboardTarget *targetPtr = (TkClipboardTarget*) clientData; + TkClipboardTarget *targetPtr = clientData; TkClipboardBuffer *cbPtr; char *srcPtr, *destPtr; size_t count = 0; @@ -136,9 +136,9 @@ ClipboardAppHandler( char *buffer, /* Place to store converted selection. */ int maxBytes) /* Maximum # of bytes to store at buffer. */ { - TkDisplay *dispPtr = (TkDisplay *) clientData; + TkDisplay *dispPtr = clientData; size_t length; - CONST char *p; + const char *p; p = dispPtr->clipboardAppPtr->winPtr->nameUid; length = strlen(p); @@ -207,7 +207,7 @@ static void ClipboardLostSel( ClientData clientData) /* Pointer to TkDisplay structure. */ { - TkDisplay *dispPtr = (TkDisplay*) clientData; + TkDisplay *dispPtr = clientData; dispPtr->clipboardActive = 0; } @@ -284,7 +284,7 @@ Tk_ClipboardClear( if (!dispPtr->clipboardActive) { Tk_OwnSelection(dispPtr->clipWindow, dispPtr->clipboardAtom, - ClipboardLostSel, (ClientData) dispPtr); + ClipboardLostSel, dispPtr); dispPtr->clipboardActive = 1; } dispPtr->clipboardAppPtr = winPtr->mainPtr; @@ -326,7 +326,7 @@ Tk_ClipboardAppend( * clipboard item, e.g. STRING or LENGTH. */ Atom format, /* Format in which the selection information * should be returned to the requestor. */ - char* buffer) /* NULL terminated string containing the data + char *buffer) /* NULL terminated string containing the data * to be added to the clipboard. */ { TkWindow *winPtr = (TkWindow *) tkwin; @@ -343,7 +343,7 @@ Tk_ClipboardAppend( Tk_ClipboardClear(interp, tkwin); } else if (!dispPtr->clipboardActive) { Tk_OwnSelection(dispPtr->clipWindow, dispPtr->clipboardAtom, - ClipboardLostSel, (ClientData) dispPtr); + ClipboardLostSel, dispPtr); dispPtr->clipboardActive = 1; } @@ -360,14 +360,14 @@ Tk_ClipboardAppend( } } if (targetPtr == NULL) { - targetPtr = (TkClipboardTarget*) ckalloc(sizeof(TkClipboardTarget)); + targetPtr = (TkClipboardTarget *) ckalloc(sizeof(TkClipboardTarget)); targetPtr->type = type; targetPtr->format = format; targetPtr->firstBufferPtr = targetPtr->lastBufferPtr = NULL; targetPtr->nextPtr = dispPtr->clipTargetPtr; dispPtr->clipTargetPtr = targetPtr; Tk_CreateSelHandler(dispPtr->clipWindow, dispPtr->clipboardAtom, - type, ClipboardHandler, (ClientData) targetPtr, format); + type, ClipboardHandler, targetPtr, format); } else if (targetPtr->format != format) { Tcl_AppendResult(interp, "format \"", Tk_GetAtomName(tkwin, format), "\" does not match current format \"", @@ -380,7 +380,7 @@ Tk_ClipboardAppend( * Append a new buffer to the buffer chain. */ - cbPtr = (TkClipboardBuffer*) ckalloc(sizeof(TkClipboardBuffer)); + cbPtr = (TkClipboardBuffer *) ckalloc(sizeof(TkClipboardBuffer)); cbPtr->nextPtr = NULL; if (targetPtr->lastBufferPtr != NULL) { targetPtr->lastBufferPtr->nextPtr = cbPtr; @@ -393,7 +393,7 @@ Tk_ClipboardAppend( cbPtr->buffer = (char *) ckalloc((unsigned) (cbPtr->length + 1)); strcpy(cbPtr->buffer, buffer); - TkSelUpdateClipboard((TkWindow*)(dispPtr->clipWindow), targetPtr); + TkSelUpdateClipboard((TkWindow *) dispPtr->clipWindow, targetPtr); return TCL_OK; } @@ -420,12 +420,12 @@ Tk_ClipboardObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument strings. */ + Tcl_Obj *const objv[]) /* Argument strings. */ { Tk_Window tkwin = (Tk_Window) clientData; char *path = NULL; Atom selection; - static CONST char *optionStrings[] = { "append", "clear", "get", NULL }; + static const char *optionStrings[] = { "append", "clear", "get", NULL }; enum options { CLIPBOARD_APPEND, CLIPBOARD_CLEAR, CLIPBOARD_GET }; int index, i; @@ -445,7 +445,7 @@ Tk_ClipboardObjCmd( char *targetName = NULL; char *formatName = NULL; char *string; - static CONST char *appendOptionStrings[] = { + static const char *appendOptionStrings[] = { "-displayof", "-format", "-type", NULL }; enum appendOptions { APPEND_DISPLAYOF, APPEND_FORMAT, APPEND_TYPE }; @@ -516,7 +516,7 @@ Tk_ClipboardObjCmd( Tcl_GetString(objv[i])); } case CLIPBOARD_CLEAR: { - static CONST char *clearOptionStrings[] = { "-displayof", NULL }; + static const char *clearOptionStrings[] = { "-displayof", NULL }; enum clearOptions { CLEAR_DISPLAYOF }; int subIndex; @@ -548,7 +548,7 @@ Tk_ClipboardObjCmd( Tcl_DString selBytes; int result; char *string; - static CONST char *getOptionStrings[] = { + static const char *getOptionStrings[] = { "-displayof", "-type", NULL }; enum getOptions { APPEND_DISPLAYOF, APPEND_TYPE }; @@ -647,12 +647,12 @@ TkClipInit( * and set up an event handler for it. */ - dispPtr->clipWindow = Tk_CreateWindow(interp, (Tk_Window) NULL, - "_clip", DisplayString(dispPtr->display)); + dispPtr->clipWindow = Tk_CreateWindow(interp, NULL, "_clip", + DisplayString(dispPtr->display)); if (dispPtr->clipWindow == NULL) { return TCL_ERROR; } - Tcl_Preserve((ClientData) dispPtr->clipWindow); + Tcl_Preserve(dispPtr->clipWindow); atts.override_redirect = True; Tk_ChangeWindowAttributes(dispPtr->clipWindow, CWOverrideRedirect, &atts); Tk_MakeWindowExist(dispPtr->clipWindow); @@ -673,11 +673,9 @@ TkClipInit( */ Tk_CreateSelHandler(dispPtr->clipWindow, dispPtr->clipboardAtom, - dispPtr->applicationAtom, ClipboardAppHandler, - (ClientData) dispPtr, XA_STRING); + dispPtr->applicationAtom, ClipboardAppHandler, dispPtr,XA_STRING); Tk_CreateSelHandler(dispPtr->clipWindow, dispPtr->clipboardAtom, - dispPtr->windowAtom, ClipboardWindowHandler, - (ClientData) dispPtr, XA_STRING); + dispPtr->windowAtom, ClipboardWindowHandler, dispPtr, XA_STRING); return TCL_OK; } diff --git a/generic/tkColor.c b/generic/tkColor.c index 85593ac..8fbb85e 100644 --- a/generic/tkColor.c +++ b/generic/tkColor.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkColor.c,v 1.16 2007/12/13 15:24:13 dgp Exp $ + * RCS: @(#) $Id: tkColor.c,v 1.17 2008/04/27 22:38:55 dkf Exp $ */ #include "tkInt.h" @@ -129,8 +129,8 @@ Tk_AllocColorFromObj( */ if (tkColPtr != NULL) { - TkColor *firstColorPtr = (TkColor *) - Tcl_GetHashValue(tkColPtr->hashPtr); + TkColor *firstColorPtr = Tcl_GetHashValue(tkColPtr->hashPtr); + FreeColorObjProc(objPtr); for (tkColPtr = firstColorPtr; tkColPtr != NULL; tkColPtr = tkColPtr->nextPtr) { @@ -138,7 +138,7 @@ Tk_AllocColorFromObj( && (Tk_Colormap(tkwin) == tkColPtr->colormap)) { tkColPtr->resourceRefCount++; tkColPtr->objRefCount++; - objPtr->internalRep.twoPtrValue.ptr1 = (void *) tkColPtr; + objPtr->internalRep.twoPtrValue.ptr1 = tkColPtr; return (XColor *) tkColPtr; } } @@ -149,7 +149,7 @@ Tk_AllocColorFromObj( */ tkColPtr = (TkColor *) Tk_GetColor(interp, tkwin, Tcl_GetString(objPtr)); - objPtr->internalRep.twoPtrValue.ptr1 = (void *) tkColPtr; + objPtr->internalRep.twoPtrValue.ptr1 = tkColPtr; if (tkColPtr != NULL) { tkColPtr->objRefCount++; } @@ -204,7 +204,7 @@ Tk_GetColor( nameHashPtr = Tcl_CreateHashEntry(&dispPtr->colorNameTable, name, &isNew); if (!isNew) { - existingColPtr = (TkColor *) Tcl_GetHashValue(nameHashPtr); + existingColPtr = Tcl_GetHashValue(nameHashPtr); for (tkColPtr = existingColPtr; tkColPtr != NULL; tkColPtr = tkColPtr->nextPtr) { if ((tkColPtr->screen == Tk_Screen(tkwin)) @@ -310,7 +310,7 @@ Tk_GetColorByValue( valueHashPtr = Tcl_CreateHashEntry(&dispPtr->colorValueTable, (char *) &valueKey, &isNew); if (!isNew) { - tkColPtr = (TkColor *) Tcl_GetHashValue(valueHashPtr); + tkColPtr = Tcl_GetHashValue(valueHashPtr); tkColPtr->resourceRefCount++; return &tkColPtr->color; } @@ -355,7 +355,7 @@ Tk_GetColorByValue( *-------------------------------------------------------------- */ -CONST char * +const char * Tk_NameOfColor( XColor *colorPtr) /* Color whose name is desired. */ { @@ -364,7 +364,7 @@ Tk_NameOfColor( if (tkColPtr->magic==COLOR_MAGIC && tkColPtr->type==TK_COLOR_BY_NAME) { return tkColPtr->hashPtr->key.string; } else { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); sprintf(tsdPtr->rgbString, "#%04x%04x%04x", colorPtr->red, @@ -415,8 +415,8 @@ Tk_GCForColor( if (tkColPtr->gc == None) { gcValues.foreground = tkColPtr->color.pixel; - tkColPtr->gc = XCreateGC(DisplayOfScreen(tkColPtr->screen), - drawable, GCForeground, &gcValues); + tkColPtr->gc = XCreateGC(DisplayOfScreen(tkColPtr->screen), drawable, + GCForeground, &gcValues); } return tkColPtr->gc; } @@ -474,7 +474,7 @@ Tk_FreeColor( } TkpFreeColor(tkColPtr); - prevPtr = (TkColor *) Tcl_GetHashValue(tkColPtr->hashPtr); + prevPtr = Tcl_GetHashValue(tkColPtr->hashPtr); if (prevPtr == tkColPtr) { if (tkColPtr->nextPtr == NULL) { Tcl_DeleteHashEntry(tkColPtr->hashPtr); @@ -553,7 +553,7 @@ static void FreeColorObjProc( Tcl_Obj *objPtr) /* The object we are releasing. */ { - TkColor *tkColPtr = (TkColor *) objPtr->internalRep.twoPtrValue.ptr1; + TkColor *tkColPtr = objPtr->internalRep.twoPtrValue.ptr1; if (tkColPtr != NULL) { tkColPtr->objRefCount--; @@ -588,10 +588,10 @@ DupColorObjProc( Tcl_Obj *srcObjPtr, /* The object we are copying from. */ Tcl_Obj *dupObjPtr) /* The object we are copying to. */ { - TkColor *tkColPtr = (TkColor *) srcObjPtr->internalRep.twoPtrValue.ptr1; + TkColor *tkColPtr = srcObjPtr->internalRep.twoPtrValue.ptr1; dupObjPtr->typePtr = srcObjPtr->typePtr; - dupObjPtr->internalRep.twoPtrValue.ptr1 = (void *) tkColPtr; + dupObjPtr->internalRep.twoPtrValue.ptr1 = tkColPtr; if (tkColPtr != NULL) { tkColPtr->objRefCount++; @@ -638,7 +638,7 @@ Tk_GetColorFromObj( * map. If it is, we are done. */ - tkColPtr = (TkColor *) objPtr->internalRep.twoPtrValue.ptr1; + tkColPtr = objPtr->internalRep.twoPtrValue.ptr1; if ((tkColPtr != NULL) && (tkColPtr->resourceRefCount > 0) && (Tk_Screen(tkwin) == tkColPtr->screen) @@ -664,12 +664,12 @@ Tk_GetColorFromObj( if (hashPtr == NULL) { goto error; } - for (tkColPtr = (TkColor *) Tcl_GetHashValue(hashPtr); + for (tkColPtr = Tcl_GetHashValue(hashPtr); (tkColPtr != NULL); tkColPtr = tkColPtr->nextPtr) { if ((Tk_Screen(tkwin) == tkColPtr->screen) && (Tk_Colormap(tkwin) == tkColPtr->colormap)) { FreeColorObjProc(objPtr); - objPtr->internalRep.twoPtrValue.ptr1 = (void *) tkColPtr; + objPtr->internalRep.twoPtrValue.ptr1 = tkColPtr; tkColPtr->objRefCount++; return (XColor *) tkColPtr; } @@ -780,7 +780,7 @@ TkDebugColor( resultPtr = Tcl_NewObj(); hashPtr = Tcl_FindHashEntry(&dispPtr->colorNameTable, name); if (hashPtr != NULL) { - TkColor *tkColPtr = (TkColor *) Tcl_GetHashValue(hashPtr); + TkColor *tkColPtr = Tcl_GetHashValue(hashPtr); if (tkColPtr == NULL) { Tcl_Panic("TkDebugColor found empty hash table entry"); diff --git a/generic/tkConfig.c b/generic/tkConfig.c index 368d0ce..5521615 100644 --- a/generic/tkConfig.c +++ b/generic/tkConfig.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkConfig.c,v 1.26 2007/12/13 15:24:13 dgp Exp $ + * RCS: @(#) $Id: tkConfig.c,v 1.27 2008/04/27 22:38:55 dkf Exp $ */ /* @@ -50,7 +50,7 @@ */ typedef struct TkOption { - CONST Tk_OptionSpec *specPtr; + const Tk_OptionSpec *specPtr; /* The original spec from the template passed * to Tk_CreateOptionTable.*/ Tk_Uid dbNameUID; /* The Uid form of the option database @@ -123,7 +123,7 @@ static Tcl_Obj * GetConfigList(char *recordPtr, Option *optionPtr, Tk_Window tkwin); static Tcl_Obj * GetObjectForOption(char *recordPtr, Option *optionPtr, Tk_Window tkwin); -static Option * GetOption(CONST char *name, OptionTable *tablePtr); +static Option * GetOption(const char *name, OptionTable *tablePtr); static Option * GetOptionFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, OptionTable *tablePtr); static int ObjectIsEmpty(Tcl_Obj *objPtr); @@ -166,7 +166,7 @@ Tk_OptionTable Tk_CreateOptionTable( Tcl_Interp *interp, /* Interpreter associated with the application * in which this table will be used. */ - CONST Tk_OptionSpec *templatePtr) + const Tk_OptionSpec *templatePtr) /* Static information about the configuration * options. */ { @@ -174,7 +174,7 @@ Tk_CreateOptionTable( Tcl_HashEntry *hashEntryPtr; int newEntry; OptionTable *tablePtr; - CONST Tk_OptionSpec *specPtr, *specPtr2; + const Tk_OptionSpec *specPtr, *specPtr2; Option *optionPtr; int numOptions, i; @@ -194,7 +194,7 @@ Tk_CreateOptionTable( hashTablePtr = (Tcl_HashTable *) ckalloc(sizeof(Tcl_HashTable)); Tcl_InitHashTable(hashTablePtr, TCL_ONE_WORD_KEYS); Tcl_SetAssocData(interp, OPTION_HASH_KEY, DestroyOptionHashTable, - (ClientData) hashTablePtr); + hashTablePtr); } /* @@ -270,7 +270,7 @@ Tk_CreateOptionTable( || (specPtr->type == TK_OPTION_BORDER)) && (specPtr->clientData != NULL)) { optionPtr->extra.monoColorPtr = - Tcl_NewStringObj((char *) specPtr->clientData, -1); + Tcl_NewStringObj(specPtr->clientData, -1); Tcl_IncrRefCount(optionPtr->extra.monoColorPtr); } @@ -278,8 +278,8 @@ Tk_CreateOptionTable( /* * Get the custom parsing, etc., functions. */ - optionPtr->extra.custom = - (Tk_ObjCustomOption *) specPtr->clientData; + + optionPtr->extra.custom = specPtr->clientData; } } if (((specPtr->type == TK_OPTION_STRING) @@ -303,8 +303,8 @@ Tk_CreateOptionTable( */ if (specPtr->clientData != NULL) { - tablePtr->nextPtr = (OptionTable *) Tk_CreateOptionTable(interp, - (Tk_OptionSpec *) specPtr->clientData); + tablePtr->nextPtr = (OptionTable *) + Tk_CreateOptionTable(interp, specPtr->clientData); } return (Tk_OptionTable) tablePtr; @@ -385,7 +385,7 @@ DestroyOptionHashTable( ClientData clientData, /* The hash table we are destroying */ Tcl_Interp *interp) /* The interpreter we are destroying */ { - Tcl_HashTable *hashTablePtr = (Tcl_HashTable *) clientData; + Tcl_HashTable *hashTablePtr = clientData; Tcl_HashSearch search; Tcl_HashEntry *hashEntryPtr; OptionTable *tablePtr; @@ -634,7 +634,7 @@ DoObjConfig( Tk_SavedOption internal; /* Used to save the old internal * representation of the value if * savedOptionPtr is NULL. */ - CONST Tk_OptionSpec *specPtr; + const Tk_OptionSpec *specPtr; int nullOK; /* @@ -735,7 +735,7 @@ DoObjConfig( int newValue; if (Tcl_GetIndexFromObj(interp, valuePtr, - (CONST char **) optionPtr->specPtr->clientData, + optionPtr->specPtr->clientData, optionPtr->specPtr->optionName+1, 0, &newValue) != TCL_OK) { return TCL_ERROR; } @@ -1030,13 +1030,13 @@ ObjectIsEmpty( static Option * GetOption( - CONST char *name, /* String balue to be looked up in the option + const char *name, /* String balue to be looked up in the option * table. */ OptionTable *tablePtr) /* Table in which to look up name. */ { Option *bestPtr, *optionPtr; OptionTable *tablePtr2; - CONST char *p1, *p2; + const char *p1, *p2; int count; /* @@ -1184,9 +1184,9 @@ GetOptionFromObj( *---------------------------------------------------------------------- */ -CONST Tk_OptionSpec * +const Tk_OptionSpec * TkGetOptionSpec( - CONST char *name, /* String value to be looked up. */ + const char *name, /* String value to be looked up. */ Tk_OptionTable optionTable) /* Table in which to look up name. */ { Option *optionPtr; @@ -1262,7 +1262,7 @@ Tk_SetOptions( char *recordPtr, /* The record to configure. */ Tk_OptionTable optionTable, /* Describes valid options. */ int objc, /* The number of elements in objv. */ - Tcl_Obj *CONST objv[], /* Contains one or more name-value pairs. */ + Tcl_Obj *const objv[], /* Contains one or more name-value pairs. */ Tk_Window tkwin, /* Window associated with the thing being * configured; needed for some options (such * as colors). */ @@ -1385,7 +1385,7 @@ Tk_RestoreSavedOptions( * record. */ char *internalPtr; /* Points to internal value of option in * record. */ - CONST Tk_OptionSpec *specPtr; + const Tk_OptionSpec *specPtr; /* * Be sure to restore the options in the opposite order they were set. @@ -1575,7 +1575,7 @@ Tk_FreeConfigOptions( int count; Tcl_Obj **oldPtrPtr, *oldPtr; char *oldInternalPtr; - CONST Tk_OptionSpec *specPtr; + const Tk_OptionSpec *specPtr; for (tablePtr = (OptionTable *) optionTable; tablePtr != NULL; tablePtr = tablePtr->nextPtr) { diff --git a/generic/tkConsole.c b/generic/tkConsole.c index 0ea2051..5d0ba6e 100644 --- a/generic/tkConsole.c +++ b/generic/tkConsole.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkConsole.c,v 1.36 2008/04/01 16:30:52 dgp Exp $ + * RCS: @(#) $Id: tkConsole.c,v 1.37 2008/04/27 22:38:56 dkf Exp $ */ #include "tk.h" @@ -48,19 +48,19 @@ typedef struct ChannelData { static int ConsoleClose(ClientData instanceData, Tcl_Interp *interp); static void ConsoleDeleteProc(ClientData clientData); static void ConsoleEventProc(ClientData clientData, XEvent *eventPtr); -static int ConsoleHandle(ClientData instanceData, - int direction, ClientData *handlePtr); -static int ConsoleInput(ClientData instanceData, - char *buf, int toRead, int *errorCode); +static int ConsoleHandle(ClientData instanceData, int direction, + ClientData *handlePtr); +static int ConsoleInput(ClientData instanceData, char *buf, int toRead, + int *errorCode); static int ConsoleObjCmd(ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]); -static int ConsoleOutput(ClientData instanceData, - CONST char *buf, int toWrite, int *errorCode); + int objc, Tcl_Obj *const objv[]); +static int ConsoleOutput(ClientData instanceData, const char *buf, + int toWrite, int *errorCode); static void ConsoleWatch(ClientData instanceData, int mask); static void DeleteConsoleInterp(ClientData clientData); static void InterpDeleteProc(ClientData clientData, Tcl_Interp *interp); static int InterpreterObjCmd(ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); /* * This structure describes the channel type structure for file based IO: @@ -175,7 +175,7 @@ ShouldUseConsoleChannel( */ if (fileType == FILE_TYPE_CHAR) { - dcb.DCBlength = sizeof( DCB ) ; + dcb.DCBlength = sizeof(DCB); if (!GetConsoleMode(handle, &consoleParams) && !GetCommState(handle, &dcb)) { /* @@ -237,9 +237,12 @@ Tk_InitConsoleChannels( return; } - consoleInitPtr = Tcl_GetThreadData(&consoleInitKey, (int)sizeof(int)); + consoleInitPtr = Tcl_GetThreadData(&consoleInitKey, (int) sizeof(int)); if (*consoleInitPtr) { - /* We've already initialized console channels in this thread. */ + /* + * We've already initialized console channels in this thread. + */ + return; } *consoleInitPtr = 1; @@ -250,15 +253,16 @@ Tk_InitConsoleChannels( if (!(doIn || doOut || doErr)) { /* - * No std channels should be tied to the console; - * Thus, no need to create the console + * No std channels should be tied to the console; thus, no need to + * create the console. */ + return; } /* - * At least one std channel wants to be tied to the console, - * so create the interp for it to live in. + * At least one std channel wants to be tied to the console, so create the + * interp for it to live in. */ info = (ConsoleInfo *) ckalloc(sizeof(ConsoleInfo)); @@ -268,18 +272,16 @@ Tk_InitConsoleChannels( if (doIn) { ChannelData *data = (ChannelData *) ckalloc(sizeof(ChannelData)); + data->info = info; data->info->refCount++; data->type = TCL_STDIN; consoleChannel = Tcl_CreateChannel(&consoleChannelType, "console0", - (ClientData) data, TCL_READABLE); + data, TCL_READABLE); if (consoleChannel != NULL) { - Tcl_SetChannelOption(NULL, consoleChannel, - "-translation", "lf"); - Tcl_SetChannelOption(NULL, consoleChannel, - "-buffering", "none"); - Tcl_SetChannelOption(NULL, consoleChannel, - "-encoding", "utf-8"); + Tcl_SetChannelOption(NULL, consoleChannel, "-translation", "lf"); + Tcl_SetChannelOption(NULL, consoleChannel, "-buffering", "none"); + Tcl_SetChannelOption(NULL, consoleChannel, "-encoding", "utf-8"); } Tcl_SetStdChannel(consoleChannel, TCL_STDIN); Tcl_RegisterChannel(NULL, consoleChannel); @@ -287,18 +289,16 @@ Tk_InitConsoleChannels( if (doOut) { ChannelData *data = (ChannelData *) ckalloc(sizeof(ChannelData)); + data->info = info; data->info->refCount++; data->type = TCL_STDOUT; consoleChannel = Tcl_CreateChannel(&consoleChannelType, "console1", - (ClientData) data, TCL_WRITABLE); + data, TCL_WRITABLE); if (consoleChannel != NULL) { - Tcl_SetChannelOption(NULL, consoleChannel, - "-translation", "lf"); - Tcl_SetChannelOption(NULL, consoleChannel, - "-buffering", "none"); - Tcl_SetChannelOption(NULL, consoleChannel, - "-encoding", "utf-8"); + Tcl_SetChannelOption(NULL, consoleChannel, "-translation", "lf"); + Tcl_SetChannelOption(NULL, consoleChannel, "-buffering", "none"); + Tcl_SetChannelOption(NULL, consoleChannel, "-encoding", "utf-8"); } Tcl_SetStdChannel(consoleChannel, TCL_STDOUT); Tcl_RegisterChannel(NULL, consoleChannel); @@ -306,18 +306,16 @@ Tk_InitConsoleChannels( if (doErr) { ChannelData *data = (ChannelData *) ckalloc(sizeof(ChannelData)); + data->info = info; data->info->refCount++; data->type = TCL_STDERR; consoleChannel = Tcl_CreateChannel(&consoleChannelType, "console2", - (ClientData) data, TCL_WRITABLE); + data, TCL_WRITABLE); if (consoleChannel != NULL) { - Tcl_SetChannelOption(NULL, consoleChannel, - "-translation", "lf"); - Tcl_SetChannelOption(NULL, consoleChannel, - "-buffering", "none"); - Tcl_SetChannelOption(NULL, consoleChannel, - "-encoding", "utf-8"); + Tcl_SetChannelOption(NULL, consoleChannel, "-translation", "lf"); + Tcl_SetChannelOption(NULL, consoleChannel, "-buffering", "none"); + Tcl_SetChannelOption(NULL, consoleChannel, "-encoding", "utf-8"); } Tcl_SetStdChannel(consoleChannel, TCL_STDERR); Tcl_RegisterChannel(NULL, consoleChannel); @@ -378,7 +376,7 @@ Tk_CreateConsoleWindow( } if (haveConsoleChannel) { - ChannelData *data = (ChannelData *)Tcl_GetChannelInstanceData(chan); + ChannelData *data = (ChannelData *) Tcl_GetChannelInstanceData(chan); info = data->info; if (info->consoleInterp) { /* New ConsoleInfo for a new console window */ @@ -388,21 +386,21 @@ Tk_CreateConsoleWindow( /* Update any console channels to make use of the new console */ if (Tcl_GetChannelType(chan = Tcl_GetStdChannel(TCL_STDIN)) == &consoleChannelType) { - data = (ChannelData *)Tcl_GetChannelInstanceData(chan); + data = (ChannelData *) Tcl_GetChannelInstanceData(chan); data->info->refCount--; data->info = info; data->info->refCount++; } if (Tcl_GetChannelType(chan = Tcl_GetStdChannel(TCL_STDOUT)) == &consoleChannelType) { - data = (ChannelData *)Tcl_GetChannelInstanceData(chan); + data = (ChannelData *) Tcl_GetChannelInstanceData(chan); data->info->refCount--; data->info = info; data->info->refCount++; } if (Tcl_GetChannelType(chan = Tcl_GetStdChannel(TCL_STDERR)) == &consoleChannelType) { - data = (ChannelData *)Tcl_GetChannelInstanceData(chan); + data = (ChannelData *) Tcl_GetChannelInstanceData(chan); data->info->refCount--; data->info = info; data->info->refCount++; @@ -416,17 +414,16 @@ Tk_CreateConsoleWindow( info->consoleInterp = consoleInterp; info->interp = interp; - Tcl_CallWhenDeleted(consoleInterp, InterpDeleteProc, (ClientData) info); + Tcl_CallWhenDeleted(consoleInterp, InterpDeleteProc, info); info->refCount++; - Tcl_CreateThreadExitHandler(DeleteConsoleInterp, - (ClientData) consoleInterp); + Tcl_CreateThreadExitHandler(DeleteConsoleInterp, consoleInterp); /* * Add console commands to the interp */ - token = Tcl_CreateObjCommand(interp, "console", ConsoleObjCmd, - (ClientData) info, ConsoleDeleteProc); + token = Tcl_CreateObjCommand(interp, "console", ConsoleObjCmd, info, + ConsoleDeleteProc); info->refCount++; /* @@ -435,29 +432,29 @@ Tk_CreateConsoleWindow( * handler takes care of us. */ Tcl_CreateObjCommand(consoleInterp, "consoleinterp", InterpreterObjCmd, - (ClientData) info, NULL); + info, NULL); mainWindow = Tk_MainWindow(interp); if (mainWindow) { Tk_CreateEventHandler(mainWindow, StructureNotifyMask, - ConsoleEventProc, (ClientData) info); + ConsoleEventProc, info); info->refCount++; } - Tcl_Preserve((ClientData) consoleInterp); + Tcl_Preserve(consoleInterp); result = Tcl_GlobalEval(consoleInterp, "source $tk_library/console.tcl"); if (result == TCL_ERROR) { Tcl_SetReturnOptions(interp, Tcl_GetReturnOptions(consoleInterp, result)); Tcl_SetObjResult(interp, Tcl_GetObjResult(consoleInterp)); } - Tcl_Release((ClientData) consoleInterp); + Tcl_Release(consoleInterp); if (result == TCL_ERROR) { Tcl_DeleteCommandFromToken(interp, token); mainWindow = Tk_MainWindow(interp); if (mainWindow) { Tk_DeleteEventHandler(mainWindow, StructureNotifyMask, - ConsoleEventProc, (ClientData) info); + ConsoleEventProc, info); if (--info->refCount <= 0) { ckfree((char *) info); } @@ -466,7 +463,7 @@ Tk_CreateConsoleWindow( } return TCL_OK; - error: + error: Tcl_AddErrorInfo(interp, "\n (creating console window)"); if (!Tcl_InterpDeleted(consoleInterp)) { Tcl_DeleteInterp(consoleInterp); @@ -495,11 +492,11 @@ Tk_CreateConsoleWindow( static int ConsoleOutput( ClientData instanceData, /* Indicates which device to use. */ - CONST char *buf, /* The data buffer. */ + const char *buf, /* The data buffer. */ int toWrite, /* How many bytes to write? */ int *errorCode) /* Where to store error code. */ { - ChannelData *data = (ChannelData *)instanceData; + ChannelData *data = instanceData; ConsoleInfo *info = data->info; *errorCode = 0; @@ -510,6 +507,7 @@ ConsoleOutput( if (consoleInterp && !Tcl_InterpDeleted(consoleInterp)) { Tcl_Obj *cmd = Tcl_NewStringObj("tk::ConsoleOutput", -1); + if (data->type == TCL_STDERR) { Tcl_ListObjAppendElement(NULL, cmd, Tcl_NewStringObj("stderr", -1)); @@ -517,7 +515,8 @@ ConsoleOutput( Tcl_ListObjAppendElement(NULL, cmd, Tcl_NewStringObj("stdout", -1)); } - Tcl_ListObjAppendElement(NULL, cmd, Tcl_NewStringObj(buf, toWrite)); + Tcl_ListObjAppendElement(NULL, cmd, + Tcl_NewStringObj(buf, toWrite)); Tcl_IncrRefCount(cmd); Tcl_GlobalEvalObj(consoleInterp, cmd); Tcl_DecrRefCount(cmd); @@ -576,12 +575,15 @@ ConsoleClose( ClientData instanceData, /* Unused. */ Tcl_Interp *interp) /* Unused. */ { - ChannelData *data = (ChannelData *)instanceData; + ChannelData *data = instanceData; ConsoleInfo *info = data->info; if (info) { if (--info->refCount <= 0) { - /* Assuming the Tcl_Interp * fields must already be NULL */ + /* + * Assuming the Tcl_Interp * fields must already be NULL. + */ + ckfree((char *) info); } } @@ -668,10 +670,10 @@ ConsoleObjCmd( ClientData clientData, /* Access to the console interp */ Tcl_Interp *interp, /* Current interpreter */ int objc, /* Number of arguments */ - Tcl_Obj *CONST objv[]) /* Argument objects */ + Tcl_Obj *const objv[]) /* Argument objects */ { int index, result; - static CONST char *options[] = {"eval", "hide", "show", "title", NULL}; + static const char *options[] = {"eval", "hide", "show", "title", NULL}; enum option {CON_EVAL, CON_HIDE, CON_SHOW, CON_TITLE}; Tcl_Obj *cmd = NULL; ConsoleInfo *info = (ConsoleInfo *) clientData; @@ -722,12 +724,12 @@ ConsoleObjCmd( Tcl_IncrRefCount(cmd); if (consoleInterp && !Tcl_InterpDeleted(consoleInterp)) { - Tcl_Preserve((ClientData) consoleInterp); + Tcl_Preserve(consoleInterp); result = Tcl_GlobalEvalObj(consoleInterp, cmd); Tcl_SetReturnOptions(interp, Tcl_GetReturnOptions(consoleInterp, result)); Tcl_SetObjResult(interp, Tcl_GetObjResult(consoleInterp)); - Tcl_Release((ClientData) consoleInterp); + Tcl_Release(consoleInterp); } else { Tcl_AppendResult(interp, "no active console interp", NULL); result = TCL_ERROR; @@ -755,12 +757,12 @@ InterpreterObjCmd( ClientData clientData, /* */ Tcl_Interp *interp, /* Current interpreter */ int objc, /* Number of arguments */ - Tcl_Obj *CONST objv[]) /* Argument objects */ + Tcl_Obj *const objv[]) /* Argument objects */ { int index, result = TCL_OK; - static CONST char *options[] = {"eval", "record", NULL}; + static const char *options[] = {"eval", "record", NULL}; enum option {OTHER_EVAL, OTHER_RECORD}; - ConsoleInfo *info = (ConsoleInfo *) clientData; + ConsoleInfo *info = clientData; Tcl_Interp *otherInterp = info->interp; if (objc < 2) { @@ -782,28 +784,32 @@ InterpreterObjCmd( return TCL_ERROR; } - Tcl_Preserve((ClientData) otherInterp); + Tcl_Preserve(otherInterp); switch ((enum option) index) { case OTHER_EVAL: result = Tcl_GlobalEvalObj(otherInterp, objv[2]); + /* * TODO: Should exceptions be filtered here? */ + Tcl_SetReturnOptions(interp, Tcl_GetReturnOptions(otherInterp, result)); Tcl_SetObjResult(interp, Tcl_GetObjResult(otherInterp)); break; case OTHER_RECORD: Tcl_RecordAndEvalObj(otherInterp, objv[2], TCL_EVAL_GLOBAL); + /* - * By not setting result, we discard any exceptions or errors here - * and always return TCL_OK. All the caller wants is the - * interp result to display, whether that's result or error message. + * By not setting result, we discard any exceptions or errors here and + * always return TCL_OK. All the caller wants is the interp result to + * display, whether that's result or error message. */ + Tcl_SetObjResult(interp, Tcl_GetObjResult(otherInterp)); break; } - Tcl_Release((ClientData) otherInterp); + Tcl_Release(otherInterp); return result; } @@ -812,8 +818,8 @@ InterpreterObjCmd( * * DeleteConsoleInterp -- * - * Thread exit handler to destroy a console interp when the - * thread it lives in gets torn down. + * Thread exit handler to destroy a console interp when the thread it + * lives in gets torn down. * *---------------------------------------------------------------------- */ @@ -822,7 +828,8 @@ static void DeleteConsoleInterp( ClientData clientData) { - Tcl_Interp *interp = (Tcl_Interp *)clientData; + Tcl_Interp *interp = clientData; + Tcl_DeleteInterp(interp); } @@ -831,8 +838,8 @@ DeleteConsoleInterp( * * InterpDeleteProc -- * - * React when the interp in which the console is displayed is deleted - * for any reason. + * React when the interp in which the console is displayed is deleted for + * any reason. * * Results: * None. @@ -848,11 +855,10 @@ InterpDeleteProc( ClientData clientData, Tcl_Interp *interp) { - ConsoleInfo *info = (ConsoleInfo *) clientData; + ConsoleInfo *info = clientData; if (info->consoleInterp == interp) { - Tcl_DeleteThreadExitHandler(DeleteConsoleInterp, - (ClientData) info->consoleInterp); + Tcl_DeleteThreadExitHandler(DeleteConsoleInterp, info->consoleInterp); info->consoleInterp = NULL; } if (--info->refCount <= 0) { @@ -881,7 +887,7 @@ static void ConsoleDeleteProc( ClientData clientData) { - ConsoleInfo *info = (ConsoleInfo *) clientData; + ConsoleInfo *info = clientData; if (info->consoleInterp) { Tcl_DeleteInterp(info->consoleInterp); @@ -916,7 +922,7 @@ ConsoleEventProc( XEvent *eventPtr) { if (eventPtr->type == DestroyNotify) { - ConsoleInfo *info = (ConsoleInfo *) clientData; + ConsoleInfo *info = clientData; Tcl_Interp *consoleInterp = info->consoleInterp; if (consoleInterp && !Tcl_InterpDeleted(consoleInterp)) { diff --git a/generic/tkCursor.c b/generic/tkCursor.c index 8837028..d4e112d 100644 --- a/generic/tkCursor.c +++ b/generic/tkCursor.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCursor.c,v 1.18 2007/12/13 15:24:14 dgp Exp $ + * RCS: @(#) $Id: tkCursor.c,v 1.19 2008/04/27 22:38:56 dkf Exp $ */ #include "tkInt.h" @@ -25,8 +25,8 @@ */ typedef struct { - CONST char *source; /* Cursor bits. */ - CONST char *mask; /* Mask bits. */ + const char *source; /* Cursor bits. */ + const char *mask; /* Mask bits. */ int width, height; /* Dimensions of cursor (and data and * mask). */ int xHot, yHot; /* Location of cursor hot-spot. */ @@ -43,8 +43,8 @@ static void DupCursorObjProc(Tcl_Obj *srcObjPtr, Tcl_Obj *dupObjPtr); static void FreeCursor(TkCursor *cursorPtr); static void FreeCursorObjProc(Tcl_Obj *objPtr); -static TkCursor * TkcGetCursor(Tcl_Interp *interp, - Tk_Window tkwin, CONST char *name); +static TkCursor * TkcGetCursor(Tcl_Interp *interp, Tk_Window tkwin, + const char *name); static TkCursor * GetCursorFromObj(Tk_Window tkwin, Tcl_Obj *objPtr); static void InitCursorObj(Tcl_Obj *objPtr); @@ -101,7 +101,7 @@ Tk_AllocCursorFromObj( if (objPtr->typePtr != &tkCursorObjType) { InitCursorObj(objPtr); } - cursorPtr = (TkCursor *) objPtr->internalRep.twoPtrValue.ptr1; + cursorPtr = objPtr->internalRep.twoPtrValue.ptr1; /* * If the object currently points to a TkCursor, see if it's the one we @@ -130,15 +130,15 @@ Tk_AllocCursorFromObj( */ if (cursorPtr != NULL) { - TkCursor *firstCursorPtr = (TkCursor *) - Tcl_GetHashValue(cursorPtr->hashPtr); + TkCursor *firstCursorPtr = Tcl_GetHashValue(cursorPtr->hashPtr); + FreeCursorObjProc(objPtr); for (cursorPtr = firstCursorPtr; cursorPtr != NULL; cursorPtr = cursorPtr->nextPtr) { if (Tk_Display(tkwin) == cursorPtr->display) { cursorPtr->resourceRefCount++; cursorPtr->objRefCount++; - objPtr->internalRep.twoPtrValue.ptr1 = (void *) cursorPtr; + objPtr->internalRep.twoPtrValue.ptr1 = cursorPtr; return cursorPtr->cursor; } } @@ -149,7 +149,7 @@ Tk_AllocCursorFromObj( */ cursorPtr = TkcGetCursor(interp, tkwin, Tcl_GetString(objPtr)); - objPtr->internalRep.twoPtrValue.ptr1 = (void *) cursorPtr; + objPtr->internalRep.twoPtrValue.ptr1 = cursorPtr; if (cursorPtr == NULL) { return None; } @@ -189,6 +189,7 @@ Tk_GetCursor( * details on legal syntax. */ { TkCursor *cursorPtr = TkcGetCursor(interp, tkwin, string); + if (cursorPtr == NULL) { return None; } @@ -225,7 +226,7 @@ static TkCursor * TkcGetCursor( Tcl_Interp *interp, /* Interpreter to use for error reporting. */ Tk_Window tkwin, /* Window in which cursor will be used. */ - CONST char *string) /* Description of cursor. See manual entry for + const char *string) /* Description of cursor. See manual entry for * details on legal syntax. */ { Tcl_HashEntry *nameHashPtr; @@ -241,7 +242,7 @@ TkcGetCursor( nameHashPtr = Tcl_CreateHashEntry(&dispPtr->cursorNameTable, string, &isNew); if (!isNew) { - existingCursorPtr = (TkCursor *) Tcl_GetHashValue(nameHashPtr); + existingCursorPtr = Tcl_GetHashValue(nameHashPtr); for (cursorPtr = existingCursorPtr; cursorPtr != NULL; cursorPtr = cursorPtr->nextPtr) { if (Tk_Display(tkwin) == cursorPtr->display) { @@ -311,8 +312,8 @@ Tk_Cursor Tk_GetCursorFromData( Tcl_Interp *interp, /* Interpreter to use for error reporting. */ Tk_Window tkwin, /* Window in which cursor will be used. */ - CONST char *source, /* Bitmap data for cursor shape. */ - CONST char *mask, /* Bitmap data for cursor mask. */ + const char *source, /* Bitmap data for cursor shape. */ + const char *mask, /* Bitmap data for cursor mask. */ int width, int height, /* Dimensions of cursor. */ int xHot, int yHot, /* Location of hot-spot in cursor. */ Tk_Uid fg, /* Foreground color for cursor. */ @@ -341,7 +342,7 @@ Tk_GetCursorFromData( dataHashPtr = Tcl_CreateHashEntry(&dispPtr->cursorDataTable, (char *) &dataKey, &isNew); if (!isNew) { - cursorPtr = (TkCursor *) Tcl_GetHashValue(dataHashPtr); + cursorPtr = Tcl_GetHashValue(dataHashPtr); cursorPtr->resourceRefCount++; return cursorPtr->cursor; } @@ -407,7 +408,7 @@ Tk_GetCursorFromData( *-------------------------------------------------------------- */ -CONST char * +const char * Tk_NameOfCursor( Display *display, /* Display for which cursor was allocated. */ Tk_Cursor cursor) /* Identifier for cursor whose name is @@ -428,7 +429,7 @@ Tk_NameOfCursor( if (idHashPtr == NULL) { goto printid; } - cursorPtr = (TkCursor *) Tcl_GetHashValue(idHashPtr); + cursorPtr = Tcl_GetHashValue(idHashPtr); if (cursorPtr->otherTable != &dispPtr->cursorNameTable) { goto printid; } @@ -465,7 +466,7 @@ FreeCursor( } Tcl_DeleteHashEntry(cursorPtr->idHashPtr); - prevPtr = (TkCursor *) Tcl_GetHashValue(cursorPtr->hashPtr); + prevPtr = Tcl_GetHashValue(cursorPtr->hashPtr); if (prevPtr == cursorPtr) { if (cursorPtr->nextPtr == NULL) { Tcl_DeleteHashEntry(cursorPtr->hashPtr); @@ -518,7 +519,7 @@ Tk_FreeCursor( if (idHashPtr == NULL) { Tcl_Panic("Tk_FreeCursor received unknown cursor argument"); } - FreeCursor((TkCursor *) Tcl_GetHashValue(idHashPtr)); + FreeCursor(Tcl_GetHashValue(idHashPtr)); } /* @@ -575,7 +576,7 @@ static void FreeCursorObjProc( Tcl_Obj *objPtr) /* The object we are releasing. */ { - TkCursor *cursorPtr = (TkCursor *) objPtr->internalRep.twoPtrValue.ptr1; + TkCursor *cursorPtr = objPtr->internalRep.twoPtrValue.ptr1; if (cursorPtr != NULL) { cursorPtr->objRefCount--; @@ -610,10 +611,10 @@ DupCursorObjProc( Tcl_Obj *srcObjPtr, /* The object we are copying from. */ Tcl_Obj *dupObjPtr) /* The object we are copying to. */ { - TkCursor *cursorPtr = (TkCursor *) srcObjPtr->internalRep.twoPtrValue.ptr1; + TkCursor *cursorPtr = srcObjPtr->internalRep.twoPtrValue.ptr1; dupObjPtr->typePtr = srcObjPtr->typePtr; - dupObjPtr->internalRep.twoPtrValue.ptr1 = (void *) cursorPtr; + dupObjPtr->internalRep.twoPtrValue.ptr1 = cursorPtr; if (cursorPtr != NULL) { cursorPtr->objRefCount++; @@ -695,7 +696,7 @@ GetCursorFromObj( * cached is the one that is needed. */ - cursorPtr = (TkCursor *) objPtr->internalRep.twoPtrValue.ptr1; + cursorPtr = objPtr->internalRep.twoPtrValue.ptr1; if ((cursorPtr != NULL) && (Tk_Display(tkwin) == cursorPtr->display)) { return cursorPtr; } @@ -710,11 +711,11 @@ GetCursorFromObj( if (hashPtr == NULL) { goto error; } - for (cursorPtr = (TkCursor *) Tcl_GetHashValue(hashPtr); + for (cursorPtr = Tcl_GetHashValue(hashPtr); cursorPtr != NULL; cursorPtr = cursorPtr->nextPtr) { if (Tk_Display(tkwin) == cursorPtr->display) { FreeCursorObjProc(objPtr); - objPtr->internalRep.twoPtrValue.ptr1 = (void *) cursorPtr; + objPtr->internalRep.twoPtrValue.ptr1 = cursorPtr; cursorPtr->objRefCount++; return cursorPtr; } @@ -845,7 +846,7 @@ TkDebugCursor( resultPtr = Tcl_NewObj(); hashPtr = Tcl_FindHashEntry(&dispPtr->cursorNameTable, name); if (hashPtr != NULL) { - cursorPtr = (TkCursor *) Tcl_GetHashValue(hashPtr); + cursorPtr = Tcl_GetHashValue(hashPtr); if (cursorPtr == NULL) { Tcl_Panic("TkDebugCursor found empty hash table entry"); } diff --git a/generic/tkEntry.c b/generic/tkEntry.c index 62b0806..25126bc 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkEntry.c,v 1.47 2007/12/13 15:24:14 dgp Exp $ + * RCS: @(#) $Id: tkEntry.c,v 1.48 2008/04/27 22:38:56 dkf Exp $ */ #include "tkInt.h" @@ -319,7 +319,7 @@ static const Tk_OptionSpec sbOptSpec[] = { * dispatch the entry widget command. */ -static CONST char *entryCmdNames[] = { +static const char *entryCmdNames[] = { "bbox", "cget", "configure", "delete", "get", "icursor", "index", "insert", "scan", "selection", "validate", "xview", NULL }; @@ -330,7 +330,7 @@ enum entryCmd { COMMAND_SCAN, COMMAND_SELECTION, COMMAND_VALIDATE, COMMAND_XVIEW }; -static CONST char *selCmdNames[] = { +static const char *selCmdNames[] = { "adjust", "clear", "from", "present", "range", "to", NULL }; @@ -345,7 +345,7 @@ enum selCmd { * dispatch the spinbox widget command. */ -static CONST char *sbCmdNames[] = { +static const char *sbCmdNames[] = { "bbox", "cget", "configure", "delete", "get", "icursor", "identify", "index", "insert", "invoke", "scan", "selection", "set", "validate", "xview", NULL @@ -358,7 +358,7 @@ enum sbCmd { SB_CMD_SET, SB_CMD_VALIDATE, SB_CMD_XVIEW }; -static CONST char *sbSelCmdNames[] = { +static const char *sbSelCmdNames[] = { "adjust", "clear", "element", "from", "present", "range", "to", NULL }; @@ -376,7 +376,7 @@ enum sbselCmd { * modify them, you must modify the strings here. */ -static CONST char *selElementNames[] = { +static const char *selElementNames[] = { "none", "buttondown", "buttonup", NULL, "entry" }; @@ -392,7 +392,7 @@ static CONST char *selElementNames[] = { */ static int ConfigureEntry(Tcl_Interp *interp, Entry *entryPtr, - int objc, Tcl_Obj *CONST objv[], int flags); + int objc, Tcl_Obj *const objv[], int flags); static void DeleteChars(Entry *entryPtr, int index, int count); static void DestroyEntry(char *memPtr); static void DisplayEntry(ClientData clientData); @@ -407,25 +407,25 @@ static int EntryFetchSelection(ClientData clientData, int offset, static void EntryLostSelection(ClientData clientData); static void EventuallyRedraw(Entry *entryPtr); static void EntryScanTo(Entry *entryPtr, int y); -static void EntrySetValue(Entry *entryPtr, CONST char *value); +static void EntrySetValue(Entry *entryPtr, const char *value); static void EntrySelectTo(Entry *entryPtr, int index); static char * EntryTextVarProc(ClientData clientData, - Tcl_Interp *interp, CONST char *name1, - CONST char *name2, int flags); + Tcl_Interp *interp, const char *name1, + const char *name2, int flags); static void EntryUpdateScrollbar(Entry *entryPtr); static int EntryValidate(Entry *entryPtr, char *cmd); static int EntryValidateChange(Entry *entryPtr, char *change, - CONST char *newStr, int index, int type); -static void ExpandPercents(Entry *entryPtr, CONST char *before, - CONST char *change, CONST char *newStr, int index, + const char *newStr, int index, int type); +static void ExpandPercents(Entry *entryPtr, const char *before, + const char *change, const char *newStr, int index, int type, Tcl_DString *dsPtr); static void EntryValueChanged(Entry *entryPtr, - CONST char *newValue); + const char *newValue); static void EntryVisibleRange(Entry *entryPtr, double *firstPtr, double *lastPtr); static int EntryWidgetObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static void EntryWorldChanged(ClientData instanceData); static int GetEntryIndex(Tcl_Interp *interp, Entry *entryPtr, char *string, int *indexPtr); @@ -437,7 +437,7 @@ static void InsertChars(Entry *entryPtr, int index, char *string); static int SpinboxWidgetObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int GetSpinboxElement(Spinbox *sbPtr, int x, int y); static int SpinboxInvoke(Tcl_Interp *interp, Spinbox *sbPtr, int element); @@ -476,7 +476,7 @@ Tk_EntryObjCmd( ClientData clientData, /* NULL. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register Entry *entryPtr; Tk_OptionTable optionTable; @@ -515,11 +515,11 @@ Tk_EntryObjCmd( entryPtr->display = Tk_Display(tkwin); entryPtr->interp = interp; entryPtr->widgetCmd = Tcl_CreateObjCommand(interp, - Tk_PathName(entryPtr->tkwin), EntryWidgetObjCmd, - (ClientData) entryPtr, EntryCmdDeletedProc); + Tk_PathName(entryPtr->tkwin), EntryWidgetObjCmd, entryPtr, + EntryCmdDeletedProc); entryPtr->optionTable = optionTable; entryPtr->type = TK_ENTRY; - tmp = (char *) ckalloc(1); + tmp = ckalloc(1); tmp[0] = '\0'; entryPtr->string = tmp; entryPtr->selectFirst = -1; @@ -543,15 +543,15 @@ Tk_EntryObjCmd( * otherwise Tk might free it while we still need it. */ - Tcl_Preserve((ClientData) entryPtr->tkwin); + Tcl_Preserve(entryPtr->tkwin); Tk_SetClass(entryPtr->tkwin, "Entry"); - Tk_SetClassProcs(entryPtr->tkwin, &entryClass, (ClientData) entryPtr); + Tk_SetClassProcs(entryPtr->tkwin, &entryClass, entryPtr); Tk_CreateEventHandler(entryPtr->tkwin, ExposureMask|StructureNotifyMask|FocusChangeMask, - EntryEventProc, (ClientData) entryPtr); + EntryEventProc, entryPtr); Tk_CreateSelHandler(entryPtr->tkwin, XA_PRIMARY, XA_STRING, - EntryFetchSelection, (ClientData) entryPtr, XA_STRING); + EntryFetchSelection, entryPtr, XA_STRING); if ((Tk_InitOptions(interp, (char *) entryPtr, optionTable, tkwin) != TCL_OK) || @@ -587,9 +587,9 @@ EntryWidgetObjCmd( ClientData clientData, /* Information about entry widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { - Entry *entryPtr = (Entry *) clientData; + Entry *entryPtr = clientData; int cmdIndex, selIndex, result; Tcl_Obj *objPtr; @@ -603,13 +603,13 @@ EntryWidgetObjCmd( * valid command names. */ - result = Tcl_GetIndexFromObj(interp, objv[1], entryCmdNames, - "option", 0, &cmdIndex); + result = Tcl_GetIndexFromObj(interp, objv[1], entryCmdNames, "option", 0, + &cmdIndex); if (result != TCL_OK) { return result; } - Tcl_Preserve((ClientData) entryPtr); + Tcl_Preserve(entryPtr); switch ((enum entryCmd) cmdIndex) { case COMMAND_BBOX: { int index, x, y, width, height; @@ -882,7 +882,7 @@ EntryWidgetObjCmd( if (!(entryPtr->flags & GOT_SELECTION) && (entryPtr->exportSelection)) { Tk_OwnSelection(entryPtr->tkwin, XA_PRIMARY, - EntryLostSelection, (ClientData) entryPtr); + EntryLostSelection, entryPtr); entryPtr->flags |= GOT_SELECTION; } EventuallyRedraw(entryPtr); @@ -980,11 +980,11 @@ EntryWidgetObjCmd( } done: - Tcl_Release((ClientData) entryPtr); + Tcl_Release(entryPtr); return result; error: - Tcl_Release((ClientData) entryPtr); + Tcl_Release(entryPtr); return TCL_ERROR; } @@ -1021,7 +1021,7 @@ DestroyEntry( if (entryPtr->textVarName != NULL) { Tcl_UntraceVar(entryPtr->interp, entryPtr->textVarName, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, - EntryTextVarProc, (ClientData) entryPtr); + EntryTextVarProc, entryPtr); entryPtr->flags &= ~ENTRY_VAR_TRACED; } if (entryPtr->textGC != None) { @@ -1048,7 +1048,7 @@ DestroyEntry( Tk_FreeTextLayout(entryPtr->textLayout); Tk_FreeConfigOptions((char *) entryPtr, entryPtr->optionTable, entryPtr->tkwin); - Tcl_Release((ClientData) entryPtr->tkwin); + Tcl_Release(entryPtr->tkwin); entryPtr->tkwin = NULL; ckfree((char *) entryPtr); @@ -1080,7 +1080,7 @@ ConfigureEntry( Entry *entryPtr, /* Information about widget; may or may not * already have values for some fields. */ int objc, /* Number of valid entries in argv. */ - Tcl_Obj *CONST objv[], /* Argument objects. */ + Tcl_Obj *const objv[], /* Argument objects. */ int flags) /* Flags to pass to Tk_ConfigureWidget. */ { Tk_SavedOptions savedOptions; @@ -1105,7 +1105,7 @@ ConfigureEntry( && (entryPtr->flags & ENTRY_VAR_TRACED)) { Tcl_UntraceVar(interp, entryPtr->textVarName, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, - EntryTextVarProc, (ClientData) entryPtr); + EntryTextVarProc, entryPtr); entryPtr->flags &= ~ENTRY_VAR_TRACED; } @@ -1266,7 +1266,7 @@ ConfigureEntry( && (entryPtr->selectFirst != -1) && !(entryPtr->flags & GOT_SELECTION)) { Tk_OwnSelection(entryPtr->tkwin, XA_PRIMARY, EntryLostSelection, - (ClientData) entryPtr); + entryPtr); entryPtr->flags |= GOT_SELECTION; } @@ -1294,7 +1294,7 @@ ConfigureEntry( */ if (entryPtr->textVarName != NULL) { - CONST char *value; + const char *value; value = Tcl_GetVar(interp, entryPtr->textVarName, TCL_GLOBAL_ONLY); if (value == NULL) { @@ -1355,11 +1355,11 @@ ConfigureEntry( && !(entryPtr->flags & ENTRY_VAR_TRACED)) { Tcl_TraceVar(interp, entryPtr->textVarName, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, - EntryTextVarProc, (ClientData) entryPtr); + EntryTextVarProc, entryPtr); entryPtr->flags |= ENTRY_VAR_TRACED; } - EntryWorldChanged((ClientData) entryPtr); + EntryWorldChanged(entryPtr); if (error) { Tcl_SetObjResult(interp, errorResult); Tcl_DecrRefCount(errorResult); @@ -1548,7 +1548,7 @@ static void DisplayEntry( ClientData clientData) /* Information about window. */ { - Entry *entryPtr = (Entry *) clientData; + Entry *entryPtr = clientData; Tk_Window tkwin = entryPtr->tkwin; int baseY, selStartX, selEndX, cursorX; int showSelection, xBound; @@ -1575,14 +1575,14 @@ DisplayEntry( * side-effect of destroying or unmapping the entry widget. */ - Tcl_Preserve((ClientData) entryPtr); + Tcl_Preserve(entryPtr); EntryUpdateScrollbar(entryPtr); if ((entryPtr->flags & ENTRY_DELETED) || !Tk_IsMapped(tkwin)) { - Tcl_Release((ClientData) entryPtr); + Tcl_Release(entryPtr); return; } - Tcl_Release((ClientData) entryPtr); + Tcl_Release(entryPtr); } #ifndef TK_NO_DOUBLE_BUFFERING @@ -2011,7 +2011,7 @@ InsertChars( ptrdiff_t byteIndex; size_t byteCount, newByteCount; int oldChars, charsAdded; - CONST char *string; + const char *string; char *newStr; string = entryPtr->string; @@ -2107,7 +2107,7 @@ DeleteChars( int count) /* How many characters to delete. */ { int byteIndex, byteCount, newByteCount; - CONST char *string; + const char *string; char *newStr, *toDelete; if ((index + count) > entryPtr->numChars) { @@ -2219,7 +2219,7 @@ DeleteChars( static void EntryValueChanged( Entry *entryPtr, /* Entry whose value just changed. */ - CONST char *newValue) /* If this value is not NULL, we first force + const char *newValue) /* If this value is not NULL, we first force * the value of the entry to this. */ { if (newValue != NULL) { @@ -2279,9 +2279,9 @@ EntryValueChanged( static void EntrySetValue( Entry *entryPtr, /* Entry whose value is to be changed. */ - CONST char *value) /* New text to display in entry. */ + const char *value) /* New text to display in entry. */ { - CONST char *oldSource; + const char *oldSource; int valueLen, malloced = 0; if (strcmp(value, entryPtr->string) == 0) { @@ -2387,10 +2387,10 @@ EntryEventProc( ClientData clientData, /* Information about window. */ XEvent *eventPtr) /* Information about event. */ { - Entry *entryPtr = (Entry *) clientData; + Entry *entryPtr = clientData; if ((entryPtr->type == TK_SPINBOX) && (eventPtr->type == MotionNotify)) { - Spinbox *sbPtr = (Spinbox *) clientData; + Spinbox *sbPtr = clientData; int elem; elem = GetSpinboxElement(sbPtr, eventPtr->xmotion.x, @@ -2431,11 +2431,11 @@ EntryEventProc( } break; case ConfigureNotify: - Tcl_Preserve((ClientData) entryPtr); + Tcl_Preserve(entryPtr); entryPtr->flags |= UPDATE_SCROLLBAR; EntryComputeGeometry(entryPtr); EventuallyRedraw(entryPtr); - Tcl_Release((ClientData) entryPtr); + Tcl_Release(entryPtr); break; case FocusIn: case FocusOut: @@ -2468,7 +2468,7 @@ static void EntryCmdDeletedProc( ClientData clientData) /* Pointer to widget record for widget. */ { - Entry *entryPtr = (Entry *) clientData; + Entry *entryPtr = clientData; /* * This function could be invoked either because the window was destroyed @@ -2691,7 +2691,7 @@ EntrySelectTo( if (!(entryPtr->flags & GOT_SELECTION) && (entryPtr->exportSelection)) { Tk_OwnSelection(entryPtr->tkwin, XA_PRIMARY, EntryLostSelection, - (ClientData) entryPtr); + entryPtr); entryPtr->flags |= GOT_SELECTION; } @@ -2751,10 +2751,10 @@ EntryFetchSelection( int maxBytes) /* Maximum number of bytes to place at buffer, * not including terminating NUL character. */ { - Entry *entryPtr = (Entry *) clientData; + Entry *entryPtr = clientData; int byteCount; - CONST char *string; - CONST char *selStart, *selEnd; + const char *string; + const char *selStart, *selEnd; if ((entryPtr->selectFirst < 0) || !(entryPtr->exportSelection)) { return -1; @@ -2797,7 +2797,7 @@ static void EntryLostSelection( ClientData clientData) /* Information about entry widget. */ { - Entry *entryPtr = (Entry *) clientData; + Entry *entryPtr = clientData; entryPtr->flags &= ~GOT_SELECTION; @@ -2851,7 +2851,7 @@ EventuallyRedraw( if (!(entryPtr->flags & REDRAW_PENDING)) { entryPtr->flags |= REDRAW_PENDING; - Tcl_DoWhenIdle(DisplayEntry, (ClientData) entryPtr); + Tcl_DoWhenIdle(DisplayEntry, entryPtr); } } @@ -2938,7 +2938,7 @@ EntryUpdateScrollbar( } interp = entryPtr->interp; - Tcl_Preserve((ClientData) interp); + Tcl_Preserve(interp); EntryVisibleRange(entryPtr, &first, &last); sprintf(args, " %g %g", first, last); code = Tcl_VarEval(interp, entryPtr->scrollCmd, args, NULL); @@ -2950,7 +2950,7 @@ EntryUpdateScrollbar( Tcl_BackgroundError(interp); } Tcl_SetResult(interp, NULL, TCL_STATIC); - Tcl_Release((ClientData) interp); + Tcl_Release(interp); } /* @@ -2975,7 +2975,7 @@ static void EntryBlinkProc( ClientData clientData) /* Pointer to record describing entry. */ { - Entry *entryPtr = (Entry *) clientData; + Entry *entryPtr = clientData; if ((entryPtr->state == STATE_DISABLED) || (entryPtr->state == STATE_READONLY) || @@ -2985,11 +2985,11 @@ EntryBlinkProc( if (entryPtr->flags & CURSOR_ON) { entryPtr->flags &= ~CURSOR_ON; entryPtr->insertBlinkHandler = Tcl_CreateTimerHandler( - entryPtr->insertOffTime, EntryBlinkProc, (ClientData) entryPtr); + entryPtr->insertOffTime, EntryBlinkProc, entryPtr); } else { entryPtr->flags |= CURSOR_ON; entryPtr->insertBlinkHandler = Tcl_CreateTimerHandler( - entryPtr->insertOnTime, EntryBlinkProc, (ClientData) entryPtr); + entryPtr->insertOnTime, EntryBlinkProc, entryPtr); } EventuallyRedraw(entryPtr); } @@ -3023,23 +3023,22 @@ EntryFocusProc( entryPtr->flags |= GOT_FOCUS | CURSOR_ON; if (entryPtr->insertOffTime != 0) { entryPtr->insertBlinkHandler = Tcl_CreateTimerHandler( - entryPtr->insertOnTime, EntryBlinkProc, - (ClientData) entryPtr); + entryPtr->insertOnTime, EntryBlinkProc, entryPtr); } if (entryPtr->validate == VALIDATE_ALL || - entryPtr->validate == VALIDATE_FOCUS || - entryPtr->validate == VALIDATE_FOCUSIN) { - EntryValidateChange(entryPtr, NULL, - entryPtr->string, -1, VALIDATE_FOCUSIN); + entryPtr->validate == VALIDATE_FOCUS || + entryPtr->validate == VALIDATE_FOCUSIN) { + EntryValidateChange(entryPtr, NULL, entryPtr->string, -1, + VALIDATE_FOCUSIN); } } else { entryPtr->flags &= ~(GOT_FOCUS | CURSOR_ON); - entryPtr->insertBlinkHandler = (Tcl_TimerToken) NULL; + entryPtr->insertBlinkHandler = NULL; if (entryPtr->validate == VALIDATE_ALL || - entryPtr->validate == VALIDATE_FOCUS || - entryPtr->validate == VALIDATE_FOCUSOUT) { - EntryValidateChange(entryPtr, NULL, - entryPtr->string, -1, VALIDATE_FOCUSOUT); + entryPtr->validate == VALIDATE_FOCUS || + entryPtr->validate == VALIDATE_FOCUSOUT) { + EntryValidateChange(entryPtr, NULL, entryPtr->string, -1, + VALIDATE_FOCUSOUT); } } EventuallyRedraw(entryPtr); @@ -3067,12 +3066,12 @@ static char * EntryTextVarProc( ClientData clientData, /* Information about button. */ Tcl_Interp *interp, /* Interpreter containing variable. */ - CONST char *name1, /* Not used. */ - CONST char *name2, /* Not used. */ + const char *name1, /* Not used. */ + const char *name2, /* Not used. */ int flags) /* Information about what happened. */ { - Entry *entryPtr = (Entry *) clientData; - CONST char *value; + Entry *entryPtr = clientData; + const char *value; if (entryPtr->flags & ENTRY_DELETED) { /* @@ -3197,7 +3196,7 @@ EntryValidateChange( register Entry *entryPtr, /* Entry that needs validation. */ char *change, /* Characters to be added/deleted * (NUL-terminated string). */ - CONST char *newValue, /* Potential new value of entry string */ + const char *newValue, /* Potential new value of entry string */ int index, /* index of insert/delete, -1 otherwise */ int type) /* forced, delete, insert, focusin or * focusout */ @@ -3331,12 +3330,12 @@ EntryValidateChange( static void ExpandPercents( register Entry *entryPtr, /* Entry that needs validation. */ - register CONST char *before, + register const char *before, /* Command containing percent expressions to * be replaced. */ - CONST char *change, /* Characters to added/deleted (NUL-terminated + const char *change, /* Characters to added/deleted (NUL-terminated * string). */ - CONST char *newValue, /* Potential new value of entry string */ + const char *newValue, /* Potential new value of entry string */ int index, /* index of insert/delete */ int type, /* INSERT or DELETE */ Tcl_DString *dsPtr) /* Dynamic string in which to append new @@ -3345,7 +3344,7 @@ ExpandPercents( int spaceNeeded, cvtFlags; /* Used to substitute string as proper Tcl * list element. */ int number, length; - register CONST char *string; + register const char *string; Tcl_UniChar ch; char numStorage[2*TCL_INTEGER_SPACE]; @@ -3498,7 +3497,7 @@ Tk_SpinboxObjCmd( ClientData clientData, /* NULL. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register Entry *entryPtr; register Spinbox *sbPtr; @@ -3539,11 +3538,11 @@ Tk_SpinboxObjCmd( entryPtr->display = Tk_Display(tkwin); entryPtr->interp = interp; entryPtr->widgetCmd = Tcl_CreateObjCommand(interp, - Tk_PathName(entryPtr->tkwin), SpinboxWidgetObjCmd, - (ClientData) sbPtr, EntryCmdDeletedProc); + Tk_PathName(entryPtr->tkwin), SpinboxWidgetObjCmd, sbPtr, + EntryCmdDeletedProc); entryPtr->optionTable = optionTable; entryPtr->type = TK_SPINBOX; - tmp = (char *) ckalloc(1); + tmp = ckalloc(1); tmp[0] = '\0'; entryPtr->string = tmp; entryPtr->selectFirst = -1; @@ -3570,7 +3569,7 @@ Tk_SpinboxObjCmd( sbPtr->fromValue = 0.0; sbPtr->toValue = 100.0; sbPtr->increment = 1.0; - sbPtr->formatBuf = (char *) ckalloc(TCL_DOUBLE_SPACE); + sbPtr->formatBuf = ckalloc(TCL_DOUBLE_SPACE); sbPtr->bdRelief = TK_RELIEF_FLAT; sbPtr->buRelief = TK_RELIEF_FLAT; @@ -3579,15 +3578,15 @@ Tk_SpinboxObjCmd( * otherwise Tk might free it while we still need it. */ - Tcl_Preserve((ClientData) entryPtr->tkwin); + Tcl_Preserve(entryPtr->tkwin); Tk_SetClass(entryPtr->tkwin, "Spinbox"); - Tk_SetClassProcs(entryPtr->tkwin, &entryClass, (ClientData) entryPtr); + Tk_SetClassProcs(entryPtr->tkwin, &entryClass, entryPtr); Tk_CreateEventHandler(entryPtr->tkwin, PointerMotionMask|ExposureMask|StructureNotifyMask|FocusChangeMask, - EntryEventProc, (ClientData) entryPtr); + EntryEventProc, entryPtr); Tk_CreateSelHandler(entryPtr->tkwin, XA_PRIMARY, XA_STRING, - EntryFetchSelection, (ClientData) entryPtr, XA_STRING); + EntryFetchSelection, entryPtr, XA_STRING); if (Tk_InitOptions(interp, (char *) sbPtr, optionTable, tkwin) != TCL_OK) { @@ -3601,7 +3600,7 @@ Tk_SpinboxObjCmd( Tcl_SetResult(interp, Tk_PathName(entryPtr->tkwin), TCL_STATIC); return TCL_OK; - error: + error: Tk_DestroyWindow(entryPtr->tkwin); return TCL_ERROR; } @@ -3629,10 +3628,10 @@ SpinboxWidgetObjCmd( ClientData clientData, /* Information about spinbox widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { - Entry *entryPtr = (Entry *) clientData; - Spinbox *sbPtr = (Spinbox *) clientData; + Entry *entryPtr = clientData; + Spinbox *sbPtr = clientData; int cmdIndex, selIndex, result; Tcl_Obj *objPtr; @@ -3652,7 +3651,7 @@ SpinboxWidgetObjCmd( return result; } - Tcl_Preserve((ClientData) entryPtr); + Tcl_Preserve(entryPtr); switch ((enum sbCmd) cmdIndex) { case SB_CMD_BBOX: { int index, x, y, width, height; @@ -3669,8 +3668,7 @@ SpinboxWidgetObjCmd( if ((index == entryPtr->numChars) && (index > 0)) { index--; } - Tk_CharBbox(entryPtr->textLayout, index, &x, &y, - &width, &height); + Tk_CharBbox(entryPtr->textLayout, index, &x, &y, &width, &height); sprintf(buf, "%d %d %d %d", x + entryPtr->layoutX, y + entryPtr->layoutY, width, height); Tcl_SetResult(interp, buf, TCL_VOLATILE); @@ -3695,8 +3693,7 @@ SpinboxWidgetObjCmd( case SB_CMD_CONFIGURE: if (objc <= 3) { objPtr = Tk_GetOptionInfo(interp, (char *) entryPtr, - entryPtr->optionTable, - (objc == 3) ? objv[2] : NULL, + entryPtr->optionTable, (objc == 3) ? objv[2] : NULL, entryPtr->tkwin); if (objPtr == NULL) { goto error; @@ -3738,6 +3735,7 @@ SpinboxWidgetObjCmd( Tcl_WrongNumArgs(interp, 2, objv, NULL); goto error; } + /* FIXME: modification of objresult */ Tcl_SetStringObj(Tcl_GetObjResult(interp), entryPtr->string, -1); break; @@ -3766,6 +3764,7 @@ SpinboxWidgetObjCmd( } elem = GetSpinboxElement(sbPtr, x, y); if (elem != SEL_NONE) { + /* FIXME: modification of objresult */ Tcl_SetStringObj(Tcl_GetObjResult(interp), selElementNames[elem], -1); } @@ -3962,9 +3961,9 @@ SpinboxWidgetObjCmd( entryPtr->selectLast = index2; } if (!(entryPtr->flags & GOT_SELECTION) - && (entryPtr->exportSelection)) { + && entryPtr->exportSelection) { Tk_OwnSelection(entryPtr->tkwin, XA_PRIMARY, - EntryLostSelection, (ClientData) entryPtr); + EntryLostSelection, entryPtr); entryPtr->flags |= GOT_SELECTION; } EventuallyRedraw(entryPtr); @@ -3988,6 +3987,7 @@ SpinboxWidgetObjCmd( goto error; } if (objc == 3) { + /* FIXME: modification of objresult */ Tcl_SetStringObj(Tcl_GetObjResult(interp), selElementNames[sbPtr->selElement], -1); } else { @@ -4015,6 +4015,7 @@ SpinboxWidgetObjCmd( if (objc == 3) { EntryValueChanged(entryPtr, Tcl_GetString(objv[2])); } + /* FIXME: modification of objresult */ Tcl_SetStringObj(Tcl_GetObjResult(interp), entryPtr->string, -1); break; @@ -4032,6 +4033,7 @@ SpinboxWidgetObjCmd( if (entryPtr->validate != VALIDATE_NONE) { entryPtr->validate = selIndex; } + /* FIXME: modification of objresult */ Tcl_SetObjResult(interp, Tcl_NewBooleanObj((code == TCL_OK))); break; } @@ -4096,11 +4098,11 @@ SpinboxWidgetObjCmd( } done: - Tcl_Release((ClientData) entryPtr); + Tcl_Release(entryPtr); return result; error: - Tcl_Release((ClientData) entryPtr); + Tcl_Release(entryPtr); return TCL_ERROR; } diff --git a/generic/tkFileFilter.c b/generic/tkFileFilter.c index 06e63d6..94cdbcd 100644 --- a/generic/tkFileFilter.c +++ b/generic/tkFileFilter.c @@ -9,19 +9,19 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkFileFilter.c,v 1.10 2007/05/09 12:51:30 das Exp $ + * RCS: @(#) $Id: tkFileFilter.c,v 1.11 2008/04/27 22:38:56 dkf Exp $ */ #include "tkInt.h" #include "tkFileFilter.h" -static int AddClause(Tcl_Interp *interp, - FileFilter *filterPtr, Tcl_Obj *patternsObj, - Tcl_Obj *ostypesObj, int isWindows); +static int AddClause(Tcl_Interp *interp, FileFilter *filterPtr, + Tcl_Obj *patternsObj, Tcl_Obj *ostypesObj, + int isWindows); static void FreeClauses(FileFilter *filterPtr); static void FreeGlobPatterns(FileFilterClause *clausePtr); static void FreeMacFileTypes(FileFilterClause *clausePtr); -static FileFilter * GetFilter(FileFilterList *flistPtr, CONST char *name); +static FileFilter * GetFilter(FileFilterList *flistPtr, const char *name); /* *---------------------------------------------------------------------- @@ -169,8 +169,8 @@ TkFreeFileFilters( toFree = filterPtr; filterPtr = filterPtr->next; FreeClauses(toFree); - ckfree((char*)toFree->name); - ckfree((char*)toFree); + ckfree(toFree->name); + ckfree((char *) toFree); } flistPtr->filters = NULL; } @@ -233,7 +233,7 @@ AddClause( for (i=0; ipatterns = NULL; + clausePtr = (FileFilterClause *) ckalloc(sizeof(FileFilterClause)); + clausePtr->patterns = NULL; clausePtr->patternsTail = NULL; - clausePtr->macTypes = NULL; + clausePtr->macTypes = NULL; clausePtr->macTypesTail = NULL; if (filterPtr->clauses == NULL) { @@ -289,39 +289,39 @@ AddClause( if (globCount > 0 && globList != NULL) { for (i=0; ipattern = (char*)ckalloc((unsigned int) len+1); + globPtr->pattern = ckalloc((unsigned) len+1); globPtr->pattern[0] = '*'; strcpy(globPtr->pattern+1, str); } else if (isWindows) { if (strcmp(str, "*") == 0) { - globPtr->pattern = (char*)ckalloc(4 * sizeof(char)); + globPtr->pattern = ckalloc(4 * sizeof(char)); strcpy(globPtr->pattern, "*.*"); } else if (strcmp(str, "") == 0) { /* * An empty string means "match all files with no * extensions" - * BUG: "*." actually matches with all files on Win95 + * TODO: "*." actually matches with all files on Win95 */ - globPtr->pattern = (char *) ckalloc(3 * sizeof(char)); + globPtr->pattern = ckalloc(3 * sizeof(char)); strcpy(globPtr->pattern, "*."); } else { - globPtr->pattern = (char *) ckalloc((unsigned int) len); + globPtr->pattern = ckalloc((unsigned) len); strcpy(globPtr->pattern, str); } } else { - globPtr->pattern = (char *) ckalloc((unsigned int) len); + globPtr->pattern = ckalloc((unsigned) len); strcpy(globPtr->pattern, str); } @@ -346,7 +346,7 @@ AddClause( Tcl_DString osTypeDS; int len; MacFileType *mfPtr = (MacFileType *) ckalloc(sizeof(MacFileType)); - CONST char *strType = Tcl_GetStringFromObj(ostypeList[i], &len); + const char *strType = Tcl_GetStringFromObj(ostypeList[i], &len); char *string; /* @@ -401,11 +401,12 @@ static FileFilter * GetFilter( FileFilterList *flistPtr, /* The FileFilterList that contains the newly * created filter */ - CONST char *name) /* Name of the filter. It is usually displayed + const char *name) /* Name of the filter. It is usually displayed * in the "File Types" listbox in the file * dialogs. */ { FileFilter *filterPtr = flistPtr->filters; + size_t len; for (; filterPtr; filterPtr=filterPtr->next) { if (strcmp(filterPtr->name, name) == 0) { @@ -416,8 +417,9 @@ GetFilter( filterPtr = (FileFilter *) ckalloc(sizeof(FileFilter)); filterPtr->clauses = NULL; filterPtr->clausesTail = NULL; - filterPtr->name = (char *) ckalloc((strlen(name)+1) * sizeof(char)); - strcpy(filterPtr->name, name); + len = (strlen(name) + 1) * sizeof(char); + filterPtr->name = ckalloc(len); + memcpy(filterPtr->name, name, len); if (flistPtr->filters == NULL) { flistPtr->filters = flistPtr->filtersTail = filterPtr; @@ -436,7 +438,7 @@ GetFilter( * * FreeClauses -- * - * Frees the malloc'ed file type clause + * Frees the malloc'ed file type clause. * * Results: * None. @@ -455,8 +457,8 @@ FreeClauses( while (clausePtr != NULL) { FileFilterClause *toFree = clausePtr; - clausePtr = clausePtr->next; + clausePtr = clausePtr->next; FreeGlobPatterns(toFree); FreeMacFileTypes(toFree); ckfree((char *) toFree); @@ -491,7 +493,7 @@ FreeGlobPatterns( GlobPattern *toFree = globPtr; globPtr = globPtr->next; - ckfree((char *) toFree->pattern); + ckfree(toFree->pattern); ckfree((char *) toFree); } clausePtr->patterns = NULL; @@ -516,12 +518,13 @@ FreeGlobPatterns( static void FreeMacFileTypes( FileFilterClause *clausePtr)/* The clause whose mac types are to be - * freed */ + * freed. */ { MacFileType *mfPtr = clausePtr->macTypes; while (mfPtr != NULL) { MacFileType *toFree = mfPtr; + mfPtr = mfPtr->next; ckfree((char *) toFree); } diff --git a/generic/tkFocus.c b/generic/tkFocus.c index e524c16..980a8e0 100644 --- a/generic/tkFocus.c +++ b/generic/tkFocus.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkFocus.c,v 1.16 2007/12/13 15:24:14 dgp Exp $ + * RCS: @(#) $Id: tkFocus.c,v 1.17 2008/04/27 22:38:56 dkf Exp $ */ #include "tkInt.h" @@ -118,13 +118,13 @@ Tk_FocusObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { - static CONST char *focusOptions[] = { + static const char *focusOptions[] = { "-displayof", "-force", "-lastfor", NULL }; - Tk_Window tkwin = (Tk_Window) clientData; - TkWindow *winPtr = (TkWindow *) clientData; + Tk_Window tkwin = clientData; + TkWindow *winPtr = clientData; TkWindow *newPtr, *focusWinPtr, *topLevelPtr; ToplevelFocusInfo *tlFocusPtr; char *windowName; @@ -216,7 +216,7 @@ Tk_FocusObjCmd( return TCL_ERROR; } for (topLevelPtr = newPtr; topLevelPtr != NULL; - topLevelPtr = topLevelPtr->parentPtr) { + topLevelPtr = topLevelPtr->parentPtr) { if (!(topLevelPtr->flags & TK_TOP_HIERARCHY)) { continue; } @@ -393,7 +393,7 @@ TkFocusFilterEvent( * tree, then ignore the event. */ - if (TkGrabState(winPtr) == TK_GRAB_EXCLUDED) { + if (TkGrabState(winPtr) == TK_GRAB_EXCLUDED) { return retValue; } @@ -500,14 +500,14 @@ TkFocusFilterEvent( } else if (eventPtr->type == LeaveNotify) { /* * If the pointer just left a window for which we automatically - * claimed the focus on enter, move the focus back to the root - * window, where it was before we claimed it above. Note: + * claimed the focus on enter, move the focus back to the root window, + * where it was before we claimed it above. Note: * dispPtr->implicitWinPtr may not be the same as - * displayFocusPtr->focusWinPtr (e.g. because the "focus" command - * was used to redirect the focus after it arrived at - * dispPtr->implicitWinPtr)!! In addition, we generate events - * because the window manager won't give us a FocusOut event when - * we focus on the root. + * displayFocusPtr->focusWinPtr (e.g. because the "focus" command was + * used to redirect the focus after it arrived at + * dispPtr->implicitWinPtr)!! In addition, we generate events because + * the window manager won't give us a FocusOut event when we focus on + * the root. */ if ((dispPtr->implicitWinPtr != NULL) @@ -573,7 +573,7 @@ TkSetFocusWin( */ allMapped = 1; - for (topLevelPtr = winPtr; ; topLevelPtr = topLevelPtr->parentPtr) { + for (topLevelPtr = winPtr; ; topLevelPtr = topLevelPtr->parentPtr) { if (topLevelPtr == NULL) { /* * The window is being deleted. No point in worrying about giving @@ -599,16 +599,14 @@ TkSetFocusWin( */ if (displayFocusPtr->focusOnMapPtr != NULL) { - Tk_DeleteEventHandler( - (Tk_Window) displayFocusPtr->focusOnMapPtr, + Tk_DeleteEventHandler((Tk_Window) displayFocusPtr->focusOnMapPtr, StructureNotifyMask, FocusMapProc, - (ClientData) displayFocusPtr->focusOnMapPtr); + displayFocusPtr->focusOnMapPtr); displayFocusPtr->focusOnMapPtr = NULL; } if (!allMapped) { - Tk_CreateEventHandler((Tk_Window) winPtr, - VisibilityChangeMask, FocusMapProc, - (ClientData) winPtr); + Tk_CreateEventHandler((Tk_Window) winPtr, VisibilityChangeMask, + FocusMapProc, winPtr); displayFocusPtr->focusOnMapPtr = winPtr; displayFocusPtr->forceFocus = force; return; @@ -943,7 +941,7 @@ FocusMapProc( ClientData clientData, /* Toplevel window. */ XEvent *eventPtr) /* Information about event. */ { - TkWindow *winPtr = (TkWindow *) clientData; + TkWindow *winPtr = clientData; DisplayFocusInfo *displayFocusPtr; if (eventPtr->type == VisibilityNotify) { @@ -1048,8 +1046,8 @@ TkFocusFree( * * TkFocusSplit -- * - * Adjust focus window for a newly managed toplevel, thus splitting - * the toplevel into two toplevels. + * Adjust focus window for a newly managed toplevel, thus splitting the + * toplevel into two toplevels. * * Results: * None. @@ -1062,29 +1060,29 @@ TkFocusFree( void TkFocusSplit(winPtr) - TkWindow *winPtr; /* Window is the new toplevel - * Any focus point at or below window - * must be moved to this new toplevel */ + TkWindow *winPtr; /* Window is the new toplevel. Any focus point + * at or below window must be moved to this + * new toplevel. */ { ToplevelFocusInfo *tlFocusPtr; DisplayFocusInfo *displayFocusPtr; - TkWindow *topLevelPtr; - TkWindow *subWinPtr; + TkWindow *topLevelPtr, *subWinPtr; displayFocusPtr = FindDisplayFocusInfo(winPtr->mainPtr, winPtr->dispPtr); /* - * Find the top-level window for winPtr, then find (or create) - * a record for the top-level. Also see whether winPtr and all its - * ancestors are mapped. + * Find the top-level window for winPtr, then find (or create) a record + * for the top-level. Also see whether winPtr and all its ancestors are + * mapped. */ - for (topLevelPtr = winPtr; ; topLevelPtr = topLevelPtr->parentPtr) { + for (topLevelPtr = winPtr; ; topLevelPtr = topLevelPtr->parentPtr) { if (topLevelPtr == NULL) { /* - * The window is being deleted. No point in worrying about - * giving it the focus. + * The window is being deleted. No point in worrying about giving + * it the focus. */ + return; } if (topLevelPtr->flags & TK_TOP_HIERARCHY) { @@ -1092,37 +1090,58 @@ TkFocusSplit(winPtr) } } - /* Search all focus records to find child windows of winPtr */ + /* + * Search all focus records to find child windows of winPtr. + */ + for (tlFocusPtr = winPtr->mainPtr->tlFocusPtr; tlFocusPtr != NULL; - tlFocusPtr = tlFocusPtr->nextPtr) { + tlFocusPtr = tlFocusPtr->nextPtr) { if (tlFocusPtr->topLevelPtr == topLevelPtr) { break; } } if (tlFocusPtr == NULL) { - /* No focus record for this toplevel, nothing to do. */ + /* + * No focus record for this toplevel, nothing to do. + */ + return; } - /* See if current focusWin is child of the new toplevel */ + /* + * See if current focusWin is child of the new toplevel. + */ + for (subWinPtr = tlFocusPtr->focusWinPtr; - subWinPtr && subWinPtr != winPtr && subWinPtr != topLevelPtr; - subWinPtr = subWinPtr->parentPtr) {} + subWinPtr && subWinPtr != winPtr && subWinPtr != topLevelPtr; + subWinPtr = subWinPtr->parentPtr) { + /* EMPTY */ + } if (subWinPtr == winPtr) { - /* Move focus to new toplevel */ - ToplevelFocusInfo *newTlFocusPtr; + /* + * Move focus to new toplevel. + */ + + ToplevelFocusInfo *newTlFocusPtr = (ToplevelFocusInfo *) + ckalloc(sizeof(ToplevelFocusInfo)); - newTlFocusPtr = (ToplevelFocusInfo *) ckalloc(sizeof(ToplevelFocusInfo)); newTlFocusPtr->topLevelPtr = winPtr; newTlFocusPtr->focusWinPtr = tlFocusPtr->focusWinPtr; newTlFocusPtr->nextPtr = winPtr->mainPtr->tlFocusPtr; winPtr->mainPtr->tlFocusPtr = newTlFocusPtr; - /* Move old toplevel's focus to the toplevel itself */ + + /* + * Move old toplevel's focus to the toplevel itself. + */ + tlFocusPtr->focusWinPtr = topLevelPtr; } - /* If it's not, then let focus progress naturally */ + + /* + * If it's not, then let focus progress naturally. + */ } /* @@ -1142,25 +1161,25 @@ TkFocusSplit(winPtr) */ void -TkFocusJoin(winPtr) - TkWindow *winPtr; /* Window is no longer a toplevel */ +TkFocusJoin( + TkWindow *winPtr) /* Window is no longer a toplevel. */ { - ToplevelFocusInfo *tlFocusPtr; - ToplevelFocusInfo *tmpPtr; + ToplevelFocusInfo *tlFocusPtr, *tmpPtr; /* * Remove old toplevel record */ + if (winPtr && winPtr->mainPtr && winPtr->mainPtr->tlFocusPtr - && winPtr->mainPtr->tlFocusPtr->topLevelPtr == winPtr) { + && winPtr->mainPtr->tlFocusPtr->topLevelPtr == winPtr) { tmpPtr = winPtr->mainPtr->tlFocusPtr; winPtr->mainPtr->tlFocusPtr = tmpPtr->nextPtr; ckfree((char *)tmpPtr); } else { for (tlFocusPtr = winPtr->mainPtr->tlFocusPtr; tlFocusPtr != NULL; - tlFocusPtr = tlFocusPtr->nextPtr) { + tlFocusPtr = tlFocusPtr->nextPtr) { if (tlFocusPtr->nextPtr && - tlFocusPtr->nextPtr->topLevelPtr == winPtr) { + tlFocusPtr->nextPtr->topLevelPtr == winPtr) { tmpPtr = tlFocusPtr->nextPtr; tlFocusPtr->nextPtr = tmpPtr->nextPtr; ckfree((char *)tmpPtr); diff --git a/generic/tkFont.c b/generic/tkFont.c index f2d2441..a168919 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkFont.c,v 1.42 2007/12/13 15:24:14 dgp Exp $ + * RCS: @(#) $Id: tkFont.c,v 1.43 2008/04/27 22:38:56 dkf Exp $ */ #include "tkInt.h" @@ -378,9 +378,8 @@ void TkFontPkgInit( TkMainInfo *mainPtr) /* The application being created. */ { - TkFontInfo *fiPtr; + TkFontInfo *fiPtr = (TkFontInfo *) ckalloc(sizeof(TkFontInfo)); - fiPtr = (TkFontInfo *) ckalloc(sizeof(TkFontInfo)); Tcl_InitHashTable(&fiPtr->fontCache, TCL_STRING_KEYS); Tcl_InitHashTable(&fiPtr->namedTable, TCL_STRING_KEYS); fiPtr->mainPtr = mainPtr; @@ -412,13 +411,11 @@ void TkFontPkgFree( TkMainInfo *mainPtr) /* The application being deleted. */ { - TkFontInfo *fiPtr; + TkFontInfo *fiPtr = mainPtr->fontInfoPtr; Tcl_HashEntry *hPtr, *searchPtr; Tcl_HashSearch search; int fontsLeft; - fiPtr = mainPtr->fontInfoPtr; - fontsLeft = 0; for (searchPtr = Tcl_FirstHashEntry(&fiPtr->fontCache, &search); searchPtr != NULL; @@ -445,7 +442,7 @@ TkFontPkgFree( } Tcl_DeleteHashTable(&fiPtr->namedTable); if (fiPtr->updatePending != 0) { - Tcl_CancelIdleCall(TheWorldHasChanged, (ClientData) fiPtr); + Tcl_CancelIdleCall(TheWorldHasChanged, fiPtr); } ckfree((char *) fiPtr); } @@ -621,7 +618,7 @@ Tk_FontObjCmd( namedHashPtr = Tcl_FindHashEntry(&fiPtr->namedTable, string); nfPtr = NULL; /* lint. */ if (namedHashPtr != NULL) { - nfPtr = (NamedFont *) Tcl_GetHashValue(namedHashPtr); + nfPtr = Tcl_GetHashValue(namedHashPtr); } if ((namedHashPtr == NULL) || (nfPtr->deletePending != 0)) { Tcl_AppendResult(interp, "named font \"", string, @@ -804,7 +801,7 @@ Tk_FontObjCmd( resultPtr = Tcl_GetObjResult(interp); namedHashPtr = Tcl_FirstHashEntry(&fiPtr->namedTable, &search); while (namedHashPtr != NULL) { - nfPtr = (NamedFont *) Tcl_GetHashValue(namedHashPtr); + nfPtr = Tcl_GetHashValue(namedHashPtr); if (nfPtr->deletePending == 0) { string = Tcl_GetHashKey(&fiPtr->namedTable, namedHashPtr); strPtr = Tcl_NewStringObj(string, -1); @@ -848,7 +845,7 @@ UpdateDependentFonts( TkFont *fontPtr; NamedFont *nfPtr; - nfPtr = (NamedFont *) Tcl_GetHashValue(namedHashPtr); + nfPtr = Tcl_GetHashValue(namedHashPtr); if (nfPtr->refCount == 0) { /* * Well nobody's using this named font, so don't have to tell any @@ -860,13 +857,13 @@ UpdateDependentFonts( cacheHashPtr = Tcl_FirstHashEntry(&fiPtr->fontCache, &search); while (cacheHashPtr != NULL) { - for (fontPtr = (TkFont *) Tcl_GetHashValue(cacheHashPtr); + for (fontPtr = Tcl_GetHashValue(cacheHashPtr); fontPtr != NULL; fontPtr = fontPtr->nextPtr) { if (fontPtr->namedHashPtr == namedHashPtr) { TkpGetFontFromAttributes(fontPtr, tkwin, &nfPtr->fa); if (fiPtr->updatePending == 0) { fiPtr->updatePending = 1; - Tcl_DoWhenIdle(TheWorldHasChanged, (ClientData) fiPtr); + Tcl_DoWhenIdle(TheWorldHasChanged, fiPtr); } } } @@ -878,11 +875,9 @@ static void TheWorldHasChanged( ClientData clientData) /* Info about application's fonts. */ { - TkFontInfo *fiPtr; + TkFontInfo *fiPtr = clientData; - fiPtr = (TkFontInfo *) clientData; fiPtr->updatePending = 0; - RecomputeWidgets(fiPtr->mainPtr->winPtr); } @@ -890,8 +885,9 @@ static void RecomputeWidgets( TkWindow *winPtr) /* Window to which command is sent. */ { - Tk_ClassWorldChangedProc *proc; - proc = Tk_GetClassProc(winPtr->classProcsPtr, worldChangedProc); + Tk_ClassWorldChangedProc *proc = + Tk_GetClassProc(winPtr->classProcsPtr, worldChangedProc); + if (proc != NULL) { (*proc)(winPtr->instanceData); } @@ -961,7 +957,7 @@ TkCreateNamedFont( namedHashPtr = Tcl_CreateHashEntry(&fiPtr->namedTable, name, &isNew); if (!isNew) { - nfPtr = (NamedFont *) Tcl_GetHashValue(namedHashPtr); + nfPtr = Tcl_GetHashValue(namedHashPtr); if (nfPtr->deletePending == 0) { if (interp) { Tcl_AppendResult(interp, "named font \"", name, @@ -1006,7 +1002,7 @@ int TkDeleteNamedFont( Tcl_Interp *interp, /* Interp for error return (can be NULL). */ Tk_Window tkwin, /* A window associated with interp. */ - CONST char *name) /* Name for the new named font. */ + const char *name) /* Name for the new named font. */ { TkFontInfo *fiPtr; NamedFont *nfPtr; @@ -1022,7 +1018,7 @@ TkDeleteNamedFont( } return TCL_ERROR; } - nfPtr = (NamedFont *) Tcl_GetHashValue(namedHashPtr); + nfPtr = Tcl_GetHashValue(namedHashPtr); if (nfPtr->refCount != 0) { nfPtr->deletePending = 1; } else { @@ -1111,7 +1107,7 @@ Tk_AllocFontFromObj( SetFontFromAny(interp, objPtr); } - oldFontPtr = (TkFont *) objPtr->internalRep.twoPtrValue.ptr1; + oldFontPtr = objPtr->internalRep.twoPtrValue.ptr1; if (oldFontPtr != NULL) { if (oldFontPtr->resourceRefCount == 0) { @@ -1141,13 +1137,13 @@ Tk_AllocFontFromObj( cacheHashPtr = Tcl_CreateHashEntry(&fiPtr->fontCache, Tcl_GetString(objPtr), &isNew); } - firstFontPtr = (TkFont *) Tcl_GetHashValue(cacheHashPtr); + firstFontPtr = Tcl_GetHashValue(cacheHashPtr); for (fontPtr = firstFontPtr; (fontPtr != NULL); fontPtr = fontPtr->nextPtr) { if (Tk_Screen(tkwin) == fontPtr->screen) { fontPtr->resourceRefCount++; fontPtr->objRefCount++; - objPtr->internalRep.twoPtrValue.ptr1 = (void *) fontPtr; + objPtr->internalRep.twoPtrValue.ptr1 = fontPtr; return (Tk_Font) fontPtr; } } @@ -1163,7 +1159,7 @@ Tk_AllocFontFromObj( * Construct a font based on a named font. */ - nfPtr = (NamedFont *) Tcl_GetHashValue(namedHashPtr); + nfPtr = Tcl_GetHashValue(namedHashPtr); nfPtr->refCount++; fontPtr = TkpGetFontFromAttributes(NULL, tkwin, &nfPtr->fa); @@ -1242,7 +1238,7 @@ Tk_AllocFontFromObj( } } - objPtr->internalRep.twoPtrValue.ptr1 = (void *) fontPtr; + objPtr->internalRep.twoPtrValue.ptr1 = fontPtr; return (Tk_Font) fontPtr; } @@ -1278,7 +1274,7 @@ Tk_GetFontFromObj( SetFontFromAny(NULL, objPtr); } - fontPtr = (TkFont *) objPtr->internalRep.twoPtrValue.ptr1; + fontPtr = objPtr->internalRep.twoPtrValue.ptr1; if (fontPtr != NULL) { if (fontPtr->resourceRefCount == 0) { @@ -1306,11 +1302,11 @@ Tk_GetFontFromObj( hashPtr = Tcl_FindHashEntry(&fiPtr->fontCache, Tcl_GetString(objPtr)); } if (hashPtr != NULL) { - for (fontPtr = (TkFont *) Tcl_GetHashValue(hashPtr); fontPtr != NULL; + for (fontPtr = Tcl_GetHashValue(hashPtr); fontPtr != NULL; fontPtr = fontPtr->nextPtr) { if (Tk_Screen(tkwin) == fontPtr->screen) { fontPtr->objRefCount++; - objPtr->internalRep.twoPtrValue.ptr1 = (void *) fontPtr; + objPtr->internalRep.twoPtrValue.ptr1 = fontPtr; return (Tk_Font) fontPtr; } } @@ -1427,7 +1423,7 @@ Tk_FreeFont( * the named font and free it if no-one else is using it. */ - nfPtr = (NamedFont *) Tcl_GetHashValue(fontPtr->namedHashPtr); + nfPtr = Tcl_GetHashValue(fontPtr->namedHashPtr); nfPtr->refCount--; if ((nfPtr->refCount == 0) && (nfPtr->deletePending != 0)) { Tcl_DeleteHashEntry(fontPtr->namedHashPtr); @@ -1435,7 +1431,7 @@ Tk_FreeFont( } } - prevPtr = (TkFont *) Tcl_GetHashValue(fontPtr->cacheHashPtr); + prevPtr = Tcl_GetHashValue(fontPtr->cacheHashPtr); if (prevPtr == fontPtr) { if (fontPtr->nextPtr == NULL) { Tcl_DeleteHashEntry(fontPtr->cacheHashPtr); @@ -1505,7 +1501,7 @@ static void FreeFontObjProc( Tcl_Obj *objPtr) /* The object we are releasing. */ { - TkFont *fontPtr = (TkFont *) objPtr->internalRep.twoPtrValue.ptr1; + TkFont *fontPtr = objPtr->internalRep.twoPtrValue.ptr1; if (fontPtr != NULL) { fontPtr->objRefCount--; @@ -1539,10 +1535,10 @@ DupFontObjProc( Tcl_Obj *srcObjPtr, /* The object we are copying from. */ Tcl_Obj *dupObjPtr) /* The object we are copying to. */ { - TkFont *fontPtr = (TkFont *) srcObjPtr->internalRep.twoPtrValue.ptr1; + TkFont *fontPtr = srcObjPtr->internalRep.twoPtrValue.ptr1; dupObjPtr->typePtr = srcObjPtr->typePtr; - dupObjPtr->internalRep.twoPtrValue.ptr1 = (void *) fontPtr; + dupObjPtr->internalRep.twoPtrValue.ptr1 = fontPtr; if (fontPtr != NULL) { fontPtr->objRefCount++; @@ -1606,9 +1602,8 @@ Tk_GetFontMetrics( Tk_FontMetrics *fmPtr) /* Pointer to structure in which font metrics * for tkfont will be stored. */ { - TkFont *fontPtr; + TkFont *fontPtr = (TkFont *) tkfont; - fontPtr = (TkFont *) tkfont; fmPtr->ascent = fontPtr->fm.ascent; fmPtr->descent = fontPtr->fm.descent; fmPtr->linespace = fontPtr->fm.ascent + fontPtr->fm.descent; @@ -1891,8 +1886,8 @@ TkUnderlineCharsInContext( &endX); XFillRectangle(display, drawable, gc, x + startX, - y + fontPtr->underlinePos, (unsigned int) (endX - startX), - (unsigned int) fontPtr->underlineHeight); + y + fontPtr->underlinePos, (unsigned) (endX - startX), + (unsigned) fontPtr->underlineHeight); } /* @@ -2232,9 +2227,8 @@ void Tk_FreeTextLayout( Tk_TextLayout textLayout) /* The text layout to be released. */ { - TextLayout *layoutPtr; + TextLayout *layoutPtr = (TextLayout *) textLayout; - layoutPtr = (TextLayout *) textLayout; if (layoutPtr != NULL) { ckfree((char *) layoutPtr); } @@ -2276,13 +2270,11 @@ Tk_DrawTextLayout( * draw from the given text item. A number < 0 * means to draw all characters. */ { - TextLayout *layoutPtr; + TextLayout *layoutPtr = (TextLayout *) layout; int i, numDisplayChars, drawX; - const char *firstByte; - const char *lastByte; + const char *firstByte, *lastByte; LayoutChunk *chunkPtr; - layoutPtr = (TextLayout *) layout; if (layoutPtr == NULL) { return; } @@ -2307,9 +2299,8 @@ Tk_DrawTextLayout( numDisplayChars = lastChar; } lastByte = Tcl_UtfAtIndex(chunkPtr->start, numDisplayChars); - Tk_DrawChars(display, drawable, gc, layoutPtr->tkfont, - firstByte, lastByte - firstByte, - x + chunkPtr->x + drawX, y + chunkPtr->y); + Tk_DrawChars(display, drawable, gc, layoutPtr->tkfont, firstByte, + lastByte - firstByte, x+chunkPtr->x+drawX, y+chunkPtr->y); } firstChar -= chunkPtr->numChars; lastChar -= chunkPtr->numChars; @@ -2355,18 +2346,16 @@ Tk_UnderlineTextLayout( int underline) /* Index of the single character to underline, * or -1 for no underline. */ { - TextLayout *layoutPtr; - TkFont *fontPtr; int xx, yy, width, height; if ((Tk_CharBbox(layout, underline, &xx, &yy, &width, &height) != 0) && (width != 0)) { - layoutPtr = (TextLayout *) layout; - fontPtr = (TkFont *) layoutPtr->tkfont; + TextLayout *layoutPtr = (TextLayout *) layout; + TkFont *fontPtr = (TkFont *) layoutPtr->tkfont; XFillRectangle(display, drawable, gc, x + xx, y + yy + fontPtr->fm.ascent + fontPtr->underlinePos, - (unsigned int) width, (unsigned int) fontPtr->underlineHeight); + (unsigned) width, (unsigned) fontPtr->underlineHeight); } } @@ -2475,8 +2464,7 @@ Tk_PointToChar( return numChars; } n = Tk_MeasureChars((Tk_Font) fontPtr, chunkPtr->start, - chunkPtr->numBytes, x - chunkPtr->x, - 0, &dummy); + chunkPtr->numBytes, x - chunkPtr->x, 0, &dummy); return numChars + Tcl_NumUtfChars(chunkPtr->start, n); } numChars += chunkPtr->numChars; @@ -3804,7 +3792,7 @@ TkDebugFont( hashPtr = Tcl_FindHashEntry( &((TkWindow *) tkwin)->mainPtr->fontInfoPtr->fontCache, name); if (hashPtr != NULL) { - fontPtr = (TkFont *) Tcl_GetHashValue(hashPtr); + fontPtr = Tcl_GetHashValue(hashPtr); if (fontPtr == NULL) { Tcl_Panic("TkDebugFont found empty hash table entry"); } @@ -3850,7 +3838,7 @@ TkFontGetFirstTextLayout( LayoutChunk *chunkPtr; int numBytesInChunk; - layoutPtr = (TextLayout *)layout; + layoutPtr = (TextLayout *) layout; if ((layoutPtr==NULL) || (layoutPtr->numChunks==0) || (layoutPtr->chunks->numDisplayChars <= 0)) { dst[0] = '\0'; diff --git a/generic/tkFrame.c b/generic/tkFrame.c index 372cbda..1a751ed 100644 --- a/generic/tkFrame.c +++ b/generic/tkFrame.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkFrame.c,v 1.31 2007/12/13 15:24:14 dgp Exp $ + * RCS: @(#) $Id: tkFrame.c,v 1.32 2008/04/27 22:38:56 dkf Exp $ */ #include "default.h" @@ -290,7 +290,7 @@ static char *classNames[] = {"Frame", "Toplevel", "Labelframe"}; * class of widgets. */ -static const Tk_OptionSpec * const optionSpecs[] = { +static const Tk_OptionSpec *const optionSpecs[] = { frameOptSpec, toplevelOptSpec, labelframeOptSpec, @@ -302,9 +302,9 @@ static const Tk_OptionSpec * const optionSpecs[] = { static void ComputeFrameGeometry(Frame *framePtr); static int ConfigureFrame(Tcl_Interp *interp, Frame *framePtr, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static int CreateFrame(ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST argv[], + int objc, Tcl_Obj *const argv[], enum FrameType type, char *appName); static void DestroyFrame(char *memPtr); static void DestroyFramePartly(Frame *framePtr); @@ -320,7 +320,7 @@ static void FrameStructureProc(ClientData clientData, XEvent *eventPtr); static int FrameWidgetObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static void FrameWorldChanged(ClientData instanceData); static void MapFrame(ClientData clientData); @@ -369,7 +369,7 @@ Tk_FrameObjCmd( ClientData clientData, /* Either NULL or pointer to option table. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { return CreateFrame(clientData, interp, objc, objv, TYPE_FRAME, NULL); } @@ -379,7 +379,7 @@ Tk_ToplevelObjCmd( ClientData clientData, /* Either NULL or pointer to option table. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { return CreateFrame(clientData, interp, objc, objv, TYPE_TOPLEVEL, NULL); } @@ -389,7 +389,7 @@ Tk_LabelframeObjCmd( ClientData clientData, /* Either NULL or pointer to option table. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { return CreateFrame(clientData, interp, objc, objv, TYPE_LABELFRAME, NULL); } @@ -448,7 +448,7 @@ CreateFrame( ClientData clientData, /* NULL. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[], /* Argument objects. */ + Tcl_Obj *const objv[], /* Argument objects. */ enum FrameType type, /* What widget type to create. */ char *appName) /* Should only be non-NULL if there are no * Main window associated with the @@ -459,7 +459,8 @@ CreateFrame( Frame *framePtr; Tk_OptionTable optionTable; Tk_Window newWin; - CONST char *className, *screenName, *visualName, *colormapName, *arg, *useOption; + const char *className, *screenName, *visualName, *colormapName; + const char *arg, *useOption; int i, c, length, depth; unsigned int mask; Colormap colormap; @@ -614,17 +615,17 @@ CreateFrame( if (type == TYPE_LABELFRAME) { framePtr = (Frame *) ckalloc(sizeof(Labelframe)); - memset((void *) framePtr, 0, (sizeof(Labelframe))); + memset(framePtr, 0, sizeof(Labelframe)); } else { framePtr = (Frame *) ckalloc(sizeof(Frame)); - memset((void *) framePtr, 0, (sizeof(Frame))); + memset(framePtr, 0, sizeof(Frame)); } framePtr->tkwin = newWin; framePtr->display = Tk_Display(newWin); framePtr->interp = interp; framePtr->widgetCmd = Tcl_CreateObjCommand(interp, - Tk_PathName(newWin), FrameWidgetObjCmd, - (ClientData) framePtr, FrameCmdDeletedProc); + Tk_PathName(newWin), FrameWidgetObjCmd, framePtr, + FrameCmdDeletedProc); framePtr->optionTable = optionTable; framePtr->type = type; framePtr->colormap = colormap; @@ -633,6 +634,7 @@ CreateFrame( if (framePtr->type == TYPE_LABELFRAME) { Labelframe *labelframePtr = (Labelframe *) framePtr; + labelframePtr->labelAnchor = LABELANCHOR_NW; labelframePtr->textGC = None; } @@ -641,13 +643,13 @@ CreateFrame( * Store backreference to frame widget in window structure. */ - Tk_SetClassProcs(newWin, &frameClass, (ClientData) framePtr); + Tk_SetClassProcs(newWin, &frameClass, framePtr); mask = ExposureMask | StructureNotifyMask | FocusChangeMask; if (type == TYPE_TOPLEVEL) { mask |= ActivateMask; } - Tk_CreateEventHandler(newWin, mask, FrameEventProc, (ClientData) framePtr); + Tk_CreateEventHandler(newWin, mask, FrameEventProc, framePtr); if ((Tk_InitOptions(interp, (char *) framePtr, optionTable, newWin) != TCL_OK) || (ConfigureFrame(interp, framePtr, objc-2, objv+2) != TCL_OK)) { @@ -663,7 +665,7 @@ CreateFrame( } } if (type == TYPE_TOPLEVEL) { - Tcl_DoWhenIdle(MapFrame, (ClientData) framePtr); + Tcl_DoWhenIdle(MapFrame, framePtr); } Tcl_SetResult(interp, Tk_PathName(newWin), TCL_STATIC); return TCL_OK; @@ -698,15 +700,15 @@ FrameWidgetObjCmd( ClientData clientData, /* Information about frame widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { - static CONST char *frameOptions[] = { + static const char *frameOptions[] = { "cget", "configure", NULL }; enum options { FRAME_CGET, FRAME_CONFIGURE }; - register Frame *framePtr = (Frame *) clientData; + register Frame *framePtr = clientData; int result = TCL_OK, index; int c, i, length; Tcl_Obj *objPtr; @@ -719,7 +721,7 @@ FrameWidgetObjCmd( &index) != TCL_OK) { return TCL_ERROR; } - Tcl_Preserve((ClientData) framePtr); + Tcl_Preserve(framePtr); switch ((enum options) index) { case FRAME_CGET: if (objc != 3) { @@ -732,22 +734,19 @@ FrameWidgetObjCmd( if (objPtr == NULL) { result = TCL_ERROR; goto done; - } else { - Tcl_SetObjResult(interp, objPtr); } + Tcl_SetObjResult(interp, objPtr); break; case FRAME_CONFIGURE: if (objc <= 3) { objPtr = Tk_GetOptionInfo(interp, (char *) framePtr, - framePtr->optionTable, - (objc == 3) ? objv[2] : NULL, + framePtr->optionTable, (objc == 3) ? objv[2] : NULL, framePtr->tkwin); if (objPtr == NULL) { result = TCL_ERROR; goto done; - } else { - Tcl_SetObjResult(interp, objPtr); } + Tcl_SetObjResult(interp, objPtr); } else { /* * Don't allow the options -class, -colormap, -container, -screen, @@ -773,9 +772,9 @@ FrameWidgetObjCmd( || ((c == 'v') && (strncmp(arg, "-visual", (unsigned)length) == 0))) { - #ifdef SUPPORT_CONFIG_EMBEDDED +#ifdef SUPPORT_CONFIG_EMBEDDED if (c == 'u') { - CONST char *string = Tcl_GetString(objv[i+1]); + const char *string = Tcl_GetString(objv[i+1]); if (TkpUseWindow(interp, framePtr->tkwin, string) != TCL_OK) { result = TCL_ERROR; @@ -787,12 +786,12 @@ FrameWidgetObjCmd( result = TCL_ERROR; goto done; } - #else +#else Tcl_AppendResult(interp, "can't modify ", arg, " option after widget is created", NULL); result = TCL_ERROR; goto done; - #endif +#endif } } result = ConfigureFrame(interp, framePtr, objc-2, objv+2); @@ -801,7 +800,7 @@ FrameWidgetObjCmd( } done: - Tcl_Release((ClientData) framePtr); + Tcl_Release(framePtr); return result; } @@ -868,8 +867,8 @@ DestroyFramePartly( if (framePtr->type == TYPE_LABELFRAME && labelframePtr->labelWin != NULL) { Tk_DeleteEventHandler(labelframePtr->labelWin, StructureNotifyMask, - FrameStructureProc, (ClientData) framePtr); - Tk_ManageGeometry(labelframePtr->labelWin, NULL, (ClientData) NULL); + FrameStructureProc, framePtr); + Tk_ManageGeometry(labelframePtr->labelWin, NULL, NULL); if (framePtr->tkwin != Tk_Parent(labelframePtr->labelWin)) { Tk_UnmaintainGeometry(labelframePtr->labelWin, framePtr->tkwin); } @@ -907,7 +906,7 @@ ConfigureFrame( register Frame *framePtr, /* Information about widget; may or may not * already have values for some fields. */ int objc, /* Number of valid entries in objv. */ - Tcl_Obj *CONST objv[]) /* Arguments. */ + Tcl_Obj *const objv[]) /* Arguments. */ { Tk_SavedOptions savedOptions; char *oldMenuName; @@ -947,7 +946,7 @@ ConfigureFrame( || ((oldMenuName != NULL) && (framePtr->menuName == NULL)) || ((oldMenuName != NULL) && (framePtr->menuName != NULL) && strcmp(oldMenuName, framePtr->menuName) != 0)) - && framePtr->type == TYPE_TOPLEVEL) { + && framePtr->type == TYPE_TOPLEVEL) { TkSetWindowMenuBar(interp, framePtr->tkwin, oldMenuName, framePtr->menuName); } @@ -981,7 +980,7 @@ ConfigureFrame( if (oldWindow != labelframePtr->labelWin) { if (oldWindow != NULL) { Tk_DeleteEventHandler(oldWindow, StructureNotifyMask, - FrameStructureProc, (ClientData) framePtr); + FrameStructureProc, framePtr); Tk_ManageGeometry(oldWindow, NULL, (ClientData) NULL); Tk_UnmaintainGeometry(oldWindow, framePtr->tkwin); Tk_UnmapWindow(oldWindow); @@ -1003,7 +1002,7 @@ ConfigureFrame( } sibling = ancestor; if (Tk_IsTopLevel(ancestor)) { - badWindow: + badWindow: Tcl_AppendResult(interp, "can't use ", Tk_PathName(labelframePtr->labelWin), " as label in this frame", NULL); @@ -1018,10 +1017,9 @@ ConfigureFrame( goto badWindow; } Tk_CreateEventHandler(labelframePtr->labelWin, - StructureNotifyMask, FrameStructureProc, - (ClientData) framePtr); + StructureNotifyMask, FrameStructureProc, framePtr); Tk_ManageGeometry(labelframePtr->labelWin, &frameGeomType, - (ClientData) framePtr); + framePtr); /* * If the frame is not parent to the label, make sure the @@ -1035,8 +1033,7 @@ ConfigureFrame( } } - FrameWorldChanged((ClientData) framePtr); - + FrameWorldChanged(framePtr); return TCL_OK; } @@ -1062,8 +1059,8 @@ static void FrameWorldChanged( ClientData instanceData) /* Information about widget. */ { - Frame *framePtr = (Frame *) instanceData; - Labelframe *labelframePtr = (Labelframe *) framePtr; + Frame *framePtr = instanceData; + Labelframe *labelframePtr = instanceData; Tk_Window tkwin = framePtr->tkwin; XGCValues gcValues; GC gc; @@ -1102,14 +1099,17 @@ FrameWorldChanged( if (anyTextLabel) { labelText = Tcl_GetString(labelframePtr->textPtr); Tk_FreeTextLayout(labelframePtr->textLayout); - labelframePtr->textLayout = Tk_ComputeTextLayout(labelframePtr->tkfont, + labelframePtr->textLayout = + Tk_ComputeTextLayout(labelframePtr->tkfont, labelText, -1, 0, TK_JUSTIFY_CENTER, 0, - &labelframePtr->labelReqWidth, &labelframePtr->labelReqHeight); + &labelframePtr->labelReqWidth, + &labelframePtr->labelReqHeight); labelframePtr->labelReqWidth += 2 * LABELSPACING; labelframePtr->labelReqHeight += 2 * LABELSPACING; } else if (anyWindowLabel) { labelframePtr->labelReqWidth = Tk_ReqWidth(labelframePtr->labelWin); - labelframePtr->labelReqHeight = Tk_ReqHeight(labelframePtr->labelWin); + labelframePtr->labelReqHeight = + Tk_ReqHeight(labelframePtr->labelWin); } /* @@ -1202,7 +1202,7 @@ FrameWorldChanged( if (Tk_IsMapped(tkwin)) { if (!(framePtr->flags & REDRAW_PENDING)) { - Tcl_DoWhenIdle(DisplayFrame, (ClientData) framePtr); + Tcl_DoWhenIdle(DisplayFrame, framePtr); } framePtr->flags |= REDRAW_PENDING; } @@ -1239,7 +1239,9 @@ ComputeFrameGeometry( * We have nothing to do here unless there is a label. */ - if (framePtr->type != TYPE_LABELFRAME) return; + if (framePtr->type != TYPE_LABELFRAME) { + return; + } if (labelframePtr->textPtr == NULL && labelframePtr->labelWin == NULL) { return; } @@ -1371,7 +1373,7 @@ static void DisplayFrame( ClientData clientData) /* Information about widget. */ { - register Frame *framePtr = (Frame *) clientData; + register Frame *framePtr = clientData; register Tk_Window tkwin = framePtr->tkwin; int bdX1, bdY1, bdX2, bdY2, hlWidth; Pixmap pixmap; @@ -1408,7 +1410,9 @@ DisplayFrame( * If -background is set to "", no interior is drawn. */ - if (framePtr->border == NULL) return; + if (framePtr->border == NULL) { + return; + } if (framePtr->type != TYPE_LABELFRAME) { /* @@ -1539,7 +1543,8 @@ DisplayFrame( || (labelframePtr->labelBox.height != Tk_Height(labelframePtr->labelWin))) { Tk_MoveResizeWindow(labelframePtr->labelWin, - labelframePtr->labelBox.x, labelframePtr->labelBox.y, + labelframePtr->labelBox.x, + labelframePtr->labelBox.y, labelframePtr->labelBox.width, labelframePtr->labelBox.height); } @@ -1552,7 +1557,6 @@ DisplayFrame( } } - #ifndef TK_NO_DOUBLE_BUFFERING /* * Everything's been redisplayed; now copy the pixmap onto the screen @@ -1594,7 +1598,7 @@ FrameEventProc( ClientData clientData, /* Information about window. */ register XEvent *eventPtr) /* Information about event. */ { - register Frame *framePtr = (Frame *) clientData; + register Frame *framePtr = clientData; if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) { goto redraw; @@ -1628,15 +1632,15 @@ FrameEventProc( Tk_DeleteEventHandler(framePtr->tkwin, ExposureMask|StructureNotifyMask|FocusChangeMask, - FrameEventProc, (ClientData) framePtr); + FrameEventProc, framePtr); framePtr->tkwin = NULL; Tcl_DeleteCommandFromToken(framePtr->interp, framePtr->widgetCmd); } if (framePtr->flags & REDRAW_PENDING) { - Tcl_CancelIdleCall(DisplayFrame, (ClientData) framePtr); + Tcl_CancelIdleCall(DisplayFrame, framePtr); } - Tcl_CancelIdleCall(MapFrame, (ClientData) framePtr); - Tcl_EventuallyFree((ClientData) framePtr, DestroyFrame); + Tcl_CancelIdleCall(MapFrame, framePtr); + Tcl_EventuallyFree(framePtr, DestroyFrame); } else if (eventPtr->type == FocusIn) { if (eventPtr->xfocus.detail != NotifyInferior) { framePtr->flags |= GOT_FOCUS; @@ -1659,7 +1663,7 @@ FrameEventProc( redraw: if ((framePtr->tkwin != NULL) && !(framePtr->flags & REDRAW_PENDING)) { - Tcl_DoWhenIdle(DisplayFrame, (ClientData) framePtr); + Tcl_DoWhenIdle(DisplayFrame, framePtr); framePtr->flags |= REDRAW_PENDING; } } @@ -1686,7 +1690,7 @@ static void FrameCmdDeletedProc( ClientData clientData) /* Pointer to widget record for widget. */ { - Frame *framePtr = (Frame *) clientData; + Frame *framePtr = clientData; Tk_Window tkwin = framePtr->tkwin; if (framePtr->menuName != NULL) { @@ -1737,7 +1741,7 @@ static void MapFrame( ClientData clientData) /* Pointer to frame structure. */ { - Frame *framePtr = (Frame *) clientData; + Frame *framePtr = clientData; /* * Wait for all other background events to be processed before mapping @@ -1746,7 +1750,7 @@ MapFrame( * doesn't get a false idea of its desired geometry. */ - Tcl_Preserve((ClientData) framePtr); + Tcl_Preserve(framePtr); while (1) { if (Tcl_DoOneEvent(TCL_IDLE_EVENTS) == 0) { break; @@ -1758,12 +1762,12 @@ MapFrame( */ if (framePtr->tkwin == NULL) { - Tcl_Release((ClientData) framePtr); + Tcl_Release(framePtr); return; } } Tk_MapWindow(framePtr->tkwin); - Tcl_Release((ClientData) framePtr); + Tcl_Release(framePtr); } /* @@ -1792,8 +1796,8 @@ TkInstallFrameMenu( TkWindow *winPtr = (TkWindow *) tkwin; if (winPtr->mainPtr != NULL) { - Frame *framePtr; - framePtr = (Frame*) winPtr->instanceData; + Frame *framePtr = (Frame *) winPtr->instanceData; + if (framePtr == NULL) { Tcl_Panic("TkInstallFrameMenu couldn't get frame pointer"); } @@ -1825,7 +1829,7 @@ FrameStructureProc( ClientData clientData, /* Pointer to record describing frame. */ XEvent *eventPtr) /* Describes what just happened. */ { - Labelframe *labelframePtr = (Labelframe *) clientData; + Labelframe *labelframePtr = clientData; if (eventPtr->type == DestroyNotify) { /* @@ -1835,7 +1839,7 @@ FrameStructureProc( if (labelframePtr->frame.type == TYPE_LABELFRAME) { labelframePtr->labelWin = NULL; - FrameWorldChanged((ClientData) labelframePtr); + FrameWorldChanged(labelframePtr); } } } @@ -1863,9 +1867,9 @@ FrameRequestProc( ClientData clientData, /* Pointer to record for frame. */ Tk_Window tkwin) /* Window that changed its desired size. */ { - Frame *framePtr = (Frame *) clientData; + Frame *framePtr = clientData; - FrameWorldChanged((ClientData) framePtr); + FrameWorldChanged(framePtr); } /* @@ -1891,8 +1895,8 @@ FrameLostSlaveProc( * stolen away. */ Tk_Window tkwin) /* Tk's handle for the slave window. */ { - Frame *framePtr = (Frame *) clientData; - Labelframe *labelframePtr = (Labelframe *) clientData; + Frame *framePtr = clientData; + Labelframe *labelframePtr = clientData; /* * This should only happen in a labelframe but it doesn't hurt to be @@ -1901,14 +1905,14 @@ FrameLostSlaveProc( if (labelframePtr->frame.type == TYPE_LABELFRAME) { Tk_DeleteEventHandler(labelframePtr->labelWin, StructureNotifyMask, - FrameStructureProc, (ClientData) labelframePtr); + FrameStructureProc, labelframePtr); if (framePtr->tkwin != Tk_Parent(labelframePtr->labelWin)) { Tk_UnmaintainGeometry(labelframePtr->labelWin, framePtr->tkwin); } Tk_UnmapWindow(labelframePtr->labelWin); labelframePtr->labelWin = NULL; } - FrameWorldChanged((ClientData) framePtr); + FrameWorldChanged(framePtr); } void @@ -1917,24 +1921,31 @@ TkMapTopFrame (tkwin) { Frame *framePtr = ((TkWindow*)tkwin)->instanceData; Tk_OptionTable optionTable; + if (Tk_IsTopLevel(tkwin) && framePtr->type == TYPE_FRAME) { framePtr->type = TYPE_TOPLEVEL; - Tcl_DoWhenIdle(MapFrame, (ClientData)framePtr); + Tcl_DoWhenIdle(MapFrame, framePtr); if (framePtr->menuName != NULL) { TkSetWindowMenuBar(framePtr->interp, framePtr->tkwin, NULL, - framePtr->menuName); + framePtr->menuName); } } else if (!Tk_IsTopLevel(tkwin) && framePtr->type == TYPE_TOPLEVEL) { framePtr->type = TYPE_FRAME; } else { - /* Not a frame or toplevel, skip it */ + /* + * Not a frame or toplevel, skip it. + */ + return; } + /* - * The option table has already been created so - * the cached pointer will be returned. + * The option table has already been created so the cached pointer will be + * returned. */ - optionTable = Tk_CreateOptionTable(framePtr->interp, optionSpecs[framePtr->type]); + + optionTable = Tk_CreateOptionTable(framePtr->interp, + optionSpecs[framePtr->type]); framePtr->optionTable = optionTable; } @@ -1961,7 +1972,7 @@ TkMapTopFrame (tkwin) Tk_Window TkToplevelWindowForCommand( Tcl_Interp *interp, - CONST char *cmdName) + const char *cmdName) { Tcl_CmdInfo cmdInfo; Frame *framePtr; @@ -1972,7 +1983,7 @@ TkToplevelWindowForCommand( if (cmdInfo.objProc != FrameWidgetObjCmd) { return NULL; } - framePtr = (Frame *) cmdInfo.objClientData; + framePtr = cmdInfo.objClientData; if (framePtr->type != TYPE_TOPLEVEL) { return NULL; } diff --git a/generic/tkGeometry.c b/generic/tkGeometry.c index f6f5150..2bd9ea7 100644 --- a/generic/tkGeometry.c +++ b/generic/tkGeometry.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkGeometry.c,v 1.12 2007/12/13 15:24:14 dgp Exp $ + * RCS: @(#) $Id: tkGeometry.c,v 1.13 2008/04/27 22:38:56 dkf Exp $ */ #include "tkInt.h" @@ -86,7 +86,7 @@ void Tk_ManageGeometry( Tk_Window tkwin, /* Window whose geometry is to be managed by * proc. */ - CONST Tk_GeomMgr *mgrPtr, /* Static structure describing the geometry + const Tk_GeomMgr *mgrPtr, /* Static structure describing the geometry * manager. This structure must never go * away. */ ClientData clientData) /* Arbitrary one-word argument to pass to @@ -381,7 +381,7 @@ Tk_MaintainGeometry( hPtr = Tcl_CreateHashEntry(&dispPtr->maintainHashTable, (char *) master, &isNew); if (!isNew) { - masterPtr = (MaintainMaster *) Tcl_GetHashValue(hPtr); + masterPtr = Tcl_GetHashValue(hPtr); } else { masterPtr = (MaintainMaster *) ckalloc(sizeof(MaintainMaster)); masterPtr->ancestor = master; @@ -407,7 +407,7 @@ Tk_MaintainGeometry( slavePtr->nextPtr = masterPtr->slavePtr; masterPtr->slavePtr = slavePtr; Tk_CreateEventHandler(slave, StructureNotifyMask, MaintainSlaveProc, - (ClientData) slavePtr); + slavePtr); /* * Make sure that there are event handlers registered for all the windows @@ -420,7 +420,7 @@ Tk_MaintainGeometry( ancestor = Tk_Parent(ancestor)) { if (ancestor == masterPtr->ancestor) { Tk_CreateEventHandler(ancestor, StructureNotifyMask, - MaintainMasterProc, (ClientData) masterPtr); + MaintainMasterProc, masterPtr); masterPtr->ancestor = Tk_Parent(ancestor); } } @@ -511,7 +511,7 @@ Tk_UnmaintainGeometry( if (hPtr == NULL) { return; } - masterPtr = (MaintainMaster *) Tcl_GetHashValue(hPtr); + masterPtr = Tcl_GetHashValue(hPtr); slavePtr = masterPtr->slavePtr; if (slavePtr->slave == slave) { masterPtr->slavePtr = slavePtr->nextPtr; @@ -528,20 +528,20 @@ Tk_UnmaintainGeometry( } } Tk_DeleteEventHandler(slavePtr->slave, StructureNotifyMask, - MaintainSlaveProc, (ClientData) slavePtr); + MaintainSlaveProc, slavePtr); ckfree((char *) slavePtr); if (masterPtr->slavePtr == NULL) { if (masterPtr->ancestor != NULL) { for (ancestor = master; ; ancestor = Tk_Parent(ancestor)) { Tk_DeleteEventHandler(ancestor, StructureNotifyMask, - MaintainMasterProc, (ClientData) masterPtr); + MaintainMasterProc, masterPtr); if (ancestor == masterPtr->ancestor) { break; } } } if (masterPtr->checkScheduled) { - Tcl_CancelIdleCall(MaintainCheckProc, (ClientData) masterPtr); + Tcl_CancelIdleCall(MaintainCheckProc, masterPtr); } Tcl_DeleteHashEntry(hPtr); ckfree((char *) masterPtr); @@ -575,7 +575,7 @@ MaintainMasterProc( * master window. */ XEvent *eventPtr) /* Describes what just happened. */ { - MaintainMaster *masterPtr = (MaintainMaster *) clientData; + MaintainMaster *masterPtr = clientData; MaintainSlave *slavePtr; int done; @@ -584,7 +584,7 @@ MaintainMasterProc( || (eventPtr->type == UnmapNotify)) { if (!masterPtr->checkScheduled) { masterPtr->checkScheduled = 1; - Tcl_DoWhenIdle(MaintainCheckProc, (ClientData) masterPtr); + Tcl_DoWhenIdle(MaintainCheckProc, masterPtr); } } else if (eventPtr->type == DestroyNotify) { /* @@ -629,7 +629,7 @@ MaintainSlaveProc( * master-slave pair. */ XEvent *eventPtr) /* Describes what just happened. */ { - MaintainSlave *slavePtr = (MaintainSlave *) clientData; + MaintainSlave *slavePtr = clientData; if (eventPtr->type == DestroyNotify) { Tk_UnmaintainGeometry(slavePtr->slave, slavePtr->master); @@ -661,7 +661,7 @@ MaintainCheckProc( ClientData clientData) /* Pointer to MaintainMaster structure for the * master window. */ { - MaintainMaster *masterPtr = (MaintainMaster *) clientData; + MaintainMaster *masterPtr = clientData; MaintainSlave *slavePtr; Tk_Window ancestor, parent; int x, y, map; diff --git a/generic/tkGet.c b/generic/tkGet.c index e6b19e2..807f9c2 100644 --- a/generic/tkGet.c +++ b/generic/tkGet.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkGet.c,v 1.13 2007/12/13 15:24:14 dgp Exp $ + * RCS: @(#) $Id: tkGet.c,v 1.14 2008/04/27 22:38:56 dkf Exp $ */ #include "tkInt.h" @@ -37,10 +37,10 @@ static void FreeUidThreadExitProc(ClientData clientData); * used by Tk_GetAnchorFromObj and Tk_GetJustifyFromObj. */ -static CONST char *anchorStrings[] = { +static const char *anchorStrings[] = { "n", "ne", "e", "se", "s", "sw", "w", "nw", "center", NULL }; -static CONST char *justifyStrings[] = { +static const char *justifyStrings[] = { "left", "right", "center", NULL }; @@ -103,7 +103,7 @@ Tk_GetAnchorFromObj( int Tk_GetAnchor( Tcl_Interp *interp, /* Use this for error reporting. */ - CONST char *string, /* String describing a direction. */ + const char *string, /* String describing a direction. */ Tk_Anchor *anchorPtr) /* Where to store Tk_Anchor corresponding to * string. */ { @@ -175,7 +175,7 @@ Tk_GetAnchor( *-------------------------------------------------------------- */ -CONST char * +const char * Tk_NameOfAnchor( Tk_Anchor anchor) /* Anchor for which identifying string is * desired. */ @@ -216,7 +216,7 @@ Tk_NameOfAnchor( int Tk_GetJoinStyle( Tcl_Interp *interp, /* Use this for error reporting. */ - CONST char *string, /* String describing a justification style. */ + const char *string, /* String describing a justification style. */ int *joinPtr) /* Where to store join style corresponding to * string. */ { @@ -260,7 +260,7 @@ Tk_GetJoinStyle( *-------------------------------------------------------------- */ -CONST char * +const char * Tk_NameOfJoinStyle( int join) /* Join style for which identifying string is * desired. */ @@ -295,7 +295,7 @@ Tk_NameOfJoinStyle( int Tk_GetCapStyle( Tcl_Interp *interp, /* Use this for error reporting. */ - CONST char *string, /* String describing a justification style. */ + const char *string, /* String describing a justification style. */ int *capPtr) /* Where to store cap style corresponding to * string. */ { @@ -339,7 +339,7 @@ Tk_GetCapStyle( *-------------------------------------------------------------- */ -CONST char * +const char * Tk_NameOfCapStyle( int cap) /* Cap style for which identifying string is * desired. */ @@ -411,7 +411,7 @@ Tk_GetJustifyFromObj( int Tk_GetJustify( Tcl_Interp *interp, /* Use this for error reporting. */ - CONST char *string, /* String describing a justification style. */ + const char *string, /* String describing a justification style. */ Tk_Justify *justifyPtr) /* Where to store Tk_Justify corresponding to * string. */ { @@ -456,7 +456,7 @@ Tk_GetJustify( *-------------------------------------------------------------- */ -CONST char * +const char * Tk_NameOfJustify( Tk_Justify justify) /* Justification style for which identifying * string is desired. */ @@ -491,6 +491,7 @@ FreeUidThreadExitProc( { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + Tcl_DeleteHashTable(&tsdPtr->uidTable); tsdPtr->initialized = 0; } @@ -519,7 +520,7 @@ FreeUidThreadExitProc( Tk_Uid Tk_GetUid( - CONST char *string) /* String to convert. */ + const char *string) /* String to convert. */ { int dummy; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) @@ -561,7 +562,7 @@ Tk_GetScreenMM( Tk_Window tkwin, /* Window whose screen determines conversion * from centimeters and other absolute * units. */ - CONST char *string, /* String describing a screen distance. */ + const char *string, /* String describing a screen distance. */ double *doublePtr) /* Place to store converted result. */ { char *end; @@ -635,7 +636,7 @@ Tk_GetPixels( Tk_Window tkwin, /* Window whose screen determines conversion * from centimeters and other absolute * units. */ - CONST char *string, /* String describing a number of pixels. */ + const char *string, /* String describing a number of pixels. */ int *intPtr) /* Place to store converted result. */ { double d; @@ -660,7 +661,6 @@ Tk_GetPixels( * string. * * Results: - * The return value is a standard Tcl return result. If TCL_OK is * returned, then everything went well and the pixel distance is stored * at *doublePtr; otherwise TCL_ERROR is returned and an error message is @@ -678,7 +678,7 @@ TkGetDoublePixels( Tk_Window tkwin, /* Window whose screen determines conversion * from centimeters and other absolute * units. */ - CONST char *string, /* String describing a number of pixels. */ + const char *string, /* String describing a number of pixels. */ double *doublePtr) /* Place to store converted result. */ { char *end; diff --git a/generic/tkGrab.c b/generic/tkGrab.c index 1369f7c..17e5289 100644 --- a/generic/tkGrab.c +++ b/generic/tkGrab.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkGrab.c,v 1.13 2007/12/13 15:24:14 dgp Exp $ + * RCS: @(#) $Id: tkGrab.c,v 1.14 2008/04/27 22:38:56 dkf Exp $ */ #include "tkInt.h" @@ -183,7 +183,7 @@ Tk_GrabObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { int globalGrab; Tk_Window tkwin; @@ -191,10 +191,10 @@ Tk_GrabObjCmd( char *arg; int index; int len; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "current", "release", "set", "status", NULL }; - static CONST char *flagStrings[] = { + static const char *flagStrings[] = { "-global", NULL }; enum options { @@ -229,7 +229,7 @@ Tk_GrabObjCmd( Tcl_WrongNumArgs(interp, 1, objv, "?-global? window"); return TCL_ERROR; } - tkwin = Tk_NameToWindow(interp, arg, (Tk_Window) clientData); + tkwin = Tk_NameToWindow(interp, arg, clientData); if (tkwin == NULL) { return TCL_ERROR; } @@ -245,8 +245,7 @@ Tk_GrabObjCmd( Tcl_WrongNumArgs(interp, 1, objv, "?-global? window"); return TCL_ERROR; } - tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[2]), - (Tk_Window) clientData); + tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[2]), clientData); if (tkwin == NULL) { return TCL_ERROR; } @@ -272,7 +271,7 @@ Tk_GrabObjCmd( } if (objc == 3) { tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[2]), - (Tk_Window) clientData); + clientData); if (tkwin == NULL) { return TCL_ERROR; } @@ -298,8 +297,7 @@ Tk_GrabObjCmd( Tcl_WrongNumArgs(interp, 1, objv, "release window"); return TCL_ERROR; } - tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[2]), - (Tk_Window) clientData); + tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[2]), clientData); if (tkwin == NULL) { Tcl_ResetResult(interp); } else { @@ -316,7 +314,7 @@ Tk_GrabObjCmd( if (objc == 3) { globalGrab = 0; tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[2]), - (Tk_Window) clientData); + clientData); } else { globalGrab = 1; @@ -332,7 +330,7 @@ Tk_GrabObjCmd( return TCL_ERROR; } tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[3]), - (Tk_Window) clientData); + clientData); } if (tkwin == NULL) { return TCL_ERROR; @@ -348,7 +346,7 @@ Tk_GrabObjCmd( return TCL_ERROR; } winPtr = (TkWindow *) Tk_NameToWindow(interp, Tcl_GetString(objv[2]), - (Tk_Window) clientData); + clientData); if (winPtr == NULL) { return TCL_ERROR; } @@ -1246,8 +1244,9 @@ EatGrabEvents( info.display = dispPtr->display; info.serial = serial; TkpSync(info.display); - oldProc = Tk_RestrictEvents(GrabRestrictProc, (ClientData)&info, &oldArg); + oldProc = Tk_RestrictEvents(GrabRestrictProc, &info, &oldArg); while (Tcl_ServiceEvent(TCL_WINDOW_EVENTS)) { + /* EMPTY */ } Tk_RestrictEvents(oldProc, oldArg, &dummy); } @@ -1276,7 +1275,7 @@ GrabRestrictProc( ClientData arg, XEvent *eventPtr) { - GrabInfo *info = (GrabInfo *) arg; + GrabInfo *info = arg; int mode, diff; /* diff --git a/generic/tkGrid.c b/generic/tkGrid.c index 29848a8..1400030 100644 --- a/generic/tkGrid.c +++ b/generic/tkGrid.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkGrid.c,v 1.47 2007/05/15 17:01:43 dgp Exp $ + * RCS: @(#) $Id: tkGrid.c,v 1.48 2008/04/27 22:38:56 dkf Exp $ */ #include "tkInt.h" @@ -259,31 +259,31 @@ static void ArrangeGrid(ClientData clientData); static int CheckSlotData(Gridder *masterPtr, int slot, int slotType, int checkOnly); static int ConfigureSlaves(Tcl_Interp *interp, Tk_Window tkwin, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static void DestroyGrid(char *memPtr); static Gridder * GetGrid(Tk_Window tkwin); static int GridAnchorCommand(Tk_Window tkwin, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static int GridBboxCommand(Tk_Window tkwin, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static int GridForgetRemoveCommand(Tk_Window tkwin, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int GridInfoCommand(Tk_Window tkwin, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static int GridLocationCommand(Tk_Window tkwin, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int GridPropagateCommand(Tk_Window tkwin, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int GridRowColumnConfigureCommand(Tk_Window tkwin, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int GridSizeCommand(Tk_Window tkwin, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static int GridSlavesCommand(Tk_Window tkwin, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static void GridStructureProc(ClientData clientData, XEvent *eventPtr); static void GridLostSlaveProc(ClientData clientData, @@ -331,10 +331,10 @@ Tk_GridObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { - Tk_Window tkwin = (Tk_Window) clientData; - static CONST char *optionStrings[] = { + Tk_Window tkwin = clientData; + static const char *optionStrings[] = { "anchor", "bbox", "columnconfigure", "configure", "forget", "info", "location", "propagate", "remove", "rowconfigure", "size", "slaves", NULL @@ -426,7 +426,7 @@ GridAnchorCommand( Tk_Window tkwin, /* Main window of the application. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window master; Gridder *masterPtr; @@ -467,7 +467,7 @@ GridAnchorCommand( } if (!(masterPtr->flags & REQUESTED_RELAYOUT)) { masterPtr->flags |= REQUESTED_RELAYOUT; - Tcl_DoWhenIdle(ArrangeGrid, (ClientData) masterPtr); + Tcl_DoWhenIdle(ArrangeGrid, masterPtr); } } return TCL_OK; @@ -494,7 +494,7 @@ GridBboxCommand( Tk_Window tkwin, /* Main window of the application. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window master; Gridder *masterPtr; /* master grid record */ @@ -624,7 +624,7 @@ GridForgetRemoveCommand( Tk_Window tkwin, /* Main window of the application. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window slave; Gridder *slavePtr; @@ -656,7 +656,7 @@ GridForgetRemoveCommand( slavePtr->iPadY = 0; slavePtr->doubleBw = 2*Tk_Changes(tkwin)->border_width; if (slavePtr->flags & REQUESTED_RELAYOUT) { - Tcl_CancelIdleCall(ArrangeGrid, (ClientData) slavePtr); + Tcl_CancelIdleCall(ArrangeGrid, slavePtr); } slavePtr->flags = 0; slavePtr->sticky = 0; @@ -695,7 +695,7 @@ GridInfoCommand( Tk_Window tkwin, /* Main window of the application. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register Gridder *slavePtr; Tk_Window slave; @@ -751,7 +751,7 @@ GridLocationCommand( Tk_Window tkwin, /* Main window of the application. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window master; Gridder *masterPtr; /* Master grid record. */ @@ -791,8 +791,8 @@ GridLocationCommand( */ while (masterPtr->flags & REQUESTED_RELAYOUT) { - Tcl_CancelIdleCall(ArrangeGrid, (ClientData) masterPtr); - ArrangeGrid((ClientData) masterPtr); + Tcl_CancelIdleCall(ArrangeGrid, masterPtr); + ArrangeGrid(masterPtr); } SetGridSize(masterPtr); endX = MAX(gridPtr->columnEnd, gridPtr->columnMax); @@ -844,7 +844,7 @@ GridPropagateCommand( Tk_Window tkwin, /* Main window of the application. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window master; Gridder *masterPtr; @@ -890,7 +890,7 @@ GridPropagateCommand( } if (!(masterPtr->flags & REQUESTED_RELAYOUT)) { masterPtr->flags |= REQUESTED_RELAYOUT; - Tcl_DoWhenIdle(ArrangeGrid, (ClientData) masterPtr); + Tcl_DoWhenIdle(ArrangeGrid, masterPtr); } } return TCL_OK; @@ -918,7 +918,7 @@ GridRowColumnConfigureCommand( Tk_Window tkwin, /* Main window of the application. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window master, slave; Gridder *masterPtr, *slavePtr; @@ -931,7 +931,7 @@ GridRowColumnConfigureCommand( int ok; /* temporary TCL result code */ int i, j, first, last; char *string; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "-minsize", "-pad", "-uniform", "-weight", NULL }; enum options { @@ -1117,7 +1117,7 @@ GridRowColumnConfigureCommand( Tcl_GetString(objv[1]), ": \"", Tcl_GetString(lObjv[j]), "\" is out of range", NULL); - Tcl_DecrRefCount(listCopy); + Tcl_DecrRefCount(listCopy); return TCL_ERROR; } slotPtr = (slotType == COLUMN) ? @@ -1132,13 +1132,13 @@ GridRowColumnConfigureCommand( for (i = 4; i < objc; i += 2) { if (Tcl_GetIndexFromObj(interp, objv[i], optionStrings, "option", 0, &index) != TCL_OK) { - Tcl_DecrRefCount(listCopy); + Tcl_DecrRefCount(listCopy); return TCL_ERROR; } if (index == ROWCOL_MINSIZE) { if (Tk_GetPixelsFromObj(interp, master, objv[i+1], &size) != TCL_OK) { - Tcl_DecrRefCount(listCopy); + Tcl_DecrRefCount(listCopy); return TCL_ERROR; } else { slotPtr[slot].minSize = size; @@ -1147,13 +1147,13 @@ GridRowColumnConfigureCommand( int wt; if (Tcl_GetIntFromObj(interp,objv[i+1],&wt)!=TCL_OK) { - Tcl_DecrRefCount(listCopy); + Tcl_DecrRefCount(listCopy); return TCL_ERROR; } else if (wt < 0) { Tcl_AppendResult(interp, "invalid arg \"", Tcl_GetString(objv[i]), "\": should be non-negative", NULL); - Tcl_DecrRefCount(listCopy); + Tcl_DecrRefCount(listCopy); return TCL_ERROR; } else { slotPtr[slot].weight = wt; @@ -1168,13 +1168,13 @@ GridRowColumnConfigureCommand( } else if (index == ROWCOL_PAD) { if (Tk_GetPixelsFromObj(interp, master, objv[i+1], &size) != TCL_OK) { - Tcl_DecrRefCount(listCopy); + Tcl_DecrRefCount(listCopy); return TCL_ERROR; } else if (size < 0) { Tcl_AppendResult(interp, "invalid arg \"", Tcl_GetString(objv[i]), "\": should be non-negative", NULL); - Tcl_DecrRefCount(listCopy); + Tcl_DecrRefCount(listCopy); return TCL_ERROR; } else { slotPtr[slot].pad = size; @@ -1221,7 +1221,7 @@ GridRowColumnConfigureCommand( } if (!(masterPtr->flags & REQUESTED_RELAYOUT)) { masterPtr->flags |= REQUESTED_RELAYOUT; - Tcl_DoWhenIdle(ArrangeGrid, (ClientData) masterPtr); + Tcl_DoWhenIdle(ArrangeGrid, masterPtr); } return TCL_OK; } @@ -1248,7 +1248,7 @@ GridSizeCommand( Tk_Window tkwin, /* Main window of the application. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window master; Gridder *masterPtr; @@ -1299,14 +1299,14 @@ GridSlavesCommand( Tk_Window tkwin, /* Main window of the application. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window master; Gridder *masterPtr; /* master grid record */ Gridder *slavePtr; int i, value, index; int row = -1, column = -1; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "-column", "-row", NULL }; enum options { SLAVES_COLUMN, SLAVES_ROW }; @@ -1385,12 +1385,12 @@ GridReqProc( Tk_Window tkwin) /* Other Tk-related information about the * window. */ { - register Gridder *gridPtr = (Gridder *) clientData; + register Gridder *gridPtr = clientData; gridPtr = gridPtr->masterPtr; if (gridPtr && !(gridPtr->flags & REQUESTED_RELAYOUT)) { gridPtr->flags |= REQUESTED_RELAYOUT; - Tcl_DoWhenIdle(ArrangeGrid, (ClientData) gridPtr); + Tcl_DoWhenIdle(ArrangeGrid, gridPtr); } } @@ -1417,7 +1417,7 @@ GridLostSlaveProc( * stolen away. */ Tk_Window tkwin) /* Tk's handle for the slave window. */ { - register Gridder *slavePtr = (Gridder *) clientData; + register Gridder *slavePtr = clientData; if (slavePtr->masterPtr->tkwin != Tk_Parent(slavePtr->tkwin)) { Tk_UnmaintainGeometry(slavePtr->tkwin, slavePtr->masterPtr->tkwin); @@ -1675,7 +1675,7 @@ ArrangeGrid( ClientData clientData) /* Structure describing master whose slaves * are to be re-layed out. */ { - register Gridder *masterPtr = (Gridder *) clientData; + register Gridder *masterPtr = clientData; register Gridder *slavePtr; GridMaster *slotPtr = masterPtr->masterDataPtr; int abort; @@ -1711,7 +1711,7 @@ ArrangeGrid( } masterPtr->abortPtr = &abort; abort = 0; - Tcl_Preserve((ClientData) masterPtr); + Tcl_Preserve(masterPtr); /* * Call the constraint engine to fill in the row and column offsets. @@ -1738,10 +1738,10 @@ ArrangeGrid( Tk_GeometryRequest(masterPtr->tkwin, width, height); if (width>1 && height>1) { masterPtr->flags |= REQUESTED_RELAYOUT; - Tcl_DoWhenIdle(ArrangeGrid, (ClientData) masterPtr); + Tcl_DoWhenIdle(ArrangeGrid, masterPtr); } masterPtr->abortPtr = NULL; - Tcl_Release((ClientData) masterPtr); + Tcl_Release(masterPtr); return; } @@ -1827,7 +1827,7 @@ ArrangeGrid( } masterPtr->abortPtr = NULL; - Tcl_Release((ClientData) masterPtr); + Tcl_Release(masterPtr); } /* @@ -2415,7 +2415,7 @@ GetGrid( gridPtr->padTop = 0; gridPtr->iPadX = 0; gridPtr->iPadY = 0; - gridPtr->doubleBw = 2*Tk_Changes(tkwin)->border_width; + gridPtr->doubleBw = 2 * Tk_Changes(tkwin)->border_width; gridPtr->abortPtr = NULL; gridPtr->flags = 0; gridPtr->sticky = 0; @@ -2423,7 +2423,7 @@ GetGrid( gridPtr->masterDataPtr = NULL; Tcl_SetHashValue(hPtr, gridPtr); Tk_CreateEventHandler(tkwin, StructureNotifyMask, - GridStructureProc, (ClientData) gridPtr); + GridStructureProc, gridPtr); return gridPtr; } @@ -2717,7 +2717,7 @@ Unlink( } if (!(masterPtr->flags & REQUESTED_RELAYOUT)) { masterPtr->flags |= REQUESTED_RELAYOUT; - Tcl_DoWhenIdle(ArrangeGrid, (ClientData) masterPtr); + Tcl_DoWhenIdle(ArrangeGrid, masterPtr); } if (masterPtr->abortPtr != NULL) { *masterPtr->abortPtr = 1; @@ -2789,21 +2789,21 @@ GridStructureProc( * eventPtr. */ XEvent *eventPtr) /* Describes what just happened. */ { - register Gridder *gridPtr = (Gridder *) clientData; + register Gridder *gridPtr = clientData; TkDisplay *dispPtr = ((TkWindow *) gridPtr->tkwin)->dispPtr; if (eventPtr->type == ConfigureNotify) { if ((gridPtr->slavePtr != NULL) && !(gridPtr->flags & REQUESTED_RELAYOUT)) { gridPtr->flags |= REQUESTED_RELAYOUT; - Tcl_DoWhenIdle(ArrangeGrid, (ClientData) gridPtr); + Tcl_DoWhenIdle(ArrangeGrid, gridPtr); } if ((gridPtr->masterPtr != NULL) && (gridPtr->doubleBw != 2*Tk_Changes(gridPtr->tkwin)->border_width)) { if (!(gridPtr->masterPtr->flags & REQUESTED_RELAYOUT)) { gridPtr->doubleBw = 2*Tk_Changes(gridPtr->tkwin)->border_width; gridPtr->masterPtr->flags |= REQUESTED_RELAYOUT; - Tcl_DoWhenIdle(ArrangeGrid, (ClientData) gridPtr->masterPtr); + Tcl_DoWhenIdle(ArrangeGrid, gridPtr->masterPtr); } } } else if (eventPtr->type == DestroyNotify) { @@ -2822,15 +2822,15 @@ GridStructureProc( Tcl_DeleteHashEntry(Tcl_FindHashEntry(&dispPtr->gridHashTable, (char *) gridPtr->tkwin)); if (gridPtr->flags & REQUESTED_RELAYOUT) { - Tcl_CancelIdleCall(ArrangeGrid, (ClientData) gridPtr); + Tcl_CancelIdleCall(ArrangeGrid, gridPtr); } gridPtr->tkwin = NULL; - Tcl_EventuallyFree((ClientData) gridPtr, DestroyGrid); + Tcl_EventuallyFree(gridPtr, DestroyGrid); } else if (eventPtr->type == MapNotify) { if ((gridPtr->slavePtr != NULL) && !(gridPtr->flags & REQUESTED_RELAYOUT)) { gridPtr->flags |= REQUESTED_RELAYOUT; - Tcl_DoWhenIdle(ArrangeGrid, (ClientData) gridPtr); + Tcl_DoWhenIdle(ArrangeGrid, gridPtr); } } else if (eventPtr->type == UnmapNotify) { register Gridder *gridPtr2; @@ -2868,7 +2868,7 @@ ConfigureSlaves( Tk_Window tkwin, /* Any window in application containing * slaves. Used to look up slave names. */ int objc, /* Number of elements in argv. */ - Tcl_Obj *CONST objv[]) /* Argument objects: contains one or more + Tcl_Obj *const objv[]) /* Argument objects: contains one or more * window names followed by any number of * "option value" pairs. Caller must make sure * that there is at least one window name. */ @@ -2885,7 +2885,7 @@ ConfigureSlaves( char *lastWindow; /* Use this window to base current row/col * on */ int numSkip; /* Number of 'x' found */ - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "-column", "-columnspan", "-in", "-ipadx", "-ipady", "-padx", "-pady", "-row", "-rowspan", "-sticky", NULL }; @@ -3136,7 +3136,7 @@ ConfigureSlaves( "positive screen distance", NULL); return TCL_ERROR; } - slavePtr->iPadX = tmp*2; + slavePtr->iPadX = tmp * 2; break; case CONF_IPADY: if ((Tk_GetPixelsFromObj(NULL, slave, objv[i+1], @@ -3146,7 +3146,7 @@ ConfigureSlaves( "positive screen distance", NULL); return TCL_ERROR; } - slavePtr->iPadY = tmp*2; + slavePtr->iPadY = tmp * 2; break; case CONF_PADX: if (TkParsePadAmount(interp, tkwin, objv[i+1], @@ -3261,7 +3261,7 @@ ConfigureSlaves( return TCL_ERROR; } - Tk_ManageGeometry(slave, &gridMgrType, (ClientData) slavePtr); + Tk_ManageGeometry(slave, &gridMgrType, slavePtr); /* * Assign default position information. @@ -3294,7 +3294,7 @@ ConfigureSlaves( } if (!(masterPtr->flags & REQUESTED_RELAYOUT)) { masterPtr->flags |= REQUESTED_RELAYOUT; - Tcl_DoWhenIdle(ArrangeGrid, (ClientData) masterPtr); + Tcl_DoWhenIdle(ArrangeGrid, masterPtr); } } diff --git a/generic/tkImage.c b/generic/tkImage.c index 4dd3010..f0f914d 100644 --- a/generic/tkImage.c +++ b/generic/tkImage.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkImage.c,v 1.35 2007/12/13 15:24:14 dgp Exp $ + * RCS: @(#) $Id: tkImage.c,v 1.36 2008/04/27 22:38:56 dkf Exp $ */ #include "tkInt.h" @@ -154,9 +154,9 @@ Tk_ImageObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument strings. */ + Tcl_Obj *const objv[]) /* Argument strings. */ { - static CONST char *imageOptions[] = { + static const char *imageOptions[] = { "create", "delete", "height", "inuse", "names", "type", "types", "width", NULL }; @@ -164,7 +164,7 @@ Tk_ImageObjCmd( IMAGE_CREATE, IMAGE_DELETE, IMAGE_HEIGHT, IMAGE_INUSE, IMAGE_NAMES, IMAGE_TYPE, IMAGE_TYPES, IMAGE_WIDTH }; - TkWindow *winPtr = (TkWindow *) clientData; + TkWindow *winPtr = clientData; int i, isNew, firstOption, index; Tk_ImageType *typePtr; ImageMaster *masterPtr; @@ -271,7 +271,7 @@ Tk_ImageObjCmd( masterPtr->instancePtr = NULL; masterPtr->deleted = 0; masterPtr->winPtr = winPtr->mainPtr->winPtr; - Tcl_Preserve((ClientData) masterPtr->winPtr); + Tcl_Preserve(masterPtr->winPtr); Tcl_SetHashValue(hPtr, masterPtr); } else { /* @@ -279,7 +279,7 @@ Tk_ImageObjCmd( * from the master. */ - masterPtr = (ImageMaster *) Tcl_GetHashValue(hPtr); + masterPtr = Tcl_GetHashValue(hPtr); if (masterPtr->typePtr != NULL) { for (imagePtr = masterPtr->instancePtr; imagePtr != NULL; imagePtr = imagePtr->nextPtr) { @@ -313,17 +313,17 @@ Tk_ImageObjCmd( } args[objc] = NULL; } - Tcl_Preserve((ClientData) masterPtr); + Tcl_Preserve(masterPtr); if ((*typePtr->createProc)(interp, name, objc, args, typePtr, (Tk_ImageMaster)masterPtr, &masterPtr->masterData) != TCL_OK) { EventuallyDeleteImage(masterPtr, 0); - Tcl_Release((ClientData) masterPtr); + Tcl_Release(masterPtr); if (oldimage) { ckfree((char *) args); } return TCL_ERROR; } - Tcl_Release((ClientData) masterPtr); + Tcl_Release(masterPtr); if (oldimage) { ckfree((char *) args); } @@ -345,7 +345,7 @@ Tk_ImageObjCmd( if (hPtr == NULL) { goto alreadyDeleted; } - masterPtr = (ImageMaster *) Tcl_GetHashValue(hPtr); + masterPtr = Tcl_GetHashValue(hPtr); if (masterPtr->deleted) { goto alreadyDeleted; } @@ -359,7 +359,7 @@ Tk_ImageObjCmd( } hPtr = Tcl_FirstHashEntry(&winPtr->mainPtr->imageTable, &search); for ( ; hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) { - masterPtr = (ImageMaster *) Tcl_GetHashValue(hPtr); + masterPtr = Tcl_GetHashValue(hPtr); if (masterPtr->deleted) { continue; } @@ -402,7 +402,7 @@ Tk_ImageObjCmd( if (hPtr == NULL) { goto alreadyDeleted; } - masterPtr = (ImageMaster *) Tcl_GetHashValue(hPtr); + masterPtr = Tcl_GetHashValue(hPtr); if (masterPtr->deleted) { goto alreadyDeleted; } @@ -500,7 +500,7 @@ Tk_ImageChanged( *---------------------------------------------------------------------- */ -CONST char * +const char * Tk_NameOfImage( Tk_ImageMaster imageMaster) /* Token for image. */ { @@ -540,7 +540,7 @@ Tk_GetImage( * be found. */ Tk_Window tkwin, /* Token for window in which image will be * used. */ - CONST char *name, /* Name of desired image. */ + const char *name, /* Name of desired image. */ Tk_ImageChangedProc *changeProc, /* Function to invoke when redisplay is needed * because image's pixels or size changed. */ @@ -554,7 +554,7 @@ Tk_GetImage( if (hPtr == NULL) { goto noSuchImage; } - masterPtr = (ImageMaster *) Tcl_GetHashValue(hPtr); + masterPtr = Tcl_GetHashValue(hPtr); if (masterPtr->typePtr == NULL) { goto noSuchImage; } @@ -635,7 +635,7 @@ Tk_FreeImage( if (masterPtr->hPtr != NULL) { Tcl_DeleteHashEntry(masterPtr->hPtr); } - Tcl_Release((ClientData) masterPtr->winPtr); + Tcl_Release(masterPtr->winPtr); ckfree((char *) masterPtr); } } @@ -855,7 +855,7 @@ void Tk_DeleteImage( Tcl_Interp *interp, /* Interpreter in which the image was * created. */ - CONST char *name) /* Name of image. */ + const char *name) /* Name of image. */ { Tcl_HashEntry *hPtr; TkWindow *winPtr; @@ -868,7 +868,7 @@ Tk_DeleteImage( if (hPtr == NULL) { return; } - DeleteImage((ImageMaster *)Tcl_GetHashValue(hPtr)); + DeleteImage(Tcl_GetHashValue(hPtr)); } /* @@ -913,7 +913,7 @@ DeleteImage( if (masterPtr->hPtr != NULL) { Tcl_DeleteHashEntry(masterPtr->hPtr); } - Tcl_Release((ClientData) masterPtr->winPtr); + Tcl_Release(masterPtr->winPtr); ckfree((char *) masterPtr); } else { masterPtr->deleted = 1; @@ -949,8 +949,7 @@ EventuallyDeleteImage( } if (!masterPtr->deleted) { masterPtr->deleted = 1; - Tcl_EventuallyFree((ClientData) masterPtr, - (Tcl_FreeProc *)DeleteImage); + Tcl_EventuallyFree(masterPtr, (Tcl_FreeProc *) DeleteImage); } } @@ -982,7 +981,7 @@ TkDeleteAllImages( for (hPtr = Tcl_FirstHashEntry(&mainPtr->imageTable, &search); hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) { - EventuallyDeleteImage((ImageMaster *) Tcl_GetHashValue(hPtr), 1); + EventuallyDeleteImage(Tcl_GetHashValue(hPtr), 1); } Tcl_DeleteHashTable(&mainPtr->imageTable); } @@ -1011,7 +1010,7 @@ ClientData Tk_GetImageMasterData( Tcl_Interp *interp, /* Interpreter in which the image was * created. */ - CONST char *name, /* Name of image. */ + const char *name, /* Name of image. */ Tk_ImageType **typePtrPtr) /* Points to location to fill in with pointer * to type information for image. */ { @@ -1025,7 +1024,7 @@ Tk_GetImageMasterData( *typePtrPtr = NULL; return NULL; } - masterPtr = (ImageMaster *) Tcl_GetHashValue(hPtr); + masterPtr = Tcl_GetHashValue(hPtr); if (masterPtr->deleted) { *typePtrPtr = NULL; return NULL; diff --git a/generic/tkImgBmap.c b/generic/tkImgBmap.c index fc051d9..324ccc4 100644 --- a/generic/tkImgBmap.c +++ b/generic/tkImgBmap.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkImgBmap.c,v 1.22 2007/12/13 15:24:14 dgp Exp $ + * RCS: @(#) $Id: tkImgBmap.c,v 1.23 2008/04/27 22:38:56 dkf Exp $ */ #include "tkInt.h" @@ -77,7 +77,7 @@ typedef struct BitmapInstance { static int GetByte(Tcl_Channel chan); static int ImgBmapCreate(Tcl_Interp *interp, - char *name, int argc, Tcl_Obj *CONST objv[], + char *name, int argc, Tcl_Obj *const objv[], Tk_ImageType *typePtr, Tk_ImageMaster master, ClientData *clientDataPtr); static ClientData ImgBmapGet(Tk_Window tkwin, ClientData clientData); @@ -147,11 +147,11 @@ typedef struct ParseInfo { */ static int ImgBmapCmd(ClientData clientData, Tcl_Interp *interp, - int argc, Tcl_Obj *CONST objv[]); + int argc, Tcl_Obj *const objv[]); static void ImgBmapCmdDeletedProc(ClientData clientData); static void ImgBmapConfigureInstance(BitmapInstance *instancePtr); static int ImgBmapConfigureMaster(BitmapMaster *masterPtr, - int argc, Tcl_Obj *CONST objv[], int flags); + int argc, Tcl_Obj *const objv[], int flags); static int NextBitmapWord(ParseInfo *parseInfoPtr); /* @@ -177,7 +177,7 @@ ImgBmapCreate( * image. */ char *name, /* Name to use for image. */ int argc, /* Number of arguments. */ - Tcl_Obj *CONST argv[], /* Argument objects for options (doesn't + Tcl_Obj *const argv[], /* Argument objects for options (doesn't * include image name or type). */ Tk_ImageType *typePtr, /* Pointer to our type record (not used). */ Tk_ImageMaster master, /* Token for image, to be used by us in later @@ -191,7 +191,7 @@ ImgBmapCreate( masterPtr->tkMaster = master; masterPtr->interp = interp; masterPtr->imageCmd = Tcl_CreateObjCommand(interp, name, ImgBmapCmd, - (ClientData) masterPtr, ImgBmapCmdDeletedProc); + masterPtr, ImgBmapCmdDeletedProc); masterPtr->width = masterPtr->height = 0; masterPtr->data = NULL; masterPtr->maskData = NULL; @@ -203,10 +203,10 @@ ImgBmapCreate( masterPtr->maskDataString = NULL; masterPtr->instancePtr = NULL; if (ImgBmapConfigureMaster(masterPtr, argc, argv, 0) != TCL_OK) { - ImgBmapDelete((ClientData) masterPtr); + ImgBmapDelete(masterPtr); return TCL_ERROR; } - *clientDataPtr = (ClientData) masterPtr; + *clientDataPtr = masterPtr; return TCL_OK; } @@ -235,22 +235,21 @@ ImgBmapConfigureMaster( BitmapMaster *masterPtr, /* Pointer to data structure describing * overall bitmap image to (reconfigure). */ int objc, /* Number of entries in objv. */ - Tcl_Obj *CONST objv[], /* Pairs of configuration options for image. */ + Tcl_Obj *const objv[], /* Pairs of configuration options for image. */ int flags) /* Flags to pass to Tk_ConfigureWidget, such * as TK_CONFIG_ARGV_ONLY. */ { BitmapInstance *instancePtr; int maskWidth, maskHeight, dummy1, dummy2; - CONST char **argv = (CONST char **) ckalloc((objc+1) * sizeof(char *)); + const char **argv = (const char **) ckalloc((objc+1) * sizeof(char *)); for (dummy1 = 0; dummy1 < objc; dummy1++) { argv[dummy1]=Tcl_GetString(objv[dummy1]); } argv[objc] = NULL; if (Tk_ConfigureWidget(masterPtr->interp, Tk_MainWindow(masterPtr->interp), - configSpecs, objc, argv, (char *) masterPtr, flags) - != TCL_OK) { + configSpecs, objc, argv, (char *) masterPtr, flags) != TCL_OK) { ckfree((char *) argv); return TCL_ERROR; } @@ -484,7 +483,7 @@ TkGetBitmapData( int *hotXPtr, int *hotYPtr) /* Position of hot spot or -1,-1. */ { int width, height, numBytes, hotX, hotY; - CONST char *expandedFileName; + const char *expandedFileName; char *p, *end; ParseInfo pi; char *data = NULL; @@ -613,7 +612,7 @@ TkGetBitmapData( goto error; } numBytes = ((width+7)/8) * height; - data = (char *) ckalloc((unsigned) numBytes); + data = ckalloc((unsigned) numBytes); for (p = data; numBytes > 0; p++, numBytes--) { if (NextBitmapWord(&pi) != TCL_OK) { goto error; @@ -744,10 +743,10 @@ ImgBmapCmd( ClientData clientData, /* Information about the image master. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { - static CONST char *bmapOptions[] = {"cget", "configure", NULL}; - BitmapMaster *masterPtr = (BitmapMaster *) clientData; + static const char *bmapOptions[] = {"cget", "configure", NULL}; + BitmapMaster *masterPtr = clientData; int index; if (objc < 2) { @@ -809,7 +808,7 @@ ImgBmapGet( ClientData masterData) /* Pointer to our master structure for the * image. */ { - BitmapMaster *masterPtr = (BitmapMaster *) masterData; + BitmapMaster *masterPtr = masterData; BitmapInstance *instancePtr; /* @@ -821,7 +820,7 @@ ImgBmapGet( instancePtr = instancePtr->nextPtr) { if (instancePtr->tkwin == tkwin) { instancePtr->refCount++; - return (ClientData) instancePtr; + return instancePtr; } } @@ -852,7 +851,7 @@ ImgBmapGet( masterPtr->height); } - return (ClientData) instancePtr; + return instancePtr; } /* @@ -884,7 +883,7 @@ ImgBmapDisplay( /* Coordinates within drawable that correspond * to imageX and imageY. */ { - BitmapInstance *instancePtr = (BitmapInstance *) clientData; + BitmapInstance *instancePtr = clientData; int masking; /* @@ -938,7 +937,7 @@ ImgBmapFree( * instance to be displayed. */ Display *display) /* Display containing window that used image. */ { - BitmapInstance *instancePtr = (BitmapInstance *) clientData; + BitmapInstance *instancePtr = clientData; BitmapInstance *prevPtr; instancePtr->refCount--; @@ -1000,7 +999,7 @@ ImgBmapDelete( ClientData masterData) /* Pointer to BitmapMaster structure for * image. Must not have any more instances. */ { - BitmapMaster *masterPtr = (BitmapMaster *) masterData; + BitmapMaster *masterPtr = masterData; if (masterPtr->instancePtr != NULL) { Tcl_Panic("tried to delete bitmap image when instances still exist"); @@ -1041,7 +1040,7 @@ ImgBmapCmdDeletedProc( ClientData clientData) /* Pointer to BitmapMaster structure for * image. */ { - BitmapMaster *masterPtr = (BitmapMaster *) clientData; + BitmapMaster *masterPtr = clientData; masterPtr->imageCmd = NULL; if (masterPtr->tkMaster != NULL) { @@ -1205,7 +1204,7 @@ ImgBmapPostscript( int x, int y, int width, int height, int prepass) { - BitmapMaster *masterPtr = (BitmapMaster *) clientData; + BitmapMaster *masterPtr = clientData; char buffer[200]; if (prepass) { diff --git a/generic/tkImgGIF.c b/generic/tkImgGIF.c index 9a823bf..69a0c85 100644 --- a/generic/tkImgGIF.c +++ b/generic/tkImgGIF.c @@ -32,7 +32,7 @@ * This file also contains code from miGIF. See lower down in file for the * applicable copyright notice for that portion. * - * RCS: @(#) $Id: tkImgGIF.c,v 1.43 2008/04/09 21:00:54 nijtmans Exp $ + * RCS: @(#) $Id: tkImgGIF.c,v 1.44 2008/04/27 22:38:56 dkf Exp $ */ #include "tkInt.h" @@ -1647,7 +1647,8 @@ color( int x = (statePtr->alphaOffset != 0); for (; x<=MAXCOLORMAPSIZE ; x++) { - if ((statePtr->mapa[x][CM_RED] == red) && (statePtr->mapa[x][CM_GREEN] == green) && + if ((statePtr->mapa[x][CM_RED] == red) && + (statePtr->mapa[x][CM_GREEN] == green) && (statePtr->mapa[x][CM_BLUE] == blue)) { return x; } @@ -1663,7 +1664,8 @@ nuevo( int x = (statePtr->alphaOffset != 0); for (; x<=statePtr->num ; x++) { - if ((statePtr->mapa[x][CM_RED] == red) && (statePtr->mapa[x][CM_GREEN] == green) && + if ((statePtr->mapa[x][CM_RED] == red) && + (statePtr->mapa[x][CM_GREEN] == green) && (statePtr->mapa[x][CM_BLUE] == blue)) { return 0; } @@ -1739,7 +1741,6 @@ ReadValue( } /* - * * GIF Image compression - modified 'compress' * * Based on: compress.c - File compression ala IEEE Computer, June 1984. @@ -1750,55 +1751,54 @@ ReadValue( * Ken Turkowski (decvax!decwrl!turtlevax!ken) * James A. Woods (decvax!ihnp4!ames!jaw) * Joe Orost (decvax!vax135!petsd!joe) - * */ #define MAXCODE(n_bits) (((long) 1 << (n_bits)) - 1) typedef struct { - int n_bits; /* number of bits/code */ + int n_bits; /* number of bits/code */ long maxcode; /* maximum code, given n_bits */ - int htab[HSIZE]; - unsigned int codetab[HSIZE]; + int htab[HSIZE]; + unsigned int codetab[HSIZE]; + long hsize; /* for dynamic table sizing */ - long hsize; /* for dynamic table sizing */ + /* + * To save much memory, we overlay the table used by compress() with those + * used by decompress(). The tab_prefix table is the same size and type as + * the codetab. The tab_suffix table needs 2**GIFBITS characters. We get + * this from the beginning of htab. The output stack uses the rest of + * htab, and contains characters. There is plenty of room for any possible + * stack (stack used to be 8000 characters). + */ -/* - * To save much memory, we overlay the table used by compress() with those - * used by decompress(). The tab_prefix table is the same size and type - * as the codetab. The tab_suffix table needs 2**GIFBITS characters. We - * get this from the beginning of htab. The output stack uses the rest - * of htab, and contains characters. There is plenty of room for any - * possible stack (stack used to be 8000 characters). - */ + int free_ent; /* first unused entry */ - int free_ent; /* first unused entry */ + /* + * block compression parameters -- after all codes are used up, + * and compression rate changes, start over. + */ -/* - * block compression parameters -- after all codes are used up, - * and compression rate changes, start over. - */ int clear_flg; int offset; - unsigned int in_count; /* length of input */ - unsigned int out_count; /* # of codes output (for debugging) */ + unsigned int in_count; /* length of input */ + unsigned int out_count; /* # of codes output (for debugging) */ -/* - * compress stdin to stdout - * - * Algorithm: use open addressing double hashing (no chaining) on the - * prefix code / next character combination. We do a variant of Knuth's - * algorithm D (vol. 3, sec. 6.4) along with G. Knott's relatively-prime - * secondary probe. Here, the modular division first probe is gives way - * to a faster exclusive-or manipulation. Also do block compression with - * an adaptive reset, whereby the code table is cleared when the compression - * ratio decreases, but after the table fills. The variable-length output - * codes are re-sized at this point, and a special CLEAR code is generated - * for the decompressor. Late addition: construct the table according to - * file size for noticeable speed improvement on small files. Please direct - * questions about this implementation to ames!jaw. - */ + /* + * compress stdin to stdout + * + * Algorithm: use open addressing double hashing (no chaining) on the + * prefix code / next character combination. We do a variant of Knuth's + * algorithm D (vol. 3, sec. 6.4) along with G. Knott's relatively-prime + * secondary probe. Here, the modular division first probe is gives way to + * a faster exclusive-or manipulation. Also do block compression with an + * adaptive reset, whereby the code table is cleared when the compression + * ratio decreases, but after the table fills. The variable-length output + * codes are re-sized at this point, and a special CLEAR code is generated + * for the decompressor. Late addition: construct the table according to + * file size for noticeable speed improvement on small files. Please + * direct questions about this implementation to ames!jaw. + */ int g_init_bits; Tcl_Channel g_outfile; @@ -1807,34 +1807,36 @@ typedef struct { int EOFCode; unsigned long cur_accum; - int cur_bits; + int cur_bits; + + /* + * Number of characters so far in this 'packet' + */ -/* - * Number of characters so far in this 'packet' - */ int a_count; -/* - * Define the storage for the packet accumulator - */ + /* + * Define the storage for the packet accumulator + */ + unsigned char accum[256]; } GIFState_t; -static void output _ANSI_ARGS_((GIFState_t *statePtr, long code)); -static void cl_block _ANSI_ARGS_((GIFState_t *statePtr)); -static void cl_hash _ANSI_ARGS_((GIFState_t *statePtr, int hsize)); -static void char_init _ANSI_ARGS_((GIFState_t *statePtr)); -static void char_out _ANSI_ARGS_((GIFState_t *statePtr, int c)); -static void flush_char _ANSI_ARGS_((GIFState_t *statePtr)); - +static void output(GIFState_t *statePtr, long code); +static void cl_block(GIFState_t *statePtr); +static void cl_hash(GIFState_t *statePtr, int hsize); +static void char_init(GIFState_t *statePtr); +static void char_out(GIFState_t *statePtr, int c); +static void flush_char(GIFState_t *statePtr); static void compress(int initBits, Tcl_Channel handle, ifunptr readValue, GifWriterState *statePtr); - -static void compress(init_bits, handle, readValue, statePtr) - int init_bits; - Tcl_Channel handle; - ifunptr readValue; - GifWriterState *statePtr; + +static void +compress( + int init_bits, + Tcl_Channel handle, + ifunptr readValue, + GifWriterState *statePtr) { register long fcode; register long i = 0; @@ -1846,16 +1848,19 @@ static void compress(init_bits, handle, readValue, statePtr) GIFState_t state; memset(&state, 0, sizeof(state)); + /* * Set up the globals: g_init_bits - initial number of bits - * g_outfile - pointer to output file + * g_outfile - pointer to output file */ + state.g_init_bits = init_bits; state.g_outfile = handle; /* - * Set up the necessary values + * Set up the necessary values. */ + state.offset = 0; state.hsize = HSIZE; state.out_count = 0; @@ -1872,95 +1877,111 @@ static void compress(init_bits, handle, readValue, statePtr) ent = readValue(statePtr); hshift = 0; - for ( fcode = (long) state.hsize; fcode < 65536L; fcode *= 2L ) - hshift++; - hshift = 8 - hshift; /* set hash code range bound */ + for (fcode = (long) state.hsize; fcode < 65536L; fcode *= 2L) { + hshift++; + } + hshift = 8 - hshift; /* set hash code range bound */ hsize_reg = state.hsize; - cl_hash(&state, (int) hsize_reg); /* clear hash table */ + cl_hash(&state, (int) hsize_reg); /* clear hash table */ - output(&state, (long)state.ClearCode); + output(&state, (long) state.ClearCode); #ifdef SIGNED_COMPARE_SLOW - while ( (c = readValue(statePtr) ) != (unsigned) EOF ) { + while ((c = readValue(statePtr)) != (unsigned) EOF) #else - while ( (c = readValue(statePtr)) != EOF ) { + while ((c = readValue(statePtr)) != EOF) #endif + { + state.in_count++; + + fcode = (long) (((long) c << GIFBITS) + ent); + i = (((long)c << hshift) ^ ent); /* xor hashing */ + + if (state.htab[i] == fcode) { + ent = state.codetab[i]; + continue; + } else if ((long) state.htab[i] < 0) { /* empty slot */ + goto nomatch; + } + + disp = hsize_reg - i; /* secondary hash (after G. + * Knott) */ + if (i == 0) { + disp = 1; + } + + probe: + if ((i -= disp) < 0) { + i += hsize_reg; + } - state.in_count++; - - fcode = (long) (((long) c << GIFBITS) + ent); - i = (((long)c << hshift) ^ ent); /* xor hashing */ - - if (state.htab[i] == fcode) { - ent = state.codetab[i]; - continue; - } else if ( (long) state.htab[i] < 0 ) /* empty slot */ - goto nomatch; - disp = hsize_reg - i; /* secondary hash (after G. Knott) */ - if ( i == 0 ) - disp = 1; -probe: - if ( (i -= disp) < 0 ) - i += hsize_reg; - - if (state.htab[i] == fcode) { - ent = state.codetab[i]; - continue; - } - if ( (long) state.htab[i] > 0 ) - goto probe; -nomatch: - output (&state, (long) ent); - state.out_count++; - ent = c; + if (state.htab[i] == fcode) { + ent = state.codetab[i]; + continue; + } + if ((long) state.htab[i] > 0) { + goto probe; + } + + nomatch: + output(&state, (long) ent); + state.out_count++; + ent = c; #ifdef SIGNED_COMPARE_SLOW - if ( (unsigned) free_ent < (unsigned) ((long)1 << GIFBITS)) { + if ((unsigned) free_ent < (unsigned) ((long)1 << GIFBITS)) #else - if (state.free_ent < ((long)1 << GIFBITS)) { + if (state.free_ent < ((long)1 << GIFBITS)) #endif - state.codetab[i] = state.free_ent++; /* code -> hashtable */ - state.htab[i] = fcode; - } else - cl_block(&state); + { + state.codetab[i] = state.free_ent++; /* code -> hashtable */ + state.htab[i] = fcode; + } else { + cl_block(&state); + } } + /* * Put out the final code. */ + output(&state, (long)ent); state.out_count++; output(&state, (long) state.EOFCode); return; } - + /***************************************************************** * TAG( output ) * * Output the given code. * Inputs: - * code: A n_bits-bit integer. If == -1, then EOF. This assumes - * that n_bits =< (long) wordsize - 1. + * code: A n_bits-bit integer. If == -1, then EOF. This assumes that + * n_bits =< (long) wordsize - 1. * Outputs: - * Outputs code to the file. + * Outputs code to the file. * Assumptions: - * Chars are 8 bits long. + * Chars are 8 bits long. * Algorithm: - * Maintain a GIFBITS character long buffer (so that 8 codes will - * fit in it exactly). Use the VAX insv instruction to insert each + * Maintain a GIFBITS character long buffer (so that 8 codes will + * fit in it exactly). Use the VAX insv instruction to insert each * code in turn. When the buffer fills up empty it and start over. */ static const -unsigned long masks[] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000F, - 0x001F, 0x003F, 0x007F, 0x00FF, - 0x01FF, 0x03FF, 0x07FF, 0x0FFF, - 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF }; +unsigned long masks[] = { + 0x0000, + 0x0001, 0x0003, 0x0007, 0x000F, + 0x001F, 0x003F, 0x007F, 0x00FF, + 0x01FF, 0x03FF, 0x07FF, 0x0FFF, + 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF +}; static void -output(statePtr, code) - GIFState_t *statePtr; - long code; +output( + GIFState_t *statePtr, + long code) { statePtr->cur_accum &= masks[statePtr->cur_bits]; @@ -1973,7 +1994,7 @@ output(statePtr, code) statePtr->cur_bits += statePtr->n_bits; while (statePtr->cur_bits >= 8 ) { - char_out(statePtr, (unsigned int)(statePtr->cur_accum & 0xff)); + char_out(statePtr, (unsigned) (statePtr->cur_accum & 0xff)); statePtr->cur_accum >>= 8; statePtr->cur_bits -= 8; } @@ -1985,7 +2006,8 @@ output(statePtr, code) if ((statePtr->free_ent > statePtr->maxcode)|| statePtr->clear_flg ) { if (statePtr->clear_flg) { - statePtr->maxcode = MAXCODE(statePtr->n_bits = statePtr->g_init_bits); + statePtr->maxcode = MAXCODE( + statePtr->n_bits = statePtr->g_init_bits); statePtr->clear_flg = 0; } else { statePtr->n_bits++; @@ -2001,41 +2023,42 @@ output(statePtr, code) /* * At EOF, write the rest of the buffer. */ - while (statePtr->cur_bits > 0) { - char_out(statePtr, (unsigned int)(statePtr->cur_accum & 0xff)); + + while (statePtr->cur_bits > 0) { + char_out(statePtr, (unsigned) (statePtr->cur_accum & 0xff)); statePtr->cur_accum >>= 8; statePtr->cur_bits -= 8; } flush_char(statePtr); } } - + /* * Clear out the hash table */ + static void -cl_block(statePtr) /* table clear for block compress */ - GIFState_t *statePtr; +cl_block( /* table clear for block compress */ + GIFState_t *statePtr) { + cl_hash(statePtr, (int) statePtr->hsize); + statePtr->free_ent = statePtr->ClearCode + 2; + statePtr->clear_flg = 1; - cl_hash (statePtr, (int) statePtr->hsize); - statePtr->free_ent = statePtr->ClearCode + 2; - statePtr->clear_flg = 1; - - output(statePtr, (long) statePtr->ClearCode); + output(statePtr, (long) statePtr->ClearCode); } - + static void -cl_hash(statePtr, hsize) /* reset code table */ - GIFState_t *statePtr; - int hsize; +cl_hash( /* reset code table */ + GIFState_t *statePtr, + int hsize) { - register int *htab_p = statePtr->htab+hsize; + register int *htab_p = statePtr->htab + hsize; register long i; register long m1 = -1; i = hsize - 16; - do { /* might use Sys V memset(3) here */ + do { /* might use Sys V memset(3) here */ *(htab_p-16) = m1; *(htab_p-15) = m1; *(htab_p-14) = m1; @@ -2059,53 +2082,59 @@ cl_hash(statePtr, hsize) /* reset code table */ *--htab_p = m1; } } - - -/****************************************************************************** + +/* + ***************************************************************************** * * GIF Specific routines * - ******************************************************************************/ + ***************************************************************************** + */ /* * Set up the 'byte output' routine */ + static void -char_init(statePtr) - GIFState_t *statePtr; +char_init( + GIFState_t *statePtr) { statePtr->a_count = 0; statePtr->cur_accum = 0; statePtr->cur_bits = 0; } - + /* * Add a character to the end of the current packet, and if it is 254 * characters, flush the packet to disk. */ + static void -char_out(statePtr, c) - GIFState_t *statePtr; - int c; +char_out( + GIFState_t *statePtr, + int c) { statePtr->accum[statePtr->a_count++] = c; if (statePtr->a_count >= 254) { flush_char(statePtr); } } - + /* * Flush the packet to disk, and reset the accumulator */ + static void -flush_char(statePtr) - GIFState_t *statePtr; +flush_char( + GIFState_t *statePtr) { unsigned char c; + if (statePtr->a_count > 0) { c = statePtr->a_count; - Tcl_Write(statePtr->g_outfile, (CONST char *) &c, 1); - Tcl_Write(statePtr->g_outfile, (CONST char *) statePtr->accum, statePtr->a_count); + Tcl_Write(statePtr->g_outfile, (const char *) &c, 1); + Tcl_Write(statePtr->g_outfile, (const char *) statePtr->accum, + statePtr->a_count); statePtr->a_count = 0; } } diff --git a/generic/tkImgPPM.c b/generic/tkImgPPM.c index 7aeeade..6419072 100644 --- a/generic/tkImgPPM.c +++ b/generic/tkImgPPM.c @@ -13,7 +13,7 @@ * Department of Computer Science, * Australian National University. * - * RCS: @(#) $Id: tkImgPPM.c,v 1.21 2007/12/13 15:24:14 dgp Exp $ + * RCS: @(#) $Id: tkImgPPM.c,v 1.22 2008/04/27 22:38:56 dkf Exp $ */ #include "tkInt.h" @@ -36,14 +36,14 @@ * The format record for the PPM file format: */ -static int FileMatchPPM(Tcl_Channel chan, CONST char *fileName, +static int FileMatchPPM(Tcl_Channel chan, const char *fileName, Tcl_Obj *format, int *widthPtr, int *heightPtr, Tcl_Interp *interp); static int FileReadPPM(Tcl_Interp *interp, Tcl_Channel chan, - CONST char *fileName, Tcl_Obj *format, + const char *fileName, Tcl_Obj *format, Tk_PhotoHandle imageHandle, int destX, int destY, int width, int height, int srcX, int srcY); -static int FileWritePPM(Tcl_Interp *interp, CONST char *fileName, +static int FileWritePPM(Tcl_Interp *interp, const char *fileName, Tcl_Obj *format, Tk_PhotoImageBlock *blockPtr); static int StringWritePPM(Tcl_Interp *interp, Tcl_Obj *format, Tk_PhotoImageBlock *blockPtr); @@ -95,7 +95,7 @@ static int ReadPPMStringHeader(Tcl_Obj *dataObj, int *widthPtr, static int FileMatchPPM( Tcl_Channel chan, /* The image file, open for reading. */ - CONST char *fileName, /* The name of the image file. */ + const char *fileName, /* The name of the image file. */ Tcl_Obj *format, /* User-specified format string, or NULL. */ int *widthPtr, int *heightPtr, /* The dimensions of the image are returned @@ -131,7 +131,7 @@ static int FileReadPPM( Tcl_Interp *interp, /* Interpreter to use for reporting errors. */ Tcl_Channel chan, /* The image file, open for reading. */ - CONST char *fileName, /* The name of the image file. */ + const char *fileName, /* The name of the image file. */ Tcl_Obj *format, /* User-specified format string, or NULL. */ Tk_PhotoHandle imageHandle, /* The photo image to write into. */ int destX, int destY, /* Coordinates of top-left pixel in photo @@ -267,7 +267,7 @@ FileReadPPM( static int FileWritePPM( Tcl_Interp *interp, - CONST char *fileName, + const char *fileName, Tcl_Obj *format, Tk_PhotoImageBlock *blockPtr) { diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index eff0fde..3d7b017 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -17,7 +17,7 @@ * Department of Computer Science, * Australian National University. * - * RCS: @(#) $Id: tkImgPhoto.c,v 1.76 2007/12/13 15:24:14 dgp Exp $ + * RCS: @(#) $Id: tkImgPhoto.c,v 1.77 2008/04/27 22:38:56 dkf Exp $ */ #include "tkInt.h" @@ -302,7 +302,7 @@ static char *optionNames[] = { */ static int ImgPhotoCreate(Tcl_Interp *interp, char *name, - int objc, Tcl_Obj *CONST objv[], + int objc, Tcl_Obj *const objv[], Tk_ImageType *typePtr, Tk_ImageMaster master, ClientData *clientDataPtr); static ClientData ImgPhotoGet(Tk_Window tkwin, ClientData clientData); @@ -395,7 +395,7 @@ static int imgPhotoColorHashInitialized; static void PhotoFormatThreadExitProc(ClientData clientData); static int ImgPhotoCmd(ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static int ParseSubcommandOptions( struct SubcommandOptions *optPtr, Tcl_Interp *interp, int allowedOptions, @@ -579,7 +579,7 @@ ImgPhotoCreate( * image. */ char *name, /* Name to use for image. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[], /* Argument objects for options (doesn't + Tcl_Obj *const objv[], /* Argument objects for options (doesn't * include image name or type). */ Tk_ImageType *typePtr, /* Pointer to our type record (not used). */ Tk_ImageMaster master, /* Token for image, to be used by us in later @@ -598,7 +598,7 @@ ImgPhotoCreate( masterPtr->tkMaster = master; masterPtr->interp = interp; masterPtr->imageCmd = Tcl_CreateObjCommand(interp, name, ImgPhotoCmd, - (ClientData) masterPtr, ImgPhotoCmdDeletedProc); + masterPtr, ImgPhotoCmdDeletedProc); masterPtr->palette = NULL; masterPtr->pix32 = NULL; masterPtr->instancePtr = NULL; @@ -609,11 +609,11 @@ ImgPhotoCreate( */ if (ImgPhotoConfigureMaster(interp, masterPtr, objc, objv, 0) != TCL_OK) { - ImgPhotoDelete((ClientData) masterPtr); + ImgPhotoDelete(masterPtr); return TCL_ERROR; } - *clientDataPtr = (ClientData) masterPtr; + *clientDataPtr = masterPtr; return TCL_OK; } @@ -640,7 +640,7 @@ ImgPhotoCmd( ClientData clientData, /* Information about photo master. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { static const char *photoOptions[] = { "blank", "cget", "configure", "copy", "data", "get", "put", @@ -652,7 +652,7 @@ ImgPhotoCmd( PHOTO_WRITE }; - PhotoMaster *masterPtr = (PhotoMaster *) clientData; + PhotoMaster *masterPtr = clientData; int result, index, x, y, width, height, dataWidth, dataHeight, listObjc; struct SubcommandOptions options; Tcl_Obj **listObjv, **srcObjv; @@ -1206,7 +1206,7 @@ ImgPhotoCmd( block.offset[1] = 1; block.offset[2] = 2; block.offset[3] = 0; - result = Tk_PhotoPutBlock(interp, (ClientData)masterPtr, &block, + result = Tk_PhotoPutBlock(interp, masterPtr, &block, options.toX, options.toY, options.toX2 - options.toX, options.toY2 - options.toY, TK_PHOTO_COMPOSITE_SET); @@ -2328,7 +2328,7 @@ ImgPhotoGet( ClientData masterData) /* Pointer to our master structure for the * image. */ { - PhotoMaster *masterPtr = (PhotoMaster *) masterData; + PhotoMaster *masterPtr = masterData; PhotoInstance *instancePtr; Colormap colormap; int mono, nRed, nGreen, nBlue, numVisuals; @@ -2378,14 +2378,14 @@ ImgPhotoGet( * We are resurrecting this instance. */ - Tcl_CancelIdleCall(DisposeInstance, (ClientData) instancePtr); + Tcl_CancelIdleCall(DisposeInstance, instancePtr); if (instancePtr->colorTablePtr != NULL) { FreeColorTable(instancePtr->colorTablePtr, 0); } GetColorTable(instancePtr); } instancePtr->refCount++; - return (ClientData) instancePtr; + return instancePtr; } } @@ -2489,7 +2489,7 @@ ImgPhotoGet( masterPtr->width, masterPtr->height); } - return (ClientData) instancePtr; + return instancePtr; } /* @@ -2760,7 +2760,7 @@ ImgPhotoDisplay( int drawableX,int drawableY)/* Coordinates within drawable that correspond * to imageX and imageY. */ { - PhotoInstance *instancePtr = (PhotoInstance *) clientData; + PhotoInstance *instancePtr = clientData; XVisualInfo visInfo = instancePtr->visualInfo; /* @@ -2783,8 +2783,7 @@ ImgPhotoDisplay( * not properly constrained, which can cause an X error. [Bug 979239] */ - handler = Tk_CreateErrorHandler(display, -1, -1, -1, NULL, - (ClientData) NULL); + handler = Tk_CreateErrorHandler(display, -1, -1, -1, NULL, NULL); /* * Pull the current background from the display to blend with @@ -2855,7 +2854,7 @@ ImgPhotoFree( Display *display) /* Display containing window that used * image. */ { - PhotoInstance *instancePtr = (PhotoInstance *) clientData; + PhotoInstance *instancePtr = clientData; ColorTable *colorPtr; instancePtr->refCount -= 1; @@ -2875,7 +2874,7 @@ ImgPhotoFree( colorPtr->liveRefCount -= 1; } - Tcl_DoWhenIdle(DisposeInstance, (ClientData) instancePtr); + Tcl_DoWhenIdle(DisposeInstance, instancePtr); } /* @@ -2900,15 +2899,15 @@ ImgPhotoDelete( ClientData masterData) /* Pointer to PhotoMaster structure for image. * Must not have any more instances. */ { - PhotoMaster *masterPtr = (PhotoMaster *) masterData; + PhotoMaster *masterPtr = masterData; PhotoInstance *instancePtr; while ((instancePtr = masterPtr->instancePtr) != NULL) { if (instancePtr->refCount > 0) { Tcl_Panic("tried to delete photo image when instances still exist"); } - Tcl_CancelIdleCall(DisposeInstance, (ClientData) instancePtr); - DisposeInstance((ClientData) instancePtr); + Tcl_CancelIdleCall(DisposeInstance, instancePtr); + DisposeInstance(instancePtr); } masterPtr->tkMaster = NULL; if (masterPtr->imageCmd != NULL) { @@ -2952,7 +2951,7 @@ ImgPhotoCmdDeletedProc( ClientData clientData) /* Pointer to PhotoMaster structure for * image. */ { - PhotoMaster *masterPtr = (PhotoMaster *) clientData; + PhotoMaster *masterPtr = clientData; masterPtr->imageCmd = NULL; if (masterPtr->tkMaster != NULL) { @@ -3350,7 +3349,7 @@ IsValidPalette( case StaticColor: numColors = nRed; if (!mono) { - numColors *= nGreen*nBlue; + numColors *= nGreen * nBlue; } if (numColors > (1 << instancePtr->visualInfo.depth)) { return 0; @@ -3447,7 +3446,7 @@ GetColorTable( * Re-use the existing entry. */ - colorPtr = (ColorTable *) Tcl_GetHashValue(entry); + colorPtr = Tcl_GetHashValue(entry); } else { /* * No color table currently available; need to make one. @@ -3480,7 +3479,7 @@ GetColorTable( colorPtr->liveRefCount++; instancePtr->colorTablePtr = colorPtr; if (colorPtr->flags & DISPOSE_PENDING) { - Tcl_CancelIdleCall(DisposeColorTable, (ClientData) colorPtr); + Tcl_CancelIdleCall(DisposeColorTable, colorPtr); colorPtr->flags &= ~DISPOSE_PENDING; } @@ -3525,12 +3524,12 @@ FreeColorTable( if (force) { if ((colorPtr->flags & DISPOSE_PENDING) != 0) { - Tcl_CancelIdleCall(DisposeColorTable, (ClientData) colorPtr); + Tcl_CancelIdleCall(DisposeColorTable, colorPtr); colorPtr->flags &= ~DISPOSE_PENDING; } - DisposeColorTable((ClientData) colorPtr); + DisposeColorTable(colorPtr); } else if ((colorPtr->flags & DISPOSE_PENDING) == 0) { - Tcl_DoWhenIdle(DisposeColorTable, (ClientData) colorPtr); + Tcl_DoWhenIdle(DisposeColorTable, colorPtr); colorPtr->flags |= DISPOSE_PENDING; } } @@ -3840,7 +3839,7 @@ DisposeColorTable( ClientData clientData) /* Pointer to the ColorTable whose * colors are to be released. */ { - ColorTable *colorPtr = (ColorTable *) clientData; + ColorTable *colorPtr = clientData; Tcl_HashEntry *entry; if (colorPtr->pixelMap != NULL) { @@ -3900,7 +3899,7 @@ ReclaimColors( entry = Tcl_FirstHashEntry(&imgPhotoColorHash, &srch); while (entry != NULL) { - colorPtr = (ColorTable *) Tcl_GetHashValue(entry); + colorPtr = Tcl_GetHashValue(entry); if ((colorPtr->id.display == id->display) && (colorPtr->id.colormap == id->colormap) && (colorPtr->liveRefCount == 0 )&& (colorPtr->numColors != 0) @@ -3929,7 +3928,7 @@ ReclaimColors( entry = Tcl_FirstHashEntry(&imgPhotoColorHash, &srch); while ((entry != NULL) && (numColors > 0)) { - colorPtr = (ColorTable *) Tcl_GetHashValue(entry); + colorPtr = Tcl_GetHashValue(entry); if ((colorPtr->id.display == id->display) && (colorPtr->id.colormap == id->colormap) && (colorPtr->liveRefCount == 0) && (colorPtr->numColors != 0) @@ -3974,7 +3973,7 @@ DisposeInstance( ClientData clientData) /* Pointer to the instance whose resources are * to be released. */ { - PhotoInstance *instancePtr = (PhotoInstance *) clientData; + PhotoInstance *instancePtr = clientData; PhotoInstance *prevPtr; if (instancePtr->pixels != None) { @@ -4273,16 +4272,16 @@ Tk_PhotoHandle Tk_FindPhoto( Tcl_Interp *interp, /* Interpreter (application) in which image * exists. */ - CONST char *imageName) /* Name of the desired photo image. */ + const char *imageName) /* Name of the desired photo image. */ { - ClientData clientData; Tk_ImageType *typePtr; + ClientData clientData = + Tk_GetImageMasterData(interp, imageName, &typePtr); - clientData = Tk_GetImageMasterData(interp, imageName, &typePtr); if (typePtr != &tkPhotoImageType) { return NULL; } - return (Tk_PhotoHandle) clientData; + return clientData; } /* @@ -4617,7 +4616,7 @@ Tk_PhotoPutBlock( if (!sourceIsSimplePhoto && (width == 1) && (height == 1)) { /* * Optimize the single pixel case if we can. This speeds up code that - * builds up large simple-alpha images by single pixels. We don't + * builds up large simple-alpha images by single pixels. We don't * negate COMPLEX_ALPHA in this case. [Bug 1409140] */ @@ -4634,7 +4633,7 @@ Tk_PhotoPutBlock( } else if ((alphaOffset != 0) || (masterPtr->flags & COMPLEX_ALPHA)) { /* * Check for partial transparency if alpha pixels are specified, or - * rescan if we already knew such pixels existed. To restrict this + * rescan if we already knew such pixels existed. To restrict this * Toggle to only checking the changed pixels requires knowing where * the alpha pixels are. */ @@ -4743,7 +4742,7 @@ Tk_PhotoPutZoomedBlock( } if ((y < masterPtr->ditherY) || ((y == masterPtr->ditherY) - && (x < masterPtr->ditherX))) { + && (x < masterPtr->ditherX))) { /* * The dithering isn't correct past the start of this block. */ @@ -4917,7 +4916,7 @@ Tk_PhotoPutZoomedBlock( if (!sourceIsSimplePhoto && (width == 1) && (height == 1)) { /* * Optimize the single pixel case if we can. This speeds up code that - * builds up large simple-alpha images by single pixels. We don't + * builds up large simple-alpha images by single pixels. We don't * negate COMPLEX_ALPHA in this case. [Bug 1409140] */ if (!(masterPtr->flags & COMPLEX_ALPHA)) { @@ -4933,7 +4932,7 @@ Tk_PhotoPutZoomedBlock( } else if ((alphaOffset != 0) || (masterPtr->flags & COMPLEX_ALPHA)) { /* * Check for partial transparency if alpha pixels are specified, or - * rescan if we already knew such pixels existed. To restrict this + * rescan if we already knew such pixels existed. To restrict this * Toggle to only checking the changed pixels requires knowing where * the alpha pixels are. */ @@ -5246,7 +5245,7 @@ DitherInstance( for (x = xStart; x < xEnd; ++x) { c = (x > 0) ? errPtr[-1] * 7: 0; if (y > 0) { - if (x > 0) { + if (x > 0) { c += errPtr[-lineLength-1]; } c += errPtr[-lineLength] * 5; @@ -5259,7 +5258,7 @@ DitherInstance( if ((masterPtr->flags & COLOR_IMAGE) == 0) { c += srcPtr[0]; } else { - c += (unsigned)(srcPtr[0] * 11 + srcPtr[1] * 16 + c += (unsigned) (srcPtr[0] * 11 + srcPtr[1] * 16 + srcPtr[2] * 5 + 16) >> 5; } srcPtr += 4; @@ -5900,8 +5899,7 @@ PhotoOptionFind( char *name = Tcl_GetStringFromObj(obj, &length); char *prevname = NULL; Tcl_ObjCmdProc *proc = NULL; - OptionAssocData *list = (OptionAssocData *) Tcl_GetAssocData(interp, - "photoOption", NULL); + OptionAssocData *list = Tcl_GetAssocData(interp, "photoOption", NULL); while (list != NULL) { if (strncmp(name, list->name, (unsigned) length) == 0) { @@ -5951,7 +5949,7 @@ PhotoOptionCleanupProc( * interpreter. */ Tcl_Interp *interp) /* Interpreter that is being deleted. */ { - OptionAssocData *list = (OptionAssocData *) clientData; + OptionAssocData *list = clientData; while (list != NULL) { register OptionAssocData *ptr; @@ -5981,12 +5979,11 @@ PhotoOptionCleanupProc( MODULE_SCOPE void Tk_CreatePhotoOption( Tcl_Interp *interp, /* Interpreter. */ - CONST char *name, /* Option name. */ + const char *name, /* Option name. */ Tcl_ObjCmdProc *proc) /* Function to execute command. */ { OptionAssocData *typePtr2, *prevPtr, *ptr; - OptionAssocData *list = (OptionAssocData *) - Tcl_GetAssocData(interp, "photoOption", NULL); + OptionAssocData *list = Tcl_GetAssocData(interp, "photoOption", NULL); /* * If there's already a photo option with the given name, remove it. @@ -6008,8 +6005,7 @@ Tk_CreatePhotoOption( strcpy(&(ptr->name[0]), name); ptr->command = proc; ptr->nextPtr = list; - Tcl_SetAssocData(interp, "photoOption", PhotoOptionCleanupProc, - (ClientData) ptr); + Tcl_SetAssocData(interp, "photoOption", PhotoOptionCleanupProc, ptr); } /* @@ -6041,7 +6037,7 @@ ImgPhotoPostscript( { Tk_PhotoImageBlock block; - Tk_PhotoGetImage((Tk_PhotoHandle) clientData, &block); + Tk_PhotoGetImage(clientData, &block); block.pixelPtr += y * block.pitch + x * block.pixelSize; return Tk_PostscriptPhoto(interp, &block, psInfo, width, height); diff --git a/generic/tkMain.c b/generic/tkMain.c index 9f6a73c..396c93f 100644 --- a/generic/tkMain.c +++ b/generic/tkMain.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMain.c,v 1.29 2008/04/01 16:30:54 dgp Exp $ + * RCS: @(#) $Id: tkMain.c,v 1.30 2008/04/27 22:38:56 dkf Exp $ */ #include @@ -56,7 +56,7 @@ static Tcl_ThreadDataKey dataKey; #if !defined(__WIN32__) && !defined(_WIN32) extern int isatty(int fd); -extern char * strrchr(CONST char *string, int c); +extern char * strrchr(const char *string, int c); #endif /* @@ -96,7 +96,7 @@ Tk_MainEx( Tcl_Interp *interp) { Tcl_Obj *path, *argvPtr; - CONST char *encodingName; + const char *encodingName; int code, nullStdin = 0; Tcl_Channel inChannel, outChannel; ThreadSpecificData *tsdPtr; @@ -114,12 +114,11 @@ Tk_MainEx( abort(); } - tsdPtr = (ThreadSpecificData *) - Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_FindExecutable(argv[0]); tsdPtr->interp = interp; - Tcl_Preserve((ClientData) interp); + Tcl_Preserve(interp); #if defined(__WIN32__) Tk_InitConsoleChannels(interp); @@ -176,7 +175,7 @@ Tk_MainEx( Tcl_ExternalToUtfDString(NULL, argv[0], -1, &appName); } else { int numBytes; - CONST char *pathName = Tcl_GetStringFromObj(path, &numBytes); + const char *pathName = Tcl_GetStringFromObj(path, &numBytes); Tcl_ExternalToUtfDString(NULL, pathName, numBytes, &appName); path = Tcl_NewStringObj(Tcl_DStringValue(&appName), -1); @@ -298,7 +297,7 @@ Tk_MainEx( inChannel = Tcl_GetStdChannel(TCL_STDIN); if (inChannel) { Tcl_CreateChannelHandler(inChannel, TCL_READABLE, StdinProc, - (ClientData) inChannel); + inChannel); } if (tsdPtr->tty) { Prompt(interp, 0); @@ -320,7 +319,7 @@ Tk_MainEx( Tk_MainLoop(); Tcl_DeleteInterp(interp); - Tcl_Release((ClientData) interp); + Tcl_Release(interp); Tcl_SetStartupScript(NULL, NULL); Tcl_Exit(0); } @@ -353,8 +352,8 @@ StdinProc( static int gotPartial = 0; char *cmd; int code, count; - Tcl_Channel chan = (Tcl_Channel) clientData; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + Tcl_Channel chan = clientData; + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_Interp *interp = tsdPtr->interp; @@ -364,13 +363,12 @@ StdinProc( if (tsdPtr->tty) { Tcl_Exit(0); } else { - Tcl_DeleteChannelHandler(chan, StdinProc, (ClientData) chan); + Tcl_DeleteChannelHandler(chan, StdinProc, chan); } return; } - (void) Tcl_DStringAppend(&tsdPtr->command, Tcl_DStringValue( - &tsdPtr->line), -1); + Tcl_DStringAppend(&tsdPtr->command, Tcl_DStringValue(&tsdPtr->line), -1); cmd = Tcl_DStringAppend(&tsdPtr->command, "\n", -1); Tcl_DStringFree(&tsdPtr->line); if (!Tcl_CommandComplete(cmd)) { @@ -386,13 +384,12 @@ StdinProc( * things, this will trash the text of the command being evaluated. */ - Tcl_CreateChannelHandler(chan, 0, StdinProc, (ClientData) chan); + Tcl_CreateChannelHandler(chan, 0, StdinProc, chan); code = Tcl_RecordAndEval(interp, cmd, TCL_EVAL_GLOBAL); chan = Tcl_GetStdChannel(TCL_STDIN); if (chan) { - Tcl_CreateChannelHandler(chan, TCL_READABLE, StdinProc, - (ClientData) chan); + Tcl_CreateChannelHandler(chan, TCL_READABLE, StdinProc, chan); } Tcl_DStringFree(&tsdPtr->command); if (Tcl_GetStringResult(interp)[0] != '\0') { diff --git a/generic/tkMenu.c b/generic/tkMenu.c index a402fc3..1f18cc3 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMenu.c,v 1.41 2007/12/13 15:24:15 dgp Exp $ + * RCS: @(#) $Id: tkMenu.c,v 1.42 2008/04/27 22:38:56 dkf Exp $ */ /* @@ -101,7 +101,7 @@ TCL_DECLARE_MUTEX(menuMutex) char *tkMenuStateStrings[] = {"active", "normal", "disabled", NULL}; -static CONST char *menuEntryTypeStrings[] = { +static const char *menuEntryTypeStrings[] = { "cascade", "checkbutton", "command", "radiobutton", "separator", NULL }; @@ -310,7 +310,7 @@ static const Tk_OptionSpec tkMenuConfigSpecs[] = { * with MenuWidgetObjCmd. */ -static CONST char *menuOptions[] = { +static const char *menuOptions[] = { "activate", "add", "cget", "clone", "configure", "delete", "entrycget", "entryconfigure", "index", "insert", "invoke", "post", "postcascade", "type", "unpost", "xposition", "yposition", NULL @@ -329,12 +329,12 @@ enum options { static int CloneMenu(TkMenu *menuPtr, Tcl_Obj *newMenuName, Tcl_Obj *newMenuTypeString); static int ConfigureMenu(Tcl_Interp *interp, TkMenu *menuPtr, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static int ConfigureMenuCloneEntries(Tcl_Interp *interp, TkMenu *menuPtr, int index, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static int ConfigureMenuEntry(TkMenuEntry *mePtr, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static void DeleteMenuCloneEntries(TkMenu *menuPtr, int first, int last); static void DestroyMenuHashTable(ClientData clientData, @@ -349,17 +349,17 @@ static int MenuDoXPosition(Tcl_Interp *interp, TkMenu *menuPtr, Tcl_Obj *objPtr); static int MenuAddOrInsert(Tcl_Interp *interp, TkMenu *menuPtr, Tcl_Obj *indexPtr, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int MenuCmd(ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static void MenuCmdDeletedProc(ClientData clientData); static TkMenuEntry * MenuNewEntry(TkMenu *menuPtr, int index, int type); static char * MenuVarProc(ClientData clientData, - Tcl_Interp *interp, CONST char *name1, - CONST char *name2, int flags); + Tcl_Interp *interp, const char *name1, + const char *name2, int flags); static int MenuWidgetObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static void MenuWorldChanged(ClientData instanceData); static int PostProcessEntry(TkMenuEntry *mePtr); static void RecursivelyDeleteMenu(TkMenu *menuPtr); @@ -416,8 +416,7 @@ TkCreateMenuCmd( optionTablesPtr->entryOptionTables[CHECK_BUTTON_ENTRY] = Tk_CreateOptionTable(interp, specsArray[CHECK_BUTTON_ENTRY]); - Tcl_CreateObjCommand(interp, "menu", MenuCmd, - (ClientData) optionTablesPtr, NULL); + Tcl_CreateObjCommand(interp, "menu", MenuCmd, optionTablesPtr, NULL); if (Tcl_IsSafe(interp)) { Tcl_HideCommand(interp, "menu", "menu"); @@ -448,7 +447,7 @@ MenuCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument strings. */ + Tcl_Obj *const objv[]) /* Argument strings. */ { Tk_Window tkwin = Tk_MainWindow(interp); Tk_Window newWin; @@ -456,8 +455,8 @@ MenuCmd( TkMenuReferences *menuRefPtr; int i, index, toplevel; char *windowName; - static CONST char *typeStringList[] = {"-type", NULL}; - TkMenuOptionTables *optionTablesPtr = (TkMenuOptionTables *) clientData; + static const char *typeStringList[] = {"-type", NULL}; + TkMenuOptionTables *optionTablesPtr = clientData; if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?"); @@ -497,8 +496,8 @@ MenuCmd( menuPtr->display = Tk_Display(newWin); menuPtr->interp = interp; menuPtr->widgetCmd = Tcl_CreateObjCommand(interp, - Tk_PathName(menuPtr->tkwin), MenuWidgetObjCmd, - (ClientData) menuPtr, MenuCmdDeletedProc); + Tk_PathName(menuPtr->tkwin), MenuWidgetObjCmd, menuPtr, + MenuCmdDeletedProc); menuPtr->active = -1; menuPtr->cursorPtr = None; menuPtr->masterMenuPtr = menuPtr; @@ -507,10 +506,10 @@ MenuCmd( TkMenuInitializeDrawingFields(menuPtr); Tk_SetClass(menuPtr->tkwin, "Menu"); - Tk_SetClassProcs(menuPtr->tkwin, &menuClass, (ClientData) menuPtr); + Tk_SetClassProcs(menuPtr->tkwin, &menuClass, menuPtr); Tk_CreateEventHandler(newWin, ExposureMask|StructureNotifyMask|ActivateMask, - TkMenuEventProc, (ClientData) menuPtr); + TkMenuEventProc, menuPtr); if (Tk_InitOptions(interp, (char *) menuPtr, menuPtr->optionTablesPtr->menuOptionTable, menuPtr->tkwin) != TCL_OK) { @@ -661,9 +660,9 @@ MenuWidgetObjCmd( ClientData clientData, /* Information about menu widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument strings. */ + Tcl_Obj *const objv[]) /* Argument strings. */ { - register TkMenu *menuPtr = (TkMenu *) clientData; + register TkMenu *menuPtr = clientData; register TkMenuEntry *mePtr; int result = TCL_OK; int option; @@ -676,7 +675,7 @@ MenuWidgetObjCmd( &option) != TCL_OK) { return TCL_ERROR; } - Tcl_Preserve((ClientData) menuPtr); + Tcl_Preserve(menuPtr); switch ((enum options) option) { case MENU_ACTIVATE: { @@ -808,10 +807,10 @@ MenuWidgetObjCmd( goto done; } mePtr = menuPtr->entries[index]; - Tcl_Preserve((ClientData) mePtr); + Tcl_Preserve(mePtr); resultPtr = Tk_GetOptionValue(interp, (char *) mePtr, mePtr->optionTable, objv[3], menuPtr->tkwin); - Tcl_Release((ClientData) mePtr); + Tcl_Release(mePtr); if (resultPtr == NULL) { goto error; } @@ -833,7 +832,7 @@ MenuWidgetObjCmd( goto done; } mePtr = menuPtr->entries[index]; - Tcl_Preserve((ClientData) mePtr); + Tcl_Preserve(mePtr); if (objc == 3) { resultPtr = Tk_GetOptionInfo(interp, (char *) mePtr, mePtr->optionTable, NULL, menuPtr->tkwin); @@ -856,7 +855,7 @@ MenuWidgetObjCmd( result = ConfigureMenuCloneEntries(interp, menuPtr, index, objc-3, objv+3); } - Tcl_Release((ClientData) mePtr); + Tcl_Release(mePtr); break; } case MENU_INDEX: { @@ -989,11 +988,11 @@ MenuWidgetObjCmd( break; } done: - Tcl_Release((ClientData) menuPtr); + Tcl_Release(menuPtr); return result; error: - Tcl_Release((ClientData) menuPtr); + Tcl_Release(menuPtr); return TCL_ERROR; } @@ -1032,9 +1031,11 @@ TkInvokeMenu( if (mePtr->state == ENTRY_DISABLED) { goto done; } - Tcl_Preserve((ClientData) mePtr); + + Tcl_Preserve(mePtr); if (mePtr->type == TEAROFF_ENTRY) { Tcl_DString ds; + Tcl_DStringInit(&ds); Tcl_DStringAppend(&ds, "tk::TearOffMenu ", -1); Tcl_DStringAppend(&ds, Tk_PathName(menuPtr->tkwin), -1); @@ -1087,7 +1088,8 @@ TkInvokeMenu( result = Tcl_EvalObjEx(interp, commandPtr, TCL_EVAL_GLOBAL); Tcl_DecrRefCount(commandPtr); } - Tcl_Release((ClientData) mePtr); + Tcl_Release(mePtr); + done: return result; } @@ -1469,7 +1471,7 @@ DestroyMenuEntry( Tcl_UntraceVar(menuPtr->interp, varName, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, - MenuVarProc, (ClientData) mePtr); + MenuVarProc, mePtr); } TkpDestroyMenuEntry(mePtr); TkMenuEntryFreeDrawOptions(mePtr); @@ -1499,7 +1501,7 @@ static void MenuWorldChanged( ClientData instanceData) /* Information about widget. */ { - TkMenu *menuPtr = (TkMenu *) instanceData; + TkMenu *menuPtr = instanceData; int i; TkMenuConfigureDrawOptions(menuPtr); @@ -1536,7 +1538,7 @@ ConfigureMenu( register TkMenu *menuPtr, /* Information about widget; may or may not * already have values for some fields. */ int objc, /* Number of valid entries in argv. */ - Tcl_Obj *CONST objv[]) /* Arguments. */ + Tcl_Obj *const objv[]) /* Arguments. */ { int i; TkMenu *menuListPtr, *cleanupPtr; @@ -1620,8 +1622,7 @@ ConfigureMenu( && (menuListPtr->entries[0]->type == TEAROFF_ENTRY)) { int i; - Tcl_EventuallyFree((ClientData) menuListPtr->entries[0], - DestroyMenuEntry); + Tcl_EventuallyFree(menuListPtr->entries[0], DestroyMenuEntry); for (i = 0; i < menuListPtr->numEntries - 1; i++) { menuListPtr->entries[i] = menuListPtr->entries[i + 1]; @@ -1789,7 +1790,7 @@ PostProcessEntry( char *imageString = Tcl_GetString(mePtr->imagePtr); image = Tk_GetImage(menuPtr->interp, menuPtr->tkwin, imageString, - TkMenuImageProc, (ClientData) mePtr); + TkMenuImageProc, mePtr); if (image == NULL) { return TCL_ERROR; } @@ -1804,7 +1805,7 @@ PostProcessEntry( char *selectImageString = Tcl_GetString(mePtr->selectImagePtr); image = Tk_GetImage(menuPtr->interp, menuPtr->tkwin, selectImageString, - TkMenuSelectImageProc, (ClientData) mePtr); + TkMenuSelectImageProc, mePtr); if (image == NULL) { return TCL_ERROR; } @@ -1871,7 +1872,7 @@ PostProcessEntry( name = Tcl_GetString(mePtr->namePtr); Tcl_TraceVar(menuPtr->interp, name, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, - MenuVarProc, (ClientData) mePtr); + MenuVarProc, mePtr); } } @@ -1902,7 +1903,7 @@ ConfigureMenuEntry( register TkMenuEntry *mePtr,/* Information about menu entry; may or may * not already have values for some fields. */ int objc, /* Number of valid entries in argv. */ - Tcl_Obj *CONST objv[]) /* Arguments. */ + Tcl_Obj *const objv[]) /* Arguments. */ { TkMenu *menuPtr = mePtr->menuPtr; Tk_SavedOptions errorStruct; @@ -1920,7 +1921,7 @@ ConfigureMenuEntry( Tcl_UntraceVar(menuPtr->interp, name, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, - MenuVarProc, (ClientData) mePtr); + MenuVarProc, mePtr); } result = TCL_OK; @@ -1967,7 +1968,7 @@ ConfigureMenuCloneEntries( TkMenu *menuPtr, /* Information about whole menu. */ int index, /* Index of mePtr within menuPtr's entries. */ int objc, /* Number of valid entries in argv. */ - Tcl_Obj *CONST objv[]) /* Arguments. */ + Tcl_Obj *const objv[]) /* Arguments. */ { TkMenuEntry *mePtr; TkMenu *menuListPtr; @@ -2195,7 +2196,7 @@ static void MenuCmdDeletedProc( ClientData clientData) /* Pointer to widget record for widget. */ { - TkMenu *menuPtr = (TkMenu *) clientData; + TkMenu *menuPtr = clientData; Tk_Window tkwin = menuPtr->tkwin; /* @@ -2336,7 +2337,7 @@ MenuAddOrInsert( Tcl_Obj *indexPtr, /* Object describing index at which to insert. * NULL means insert at end. */ int objc, /* Number of elements in objv. */ - Tcl_Obj *CONST objv[]) /* Arguments to command: first arg is type of + Tcl_Obj *const objv[]) /* Arguments to command: first arg is type of * entry, others are config options. */ { int type, index; @@ -2386,7 +2387,7 @@ MenuAddOrInsert( for (errorMenuPtr = menuPtr->masterMenuPtr; errorMenuPtr != NULL; errorMenuPtr = errorMenuPtr->nextInstancePtr) { - Tcl_EventuallyFree((ClientData) errorMenuPtr->entries[index], + Tcl_EventuallyFree(errorMenuPtr->entries[index], DestroyMenuEntry); for (i = index; i < errorMenuPtr->numEntries - 1; i++) { errorMenuPtr->entries[i] = errorMenuPtr->entries[i + 1]; @@ -2474,15 +2475,14 @@ static char * MenuVarProc( ClientData clientData, /* Information about menu entry. */ Tcl_Interp *interp, /* Interpreter containing variable. */ - CONST char *name1, /* First part of variable's name. */ - CONST char *name2, /* Second part of variable's name. */ + const char *name1, /* First part of variable's name. */ + const char *name2, /* Second part of variable's name. */ int flags) /* Describes what just happened. */ { - TkMenuEntry *mePtr = (TkMenuEntry *) clientData; + TkMenuEntry *mePtr = clientData; TkMenu *menuPtr; - CONST char *value; - char *name; - char *onValue; + const char *value; + char *name, *onValue; if (flags & TCL_INTERP_DESTROYED) { /* @@ -2686,7 +2686,7 @@ CloneMenu( for (i = 0; i < 4; i++) { Tcl_IncrRefCount(menuDupCommandArray[i]); } - Tcl_Preserve((ClientData) menuPtr); + Tcl_Preserve(menuPtr); returnResult = Tcl_EvalObjv(menuPtr->interp, 4, menuDupCommandArray, 0); for (i = 0; i < 4; i++) { Tcl_DecrRefCount(menuDupCommandArray[i]); @@ -2732,8 +2732,8 @@ CloneMenu( newObjv[1] = Tcl_NewStringObj(Tk_PathName(newMenuPtr->tkwin), -1); Tcl_IncrRefCount(newObjv[0]); Tcl_IncrRefCount(newObjv[1]); - if (Tk_BindtagsObjCmd((ClientData)newMenuPtr->tkwin, - newMenuPtr->interp, 2, newObjv) == TCL_OK) { + if (Tk_BindtagsObjCmd(newMenuPtr->tkwin, newMenuPtr->interp, 2, + newObjv) == TCL_OK) { char *windowName; Tcl_Obj *bindingsPtr = Tcl_DuplicateObj(Tcl_GetObjResult(newMenuPtr->interp)); @@ -2758,8 +2758,8 @@ CloneMenu( Tcl_ListObjReplace(menuPtr->interp, bindingsPtr, i + 1, 0, 1, &newElementPtr); newObjv[2] = bindingsPtr; - Tk_BindtagsObjCmd((ClientData)newMenuPtr->tkwin, - menuPtr->interp, 3, newObjv); + Tk_BindtagsObjCmd(newMenuPtr->tkwin, menuPtr->interp, 3, + newObjv); break; } } @@ -2811,7 +2811,7 @@ CloneMenu( } else { returnResult = TCL_ERROR; } - Tcl_Release((ClientData) menuPtr); + Tcl_Release(menuPtr); return returnResult; } @@ -3271,8 +3271,8 @@ DestroyMenuHashTable( ClientData clientData, /* The menu hash table we are destroying. */ Tcl_Interp *interp) /* The interpreter we are destroying. */ { - Tcl_DeleteHashTable((Tcl_HashTable *) clientData); - ckfree((char *) clientData); + Tcl_DeleteHashTable(clientData); + ckfree(clientData); } /* @@ -3305,7 +3305,7 @@ TkGetMenuHashTable( menuTablePtr = (Tcl_HashTable *) ckalloc(sizeof(Tcl_HashTable)); Tcl_InitHashTable(menuTablePtr, TCL_STRING_KEYS); Tcl_SetAssocData(interp, MENU_HASH_KEY, DestroyMenuHashTable, - (ClientData) menuTablePtr); + menuTablePtr); } return menuTablePtr; } @@ -3348,9 +3348,9 @@ TkCreateMenuReferences( menuRefPtr->topLevelListPtr = NULL; menuRefPtr->parentEntryPtr = NULL; menuRefPtr->hashEntryPtr = hashEntryPtr; - Tcl_SetHashValue(hashEntryPtr, (char *) menuRefPtr); + Tcl_SetHashValue(hashEntryPtr, menuRefPtr); } else { - menuRefPtr = (TkMenuReferences *) Tcl_GetHashValue(hashEntryPtr); + menuRefPtr = Tcl_GetHashValue(hashEntryPtr); } return menuRefPtr; } @@ -3387,7 +3387,7 @@ TkFindMenuReferences( menuTablePtr = TkGetMenuHashTable(interp); hashEntryPtr = Tcl_FindHashEntry(menuTablePtr, pathName); if (hashEntryPtr != NULL) { - menuRefPtr = (TkMenuReferences *) Tcl_GetHashValue(hashEntryPtr); + menuRefPtr = Tcl_GetHashValue(hashEntryPtr); } return menuRefPtr; } @@ -3485,8 +3485,7 @@ DeleteMenuCloneEntries( for (menuListPtr = menuPtr->masterMenuPtr; menuListPtr != NULL; menuListPtr = menuListPtr->nextInstancePtr) { for (i = last; i >= first; i--) { - Tcl_EventuallyFree((ClientData) menuListPtr->entries[i], - DestroyMenuEntry); + Tcl_EventuallyFree(menuListPtr->entries[i], DestroyMenuEntry); } for (i = last + 1; i < menuListPtr->numEntries; i++) { j = i - numDeleted; @@ -3552,7 +3551,7 @@ TkMenuCleanup( void TkMenuInit(void) { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (!menusInitialized) { diff --git a/generic/tkMenubutton.c b/generic/tkMenubutton.c index 7d3622a..2113f8c 100644 --- a/generic/tkMenubutton.c +++ b/generic/tkMenubutton.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMenubutton.c,v 1.19 2007/12/13 23:08:43 hobbs Exp $ + * RCS: @(#) $Id: tkMenubutton.c,v 1.20 2008/04/27 22:38:56 dkf Exp $ */ #include "tkInt.h" @@ -153,7 +153,7 @@ static const Tk_OptionSpec optionSpecs[] = { * dispatch the scale widget command. */ -static CONST char *commandNames[] = { +static const char *commandNames[] = { "cget", "configure", NULL }; @@ -172,14 +172,14 @@ static void MenuButtonImageProc(ClientData clientData, int x, int y, int width, int height, int imgWidth, int imgHeight); static char * MenuButtonTextVarProc(ClientData clientData, - Tcl_Interp *interp, CONST char *name1, - CONST char *name2, int flags); + Tcl_Interp *interp, const char *name1, + const char *name2, int flags); static int MenuButtonWidgetObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int ConfigureMenuButton(Tcl_Interp *interp, TkMenuButton *mbPtr, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static void DestroyMenuButton(char *memPtr); /* @@ -205,7 +205,7 @@ Tk_MenubuttonObjCmd( ClientData clientData, /* NULL. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register TkMenuButton *mbPtr; Tk_OptionTable optionTable; @@ -236,7 +236,7 @@ Tk_MenubuttonObjCmd( Tk_SetClass(tkwin, "Menubutton"); mbPtr = TkpCreateMenuButton(tkwin); - Tk_SetClassProcs(tkwin, &tkpMenubuttonClass, (ClientData) mbPtr); + Tk_SetClassProcs(tkwin, &tkpMenubuttonClass, mbPtr); /* * Initialize the data structure for the button. @@ -246,8 +246,8 @@ Tk_MenubuttonObjCmd( mbPtr->display = Tk_Display (tkwin); mbPtr->interp = interp; mbPtr->widgetCmd = Tcl_CreateObjCommand(interp, - Tk_PathName(mbPtr->tkwin), MenuButtonWidgetObjCmd, - (ClientData) mbPtr, MenuButtonCmdDeletedProc); + Tk_PathName(mbPtr->tkwin), MenuButtonWidgetObjCmd, mbPtr, + MenuButtonCmdDeletedProc); mbPtr->optionTable = optionTable; mbPtr->menuName = NULL; mbPtr->text = NULL; @@ -296,7 +296,7 @@ Tk_MenubuttonObjCmd( Tk_CreateEventHandler(mbPtr->tkwin, ExposureMask|StructureNotifyMask|FocusChangeMask, - MenuButtonEventProc, (ClientData) mbPtr); + MenuButtonEventProc, mbPtr); if (Tk_InitOptions(interp, (char *) mbPtr, optionTable, tkwin) != TCL_OK) { Tk_DestroyWindow(mbPtr->tkwin); @@ -335,9 +335,9 @@ MenuButtonWidgetObjCmd( ClientData clientData, /* Information about button widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { - register TkMenuButton *mbPtr = (TkMenuButton *) clientData; + register TkMenuButton *mbPtr = clientData; int result, index; Tcl_Obj *objPtr; @@ -350,7 +350,7 @@ MenuButtonWidgetObjCmd( if (result != TCL_OK) { return result; } - Tcl_Preserve((ClientData) mbPtr); + Tcl_Preserve(mbPtr); switch (index) { case COMMAND_CGET: @@ -383,11 +383,11 @@ MenuButtonWidgetObjCmd( } break; } - Tcl_Release((ClientData) mbPtr); + Tcl_Release(mbPtr); return result; error: - Tcl_Release((ClientData) mbPtr); + Tcl_Release(mbPtr); return TCL_ERROR; } @@ -418,7 +418,7 @@ DestroyMenuButton( TkpDestroyMenuButton(mbPtr); if (mbPtr->flags & REDRAW_PENDING) { - Tcl_CancelIdleCall(TkpDisplayMenuButton, (ClientData) mbPtr); + Tcl_CancelIdleCall(TkpDisplayMenuButton, mbPtr); } /* @@ -430,7 +430,7 @@ DestroyMenuButton( if (mbPtr->textVarName != NULL) { Tcl_UntraceVar(mbPtr->interp, mbPtr->textVarName, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, - MenuButtonTextVarProc, (ClientData) mbPtr); + MenuButtonTextVarProc, mbPtr); } if (mbPtr->image != NULL) { Tk_FreeImage(mbPtr->image); @@ -455,7 +455,7 @@ DestroyMenuButton( } Tk_FreeConfigOptions((char *) mbPtr, mbPtr->optionTable, mbPtr->tkwin); mbPtr->tkwin = NULL; - Tcl_EventuallyFree((ClientData) mbPtr, TCL_DYNAMIC); + Tcl_EventuallyFree(mbPtr, TCL_DYNAMIC); } /* @@ -486,7 +486,7 @@ ConfigureMenuButton( /* Information about widget; may or may not * already have values for some fields. */ int objc, /* Number of valid entries in objv. */ - Tcl_Obj *CONST objv[]) /* Arguments. */ + Tcl_Obj *const objv[]) /* Arguments. */ { Tk_SavedOptions savedOptions; Tcl_Obj *errorResult = NULL; @@ -500,7 +500,7 @@ ConfigureMenuButton( if (mbPtr->textVarName != NULL) { Tcl_UntraceVar(interp, mbPtr->textVarName, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, - MenuButtonTextVarProc, (ClientData) mbPtr); + MenuButtonTextVarProc, mbPtr); } /* @@ -563,8 +563,7 @@ ConfigureMenuButton( if (mbPtr->imageString != NULL) { image = Tk_GetImage(mbPtr->interp, mbPtr->tkwin, - mbPtr->imageString, MenuButtonImageProc, - (ClientData) mbPtr); + mbPtr->imageString, MenuButtonImageProc, mbPtr); if (image == NULL) { return TCL_ERROR; } @@ -616,7 +615,7 @@ ConfigureMenuButton( * Set up a trace to watch for any changes in it, create the variable * if it doesn't exist, and fetch its current value. */ - CONST char *value; + const char *value; value = Tcl_GetVar(interp, mbPtr->textVarName, TCL_GLOBAL_ONLY); if (value == NULL) { @@ -631,10 +630,10 @@ ConfigureMenuButton( } Tcl_TraceVar(interp, mbPtr->textVarName, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, - MenuButtonTextVarProc, (ClientData) mbPtr); + MenuButtonTextVarProc, mbPtr); } - TkMenuButtonWorldChanged((ClientData) mbPtr); + TkMenuButtonWorldChanged(mbPtr); if (error) { Tcl_SetObjResult(interp, errorResult); Tcl_DecrRefCount(errorResult); @@ -668,9 +667,7 @@ TkMenuButtonWorldChanged( XGCValues gcValues; GC gc; unsigned long mask; - TkMenuButton *mbPtr; - - mbPtr = (TkMenuButton *) instanceData; + TkMenuButton *mbPtr = instanceData; gcValues.font = Tk_FontId(mbPtr->tkfont); gcValues.foreground = mbPtr->normalFg->pixel; @@ -743,7 +740,7 @@ TkMenuButtonWorldChanged( */ if (Tk_IsMapped(mbPtr->tkwin) && !(mbPtr->flags & REDRAW_PENDING)) { - Tcl_DoWhenIdle(TkpDisplayMenuButton, (ClientData) mbPtr); + Tcl_DoWhenIdle(TkpDisplayMenuButton, mbPtr); mbPtr->flags |= REDRAW_PENDING; } } @@ -771,7 +768,7 @@ MenuButtonEventProc( ClientData clientData, /* Information about window. */ XEvent *eventPtr) /* Information about event. */ { - TkMenuButton *mbPtr = (TkMenuButton *) clientData; + TkMenuButton *mbPtr = clientData; if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) { goto redraw; } else if (eventPtr->type == ConfigureNotify) { @@ -802,7 +799,7 @@ MenuButtonEventProc( redraw: if ((mbPtr->tkwin != NULL) && !(mbPtr->flags & REDRAW_PENDING)) { - Tcl_DoWhenIdle(TkpDisplayMenuButton, (ClientData) mbPtr); + Tcl_DoWhenIdle(TkpDisplayMenuButton, mbPtr); mbPtr->flags |= REDRAW_PENDING; } } @@ -829,7 +826,7 @@ static void MenuButtonCmdDeletedProc( ClientData clientData) /* Pointer to widget record for widget. */ { - TkMenuButton *mbPtr = (TkMenuButton *) clientData; + TkMenuButton *mbPtr = clientData; Tk_Window tkwin = mbPtr->tkwin; /* @@ -867,12 +864,12 @@ static char * MenuButtonTextVarProc( ClientData clientData, /* Information about button. */ Tcl_Interp *interp, /* Interpreter containing variable. */ - CONST char *name1, /* Name of variable. */ - CONST char *name2, /* Second part of variable name. */ + const char *name1, /* Name of variable. */ + const char *name2, /* Second part of variable name. */ int flags) /* Information about what happened. */ { - register TkMenuButton *mbPtr = (TkMenuButton *) clientData; - CONST char *value; + register TkMenuButton *mbPtr = clientData; + const char *value; unsigned len; /* @@ -905,7 +902,7 @@ MenuButtonTextVarProc( if ((mbPtr->tkwin != NULL) && Tk_IsMapped(mbPtr->tkwin) && !(mbPtr->flags & REDRAW_PENDING)) { - Tcl_DoWhenIdle(TkpDisplayMenuButton, (ClientData) mbPtr); + Tcl_DoWhenIdle(TkpDisplayMenuButton, mbPtr); mbPtr->flags |= REDRAW_PENDING; } return NULL; @@ -938,12 +935,12 @@ MenuButtonImageProc( * 0). */ int imgWidth, int imgHeight)/* New dimensions of image. */ { - register TkMenuButton *mbPtr = (TkMenuButton *) clientData; + register TkMenuButton *mbPtr = clientData; if (mbPtr->tkwin != NULL) { TkpComputeMenuButtonGeometry(mbPtr); if (Tk_IsMapped(mbPtr->tkwin) && !(mbPtr->flags & REDRAW_PENDING)) { - Tcl_DoWhenIdle(TkpDisplayMenuButton, (ClientData) mbPtr); + Tcl_DoWhenIdle(TkpDisplayMenuButton, mbPtr); mbPtr->flags |= REDRAW_PENDING; } } diff --git a/generic/tkMessage.c b/generic/tkMessage.c index 048bb5c..ff33d48 100644 --- a/generic/tkMessage.c +++ b/generic/tkMessage.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMessage.c,v 1.19 2007/12/13 15:24:16 dgp Exp $ + * RCS: @(#) $Id: tkMessage.c,v 1.20 2008/04/27 22:38:56 dkf Exp $ */ #include "default.h" @@ -173,15 +173,15 @@ static void MessageCmdDeletedProc(ClientData clientData); static void MessageEventProc(ClientData clientData, XEvent *eventPtr); static char * MessageTextVarProc(ClientData clientData, - Tcl_Interp *interp, CONST char *name1, - CONST char *name2, int flags); + Tcl_Interp *interp, const char *name1, + const char *name2, int flags); static int MessageWidgetObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static void MessageWorldChanged(ClientData instanceData); static void ComputeMessageGeometry(Message *msgPtr); static int ConfigureMessage(Tcl_Interp *interp, Message *msgPtr, - int objc, Tcl_Obj *CONST objv[], int flags); + int objc, Tcl_Obj *const objv[], int flags); static void DestroyMessage(char *memPtr); static void DisplayMessage(ClientData clientData); @@ -217,7 +217,7 @@ Tk_MessageObjCmd( ClientData clientData, /* NULL. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument strings. */ + Tcl_Obj *const objv[]) /* Argument strings. */ { register Message *msgPtr; Tk_OptionTable optionTable; @@ -252,8 +252,8 @@ Tk_MessageObjCmd( msgPtr->display = Tk_Display(tkwin); msgPtr->interp = interp; msgPtr->widgetCmd = Tcl_CreateObjCommand(interp, - Tk_PathName(msgPtr->tkwin), MessageWidgetObjCmd, - (ClientData) msgPtr, MessageCmdDeletedProc); + Tk_PathName(msgPtr->tkwin), MessageWidgetObjCmd, msgPtr, + MessageCmdDeletedProc); msgPtr->optionTable = optionTable; msgPtr->relief = TK_RELIEF_FLAT; msgPtr->textGC = None; @@ -263,10 +263,10 @@ Tk_MessageObjCmd( msgPtr->cursor = None; Tk_SetClass(msgPtr->tkwin, "Message"); - Tk_SetClassProcs(msgPtr->tkwin, &messageClass, (ClientData) msgPtr); + Tk_SetClassProcs(msgPtr->tkwin, &messageClass, msgPtr); Tk_CreateEventHandler(msgPtr->tkwin, ExposureMask|StructureNotifyMask|FocusChangeMask, - MessageEventProc, (ClientData) msgPtr); + MessageEventProc, msgPtr); if (Tk_InitOptions(interp, (char *)msgPtr, optionTable, tkwin) != TCL_OK) { Tk_DestroyWindow(msgPtr->tkwin); return TCL_ERROR; @@ -304,10 +304,10 @@ MessageWidgetObjCmd( ClientData clientData, /* Information about message widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument strings. */ + Tcl_Obj *const objv[]) /* Argument strings. */ { - register Message *msgPtr = (Message *) clientData; - static CONST char *optionStrings[] = { "cget", "configure", NULL }; + register Message *msgPtr = clientData; + static const char *optionStrings[] = { "cget", "configure", NULL }; enum options { MESSAGE_CGET, MESSAGE_CONFIGURE }; int index; int result = TCL_OK; @@ -323,7 +323,7 @@ MessageWidgetObjCmd( return TCL_ERROR; } - Tcl_Preserve((ClientData) msgPtr); + Tcl_Preserve(msgPtr); switch ((enum options) index) { case MESSAGE_CGET: @@ -358,7 +358,7 @@ MessageWidgetObjCmd( break; } - Tcl_Release((ClientData) msgPtr); + Tcl_Release(msgPtr); return result; } @@ -390,7 +390,7 @@ DestroyMessage( Tcl_DeleteCommandFromToken(msgPtr->interp, msgPtr->widgetCmd); if (msgPtr->flags & REDRAW_PENDING) { - Tcl_CancelIdleCall(DisplayMessage, (ClientData) msgPtr); + Tcl_CancelIdleCall(DisplayMessage, msgPtr); } /* @@ -407,7 +407,7 @@ DestroyMessage( if (msgPtr->textVarName != NULL) { Tcl_UntraceVar(msgPtr->interp, msgPtr->textVarName, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, - MessageTextVarProc, (ClientData) msgPtr); + MessageTextVarProc, msgPtr); } Tk_FreeConfigOptions((char *) msgPtr, msgPtr->optionTable, msgPtr->tkwin); msgPtr->tkwin = NULL; @@ -440,7 +440,7 @@ ConfigureMessage( register Message *msgPtr, /* Information about widget; may or may not * already have values for some fields. */ int objc, /* Number of valid entries in argv. */ - Tcl_Obj *CONST objv[], /* Arguments. */ + Tcl_Obj *const objv[], /* Arguments. */ int flags) /* Flags to pass to Tk_ConfigureWidget. */ { Tk_SavedOptions savedOptions; @@ -452,7 +452,7 @@ ConfigureMessage( if (msgPtr->textVarName != NULL) { Tcl_UntraceVar(interp, msgPtr->textVarName, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, - MessageTextVarProc, (ClientData) msgPtr); + MessageTextVarProc, msgPtr); } if (Tk_SetOptions(interp, (char *) msgPtr, msgPtr->optionTable, objc, objv, @@ -468,7 +468,7 @@ ConfigureMessage( */ if (msgPtr->textVarName != NULL) { - CONST char *value; + const char *value; value = Tcl_GetVar(interp, msgPtr->textVarName, TCL_GLOBAL_ONLY); if (value == NULL) { @@ -482,7 +482,7 @@ ConfigureMessage( } Tcl_TraceVar(interp, msgPtr->textVarName, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, - MessageTextVarProc, (ClientData) msgPtr); + MessageTextVarProc, msgPtr); } /* @@ -498,7 +498,7 @@ ConfigureMessage( } Tk_FreeSavedOptions(&savedOptions); - MessageWorldChanged((ClientData) msgPtr); + MessageWorldChanged(msgPtr); return TCL_OK; } @@ -559,7 +559,7 @@ MessageWorldChanged( ComputeMessageGeometry(msgPtr); if ((msgPtr->tkwin != NULL) && Tk_IsMapped(msgPtr->tkwin) && !(msgPtr->flags & REDRAW_PENDING)) { - Tcl_DoWhenIdle(DisplayMessage, (ClientData) msgPtr); + Tcl_DoWhenIdle(DisplayMessage, msgPtr); msgPtr->flags |= REDRAW_PENDING; } } @@ -668,7 +668,7 @@ static void DisplayMessage( ClientData clientData) /* Information about window. */ { - register Message *msgPtr = (Message *) clientData; + register Message *msgPtr = clientData; register Tk_Window tkwin = msgPtr->tkwin; int x, y; int borderWidth = msgPtr->highlightWidth; @@ -744,13 +744,13 @@ MessageEventProc( ClientData clientData, /* Information about window. */ XEvent *eventPtr) /* Information about event. */ { - Message *msgPtr = (Message *) clientData; + Message *msgPtr = clientData; if (((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) || (eventPtr->type == ConfigureNotify)) { goto redraw; } else if (eventPtr->type == DestroyNotify) { - DestroyMessage((char *) clientData); + DestroyMessage(clientData); } else if (eventPtr->type == FocusIn) { if (eventPtr->xfocus.detail != NotifyInferior) { msgPtr->flags |= GOT_FOCUS; @@ -770,7 +770,7 @@ MessageEventProc( redraw: if ((msgPtr->tkwin != NULL) && !(msgPtr->flags & REDRAW_PENDING)) { - Tcl_DoWhenIdle(DisplayMessage, (ClientData) msgPtr); + Tcl_DoWhenIdle(DisplayMessage, msgPtr); msgPtr->flags |= REDRAW_PENDING; } } @@ -797,7 +797,7 @@ static void MessageCmdDeletedProc( ClientData clientData) /* Pointer to widget record for widget. */ { - Message *msgPtr = (Message *) clientData; + Message *msgPtr = clientData; /* * This function could be invoked either because the window was destroyed @@ -833,12 +833,12 @@ static char * MessageTextVarProc( ClientData clientData, /* Information about message. */ Tcl_Interp *interp, /* Interpreter containing variable. */ - CONST char *name1, /* Name of variable. */ - CONST char *name2, /* Second part of variable name. */ + const char *name1, /* Name of variable. */ + const char *name2, /* Second part of variable name. */ int flags) /* Information about what happened. */ { - register Message *msgPtr = (Message *) clientData; - CONST char *value; + register Message *msgPtr = clientData; + const char *value; /* * If the variable is unset, then immediately recreate it unless the whole @@ -870,7 +870,7 @@ MessageTextVarProc( if ((msgPtr->tkwin != NULL) && Tk_IsMapped(msgPtr->tkwin) && !(msgPtr->flags & REDRAW_PENDING)) { - Tcl_DoWhenIdle(DisplayMessage, (ClientData) msgPtr); + Tcl_DoWhenIdle(DisplayMessage, msgPtr); msgPtr->flags |= REDRAW_PENDING; } return NULL; diff --git a/generic/tkObj.c b/generic/tkObj.c index 15f01ac..ce1c649 100644 --- a/generic/tkObj.c +++ b/generic/tkObj.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkObj.c,v 1.19 2007/12/13 15:24:16 dgp Exp $ + * RCS: @(#) $Id: tkObj.c,v 1.20 2008/04/27 22:38:56 dkf Exp $ */ #include "tkInt.h" @@ -36,7 +36,7 @@ typedef struct PixelRep { #define SET_COMPLEXPIXEL(objPtr, repPtr) \ (objPtr)->internalRep.twoPtrValue.ptr1 = 0; \ - (objPtr)->internalRep.twoPtrValue.ptr2 = (VOID *) repPtr + (objPtr)->internalRep.twoPtrValue.ptr2 = (void *) repPtr #define GET_COMPLEXPIXEL(objPtr) \ ((PixelRep *) (objPtr)->internalRep.twoPtrValue.ptr2) @@ -476,7 +476,7 @@ DupMMInternalRep( newPtr->units = oldPtr->units; newPtr->tkwin = oldPtr->tkwin; newPtr->returnValue = oldPtr->returnValue; - copyPtr->internalRep.otherValuePtr = (VOID *) newPtr; + copyPtr->internalRep.otherValuePtr = (void *) newPtr; } /* @@ -639,7 +639,7 @@ SetMMFromAny( mmPtr->tkwin = NULL; mmPtr->returnValue = d; - objPtr->internalRep.otherValuePtr = (VOID *) mmPtr; + objPtr->internalRep.otherValuePtr = (void *) mmPtr; return TCL_OK; } @@ -747,7 +747,7 @@ SetWindowFromAny( winPtr->mainPtr = NULL; winPtr->epoch = 0; - objPtr->internalRep.otherValuePtr = (VOID*)winPtr; + objPtr->internalRep.otherValuePtr = (void *) winPtr; objPtr->typePtr = &windowObjType; return TCL_OK; @@ -783,7 +783,7 @@ DupWindowInternalRep( newPtr->tkwin = oldPtr->tkwin; newPtr->mainPtr = oldPtr->mainPtr; newPtr->epoch = oldPtr->epoch; - copyPtr->internalRep.otherValuePtr = (VOID *)newPtr; + copyPtr->internalRep.otherValuePtr = (void *) newPtr; copyPtr->typePtr = srcPtr->typePtr; } diff --git a/generic/tkOldConfig.c b/generic/tkOldConfig.c index 8a46c58..37d278d 100644 --- a/generic/tkOldConfig.c +++ b/generic/tkOldConfig.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkOldConfig.c,v 1.23 2007/12/13 15:24:16 dgp Exp $ + * RCS: @(#) $Id: tkOldConfig.c,v 1.24 2008/04/27 22:38:56 dkf Exp $ */ #include "tkPort.h" @@ -35,11 +35,11 @@ static int DoConfig(Tcl_Interp *interp, Tk_Window tkwin, Tk_ConfigSpec *specPtr, Tk_Uid value, int valueIsUid, char *widgRec); static Tk_ConfigSpec * FindConfigSpec(Tcl_Interp *interp, - Tk_ConfigSpec *specs, CONST char *argvName, + Tk_ConfigSpec *specs, const char *argvName, int needFlags, int hateFlags); static char * FormatConfigInfo(Tcl_Interp *interp, Tk_Window tkwin, Tk_ConfigSpec *specPtr, char *widgRec); -static CONST char * FormatConfigValue(Tcl_Interp *interp, Tk_Window tkwin, +static const char * FormatConfigValue(Tcl_Interp *interp, Tk_Window tkwin, Tk_ConfigSpec *specPtr, char *widgRec, char *buffer, Tcl_FreeProc **freeProcPtr); static Tk_ConfigSpec * GetCachedSpecs(Tcl_Interp *interp, @@ -76,7 +76,7 @@ Tk_ConfigureWidget( * X resources). */ Tk_ConfigSpec *specs, /* Describes legal options. */ int argc, /* Number of elements in argv. */ - CONST char **argv, /* Command-line options. */ + const char **argv, /* Command-line options. */ char *widgRec, /* Record whose fields are to be modified. * Values must be properly initialized. */ int flags) /* Used to specify additional flags that must @@ -120,7 +120,7 @@ Tk_ConfigureWidget( */ for ( ; argc > 0; argc -= 2, argv += 2) { - CONST char *arg; + const char *arg; if (flags & TK_CONFIG_OBJS) { arg = Tcl_GetStringFromObj((Tcl_Obj *) *argv, NULL); @@ -242,7 +242,7 @@ FindConfigSpec( Tcl_Interp *interp, /* Used for reporting errors. */ Tk_ConfigSpec *specs, /* Pointer to table of configuration * specifications for a widget. */ - CONST char *argvName, /* Name (suitable for use in a "config" + const char *argvName, /* Name (suitable for use in a "config" * command) identifying particular option. */ int needFlags, /* Flags that must be present in matching * entry. */ @@ -597,7 +597,7 @@ Tk_ConfigureInfo( Tk_ConfigSpec *specs, /* Describes legal options. */ char *widgRec, /* Record whose fields contain current values * for options. */ - CONST char *argvName, /* If non-NULL, indicates a single option + const char *argvName, /* If non-NULL, indicates a single option * whose info is to be returned. Otherwise * info is returned for all options. */ int flags) /* Used to specify additional flags that must @@ -692,7 +692,7 @@ FormatConfigInfo( char *widgRec) /* Pointer to record holding current values of * info for widget. */ { - CONST char *argv[6]; + const char *argv[6]; char *result; char buffer[200]; Tcl_FreeProc *freeProc = NULL; @@ -721,9 +721,9 @@ FormatConfigInfo( result = Tcl_Merge(5, argv); if (freeProc != NULL) { if ((freeProc == TCL_DYNAMIC) || (freeProc == (Tcl_FreeProc *) free)) { - ckfree((char *)argv[4]); + ckfree((char *) argv[4]); } else { - (*freeProc)((char *)argv[4]); + (*freeProc)((char *) argv[4]); } } return result; @@ -749,7 +749,7 @@ FormatConfigInfo( *---------------------------------------------------------------------- */ -static CONST char * +static const char * FormatConfigValue( Tcl_Interp *interp, /* Interpreter for use in real conversions. */ Tk_Window tkwin, /* Window corresponding to widget. */ @@ -763,7 +763,7 @@ FormatConfigValue( * function to free the result, or NULL if * result is static. */ { - CONST char *ptr, *result; + const char *ptr, *result; *freeProcPtr = NULL; ptr = widgRec + specPtr->offset; @@ -909,7 +909,7 @@ Tk_ConfigureValue( Tk_ConfigSpec *specs, /* Describes legal options. */ char *widgRec, /* Record whose fields contain current values * for options. */ - CONST char *argvName, /* Gives the command-line name for the option + const char *argvName, /* Gives the command-line name for the option * whose value is to be returned. */ int flags) /* Used to specify additional flags that must * be present in config specs for them to be @@ -918,7 +918,7 @@ Tk_ConfigureValue( Tk_ConfigSpec *specPtr; int needFlags, hateFlags; Tcl_FreeProc *freeProc; - CONST char *result; + const char *result; char buffer[200]; needFlags = flags & ~(TK_CONFIG_USER_BIT - 1); @@ -943,9 +943,9 @@ Tk_ConfigureValue( Tcl_SetResult(interp, (char *) result, TCL_VOLATILE); if (freeProc != NULL) { if ((freeProc == TCL_DYNAMIC) || (freeProc == (Tcl_FreeProc *) free)) { - ckfree((char *)result); + ckfree((char *) result); } else { - (*freeProc)((char *)result); + (*freeProc)((char *) result); } } return TCL_OK; @@ -1072,13 +1072,13 @@ GetCachedSpecs( * self-initializing code. */ - specCacheTablePtr = (Tcl_HashTable *) + specCacheTablePtr = Tcl_GetAssocData(interp, "tkConfigSpec.threadTable", NULL); if (specCacheTablePtr == NULL) { specCacheTablePtr = (Tcl_HashTable *) ckalloc(sizeof(Tcl_HashTable)); Tcl_InitHashTable(specCacheTablePtr, TCL_ONE_WORD_KEYS); Tcl_SetAssocData(interp, "tkConfigSpec.threadTable", - DeleteSpecCacheTable, (ClientData) specCacheTablePtr); + DeleteSpecCacheTable, specCacheTablePtr); } /* @@ -1110,7 +1110,7 @@ GetCachedSpecs( cachedSpecs = (Tk_ConfigSpec *) ckalloc(entrySpace); memcpy(cachedSpecs, staticSpecs, entrySpace); - Tcl_SetHashValue(entryPtr, (ClientData) cachedSpecs); + Tcl_SetHashValue(entryPtr, cachedSpecs); /* * Finally, go through and replace database names, database classes @@ -1133,7 +1133,7 @@ GetCachedSpecs( specPtr->specFlags &= ~TK_CONFIG_OPTION_SPECIFIED; } } else { - cachedSpecs = (Tk_ConfigSpec *) Tcl_GetHashValue(entryPtr); + cachedSpecs = Tcl_GetHashValue(entryPtr); } return cachedSpecs; @@ -1161,7 +1161,7 @@ DeleteSpecCacheTable( ClientData clientData, Tcl_Interp *interp) { - Tcl_HashTable *tablePtr = (Tcl_HashTable *) clientData; + Tcl_HashTable *tablePtr = clientData; Tcl_HashEntry *entryPtr; Tcl_HashSearch search; @@ -1171,7 +1171,7 @@ DeleteSpecCacheTable( * Someone else deallocates the Tk_Uids themselves. */ - ckfree((char *) Tcl_GetHashValue(entryPtr)); + ckfree(Tcl_GetHashValue(entryPtr)); } Tcl_DeleteHashTable(tablePtr); ckfree((char *) tablePtr); diff --git a/generic/tkOldTest.c b/generic/tkOldTest.c index 473d92c..cd7ae5b 100644 --- a/generic/tkOldTest.c +++ b/generic/tkOldTest.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkOldTest.c,v 1.1 2007/05/14 20:58:27 dgp Exp $ + * RCS: @(#) $Id: tkOldTest.c,v 1.2 2008/04/27 22:38:56 dkf Exp $ */ #define USE_OLD_IMAGE @@ -77,7 +77,7 @@ static Tk_ImageType imageType = { */ static int ImageCmd(ClientData dummy, - Tcl_Interp *interp, int argc, CONST char **argv); + Tcl_Interp *interp, int argc, const char **argv); MODULE_SCOPE int TkOldTestInit(Tcl_Interp *interp); @@ -171,8 +171,8 @@ ImageCreate( strcpy(timPtr->imageName, name); timPtr->varName = (char *) ckalloc((unsigned) (strlen(varName) + 1)); strcpy(timPtr->varName, varName); - Tcl_CreateCommand(interp, name, ImageCmd, (ClientData) timPtr, NULL); - *clientDataPtr = (ClientData) timPtr; + Tcl_CreateCommand(interp, name, ImageCmd, timPtr, NULL); + *clientDataPtr = timPtr; Tk_ImageChanged(master, 0, 0, 30, 15, 30, 15); return TCL_OK; } @@ -200,9 +200,9 @@ ImageCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int argc, /* Number of arguments. */ - CONST char **argv) /* Argument strings. */ + const char **argv) /* Argument strings. */ { - TImageMaster *timPtr = (TImageMaster *) clientData; + TImageMaster *timPtr = clientData; int x, y, width, height; if (argc < 2) { @@ -258,7 +258,7 @@ ImageGet( * used. */ ClientData clientData) /* Pointer to TImageMaster for image. */ { - TImageMaster *timPtr = (TImageMaster *) clientData; + TImageMaster *timPtr = clientData; TImageInstance *instPtr; char buffer[100]; XGCValues gcValues; @@ -272,7 +272,7 @@ ImageGet( instPtr->fg = Tk_GetColor(timPtr->interp, tkwin, "#ff0000"); gcValues.foreground = instPtr->fg->pixel; instPtr->gc = Tk_GetGC(tkwin, GCForeground, &gcValues); - return (ClientData) instPtr; + return instPtr; } /* @@ -305,7 +305,7 @@ ImageDisplay( /* Coordinates in drawable corresponding to * imageX and imageY. */ { - TImageInstance *instPtr = (TImageInstance *) clientData; + TImageInstance *instPtr = clientData; char buffer[200 + TCL_INTEGER_SPACE * 6]; sprintf(buffer, "%s display %d %d %d %d %d %d", @@ -350,7 +350,7 @@ ImageFree( ClientData clientData, /* Pointer to TImageInstance for instance. */ Display *display) /* Display where image was to be drawn. */ { - TImageInstance *instPtr = (TImageInstance *) clientData; + TImageInstance *instPtr = clientData; char buffer[200]; sprintf(buffer, "%s free", instPtr->masterPtr->imageName); @@ -384,7 +384,7 @@ ImageDelete( * this function is called, no more instances * exist. */ { - TImageMaster *timPtr = (TImageMaster *) clientData; + TImageMaster *timPtr = clientData; char buffer[100]; sprintf(buffer, "%s delete", timPtr->imageName); diff --git a/generic/tkOption.c b/generic/tkOption.c index 1fac8b4..06b67f9 100644 --- a/generic/tkOption.c +++ b/generic/tkOption.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkOption.c,v 1.24 2007/12/13 15:24:16 dgp Exp $ + * RCS: @(#) $Id: tkOption.c,v 1.25 2008/04/27 22:38:56 dkf Exp $ */ #include "tkInt.h" @@ -248,8 +248,8 @@ void Tk_AddOption( Tk_Window tkwin, /* Window token; option will be associated * with main window for this window. */ - CONST char *name, /* Multi-element name of option. */ - CONST char *value, /* String value for option. */ + const char *name, /* Multi-element name of option. */ + const char *value, /* String value for option. */ int priority) /* Overall priority level to use for this * option, such as TK_USER_DEFAULT_PRIO or * TK_INTERACTIVE_PRIO. Must be between 0 and @@ -259,13 +259,13 @@ Tk_AddOption( register ElArray **arrayPtrPtr; register Element *elPtr; Element newEl; - register CONST char *p; - CONST char *field; + register const char *p; + const char *field; int count, firstField; ptrdiff_t length; #define TMP_SIZE 100 char tmp[TMP_SIZE+1]; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (winPtr->mainPtr->optionRootPtr == NULL) { @@ -402,8 +402,8 @@ Tk_Uid Tk_GetOption( Tk_Window tkwin, /* Token for window that option is associated * with. */ - CONST char *name, /* Name of option. */ - CONST char *className) /* Class of option. NULL means there is no + const char *name, /* Name of option. */ + const char *className) /* Class of option. NULL means there is no * class for this option: just check for * name. */ { @@ -413,7 +413,7 @@ Tk_GetOption( register int count; StackLevel *levelPtr; int stackDepth[NUM_STACKS]; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* @@ -477,16 +477,16 @@ Tk_GetOption( */ for (elPtr = tsdPtr->stacks[EXACT_LEAF_NAME]->els, - count = stackDepth[EXACT_LEAF_NAME]; count > 0; - elPtr++, count--) { + count = stackDepth[EXACT_LEAF_NAME]; count > 0; + elPtr++, count--) { if ((elPtr->nameUid == nameId) && (elPtr->priority > bestPtr->priority)) { bestPtr = elPtr; } } for (elPtr = tsdPtr->stacks[WILDCARD_LEAF_NAME]->els, - count = stackDepth[WILDCARD_LEAF_NAME]; count > 0; - elPtr++, count--) { + count = stackDepth[WILDCARD_LEAF_NAME]; count > 0; + elPtr++, count--) { if ((elPtr->nameUid == nameId) && (elPtr->priority > bestPtr->priority)) { bestPtr = elPtr; @@ -496,16 +496,16 @@ Tk_GetOption( if (className != NULL) { classId = Tk_GetUid(className); for (elPtr = tsdPtr->stacks[EXACT_LEAF_CLASS]->els, - count = stackDepth[EXACT_LEAF_CLASS]; count > 0; - elPtr++, count--) { + count = stackDepth[EXACT_LEAF_CLASS]; count > 0; + elPtr++, count--) { if ((elPtr->nameUid == classId) && (elPtr->priority > bestPtr->priority)) { bestPtr = elPtr; } } for (elPtr = tsdPtr->stacks[WILDCARD_LEAF_CLASS]->els, - count = stackDepth[WILDCARD_LEAF_CLASS]; count > 0; - elPtr++, count--) { + count = stackDepth[WILDCARD_LEAF_CLASS]; count > 0; + elPtr++, count--) { if ((elPtr->nameUid == classId) && (elPtr->priority > bestPtr->priority)) { bestPtr = elPtr; @@ -535,7 +535,7 @@ Tk_GetOption( * Extract the masquerade class name from the name field. */ - classNameLength = (unsigned int)(masqName - name); + classNameLength = (unsigned) (masqName - name); masqClass = (char *) ckalloc(classNameLength + 1); strncpy(masqClass, name, classNameLength); masqClass[classNameLength] = '\0'; @@ -614,14 +614,14 @@ Tk_OptionObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of Tcl_Obj arguments. */ - Tcl_Obj *CONST objv[]) /* Tcl_Obj arguments. */ + Tcl_Obj *const objv[]) /* Tcl_Obj arguments. */ { - Tk_Window tkwin = (Tk_Window) clientData; + Tk_Window tkwin = clientData; int index, result; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - static CONST char *optionCmds[] = { + static const char *optionCmds[] = { "add", "clear", "get", "readfile", NULL }; @@ -644,6 +644,7 @@ Tk_OptionObjCmd( switch ((enum optionVals) index) { case OPTION_ADD: { int priority; + if ((objc != 4) && (objc != 5)) { Tcl_WrongNumArgs(interp, 2, objv, "pattern value ?priority?"); return TCL_ERROR; @@ -693,7 +694,7 @@ Tk_OptionObjCmd( value = Tk_GetOption(window, Tcl_GetString(objv[3]), Tcl_GetString(objv[4])); if (value != NULL) { - Tcl_SetResult(interp, (char *)value, TCL_STATIC); + Tcl_SetResult(interp, (char *) value, TCL_STATIC); } break; } @@ -743,7 +744,7 @@ void TkOptionDeadWindow( register TkWindow *winPtr) /* Window to be cleaned up. */ { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* @@ -799,7 +800,7 @@ TkOptionClassChanged( { int i, j, *basePtr; ElArray *arrayPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (winPtr->optionLevel == -1) { @@ -930,7 +931,6 @@ AddFromString( src = string; lineNum = 1; while (1) { - /* * Skip leading white space and empty lines and comment lines, and * check for the end of the spec. @@ -1073,7 +1073,7 @@ ReadOptionFile( * TK_INTERACTIVE_PRIO. Must be between 0 and * TK_MAX_PRIO. */ { - CONST char *realName; + const char *realName; char *buffer; int result, bufferSize; Tcl_Channel chan; @@ -1108,7 +1108,7 @@ ReadOptionFile( */ bufferSize = (int) Tcl_Seek(chan, (Tcl_WideInt) 0, SEEK_END); - (void) Tcl_Seek(chan, (Tcl_WideInt) 0, SEEK_SET); + Tcl_Seek(chan, (Tcl_WideInt) 0, SEEK_SET); if (bufferSize < 0) { Tcl_AppendResult(interp, "error seeking to end of file \"", @@ -1117,7 +1117,7 @@ ReadOptionFile( return TCL_ERROR; } - buffer = (char *) ckalloc((unsigned) bufferSize+1); + buffer = ckalloc((unsigned) bufferSize+1); bufferSize = Tcl_Read(chan, buffer, bufferSize); if (bufferSize < 0) { Tcl_AppendResult(interp, "error reading file \"", fileName, "\":", @@ -1153,9 +1153,8 @@ static ElArray * NewArray( int numEls) /* How many elements of space to allocate. */ { - register ElArray *arrayPtr; + register ElArray *arrayPtr = (ElArray *) ckalloc(EL_ARRAY_SIZE(numEls)); - arrayPtr = (ElArray *) ckalloc(EL_ARRAY_SIZE(numEls)); arrayPtr->arraySize = numEls; arrayPtr->numUsed = 0; arrayPtr->nextToUse = arrayPtr->els; @@ -1236,7 +1235,7 @@ SetupStacks( int level, i, *iPtr; register StackLevel *levelPtr; register ElArray *arrayPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* @@ -1313,10 +1312,8 @@ SetupStacks( */ if (tsdPtr->curLevel >= tsdPtr->numLevels) { - StackLevel *newLevels; - - newLevels = (StackLevel *) ckalloc((unsigned) - (tsdPtr->numLevels * 2 * sizeof(StackLevel))); + StackLevel *newLevels = (StackLevel *) + ckalloc((unsigned) (tsdPtr->numLevels*2*sizeof(StackLevel))); memcpy(newLevels, tsdPtr->levels, tsdPtr->numLevels * sizeof(StackLevel)); ckfree((char *) tsdPtr->levels); @@ -1398,7 +1395,7 @@ ExtendStacks( { register int count; register Element *elPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); for (elPtr = arrayPtr->els, count = arrayPtr->numUsed; @@ -1431,7 +1428,7 @@ static void OptionThreadExitProc( ClientData clientData) /* not used */ { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (tsdPtr->initialized) { @@ -1469,7 +1466,7 @@ OptionInit( { int i; Tcl_Interp *interp; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Element *defaultMatchPtr = &tsdPtr->defaultMatch; @@ -1505,7 +1502,7 @@ OptionInit( mainPtr->optionRootPtr = NewArray(20); interp = Tcl_CreateInterp(); - (void) GetDefaultOptions(interp, mainPtr->winPtr); + GetDefaultOptions(interp, mainPtr->winPtr); Tcl_DeleteInterp(interp); } diff --git a/generic/tkPack.c b/generic/tkPack.c index 0733d86..a266fba 100644 --- a/generic/tkPack.c +++ b/generic/tkPack.c @@ -10,20 +10,20 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkPack.c,v 1.27 2007/12/13 15:24:16 dgp Exp $ + * RCS: @(#) $Id: tkPack.c,v 1.28 2008/04/27 22:38:56 dkf Exp $ */ #include "tkInt.h" typedef enum {TOP, BOTTOM, LEFT, RIGHT} Side; -static CONST char *sideNames[] = { +static const char *sideNames[] = { "top", "bottom", "left", "right", NULL }; -/* For each window that the packer cares about (either because - * the window is managed by the packer or because the window - * has slaves that are managed by the packer), there is a - * structure of the following type: +/* + * For each window that the packer cares about (either because the window is + * managed by the packer or because the window has slaves that are managed by + * the packer), there is a structure of the following type: */ typedef struct Packer { @@ -34,9 +34,9 @@ typedef struct Packer { struct Packer *masterPtr; /* Master window within which this window is * packed (NULL means this window isn't * managed by the packer). */ - struct Packer *nextPtr; /* Next window packed within same master. - * List is priority-ordered: first on list - * gets packed first. */ + struct Packer *nextPtr; /* Next window packed within same master. List + * is priority-ordered: first on list gets + * packed first. */ struct Packer *slavePtr; /* First in list of slaves packed inside this * window (NULL means no packed slaves). */ Side side; /* Side of master against which this window is @@ -118,11 +118,11 @@ static const Tk_GeomMgr packerType = { static void ArrangePacking(ClientData clientData); static int ConfigureSlaves(Tcl_Interp *interp, Tk_Window tkwin, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static void DestroyPacker(char *memPtr); static Packer * GetPacker(Tk_Window tkwin); static int PackAfter(Tcl_Interp *interp, Packer *prevPtr, - Packer *masterPtr, int objc,Tcl_Obj *CONST objv[]); + Packer *masterPtr, int objc,Tcl_Obj *const objv[]); static void PackStructureProc(ClientData clientData, XEvent *eventPtr); static void Unlink(Packer *packPtr); @@ -130,7 +130,7 @@ static int XExpansion(Packer *slavePtr, int cavityWidth); static int YExpansion(Packer *slavePtr, int cavityHeight); /* - *-------------------------------------------------------------- + *------------------------------------------------------------------------ * * TkPrintPadAmount -- * @@ -144,7 +144,7 @@ static int YExpansion(Packer *slavePtr, int cavityHeight); * Side effects: * None. * - *-------------------------------------------------------------- + *------------------------------------------------------------------------ */ void @@ -166,7 +166,7 @@ TkPrintPadAmount( } /* - *-------------------------------------------------------------- + *------------------------------------------------------------------------ * * Tk_PackCmd -- * @@ -179,7 +179,7 @@ TkPrintPadAmount( * Side effects: * See the user documentation. * - *-------------------------------------------------------------- + *------------------------------------------------------------------------ */ int @@ -187,11 +187,11 @@ Tk_PackObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { - Tk_Window tkwin = (Tk_Window) clientData; + Tk_Window tkwin = clientData; char *argv2; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { /* after, append, before and unpack are deprecated */ "after", "append", "before", "unpack", "configure", "forget", "info", "propagate", "slaves", NULL }; @@ -202,6 +202,7 @@ Tk_PackObjCmd( if (objc >= 2) { char *string = Tcl_GetString(objv[1]); + if (string[0] == '.') { return ConfigureSlaves(interp, tkwin, objc-1, objv+1); } @@ -307,8 +308,7 @@ Tk_PackObjCmd( } slavePtr = GetPacker(slave); if ((slavePtr != NULL) && (slavePtr->masterPtr != NULL)) { - Tk_ManageGeometry(slave, NULL, - (ClientData) NULL); + Tk_ManageGeometry(slave, NULL, NULL); if (slavePtr->masterPtr->tkwin != Tk_Parent(slavePtr->tkwin)) { Tk_UnmaintainGeometry(slavePtr->tkwin, slavePtr->masterPtr->tkwin); @@ -397,7 +397,7 @@ Tk_PackObjCmd( } if (!(masterPtr->flags & REQUESTED_REPACK)) { masterPtr->flags |= REQUESTED_REPACK; - Tcl_DoWhenIdle(ArrangePacking, (ClientData) masterPtr); + Tcl_DoWhenIdle(ArrangePacking, masterPtr); } } else { masterPtr->flags |= DONT_PROPAGATE; @@ -435,8 +435,7 @@ Tk_PackObjCmd( } packPtr = GetPacker(tkwin2); if ((packPtr != NULL) && (packPtr->masterPtr != NULL)) { - Tk_ManageGeometry(tkwin2, NULL, - (ClientData) NULL); + Tk_ManageGeometry(tkwin2, NULL, NULL); if (packPtr->masterPtr->tkwin != Tk_Parent(packPtr->tkwin)) { Tk_UnmaintainGeometry(packPtr->tkwin, packPtr->masterPtr->tkwin); @@ -452,7 +451,7 @@ Tk_PackObjCmd( } /* - *-------------------------------------------------------------- + *------------------------------------------------------------------------ * * PackReqProc -- * @@ -466,7 +465,7 @@ Tk_PackObjCmd( * Arranges for tkwin, and all its managed siblings, to be re-packed at * the next idle point. * - *-------------------------------------------------------------- + *------------------------------------------------------------------------ */ /* ARGSUSED */ @@ -477,17 +476,17 @@ PackReqProc( Tk_Window tkwin) /* Other Tk-related information about the * window. */ { - register Packer *packPtr = (Packer *) clientData; + register Packer *packPtr = clientData; packPtr = packPtr->masterPtr; if (!(packPtr->flags & REQUESTED_REPACK)) { packPtr->flags |= REQUESTED_REPACK; - Tcl_DoWhenIdle(ArrangePacking, (ClientData) packPtr); + Tcl_DoWhenIdle(ArrangePacking, packPtr); } } /* - *-------------------------------------------------------------- + *------------------------------------------------------------------------ * * PackLostSlaveProc -- * @@ -500,7 +499,7 @@ PackReqProc( * Side effects: * Forgets all packer-related information about the slave. * - *-------------------------------------------------------------- + *------------------------------------------------------------------------ */ /* ARGSUSED */ @@ -510,7 +509,7 @@ PackLostSlaveProc( * stolen away. */ Tk_Window tkwin) /* Tk's handle for the slave window. */ { - register Packer *slavePtr = (Packer *) clientData; + register Packer *slavePtr = clientData; if (slavePtr->masterPtr->tkwin != Tk_Parent(slavePtr->tkwin)) { Tk_UnmaintainGeometry(slavePtr->tkwin, slavePtr->masterPtr->tkwin); @@ -520,7 +519,7 @@ PackLostSlaveProc( } /* - *-------------------------------------------------------------- + *------------------------------------------------------------------------ * * ArrangePacking -- * @@ -535,7 +534,7 @@ PackLostSlaveProc( * Side effects: * The packed slaves of masterPtr may get resized or moved. * - *-------------------------------------------------------------- + *------------------------------------------------------------------------ */ static void @@ -543,7 +542,7 @@ ArrangePacking( ClientData clientData) /* Structure describing master whose slaves * are to be re-layed out. */ { - register Packer *masterPtr = (Packer *) clientData; + register Packer *masterPtr = clientData; register Packer *slavePtr; int cavityX, cavityY, cavityWidth, cavityHeight; /* These variables keep track of the @@ -583,7 +582,7 @@ ArrangePacking( } masterPtr->abortPtr = &abort; abort = 0; - Tcl_Preserve((ClientData) masterPtr); + Tcl_Preserve(masterPtr); /* * Pass #1: scan all the slaves to figure out the total amount of space @@ -652,7 +651,7 @@ ArrangePacking( && !(masterPtr->flags & DONT_PROPAGATE)) { Tk_GeometryRequest(masterPtr->tkwin, maxWidth, maxHeight); masterPtr->flags |= REQUESTED_REPACK; - Tcl_DoWhenIdle(ArrangePacking, (ClientData) masterPtr); + Tcl_DoWhenIdle(ArrangePacking, masterPtr); goto done; } @@ -843,7 +842,7 @@ ArrangePacking( done: masterPtr->abortPtr = NULL; - Tcl_Release((ClientData) masterPtr); + Tcl_Release(masterPtr); } /* @@ -964,7 +963,7 @@ YExpansion( } /* - *-------------------------------------------------------------- + *------------------------------------------------------------------------ * * GetPacker -- * @@ -979,7 +978,7 @@ YExpansion( * A new packer structure may be created. If so, then a callback is set * up to clean things up when the window is deleted. * - *-------------------------------------------------------------- + *------------------------------------------------------------------------ */ static Packer * @@ -1005,7 +1004,7 @@ GetPacker( hPtr = Tcl_CreateHashEntry(&dispPtr->packerHashTable, (char *) tkwin, &isNew); if (!isNew) { - return (Packer *) Tcl_GetHashValue(hPtr); + return Tcl_GetHashValue(hPtr); } packPtr = (Packer *) ckalloc(sizeof(Packer)); packPtr->tkwin = tkwin; @@ -1022,12 +1021,12 @@ GetPacker( packPtr->flags = 0; Tcl_SetHashValue(hPtr, packPtr); Tk_CreateEventHandler(tkwin, StructureNotifyMask, - PackStructureProc, (ClientData) packPtr); + PackStructureProc, packPtr); return packPtr; } /* - *-------------------------------------------------------------- + *------------------------------------------------------------------------ * * PackAfter -- * @@ -1041,7 +1040,7 @@ GetPacker( * The geometry of the specified windows may change, both now and again * in the future. * - *-------------------------------------------------------------- + *------------------------------------------------------------------------ */ static int @@ -1052,7 +1051,7 @@ PackAfter( * masterPtr. */ Packer *masterPtr, /* Master in which to pack windows. */ int objc, /* Number of elements in objv. */ - Tcl_Obj *CONST objv[]) /* Array of lists, each containing 2 elements: + Tcl_Obj *const objv[]) /* Array of lists, each containing 2 elements: * window name and side against which to * pack. */ { @@ -1227,7 +1226,7 @@ PackAfter( packPtr->nextPtr = prevPtr->nextPtr; prevPtr->nextPtr = packPtr; } - Tk_ManageGeometry(tkwin, &packerType, (ClientData) packPtr); + Tk_ManageGeometry(tkwin, &packerType, packPtr); } } @@ -1240,7 +1239,7 @@ PackAfter( } if (!(masterPtr->flags & REQUESTED_REPACK)) { masterPtr->flags |= REQUESTED_REPACK; - Tcl_DoWhenIdle(ArrangePacking, (ClientData) masterPtr); + Tcl_DoWhenIdle(ArrangePacking, masterPtr); } return TCL_OK; } @@ -1286,7 +1285,7 @@ Unlink( } if (!(masterPtr->flags & REQUESTED_REPACK)) { masterPtr->flags |= REQUESTED_REPACK; - Tcl_DoWhenIdle(ArrangePacking, (ClientData) masterPtr); + Tcl_DoWhenIdle(ArrangePacking, masterPtr); } if (masterPtr->abortPtr != NULL) { *masterPtr->abortPtr = 1; @@ -1346,20 +1345,20 @@ PackStructureProc( * eventPtr. */ XEvent *eventPtr) /* Describes what just happened. */ { - register Packer *packPtr = (Packer *) clientData; + register Packer *packPtr = clientData; if (eventPtr->type == ConfigureNotify) { if ((packPtr->slavePtr != NULL) && !(packPtr->flags & REQUESTED_REPACK)) { packPtr->flags |= REQUESTED_REPACK; - Tcl_DoWhenIdle(ArrangePacking, (ClientData) packPtr); + Tcl_DoWhenIdle(ArrangePacking, packPtr); } if ((packPtr->masterPtr != NULL) && (packPtr->doubleBw != 2*Tk_Changes(packPtr->tkwin)->border_width)) { if (!(packPtr->masterPtr->flags & REQUESTED_REPACK)) { packPtr->doubleBw = 2*Tk_Changes(packPtr->tkwin)->border_width; packPtr->masterPtr->flags |= REQUESTED_REPACK; - Tcl_DoWhenIdle(ArrangePacking, (ClientData) packPtr->masterPtr); + Tcl_DoWhenIdle(ArrangePacking, packPtr->masterPtr); } } } else if (eventPtr->type == DestroyNotify) { @@ -1371,8 +1370,7 @@ PackStructureProc( for (slavePtr = packPtr->slavePtr; slavePtr != NULL; slavePtr = nextPtr) { - Tk_ManageGeometry(slavePtr->tkwin, NULL, - (ClientData) NULL); + Tk_ManageGeometry(slavePtr->tkwin, NULL, NULL); Tk_UnmapWindow(slavePtr->tkwin); slavePtr->masterPtr = NULL; nextPtr = slavePtr->nextPtr; @@ -1386,10 +1384,10 @@ PackStructureProc( } if (packPtr->flags & REQUESTED_REPACK) { - Tcl_CancelIdleCall(ArrangePacking, (ClientData) packPtr); + Tcl_CancelIdleCall(ArrangePacking, packPtr); } packPtr->tkwin = NULL; - Tcl_EventuallyFree((ClientData) packPtr, DestroyPacker); + Tcl_EventuallyFree(packPtr, DestroyPacker); } else if (eventPtr->type == MapNotify) { /* * When a master gets mapped, must redo the geometry computation so @@ -1399,7 +1397,7 @@ PackStructureProc( if ((packPtr->slavePtr != NULL) && !(packPtr->flags & REQUESTED_REPACK)) { packPtr->flags |= REQUESTED_REPACK; - Tcl_DoWhenIdle(ArrangePacking, (ClientData) packPtr); + Tcl_DoWhenIdle(ArrangePacking, packPtr); } } else if (eventPtr->type == UnmapNotify) { register Packer *packPtr2; @@ -1441,7 +1439,7 @@ ConfigureSlaves( Tk_Window tkwin, /* Any window in application containing * slaves. Used to look up slave names. */ int objc, /* Number of elements in argv. */ - Tcl_Obj *CONST objv[]) /* Argument objects: contains one or more + Tcl_Obj *const objv[]) /* Argument objects: contains one or more * window names followed by any number of * "option value" pairs. Caller must make sure * that there is at least one window name. */ @@ -1450,7 +1448,7 @@ ConfigureSlaves( Tk_Window other, slave, parent, ancestor; int i, j, numWindows, tmp, positionGiven; char *string; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "-after", "-anchor", "-before", "-expand", "-fill", "-in", "-ipadx", "-ipady", "-padx", "-pady", "-side", NULL }; enum options { @@ -1532,8 +1530,8 @@ ConfigureSlaves( if (prevPtr->masterPtr == NULL) { notPacked: Tcl_AppendResult(interp, "window \"", - Tcl_GetString(objv[i+1]), - "\" isn't packed", NULL); + Tcl_GetString(objv[i+1]), "\" isn't packed", + NULL); return TCL_ERROR; } masterPtr = prevPtr->masterPtr; @@ -1738,7 +1736,7 @@ ConfigureSlaves( slavePtr->nextPtr = prevPtr->nextPtr; prevPtr->nextPtr = slavePtr; } - Tk_ManageGeometry(slave, &packerType, (ClientData) slavePtr); + Tk_ManageGeometry(slave, &packerType, slavePtr); prevPtr = slavePtr; /* @@ -1751,7 +1749,7 @@ ConfigureSlaves( } if (!(masterPtr->flags & REQUESTED_REPACK)) { masterPtr->flags |= REQUESTED_REPACK; - Tcl_DoWhenIdle(ArrangePacking, (ClientData) masterPtr); + Tcl_DoWhenIdle(ArrangePacking, masterPtr); } } return TCL_OK; diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index 7854498..f80e257 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkPanedWindow.c,v 1.30 2007/12/13 15:24:16 dgp Exp $ + * RCS: @(#) $Id: tkPanedWindow.c,v 1.31 2008/04/27 22:38:56 dkf Exp $ */ #include "default.h" @@ -183,11 +183,11 @@ typedef struct PanedWindow { int Tk_PanedWindowObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static void PanedWindowCmdDeletedProc(ClientData clientData); static int ConfigurePanedWindow(Tcl_Interp *interp, PanedWindow *pwPtr, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static void DestroyPanedWindow(PanedWindow *pwPtr); static void DisplayPanedWindow(ClientData clientData); static void PanedWindowEventProc(ClientData clientData, @@ -197,7 +197,7 @@ static void ProxyWindowEventProc(ClientData clientData, static void DisplayProxyWindow(ClientData clientData); static void PanedWindowWorldChanged(ClientData instanceData); static int PanedWindowWidgetObjCmd(ClientData clientData, - Tcl_Interp *, int objc, Tcl_Obj * CONST objv[]); + Tcl_Interp *, int objc, Tcl_Obj * const objv[]); static void PanedWindowLostSlaveProc(ClientData clientData, Tk_Window tkwin); static void PanedWindowReqProc(ClientData clientData, @@ -209,14 +209,14 @@ static void SlaveStructureProc(ClientData clientData, XEvent *eventPtr); static int PanedWindowSashCommand(PanedWindow *pwPtr, Tcl_Interp *interp, int objc, - Tcl_Obj * CONST objv[]); + Tcl_Obj * const objv[]); static int PanedWindowProxyCommand(PanedWindow *pwPtr, Tcl_Interp *interp, int objc, - Tcl_Obj * CONST objv[]); + Tcl_Obj * const objv[]); static void ComputeGeometry(PanedWindow *pwPtr); static int ConfigureSlaves(PanedWindow *pwPtr, Tcl_Interp *interp, int objc, - Tcl_Obj * CONST objv[]); + Tcl_Obj * const objv[]); static void DestroyOptionTables(ClientData clientData, Tcl_Interp *interp); static int SetSticky(ClientData clientData, Tcl_Interp *interp, @@ -373,7 +373,7 @@ Tk_PanedWindowObjCmd( ClientData clientData, /* NULL. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj * CONST objv[]) /* Argument objects. */ + Tcl_Obj * const objv[]) /* Argument objects. */ { PanedWindow *pwPtr; Tk_Window tkwin, parent; @@ -408,7 +408,7 @@ Tk_PanedWindowObjCmd( */ Tcl_SetAssocData(interp, "PanedWindowOptionTables", - DestroyOptionTables, (ClientData) pwOpts); + DestroyOptionTables, pwOpts); /* * Create the paned window option tables. @@ -430,8 +430,8 @@ Tk_PanedWindowObjCmd( pwPtr->display = Tk_Display(tkwin); pwPtr->interp = interp; pwPtr->widgetCmd = Tcl_CreateObjCommand(interp, - Tk_PathName(pwPtr->tkwin), PanedWindowWidgetObjCmd, - (ClientData) pwPtr, PanedWindowCmdDeletedProc); + Tk_PathName(pwPtr->tkwin), PanedWindowWidgetObjCmd, pwPtr, + PanedWindowCmdDeletedProc); pwPtr->optionTable = pwOpts->pwOptions; pwPtr->slaveOpts = pwOpts->slaveOpts; pwPtr->relief = TK_RELIEF_RAISED; @@ -444,7 +444,7 @@ Tk_PanedWindowObjCmd( * otherwise Tk might free it while we still need it. */ - Tcl_Preserve((ClientData) pwPtr->tkwin); + Tcl_Preserve(pwPtr->tkwin); if (Tk_InitOptions(interp, (char *) pwPtr, pwOpts->pwOptions, tkwin) != TCL_OK) { @@ -453,7 +453,7 @@ Tk_PanedWindowObjCmd( } Tk_CreateEventHandler(pwPtr->tkwin, ExposureMask|StructureNotifyMask, - PanedWindowEventProc, (ClientData) pwPtr); + PanedWindowEventProc, pwPtr); /* * Find the toplevel ancestor of the panedwindow, and make a proxy win as @@ -483,7 +483,7 @@ Tk_PanedWindowObjCmd( Tk_SetWindowVisual(pwPtr->proxywin, Tk_Visual(tkwin), Tk_Depth(tkwin), Tk_Colormap(tkwin)); Tk_CreateEventHandler(pwPtr->proxywin, ExposureMask, ProxyWindowEventProc, - (ClientData) pwPtr); + pwPtr); atts.save_under = True; Tk_ChangeWindowAttributes(pwPtr->proxywin, CWSaveUnder, &atts); @@ -520,11 +520,11 @@ PanedWindowWidgetObjCmd( ClientData clientData, /* Information about square widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj * CONST objv[]) /* Argument objects. */ + Tcl_Obj * const objv[]) /* Argument objects. */ { - PanedWindow *pwPtr = (PanedWindow *) clientData; + PanedWindow *pwPtr = clientData; int result = TCL_OK; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "add", "cget", "configure", "forget", "identify", "panecget", "paneconfigure", "panes", "proxy", "sash", NULL }; @@ -547,7 +547,7 @@ PanedWindowWidgetObjCmd( return TCL_ERROR; } - Tcl_Preserve((ClientData) pwPtr); + Tcl_Preserve(pwPtr); switch ((enum options) index) { case PW_ADD: @@ -605,16 +605,17 @@ PanedWindowWidgetObjCmd( for (count = 0, i = 2; i < objc; i++) { Tk_Window slave = Tk_NameToWindow(interp, Tcl_GetString(objv[i]), pwPtr->tkwin); + if (slave == NULL) { continue; } slavePtr = GetPane(pwPtr, slave); if ((slavePtr != NULL) && (slavePtr->masterPtr != NULL)) { count++; - Tk_ManageGeometry(slave, NULL, (ClientData)NULL); + Tk_ManageGeometry(slave, NULL, NULL); Tk_UnmaintainGeometry(slavePtr->tkwin, pwPtr->tkwin); Tk_DeleteEventHandler(slavePtr->tkwin, StructureNotifyMask, - SlaveStructureProc, (ClientData) slavePtr); + SlaveStructureProc, slavePtr); Tk_UnmapWindow(slavePtr->tkwin); Unlink(slavePtr); } @@ -720,7 +721,7 @@ PanedWindowWidgetObjCmd( result = PanedWindowSashCommand(pwPtr, interp, objc, objv); break; } - Tcl_Release((ClientData) pwPtr); + Tcl_Release(pwPtr); return result; } @@ -746,7 +747,7 @@ ConfigureSlaves( PanedWindow *pwPtr, /* Information about paned window. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { int i, firstOptionArg, j, found, doubleBw, index, numNewSlaves, haveLoc; int insertIndex; @@ -973,9 +974,8 @@ ConfigureSlaves( */ Tk_CreateEventHandler(slavePtr->tkwin, StructureNotifyMask, - SlaveStructureProc, (ClientData) slavePtr); - Tk_ManageGeometry(slavePtr->tkwin, &panedWindowMgrType, - (ClientData) slavePtr); + SlaveStructureProc, slavePtr); + Tk_ManageGeometry(slavePtr->tkwin, &panedWindowMgrType, slavePtr); inserts[insertIndex++] = slavePtr; numNewSlaves++; } @@ -1066,9 +1066,9 @@ PanedWindowSashCommand( PanedWindow *pwPtr, /* Pointer to paned window information. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { - static CONST char *sashOptionStrings[] = { + static const char *sashOptionStrings[] = { "coord", "dragto", "mark", "place", NULL }; enum sashOptions { @@ -1217,7 +1217,7 @@ ConfigurePanedWindow( Tcl_Interp *interp, /* Used for error reporting. */ PanedWindow *pwPtr, /* Information about widget. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument values. */ + Tcl_Obj *const objv[]) /* Argument values. */ { Tk_SavedOptions savedOptions; int typemask = 0; @@ -1230,7 +1230,7 @@ ConfigurePanedWindow( Tk_FreeSavedOptions(&savedOptions); - PanedWindowWorldChanged((ClientData) pwPtr); + PanedWindowWorldChanged(pwPtr); /* * If an option that affects geometry has changed, make a re-layout @@ -1268,7 +1268,7 @@ PanedWindowWorldChanged( { XGCValues gcValues; GC newGC; - PanedWindow *pwPtr = (PanedWindow *) instanceData; + PanedWindow *pwPtr = instanceData; /* * Allocated a graphics context for drawing the paned window widget @@ -1297,7 +1297,7 @@ PanedWindowWorldChanged( */ if (Tk_IsMapped(pwPtr->tkwin) && !(pwPtr->flags & REDRAW_PENDING)) { - Tcl_DoWhenIdle(DisplayPanedWindow, (ClientData) pwPtr); + Tcl_DoWhenIdle(DisplayPanedWindow, pwPtr); pwPtr->flags |= REDRAW_PENDING; } } @@ -1325,17 +1325,17 @@ PanedWindowEventProc( ClientData clientData, /* Information about window. */ XEvent *eventPtr) /* Information about event. */ { - PanedWindow *pwPtr = (PanedWindow *) clientData; + PanedWindow *pwPtr = clientData; if (eventPtr->type == Expose) { if (pwPtr->tkwin != NULL && !(pwPtr->flags & REDRAW_PENDING)) { - Tcl_DoWhenIdle(DisplayPanedWindow, (ClientData) pwPtr); + Tcl_DoWhenIdle(DisplayPanedWindow, pwPtr); pwPtr->flags |= REDRAW_PENDING; } } else if (eventPtr->type == ConfigureNotify) { pwPtr->flags |= REQUESTED_RELAYOUT; if (pwPtr->tkwin != NULL && !(pwPtr->flags & REDRAW_PENDING)) { - Tcl_DoWhenIdle(DisplayPanedWindow, (ClientData) pwPtr); + Tcl_DoWhenIdle(DisplayPanedWindow, pwPtr); pwPtr->flags |= REDRAW_PENDING; } } else if (eventPtr->type == DestroyNotify) { @@ -1365,7 +1365,7 @@ static void PanedWindowCmdDeletedProc( ClientData clientData) /* Pointer to widget record for widget. */ { - PanedWindow *pwPtr = (PanedWindow *) clientData; + PanedWindow *pwPtr = clientData; /* * This function could be invoked either because the window was destroyed @@ -1402,7 +1402,7 @@ static void DisplayPanedWindow( ClientData clientData) /* Information about window. */ { - PanedWindow *pwPtr = (PanedWindow *) clientData; + PanedWindow *pwPtr = clientData; Slave *slavePtr; Pixmap pixmap; Tk_Window tkwin = pwPtr->tkwin; @@ -1518,10 +1518,10 @@ DestroyPanedWindow( */ if (pwPtr->flags & REDRAW_PENDING) { - Tcl_CancelIdleCall(DisplayPanedWindow, (ClientData) pwPtr); + Tcl_CancelIdleCall(DisplayPanedWindow, pwPtr); } if (pwPtr->flags & RESIZE_PENDING) { - Tcl_CancelIdleCall(ArrangePanes, (ClientData) pwPtr); + Tcl_CancelIdleCall(ArrangePanes, pwPtr); } /* @@ -1533,11 +1533,11 @@ DestroyPanedWindow( for (i = 0; i < pwPtr->numSlaves; i++) { Tk_DeleteEventHandler(pwPtr->slaves[i]->tkwin, StructureNotifyMask, - SlaveStructureProc, (ClientData) pwPtr->slaves[i]); + SlaveStructureProc, pwPtr->slaves[i]); Tk_ManageGeometry(pwPtr->slaves[i]->tkwin, NULL, NULL); - Tk_FreeConfigOptions((char *)pwPtr->slaves[i], pwPtr->slaveOpts, + Tk_FreeConfigOptions((char *) pwPtr->slaves[i], pwPtr->slaveOpts, pwPtr->tkwin); - ckfree((void *)pwPtr->slaves[i]); + ckfree((char *) pwPtr->slaves[i]); pwPtr->slaves[i] = NULL; } if (pwPtr->slaves) { @@ -1555,10 +1555,10 @@ DestroyPanedWindow( */ Tk_FreeConfigOptions((char *) pwPtr, pwPtr->optionTable, pwPtr->tkwin); - Tcl_Release((ClientData) pwPtr->tkwin); + Tcl_Release(pwPtr->tkwin); pwPtr->tkwin = NULL; - Tcl_EventuallyFree((ClientData) pwPtr, TCL_DYNAMIC); + Tcl_EventuallyFree(pwPtr, TCL_DYNAMIC); } /* @@ -1586,12 +1586,12 @@ PanedWindowReqProc( Tk_Window tkwin) /* Other Tk-related information about the * window. */ { - Slave *slavePtr = (Slave *) clientData; + Slave *slavePtr = clientData; PanedWindow *pwPtr = (PanedWindow *) (slavePtr->masterPtr); if (Tk_IsMapped(pwPtr->tkwin)) { if (!(pwPtr->flags & RESIZE_PENDING)) { pwPtr->flags |= RESIZE_PENDING; - Tcl_DoWhenIdle(ArrangePanes, (ClientData) pwPtr); + Tcl_DoWhenIdle(ArrangePanes, pwPtr); } } else { int doubleBw = 2 * Tk_Changes(slavePtr->tkwin)->border_width; @@ -1630,18 +1630,18 @@ PanedWindowLostSlaveProc( * stolen away. */ Tk_Window tkwin) /* Tk's handle for the slave window. */ { - register Slave *slavePtr = (Slave *) clientData; - PanedWindow *pwPtr = (PanedWindow *) (slavePtr->masterPtr); + register Slave *slavePtr = clientData; + PanedWindow *pwPtr = (PanedWindow *) slavePtr->masterPtr; if (pwPtr->tkwin != Tk_Parent(slavePtr->tkwin)) { Tk_UnmaintainGeometry(slavePtr->tkwin, pwPtr->tkwin); } Unlink(slavePtr); Tk_DeleteEventHandler(slavePtr->tkwin, StructureNotifyMask, - SlaveStructureProc, (ClientData) slavePtr); + SlaveStructureProc, slavePtr); Tk_UnmapWindow(slavePtr->tkwin); slavePtr->tkwin = NULL; - ckfree((void *)slavePtr); + ckfree((char *) slavePtr); ComputeGeometry(pwPtr); } @@ -1669,7 +1669,7 @@ ArrangePanes( ClientData clientData) /* Structure describing parent whose slaves * are to be re-layed out. */ { - register PanedWindow *pwPtr = (PanedWindow *) clientData; + register PanedWindow *pwPtr = clientData; register Slave *slavePtr; int i, slaveWidth, slaveHeight, slaveX, slaveY; int paneWidth, paneHeight, paneSize, paneMinSize; @@ -1696,7 +1696,7 @@ ArrangePanes( return; } - Tcl_Preserve((ClientData) pwPtr); + Tcl_Preserve(pwPtr); /* * Find index of last visible pane. @@ -1939,7 +1939,7 @@ ArrangePanes( } sashCount--; } - Tcl_Release((ClientData) pwPtr); + Tcl_Release(pwPtr); } /* @@ -2000,7 +2000,7 @@ Unlink( masterPtr->flags |= REQUESTED_RELAYOUT; if (!(masterPtr->flags & REDRAW_PENDING)) { masterPtr->flags |= REDRAW_PENDING; - Tcl_DoWhenIdle(DisplayPanedWindow, (ClientData) masterPtr); + Tcl_DoWhenIdle(DisplayPanedWindow, masterPtr); } /* @@ -2071,13 +2071,13 @@ SlaveStructureProc( ClientData clientData, /* Pointer to record describing window item. */ XEvent *eventPtr) /* Describes what just happened. */ { - Slave *slavePtr = (Slave *) clientData; + Slave *slavePtr = clientData; PanedWindow *pwPtr = slavePtr->masterPtr; if (eventPtr->type == DestroyNotify) { Unlink(slavePtr); slavePtr->tkwin = NULL; - ckfree((void *)slavePtr); + ckfree((char *) slavePtr); ComputeGeometry(pwPtr); } } @@ -2256,7 +2256,7 @@ ComputeGeometry( Tk_GeometryRequest(pwPtr->tkwin, reqWidth, reqHeight); if (Tk_IsMapped(pwPtr->tkwin) && !(pwPtr->flags & REDRAW_PENDING)) { pwPtr->flags |= REDRAW_PENDING; - Tcl_DoWhenIdle(DisplayPanedWindow, (ClientData) pwPtr); + Tcl_DoWhenIdle(DisplayPanedWindow, pwPtr); } } @@ -2283,7 +2283,7 @@ DestroyOptionTables( ClientData clientData, /* Pointer to the OptionTables struct */ Tcl_Interp *interp) /* Pointer to the calling interp */ { - ckfree((char *)clientData); + ckfree((char *) clientData); return; } @@ -2664,11 +2664,11 @@ ProxyWindowEventProc( ClientData clientData, /* Information about window. */ XEvent *eventPtr) /* Information about event. */ { - PanedWindow *pwPtr = (PanedWindow *) clientData; + PanedWindow *pwPtr = clientData; if (eventPtr->type == Expose) { if (pwPtr->proxywin != NULL &&!(pwPtr->flags & PROXY_REDRAW_PENDING)) { - Tcl_DoWhenIdle(DisplayProxyWindow, (ClientData) pwPtr); + Tcl_DoWhenIdle(DisplayProxyWindow, pwPtr); pwPtr->flags |= PROXY_REDRAW_PENDING; } } @@ -2696,7 +2696,7 @@ static void DisplayProxyWindow( ClientData clientData) /* Information about window. */ { - PanedWindow *pwPtr = (PanedWindow *) clientData; + PanedWindow *pwPtr = clientData; Pixmap pixmap; Tk_Window tkwin = pwPtr->proxywin; pwPtr->flags &= ~PROXY_REDRAW_PENDING; @@ -2755,9 +2755,9 @@ PanedWindowProxyCommand( PanedWindow *pwPtr, /* Pointer to paned window information. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "coord", "forget", "place", NULL }; enum options { diff --git a/generic/tkPlace.c b/generic/tkPlace.c index 28cdf9d..007c052 100644 --- a/generic/tkPlace.c +++ b/generic/tkPlace.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkPlace.c,v 1.24 2007/12/13 15:24:16 dgp Exp $ + * RCS: @(#) $Id: tkPlace.c,v 1.25 2008/04/27 22:38:56 dkf Exp $ */ #include "tkInt.h" @@ -174,7 +174,7 @@ static void SlaveStructureProc(ClientData clientData, XEvent *eventPtr); static int ConfigureSlave(Tcl_Interp *interp, Tk_Window tkwin, Tk_OptionTable table, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int PlaceInfoCommand(Tcl_Interp *interp, Tk_Window tkwin); static Slave * CreateSlave(Tk_Window tkwin, Tk_OptionTable table); static void FreeSlave(Slave *slavePtr); @@ -208,14 +208,14 @@ Tk_PlaceObjCmd( ClientData clientData, /* NULL. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window tkwin; Slave *slavePtr; char *string; TkDisplay *dispPtr; Tk_OptionTable optionTable; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "configure", "forget", "info", "slaves", NULL }; enum options { PLACE_CONFIGURE, PLACE_FORGET, PLACE_INFO, PLACE_SLAVES }; @@ -321,7 +321,7 @@ Tk_PlaceObjCmd( Tcl_DeleteHashEntry(Tcl_FindHashEntry(&dispPtr->slaveTable, (char *) tkwin)); Tk_DeleteEventHandler(tkwin, StructureNotifyMask, SlaveStructureProc, - (ClientData) slavePtr); + slavePtr); Tk_ManageGeometry(tkwin, NULL, (ClientData) NULL); Tk_UnmapWindow(tkwin); FreeSlave(slavePtr); @@ -618,7 +618,7 @@ ConfigureSlave( Tk_Window tkwin, /* Token for the window to manipulate. */ Tk_OptionTable table, /* Token for option table. */ int objc, /* Number of config arguments. */ - Tcl_Obj *CONST objv[]) /* Object values for arguments. */ + Tcl_Obj *const objv[]) /* Object values for arguments. */ { register Master *masterPtr; Tk_SavedOptions savedOptions; @@ -732,7 +732,7 @@ ConfigureSlave( slavePtr->masterPtr = masterPtr; slavePtr->nextPtr = masterPtr->slavePtr; masterPtr->slavePtr = slavePtr; - Tk_ManageGeometry(slavePtr->tkwin, &placerType, (ClientData) slavePtr); + Tk_ManageGeometry(slavePtr->tkwin, &placerType, slavePtr); /* * Arrange for the master to be re-arranged at the first idle moment. @@ -743,7 +743,7 @@ ConfigureSlave( if (!(masterPtr->flags & PARENT_RECONFIG_PENDING)) { masterPtr->flags |= PARENT_RECONFIG_PENDING; - Tcl_DoWhenIdle(RecomputePlacement, (ClientData) masterPtr); + Tcl_DoWhenIdle(RecomputePlacement, masterPtr); } return TCL_OK; @@ -851,7 +851,7 @@ static void RecomputePlacement( ClientData clientData) /* Pointer to Master record. */ { - register Master *masterPtr = (Master *) clientData; + register Master *masterPtr = clientData; register Slave *slavePtr; int x, y, width, height, tmp; int masterWidth, masterHeight, masterX, masterY; @@ -873,13 +873,13 @@ RecomputePlacement( } masterPtr->abortPtr = &abort; abort = 0; - Tcl_Preserve((ClientData) masterPtr); + Tcl_Preserve(masterPtr); /* * Iterate over all the slaves for the master. Each slave's geometry can * be computed independently of the other slaves. Changes to the window's * structure could cause almost anything to happen, including deleting the - * parent or child. If this happens, we'll be told to abort. + * parent or child. If this happens, we'll be told to abort. */ for (slavePtr = masterPtr->slavePtr; slavePtr != NULL && !abort; @@ -1046,7 +1046,7 @@ RecomputePlacement( } masterPtr->abortPtr = NULL; - Tcl_Release((ClientData) masterPtr); + Tcl_Release(masterPtr); } /* @@ -1073,7 +1073,7 @@ MasterStructureProc( * referred to by eventPtr. */ XEvent *eventPtr) /* Describes what just happened. */ { - register Master *masterPtr = (Master *) clientData; + register Master *masterPtr = clientData; register Slave *slavePtr, *nextPtr; TkDisplay *dispPtr = ((TkWindow *) masterPtr->tkwin)->dispPtr; @@ -1081,7 +1081,7 @@ MasterStructureProc( if ((masterPtr->slavePtr != NULL) && !(masterPtr->flags & PARENT_RECONFIG_PENDING)) { masterPtr->flags |= PARENT_RECONFIG_PENDING; - Tcl_DoWhenIdle(RecomputePlacement, (ClientData) masterPtr); + Tcl_DoWhenIdle(RecomputePlacement, masterPtr); } } else if (eventPtr->type == DestroyNotify) { for (slavePtr = masterPtr->slavePtr; slavePtr != NULL; @@ -1093,13 +1093,13 @@ MasterStructureProc( Tcl_DeleteHashEntry(Tcl_FindHashEntry(&dispPtr->masterTable, (char *) masterPtr->tkwin)); if (masterPtr->flags & PARENT_RECONFIG_PENDING) { - Tcl_CancelIdleCall(RecomputePlacement, (ClientData) masterPtr); + Tcl_CancelIdleCall(RecomputePlacement, masterPtr); } masterPtr->tkwin = NULL; if (masterPtr->abortPtr != NULL) { *masterPtr->abortPtr = 1; } - Tcl_EventuallyFree((ClientData) masterPtr, TCL_DYNAMIC); + Tcl_EventuallyFree(masterPtr, TCL_DYNAMIC); } else if (eventPtr->type == MapNotify) { /* * When a master gets mapped, must redo the geometry computation so @@ -1109,7 +1109,7 @@ MasterStructureProc( if ((masterPtr->slavePtr != NULL) && !(masterPtr->flags & PARENT_RECONFIG_PENDING)) { masterPtr->flags |= PARENT_RECONFIG_PENDING; - Tcl_DoWhenIdle(RecomputePlacement, (ClientData) masterPtr); + Tcl_DoWhenIdle(RecomputePlacement, masterPtr); } } else if (eventPtr->type == UnmapNotify) { /* @@ -1147,7 +1147,7 @@ SlaveStructureProc( * referred to by eventPtr. */ XEvent *eventPtr) /* Describes what just happened. */ { - register Slave *slavePtr = (Slave *) clientData; + register Slave *slavePtr = clientData; TkDisplay *dispPtr = ((TkWindow *) slavePtr->tkwin)->dispPtr; if (eventPtr->type == DestroyNotify) { @@ -1184,7 +1184,7 @@ PlaceRequestProc( ClientData clientData, /* Pointer to our record for slave. */ Tk_Window tkwin) /* Window that changed its desired size. */ { - Slave *slavePtr = (Slave *) clientData; + Slave *slavePtr = clientData; Master *masterPtr; if (((slavePtr->flags & (CHILD_WIDTH|CHILD_REL_WIDTH)) != 0) @@ -1197,7 +1197,7 @@ PlaceRequestProc( } if (!(masterPtr->flags & PARENT_RECONFIG_PENDING)) { masterPtr->flags |= PARENT_RECONFIG_PENDING; - Tcl_DoWhenIdle(RecomputePlacement, (ClientData) masterPtr); + Tcl_DoWhenIdle(RecomputePlacement, masterPtr); } } @@ -1225,7 +1225,7 @@ PlaceLostSlaveProc( * stolen away. */ Tk_Window tkwin) /* Tk's handle for the slave window. */ { - register Slave *slavePtr = (Slave *) clientData; + register Slave *slavePtr = clientData; TkDisplay *dispPtr = ((TkWindow *) slavePtr->tkwin)->dispPtr; if (slavePtr->masterPtr->tkwin != Tk_Parent(slavePtr->tkwin)) { @@ -1236,7 +1236,7 @@ PlaceLostSlaveProc( Tcl_DeleteHashEntry(Tcl_FindHashEntry(&dispPtr->slaveTable, (char *) tkwin)); Tk_DeleteEventHandler(tkwin, StructureNotifyMask, SlaveStructureProc, - (ClientData) slavePtr); + slavePtr); FreeSlave(slavePtr); } diff --git a/generic/tkRectOval.c b/generic/tkRectOval.c index 29ee24e..00a8852 100644 --- a/generic/tkRectOval.c +++ b/generic/tkRectOval.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkRectOval.c,v 1.17 2007/12/13 15:24:16 dgp Exp $ + * RCS: @(#) $Id: tkRectOval.c,v 1.18 2008/04/27 22:38:57 dkf Exp $ */ #include @@ -135,10 +135,10 @@ static Tk_ConfigSpec configSpecs[] = { static void ComputeRectOvalBbox(Tk_Canvas canvas, RectOvalItem *rectOvalPtr); static int ConfigureRectOval(Tcl_Interp *interp, Tk_Canvas canvas, - Tk_Item *itemPtr, int objc, Tcl_Obj *CONST objv[], + Tk_Item *itemPtr, int objc, Tcl_Obj *const objv[], int flags); static int CreateRectOval(Tcl_Interp *interp, Tk_Canvas canvas, - Tk_Item *itemPtr, int objc, Tcl_Obj *CONST objv[]); + Tk_Item *itemPtr, int objc, Tcl_Obj *const objv[]); static void DeleteRectOval(Tk_Canvas canvas, Tk_Item *itemPtr, Display *display); static void DisplayRectOval(Tk_Canvas canvas, Tk_Item *itemPtr, @@ -149,7 +149,7 @@ static int OvalToArea(Tk_Canvas canvas, Tk_Item *itemPtr, static double OvalToPoint(Tk_Canvas canvas, Tk_Item *itemPtr, double *pointPtr); static int RectOvalCoords(Tcl_Interp *interp, Tk_Canvas canvas, - Tk_Item *itemPtr, int objc, Tcl_Obj *CONST objv[]); + Tk_Item *itemPtr, int objc, Tcl_Obj *const objv[]); static int RectOvalToPostscript(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, int prepass); static int RectToArea(Tk_Canvas canvas, Tk_Item *itemPtr, @@ -240,7 +240,7 @@ CreateRectOval( Tk_Item *itemPtr, /* Record to hold new item; header has been * initialized by caller. */ int objc, /* Number of arguments in objv. */ - Tcl_Obj *CONST objv[]) /* Arguments describing rectangle. */ + Tcl_Obj *const objv[]) /* Arguments describing rectangle. */ { RectOvalItem *rectOvalPtr = (RectOvalItem *) itemPtr; int i; @@ -315,7 +315,7 @@ RectOvalCoords( Tk_Item *itemPtr, /* Item whose coordinates are to be read or * modified. */ int objc, /* Number of coordinates supplied in objv. */ - Tcl_Obj *CONST objv[]) /* Array of coordinates: x1,y1,x2,y2,... */ + Tcl_Obj *const objv[]) /* Array of coordinates: x1,y1,x2,y2,... */ { RectOvalItem *rectOvalPtr = (RectOvalItem *) itemPtr; @@ -404,7 +404,7 @@ ConfigureRectOval( Tk_Canvas canvas, /* Canvas containing itemPtr. */ Tk_Item *itemPtr, /* Rectangle item to reconfigure. */ int objc, /* Number of elements in objv. */ - Tcl_Obj *CONST objv[], /* Arguments describing things to configure. */ + Tcl_Obj *const objv[], /* Arguments describing things to configure. */ int flags) /* Flags to pass to Tk_ConfigureWidget. */ { RectOvalItem *rectOvalPtr = (RectOvalItem *) itemPtr; @@ -420,7 +420,7 @@ ConfigureRectOval( tkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, - (CONST char **)objv, (char *) rectOvalPtr, flags|TK_CONFIG_OBJS)) { + (const char **)objv, (char *) rectOvalPtr, flags|TK_CONFIG_OBJS)) { return TCL_ERROR; } state = itemPtr->state; @@ -483,7 +483,7 @@ ConfigureRectOval( rectOvalPtr->outline.gc = newGC; if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } if (state == TK_STATE_HIDDEN) { ComputeRectOvalBbox(canvas, rectOvalPtr); @@ -492,7 +492,7 @@ ConfigureRectOval( color = rectOvalPtr->fillColor; stipple = rectOvalPtr->fillStipple; - if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { + if (Canvas(canvas)->currentItemPtr == itemPtr) { if (rectOvalPtr->activeFillColor!=NULL) { color = rectOvalPtr->activeFillColor; } @@ -636,7 +636,7 @@ ComputeRectOvalBbox( Tk_State state = rectOvalPtr->header.state; if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } width = rectOvalPtr->outline.width; @@ -645,7 +645,7 @@ ComputeRectOvalBbox( rectOvalPtr->header.x2 = rectOvalPtr->header.y2 = -1; return; } - if (((TkCanvas *)canvas)->currentItemPtr == (Tk_Item *)rectOvalPtr) { + if (Canvas(canvas)->currentItemPtr == (Tk_Item *) rectOvalPtr) { if (rectOvalPtr->outline.activeWidth>width) { width = rectOvalPtr->outline.activeWidth; } @@ -781,10 +781,10 @@ DisplayRectOval( */ if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } fillStipple = rectOvalPtr->fillStipple; - if (((TkCanvas *)canvas)->currentItemPtr == (Tk_Item *)rectOvalPtr) { + if (Canvas(canvas)->currentItemPtr == (Tk_Item *) rectOvalPtr) { if (rectOvalPtr->activeFillStipple != None) { fillStipple = rectOvalPtr->activeFillStipple; } @@ -886,11 +886,11 @@ RectToPoint( Tk_State state = itemPtr->state; if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } width = rectPtr->outline.width; - if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { + if (Canvas(canvas)->currentItemPtr == itemPtr) { if (rectPtr->outline.activeWidth>width) { width = rectPtr->outline.activeWidth; } @@ -1006,11 +1006,11 @@ OvalToPoint( Tk_State state = itemPtr->state; if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } width = (double) ovalPtr->outline.width; - if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { + if (Canvas(canvas)->currentItemPtr == itemPtr) { if (ovalPtr->outline.activeWidth>width) { width = (double) ovalPtr->outline.activeWidth; } @@ -1062,16 +1062,16 @@ RectToArea( Tk_State state = itemPtr->state; if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } width = rectPtr->outline.width; - if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { - if (rectPtr->outline.activeWidth>width) { + if (Canvas(canvas)->currentItemPtr == itemPtr) { + if (rectPtr->outline.activeWidth > width) { width = rectPtr->outline.activeWidth; } } else if (state == TK_STATE_DISABLED) { - if (rectPtr->outline.disabledWidth>0) { + if (rectPtr->outline.disabledWidth > 0) { width = rectPtr->outline.disabledWidth; } } @@ -1131,22 +1131,21 @@ OvalToArea( * y1, x2, y2) describing rectangular area. */ { RectOvalItem *ovalPtr = (RectOvalItem *) itemPtr; - double oval[4], halfWidth; + double oval[4], halfWidth, width; int result; - double width; Tk_State state = itemPtr->state; if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } width = ovalPtr->outline.width; - if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { - if (ovalPtr->outline.activeWidth>width) { + if (Canvas(canvas)->currentItemPtr == itemPtr) { + if (ovalPtr->outline.activeWidth > width) { width = ovalPtr->outline.activeWidth; } } else if (state == TK_STATE_DISABLED) { - if (ovalPtr->outline.disabledWidth>0) { + if (ovalPtr->outline.disabledWidth > 0) { width = ovalPtr->outline.disabledWidth; } } @@ -1328,12 +1327,12 @@ RectOvalToPostscript( } if (state == TK_STATE_NULL) { - state = ((TkCanvas *)canvas)->canvas_state; + state = Canvas(canvas)->canvas_state; } color = rectOvalPtr->outline.color; fillColor = rectOvalPtr->fillColor; fillStipple = rectOvalPtr->fillStipple; - if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { + if (Canvas(canvas)->currentItemPtr == itemPtr) { if (rectOvalPtr->outline.activeColor!=NULL) { color = rectOvalPtr->outline.activeColor; } @@ -1385,7 +1384,7 @@ RectOvalToPostscript( Tcl_AppendResult(interp, pathCmd, "0 setlinejoin 2 setlinecap\n", NULL); if (Tk_CanvasPsOutline(canvas, itemPtr, - &(rectOvalPtr->outline))!= TCL_OK) { + &rectOvalPtr->outline)!= TCL_OK) { return TCL_ERROR; } } diff --git a/generic/tkScale.c b/generic/tkScale.c index fce0341..cb010c1 100644 --- a/generic/tkScale.c +++ b/generic/tkScale.c @@ -16,7 +16,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkScale.c,v 1.28 2007/12/13 15:24:16 dgp Exp $ + * RCS: @(#) $Id: tkScale.c,v 1.29 2008/04/27 22:38:58 dkf Exp $ */ #include "default.h" @@ -142,7 +142,7 @@ static const Tk_OptionSpec optionSpecs[] = { * scale widget command. */ -static CONST char *commandNames[] = { +static const char *commandNames[] = { "cget", "configure", "coords", "get", "identify", "set", NULL }; @@ -158,17 +158,17 @@ enum command { static void ComputeFormat(TkScale *scalePtr); static void ComputeScaleGeometry(TkScale *scalePtr); static int ConfigureScale(Tcl_Interp *interp, TkScale *scalePtr, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static void DestroyScale(char *memPtr); static void ScaleCmdDeletedProc(ClientData clientData); static void ScaleEventProc(ClientData clientData, XEvent *eventPtr); static char * ScaleVarProc(ClientData clientData, - Tcl_Interp *interp, CONST char *name1, - CONST char *name2, int flags); + Tcl_Interp *interp, const char *name1, + const char *name2, int flags); static int ScaleWidgetObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static void ScaleWorldChanged(ClientData instanceData); static void ScaleSetVariable(TkScale *scalePtr); @@ -204,7 +204,7 @@ Tk_ScaleObjCmd( ClientData clientData, /* NULL. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument values. */ + Tcl_Obj *const objv[]) /* Argument values. */ { register TkScale *scalePtr; Tk_OptionTable optionTable; @@ -242,7 +242,7 @@ Tk_ScaleObjCmd( scalePtr->interp = interp; scalePtr->widgetCmd = Tcl_CreateObjCommand(interp, Tk_PathName(scalePtr->tkwin), ScaleWidgetObjCmd, - (ClientData) scalePtr, ScaleCmdDeletedProc); + scalePtr, ScaleCmdDeletedProc); scalePtr->optionTable = optionTable; scalePtr->orient = ORIENT_VERTICAL; scalePtr->width = 0; @@ -291,10 +291,10 @@ Tk_ScaleObjCmd( scalePtr->takeFocusPtr = NULL; scalePtr->flags = NEVER_SET; - Tk_SetClassProcs(scalePtr->tkwin, &scaleClass, (ClientData) scalePtr); + Tk_SetClassProcs(scalePtr->tkwin, &scaleClass, scalePtr); Tk_CreateEventHandler(scalePtr->tkwin, ExposureMask|StructureNotifyMask|FocusChangeMask, - ScaleEventProc, (ClientData) scalePtr); + ScaleEventProc, scalePtr); if ((Tk_InitOptions(interp, (char *) scalePtr, optionTable, tkwin) != TCL_OK) || @@ -330,9 +330,9 @@ ScaleWidgetObjCmd( ClientData clientData, /* Information about scale widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument strings. */ + Tcl_Obj *const objv[]) /* Argument strings. */ { - TkScale *scalePtr = (TkScale *) clientData; + TkScale *scalePtr = clientData; Tcl_Obj *objPtr; int index, result; @@ -345,7 +345,7 @@ ScaleWidgetObjCmd( if (result != TCL_OK) { return result; } - Tcl_Preserve((ClientData) scalePtr); + Tcl_Preserve(scalePtr); switch (index) { case COMMAND_CGET: @@ -467,11 +467,11 @@ ScaleWidgetObjCmd( break; } } - Tcl_Release((ClientData) scalePtr); + Tcl_Release(scalePtr); return result; error: - Tcl_Release((ClientData) scalePtr); + Tcl_Release(scalePtr); return TCL_ERROR; } @@ -503,7 +503,7 @@ DestroyScale( Tcl_DeleteCommandFromToken(scalePtr->interp, scalePtr->widgetCmd); if (scalePtr->flags & REDRAW_PENDING) { - Tcl_CancelIdleCall(TkpDisplayScale, (ClientData) scalePtr); + Tcl_CancelIdleCall(TkpDisplayScale, scalePtr); } /* @@ -514,7 +514,7 @@ DestroyScale( if (scalePtr->varNamePtr != NULL) { Tcl_UntraceVar(scalePtr->interp, Tcl_GetString(scalePtr->varNamePtr), TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, - ScaleVarProc, (ClientData) scalePtr); + ScaleVarProc, scalePtr); } if (scalePtr->troughGC != None) { Tk_FreeGC(scalePtr->display, scalePtr->troughGC); @@ -557,7 +557,7 @@ ConfigureScale( register TkScale *scalePtr, /* Information about widget; may or may not * already have values for some fields. */ int objc, /* Number of valid entries in objv. */ - Tcl_Obj *CONST objv[]) /* Argument values. */ + Tcl_Obj *const objv[]) /* Argument values. */ { Tk_SavedOptions savedOptions; Tcl_Obj *errorResult = NULL; @@ -571,7 +571,7 @@ ConfigureScale( if (scalePtr->varNamePtr != NULL) { Tcl_UntraceVar(interp, Tcl_GetString(scalePtr->varNamePtr), TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, - ScaleVarProc, (ClientData) scalePtr); + ScaleVarProc, scalePtr); } for (error = 0; error <= 1; error++) { @@ -581,8 +581,8 @@ ConfigureScale( */ if (Tk_SetOptions(interp, (char *) scalePtr, - scalePtr->optionTable, objc, objv, - scalePtr->tkwin, &savedOptions, NULL) != TCL_OK) { + scalePtr->optionTable, objc, objv, scalePtr->tkwin, + &savedOptions, NULL) != TCL_OK) { continue; } } else { @@ -687,10 +687,10 @@ ConfigureScale( } Tcl_TraceVar(interp, Tcl_GetString(scalePtr->varNamePtr), TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, - ScaleVarProc, (ClientData) scalePtr); + ScaleVarProc, scalePtr); } - ScaleWorldChanged((ClientData) scalePtr); + ScaleWorldChanged(scalePtr); if (error) { Tcl_SetObjResult(interp, errorResult); Tcl_DecrRefCount(errorResult); @@ -723,9 +723,7 @@ ScaleWorldChanged( { XGCValues gcValues; GC gc; - TkScale *scalePtr; - - scalePtr = (TkScale *) instanceData; + TkScale *scalePtr = instanceData; gcValues.foreground = scalePtr->troughColorPtr->pixel; gc = Tk_GetGC(scalePtr->tkwin, GCForeground, &gcValues); @@ -1007,7 +1005,7 @@ ScaleEventProc( ClientData clientData, /* Information about window. */ XEvent *eventPtr) /* Information about event. */ { - TkScale *scalePtr = (TkScale *) clientData; + TkScale *scalePtr = clientData; if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) { TkEventuallyRedrawScale(scalePtr, REDRAW_ALL); @@ -1055,7 +1053,7 @@ static void ScaleCmdDeletedProc( ClientData clientData) /* Pointer to widget record for widget. */ { - TkScale *scalePtr = (TkScale *) clientData; + TkScale *scalePtr = clientData; Tk_Window tkwin = scalePtr->tkwin; /* @@ -1102,7 +1100,7 @@ TkEventuallyRedrawScale( } if (!(scalePtr->flags & REDRAW_PENDING)) { scalePtr->flags |= REDRAW_PENDING; - Tcl_DoWhenIdle(TkpDisplayScale, (ClientData) scalePtr); + Tcl_DoWhenIdle(TkpDisplayScale, scalePtr); } scalePtr->flags |= what; } @@ -1173,11 +1171,11 @@ static char * ScaleVarProc( ClientData clientData, /* Information about button. */ Tcl_Interp *interp, /* Interpreter containing variable. */ - CONST char *name1, /* Name of variable. */ - CONST char *name2, /* Second part of variable name. */ + const char *name1, /* Name of variable. */ + const char *name2, /* Second part of variable name. */ int flags) /* Information about what happened. */ { - register TkScale *scalePtr = (TkScale *) clientData; + register TkScale *scalePtr = clientData; char *resultStr; double value; Tcl_Obj *valuePtr; diff --git a/generic/tkScrollbar.c b/generic/tkScrollbar.c index 52e449f..359e92c 100644 --- a/generic/tkScrollbar.c +++ b/generic/tkScrollbar.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkScrollbar.c,v 1.12 2007/12/13 15:24:16 dgp Exp $ + * RCS: @(#) $Id: tkScrollbar.c,v 1.13 2008/04/27 22:38:58 dkf Exp $ */ #include "tkInt.h" @@ -25,7 +25,7 @@ static Tk_CustomOption orientOption = { (Tk_OptionParseProc *) TkOrientParseProc, TkOrientPrintProc, - (ClientData) NULL + NULL }; /* @@ -99,10 +99,10 @@ Tk_ConfigSpec tkpScrollbarConfigSpecs[] = { static int ConfigureScrollbar(Tcl_Interp *interp, TkScrollbar *scrollPtr, int argc, - CONST char **argv, int flags); + const char **argv, int flags); static void ScrollbarCmdDeletedProc(ClientData clientData); static int ScrollbarWidgetCmd(ClientData clientData, - Tcl_Interp *, int argc, CONST char **argv); + Tcl_Interp *, int argc, const char **argv); /* *-------------------------------------------------------------- @@ -126,9 +126,9 @@ Tk_ScrollbarCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int argc, /* Number of arguments. */ - CONST char **argv) /* Argument strings. */ + const char **argv) /* Argument strings. */ { - Tk_Window tkwin = (Tk_Window) clientData; + Tk_Window tkwin = clientData; register TkScrollbar *scrollPtr; Tk_Window newWin; @@ -146,7 +146,7 @@ Tk_ScrollbarCmd( Tk_SetClass(newWin, "Scrollbar"); scrollPtr = TkpCreateScrollbar(newWin); - Tk_SetClassProcs(newWin, &tkpScrollbarProcs, (ClientData) scrollPtr); + Tk_SetClassProcs(newWin, &tkpScrollbarProcs, scrollPtr); /* * Initialize fields that won't be initialized by ConfigureScrollbar, or @@ -159,7 +159,7 @@ Tk_ScrollbarCmd( scrollPtr->interp = interp; scrollPtr->widgetCmd = Tcl_CreateCommand(interp, Tk_PathName(scrollPtr->tkwin), ScrollbarWidgetCmd, - (ClientData) scrollPtr, ScrollbarCmdDeletedProc); + scrollPtr, ScrollbarCmdDeletedProc); scrollPtr->vertical = 0; scrollPtr->width = 0; scrollPtr->command = NULL; @@ -223,9 +223,9 @@ ScrollbarWidgetCmd( ClientData clientData, /* Information about scrollbar widget. */ Tcl_Interp *interp, /* Current interpreter. */ int argc, /* Number of arguments. */ - CONST char **argv) /* Argument strings. */ + const char **argv) /* Argument strings. */ { - register TkScrollbar *scrollPtr = (TkScrollbar *) clientData; + register TkScrollbar *scrollPtr = clientData; int result = TCL_OK; size_t length; int c; @@ -235,7 +235,7 @@ ScrollbarWidgetCmd( argv[0], " option ?arg arg ...?\"", NULL); return TCL_ERROR; } - Tcl_Preserve((ClientData) scrollPtr); + Tcl_Preserve(scrollPtr); c = argv[1][0]; length = strlen(argv[1]); if ((c == 'a') && (strncmp(argv[1], "activate", length) == 0)) { @@ -493,11 +493,11 @@ ScrollbarWidgetCmd( } done: - Tcl_Release((ClientData) scrollPtr); + Tcl_Release(scrollPtr); return result; error: - Tcl_Release((ClientData) scrollPtr); + Tcl_Release(scrollPtr); return TCL_ERROR; } @@ -528,7 +528,7 @@ ConfigureScrollbar( /* Information about widget; may or may not * already have values for some fields. */ int argc, /* Number of valid entries in argv. */ - CONST char **argv, /* Arguments. */ + const char **argv, /* Arguments. */ int flags) /* Flags to pass to Tk_ConfigureWidget. */ { if (Tk_ConfigureWidget(interp, scrollPtr->tkwin, tkpScrollbarConfigSpecs, @@ -587,7 +587,7 @@ TkScrollbarEventProc( ClientData clientData, /* Information about window. */ XEvent *eventPtr) /* Information about event. */ { - TkScrollbar *scrollPtr = (TkScrollbar *) clientData; + TkScrollbar *scrollPtr = clientData; if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) { TkScrollbarEventuallyRedraw(scrollPtr); @@ -599,7 +599,7 @@ TkScrollbarEventProc( scrollPtr->widgetCmd); } if (scrollPtr->flags & REDRAW_PENDING) { - Tcl_CancelIdleCall(TkpDisplayScrollbar, (ClientData) scrollPtr); + Tcl_CancelIdleCall(TkpDisplayScrollbar, scrollPtr); } /* * Free up all the stuff that requires special handling, then let @@ -608,7 +608,7 @@ TkScrollbarEventProc( Tk_FreeOptions(tkpScrollbarConfigSpecs, (char *) scrollPtr, scrollPtr->display, 0); - Tcl_EventuallyFree((ClientData) scrollPtr, TCL_DYNAMIC); + Tcl_EventuallyFree(scrollPtr, TCL_DYNAMIC); } else if (eventPtr->type == ConfigureNotify) { TkpComputeScrollbarGeometry(scrollPtr); TkScrollbarEventuallyRedraw(scrollPtr); @@ -651,7 +651,7 @@ static void ScrollbarCmdDeletedProc( ClientData clientData) /* Pointer to widget record for widget. */ { - TkScrollbar *scrollPtr = (TkScrollbar *) clientData; + TkScrollbar *scrollPtr = clientData; Tk_Window tkwin = scrollPtr->tkwin; /* @@ -691,7 +691,7 @@ TkScrollbarEventuallyRedraw( return; } if ((scrollPtr->flags & REDRAW_PENDING) == 0) { - Tcl_DoWhenIdle(TkpDisplayScrollbar, (ClientData) scrollPtr); + Tcl_DoWhenIdle(TkpDisplayScrollbar, scrollPtr); scrollPtr->flags |= REDRAW_PENDING; } } diff --git a/generic/tkSelect.c b/generic/tkSelect.c index dca3d1c..e02478f 100644 --- a/generic/tkSelect.c +++ b/generic/tkSelect.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkSelect.c,v 1.20 2007/04/17 14:36:49 dkf Exp $ + * RCS: @(#) $Id: tkSelect.c,v 1.21 2008/04/27 22:38:58 dkf Exp $ */ #include "tkInt.h" @@ -197,7 +197,7 @@ Tk_CreateSelHandler( unsigned cmdInfoLen = sizeof(CommandInfo) + ((CommandInfo*)clientData)->cmdLength - 3; - selPtr->clientData = (ClientData)ckalloc(cmdInfoLen); + selPtr->clientData = (ClientData) ckalloc(cmdInfoLen); memcpy(selPtr->clientData, clientData, cmdInfoLen); } else { selPtr->clientData = clientData; @@ -321,7 +321,7 @@ Tk_DeleteSelHandler( * Mark the CommandInfo as deleted and free it if we can. */ - ((CommandInfo*)selPtr->clientData)->interp = NULL; + ((CommandInfo *) selPtr->clientData)->interp = NULL; Tcl_EventuallyFree(selPtr->clientData, TCL_DYNAMIC); } ckfree((char *) selPtr); @@ -671,15 +671,15 @@ Tk_SelectionObjCmd( * interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { - Tk_Window tkwin = (Tk_Window) clientData; + Tk_Window tkwin = clientData; char *path = NULL; Atom selection; char *selName = NULL, *string; int count, index; Tcl_Obj **objs; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "clear", "get", "handle", "own", NULL }; enum options { @@ -698,7 +698,7 @@ Tk_SelectionObjCmd( switch ((enum options) index) { case SELECTION_CLEAR: { - static CONST char *clearOptionStrings[] = { + static const char *clearOptionStrings[] = { "-displayof", "-selection", NULL }; enum clearOptions { CLEAR_DISPLAYOF, CLEAR_SELECTION }; @@ -757,7 +757,7 @@ Tk_SelectionObjCmd( char *targetName = NULL; Tcl_DString selBytes; int result; - static CONST char *getOptionStrings[] = { + static const char *getOptionStrings[] = { "-displayof", "-selection", "-type", NULL }; enum getOptions { GET_DISPLAYOF, GET_SELECTION, GET_TYPE }; @@ -817,7 +817,7 @@ Tk_SelectionObjCmd( Tcl_DStringInit(&selBytes); result = Tk_GetSelection(interp, tkwin, selection, target, - SelGetProc, (ClientData) &selBytes); + SelGetProc, &selBytes); if (result == TCL_OK) { Tcl_DStringResult(interp, &selBytes); } else { @@ -832,7 +832,7 @@ Tk_SelectionObjCmd( char *formatName = NULL; register CommandInfo *cmdInfoPtr; int cmdLength; - static CONST char *handleOptionStrings[] = { + static const char *handleOptionStrings[] = { "-format", "-selection", "-type", NULL }; enum handleOptions { @@ -911,7 +911,7 @@ Tk_SelectionObjCmd( cmdInfoPtr->cmdLength = cmdLength; strcpy(cmdInfoPtr->command, string); Tk_CreateSelHandler(tkwin, selection, target, HandleTclCommand, - (ClientData) cmdInfoPtr, format); + cmdInfoPtr, format); } return TCL_OK; } @@ -920,7 +920,7 @@ Tk_SelectionObjCmd( register LostCommand *lostPtr; char *script = NULL; int cmdLength; - static CONST char *ownOptionStrings[] = { + static const char *ownOptionStrings[] = { "-command", "-displayof", "-selection", NULL }; enum ownOptions { OWN_COMMAND, OWN_DISPLAYOF, OWN_SELECTION }; @@ -1003,15 +1003,15 @@ Tk_SelectionObjCmd( script = Tcl_GetString(objs[1]); } if (script == NULL) { - Tk_OwnSelection(tkwin, selection, NULL, (ClientData) NULL); + Tk_OwnSelection(tkwin, selection, NULL, NULL); return TCL_OK; } cmdLength = strlen(script); - lostPtr = (LostCommand *) ckalloc((unsigned) (sizeof(LostCommand) - -3 + cmdLength)); + lostPtr = (LostCommand *) + ckalloc((unsigned) (sizeof(LostCommand) - 3 + cmdLength)); lostPtr->interp = interp; strcpy(lostPtr->command, script); - Tk_OwnSelection(tkwin, selection, LostSelection, (ClientData) lostPtr); + Tk_OwnSelection(tkwin, selection, LostSelection, lostPtr); return TCL_OK; } } @@ -1119,7 +1119,7 @@ TkSelDeadWindow( * Mark the CommandInfo as deleted and free it when we can. */ - ((CommandInfo*)selPtr->clientData)->interp = NULL; + ((CommandInfo *) selPtr->clientData)->interp = NULL; Tcl_EventuallyFree(selPtr->clientData, TCL_DYNAMIC); } ckfree((char *) selPtr); @@ -1292,7 +1292,7 @@ SelGetProc( * used). */ char *portion) /* New information to be appended. */ { - Tcl_DStringAppend((Tcl_DString *) clientData, portion, -1); + Tcl_DStringAppend(clientData, portion, -1); return TCL_OK; } @@ -1324,7 +1324,7 @@ HandleTclCommand( char *buffer, /* Place to store converted selection. */ int maxBytes) /* Maximum # of bytes to store at buffer. */ { - CommandInfo *cmdInfoPtr = (CommandInfo *) clientData; + CommandInfo *cmdInfoPtr = clientData; int spaceNeeded, length; #define MAX_STATIC_SIZE 100 char staticSpace[MAX_STATIC_SIZE]; @@ -1333,7 +1333,7 @@ HandleTclCommand( Tcl_DString oldResult; Tcl_Obj *objPtr; int extraBytes, charOffset, count, numChars; - CONST char *p; + const char *p; /* * We must also protect the interpreter and the command from being deleted @@ -1341,7 +1341,7 @@ HandleTclCommand( */ Tcl_Preserve(clientData); - Tcl_Preserve((ClientData) interp); + Tcl_Preserve(interp); /* * Compute the proper byte offset in the case where the last chunk split a @@ -1427,7 +1427,7 @@ HandleTclCommand( } Tcl_Release(clientData); - Tcl_Release((ClientData) interp); + Tcl_Release(interp); return count; } @@ -1492,7 +1492,7 @@ TkSelDefaultSelection( if ((selPtr->selection == infoPtr->selection) && (selPtr->target != dispPtr->applicationAtom) && (selPtr->target != dispPtr->windowAtom)) { - CONST char *atomString = Tk_GetAtomName((Tk_Window) winPtr, + const char *atomString = Tk_GetAtomName((Tk_Window) winPtr, selPtr->target); Tcl_DStringAppendElement(&ds, atomString); } @@ -1559,12 +1559,12 @@ static void LostSelection( ClientData clientData) /* Pointer to LostCommand structure. */ { - LostCommand *lostPtr = (LostCommand *) clientData; + LostCommand *lostPtr = clientData; Tcl_Obj *objPtr; Tcl_Interp *interp; interp = lostPtr->interp; - Tcl_Preserve((ClientData) interp); + Tcl_Preserve(interp); /* * Execute the command. Save the interpreter's result, if any, and restore @@ -1582,7 +1582,7 @@ LostSelection( Tcl_SetObjResult(interp, objPtr); Tcl_DecrRefCount(objPtr); - Tcl_Release((ClientData) interp); + Tcl_Release(interp); /* * Free the storage for the command, since we're done with it now. diff --git a/generic/tkSquare.c b/generic/tkSquare.c index 6bfde11..29d9957 100644 --- a/generic/tkSquare.c +++ b/generic/tkSquare.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkSquare.c,v 1.10 2007/12/13 15:24:16 dgp Exp $ + * RCS: @(#) $Id: tkSquare.c,v 1.11 2008/04/27 22:38:58 dkf Exp $ */ #if 0 @@ -94,7 +94,7 @@ static const Tk_OptionSpec optionSpecs[] = { int SquareObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj * CONST objv[]); + Tcl_Obj * const objv[]); static void SquareDeletedProc(ClientData clientData); static int SquareConfigure(Tcl_Interp *interp, Square *squarePtr); static void SquareDestroy(char *memPtr); @@ -103,7 +103,7 @@ static void KeepInWindow(Square *squarePtr); static void SquareObjEventProc(ClientData clientData, XEvent *eventPtr); static int SquareWidgetObjCmd(ClientData clientData, - Tcl_Interp *, int objc, Tcl_Obj * CONST objv[]); + Tcl_Interp *, int objc, Tcl_Obj * const objv[]); /* *-------------------------------------------------------------- @@ -127,7 +127,7 @@ SquareObjCmd( ClientData clientData, /* NULL. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { Square *squarePtr; Tk_Window tkwin; @@ -166,8 +166,8 @@ SquareObjCmd( squarePtr->display = Tk_Display(tkwin); squarePtr->interp = interp; squarePtr->widgetCmd = Tcl_CreateObjCommand(interp, - Tk_PathName(squarePtr->tkwin), SquareWidgetObjCmd, - (ClientData) squarePtr, SquareDeletedProc); + Tk_PathName(squarePtr->tkwin), SquareWidgetObjCmd, squarePtr, + SquareDeletedProc); squarePtr->gc = None; squarePtr->optionTable = optionTable; @@ -179,7 +179,7 @@ SquareObjCmd( } Tk_CreateEventHandler(squarePtr->tkwin, ExposureMask|StructureNotifyMask, - SquareObjEventProc, (ClientData) squarePtr); + SquareObjEventProc, squarePtr); if (Tk_SetOptions(interp, (char *) squarePtr, optionTable, objc - 2, objv + 2, tkwin, NULL, NULL) != TCL_OK) { goto error; @@ -220,11 +220,11 @@ SquareWidgetObjCmd( ClientData clientData, /* Information about square widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj * CONST objv[]) /* Argument objects. */ + Tcl_Obj * const objv[]) /* Argument objects. */ { - Square *squarePtr = (Square *) clientData; + Square *squarePtr = clientData; int result = TCL_OK; - static CONST char *squareOptions[] = {"cget", "configure", NULL}; + static const char *squareOptions[] = {"cget", "configure", NULL}; enum { SQUARE_CGET, SQUARE_CONFIGURE }; @@ -241,7 +241,7 @@ SquareWidgetObjCmd( return TCL_ERROR; } - Tcl_Preserve((ClientData) squarePtr); + Tcl_Preserve(squarePtr); switch (index) { case SQUARE_CGET: @@ -279,7 +279,7 @@ SquareWidgetObjCmd( result = SquareConfigure(interp, squarePtr); } if (!squarePtr->updatePending) { - Tcl_DoWhenIdle(SquareDisplay, (ClientData) squarePtr); + Tcl_DoWhenIdle(SquareDisplay, squarePtr); squarePtr->updatePending = 1; } } @@ -287,11 +287,11 @@ SquareWidgetObjCmd( Tcl_SetObjResult(interp, resultObjPtr); } } - Tcl_Release((ClientData) squarePtr); + Tcl_Release(squarePtr); return result; error: - Tcl_Release((ClientData) squarePtr); + Tcl_Release(squarePtr); return TCL_ERROR; } @@ -352,7 +352,7 @@ SquareConfigure( &borderWidth); Tk_SetInternalBorder(squarePtr->tkwin, borderWidth); if (!squarePtr->updatePending) { - Tcl_DoWhenIdle(SquareDisplay, (ClientData) squarePtr); + Tcl_DoWhenIdle(SquareDisplay, squarePtr); squarePtr->updatePending = 1; } KeepInWindow(squarePtr); @@ -382,17 +382,17 @@ SquareObjEventProc( ClientData clientData, /* Information about window. */ XEvent *eventPtr) /* Information about event. */ { - Square *squarePtr = (Square *) clientData; + Square *squarePtr = clientData; if (eventPtr->type == Expose) { if (!squarePtr->updatePending) { - Tcl_DoWhenIdle(SquareDisplay, (ClientData) squarePtr); + Tcl_DoWhenIdle(SquareDisplay, squarePtr); squarePtr->updatePending = 1; } } else if (eventPtr->type == ConfigureNotify) { KeepInWindow(squarePtr); if (!squarePtr->updatePending) { - Tcl_DoWhenIdle(SquareDisplay, (ClientData) squarePtr); + Tcl_DoWhenIdle(SquareDisplay, squarePtr); squarePtr->updatePending = 1; } } else if (eventPtr->type == DestroyNotify) { @@ -407,9 +407,9 @@ SquareObjEventProc( squarePtr->widgetCmd); } if (squarePtr->updatePending) { - Tcl_CancelIdleCall(SquareDisplay, (ClientData) squarePtr); + Tcl_CancelIdleCall(SquareDisplay, squarePtr); } - Tcl_EventuallyFree((ClientData) squarePtr, SquareDestroy); + Tcl_EventuallyFree(squarePtr, SquareDestroy); } } @@ -435,7 +435,7 @@ static void SquareDeletedProc( ClientData clientData) /* Pointer to widget record for widget. */ { - Square *squarePtr = (Square *) clientData; + Square *squarePtr = clientData; Tk_Window tkwin = squarePtr->tkwin; /* @@ -472,7 +472,7 @@ static void SquareDisplay( ClientData clientData) /* Information about window. */ { - Square *squarePtr = (Square *) clientData; + Square *squarePtr = clientData; Tk_Window tkwin = squarePtr->tkwin; Pixmap pm = None; Drawable d; diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index c7f02e7..2372007 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkStubInit.c,v 1.62 2008/04/16 14:51:29 das Exp $ + * RCS: @(#) $Id: tkStubInit.c,v 1.63 2008/04/27 22:38:58 dkf Exp $ */ #include "tkInt.h" @@ -37,9 +37,9 @@ */ #define Tk_CreateCanvasVisitor \ - ((void (*)(Tcl_Interp * interp, VOID * typePtr)) NULL) + ((void (*)(Tcl_Interp * interp, void * typePtr)) NULL) #define Tk_GetCanvasVisitor \ - ((VOID * (*)(Tcl_Interp * interp, CONST char * name)) NULL) + ((void * (*)(Tcl_Interp * interp, const char * name)) NULL) /* * WARNING: The contents of this file is automatically generated by the diff --git a/generic/tkStubLib.c b/generic/tkStubLib.c index ddfd986..ce47028 100644 --- a/generic/tkStubLib.c +++ b/generic/tkStubLib.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkStubLib.c,v 1.24 2008/04/02 21:31:58 das Exp $ + * RCS: @(#) $Id: tkStubLib.c,v 1.25 2008/04/27 22:38:58 dkf Exp $ */ /* @@ -59,7 +59,9 @@ const TkIntXlibStubs *tkIntXlibStubsPtr = NULL; * Use our own isdigit to avoid linking to libc on windows */ -static int isDigit(const int c) +static int +isDigit( + const int c) { return (c >= '0' && c <= '9'); } @@ -82,13 +84,13 @@ static int isDigit(const int c) *---------------------------------------------------------------------- */ -MODULE_SCOPE CONST char * +MODULE_SCOPE const char * Tk_InitStubs( Tcl_Interp *interp, - CONST char *version, + const char *version, int exact) { - CONST char *actualVersion; + const char *actualVersion; const TkStubs **stubsPtrPtr = &tkStubsPtr; /* squelch warning */ actualVersion = Tcl_PkgRequireEx(interp, "Tk", version, 0, @@ -97,14 +99,14 @@ Tk_InitStubs( return NULL; } if (exact) { - CONST char *p = version; + const char *p = version; int count = 0; while (*p) { count += !isDigit(*p++); } if (count == 1) { - CONST char *q = actualVersion; + const char *q = actualVersion; p = version; while (*p && (*p == *q)) { diff --git a/generic/tkStyle.c b/generic/tkStyle.c index 5f2ada2..24464c0 100644 --- a/generic/tkStyle.c +++ b/generic/tkStyle.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkStyle.c,v 1.8 2007/12/13 15:24:16 dgp Exp $ + * RCS: @(#) $Id: tkStyle.c,v 1.9 2008/04/27 22:38:58 dkf Exp $ */ #include "tkInt.h" @@ -26,7 +26,7 @@ typedef struct StyledWidgetSpec { * structure. */ Tk_OptionTable optionTable; /* Option table for the widget class using the * element. */ - CONST Tk_OptionSpec **optionsPtr; + const Tk_OptionSpec **optionsPtr; /* Table of option spec pointers, matching the * option list provided during element * registration. Malloc'd. */ @@ -60,7 +60,7 @@ typedef struct StyledElement { */ typedef struct StyleEngine { - CONST char *name; /* Name of engine. Points to a hash key. */ + const char *name; /* Name of engine. Points to a hash key. */ StyledElement *elements; /* Table of widget element descriptors. Each * element is indexed by a unique system-wide * ID. Table grows dynamically as new elements @@ -77,7 +77,7 @@ typedef struct StyleEngine { */ typedef struct Style { - CONST char *name; /* Name of style. Points to a hash key. */ + const char *name; /* Name of style. Points to a hash key. */ StyleEngine *enginePtr; /* Style engine of which the style is an * instance. */ ClientData clientData; /* Data provided during registration. */ @@ -88,7 +88,7 @@ typedef struct Style { */ typedef struct Element { - CONST char *name; /* Name of element. Points to a hash key. */ + const char *name; /* Name of element. Points to a hash key. */ int id; /* Id of element. */ int genericId; /* Id of generic element. */ int created; /* Boolean, whether the element was created @@ -122,7 +122,7 @@ static Tcl_ThreadDataKey dataKey; * Forward declarations for functions defined later in this file: */ -static int CreateElement(CONST char *name, int create); +static int CreateElement(const char *name, int create); static void DupStyleObjProc(Tcl_Obj *srcObjPtr, Tcl_Obj *dupObjPtr); static void FreeElement(Element *elementPtr); @@ -134,13 +134,13 @@ static StyledElement * GetStyledElement(StyleEngine *enginePtr, int elementId); static StyledWidgetSpec*GetWidgetSpec(StyledElement *elementPtr, Tk_OptionTable optionTable); -static void InitElement(Element *elementPtr, CONST char *name, +static void InitElement(Element *elementPtr, const char *name, int id, int genericId, int created); -static void InitStyle(Style *stylePtr, CONST char *name, +static void InitStyle(Style *stylePtr, const char *name, StyleEngine *enginePtr, ClientData clientData); static void InitStyledElement(StyledElement *elementPtr); static void InitStyleEngine(StyleEngine *enginePtr, - CONST char *name, StyleEngine *parentPtr); + const char *name, StyleEngine *parentPtr); static void InitWidgetSpec(StyledWidgetSpec *widgetSpecPtr, StyledElement *elementPtr, Tk_OptionTable optionTable); @@ -182,7 +182,7 @@ void TkStylePkgInit( TkMainInfo *mainPtr) /* The application being created. */ { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (tsdPtr->nbInit != 0) { @@ -238,7 +238,7 @@ void TkStylePkgFree( TkMainInfo *mainPtr) /* The application being deleted. */ { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_HashSearch search; Tcl_HashEntry *entryPtr; @@ -267,7 +267,7 @@ TkStylePkgFree( entryPtr = Tcl_FirstHashEntry(&tsdPtr->engineTable, &search); while (entryPtr != NULL) { - enginePtr = (StyleEngine *) Tcl_GetHashValue(entryPtr); + enginePtr = Tcl_GetHashValue(entryPtr); FreeStyleEngine(enginePtr); ckfree((char *) enginePtr); entryPtr = Tcl_NextHashEntry(&search); @@ -305,12 +305,12 @@ TkStylePkgFree( Tk_StyleEngine Tk_RegisterStyleEngine( - CONST char *name, /* Name of the engine to create. NULL or empty + const char *name, /* Name of the engine to create. NULL or empty * means the default system engine. */ Tk_StyleEngine parent) /* The engine's parent. NULL means the default * system engine. */ { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_HashEntry *entryPtr; int newEntry; @@ -337,7 +337,7 @@ Tk_RegisterStyleEngine( enginePtr = (StyleEngine *) ckalloc(sizeof(StyleEngine)); InitStyleEngine(enginePtr, Tcl_GetHashKey(&tsdPtr->engineTable, entryPtr), (StyleEngine *) parent); - Tcl_SetHashValue(entryPtr, (ClientData) enginePtr); + Tcl_SetHashValue(entryPtr, enginePtr); return (Tk_StyleEngine) enginePtr; } @@ -361,13 +361,13 @@ Tk_RegisterStyleEngine( static void InitStyleEngine( StyleEngine *enginePtr, /* Points to an uninitialized engine. */ - CONST char *name, /* Name of the registered engine. NULL or empty + const char *name, /* Name of the registered engine. NULL or empty * means the default system engine. Usually * points to the hash key. */ StyleEngine *parentPtr) /* The engine's parent. NULL means the default * system engine. */ { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); int elementId; @@ -377,14 +377,12 @@ InitStyleEngine( */ enginePtr->parentPtr = NULL; - } else if (parentPtr == NULL) { /* * The default style engine is the parent. */ enginePtr->parentPtr = tsdPtr->defaultEnginePtr; - } else { enginePtr->parentPtr = parentPtr; } @@ -424,7 +422,7 @@ static void FreeStyleEngine( StyleEngine *enginePtr) /* The style engine to free. */ { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); int elementId; @@ -456,10 +454,10 @@ FreeStyleEngine( Tk_StyleEngine Tk_GetStyleEngine( - CONST char *name) /* Name of the engine to retrieve. NULL or + const char *name) /* Name of the engine to retrieve. NULL or * empty means the default system engine. */ { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_HashEntry *entryPtr; @@ -472,7 +470,7 @@ Tk_GetStyleEngine( return NULL; } - return (Tk_StyleEngine) Tcl_GetHashValue(entryPtr); + return Tcl_GetHashValue(entryPtr); } /* @@ -494,7 +492,7 @@ Tk_GetStyleEngine( static void InitElement( Element *elementPtr, /* Points to an uninitialized element.*/ - CONST char *name, /* Name of the registered element. Usually + const char *name, /* Name of the registered element. Usually * points to the hash key. */ int id, /* Unique element ID. */ int genericId, /* ID of generic element. -1 means none. */ @@ -604,17 +602,16 @@ FreeStyledElement( static int CreateElement( - CONST char *name, /* Name of the element. */ - int create) /* Boolean, whether the element is being created - * explicitly (being registered) or implicitly (by a - * derived element). */ + const char *name, /* Name of the element. */ + int create) /* Boolean, whether the element is being + * created explicitly (being registered) or + * implicitly (by a derived element). */ { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_HashEntry *entryPtr, *engineEntryPtr; Tcl_HashSearch search; - int newEntry; - int elementId, genericId = -1; + int newEntry, elementId, genericId = -1; char *dot; StyleEngine *enginePtr; @@ -642,7 +639,7 @@ CreateElement( } elementId = tsdPtr->nbElements++; - Tcl_SetHashValue(entryPtr, (ClientData) INT2PTR(elementId)); + Tcl_SetHashValue(entryPtr, INT2PTR(elementId)); /* * Reallocate element table. @@ -660,7 +657,7 @@ CreateElement( engineEntryPtr = Tcl_FirstHashEntry(&tsdPtr->engineTable, &search); while (engineEntryPtr != NULL) { - enginePtr = (StyleEngine *) Tcl_GetHashValue(engineEntryPtr); + enginePtr = Tcl_GetHashValue(engineEntryPtr); enginePtr->elements = (StyledElement *) ckrealloc( (char *) enginePtr->elements, @@ -691,9 +688,9 @@ CreateElement( int Tk_GetElementId( - CONST char *name) /* Name of the element. */ + const char *name) /* Name of the element. */ { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_HashEntry *entryPtr; int genericId = -1; @@ -851,7 +848,7 @@ GetStyledElement( int elementId) /* Unique element ID */ { StyledElement *elementPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); StyleEngine *enginePtr2; @@ -912,7 +909,7 @@ InitWidgetSpec( { int i, nbOptions; Tk_ElementOptionSpec *elementOptionPtr; - CONST Tk_OptionSpec *widgetOptionPtr; + const Tk_OptionSpec *widgetOptionPtr; widgetSpecPtr->elementPtr = elementPtr; widgetSpecPtr->optionTable = optionTable; @@ -930,7 +927,7 @@ InitWidgetSpec( * Build the widget option list. */ - widgetSpecPtr->optionsPtr = (CONST Tk_OptionSpec **) + widgetSpecPtr->optionsPtr = (const Tk_OptionSpec **) ckalloc(sizeof(Tk_OptionSpec *) * nbOptions); for (i = 0, elementOptionPtr = elementPtr->specPtr->options; i < nbOptions; i++, elementOptionPtr++) { @@ -1232,12 +1229,12 @@ Tk_DrawElement( Tk_Style Tk_CreateStyle( - CONST char *name, /* Name of the style to create. NULL or empty + const char *name, /* Name of the style to create. NULL or empty * means the default system style. */ Tk_StyleEngine engine, /* The style engine. */ ClientData clientData) /* Private data passed as is to engine code. */ { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_HashEntry *entryPtr; int newEntry; @@ -1263,10 +1260,9 @@ Tk_CreateStyle( stylePtr = (Style *) ckalloc(sizeof(Style)); InitStyle(stylePtr, Tcl_GetHashKey(&tsdPtr->styleTable, entryPtr), - (engine != NULL ? (StyleEngine *) engine : - tsdPtr->defaultEnginePtr), + (engine!=NULL ? (StyleEngine*) engine : tsdPtr->defaultEnginePtr), clientData); - Tcl_SetHashValue(entryPtr, (ClientData) stylePtr); + Tcl_SetHashValue(entryPtr, stylePtr); return (Tk_Style) stylePtr; } @@ -1290,7 +1286,7 @@ Tk_CreateStyle( *--------------------------------------------------------------------------- */ -CONST char * +const char * Tk_NameOfStyle( Tk_Style style) /* Style whose name is desired. */ { @@ -1318,7 +1314,7 @@ Tk_NameOfStyle( static void InitStyle( Style *stylePtr, /* Points to an uninitialized style. */ - CONST char *name, /* Name of the registered style. NULL or empty + const char *name, /* Name of the registered style. NULL or empty * means the default system style. Usually * points to the hash key. */ StyleEngine *enginePtr, /* The style engine. */ @@ -1350,10 +1346,10 @@ InitStyle( Tk_Style Tk_GetStyle( Tcl_Interp *interp, /* Interp for error return. */ - CONST char *name) /* Name of the style to retrieve. NULL or empty + const char *name) /* Name of the style to retrieve. NULL or empty * means the default system style. */ { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_HashEntry *entryPtr; Style *stylePtr; @@ -1370,7 +1366,7 @@ Tk_GetStyle( } return (Tk_Style) NULL; } - stylePtr = (Style *) Tcl_GetHashValue(entryPtr); + stylePtr = Tcl_GetHashValue(entryPtr); return (Tk_Style) stylePtr; } @@ -1417,10 +1413,8 @@ Tk_AllocStyleFromObj( if (objPtr->typePtr != &styleObjType) { SetStyleFromAny(interp, objPtr); - stylePtr = (Style *) objPtr->internalRep.otherValuePtr; - } else { - stylePtr = (Style *) objPtr->internalRep.otherValuePtr; } + stylePtr = objPtr->internalRep.otherValuePtr; return (Tk_Style) stylePtr; } @@ -1452,7 +1446,7 @@ Tk_GetStyleFromObj( SetStyleFromAny(NULL, objPtr); } - return (Tk_Style) objPtr->internalRep.otherValuePtr; + return objPtr->internalRep.otherValuePtr; } /* @@ -1507,7 +1501,7 @@ SetStyleFromAny( } objPtr->typePtr = &styleObjType; - objPtr->internalRep.otherValuePtr = (VOID *) Tk_GetStyle(interp, name); + objPtr->internalRep.otherValuePtr = Tk_GetStyle(interp, name); return TCL_OK; } @@ -1551,7 +1545,8 @@ DupStyleObjProc( Tcl_Obj *dupObjPtr) /* The object we are copying to. */ { dupObjPtr->typePtr = srcObjPtr->typePtr; - dupObjPtr->internalRep.otherValuePtr=srcObjPtr->internalRep.otherValuePtr; + dupObjPtr->internalRep.otherValuePtr = + srcObjPtr->internalRep.otherValuePtr; } /* diff --git a/generic/tkTest.c b/generic/tkTest.c index 432f5f7..b294022 100644 --- a/generic/tkTest.c +++ b/generic/tkTest.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkTest.c,v 1.35 2007/12/13 15:24:16 dgp Exp $ + * RCS: @(#) $Id: tkTest.c,v 1.36 2008/04/27 22:38:58 dkf Exp $ */ #include "tkInt.h" @@ -61,7 +61,7 @@ typedef struct TImageInstance { */ static int ImageCreate(Tcl_Interp *interp, - char *name, int argc, Tcl_Obj *CONST objv[], + char *name, int argc, Tcl_Obj *const objv[], Tk_ImageType *typePtr, Tk_ImageMaster master, ClientData *clientDataPtr); static ClientData ImageGet(Tk_Window tkwin, ClientData clientData); @@ -103,7 +103,7 @@ static NewApp *newAppPtr = NULL;/* First in list of all new interpreters. */ extern int SquareObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj * CONST objv[]); + Tcl_Obj * const objv[]); typedef struct CBinding { Tcl_Interp *interp; @@ -144,39 +144,39 @@ static int CBindingEvalProc(ClientData clientData, static void CBindingFreeProc(ClientData clientData); int Tktest_Init(Tcl_Interp *interp); static int ImageCmd(ClientData dummy, - Tcl_Interp *interp, int argc, CONST char **argv); + Tcl_Interp *interp, int argc, const char **argv); static int TestcbindCmd(ClientData dummy, - Tcl_Interp *interp, int argc, CONST char **argv); + Tcl_Interp *interp, int argc, const char **argv); static int TestbitmapObjCmd(ClientData dummy, Tcl_Interp *interp, int objc, - Tcl_Obj * CONST objv[]); + Tcl_Obj * const objv[]); static int TestborderObjCmd(ClientData dummy, Tcl_Interp *interp, int objc, - Tcl_Obj * CONST objv[]); + Tcl_Obj * const objv[]); static int TestcolorObjCmd(ClientData dummy, Tcl_Interp *interp, int objc, - Tcl_Obj * CONST objv[]); + Tcl_Obj * const objv[]); static int TestcursorObjCmd(ClientData dummy, Tcl_Interp *interp, int objc, - Tcl_Obj * CONST objv[]); + Tcl_Obj * const objv[]); static int TestdeleteappsCmd(ClientData dummy, - Tcl_Interp *interp, int argc, CONST char **argv); + Tcl_Interp *interp, int argc, const char **argv); static int TestfontObjCmd(ClientData dummy, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TestmakeexistCmd(ClientData dummy, - Tcl_Interp *interp, int argc, CONST char **argv); + Tcl_Interp *interp, int argc, const char **argv); #if !(defined(__WIN32__) || defined(MAC_OSX_TK)) static int TestmenubarCmd(ClientData dummy, - Tcl_Interp *interp, int argc, CONST char **argv); + Tcl_Interp *interp, int argc, const char **argv); #endif #if defined(__WIN32__) || defined(MAC_OSX_TK) static int TestmetricsCmd(ClientData dummy, - Tcl_Interp *interp, int argc, CONST char **argv); + Tcl_Interp *interp, int argc, const char **argv); #endif static int TestobjconfigObjCmd(ClientData dummy, Tcl_Interp *interp, int objc, - Tcl_Obj * CONST objv[]); + Tcl_Obj * const objv[]); static int CustomOptionSet(ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj **value, char *recordPtr, @@ -191,15 +191,15 @@ static void CustomOptionRestore(ClientData clientData, static void CustomOptionFree(ClientData clientData, Tk_Window tkwin, char *internalPtr); static int TestpropCmd(ClientData dummy, - Tcl_Interp *interp, int argc, CONST char **argv); + Tcl_Interp *interp, int argc, const char **argv); #if !(defined(__WIN32__) || defined(MAC_OSX_TK)) static int TestwrapperCmd(ClientData dummy, - Tcl_Interp *interp, int argc, CONST char **argv); + Tcl_Interp *interp, int argc, const char **argv); #endif static void TrivialCmdDeletedProc(ClientData clientData); static int TrivialConfigObjCmd(ClientData dummy, Tcl_Interp *interp, int objc, - Tcl_Obj * CONST objv[]); + Tcl_Obj * const objv[]); static void TrivialEventProc(ClientData clientData, XEvent *eventPtr); @@ -334,7 +334,7 @@ TestcbindCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int argc, /* Number of arguments. */ - CONST char **argv) /* Argument strings. */ + const char **argv) /* Argument strings. */ { TkWindow *winPtr; Tk_Window tkwin; @@ -442,7 +442,7 @@ TestbitmapObjCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { if (objc < 2) { @@ -477,7 +477,7 @@ TestborderObjCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { if (objc < 2) { @@ -512,7 +512,7 @@ TestcolorObjCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "color"); @@ -546,7 +546,7 @@ TestcursorObjCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "cursor"); @@ -581,7 +581,7 @@ TestdeleteappsCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int argc, /* Number of arguments. */ - CONST char **argv) /* Argument strings. */ + const char **argv) /* Argument strings. */ { NewApp *nextPtr; @@ -618,9 +618,9 @@ TestobjconfigObjCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { - static CONST char *options[] = { + static const char *options[] = { "alltypes", "chain1", "chain2", "configerror", "delete", "info", "internal", "new", "notenoughparams", "twowindows", NULL }; @@ -1249,10 +1249,10 @@ TrivialConfigObjCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { int result = TCL_OK; - static CONST char *options[] = { + static const char *options[] = { "cget", "configure", "csave", NULL }; enum { @@ -1432,9 +1432,9 @@ TestfontObjCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { - static CONST char *options[] = {"counts", "subfonts", NULL}; + static const char *options[] = {"counts", "subfonts", NULL}; enum option {COUNTS, SUBFONTS}; int index; Tk_Window tkwin; @@ -1493,7 +1493,7 @@ ImageCreate( * image. */ char *name, /* Name to use for image. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[], /* Argument strings for options (doesn't + Tcl_Obj *const objv[], /* Argument strings for options (doesn't * include image name or type). */ Tk_ImageType *typePtr, /* Pointer to our type record (not used). */ Tk_ImageMaster master, /* Token for image, to be used by us in later @@ -1558,7 +1558,7 @@ ImageCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int argc, /* Number of arguments. */ - CONST char **argv) /* Argument strings. */ + const char **argv) /* Argument strings. */ { TImageMaster *timPtr = (TImageMaster *) clientData; int x, y, width, height; @@ -1779,7 +1779,7 @@ TestmakeexistCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int argc, /* Number of arguments. */ - CONST char **argv) /* Argument strings. */ + const char **argv) /* Argument strings. */ { Tk_Window mainWin = (Tk_Window) clientData; int i; @@ -1821,7 +1821,7 @@ TestmenubarCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int argc, /* Number of arguments. */ - CONST char **argv) /* Argument strings. */ + const char **argv) /* Argument strings. */ { #ifdef __UNIX__ Tk_Window mainWin = (Tk_Window) clientData; @@ -1890,7 +1890,7 @@ TestmetricsCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int argc, /* Number of arguments. */ - CONST char **argv) /* Argument strings. */ + const char **argv) /* Argument strings. */ { char buf[TCL_INTEGER_SPACE]; int val; @@ -1963,7 +1963,7 @@ TestpropCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int argc, /* Number of arguments. */ - CONST char **argv) /* Argument strings. */ + const char **argv) /* Argument strings. */ { Tk_Window mainWin = (Tk_Window) clientData; int result, actualFormat; @@ -2043,7 +2043,7 @@ TestwrapperCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int argc, /* Number of arguments. */ - CONST char **argv) /* Argument strings. */ + const char **argv) /* Argument strings. */ { TkWindow *winPtr, *wrapperPtr; Tk_Window tkwin; diff --git a/generic/tkText.c b/generic/tkText.c index 0032ad5..97ce974 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkText.c,v 1.79 2007/12/13 15:24:16 dgp Exp $ + * RCS: @(#) $Id: tkText.c,v 1.80 2008/04/27 22:38:58 dkf Exp $ */ #include "default.h" @@ -331,13 +331,13 @@ int tkTextDebug = 0; */ static int ConfigureText(Tcl_Interp *interp, - TkText *textPtr, int objc, Tcl_Obj *CONST objv[]); + TkText *textPtr, int objc, Tcl_Obj *const objv[]); static int DeleteIndexRange(TkSharedText *sharedPtr, - TkText *textPtr, CONST TkTextIndex *indexPtr1, - CONST TkTextIndex *indexPtr2, int viewUpdate); -static int CountIndices(CONST TkText *textPtr, - CONST TkTextIndex *indexPtr1, - CONST TkTextIndex *indexPtr2, + TkText *textPtr, const TkTextIndex *indexPtr1, + const TkTextIndex *indexPtr2, int viewUpdate); +static int CountIndices(const TkText *textPtr, + const TkTextIndex *indexPtr1, + const TkTextIndex *indexPtr2, TkTextCountType type); static void DestroyText(TkText *textPtr); static int InsertChars(TkSharedText *sharedTextPtr, @@ -346,58 +346,58 @@ static int InsertChars(TkSharedText *sharedTextPtr, static void TextBlinkProc(ClientData clientData); static void TextCmdDeletedProc(ClientData clientData); static int CreateWidget(TkSharedText *sharedPtr, Tk_Window tkwin, - Tcl_Interp *interp, CONST TkText *parent, - int objc, Tcl_Obj *CONST objv[]); + Tcl_Interp *interp, const TkText *parent, + int objc, Tcl_Obj *const objv[]); static void TextEventProc(ClientData clientData, XEvent *eventPtr); static int TextFetchSelection(ClientData clientData, int offset, char *buffer, int maxBytes); -static int TextIndexSortProc(CONST void *first, - CONST void *second); +static int TextIndexSortProc(const void *first, + const void *second); static int TextInsertCmd(TkSharedText *sharedTextPtr, TkText *textPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[], - CONST TkTextIndex *indexPtr, int viewUpdate); + int objc, Tcl_Obj *const objv[], + const TkTextIndex *indexPtr, int viewUpdate); static int TextReplaceCmd(TkText *textPtr, Tcl_Interp *interp, - CONST TkTextIndex *indexFromPtr, - CONST TkTextIndex *indexToPtr, - int objc, Tcl_Obj *CONST objv[], int viewUpdate); + const TkTextIndex *indexFromPtr, + const TkTextIndex *indexToPtr, + int objc, Tcl_Obj *const objv[], int viewUpdate); static int TextSearchCmd(TkText *textPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static int TextEditCmd(TkText *textPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static int TextWidgetObjCmd(ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static int SharedTextObjCmd(ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static void TextWorldChangedCallback(ClientData instanceData); static void TextWorldChanged(TkText *textPtr, int mask); static int TextDumpCmd(TkText *textPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static int DumpLine(Tcl_Interp *interp, TkText *textPtr, int what, TkTextLine *linePtr, int start, int end, int lineno, Tcl_Obj *command); static int DumpSegment(TkText *textPtr, Tcl_Interp *interp, - CONST char *key, CONST char *value, - Tcl_Obj *command, CONST TkTextIndex *index, + const char *key, const char *value, + Tcl_Obj *command, const TkTextIndex *index, int what); static int TextEditUndo(TkText *textPtr); static int TextEditRedo(TkText *textPtr); -static Tcl_Obj * TextGetText(CONST TkText *textPtr, - CONST TkTextIndex *index1, - CONST TkTextIndex *index2, int visibleOnly); +static Tcl_Obj * TextGetText(const TkText *textPtr, + const TkTextIndex *index1, + const TkTextIndex *index2, int visibleOnly); static void GenerateModifiedEvent(TkText *textPtr); static void UpdateDirtyFlag(TkSharedText *sharedPtr); static void TextPushUndoAction(TkText *textPtr, Tcl_Obj *undoString, int insert, - CONST TkTextIndex *index1Ptr, - CONST TkTextIndex *index2Ptr); -static int TextSearchIndexInLine(CONST SearchSpec *searchSpecPtr, + const TkTextIndex *index1Ptr, + const TkTextIndex *index2Ptr); +static int TextSearchIndexInLine(const SearchSpec *searchSpecPtr, TkTextLine *linePtr, int byteIndex); static int TextPeerCmd(TkText *textPtr, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); static TkUndoProc TextUndoRedoCallback; /* @@ -441,7 +441,7 @@ Tk_TextObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window tkwin = (Tk_Window) clientData; @@ -479,10 +479,10 @@ CreateWidget( TkSharedText *sharedPtr, /* Shared widget info, or NULL. */ Tk_Window tkwin, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ - CONST TkText *parent, /* If non-NULL then take default start, end + const TkText *parent, /* If non-NULL then take default start, end * from this parent. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register TkText *textPtr; Tk_OptionTable optionTable; @@ -679,13 +679,13 @@ TextWidgetObjCmd( ClientData clientData, /* Information about text widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register TkText *textPtr = (TkText *) clientData; int result = TCL_OK; int index; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "bbox", "cget", "compare", "configure", "count", "debug", "delete", "dlineinfo", "dump", "edit", "get", "image", "index", "insert", "mark", "peer", "replace", "scan", "search", "see", "tag", "window", @@ -713,7 +713,7 @@ TextWidgetObjCmd( switch ((enum options) index) { case TEXT_BBOX: { int x, y, width, height; - CONST TkTextIndex *indexPtr; + const TkTextIndex *indexPtr; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "index"); @@ -757,8 +757,8 @@ TextWidgetObjCmd( break; case TEXT_COMPARE: { int relation, value; - CONST char *p; - CONST TkTextIndex *index1Ptr, *index2Ptr; + const char *p; + const TkTextIndex *index1Ptr, *index2Ptr; if (objc != 5) { Tcl_WrongNumArgs(interp, 2, objv, "index1 op index2"); @@ -818,7 +818,7 @@ TextWidgetObjCmd( } break; case TEXT_COUNT: { - CONST TkTextIndex *indexFromPtr, *indexToPtr; + const TkTextIndex *indexFromPtr, *indexToPtr; int i, found = 0, update = 0; Tcl_Obj *objPtr = NULL; @@ -841,7 +841,7 @@ TextWidgetObjCmd( for (i = 2; i < objc-2; i++) { int value, length; - CONST char *option = Tcl_GetStringFromObj(objv[i], &length); + const char *option = Tcl_GetStringFromObj(objv[i], &length); char c; if (length < 2 || option[0] != '-') { @@ -880,7 +880,7 @@ TextWidgetObjCmd( } if (compare > 0) { - CONST TkTextIndex *tmpPtr = indexFromPtr; + const TkTextIndex *tmpPtr = indexFromPtr; indexFromPtr = indexToPtr; indexToPtr = tmpPtr; @@ -1061,7 +1061,7 @@ TextWidgetObjCmd( * Simple case requires no predetermination of indices. */ - CONST TkTextIndex *indexPtr1, *indexPtr2; + const TkTextIndex *indexPtr1, *indexPtr2; /* * Parse the starting and stopping indices. @@ -1107,7 +1107,7 @@ TextWidgetObjCmd( */ for (i = 0; i < objc; i++) { - CONST TkTextIndex *indexPtr = + const TkTextIndex *indexPtr = TkTextGetIndexFromObj(interp, textPtr, objv[i]); if (indexPtr == NULL) { @@ -1198,7 +1198,7 @@ TextWidgetObjCmd( break; case TEXT_DLINEINFO: { int x, y, width, height, base; - CONST TkTextIndex *indexPtr; + const TkTextIndex *indexPtr; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "index"); @@ -1233,7 +1233,7 @@ TextWidgetObjCmd( case TEXT_GET: { Tcl_Obj *objPtr = NULL; int i, found = 0, visible = 0; - CONST char *name; + const char *name; int length; if (objc < 3) { @@ -1264,7 +1264,7 @@ TextWidgetObjCmd( } for (; i < objc; i += 2) { - CONST TkTextIndex *index1Ptr, *index2Ptr; + const TkTextIndex *index1Ptr, *index2Ptr; TkTextIndex index2; index1Ptr = TkTextGetIndexFromObj(interp, textPtr, objv[i]); @@ -1328,7 +1328,7 @@ TextWidgetObjCmd( result = TkTextImageCmd(textPtr, interp, objc, objv); break; case TEXT_INDEX: { - CONST TkTextIndex *indexPtr; + const TkTextIndex *indexPtr; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "index"); @@ -1345,7 +1345,7 @@ TextWidgetObjCmd( break; } case TEXT_INSERT: { - CONST TkTextIndex *indexPtr; + const TkTextIndex *indexPtr; if (objc < 4) { Tcl_WrongNumArgs(interp, 2, objv, @@ -1371,7 +1371,7 @@ TextWidgetObjCmd( result = TextPeerCmd(textPtr, interp, objc, objv); break; case TEXT_REPLACE: { - CONST TkTextIndex *indexFromPtr, *indexToPtr; + const TkTextIndex *indexFromPtr, *indexToPtr; if (objc < 5) { Tcl_WrongNumArgs(interp, 2, objv, @@ -1530,13 +1530,13 @@ SharedTextObjCmd( ClientData clientData, /* Information about shared test B-tree. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register TkSharedText *sharedPtr = (TkSharedText *) clientData; int result = TCL_OK; int index; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "delete", "insert", NULL }; enum options { @@ -1636,12 +1636,12 @@ TextPeerCmd( TkText *textPtr, /* Information about text widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window tkwin = textPtr->tkwin; int index; - static CONST char *peerOptionStrings[] = { + static const char *peerOptionStrings[] = { "create", "names", NULL }; enum peerOptions { @@ -1710,12 +1710,12 @@ static int TextReplaceCmd( TkText *textPtr, /* Information about text widget. */ Tcl_Interp *interp, /* Current interpreter. */ - CONST TkTextIndex *indexFromPtr, + const TkTextIndex *indexFromPtr, /* Index from which to replace. */ - CONST TkTextIndex *indexToPtr, + const TkTextIndex *indexToPtr, /* Index to which to replace. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[], /* Argument objects. */ + Tcl_Obj *const objv[], /* Argument objects. */ int viewUpdate) /* Update vertical view if set. */ { /* @@ -1780,8 +1780,8 @@ TextReplaceCmd( static int TextIndexSortProc( - CONST void *first, /* Elements to be compared. */ - CONST void *second) + const void *first, /* Elements to be compared. */ + const void *second) { TkTextIndex *pair1 = (TkTextIndex *) first; TkTextIndex *pair2 = (TkTextIndex *) second; @@ -1997,7 +1997,7 @@ ConfigureText( register TkText *textPtr, /* Information about widget; may or may not * already have values for some fields. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_SavedOptions savedOptions; int oldExport = textPtr->exportSelection; @@ -2508,7 +2508,7 @@ InsertChars( int resetViewCount; int pixels[2*PIXEL_CLIENTS]; - CONST char *string = Tcl_GetStringFromObj(stringPtr, &length); + const char *string = Tcl_GetStringFromObj(stringPtr, &length); if (sharedTextPtr == NULL) { sharedTextPtr = textPtr->sharedTextPtr; @@ -2640,9 +2640,9 @@ TextPushUndoAction( TkText *textPtr, /* Overall information about text widget. */ Tcl_Obj *undoString, /* New text. */ int insert, /* 1 if insert, else delete. */ - CONST TkTextIndex *index1Ptr, + const TkTextIndex *index1Ptr, /* Index describing first location. */ - CONST TkTextIndex *index2Ptr) + const TkTextIndex *index2Ptr) /* Index describing second location. */ { TkUndoSubAtom *iAtom, *dAtom; @@ -2864,11 +2864,11 @@ TextUndoRedoCallback( static int CountIndices( - CONST TkText *textPtr, /* Overall information about text widget. */ - CONST TkTextIndex *indexPtr1, + const TkText *textPtr, /* Overall information about text widget. */ + const TkTextIndex *indexPtr1, /* Index describing location of first * character to delete. */ - CONST TkTextIndex *indexPtr2, + const TkTextIndex *indexPtr2, /* Index describing location of last character * to delete. NULL means just delete the one * character given by indexPtr1. */ @@ -2921,10 +2921,10 @@ static int DeleteIndexRange( TkSharedText *sharedTextPtr,/* Shared portion of peer widgets. */ TkText *textPtr, /* Overall information about text widget. */ - CONST TkTextIndex *indexPtr1, + const TkTextIndex *indexPtr1, /* Index describing location of first * character (or other entity) to delete. */ - CONST TkTextIndex *indexPtr2, + const TkTextIndex *indexPtr2, /* Index describing location of last * character (or other entity) to delete. * NULL means just delete the one character @@ -3491,8 +3491,8 @@ TextInsertCmd( TkText *textPtr, /* Information about text widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[], /* Argument objects. */ - CONST TkTextIndex *indexPtr,/* Index at which to insert. */ + Tcl_Obj *const objv[], /* Argument objects. */ + const TkTextIndex *indexPtr,/* Index at which to insert. */ int viewUpdate) /* Update the view if set. */ { TkTextIndex index1, index2; @@ -3536,7 +3536,7 @@ TextInsertCmd( int i; for (i = 0; i < numTags; i++) { - CONST char *strTag = Tcl_GetString(tagNamePtrs[i]); + const char *strTag = Tcl_GetString(tagNamePtrs[i]); TkBTreeTag(&index1, &index2, TkTextCreateTag(textPtr, strTag, NULL), 1); @@ -3570,12 +3570,12 @@ TextSearchCmd( TkText *textPtr, /* Information about text widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { int i, argsLeft, code; SearchSpec searchSpec; - static CONST char *switchStrings[] = { + static const char *switchStrings[] = { "--", "-all", "-backwards", "-count", "-elide", "-exact", "-forwards", "-hidden", "-nocase", "-nolinestop", "-overlap", "-regexp", "-strictlimits", NULL @@ -3787,7 +3787,7 @@ TextSearchGetLineIndex( int *offsetPosPtr) /* For returning the text offset in the * line. */ { - CONST TkTextIndex *indexPtr; + const TkTextIndex *indexPtr; int line; TkText *textPtr = (TkText *) searchSpecPtr->clientData; @@ -3846,7 +3846,7 @@ TextSearchGetLineIndex( static int TextSearchIndexInLine( - CONST SearchSpec *searchSpecPtr, + const SearchSpec *searchSpecPtr, /* Search parameters. */ TkTextLine *linePtr, /* The line we're looking at. */ int byteIndex) /* Index into the line. */ @@ -4066,7 +4066,7 @@ TextSearchFoundMatch( */ if (searchSpecPtr->exact) { - CONST char *startOfLine = Tcl_GetString(theLine); + const char *startOfLine = Tcl_GetString(theLine); numChars = Tcl_NumUtfChars(startOfLine + matchOffset, matchLength); } else { @@ -4277,7 +4277,7 @@ TkTextGetTabs( /* * Map these strings to TkTextTabAlign values. */ - static CONST char *tabOptionStrings[] = { + static const char *tabOptionStrings[] = { "left", "right", "center", "numeric", NULL }; @@ -4431,7 +4431,7 @@ TextDumpCmd( register TkText *textPtr, /* Information about text widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. Someone else has already + Tcl_Obj *const objv[]) /* Argument objects. Someone else has already * parsed this command enough to know that * objv[1] is "dump". */ { @@ -4449,7 +4449,7 @@ TextDumpCmd( #define TK_DUMP_IMG 0x10 #define TK_DUMP_ALL (TK_DUMP_TEXT|TK_DUMP_MARK|TK_DUMP_TAG| \ TK_DUMP_WIN|TK_DUMP_IMG) - static CONST char *optStrings[] = { + static const char *optStrings[] = { "-all", "-command", "-image", "-mark", "-tag", "-text", "-window", NULL }; @@ -4816,10 +4816,10 @@ static int DumpSegment( TkText *textPtr, Tcl_Interp *interp, - CONST char *key, /* Segment type key. */ - CONST char *value, /* Segment value. */ + const char *key, /* Segment type key. */ + const char *value, /* Segment value. */ Tcl_Obj *command, /* Script callback. */ - CONST TkTextIndex *index, /* index with line/byte position info. */ + const TkTextIndex *index, /* index with line/byte position info. */ int what) /* Look for TK_DUMP_INDEX bit. */ { char buffer[TK_POS_CHARS]; @@ -4831,7 +4831,7 @@ DumpSegment( Tcl_AppendElement(interp, buffer); return 0; } else { - CONST char *argv[4]; + const char *argv[4]; char *list; int oldStateEpoch = TkBTreeEpoch(textPtr->sharedTextPtr->tree); @@ -4956,11 +4956,11 @@ TextEditCmd( TkText *textPtr, /* Information about text widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { int index; - static CONST char *editOptionStrings[] = { + static const char *editOptionStrings[] = { "modified", "redo", "reset", "separator", "undo", NULL }; enum editOptions { @@ -5080,10 +5080,10 @@ TextEditCmd( static Tcl_Obj * TextGetText( - CONST TkText *textPtr, /* Information about text widget. */ - CONST TkTextIndex *indexPtr1, + const TkText *textPtr, /* Information about text widget. */ + const TkTextIndex *indexPtr1, /* Get text from this index... */ - CONST TkTextIndex *indexPtr2, + const TkTextIndex *indexPtr2, /* ...to this index. */ int visibleOnly) /* If non-zero, then only return non-elided * characters. */ @@ -5251,7 +5251,7 @@ SearchPerform( */ if (toPtr != NULL) { - CONST TkTextIndex *indexToPtr, *indexFromPtr; + const TkTextIndex *indexToPtr, *indexFromPtr; TkText *textPtr = (TkText *) searchSpecPtr->clientData; indexToPtr = TkTextGetIndexFromObj(interp, textPtr, toPtr); @@ -5345,7 +5345,7 @@ SearchCore( Tcl_Obj *theLine; int alreadySearchOffset = -1; - CONST char *pattern = NULL; /* For exact searches only. */ + const char *pattern = NULL; /* For exact searches only. */ int firstNewLine = -1; /* For exact searches only. */ Tcl_RegExp regexp = NULL; /* For regexp searches only. */ @@ -5403,7 +5403,7 @@ SearchCore( */ if (searchSpecPtr->exact) { - CONST char *nl; + const char *nl; /* * We only need to set the matchLength once for exact searches, and we @@ -5540,11 +5540,11 @@ SearchCore( if (searchSpecPtr->exact) { int maxExtraLines = 0; - CONST char *startOfLine = Tcl_GetString(theLine); + const char *startOfLine = Tcl_GetString(theLine); do { Tcl_UniChar ch; - CONST char *p; + const char *p; int lastFullLine = lastOffset; if (firstNewLine == -1) { @@ -5569,7 +5569,7 @@ SearchCore( * match. */ - CONST char c = pattern[0]; + const char c = pattern[0]; if (alreadySearchOffset != -1) { p = startOfLine + alreadySearchOffset; @@ -6515,7 +6515,7 @@ TkpTesttextCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int argc, /* Number of arguments. */ - CONST char **argv) /* Argument strings. */ + const char **argv) /* Argument strings. */ { TkText *textPtr; size_t len; diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index c8c8606..995b3e8 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkTextDisp.c,v 1.68 2007/12/13 15:24:17 dgp Exp $ + * RCS: @(#) $Id: tkTextDisp.c,v 1.69 2008/04/27 22:38:58 dkf Exp $ */ #include "tkInt.h" @@ -542,23 +542,23 @@ static void DisplayDLine(TkText *textPtr, DLine *dlPtr, static void DisplayLineBackground(TkText *textPtr, DLine *dlPtr, DLine *prevPtr, Pixmap pixmap); static void DisplayText(ClientData clientData); -static DLine * FindDLine(DLine *dlPtr, CONST TkTextIndex *indexPtr); +static DLine * FindDLine(DLine *dlPtr, const TkTextIndex *indexPtr); static void FreeDLines(TkText *textPtr, DLine *firstPtr, DLine *lastPtr, int action); static void FreeStyle(TkText *textPtr, TextStyle *stylePtr); -static TextStyle * GetStyle(TkText *textPtr, CONST TkTextIndex *indexPtr); +static TextStyle * GetStyle(TkText *textPtr, const TkTextIndex *indexPtr); static void GetXView(Tcl_Interp *interp, TkText *textPtr, int report); static void GetYView(Tcl_Interp *interp, TkText *textPtr, int report); static int GetYPixelCount(TkText *textPtr, DLine *dlPtr); static DLine * LayoutDLine(TkText *textPtr, - CONST TkTextIndex *indexPtr); -static int MeasureChars(Tk_Font tkfont, CONST char *source, + const TkTextIndex *indexPtr); +static int MeasureChars(Tk_Font tkfont, const char *source, int maxBytes, int rangeStart, int rangeLength, int startX, int maxX, int flags, int *nextXPtr); static void MeasureUp(TkText *textPtr, - CONST TkTextIndex *srcPtr, int distance, + const TkTextIndex *srcPtr, int distance, TkTextIndex *dstPtr, int *overlap); static int NextTabStop(Tk_Font tkfont, int x, int tabOrigin); static void UpdateDisplayInfo(TkText *textPtr); @@ -568,8 +568,8 @@ static int SizeOfTab(TkText *textPtr, int tabStyle, TkTextTabArray *tabArrayPtr, int *indexPtr, int x, int maxX); static void TextChanged(TkText *textPtr, - CONST TkTextIndex *index1Ptr, - CONST TkTextIndex *index2Ptr); + const TkTextIndex *index1Ptr, + const TkTextIndex *index2Ptr); static void TextInvalidateRegion(TkText *textPtr, TkRegion region); static void TextRedrawTag(TkText *textPtr, TkTextIndex *index1Ptr, TkTextIndex *index2Ptr, @@ -577,7 +577,7 @@ static void TextRedrawTag(TkText *textPtr, static void TextInvalidateLineMetrics(TkText *textPtr, TkTextLine *linePtr, int lineCount, int action); static int CalculateDisplayLineHeight(TkText *textPtr, - CONST TkTextIndex *indexPtr, int *byteCountPtr, + const TkTextIndex *indexPtr, int *byteCountPtr, int *mergedLinePtr); static void DlineIndexOfX(TkText *textPtr, DLine *dlPtr, int x, TkTextIndex *indexPtr); @@ -585,7 +585,7 @@ static int DlineXOfIndex(TkText *textPtr, DLine *dlPtr, int byteIndex); static int TextGetScrollInfoObj(Tcl_Interp *interp, TkText *textPtr, int objc, - Tcl_Obj *CONST objv[], double *dblPtr, + Tcl_Obj *const objv[], double *dblPtr, int *intPtr); static void AsyncUpdateLineMetrics(ClientData clientData); static void AsyncUpdateYScrollbar(ClientData clientData); @@ -742,7 +742,7 @@ TkTextFreeDInfo( static TextStyle * GetStyle( TkText *textPtr, /* Overall information about text widget. */ - CONST TkTextIndex *indexPtr)/* The character in the text for which display + const TkTextIndex *indexPtr)/* The character in the text for which display * information is wanted. */ { TkTextTag **tagPtrs; @@ -1047,7 +1047,7 @@ FreeStyle( static DLine * LayoutDLine( TkText *textPtr, /* Overall information about text widget. */ - CONST TkTextIndex *indexPtr)/* Beginning of display line. May not + const TkTextIndex *indexPtr)/* Beginning of display line. May not * necessarily point to a character * segment. */ { @@ -3518,7 +3518,7 @@ TkTextFindDisplayLineEnd( static int CalculateDisplayLineHeight( TkText *textPtr, /* Widget record for text widget. */ - CONST TkTextIndex *indexPtr,/* The index at the beginning of the display + const TkTextIndex *indexPtr,/* The index at the beginning of the display * line of interest. */ int *byteCountPtr, /* NULL or used to return the number of byte * indices on the given display line. */ @@ -3589,7 +3589,7 @@ CalculateDisplayLineHeight( int TkTextIndexYPixels( TkText *textPtr, /* Widget record for text widget. */ - CONST TkTextIndex *indexPtr)/* The index of which we want the pixel + const TkTextIndex *indexPtr)/* The index of which we want the pixel * distance from top of logical line to top of * index. */ { @@ -4510,8 +4510,8 @@ void TkTextChanged( TkSharedText *sharedTextPtr,/* Shared widget section, or NULL. */ TkText *textPtr, /* Widget record for text widget, or NULL. */ - CONST TkTextIndex*index1Ptr,/* Index of first character to redisplay. */ - CONST TkTextIndex*index2Ptr)/* Index of character just after last one to + const TkTextIndex*index1Ptr,/* Index of first character to redisplay. */ + const TkTextIndex*index2Ptr)/* Index of character just after last one to * redisplay. */ { if (sharedTextPtr == NULL) { @@ -4528,8 +4528,8 @@ TkTextChanged( static void TextChanged( TkText *textPtr, /* Widget record for text widget, or NULL. */ - CONST TkTextIndex*index1Ptr,/* Index of first character to redisplay. */ - CONST TkTextIndex*index2Ptr)/* Index of character just after last one to + const TkTextIndex*index1Ptr,/* Index of first character to redisplay. */ + const TkTextIndex*index2Ptr)/* Index of character just after last one to * redisplay. */ { TextDInfo *dInfoPtr = textPtr->dInfoPtr; @@ -5209,7 +5209,7 @@ TkTextMeasureDown( static void MeasureUp( TkText *textPtr, /* Text widget in which to measure. */ - CONST TkTextIndex *srcPtr, /* Index of character from which to start + const TkTextIndex *srcPtr, /* Index of character from which to start * measuring. */ int distance, /* Vertical distance in pixels measured from * the pixel just below the lowest one in @@ -5313,7 +5313,7 @@ TkTextSeeCmd( TkText *textPtr, /* Information about text widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. Someone else has already + Tcl_Obj *const objv[]) /* Argument objects. Someone else has already * parsed this command enough to know that * objv[1] is "see". */ { @@ -5442,7 +5442,7 @@ TkTextXviewCmd( TkText *textPtr, /* Information about text widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. Someone else has already + Tcl_Obj *const objv[]) /* Argument objects. Someone else has already * parsed this command enough to know that * objv[1] is "xview". */ { @@ -5725,7 +5725,7 @@ TkTextYviewCmd( TkText *textPtr, /* Information about text widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. Someone else has already + Tcl_Obj *const objv[]) /* Argument objects. Someone else has already * parsed this command enough to know that * objv[1] is "yview". */ { @@ -5751,7 +5751,7 @@ TkTextYviewCmd( pickPlace = 0; if (Tcl_GetString(objv[2])[0] == '-') { - register CONST char *switchStr = + register const char *switchStr = Tcl_GetStringFromObj(objv[2], &switchLength); if ((switchLength >= 2) && (strncmp(switchStr, "-pickplace", @@ -5906,7 +5906,7 @@ TkTextScanCmd( register TkText *textPtr, /* Information about text widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. Someone else has already + Tcl_Obj *const objv[]) /* Argument objects. Someone else has already * parsed this command enough to know that * objv[1] is "scan". */ { @@ -6414,7 +6414,7 @@ static DLine * FindDLine( register DLine *dlPtr, /* Pointer to first in list of DLines to * search. */ - CONST TkTextIndex *indexPtr)/* Index of desired character. */ + const TkTextIndex *indexPtr)/* Index of desired character. */ { TkTextLine *linePtr; @@ -6784,7 +6784,7 @@ DlineXOfIndex( int TkTextIndexBbox( TkText *textPtr, /* Widget record for text widget. */ - CONST TkTextIndex *indexPtr,/* Index whose bounding box is desired. */ + const TkTextIndex *indexPtr,/* Index whose bounding box is desired. */ int *xPtr, int *yPtr, /* Filled with index's upper-left * coordinate. */ int *widthPtr, int *heightPtr, @@ -6914,7 +6914,7 @@ TkTextIndexBbox( int TkTextDLineInfo( TkText *textPtr, /* Widget record for text widget. */ - CONST TkTextIndex *indexPtr,/* Index of character whose bounding box is + const TkTextIndex *indexPtr,/* Index of character whose bounding box is * desired. */ int *xPtr, int *yPtr, /* Filled with line's upper-left * coordinate. */ @@ -8054,7 +8054,7 @@ NextTabStop( static int MeasureChars( Tk_Font tkfont, /* Font in which to draw characters. */ - CONST char *source, /* Characters to be displayed. Need not be + const char *source, /* Characters to be displayed. Need not be * NULL-terminated. */ int maxBytes, /* Maximum # of bytes to consider from * source. */ @@ -8069,7 +8069,7 @@ MeasureChars( * here. */ { int curX, width, ch; - CONST char *special, *end, *start; + const char *special, *end, *start; ch = 0; /* lint. */ curX = startX; @@ -8161,19 +8161,19 @@ TextGetScrollInfoObj( Tcl_Interp *interp, /* Used for error reporting. */ TkText *textPtr, /* Information about the text widget. */ int objc, /* # arguments for command. */ - Tcl_Obj *CONST objv[], /* Arguments for command. */ + Tcl_Obj *const objv[], /* Arguments for command. */ double *dblPtr, /* Filled in with argument "moveto" option, if * any. */ int *intPtr) /* Filled in with number of pages or lines or * pixels to scroll, if any. */ { - static CONST char *subcommands[] = { + static const char *subcommands[] = { "moveto", "scroll", NULL }; enum viewSubcmds { VIEW_MOVETO, VIEW_SCROLL }; - static CONST char *units[] = { + static const char *units[] = { "units", "pages", "pixels", NULL }; enum viewUnits { diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c index 4219feb..e1d58e8 100644 --- a/generic/tkTextIndex.c +++ b/generic/tkTextIndex.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkTextIndex.c,v 1.28 2007/12/13 15:24:17 dgp Exp $ + * RCS: @(#) $Id: tkTextIndex.c,v 1.29 2008/04/27 22:38:58 dkf Exp $ */ #include "default.h" @@ -35,12 +35,12 @@ * Forward declarations for functions defined later in this file: */ -static CONST char * ForwBack(TkText *textPtr, CONST char *string, +static const char * ForwBack(TkText *textPtr, const char *string, TkTextIndex *indexPtr); -static CONST char * StartEnd(TkText *textPtr, CONST char *string, +static const char * StartEnd(TkText *textPtr, const char *string, TkTextIndex *indexPtr); static int GetIndex(Tcl_Interp *interp, TkSharedText *sharedPtr, - TkText *textPtr, CONST char *string, + TkText *textPtr, const char *string, TkTextIndex *indexPtr, int *canCachePtr); /* @@ -63,7 +63,7 @@ static void UpdateStringOfTextIndex(Tcl_Obj *objPtr); #define GET_INDEXEPOCH(objPtr) \ (PTR2INT((objPtr)->internalRep.twoPtrValue.ptr2)) #define SET_TEXTINDEX(objPtr, indexPtr) \ - ((objPtr)->internalRep.twoPtrValue.ptr1 = (VOID *) (indexPtr)) + ((objPtr)->internalRep.twoPtrValue.ptr1 = (void *) (indexPtr)) #define SET_INDEXEPOCH(objPtr, epoch) \ ((objPtr)->internalRep.twoPtrValue.ptr2 = INT2PTR(epoch)) @@ -131,7 +131,7 @@ UpdateStringOfTextIndex( char buffer[TK_POS_CHARS]; register int len; - CONST TkTextIndex *indexPtr = GET_TEXTINDEX(objPtr); + const TkTextIndex *indexPtr = GET_TEXTINDEX(objPtr); len = TkTextPrintIndex(indexPtr->textPtr, indexPtr, buffer); @@ -181,7 +181,7 @@ MakeObjIndex( TkText *textPtr, /* Information about text widget. */ Tcl_Obj *objPtr, /* Object containing description of * position. */ - CONST TkTextIndex *origPtr) /* Pointer to index. */ + const TkTextIndex *origPtr) /* Pointer to index. */ { TkTextIndex *indexPtr = (TkTextIndex *) ckalloc(sizeof(TkTextIndex)); @@ -201,7 +201,7 @@ MakeObjIndex( return indexPtr; } -CONST TkTextIndex * +const TkTextIndex * TkTextGetIndexFromObj( Tcl_Interp *interp, /* Use this for error reporting. */ TkText *textPtr, /* Information about text widget. */ @@ -269,7 +269,7 @@ TkTextGetIndexFromObj( Tcl_Obj * TkTextNewIndexObj( TkText *textPtr, /* Text widget for this index */ - CONST TkTextIndex *indexPtr)/* Pointer to index. */ + const TkTextIndex *indexPtr)/* Pointer to index. */ { Tcl_Obj *retVal; @@ -385,7 +385,7 @@ TkTextIndex * TkTextMakeByteIndex( TkTextBTree tree, /* Tree that lineIndex and byteIndex refer * to. */ - CONST TkText *textPtr, + const TkText *textPtr, int lineIndex, /* Index of desired line (0 means first line * of text). */ int byteIndex, /* Byte index of desired character. */ @@ -393,7 +393,7 @@ TkTextMakeByteIndex( { TkTextSegment *segPtr; int index; - CONST char *p, *start; + const char *p, *start; Tcl_UniChar ch; indexPtr->tree = tree; @@ -437,7 +437,7 @@ TkTextMakeByteIndex( if ((byteIndex > index) && (segPtr->typePtr == &tkTextCharType)) { /* * Prevent UTF-8 character from being split up by ensuring - * that byteIndex falls on a character boundary. If index + * that byteIndex falls on a character boundary. If the index * falls in the middle of a UTF-8 character, it will be * adjusted to the end of that UTF-8 character. */ @@ -571,7 +571,7 @@ TkTextMakeCharIndex( TkTextSegment * TkTextIndexToSeg( - CONST TkTextIndex *indexPtr,/* Text index. */ + const TkTextIndex *indexPtr,/* Text index. */ int *offsetPtr) /* Where to store offset within segment, or * NULL if offset isn't wanted. */ { @@ -609,10 +609,10 @@ TkTextIndexToSeg( int TkTextSegToOffset( - CONST TkTextSegment *segPtr,/* Segment whose offset is desired. */ - CONST TkTextLine *linePtr) /* Line containing segPtr. */ + const TkTextSegment *segPtr,/* Segment whose offset is desired. */ + const TkTextLine *linePtr) /* Line containing segPtr. */ { - CONST TkTextSegment *segPtr2; + const TkTextSegment *segPtr2; int offset = 0; for (segPtr2 = linePtr->segPtr; segPtr2 != segPtr; @@ -703,7 +703,7 @@ int TkTextGetIndex( Tcl_Interp *interp, /* Use this for error reporting. */ TkText *textPtr, /* Information about text widget. */ - CONST char *string, /* Textual description of position. */ + const char *string, /* Textual description of position. */ TkTextIndex *indexPtr) /* Index structure to fill in. */ { return GetIndex(interp, NULL, textPtr, string, indexPtr, NULL); @@ -737,7 +737,7 @@ GetIndex( Tcl_Interp *interp, /* Use this for error reporting. */ TkSharedText *sharedPtr, TkText *textPtr, /* Information about text widget. */ - CONST char *string, /* Textual description of position. */ + const char *string, /* Textual description of position. */ TkTextIndex *indexPtr, /* Index structure to fill in. */ int *canCachePtr) /* Pointer to integer to store whether we can * cache the index (or NULL). */ @@ -746,7 +746,7 @@ GetIndex( TkTextIndex first, last; int wantLast, result; char c; - CONST char *cp; + const char *cp; Tcl_DString copy; int canCache = 0; @@ -788,7 +788,7 @@ GetIndex( TkTextSearch search; TkTextTag *tagPtr; Tcl_HashEntry *hPtr = NULL; - CONST char *tagName; + const char *tagName; if ((p[1] == 'f') && (strncmp(p+1, "first", 5) == 0)) { wantLast = 0; @@ -813,7 +813,7 @@ GetIndex( hPtr = Tcl_FindHashEntry(&sharedPtr->tagTable, tagName); *p = '.'; if (hPtr != NULL) { - tagPtr = (TkTextTag *) Tcl_GetHashValue(hPtr); + tagPtr = Tcl_GetHashValue(hPtr); } } @@ -1022,8 +1022,8 @@ GetIndex( int TkTextPrintIndex( - CONST TkText *textPtr, - CONST TkTextIndex *indexPtr,/* Pointer to index. */ + const TkText *textPtr, + const TkTextIndex *indexPtr,/* Pointer to index. */ char *string) /* Place to store the position. Must have at * least TK_POS_CHARS characters. */ { @@ -1086,8 +1086,8 @@ TkTextPrintIndex( int TkTextIndexCmp( - CONST TkTextIndex*index1Ptr,/* First index. */ - CONST TkTextIndex*index2Ptr)/* Second index. */ + const TkTextIndex*index1Ptr,/* First index. */ + const TkTextIndex*index2Ptr)/* Second index. */ { int line1, line2; @@ -1139,15 +1139,15 @@ TkTextIndexCmp( *--------------------------------------------------------------------------- */ -static CONST char * +static const char * ForwBack( TkText *textPtr, /* Information about text widget. */ - CONST char *string, /* String to parse for additional info about + const char *string, /* String to parse for additional info about * modifier (count and units). Points to "+" * or "-" that starts modifier. */ TkTextIndex *indexPtr) /* Index to update as specified in string. */ { - register CONST char *p, *units; + register const char *p, *units; char *end; int count, lineIndex, modifier; size_t length; @@ -1387,8 +1387,8 @@ ForwBack( int TkTextIndexForwBytes( - CONST TkText *textPtr, - CONST TkTextIndex *srcPtr, /* Source index. */ + const TkText *textPtr, + const TkTextIndex *srcPtr, /* Source index. */ int byteCount, /* How many bytes forward to move. May be * negative. */ TkTextIndex *dstPtr) /* Destination index: gets modified. */ @@ -1459,8 +1459,8 @@ TkTextIndexForwBytes( void TkTextIndexForwChars( - CONST TkText *textPtr, /* Overall information about text widget. */ - CONST TkTextIndex *srcPtr, /* Source index. */ + const TkText *textPtr, /* Overall information about text widget. */ + const TkTextIndex *srcPtr, /* Source index. */ int charCount, /* How many characters forward to move. May * be negative. */ TkTextIndex *dstPtr, /* Destination index: gets modified. */ @@ -1480,8 +1480,7 @@ TkTextIndexForwChars( return; } if (checkElided) { - infoPtr = (TkTextElideInfo *) - ckalloc((unsigned) sizeof(TkTextElideInfo)); + infoPtr = (TkTextElideInfo *) ckalloc(sizeof(TkTextElideInfo)); elide = TkTextIsElided(textPtr, srcPtr, infoPtr); } @@ -1639,11 +1638,11 @@ TkTextIndexForwChars( int TkTextIndexCount( - CONST TkText *textPtr, /* Overall information about text widget. */ - CONST TkTextIndex *indexPtr1, + const TkText *textPtr, /* Overall information about text widget. */ + const TkTextIndex *indexPtr1, /* Index describing location of character from * which to count. */ - CONST TkTextIndex *indexPtr2, + const TkTextIndex *indexPtr2, /* Index describing location of last character * at which to stop the count. */ TkTextCountType type) /* The kind of indices to count. */ @@ -1665,8 +1664,7 @@ TkTextIndexCount( seg2Ptr = TkTextIndexToSeg(indexPtr2, &maxBytes); if (checkElided) { - infoPtr = (TkTextElideInfo *) - ckalloc((unsigned) sizeof(TkTextElideInfo)); + infoPtr = (TkTextElideInfo *) ckalloc(sizeof(TkTextElideInfo)); elide = TkTextIsElided(textPtr, indexPtr1, infoPtr); } @@ -1835,8 +1833,8 @@ TkTextIndexCount( int TkTextIndexBackBytes( - CONST TkText *textPtr, - CONST TkTextIndex *srcPtr, /* Source index. */ + const TkText *textPtr, + const TkTextIndex *srcPtr, /* Source index. */ int byteCount, /* How many bytes backward to move. May be * negative. */ TkTextIndex *dstPtr) /* Destination index: gets modified. */ @@ -1905,8 +1903,8 @@ TkTextIndexBackBytes( void TkTextIndexBackChars( - CONST TkText *textPtr, /* Overall information about text widget. */ - CONST TkTextIndex *srcPtr, /* Source index. */ + const TkText *textPtr, /* Overall information about text widget. */ + const TkTextIndex *srcPtr, /* Source index. */ int charCount, /* How many characters backward to move. May * be negative. */ TkTextIndex *dstPtr, /* Destination index: gets modified. */ @@ -1915,7 +1913,7 @@ TkTextIndexBackChars( TkTextSegment *segPtr, *oldPtr; TkTextElideInfo *infoPtr = NULL; int lineIndex, segSize; - CONST char *p, *start, *end; + const char *p, *start, *end; int elide = 0; int checkElided = (type & COUNT_DISPLAY); @@ -2114,15 +2112,15 @@ TkTextIndexBackChars( *---------------------------------------------------------------------- */ -static CONST char * +static const char * StartEnd( TkText *textPtr, /* Information about text widget. */ - CONST char *string, /* String to parse for additional info about + const char *string, /* String to parse for additional info about * modifier (count and units). Points to first * character of modifer word. */ TkTextIndex *indexPtr) /* Index to modify based on string. */ { - CONST char *p; + const char *p; size_t length; register TkTextSegment *segPtr; int modifier; diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index 97929bd..b54ae3f 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkTextTag.c,v 1.27 2007/12/13 15:24:17 dgp Exp $ + * RCS: @(#) $Id: tkTextTag.c,v 1.28 2008/04/27 22:38:58 dkf Exp $ */ #include "default.h" @@ -101,7 +101,7 @@ static void ChangeTagPriority(TkText *textPtr, TkTextTag *tagPtr, static TkTextTag * FindTag(Tcl_Interp *interp, TkText *textPtr, Tcl_Obj *tagName); static void SortTags(int numTags, TkTextTag **tagArrayPtr); -static int TagSortProc(CONST VOID *first, CONST VOID *second); +static int TagSortProc(const void *first, const void *second); static void TagBindEvent(TkText *textPtr, XEvent *eventPtr, int numTags, TkTextTag **tagArrayPtr); @@ -128,11 +128,11 @@ TkTextTagCmd( register TkText *textPtr, /* Information about text widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. Someone else has already + Tcl_Obj *const objv[]) /* Argument objects. Someone else has already * parsed this command enough to know that * objv[1] is "tag". */ { - static CONST char *tagOptionStrings[] = { + static const char *tagOptionStrings[] = { "add", "bind", "cget", "configure", "delete", "lower", "names", "nextrange", "prevrange", "raise", "ranges", "remove", NULL }; @@ -225,7 +225,7 @@ TkTextTagCmd( if (addTag && textPtr->exportSelection && !(textPtr->flags & GOT_SELECTION)) { Tk_OwnSelection(textPtr->tkwin, XA_PRIMARY, - TkTextLostSelection, (ClientData) textPtr); + TkTextLostSelection, textPtr); textPtr->flags |= GOT_SELECTION; } textPtr->abortSelections = 1; @@ -285,13 +285,13 @@ TkTextTagCmd( return TCL_ERROR; } } else if (objc == 5) { - CONST char *command; + const char *command; command = Tk_GetBinding(interp, textPtr->sharedTextPtr->bindingTable, (ClientData) tagPtr->name, Tcl_GetString(objv[4])); if (command == NULL) { - CONST char *string = Tcl_GetStringResult(interp); + const char *string = Tcl_GetStringResult(interp); /* * Ignore missing binding errors. This is a special hack that @@ -541,7 +541,7 @@ TkTextTagCmd( continue; } - tagPtr = (TkTextTag *) Tcl_GetHashValue(hPtr); + tagPtr = Tcl_GetHashValue(hPtr); if (tagPtr == textPtr->selTagPtr) { continue; } @@ -607,7 +607,7 @@ TkTextTagCmd( for (i=0, hPtr = Tcl_FirstHashEntry( &textPtr->sharedTextPtr->tagTable, &search); hPtr != NULL; i++, hPtr = Tcl_NextHashEntry(&search)) { - arrayPtr[i] = (TkTextTag *) Tcl_GetHashValue(hPtr); + arrayPtr[i] = Tcl_GetHashValue(hPtr); } /* @@ -928,14 +928,14 @@ TkTextTagCmd( TkTextTag * TkTextCreateTag( TkText *textPtr, /* Widget in which tag is being used. */ - CONST char *tagName, /* Name of desired tag. */ + const char *tagName, /* Name of desired tag. */ int *newTag) /* If non-NULL, then return 1 if new, or 0 if * already exists. */ { register TkTextTag *tagPtr; Tcl_HashEntry *hPtr = NULL; int isNew; - CONST char *name; + const char *name; if (!strcmp(tagName, "sel")) { if (textPtr->selTagPtr != NULL) { @@ -955,7 +955,7 @@ TkTextCreateTag( *newTag = isNew; } if (!isNew) { - return (TkTextTag *) Tcl_GetHashValue(hPtr); + return Tcl_GetHashValue(hPtr); } name = Tcl_GetHashKey(&textPtr->sharedTextPtr->tagTable, hPtr); } @@ -1048,7 +1048,7 @@ FindTag( { Tcl_HashEntry *hPtr; int len; - CONST char *str; + const char *str; str = Tcl_GetStringFromObj(tagName, &len); if (len == 3 && !strcmp(str,"sel")) { @@ -1057,7 +1057,7 @@ FindTag( hPtr = Tcl_FindHashEntry(&textPtr->sharedTextPtr->tagTable, Tcl_GetString(tagName)); if (hPtr != NULL) { - return (TkTextTag *) Tcl_GetHashValue(hPtr); + return Tcl_GetHashValue(hPtr); } if (interp != NULL) { Tcl_AppendResult(interp, "tag \"", Tcl_GetString(tagName), @@ -1279,8 +1279,8 @@ SortTags( static int TagSortProc( - CONST void *first, - CONST void *second) /* Elements to be compared. */ + const void *first, + const void *second) /* Elements to be compared. */ { TkTextTag *tagPtr1, *tagPtr2; @@ -1349,7 +1349,7 @@ ChangeTagPriority( } for (hPtr = Tcl_FirstHashEntry(&textPtr->sharedTextPtr->tagTable, &search); hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) { - tagPtr2 = (TkTextTag *) Tcl_GetHashValue(hPtr); + tagPtr2 = Tcl_GetHashValue(hPtr); if ((tagPtr2->priority >= low) && (tagPtr2->priority <= high)) { tagPtr2->priority += delta; } @@ -1380,7 +1380,7 @@ TkTextBindProc( ClientData clientData, /* Pointer to canvas structure. */ XEvent *eventPtr) /* Pointer to X event that just happened. */ { - TkText *textPtr = (TkText *) clientData; + TkText *textPtr = clientData; int repick = 0; # define AnyButtonMask \ @@ -1687,8 +1687,8 @@ TagBindEvent( TkTextTag **tagArrayPtr) /* Array of relevant tags. */ { #define NUM_BIND_TAGS 10 - CONST char *nameArray[NUM_BIND_TAGS]; - CONST char **nameArrPtr; + const char *nameArray[NUM_BIND_TAGS]; + const char **nameArrPtr; int i; /* @@ -1696,7 +1696,7 @@ TagBindEvent( */ if (numTags > NUM_BIND_TAGS) { - nameArrPtr = (CONST char **) ckalloc(numTags * sizeof(CONST char *)); + nameArrPtr = (const char **) ckalloc(numTags * sizeof(const char *)); } else { nameArrPtr = nameArray; } diff --git a/generic/tkVisual.c b/generic/tkVisual.c index 1b880d1..e0e100a 100644 --- a/generic/tkVisual.c +++ b/generic/tkVisual.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkVisual.c,v 1.10 2007/12/13 15:24:21 dgp Exp $ + * RCS: @(#) $Id: tkVisual.c,v 1.11 2008/04/27 22:38:58 dkf Exp $ */ #include "tkInt.h" @@ -88,7 +88,7 @@ Visual * Tk_GetVisual( Tcl_Interp *interp, /* Interpreter to use for error reporting. */ Tk_Window tkwin, /* Window in which visual will be used. */ - CONST char *string, /* String describing visual. See manual entry + const char *string, /* String describing visual. See manual entry * for details. */ int *depthPtr, /* The depth of the returned visual is stored * here. */ @@ -103,7 +103,7 @@ Tk_GetVisual( Visual *visual; ptrdiff_t length; int c, numVisuals, prio, bestPrio, i; - CONST char *p; + const char *p; VisualDictionary *dictPtr; TkColormap *cmapPtr; TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr; @@ -368,7 +368,7 @@ Colormap Tk_GetColormap( Tcl_Interp *interp, /* Interpreter to use for error reporting. */ Tk_Window tkwin, /* Window where colormap will be used. */ - CONST char *string) /* String that identifies colormap: either + const char *string) /* String that identifies colormap: either * "new" or the name of another window. */ { Colormap colormap; diff --git a/generic/tkWindow.c b/generic/tkWindow.c index c73b950..8820c73 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWindow.c,v 1.94 2008/04/16 14:51:29 das Exp $ + * RCS: @(#) $Id: tkWindow.c,v 1.95 2008/04/27 22:38:58 dkf Exp $ */ #include "tkInt.h" @@ -242,14 +242,14 @@ static Tk_ArgvInfo argTable[] = { */ static Tk_Window CreateTopLevelWindow(Tcl_Interp *interp, - Tk_Window parent, CONST char *name, - CONST char *screenName, unsigned int flags); + Tk_Window parent, const char *name, + const char *screenName, unsigned int flags); static void DeleteWindowsExitProc(ClientData clientData); -static TkDisplay * GetScreen(Tcl_Interp *interp, CONST char *screenName, +static TkDisplay * GetScreen(Tcl_Interp *interp, const char *screenName, int *screenPtr); static int Initialize(Tcl_Interp *interp); static int NameWindow(Tcl_Interp *interp, TkWindow *winPtr, - TkWindow *parentPtr, CONST char *name); + TkWindow *parentPtr, const char *name); static void UnlinkWindow(TkWindow *winPtr); /* @@ -342,9 +342,9 @@ CreateTopLevelWindow( Tk_Window parent, /* Token for logical parent of new window * (used for naming, options, etc.). May be * NULL. */ - CONST char *name, /* Name for new window; if parent is non-NULL, + const char *name, /* Name for new window; if parent is non-NULL, * must be unique among parent's children. */ - CONST char *screenName, /* Name of screen on which to create window. + const char *screenName, /* Name of screen on which to create window. * NULL means use DISPLAY environment variable * to determine. Empty string means use * parent's screen, or DISPLAY if no @@ -354,7 +354,7 @@ CreateTopLevelWindow( register TkWindow *winPtr; register TkDisplay *dispPtr; int screenId; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (!tsdPtr->initialized) { @@ -446,15 +446,15 @@ CreateTopLevelWindow( static TkDisplay * GetScreen( Tcl_Interp *interp, /* Place to leave error message. */ - CONST char *screenName, /* Name for screen. NULL or empty means use + const char *screenName, /* Name for screen. NULL or empty means use * DISPLAY envariable. */ int *screenPtr) /* Where to store screen number. */ { register TkDisplay *dispPtr; - CONST char *p; + const char *p; int screenId; size_t length; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* @@ -564,7 +564,7 @@ TkGetDisplay( Display *display) /* X's display pointer */ { TkDisplay *dispPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); for (dispPtr = tsdPtr->displayList; dispPtr != NULL; @@ -597,7 +597,7 @@ TkGetDisplay( TkDisplay * TkGetDisplayList(void) { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); return tsdPtr->displayList; @@ -624,7 +624,7 @@ TkGetDisplayList(void) TkMainInfo * TkGetMainInfoList(void) { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); return tsdPtr->mainWindowList; @@ -736,7 +736,7 @@ NameWindow( register TkWindow *winPtr, /* Window that is to be named and inserted. */ TkWindow *parentPtr, /* Pointer to logical parent for winPtr (used * for naming, options, etc.). */ - CONST char *name) /* Name for winPtr; must be unique among + const char *name) /* Name for winPtr; must be unique among * parentPtr's children. */ { #define FIXED_SIZE 200 @@ -853,7 +853,7 @@ NameWindow( Tk_Window TkCreateMainWindow( Tcl_Interp *interp, /* Interpreter to use for error reporting. */ - CONST char *screenName, /* Name of screen on which to create window. + const char *screenName, /* Name of screen on which to create window. * Empty or NULL string means use DISPLAY * environment variable. */ char *baseName) /* Base name for application; usually of the @@ -866,7 +866,7 @@ TkCreateMainWindow( register TkWindow *winPtr; register TkCmd *cmdPtr; ClientData clientData; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* @@ -952,13 +952,13 @@ TkCreateMainWindow( Tcl_Panic("TkCreateMainWindow: builtin command with NULL string and object procs"); } if (cmdPtr->passMainWindow) { - clientData = (ClientData) tkwin; + clientData = tkwin; } else { - clientData = (ClientData) NULL; + clientData = NULL; } if (cmdPtr->cmdProc != NULL) { Tcl_CreateCommand(interp, cmdPtr->name, cmdPtr->cmdProc, - clientData, (void (*) _ANSI_ARGS_((ClientData))) NULL); + clientData, NULL); } else { Tcl_CreateObjCommand(interp, cmdPtr->name, cmdPtr->objProc, clientData, NULL); @@ -1011,9 +1011,9 @@ Tk_CreateWindow( * the interp's result is assumed to be * initialized by the caller. */ Tk_Window parent, /* Token for parent of new window. */ - CONST char *name, /* Name for new window. Must be unique among + const char *name, /* Name for new window. Must be unique among * parent's children. */ - CONST char *screenName) /* If NULL, new window will be internal on + const char *screenName) /* If NULL, new window will be internal on * same screen as its parent. If non-NULL, * gives name of screen on which to create new * window; window will be a top-level @@ -1075,7 +1075,7 @@ Tk_CreateAnonymousWindow( * the interp's result is assumed to be * initialized by the caller. */ Tk_Window parent, /* Token for parent of new window. */ - CONST char *screenName) /* If NULL, new window will be internal on + const char *screenName) /* If NULL, new window will be internal on * same screen as its parent. If non-NULL, * gives name of screen on which to create new * window; window will be a top-level @@ -1142,11 +1142,11 @@ Tk_CreateWindowFromPath( * initialized by the caller. */ Tk_Window tkwin, /* Token for any window in application that is * to contain new window. */ - CONST char *pathName, /* Path name for new window within the + const char *pathName, /* Path name for new window within the * application of tkwin. The parent of this * window must already exist, but the window * itself must not exist. */ - CONST char *screenName) /* If NULL, new window will be on same screen + const char *screenName) /* If NULL, new window will be on same screen * as its parent. If non-NULL, gives name of * screen on which to create new window; * window will be a top-level window. */ @@ -1257,7 +1257,7 @@ Tk_DestroyWindow( TkDisplay *dispPtr = winPtr->dispPtr; XEvent event; TkHalfdeadWindow *halfdeadPtr, *prev_halfdeadPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (winPtr->flags & TK_ALREADY_DEAD) { @@ -1485,7 +1485,7 @@ Tk_DestroyWindow( if (winPtr->mainPtr != NULL) { if (winPtr->pathName != NULL) { Tk_DeleteAllBindings(winPtr->mainPtr->bindingTable, - (ClientData) winPtr->pathName); + winPtr->pathName); Tcl_DeleteHashEntry(Tcl_FindHashEntry(&winPtr->mainPtr->nameTable, winPtr->pathName)); @@ -1607,7 +1607,7 @@ Tk_DestroyWindow( #endif } } - Tcl_EventuallyFree((ClientData) winPtr, TCL_DYNAMIC); + Tcl_EventuallyFree(winPtr, TCL_DYNAMIC); } /* @@ -2235,7 +2235,7 @@ TkDoConfigureNotify( void Tk_SetClass( Tk_Window tkwin, /* Token for window to assign class. */ - CONST char *className) /* New class for tkwin. */ + const char *className) /* New class for tkwin. */ { register TkWindow *winPtr = (TkWindow *) tkwin; @@ -2299,7 +2299,7 @@ Tk_SetClassProcs( Tk_Window Tk_NameToWindow( Tcl_Interp *interp, /* Where to report errors. */ - CONST char *pathName, /* Path name of window. */ + const char *pathName, /* Path name of window. */ Tk_Window tkwin) /* Token for window: name is assumed to belong * to the same main window as tkwin. */ { @@ -2326,7 +2326,7 @@ Tk_NameToWindow( } return NULL; } - return (Tk_Window) Tcl_GetHashValue(hPtr); + return Tcl_GetHashValue(hPtr); } /* @@ -2369,7 +2369,7 @@ Tk_IdToWindow( if (hPtr == NULL) { return NULL; } - return (Tk_Window) Tcl_GetHashValue(hPtr); + return Tcl_GetHashValue(hPtr); } /* @@ -2389,7 +2389,7 @@ Tk_IdToWindow( *---------------------------------------------------------------------- */ -CONST char * +const char * Tk_DisplayName( Tk_Window tkwin) /* Window whose display name is desired. */ { @@ -2628,8 +2628,7 @@ Tk_MainWindow( return NULL; } #endif - tsdPtr = (ThreadSpecificData *) - Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); for (mainPtr = tsdPtr->mainWindowList; mainPtr != NULL; mainPtr = mainPtr->nextPtr) { @@ -2697,8 +2696,7 @@ Tk_GetNumMainWindows(void) } #endif - tsdPtr = (ThreadSpecificData *) - Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); return tsdPtr->numMainWindows; } @@ -2756,7 +2754,7 @@ DeleteWindowsExitProc( { TkDisplay *dispPtr, *nextPtr; Tcl_Interp *interp; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) clientData; + ThreadSpecificData *tsdPtr = clientData; if (tsdPtr == NULL) { return; @@ -2772,11 +2770,11 @@ DeleteWindowsExitProc( while (tsdPtr->halfdeadWindowList != NULL) { interp = tsdPtr->halfdeadWindowList->winPtr->mainPtr->interp; - Tcl_Preserve((ClientData) interp); + Tcl_Preserve(interp); tsdPtr->halfdeadWindowList->flags |= HD_CLEANUP; tsdPtr->halfdeadWindowList->winPtr->flags &= ~TK_ALREADY_DEAD; Tk_DestroyWindow((Tk_Window) tsdPtr->halfdeadWindowList->winPtr); - Tcl_Release((ClientData) interp); + Tcl_Release(interp); } /* @@ -2785,9 +2783,9 @@ DeleteWindowsExitProc( while (tsdPtr->mainWindowList != NULL) { interp = tsdPtr->mainWindowList->interp; - Tcl_Preserve((ClientData) interp); + Tcl_Preserve(interp); Tk_DestroyWindow((Tk_Window) tsdPtr->mainWindowList->winPtr); - Tcl_Release((ClientData) interp); + Tcl_Release(interp); } /* @@ -2937,9 +2935,9 @@ Initialize( { char *p; int argc, code; - CONST char **argv; + const char **argv; char *args[20]; - CONST char *argString = NULL; + const char *argString = NULL; Tcl_DString class; ThreadSpecificData *tsdPtr; @@ -2958,8 +2956,7 @@ Initialize( TkRegisterObjTypes(); - tsdPtr = (ThreadSpecificData *) - Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* * Start by initializing all the static variables to default acceptable @@ -2979,7 +2976,7 @@ Initialize( argv = NULL; /* - * We start by resetting the result because it might not be clean + * We start by resetting the result because it might not be clean. */ Tcl_ResetResult(interp); @@ -3155,7 +3152,7 @@ Initialize( visual = NULL; } args[argc] = NULL; - code = TkCreateFrame((ClientData) NULL, interp, argc, args, 1, name); + code = TkCreateFrame(NULL, interp, argc, args, 1, name); Tcl_DStringFree(&class); if (code != TCL_OK) { @@ -3253,7 +3250,7 @@ tkInit"); * specific cleanups take place to avoid panics in finalization. */ - TkCreateThreadExitHandler(DeleteWindowsExitProc, (ClientData) tsdPtr); + TkCreateThreadExitHandler(DeleteWindowsExitProc, tsdPtr); } return code; @@ -3284,16 +3281,16 @@ tkInit"); *---------------------------------------------------------------------- */ -CONST char * +const char * Tk_PkgInitStubsCheck( Tcl_Interp *interp, - CONST char * version, + const char * version, int exact) { - CONST char *actualVersion = Tcl_PkgRequire(interp, "Tk", version, 0); + const char *actualVersion = Tcl_PkgRequire(interp, "Tk", version, 0); if (exact && actualVersion) { - CONST char *p = version; + const char *p = version; int count = 0; while (*p) { diff --git a/generic/ttk/ttkButton.c b/generic/ttk/ttkButton.c index bae3e6a..4d1adcd 100644 --- a/generic/ttk/ttkButton.c +++ b/generic/ttk/ttkButton.c @@ -1,4 +1,4 @@ -/* $Id: ttkButton.c,v 1.8 2007/12/13 15:26:24 dgp Exp $ +/* $Id: ttkButton.c,v 1.9 2008/04/27 22:41:12 dkf Exp $ * Copyright (c) 2003, Joe English * * label, button, checkbutton, radiobutton, and menubutton widgets. @@ -519,7 +519,7 @@ CheckbuttonPostConfigure(Tcl_Interp *interp, void *recordPtr, int mask) */ static int CheckbuttonInvokeCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { Checkbutton *checkPtr = recordPtr; WidgetCore *corePtr = &checkPtr->core; @@ -705,7 +705,7 @@ RadiobuttonPostConfigure(Tcl_Interp *interp, void *recordPtr, int mask) */ static int RadiobuttonInvokeCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { Radiobutton *radioPtr = recordPtr; WidgetCore *corePtr = &radioPtr->core; diff --git a/generic/ttk/ttkImage.c b/generic/ttk/ttkImage.c index 3dcb379..8c50485 100644 --- a/generic/ttk/ttkImage.c +++ b/generic/ttk/ttkImage.c @@ -1,4 +1,4 @@ -/* $Id: ttkImage.c,v 1.7 2007/12/13 15:26:26 dgp Exp $ +/* $Id: ttkImage.c,v 1.8 2008/04/27 22:41:12 dkf Exp $ * Image specifications and image element factory. * * Copyright (C) 2004 Pat Thoyts @@ -312,7 +312,7 @@ Ttk_CreateImageElement( void *clientData, Ttk_Theme theme, const char *elementName, - int objc, Tcl_Obj *CONST objv[]) + int objc, Tcl_Obj *const objv[]) { const char *optionStrings[] = { "-border","-height","-padding","-sticky","-width",NULL }; diff --git a/generic/ttk/ttkInit.c b/generic/ttk/ttkInit.c index c0d930a..76d1768 100644 --- a/generic/ttk/ttkInit.c +++ b/generic/ttk/ttkInit.c @@ -1,4 +1,4 @@ -/* $Id: ttkInit.c,v 1.7 2007/12/13 15:26:26 dgp Exp $ +/* $Id: ttkInit.c,v 1.8 2008/04/27 22:41:12 dkf Exp $ * Copyright (c) 2003, Joe English * * Ttk package: initialization routine and miscellaneous utilities. @@ -46,7 +46,7 @@ int Ttk_GetCompoundFromObj( * Legal values for the -orient option. * See also: enum Ttk_Orient. */ -CONST char *ttkOrientStrings[] = { +const char *ttkOrientStrings[] = { "horizontal", "vertical", NULL }; diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index 68fd665..7b10300 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -1,4 +1,4 @@ -/* $Id: ttkNotebook.c,v 1.13 2008/01/28 00:36:08 jenglish Exp $ +/* $Id: ttkNotebook.c,v 1.14 2008/04/27 22:41:12 dkf Exp $ * Copyright (c) 2004, Joe English */ @@ -208,7 +208,7 @@ static void DestroyTab(Notebook *nb, Tab *tab) static int ConfigureTab( Tcl_Interp *interp, Notebook *nb, Tab *tab, Tk_Window slaveWindow, - int objc, Tcl_Obj *CONST objv[]) + int objc, Tcl_Obj *const objv[]) { Ttk_Sticky sticky = tab->sticky; Ttk_Padding padding = tab->padding; @@ -854,7 +854,7 @@ static int GetTabIndex( /* $nb add window ?options ... ? */ static int NotebookAddCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { Notebook *nb = recordPtr; int index = Ttk_NumberSlaves(nb->notebook.mgr); @@ -968,7 +968,7 @@ static int NotebookInsertCommand( * Removes the specified tab. */ static int NotebookForgetCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { Notebook *nb = recordPtr; int index; @@ -992,7 +992,7 @@ static int NotebookForgetCommand( * Hides the specified tab. */ static int NotebookHideCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { Notebook *nb = recordPtr; int index; @@ -1022,7 +1022,7 @@ static int NotebookHideCommand( * Returns name of tab element at $x,$y; empty string if none. */ static int NotebookIdentifyCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { Notebook *nb = recordPtr; Ttk_LayoutNode *node = NULL; @@ -1065,7 +1065,7 @@ static int NotebookIdentifyCommand( * See above for valid item formats. */ static int NotebookIndexCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { Notebook *nb = recordPtr; int index, status; @@ -1097,7 +1097,7 @@ static int NotebookIndexCommand( * the currently-selected pane. */ static int NotebookSelectCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { Notebook *nb = recordPtr; @@ -1123,7 +1123,7 @@ static int NotebookSelectCommand( * Return list of tabs. */ static int NotebookTabsCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { Notebook *nb = recordPtr; Ttk_Manager *mgr = nb->notebook.mgr; @@ -1148,7 +1148,7 @@ static int NotebookTabsCommand( /* $nb tab $tab ?-option ?value -option value...?? */ static int NotebookTabCommand( - Tcl_Interp *interp, int objc, Tcl_Obj * CONST objv[], void *recordPtr) + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { Notebook *nb = recordPtr; Ttk_Manager *mgr = nb->notebook.mgr; diff --git a/generic/ttk/ttkPanedwindow.c b/generic/ttk/ttkPanedwindow.c index cac3d20..bd9457c 100644 --- a/generic/ttk/ttkPanedwindow.c +++ b/generic/ttk/ttkPanedwindow.c @@ -1,4 +1,4 @@ -/* $Id: ttkPanedwindow.c,v 1.14 2008/02/23 17:35:28 jenglish Exp $ +/* $Id: ttkPanedwindow.c,v 1.15 2008/04/27 22:41:12 dkf Exp $ * * Copyright (c) 2005, Joe English. Freely redistributable. * @@ -142,7 +142,7 @@ static void DestroyPane(Paned *pw, Pane *pane) */ static int ConfigurePane( Tcl_Interp *interp, Paned *pw, Pane *pane, Tk_Window slaveWindow, - int objc, Tcl_Obj *CONST objv[]) + int objc, Tcl_Obj *const objv[]) { Ttk_Manager *mgr = pw->paned.mgr; Tk_SavedOptions savedOptions; @@ -615,7 +615,7 @@ static void PanedDisplay(void *recordPtr, Drawable d) /* $pw add window [ options ... ] */ static int PanedAddCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { Paned *pw = recordPtr; Tk_Window slaveWindow; @@ -640,7 +640,7 @@ static int PanedAddCommand( * Insert new slave, or move existing one. */ static int PanedInsertCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { Paned *pw = recordPtr; int nSlaves = Ttk_NumberSlaves(pw->paned.mgr); @@ -685,7 +685,7 @@ static int PanedInsertCommand( /* $pw forget $pane */ static int PanedForgetCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { Paned *pw = recordPtr; int paneIndex; @@ -709,7 +709,7 @@ static int PanedForgetCommand( * Return index of sash at $x,$y */ static int PanedIdentifyCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { Paned *pw = recordPtr; int sashThickness = pw->paned.sashThickness; @@ -743,7 +743,7 @@ static int PanedIdentifyCommand( * Query/modify pane options. */ static int PanedPaneCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { Paned *pw = recordPtr; int paneIndex; @@ -780,7 +780,7 @@ static int PanedPaneCommand( * Return list of managed panes. */ static int PanedPanesCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { Paned *pw = recordPtr; Ttk_Manager *mgr = pw->paned.mgr; @@ -807,7 +807,7 @@ static int PanedPanesCommand( * Query or modify sash position. */ static int PanedSashposCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { Paned *pw = recordPtr; int sashIndex, position = -1; diff --git a/generic/ttk/ttkProgress.c b/generic/ttk/ttkProgress.c index 6d6db8d..b5883e1 100644 --- a/generic/ttk/ttkProgress.c +++ b/generic/ttk/ttkProgress.c @@ -1,4 +1,4 @@ -/* $Id: ttkProgress.c,v 1.5 2007/01/11 14:49:47 jenglish Exp $ +/* $Id: ttkProgress.c,v 1.6 2008/04/27 22:41:12 dkf Exp $ * * Copyright (c) Joe English, Pat Thoyts, Michael Kirkham * @@ -399,7 +399,7 @@ static Ttk_Layout ProgressbarGetLayout( /* $sb step ?amount? */ static int ProgressbarStepCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { Progressbar *pb = recordPtr; double value = 0.0, stepAmount = 1.0; @@ -453,7 +453,7 @@ static int ProgressbarStepCommand( * and pass to interpreter. */ static int ProgressbarStartStopCommand( - Tcl_Interp *interp, const char *cmdName, int objc, Tcl_Obj *CONST objv[]) + Tcl_Interp *interp, const char *cmdName, int objc, Tcl_Obj *const objv[]) { Tcl_Obj *cmd = Tcl_NewListObj(objc, objv); Tcl_Obj *prefix[2]; @@ -473,14 +473,14 @@ static int ProgressbarStartStopCommand( } static int ProgressbarStartCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { return ProgressbarStartStopCommand( interp, "::ttk::progressbar::start", objc, objv); } static int ProgressbarStopCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { return ProgressbarStartStopCommand( interp, "::ttk::progressbar::stop", objc, objv); diff --git a/generic/ttk/ttkScale.c b/generic/ttk/ttkScale.c index 4c8d1eb..68438a2 100644 --- a/generic/ttk/ttkScale.c +++ b/generic/ttk/ttkScale.c @@ -1,4 +1,4 @@ -/* $Id: ttkScale.c,v 1.7 2007/12/13 15:26:26 dgp Exp $ +/* $Id: ttkScale.c,v 1.8 2008/04/27 22:41:12 dkf Exp $ * Copyright (C) 2004 Pat Thoyts * * ttk::scale widget. @@ -252,7 +252,7 @@ static double ScaleFraction(Scale *scalePtr, double value) */ static int ScaleGetCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { Scale *scalePtr = recordPtr; int x, y, r = TCL_OK; @@ -280,7 +280,7 @@ ScaleGetCommand( */ static int ScaleSetCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { Scale *scalePtr = recordPtr; double from = 0.0, to = 1.0, value; @@ -348,7 +348,7 @@ ScaleSetCommand( static int ScaleCoordsCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { Scale *scalePtr = recordPtr; double value; diff --git a/generic/ttk/ttkScrollbar.c b/generic/ttk/ttkScrollbar.c index 82bb880..26656f2 100644 --- a/generic/ttk/ttkScrollbar.c +++ b/generic/ttk/ttkScrollbar.c @@ -1,4 +1,4 @@ -/* $Id: ttkScrollbar.c,v 1.7 2007/12/13 15:26:26 dgp Exp $ +/* $Id: ttkScrollbar.c,v 1.8 2008/04/27 22:41:12 dkf Exp $ * Copyright (c) 2003, Joe English * * ttk::scrollbar widget. @@ -132,7 +132,7 @@ static void ScrollbarDoLayout(void *recordPtr) */ static int ScrollbarSetCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { Scrollbar *scrollbar = recordPtr; Tcl_Obj *firstObj, *lastObj; @@ -183,7 +183,7 @@ ScrollbarSetCommand( */ static int ScrollbarGetCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { Scrollbar *scrollbar = recordPtr; Tcl_Obj *result[2]; @@ -206,7 +206,7 @@ ScrollbarGetCommand( */ static int ScrollbarDeltaCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { Scrollbar *sb = recordPtr; double dx, dy; @@ -246,7 +246,7 @@ ScrollbarDeltaCommand( */ static int ScrollbarFractionCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { Scrollbar *sb = recordPtr; Ttk_Box b = sb->scrollbar.troughBox; diff --git a/generic/ttk/ttkTheme.c b/generic/ttk/ttkTheme.c index 598bc34..3439ef0 100644 --- a/generic/ttk/ttkTheme.c +++ b/generic/ttk/ttkTheme.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * $Id: ttkTheme.c,v 1.11 2007/12/13 15:26:26 dgp Exp $ + * $Id: ttkTheme.c,v 1.12 2008/04/27 22:41:12 dkf Exp $ */ #include @@ -18,7 +18,7 @@ #include "ttkThemeInt.h" #ifdef NO_PRIVATE_HEADERS -EXTERN CONST Tk_OptionSpec *TkGetOptionSpec (CONST char *name, +EXTERN const Tk_OptionSpec *TkGetOptionSpec(const char *name, Tk_OptionTable optionTable); #else #include @@ -832,7 +832,7 @@ int Ttk_RegisterElementFactory( static int Ttk_CloneElement( Tcl_Interp *interp, void *clientData, Ttk_Theme theme, const char *elementName, - int objc, Tcl_Obj *CONST objv[]) + int objc, Tcl_Obj *const objv[]) { Ttk_Theme fromTheme; ElementImpl *fromElement; @@ -1183,7 +1183,7 @@ StyleMapCmd( ClientData clientData, /* Master StylePackageData pointer */ Tcl_Interp *interp, /* Current interpreter */ int objc, /* Number of arguments */ - Tcl_Obj * CONST objv[]) /* Argument objects */ + Tcl_Obj *const objv[]) /* Argument objects */ { StylePackageData *pkgPtr = (StylePackageData *)clientData; Ttk_Theme theme = pkgPtr->currentTheme; @@ -1247,7 +1247,7 @@ usage: /* + style configure $style -option ?value... */ static int StyleConfigureCmd( - ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj * CONST objv[]) + ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { StylePackageData *pkgPtr = (StylePackageData *)clientData; Ttk_Theme theme = pkgPtr->currentTheme; @@ -1302,7 +1302,7 @@ usage: /* + style lookup $style -option ?statespec? ?defaultValue? */ static int StyleLookupCmd( - ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj * CONST objv[]) + ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { StylePackageData *pkgPtr = clientData; Ttk_Theme theme = pkgPtr->currentTheme; @@ -1346,7 +1346,7 @@ static int StyleLookupCmd( /* + style theme create name ?-parent $theme? ?-settings { script }? */ static int StyleThemeCreateCmd( - ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj * CONST objv[]) + ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { StylePackageData *pkgPtr = (StylePackageData *)clientData; static const char *optStrings[] = @@ -1410,7 +1410,7 @@ static int StyleThemeCreateCmd( * Return list of registered themes. */ static int StyleThemeNamesCmd( - ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj * CONST objv[]) + ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { StylePackageData *pkgPtr = clientData; return EnumerateHashTable(interp, &pkgPtr->themeTable); @@ -1426,7 +1426,7 @@ StyleThemeSettingsCmd( ClientData clientData, /* Master StylePackageData pointer */ Tcl_Interp *interp, /* Current interpreter */ int objc, /* Number of arguments */ - Tcl_Obj * CONST objv[]) /* Argument objects */ + Tcl_Obj *const objv[]) /* Argument objects */ { StylePackageData *pkgPtr = (StylePackageData *)clientData; Ttk_Theme oldTheme = pkgPtr->currentTheme; @@ -1452,7 +1452,7 @@ StyleThemeSettingsCmd( /* + style element create name type ? ...args ? */ static int StyleElementCreateCmd( - ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj * CONST objv[]) + ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { StylePackageData *pkgPtr = (StylePackageData *)clientData; Ttk_Theme theme = pkgPtr->currentTheme; @@ -1484,7 +1484,7 @@ static int StyleElementCreateCmd( * Return a list of elements defined in the current theme. */ static int StyleElementNamesCmd( - ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj * CONST objv[]) + ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { StylePackageData *pkgPtr = (StylePackageData *)clientData; Ttk_Theme theme = pkgPtr->currentTheme; @@ -1500,7 +1500,7 @@ static int StyleElementNamesCmd( * Return list of element options for specified element */ static int StyleElementOptionsCmd( - ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj * CONST objv[]) + ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { StylePackageData *pkgPtr = clientData; Ttk_Theme theme = pkgPtr->currentTheme; @@ -1536,7 +1536,7 @@ static int StyleElementOptionsCmd( /* + style layout name ?spec? */ static int StyleLayoutCmd( - ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj * CONST objv[]) + ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { StylePackageData *pkgPtr = (StylePackageData *)clientData; Ttk_Theme theme = pkgPtr->currentTheme; @@ -1576,7 +1576,7 @@ StyleThemeUseCmd( ClientData clientData, /* Master StylePackageData pointer */ Tcl_Interp *interp, /* Current interpreter */ int objc, /* Number of arguments */ - Tcl_Obj * CONST objv[]) /* Argument objects */ + Tcl_Obj *const objv[]) /* Argument objects */ { StylePackageData *pkgPtr = clientData; Ttk_Theme theme; @@ -1635,7 +1635,7 @@ StyleObjCmd( ClientData clientData, /* Master StylePackageData pointer */ Tcl_Interp *interp, /* Current interpreter */ int objc, /* Number of arguments */ - Tcl_Obj * CONST objv[]) /* Argument objects */ + Tcl_Obj *const objv[]) /* Argument objects */ { struct Ensemble *ensemble = StyleEnsemble; int optPtr = 1; diff --git a/generic/ttk/ttkTrace.c b/generic/ttk/ttkTrace.c index 37a319b..cb2f1c7 100644 --- a/generic/ttk/ttkTrace.c +++ b/generic/ttk/ttkTrace.c @@ -1,4 +1,4 @@ -/* $Id: ttkTrace.c,v 1.1 2006/10/31 01:42:26 hobbs Exp $ +/* $Id: ttkTrace.c,v 1.2 2008/04/27 22:41:12 dkf Exp $ * * Copyright 2003, Joe English * @@ -27,8 +27,8 @@ static char * VarTraceProc( ClientData clientData, /* Widget record pointer */ Tcl_Interp *interp, /* Interpreter containing variable. */ - CONST char *name1, /* (unused) */ - CONST char *name2, /* (unused) */ + const char *name1, /* (unused) */ + const char *name2, /* (unused) */ int flags) /* Information about what happened. */ { Ttk_TraceHandle *tracePtr = clientData; diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index ad60f4b..95c9a99 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -1,4 +1,4 @@ -/* $Id: ttkTreeview.c,v 1.23 2007/12/13 15:26:26 dgp Exp $ +/* $Id: ttkTreeview.c,v 1.24 2008/04/27 22:41:12 dkf Exp $ * Copyright (c) 2004, Joe English * * ttk::treeview widget implementation. @@ -2915,8 +2915,8 @@ static int TreeviewTagBindCommand( Tcl_SetObjResult(interp, Tcl_NewStringObj(script,-1)); } } else if (objc == 6) { /* $tv tag bind $tag $sequence $script */ - CONST char *sequence = Tcl_GetString(objv[4]); - CONST char *script = Tcl_GetString(objv[5]); + const char *sequence = Tcl_GetString(objv[4]); + const char *script = Tcl_GetString(objv[5]); unsigned long mask = Tk_CreateBinding(interp, tv->tree.bindingTable, tag, sequence, script, 0); diff --git a/generic/ttk/ttkWidget.c b/generic/ttk/ttkWidget.c index ae00a32..43c6086 100644 --- a/generic/ttk/ttkWidget.c +++ b/generic/ttk/ttkWidget.c @@ -1,4 +1,4 @@ -/* $Id: ttkWidget.c,v 1.11 2008/01/06 22:35:41 jenglish Exp $ +/* $Id: ttkWidget.c,v 1.12 2008/04/27 22:41:12 dkf Exp $ * Copyright (c) 2003, Joe English * * Core widget utilities. @@ -180,7 +180,7 @@ WidgetInstanceObjCmd( ClientData clientData, /* Widget record pointer */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj * const objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { WidgetCore *corePtr = (WidgetCore *)clientData; const WidgetCommandSpec *commands = corePtr->widgetSpec->commands; @@ -345,7 +345,7 @@ static struct Tk_ClassProcs widgetClassProcs = { * ClientData is a WidgetSpec *. */ int TtkWidgetConstructorObjCmd( - ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) + ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { WidgetSpec *widgetSpec = (WidgetSpec *)clientData; const char *className = widgetSpec->className; @@ -594,7 +594,7 @@ int TtkWidgetSize(void *recordPtr, int *widthPtr, int *heightPtr) /* $w cget -option */ int TtkWidgetCgetCommand( -Tcl_Interp *interp, int objc, Tcl_Obj * CONST objv[], void *recordPtr) +Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { WidgetCore *corePtr = recordPtr; Tcl_Obj *result; @@ -614,7 +614,7 @@ Tcl_Interp *interp, int objc, Tcl_Obj * CONST objv[], void *recordPtr) /* $w configure ?-option ?value ....?? */ int TtkWidgetConfigureCommand( -Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) +Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { WidgetCore *corePtr = recordPtr; Tcl_Obj *result; @@ -679,7 +679,7 @@ Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) */ int TtkWidgetStateCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { WidgetCore *corePtr = recordPtr; Ttk_StateSpec spec; @@ -719,7 +719,7 @@ int TtkWidgetStateCommand( */ int TtkWidgetInstateCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { WidgetCore *corePtr = recordPtr; Ttk_State state = corePtr->state; @@ -749,7 +749,7 @@ int TtkWidgetInstateCommand( * Returns: name of element at $x, $y */ int TtkWidgetIdentifyCommand( - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], void *recordPtr) + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { WidgetCore *corePtr = recordPtr; Ttk_LayoutNode *node; diff --git a/macosx/tkMacOSXBitmap.c b/macosx/tkMacOSXBitmap.c index 7b66a38..74dadbd 100644 --- a/macosx/tkMacOSXBitmap.c +++ b/macosx/tkMacOSXBitmap.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXBitmap.c,v 1.7 2007/04/23 21:24:32 das Exp $ + * RCS: @(#) $Id: tkMacOSXBitmap.c,v 1.8 2008/04/27 22:39:12 dkf Exp $ */ #include "tkMacOSXInt.h" @@ -137,7 +137,7 @@ TkpDefineNativeBitmaps(void) Pixmap TkpCreateNativeBitmap( Display *display, - CONST char *source) /* Info about the icon to build. */ + const char *source) /* Info about the icon to build. */ { Pixmap pix; Rect destRect; @@ -195,7 +195,7 @@ TkpCreateNativeBitmap( Pixmap TkpGetNativeAppBitmap( Display *display, /* The display. */ - CONST char *name, /* The name of the bitmap. */ + const char *name, /* The name of the bitmap. */ int *width, /* The width & height of the bitmap. */ int *height) { @@ -249,9 +249,9 @@ TkpGetNativeAppBitmap( Str255 dummy; /* - * We need to first paint the background white. Also, for - * some reason we *must* use GetCIcon instead of GetNamedResource - * for PlotCIcon to work - so we use GetResInfo to get the id. + * We need to first paint the background white. Also, for some reason + * we *must* use GetCIcon instead of GetNamedResource for PlotCIcon to + * work - so we use GetResInfo to get the id. */ RGBForeColor(&white); diff --git a/macosx/tkMacOSXConfig.c b/macosx/tkMacOSXConfig.c index 197cfbe..f015ea5 100644 --- a/macosx/tkMacOSXConfig.c +++ b/macosx/tkMacOSXConfig.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXConfig.c,v 1.4 2007/04/23 21:24:33 das Exp $ + * RCS: @(#) $Id: tkMacOSXConfig.c,v 1.5 2008/04/27 22:39:12 dkf Exp $ */ #include "tkInt.h" @@ -38,8 +38,8 @@ Tcl_Obj * TkpGetSystemDefault( Tk_Window tkwin, /* A window to use. */ - CONST char *dbName, /* The option database name. */ - CONST char *className) /* The name of the option class. */ + const char *dbName, /* The option database name. */ + const char *className) /* The name of the option class. */ { return NULL; } diff --git a/macosx/tkMacOSXCursor.c b/macosx/tkMacOSXCursor.c index 64b967c..b2d9ba8 100644 --- a/macosx/tkMacOSXCursor.c +++ b/macosx/tkMacOSXCursor.c @@ -7,18 +7,18 @@ * Copyright 2001, Apple Computer, Inc. * Copyright (c) 2006-2007 Daniel A. Steffen * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * See the file "license.terms" for information on usage and redistribution of + * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXCursor.c,v 1.13 2007/12/13 15:27:08 dgp Exp $ + * RCS: @(#) $Id: tkMacOSXCursor.c,v 1.14 2008/04/27 22:39:12 dkf Exp $ */ #include "tkMacOSXPrivate.h" /* - * There are three different ways to set the cursor on the Mac. - * The default theme cursors (listed in cursorNames below), - * color resource cursors, & normal cursors. + * There are three different ways to set the cursor on the Mac. The default + * theme cursors (listed in cursorNames below), color resource cursors, & + * normal cursors. */ #define NONE -1 /* Hidden cursor */ @@ -28,17 +28,17 @@ #define NORMAL 3 /* Cursors of type CURS. */ /* - * The following data structure contains the system specific data - * necessary to control Windows cursors. + * The following data structure contains the system specific data necessary to + * control Windows cursors. */ typedef struct { TkCursor info; /* Generic cursor info used by tkCursor.c */ - Handle macCursor; /* Resource containing Macintosh cursor. - * For theme cursors, this is -1. */ - int type; /* Type of Mac cursor: for theme cursors - * this is the theme cursor constant, - * otherwise one of crsr or CURS */ + Handle macCursor; /* Resource containing Macintosh cursor. For + * theme cursors, this is -1. */ + int type; /* Type of Mac cursor: for theme cursors this + * is the theme cursor constant, otherwise one + * of crsr or CURS. */ int count; /* For animating cursors, the count for the * cursor. */ } TkMacOSXCursor; @@ -94,25 +94,23 @@ static struct CursorName animatedThemeCursorNames[] = { * Declarations of static variables used in this file. */ -static TkMacOSXCursor * gCurrentCursor = NULL; /* A pointer to the current - * cursor. */ -static int gResizeOverride = false; /* A boolean indicating whether - * we should use the resize - * cursor during installations. */ -static int gTkOwnsCursor = true; /* A boolean indicating whether - * Tk owns the cursor. If not (for - * instance, in the case where a Tk - * window is embedded in another app's - * window, and the cursor is out of - * the tk window, we will not attempt - * to adjust the cursor */ +static TkMacOSXCursor * gCurrentCursor = NULL; + /* A pointer to the current cursor. */ +static int gResizeOverride = false; + /* A boolean indicating whether we should use + * the resize cursor during installations. */ +static int gTkOwnsCursor = true;/* A boolean indicating whether Tk owns the + * cursor. If not (for instance, in the case + * where a Tk window is embedded in another + * app's window, and the cursor is out of the + * tk window, we will not attempt to adjust + * the cursor. */ /* * Declarations of procedures local to this file */ static void FindCursorByName(TkMacOSXCursor *macCursorPtr, const char *string); - /* *---------------------------------------------------------------------- @@ -120,10 +118,9 @@ static void FindCursorByName(TkMacOSXCursor *macCursorPtr, const char *string); * FindCursorByName -- * * Retrieve a system cursor by name, and fill the macCursorPtr - * structure. If the cursor cannot be found, the macCursor field - * will be NULL. The function first attempts to load a color - * cursor. If that fails it will attempt to load a black & white - * cursor. + * structure. If the cursor cannot be found, the macCursor field will be + * NULL. The function first attempts to load a color cursor. If that + * fails it will attempt to load a black & white cursor. * * Results: * Fills the macCursorPtr record. @@ -205,9 +202,9 @@ TkGetCursorByName( macCursorPtr->info.cursor = (Tk_Cursor) macCursorPtr; /* - * To find a cursor we must first determine if it is one of the - * builtin cursors or the standard arrow cursor. Otherwise, we - * attempt to load the cursor as a named Mac resource. + * To find a cursor we must first determine if it is one of the builtin + * cursors or the standard arrow cursor. Otherwise, we attempt to load the + * cursor as a named Mac resource. */ if (strcmp(noneCursorName.name, string) == 0) { @@ -225,11 +222,14 @@ TkGetCursorByName( if (namePtr->name == NULL) { for (namePtr = animatedThemeCursorNames; namePtr->name != NULL; namePtr++) { - int namelen = strlen (namePtr->name); + int namelen = strlen(namePtr->name); + if (strncmp(namePtr->name, string, namelen) == 0) { const char *numPtr = string + namelen; + if (*numPtr) { int result = Tcl_GetInt(NULL, numPtr, &count); + if (result != TCL_OK) { continue; } @@ -251,9 +251,9 @@ TkGetCursorByName( int argc; /* - * The user may be trying to specify an XCursor with fore - * & back colors. We don't want this to be an error, so pick - * off the first word, and try again. + * The user may be trying to specify an XCursor with fore & back + * colors. We don't want this to be an error, so pick off the + * first word, and try again. */ if (Tcl_SplitList(interp, string, &argc, &argv) == TCL_OK ) { @@ -269,9 +269,8 @@ TkGetCursorByName( ckfree((char *)macCursorPtr); Tcl_AppendResult(interp, "bad cursor spec \"", string, "\"", NULL); return NULL; - } else { - return (TkCursor *) macCursorPtr; } + return (TkCursor *) macCursorPtr; } /* @@ -293,8 +292,8 @@ TkGetCursorByName( TkCursor * TkCreateCursorFromData( Tk_Window tkwin, /* Window in which cursor will be used. */ - CONST char *source, /* Bitmap data for cursor shape. */ - CONST char *mask, /* Bitmap data for cursor mask. */ + const char *source, /* Bitmap data for cursor shape. */ + const char *mask, /* Bitmap data for cursor mask. */ int width, int height, /* Dimensions of cursor. */ int xHot, int yHot, /* Location of hot-spot in cursor. */ XColor fgColor, /* Foreground color for cursor. */ @@ -327,12 +326,12 @@ TkpFreeCursor( TkMacOSXCursor *macCursorPtr = (TkMacOSXCursor *) cursorPtr; switch (macCursorPtr->type) { - case COLOR: - DisposeCCursor((CCrsrHandle) macCursorPtr->macCursor); - break; - case NORMAL: - ReleaseResource(macCursorPtr->macCursor); - break; + case COLOR: + DisposeCCursor((CCrsrHandle) macCursorPtr->macCursor); + break; + case NORMAL: + ReleaseResource(macCursorPtr->macCursor); + break; } if (macCursorPtr == gCurrentCursor) { @@ -345,9 +344,8 @@ TkpFreeCursor( * * TkMacOSXInstallCursor -- * - * Installs either the current cursor as defined by TkpSetCursor - * or a resize cursor as the cursor the Macintosh should currently - * display. + * Installs either the current cursor as defined by TkpSetCursor or a + * resize cursor as the cursor the Macintosh should currently display. * * Results: * None. @@ -382,35 +380,35 @@ TkMacOSXInstallCursor( SetThemeCursor(kThemeArrowCursor); } else { struct CursorName *namePtr; + switch (macCursorPtr->type) { - case NONE: - if (!cursorHidden) { - cursorHidden = 1; - HideCursor(); - } - cursorNone = 1; - break; - case THEME: - namePtr = (struct CursorName *) macCursorPtr->macCursor; - SetThemeCursor( - namePtr->id); - break; - case ANIMATED: - namePtr = (struct CursorName *) macCursorPtr->macCursor; - if (macCursorPtr->count == -1) { - SetAnimatedThemeCursor(namePtr->id, cursorStep++); - } else { - SetAnimatedThemeCursor(namePtr->id, macCursorPtr->count); - } - break; - case COLOR: - ccursor = (CCrsrHandle) macCursorPtr->macCursor; - SetCCursor(ccursor); - break; - case NORMAL: - cursor = (CursHandle) macCursorPtr->macCursor; - SetCursor(*cursor); - break; + case NONE: + if (!cursorHidden) { + cursorHidden = 1; + HideCursor(); + } + cursorNone = 1; + break; + case THEME: + namePtr = (struct CursorName *) macCursorPtr->macCursor; + SetThemeCursor(namePtr->id); + break; + case ANIMATED: + namePtr = (struct CursorName *) macCursorPtr->macCursor; + if (macCursorPtr->count == -1) { + SetAnimatedThemeCursor(namePtr->id, cursorStep++); + } else { + SetAnimatedThemeCursor(namePtr->id, macCursorPtr->count); + } + break; + case COLOR: + ccursor = (CCrsrHandle) macCursorPtr->macCursor; + SetCCursor(ccursor); + break; + case NORMAL: + cursor = (CursHandle) macCursorPtr->macCursor; + SetCursor(*cursor); + break; } } if (cursorHidden && !cursorNone) { @@ -448,10 +446,10 @@ TkpSetCursor( if (cursor == None) { /* * This is a little tricky. We can't really tell whether - * gCurrentCursor is NULL because it was NULL last time around - * or because we just freed the current cursor. So if the input - * cursor is NULL, we always need to reset it, we can't trust the - * cursorChanged logic. + * gCurrentCursor is NULL because it was NULL last time around or + * because we just freed the current cursor. So if the input cursor is + * NULL, we always need to reset it, we can't trust the cursorChanged + * logic. */ gCurrentCursor = NULL; diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index 24c74e3..abe3c2b 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXDialog.c,v 1.36 2007/12/13 15:27:08 dgp Exp $ + * RCS: @(#) $Id: tkMacOSXDialog.c,v 1.37 2008/04/27 22:39:12 dkf Exp $ */ #include "tkMacOSXPrivate.h" @@ -104,16 +104,14 @@ static int fileDlgInited = 0; static NavObjectFilterUPP openFileFilterUPP; static NavEventUPP openFileEventUPP; - /* *---------------------------------------------------------------------- * * Tk_ChooseColorObjCmd -- * - * This procedure implements the color dialog box for the Mac - * platform. See the user documentation for details on what it - * does. + * This procedure implements the color dialog box for the Mac platform. + * See the user documentation for details on what it does. * * Results: * A standard Tcl result. @@ -129,11 +127,11 @@ Tk_ChooseColorObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { OSStatus err; int result = TCL_ERROR; - Tk_Window parent, tkwin = (Tk_Window) clientData; + Tk_Window parent, tkwin = clientData; const char *title; int i, srcRead, dstWrote; CMError cmerr; @@ -204,7 +202,7 @@ Tk_ChooseColorObjCmd( cpinfo.placeWhere = kCenterOnMainScreen; /* Currently, this does not actually change the colorpicker title */ Tcl_UtfToExternal(NULL, TkMacOSXCarbonEncoding, title, -1, 0, NULL, - StrBody(cpinfo.prompt), 255, &srcRead, &dstWrote, NULL); + StrBody(cpinfo.prompt), 255, &srcRead, &dstWrote, NULL); StrLength(cpinfo.prompt) = (unsigned char) dstWrote; TkMacOSXTrackingLoop(1); @@ -225,7 +223,7 @@ Tk_ChooseColorObjCmd( } result = TCL_OK; -end: + end: return result; } @@ -234,9 +232,8 @@ end: * * Tk_GetOpenFileObjCmd -- * - * This procedure implements the "open file" dialog box for the - * Mac platform. See the user documentation for details on what - * it does. + * This procedure implements the "open file" dialog box for the Mac + * platform. See the user documentation for details on what it does. * * Results: * A standard Tcl result. @@ -251,7 +248,7 @@ Tk_GetOpenFileObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { int i, result = TCL_ERROR, multiple = 0; OpenFileData ofd; @@ -301,51 +298,54 @@ Tk_GetOpenFileObjCmd( } switch (index) { - case OPEN_DEFAULT: - break; - case OPEN_FILETYPES: - types = objv[i + 1]; - if (TkGetFileFilters(interp, &ofd.fl, types, 0) != TCL_OK) { - goto end; - } - break; - case OPEN_INITDIR: - initialDir = Tcl_GetStringFromObj(objv[i + 1], &choiceLen); - /* empty strings should be like no selection given */ - if (choiceLen == 0) { initialDir = NULL; } - break; - case OPEN_INITFILE: - initialFile = Tcl_GetString(objv[i + 1]); - /* empty strings should be like no selection given */ - if (choiceLen == 0) { initialFile = NULL; } - break; - case OPEN_MESSAGE: - choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen); - message = CFStringCreateWithBytes(NULL, (unsigned char*) - choice, choiceLen, kCFStringEncodingUTF8, false); - break; - case OPEN_MULTIPLE: - if (Tcl_GetBooleanFromObj(interp, objv[i + 1], &multiple) - != TCL_OK) { - goto end; - } - break; - case OPEN_PARENT: - choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen); - parent = Tk_NameToWindow(interp, choice, - (Tk_Window) clientData); - if (parent == NULL) { - goto end; - } - break; - case OPEN_TITLE: - choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen); - title = CFStringCreateWithBytes(NULL, (unsigned char*) - choice, choiceLen, kCFStringEncodingUTF8, false); - break; - case OPEN_TYPEVARIABLE: - typeVariablePtr = objv[i + 1]; - break; + case OPEN_DEFAULT: + break; + case OPEN_FILETYPES: + types = objv[i + 1]; + if (TkGetFileFilters(interp, &ofd.fl, types, 0) != TCL_OK) { + goto end; + } + break; + case OPEN_INITDIR: + initialDir = Tcl_GetStringFromObj(objv[i + 1], &choiceLen); + /* empty strings should be like no selection given */ + if (choiceLen == 0) { + initialDir = NULL; + } + break; + case OPEN_INITFILE: + initialFile = Tcl_GetString(objv[i + 1]); + /* empty strings should be like no selection given */ + if (choiceLen == 0) { + initialFile = NULL; + } + break; + case OPEN_MESSAGE: + choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen); + message = CFStringCreateWithBytes(NULL, (unsigned char *) choice, + choiceLen, kCFStringEncodingUTF8, false); + break; + case OPEN_MULTIPLE: + if (Tcl_GetBooleanFromObj(interp, objv[i + 1], + &multiple) != TCL_OK) { + goto end; + } + break; + case OPEN_PARENT: + choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen); + parent = Tk_NameToWindow(interp, choice, clientData); + if (parent == NULL) { + goto end; + } + break; + case OPEN_TITLE: + choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen); + title = CFStringCreateWithBytes(NULL, (unsigned char *) choice, + choiceLen, kCFStringEncodingUTF8, false); + break; + case OPEN_TYPEVARIABLE: + typeVariablePtr = objv[i + 1]; + break; } } @@ -372,7 +372,7 @@ Tk_GetOpenFileObjCmd( Tcl_SetVar(interp, Tcl_GetString(typeVariablePtr), filterPtr->name, 0); } -end: + end: TkFreeFileFilters(&ofd.fl); if (initialDesc.dataHandle) { ChkErr(AEDisposeDesc, &initialDesc); @@ -394,8 +394,7 @@ end: * * Tk_GetSaveFileObjCmd -- * - * Same as Tk_GetOpenFileCmd but opens a "save file" dialog box - * instead + * Same as Tk_GetOpenFileCmd but opens a "save file" dialog box instead. * * Results: * A standard Tcl result. @@ -410,7 +409,7 @@ Tk_GetSaveFileObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { int i, result = TCL_ERROR; char *initialFile = NULL; @@ -453,47 +452,46 @@ Tk_GetSaveFileObjCmd( goto end; } switch (index) { - case SAVE_DEFAULT: - break; - case SAVE_FILETYPES: - types = objv[i + 1]; - if (TkGetFileFilters(interp, &ofd.fl, types, 0) != TCL_OK) { - goto end; - } - break; - case SAVE_INITDIR: - choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen); - /* empty strings should be like no selection given */ - if (choiceLen && HandleInitialDirectory(interp, NULL, choice, - &dirRef, NULL, &initialDesc) != TCL_OK) { - goto end; - } - break; - case SAVE_INITFILE: - initialFile = Tcl_GetStringFromObj(objv[i + 1], &choiceLen); - /* empty strings should be like no selection given */ - if (choiceLen == 0) { - initialFile = NULL; - } - break; - case SAVE_MESSAGE: - choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen); - message = CFStringCreateWithBytes(NULL, (unsigned char*) - choice, choiceLen, kCFStringEncodingUTF8, false); - break; - case SAVE_PARENT: - choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen); - parent = Tk_NameToWindow(interp, choice, - (Tk_Window) clientData); - if (parent == NULL) { - goto end; - } - break; - case SAVE_TITLE: - choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen); - title = CFStringCreateWithBytes(NULL, (unsigned char*) - choice, choiceLen, kCFStringEncodingUTF8, false); - break; + case SAVE_DEFAULT: + break; + case SAVE_FILETYPES: + types = objv[i + 1]; + if (TkGetFileFilters(interp, &ofd.fl, types, 0) != TCL_OK) { + goto end; + } + break; + case SAVE_INITDIR: + choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen); + /* empty strings should be like no selection given */ + if (choiceLen && HandleInitialDirectory(interp, NULL, choice, + &dirRef, NULL, &initialDesc) != TCL_OK) { + goto end; + } + break; + case SAVE_INITFILE: + initialFile = Tcl_GetStringFromObj(objv[i + 1], &choiceLen); + /* empty strings should be like no selection given */ + if (choiceLen == 0) { + initialFile = NULL; + } + break; + case SAVE_MESSAGE: + choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen); + message = CFStringCreateWithBytes(NULL, (unsigned char *) choice, + choiceLen, kCFStringEncodingUTF8, false); + break; + case SAVE_PARENT: + choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen); + parent = Tk_NameToWindow(interp, choice, (Tk_Window) clientData); + if (parent == NULL) { + goto end; + } + break; + case SAVE_TITLE: + choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen); + title = CFStringCreateWithBytes(NULL, (unsigned char *) choice, + choiceLen, kCFStringEncodingUTF8, false); + break; } } @@ -503,7 +501,7 @@ Tk_GetSaveFileObjCmd( result = NavServicesGetFile(interp, &ofd, initialPtr, initialFile, NULL, title, message, NULL, false, SAVE_FILE, parent); TkFreeFileFilters(&ofd.fl); -end: + end: if (initialDesc.dataHandle) { ChkErr(AEDisposeDesc, &initialDesc); } @@ -521,9 +519,9 @@ end: * * Tk_ChooseDirectoryObjCmd -- * - * This procedure implements the "tk_chooseDirectory" dialog box - * for the Windows platform. See the user documentation for details - * on what it does. + * This procedure implements the "tk_chooseDirectory" dialog box for the + * MacOS X platform. See the user documentation for details on what it + * does. * * Results: * See user documentation. @@ -535,11 +533,11 @@ end: */ int -Tk_ChooseDirectoryObjCmd(clientData, interp, objc, objv) - ClientData clientData; /* Main window associated with interpreter. */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ +Tk_ChooseDirectoryObjCmd( + ClientData clientData, /* Main window associated with interpreter. */ + Tcl_Interp *interp, /* Current interpreter. */ + int objc, /* Number of arguments. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { int i, result = TCL_ERROR; Tk_Window parent = NULL; @@ -560,9 +558,8 @@ Tk_ChooseDirectoryObjCmd(clientData, interp, objc, objv) } for (i = 1; i < objc; i += 2) { - char *choice; + char *string, *choice; int index, choiceLen; - char *string; if (Tcl_GetIndexFromObj(interp, objv[i], chooseOptionStrings, "option", TCL_EXACT, &index) != TCL_OK) { @@ -575,31 +572,30 @@ Tk_ChooseDirectoryObjCmd(clientData, interp, objc, objv) goto end; } switch (index) { - case CHOOSE_INITDIR: - choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen); - if (choiceLen && HandleInitialDirectory(interp, NULL, choice, - &dirRef, NULL, &initialDesc) != TCL_OK) { - goto end; - } - break; - case CHOOSE_MESSAGE: - choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen); - message = CFStringCreateWithBytes(NULL, (unsigned char*) - choice, choiceLen, kCFStringEncodingUTF8, false); - break; - case CHOOSE_PARENT: - choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen); - parent = Tk_NameToWindow(interp, choice, - (Tk_Window) clientData); - if (parent == NULL) { - goto end; - } - break; - case CHOOSE_TITLE: - choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen); - title = CFStringCreateWithBytes(NULL, (unsigned char*) choice, - choiceLen, kCFStringEncodingUTF8, false); - break; + case CHOOSE_INITDIR: + choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen); + if (choiceLen && HandleInitialDirectory(interp, NULL, choice, + &dirRef, NULL, &initialDesc) != TCL_OK) { + goto end; + } + break; + case CHOOSE_MESSAGE: + choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen); + message = CFStringCreateWithBytes(NULL, (unsigned char *) choice, + choiceLen, kCFStringEncodingUTF8, false); + break; + case CHOOSE_PARENT: + choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen); + parent = Tk_NameToWindow(interp, choice, clientData); + if (parent == NULL) { + goto end; + } + break; + case CHOOSE_TITLE: + choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen); + title = CFStringCreateWithBytes(NULL, (unsigned char *) choice, + choiceLen, kCFStringEncodingUTF8, false); + break; } } @@ -611,7 +607,7 @@ Tk_ChooseDirectoryObjCmd(clientData, interp, objc, objv) result = NavServicesGetFile(interp, &ofd, initialPtr, NULL, NULL, title, message, NULL, false, CHOOSE_FOLDER, parent); TkFreeFileFilters(&ofd.fl); -end: + end: if (initialDesc.dataHandle) { ChkErr(AEDisposeDesc, &initialDesc); } @@ -660,16 +656,16 @@ HandleInitialDirectory( if (dirName == NULL) { goto end; } - err = ChkErr(FSPathMakeRef, (unsigned char*) dirName, - dirRef, &isDirectory); + err = ChkErr(FSPathMakeRef, (unsigned char *) dirName, dirRef, + &isDirectory); if (err != noErr) { Tcl_AppendResult(interp, "bad directory \"", initialDir, "\"", NULL); goto end; } if (!isDirectory) { - Tcl_AppendResult(interp, "-intialdir \"", - initialDir, " is a file, not a directory.\"", NULL); + Tcl_AppendResult(interp, "-intialdir \"", initialDir, "\"" + " is a file, not a directory.", NULL); goto end; } ChkErr(AECreateDesc, typeFSRef, dirRef, sizeof(*dirRef), dirDescPtr); @@ -690,7 +686,7 @@ HandleInitialDirectory( ChkErr(AECreateList, NULL, 0, false, selectDescPtr); - err = ChkErr(FSPathMakeRef, (unsigned char*) namePtr, &fileRef, + err = ChkErr(FSPathMakeRef, (unsigned char *) namePtr, &fileRef, &isDirectory); if (err != noErr) { Tcl_AppendResult(interp, "bad initialfile \"", initialFile, @@ -702,7 +698,7 @@ HandleInitialDirectory( ChkErr(AEDisposeDesc, &fileDesc); } result = TCL_OK; -end: + end: if (dirName) { Tcl_DStringFree(&ds); } @@ -766,7 +762,7 @@ NavServicesGetFile( NavHandlerUserData data; NavDialogCreationOptions options; NavDialogRef dialogRef = NULL; - CFStringRef * menuItemNames = NULL; + CFStringRef *menuItemNames = NULL; OSStatus err; Tcl_Obj *theResult = NULL; int result = TCL_ERROR; @@ -782,7 +778,7 @@ NavServicesGetFile( options.optionFlags |= kNavAllowMultipleFiles; } options.modality = kWindowModalityAppModal; - if (parent && ((TkWindow*)parent)->window != None && + if (parent && ((TkWindow *) parent)->window != None && TkMacOSXHostToplevelExists(parent)) { options.parentWindow = TkMacOSXDrawableWindow(Tk_WindowId(parent)); TK_IF_HI_TOOLBOX (5, @@ -802,10 +798,10 @@ NavServicesGetFile( * Now process the selection list. We have to use the popupExtension * to fill the menu. */ + if (ofdPtr && ofdPtr->usePopup) { - FileFilter *filterPtr; + FileFilter *filterPtr = ofdPtr->fl.filters; - filterPtr = ofdPtr->fl.filters; if (filterPtr == NULL) { ofdPtr->usePopup = 0; } @@ -815,8 +811,8 @@ NavServicesGetFile( int index = 0; ofdPtr->curType = 0; - menuItemNames = (CFStringRef *) ckalloc(ofdPtr->fl.numFilters - * sizeof(CFStringRef)); + menuItemNames = (CFStringRef *) + ckalloc(ofdPtr->fl.numFilters * sizeof(CFStringRef)); for (filterPtr = ofdPtr->fl.filters; filterPtr != NULL; filterPtr = filterPtr->next, index++) { @@ -836,8 +832,8 @@ NavServicesGetFile( options.message = message; options.windowTitle = title; if (initialFile) { - options.saveFileName = CFStringCreateWithCString(NULL, - initialFile, kCFStringEncodingUTF8); + options.saveFileName = CFStringCreateWithCString(NULL, initialFile, + kCFStringEncodingUTF8); } else { options.saveFileName = NULL; } @@ -878,9 +874,10 @@ NavServicesGetFile( } /* - * Most commands assume that the file dialogs return a single - * item, not a list. So only build a list if multiple is true... + * Most commands assume that the file dialogs return a single item, not a + * list. So only build a list if multiple is true... */ + if (err == noErr) { if (multiple) { theResult = Tcl_NewListObj(0, NULL); @@ -893,67 +890,89 @@ NavServicesGetFile( } if (err == noErr && data.reply.validRecord) { AEDesc resultDesc; - long count; + long count, i; FSRef fsRef; char pathPtr[PATH_MAX + 1]; + char saveName[PATH_MAX + 1]; err = ChkErr(AECountItems, &data.reply.selection, &count); - if (err == noErr) { - long i; + if (err != noErr) { + /* + * There was an error when counting the items? Treat as if no + * items were chosen. + */ - for (i = 1; i <= count; i++) { - err = ChkErr(AEGetNthDesc, &data.reply.selection, i, - typeFSRef, NULL, &resultDesc); - if (err == noErr) { - err = ChkErr(AEGetDescData, &resultDesc, &fsRef, - sizeof(fsRef)); - if (err == noErr) { - err = ChkErr(FSRefMakePath, &fsRef, (unsigned char*) - pathPtr, PATH_MAX + 1); - if (err == noErr) { - int pathValid = 0; - - if (isOpen == SAVE_FILE) { - if (data.saveNameRef) { - char saveName [PATH_MAX + 1]; - - if (CFStringGetCString(data.saveNameRef, - saveName, PATH_MAX + 1, - kCFStringEncodingUTF8)) { - if (strlen(pathPtr) + strlen(saveName) - < PATH_MAX) { - strcat(pathPtr, "/"); - strcat(pathPtr, saveName); - pathValid = 1; - } else { - TkMacOSXDbgMsg("Path name too " - "long"); - } - } else { - TkMacOSXDbgMsg("CFStringGetCString " - "failed"); - } - } else { - TkMacOSXDbgMsg("NavDialogGetSaveFileName " - "failed"); - } - } else { - pathValid = 1; - } - if (pathValid) { - if (multiple) { - Tcl_ListObjAppendElement(interp, theResult, - Tcl_NewStringObj(pathPtr, -1)); - } else { - Tcl_SetStringObj(theResult, pathPtr, -1); - } - } - } - } - ChkErr(AEDisposeDesc, &resultDesc); + goto installResult; + } + + /* + * Process the chosen files. This will be one unless -multiple was + * specified. + */ + + for (i = 1; i <= count; i++) { + /* + * Get the name of the selected file. + */ + + err = ChkErr(AEGetNthDesc, &data.reply.selection, i, + typeFSRef, NULL, &resultDesc); + if (err != noErr) { + continue; + } + err = ChkErr(AEGetDescData, &resultDesc, &fsRef, sizeof(fsRef)); + if (err != noErr) { + goto nextFilename; + } + err = ChkErr(FSRefMakePath, &fsRef, (unsigned char *) pathPtr, + PATH_MAX + 1); + if (err != noErr) { + goto nextFilename; + } + + /* + * If we're saving the file, we're creating a new filename and + * must therefore check whether it is a legal filename (not + * exceeding path length limits, etc.) + */ + + if (isOpen == SAVE_FILE) { + if (!data.saveNameRef) { + TkMacOSXDbgMsg("NavDialogGetSaveFileName failed"); + goto nextFilename; + } + + if (!CFStringGetCString(data.saveNameRef, saveName, + PATH_MAX + 1, kCFStringEncodingUTF8)) { + TkMacOSXDbgMsg("CFStringGetCString failed"); + goto nextFilename; } + + if (strlen(pathPtr) + strlen(saveName) >= PATH_MAX) { + TkMacOSXDbgMsg("Path name too long"); + goto nextFilename; + } + + strcat(pathPtr, "/"); + strcat(pathPtr, saveName); } + + /* + * Got a valid file name; put it in the result object. + */ + + if (multiple) { + Tcl_ListObjAppendElement(interp, theResult, + Tcl_NewStringObj(pathPtr, -1)); + } else { + Tcl_SetStringObj(theResult, pathPtr, -1); + } + + nextFilename: + ChkErr(AEDisposeDesc, &resultDesc); } + + installResult: Tcl_SetObjResult(interp, theResult); result = TCL_OK; } else if (err == userCanceledErr) { @@ -979,10 +998,11 @@ NavServicesGetFile( } if (menuItemNames) { int i; + for (i = 0; i < ofdPtr->fl.numFilters; i++) { CFRelease(menuItemNames[i]); } - ckfree((void *)menuItemNames); + ckfree((void *) menuItemNames); } if (options.popupExtension) { CFRelease(options.popupExtension); @@ -1032,7 +1052,7 @@ OpenEventProc( selectItem.menuCreator = 0; selectItem.menuType = ofd->initialType; selectItem.menuItemName[0] = strlen(filterPtr->name); - strncpy((char*) &selectItem.menuItemName[1], + strncpy((char *) &selectItem.menuItemName[1], filterPtr->name, 255); ChkErr(NavCustomControl, callBackParams->context, kNavCtlSelectCustomType, &selectItem); @@ -1093,85 +1113,80 @@ OpenEventProc( pascal Boolean OpenFileFilterProc( - AEDesc* theItem, void* info, + AEDesc *theItem, + void *info, NavCallBackUserData callBackUD, NavFilterModes filterMode) { - OpenFileData *ofdPtr = ((NavHandlerUserData*) callBackUD)->ofdPtr; + OpenFileData *ofdPtr = ((NavHandlerUserData *) callBackUD)->ofdPtr; int result = MATCHED; - if (ofdPtr && ofdPtr->usePopup) { - if (ofdPtr->fl.numFilters > 0) { - if ((theItem->descriptorType == typeFSS) - || (theItem->descriptorType == typeFSRef)) { - NavFileOrFolderInfo* theInfo = (NavFileOrFolderInfo *) info; - char fileName[256]; - - if (!theInfo->isFolder) { - OSType fileType; - StringPtr fileNamePtr = NULL; - Tcl_DString fileNameDString; - int i; - FileFilter *filterPtr; - - fileType = - theInfo->fileAndFolder.fileInfo.finderInfo.fdType; - Tcl_DStringInit (&fileNameDString); - - if (theItem->descriptorType == typeFSS) { - int len; - fileNamePtr = ((FSSpec *) *theItem->dataHandle)->name; - len = fileNamePtr[0]; - strncpy(fileName, (char*) fileNamePtr + 1, len); - fileName[len] = '\0'; - fileNamePtr = (unsigned char*) fileName; - } else if ((theItem->descriptorType == typeFSRef)) { - OSStatus err; - FSRef *theRef = (FSRef *) *theItem->dataHandle; - HFSUniStr255 uniFileName; - err = ChkErr(FSGetCatalogInfo, theRef, kFSCatInfoNone, - NULL, &uniFileName, NULL, NULL); - - if (err == noErr) { - Tcl_UniCharToUtfDString ( - (Tcl_UniChar *) uniFileName.unicode, - uniFileName.length, &fileNameDString); - fileNamePtr = (unsigned char*) - Tcl_DStringValue(&fileNameDString); - } - } - if (ofdPtr->usePopup) { - i = ofdPtr->curType; - for (filterPtr = ofdPtr->fl.filters; - filterPtr && i > 0; i--) { - filterPtr = filterPtr->next; - } - if (filterPtr) { - result = MatchOneType(fileNamePtr, fileType, - ofdPtr, filterPtr); - } else { - result = UNMATCHED; - } - } else { - /* - * We are not using the popup menu. In this case, the - * file is considered matched if it matches any of - * the file filters. - */ - - result = UNMATCHED; - for (filterPtr = ofdPtr->fl.filters; filterPtr; - filterPtr = filterPtr->next) { - if (MatchOneType(fileNamePtr, fileType, - ofdPtr, filterPtr) == MATCHED) { - result = MATCHED; - break; - } - } + if (ofdPtr && ofdPtr->usePopup && ofdPtr->fl.numFilters > 0 && + ((theItem->descriptorType == typeFSS) + || (theItem->descriptorType == typeFSRef))) { + NavFileOrFolderInfo *theInfo = info; + char fileName[256]; + OSType fileType; + StringPtr fileNamePtr = NULL; + Tcl_DString fileNameDString; + int i; + FileFilter *filterPtr; + + if (!theInfo->isFolder) { + fileType = theInfo->fileAndFolder.fileInfo.finderInfo.fdType; + Tcl_DStringInit(&fileNameDString); + + if (theItem->descriptorType == typeFSS) { + int len; + + fileNamePtr = ((FSSpec *) *theItem->dataHandle)->name; + len = fileNamePtr[0]; + strncpy(fileName, (char *) fileNamePtr + 1, len); + fileName[len] = '\0'; + fileNamePtr = (unsigned char *) fileName; + } else if ((theItem->descriptorType == typeFSRef)) { + OSStatus err; + FSRef *theRef = (FSRef *) *theItem->dataHandle; + HFSUniStr255 uniFileName; + + err = ChkErr(FSGetCatalogInfo, theRef, kFSCatInfoNone, + NULL, &uniFileName, NULL, NULL); + + if (err == noErr) { + Tcl_UniCharToUtfDString((Tcl_UniChar *)uniFileName.unicode, + uniFileName.length, &fileNameDString); + fileNamePtr = (unsigned char *) + Tcl_DStringValue(&fileNameDString); + } + } + if (ofdPtr->usePopup) { + i = ofdPtr->curType; + for (filterPtr = ofdPtr->fl.filters; filterPtr && i>0; i--) { + filterPtr = filterPtr->next; + } + if (filterPtr) { + result = MatchOneType(fileNamePtr, fileType, ofdPtr, + filterPtr); + } else { + result = UNMATCHED; + } + } else { + /* + * We are not using the popup menu. In this case, the file is + * considered matched if it matches any of the file filters. + */ + + result = UNMATCHED; + for (filterPtr = ofdPtr->fl.filters; filterPtr; + filterPtr = filterPtr->next) { + if (MatchOneType(fileNamePtr, fileType, ofdPtr, + filterPtr) == MATCHED) { + result = MATCHED; + break; } - Tcl_DStringFree (&fileNameDString); } } + Tcl_DStringFree(&fileNameDString); } } return (result == MATCHED); @@ -1206,20 +1221,20 @@ MatchOneType( FileFilterClause *clausePtr; /* - * A file matches with a file type if it matches with at least one - * clause of the type. + * A file matches with a file type if it matches with at least one clause + * of the type. * - * If the clause has both glob patterns and ostypes, the file must - * match with at least one pattern AND at least one ostype. + * If the clause has both glob patterns and ostypes, the file must match + * with at least one pattern AND at least one ostype. * * If the clause has glob patterns only, the file must match with at least * one pattern. * - * If the clause has mac types only, the file must match with at least - * one mac type. + * If the clause has mac types only, the file must match with at least one + * mac type. * - * If the clause has neither glob patterns nor mac types, it's - * considered an error. + * If the clause has neither glob patterns nor mac types, it's considered + * an error. */ for (clausePtr = filterPtr->clauses; clausePtr; @@ -1261,10 +1276,7 @@ MatchOneType( if (Tcl_StringMatch((char*) fileNamePtr, ext)) { goto glob_matched; - } else { - goto glob_unmatched; } - glob_unmatched: continue; @@ -1281,13 +1293,12 @@ MatchOneType( } /* - * On Mac OS X, it is not uncommon for files to have NO - * file type. But folks with Tcl code on Classic MacOS pretty - * much assume that a generic file will have type TEXT. So - * if we were strict about matching types when the source file - * had NO type set, they would have to add another rule always - * with no fileType. To avoid that, we pass the macMatch side - * of the test if no fileType is set. + * On Mac OS X, it is not uncommon for files to have NO file type. But + * folks with Tcl code on Classic MacOS pretty much assume that a + * generic file will have type TEXT. So if we were strict about + * matching types when the source file had NO type set, they would + * have to add another rule always with no fileType. To avoid that, we + * pass the macMatch side of the test if no fileType is set. */ if (globMatched && (macMatched || (fileType == 0))) { @@ -1303,8 +1314,8 @@ MatchOneType( * * TkAboutDlg -- * - * Displays the default Tk About box. This code uses Macintosh - * resources to define the content of the About Box. + * Displays the default Tk About box. This code uses Macintosh resources + * to define the content of the About Box. * * Results: * None. @@ -1358,9 +1369,9 @@ Tk_MessageBoxObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { - Tk_Window tkwin = (Tk_Window) clientData; + Tk_Window tkwin = clientData; AlertStdCFStringAlertParamRec paramCFStringRec; AlertType alertType; DialogRef dialogRef; @@ -1459,107 +1470,104 @@ Tk_MessageBoxObjCmd( } switch (index) { - case ALERT_DEFAULT: - /* - * Need to postpone processing of this option until we are - * sure to know the '-type' as well. - */ - haveDefaultOption = true; - indexDefaultOption = i; - break; + case ALERT_DEFAULT: + /* + * Need to postpone processing of this option until we are sure to + * know the '-type' as well. + */ - case ALERT_DETAIL: - str = Tcl_GetString(objv[i + 1]); - finemessageTextCF = CFStringCreateWithCString(NULL, str, - kCFStringEncodingUTF8); - break; + haveDefaultOption = true; + indexDefaultOption = i; + break; - case ALERT_ICON: - if (Tcl_GetIndexFromObj(interp, objv[i + 1], - movableIconStrings, "value", TCL_EXACT, &iconIndex) - != TCL_OK) { - goto end; - } - switch (iconIndex) { - case ICON_ERROR: - alertType = kAlertStopAlert; - break; - case ICON_INFO: - alertType = kAlertNoteAlert; - break; - case ICON_QUESTION: - alertType = kAlertCautionAlert; - break; - case ICON_WARNING: - alertType = kAlertCautionAlert; - break; - } - break; + case ALERT_DETAIL: + str = Tcl_GetString(objv[i + 1]); + finemessageTextCF = CFStringCreateWithCString(NULL, str, + kCFStringEncodingUTF8); + break; - case ALERT_MESSAGE: - str = Tcl_GetString(objv[i + 1]); - messageTextCF = CFStringCreateWithCString(NULL, str, - kCFStringEncodingUTF8); + case ALERT_ICON: + if (Tcl_GetIndexFromObj(interp, objv[i + 1], movableIconStrings, + "value", TCL_EXACT, &iconIndex) != TCL_OK) { + goto end; + } + switch (iconIndex) { + case ICON_ERROR: + alertType = kAlertStopAlert; break; - - case ALERT_PARENT: - str = Tcl_GetString(objv[i + 1]); - tkwin = Tk_NameToWindow(interp, str, tkwin); - if (tkwin == NULL) { - goto end; - } - if (((TkWindow*)tkwin)->window != None && - TkMacOSXHostToplevelExists(tkwin)) { - haveParentOption = true; - } + case ICON_INFO: + alertType = kAlertNoteAlert; break; - - case ALERT_TITLE: + case ICON_QUESTION: + alertType = kAlertCautionAlert; + break; + case ICON_WARNING: + alertType = kAlertCautionAlert; break; + } + break; - case ALERT_TYPE: - if (Tcl_GetIndexFromObj(interp, objv[i + 1],\ - movableTypeStrings, "value", TCL_EXACT, &typeIndex) - != TCL_OK) { - goto end; - } - switch (typeIndex) { - case TYPE_ABORTRETRYIGNORE: - paramCFStringRec.defaultText = CFSTR("Abort"); - paramCFStringRec.cancelText = CFSTR("Retry"); - paramCFStringRec.otherText = CFSTR("Ignore"); - paramCFStringRec.cancelButton = - kAlertStdAlertOtherButton; - break; - case TYPE_OK: - paramCFStringRec.defaultText = CFSTR("OK"); - break; - case TYPE_OKCANCEL: - paramCFStringRec.defaultText = CFSTR("OK"); - paramCFStringRec.cancelText = CFSTR("Cancel"); - break; - case TYPE_RETRYCANCEL: - paramCFStringRec.defaultText = CFSTR("Retry"); - paramCFStringRec.cancelText = CFSTR("Cancel"); - break; - case TYPE_YESNO: - paramCFStringRec.defaultText = CFSTR("Yes"); - paramCFStringRec.cancelText = CFSTR("No"); - break; - case TYPE_YESNOCANCEL: - paramCFStringRec.defaultText = CFSTR("Yes"); - paramCFStringRec.cancelText = CFSTR("No"); - paramCFStringRec.otherText = CFSTR("Cancel"); - paramCFStringRec.cancelButton = - kAlertStdAlertOtherButton; - break; - } + case ALERT_MESSAGE: + str = Tcl_GetString(objv[i + 1]); + messageTextCF = CFStringCreateWithCString(NULL, str, + kCFStringEncodingUTF8); + break; + + case ALERT_PARENT: + str = Tcl_GetString(objv[i + 1]); + tkwin = Tk_NameToWindow(interp, str, tkwin); + if (tkwin == NULL) { + goto end; + } + if (((TkWindow *) tkwin)->window != None && + TkMacOSXHostToplevelExists(tkwin)) { + haveParentOption = true; + } + break; + + case ALERT_TITLE: + /* TODO: message box title missing? */ + break; + + case ALERT_TYPE: + if (Tcl_GetIndexFromObj(interp, objv[i + 1], movableTypeStrings, + "value", TCL_EXACT, &typeIndex) != TCL_OK) { + goto end; + } + switch (typeIndex) { + case TYPE_ABORTRETRYIGNORE: + paramCFStringRec.defaultText = CFSTR("Abort"); + paramCFStringRec.cancelText = CFSTR("Retry"); + paramCFStringRec.otherText = CFSTR("Ignore"); + paramCFStringRec.cancelButton = kAlertStdAlertOtherButton; + break; + case TYPE_OK: + paramCFStringRec.defaultText = CFSTR("OK"); break; + case TYPE_OKCANCEL: + paramCFStringRec.defaultText = CFSTR("OK"); + paramCFStringRec.cancelText = CFSTR("Cancel"); + break; + case TYPE_RETRYCANCEL: + paramCFStringRec.defaultText = CFSTR("Retry"); + paramCFStringRec.cancelText = CFSTR("Cancel"); + break; + case TYPE_YESNO: + paramCFStringRec.defaultText = CFSTR("Yes"); + paramCFStringRec.cancelText = CFSTR("No"); + break; + case TYPE_YESNOCANCEL: + paramCFStringRec.defaultText = CFSTR("Yes"); + paramCFStringRec.cancelText = CFSTR("No"); + paramCFStringRec.otherText = CFSTR("Cancel"); + paramCFStringRec.cancelButton = kAlertStdAlertOtherButton; + break; + } + break; } } if (haveDefaultOption) { - /* * Any '-default' option needs to know the '-type' option, which is why * we do this here. @@ -1642,19 +1650,18 @@ Tk_MessageBoxObjCmd( } } if (err == noErr) { - int ind; - /* * Map 'itemHit' (1, 2, 3) to descriptive text string. */ - ind = nativeButtonIndexAndTypeToButtonIndex[typeIndex][itemHit]; + int ind = nativeButtonIndexAndTypeToButtonIndex[typeIndex][itemHit]; + Tcl_SetObjResult(interp, Tcl_NewStringObj(movableButtonStrings[ind], -1)); result = TCL_OK; } -end: + end: if (finemessageTextCF) { CFRelease(finemessageTextCF); } @@ -1686,21 +1693,21 @@ AlertHandler( EventRef eventRef, void *userData) { - AlertHandlerUserData *data = (AlertHandlerUserData *) userData; + AlertHandlerUserData *data = userData; HICommand cmd; ChkErr(GetEventParameter,eventRef, kEventParamDirectObject, typeHICommand, NULL, sizeof(cmd), NULL, &cmd); switch (cmd.commandID) { - case kHICommandOK: - data->buttonIndex = 1; - break; - case kHICommandCancel: - data->buttonIndex = 2; - break; - case kHICommandOther: - data->buttonIndex = 3; - break; + case kHICommandOK: + data->buttonIndex = 1; + break; + case kHICommandCancel: + data->buttonIndex = 2; + break; + case kHICommandOther: + data->buttonIndex = 3; + break; } if (data->buttonIndex) { ChkErr(QuitAppModalLoopForWindow, data->dialogWindow); diff --git a/macosx/tkMacOSXEmbed.c b/macosx/tkMacOSXEmbed.c index a971c0d..47a9ed7 100644 --- a/macosx/tkMacOSXEmbed.c +++ b/macosx/tkMacOSXEmbed.c @@ -3,52 +3,49 @@ * * This file contains platform-specific procedures for theMac to provide * basic operations needed for application embedding (where one - * application can use as its main window an internal window from - * some other application). - * Currently only Toplevel embedding within the same Tk application is - * allowed on the Macintosh. + * application can use as its main window an internal window from some + * other application). Currently only Toplevel embedding within the same + * Tk application is allowed on the Macintosh. * * Copyright (c) 1996-1997 Sun Microsystems, Inc. * Copyright 2001, Apple Computer, Inc. * Copyright (c) 2006-2007 Daniel A. Steffen * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * See the file "license.terms" for information on usage and redistribution of + * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXEmbed.c,v 1.16 2007/12/13 15:27:09 dgp Exp $ + * RCS: @(#) $Id: tkMacOSXEmbed.c,v 1.17 2008/04/27 22:39:12 dkf Exp $ */ #include "tkMacOSXInt.h" /* * One of the following structures exists for each container in this - * application. It keeps track of the container window and its - * associated embedded window. + * application. It keeps track of the container window and its associated + * embedded window. */ typedef struct Container { - Window parent; /* The Mac Drawable for the parent of - * the pair (the container). */ - TkWindow *parentPtr; /* Tk's information about the container, - * or NULL if the container isn't + Window parent; /* The Mac Drawable for the parent of the pair + * (the container). */ + TkWindow *parentPtr; /* Tk's information about the container, or + * NULL if the container isn't in this + * process. */ + Window embedded; /* The MacDrawable for the embedded window. + * Starts off as None, but gets filled in when + * the window is eventually created. */ + TkWindow *embeddedPtr; /* Tk's information about the embedded window, + * or NULL if the embedded application isn't * in this process. */ - Window embedded; /* The MacDrawable for the embedded - * window. Starts off as None, but - * gets filled in when the window is - * eventually created. */ - TkWindow *embeddedPtr; /* Tk's information about the embedded - * window, or NULL if the - * embedded application isn't in - * this process. */ - struct Container *nextPtr; /* Next in list of all containers in - * this process. */ + struct Container *nextPtr; /* Next in list of all containers in this + * process. */ } Container; static Container *firstContainerPtr = NULL; - /* First in list of all containers - * managed by this process. */ + /* First in list of all containers managed by + * this process. */ /* - * Globals defined in this file + * Globals defined in this file: */ TkMacOSXEmbedHandler *tkMacOSXEmbedHandler = NULL; @@ -57,25 +54,24 @@ TkMacOSXEmbedHandler *tkMacOSXEmbedHandler = NULL; * Prototypes for static procedures defined in this file: */ -static void ContainerEventProc(ClientData clientData, XEvent *eventPtr); -static void EmbeddedEventProc(ClientData clientData, XEvent *eventPtr); -static void EmbedActivateProc(ClientData clientData, XEvent *eventPtr); -static void EmbedFocusProc(ClientData clientData, XEvent *eventPtr); -static void EmbedGeometryRequest(Container * containerPtr, int width, - int height); -static void EmbedSendConfigure(Container *containerPtr); -static void EmbedStructureProc(ClientData clientData, XEvent *eventPtr); -static void EmbedWindowDeleted(TkWindow *winPtr); - +static void ContainerEventProc(ClientData clientData, XEvent *eventPtr); +static void EmbeddedEventProc(ClientData clientData, XEvent *eventPtr); +static void EmbedActivateProc(ClientData clientData, XEvent *eventPtr); +static void EmbedFocusProc(ClientData clientData, XEvent *eventPtr); +static void EmbedGeometryRequest(Container *containerPtr, int width, + int height); +static void EmbedSendConfigure(Container *containerPtr); +static void EmbedStructureProc(ClientData clientData, XEvent *eventPtr); +static void EmbedWindowDeleted(TkWindow *winPtr); /* *---------------------------------------------------------------------- * * Tk_MacOSXSetEmbedHandler -- * - * Registers a handler for an in process form of embedding, like - * Netscape plugins, where Tk is loaded into the process, but does - * not control the main window + * Registers a handler for an in process form of embedding, like Netscape + * plugins, where Tk is loaded into the process, but does not control the + * main window * * Results: * None @@ -95,7 +91,8 @@ Tk_MacOSXSetEmbedHandler( Tk_MacOSXEmbedGetOffsetInParentProc *getOffsetProc) { if (tkMacOSXEmbedHandler == NULL) { - tkMacOSXEmbedHandler = (TkMacOSXEmbedHandler *) ckalloc(sizeof(TkMacOSXEmbedHandler)); + tkMacOSXEmbedHandler = (TkMacOSXEmbedHandler *) + ckalloc(sizeof(TkMacOSXEmbedHandler)); } tkMacOSXEmbedHandler->registerWinProc = registerWinProc; tkMacOSXEmbedHandler->getPortProc = getPortProc; @@ -129,9 +126,8 @@ TkpMakeWindow( XEvent event; /* - * If this window is marked as embedded then - * the window structure should have already been - * created in the TkpUseWindow function. + * If this window is marked as embedded then the window structure should + * have already been created in the TkpUseWindow function. */ if (Tk_IsEmbedded(winPtr)) { @@ -158,22 +154,24 @@ TkpMakeWindow( macWin->size = CGSizeZero; if (Tk_IsTopLevel(macWin->winPtr)) { /* - *This will be set when we are mapped. + * This will be set when we are mapped. */ + macWin->xOff = 0; macWin->yOff = 0; macWin->toplevel = macWin; } else { macWin->xOff = winPtr->parentPtr->privatePtr->xOff + - winPtr->parentPtr->changes.border_width + - winPtr->changes.x; + winPtr->parentPtr->changes.border_width + + winPtr->changes.x; macWin->yOff = winPtr->parentPtr->privatePtr->yOff + - winPtr->parentPtr->changes.border_width + - winPtr->changes.y; + winPtr->parentPtr->changes.border_width + + winPtr->changes.y; macWin->toplevel = winPtr->parentPtr->privatePtr->toplevel; } macWin->toplevel->referenceCount++; } + /* * TODO: need general solution for visibility events. */ @@ -195,15 +193,15 @@ TkpMakeWindow( * * TkpUseWindow -- * - * This procedure causes a Tk window to use a given X window as - * its parent window, rather than the root window for the screen. - * It is invoked by an embedded application to specify the window - * in which it is embedded. + * This procedure causes a Tk window to use a given X window as its + * parent window, rather than the root window for the screen. It is + * invoked by an embedded application to specify the window in which it + * is embedded. * * Results: - * The return value is normally TCL_OK. If an error occurs (such - * as string not being a valid window spec), then the return value - * is TCL_ERROR and an error message is left in the interp's result if + * The return value is normally TCL_OK. If an error occurs (such as + * string not being a valid window spec), then the return value is + * TCL_ERROR and an error message is left in the interp's result if * interp is non-NULL. * * Side effects: @@ -214,12 +212,12 @@ TkpMakeWindow( int TkpUseWindow( - Tcl_Interp *interp, /* If not NULL, used for error reporting - * if string is bogus. */ + Tcl_Interp *interp, /* If not NULL, used for error reporting if + * string is bogus. */ Tk_Window tkwin, /* Tk window that does not yet have an * associated X window. */ - CONST char *string) /* String identifying an X window to use - * for tkwin; must be an integer value. */ + const char *string) /* String identifying an X window to use for + * tkwin; must be an integer value. */ { TkWindow *winPtr = (TkWindow *) tkwin; TkWindow *usePtr; @@ -233,13 +231,12 @@ TkpUseWindow( } /* - * Decode the container pointer, and look for it among the - * list of available containers. + * Decode the container pointer, and look for it among the list of + * available containers. * * N.B. For now, we are limiting the containers to be in the same Tk - * application as tkwin, since otherwise they would not be in our list - * of containers. - * + * application as tkwin, since otherwise they would not be in our list of + * containers. */ if (Tcl_GetInt(interp, string, (int*) &parent) != TCL_OK) { @@ -261,8 +258,8 @@ TkpUseWindow( */ /* - * Save information about the container and the embedded window - * in a Container structure. Currently, there must already be an existing + * Save information about the container and the embedded window in a + * Container structure. Currently, there must already be an existing * Container structure, since we only allow the case where both container * and embedded app. are in the same process. */ @@ -290,11 +287,11 @@ TkpUseWindow( winPtr->privatePtr = macWin; /* - * The grafPtr will be NULL for a Tk in Tk embedded window. - * It is none of our business what it is for a Tk not in Tk embedded window, - * but we will initialize it to NULL, and let the registerWinProc - * set it. In any case, you must always use TkMacOSXGetDrawablePort - * to get the portPtr. It will correctly find the container's port. + * The grafPtr will be NULL for a Tk in Tk embedded window. It is none of + * our business what it is for a Tk not in Tk embedded window, but we will + * initialize it to NULL, and let the registerWinProc set it. In any case, + * you must always use TkMacOSXGetDrawablePort to get the portPtr. It will + * correctly find the container's port. */ macWin->grafPtr = NULL; @@ -310,19 +307,17 @@ TkpUseWindow( winPtr->flags |= TK_EMBEDDED; - /* - * Make a copy of the TK_EMBEDDED flag, since sometimes - * we need this to get the port after the TkWindow structure - * has been freed. + * Make a copy of the TK_EMBEDDED flag, since sometimes we need this to + * get the port after the TkWindow structure has been freed. */ macWin->flags |= TK_EMBEDDED; /* - * Now check whether it is embedded in another Tk widget. If not (the first - * case below) we see if there is an in-process embedding handler registered, - * and if so, let that fill in the rest of the macWin. + * Now check whether it is embedded in another Tk widget. If not (the + * first case below) we see if there is an in-process embedding handler + * registered, and if so, let that fill in the rest of the macWin. */ if (containerPtr == NULL) { @@ -345,10 +340,8 @@ TkpUseWindow( containerPtr->embeddedPtr = macWin->winPtr; containerPtr->nextPtr = firstContainerPtr; firstContainerPtr = containerPtr; - } } else { - /* * The window is embedded in another Tk window. */ @@ -360,10 +353,9 @@ TkpUseWindow( parent->winPtr->changes.border_width + winPtr->changes.y; - /* - * Finish filling up the container structure with the embedded window's - * information. + * Finish filling up the container structure with the embedded + * window's information. */ containerPtr->embedded = (Window) macWin; @@ -375,8 +367,7 @@ TkpUseWindow( */ Tk_CreateEventHandler(tkwin, StructureNotifyMask, EmbeddedEventProc, - (ClientData) winPtr); - + winPtr); } return TCL_OK; @@ -387,10 +378,10 @@ TkpUseWindow( * * TkpMakeContainer -- * - * This procedure is called to indicate that a particular window - * will be a container for an embedded application. This changes - * certain aspects of the window's behavior, such as whether it - * will receive events anymore. + * This procedure is called to indicate that a particular window will be + * a container for an embedded application. This changes certain aspects + * of the window's behavior, such as whether it will receive events + * anymore. * * Results: * None. @@ -403,18 +394,17 @@ TkpUseWindow( void TkpMakeContainer( - Tk_Window tkwin) /* Token for a window that is about to - * become a container. */ + Tk_Window tkwin) /* Token for a window that is about to become + * a container. */ { TkWindow *winPtr = (TkWindow *) tkwin; Container *containerPtr; /* - * Register the window as a container so that, for example, we can - * make sure the argument to -use is valid. + * Register the window as a container so that, for example, we can make + * sure the argument to -use is valid. */ - Tk_MakeWindowExist(tkwin); containerPtr = (Container *) ckalloc(sizeof(Container)); containerPtr->parent = Tk_WindowId(tkwin); @@ -426,23 +416,22 @@ TkpMakeContainer( winPtr->flags |= TK_CONTAINER; /* - * Request SubstructureNotify events so that we can find out when - * the embedded application creates its window or attempts to - * resize it. Also watch Configure events on the container so that - * we can resize the child to match. Also, pass activate events from - * the container down to the embedded toplevel. + * Request SubstructureNotify events so that we can find out when the + * embedded application creates its window or attempts to resize it. Also + * watch Configure events on the container so that we can resize the child + * to match. Also, pass activate events from the container down to the + * embedded toplevel. */ Tk_CreateEventHandler(tkwin, SubstructureNotifyMask|SubstructureRedirectMask, - ContainerEventProc, (ClientData) winPtr); + ContainerEventProc, winPtr); Tk_CreateEventHandler(tkwin, StructureNotifyMask, EmbedStructureProc, - (ClientData) containerPtr); + containerPtr); Tk_CreateEventHandler(tkwin, ActivateMask, EmbedActivateProc, - (ClientData) containerPtr); + containerPtr); Tk_CreateEventHandler(tkwin, FocusChangeMask, EmbedFocusProc, - (ClientData) containerPtr); - + containerPtr); } /* @@ -454,8 +443,7 @@ TkpMakeContainer( * identifier for the associated container window. * * Results: - * The return value is the MacDrawable for winPtr's - * container window. + * The return value is the MacDrawable for winPtr's container window. * * Side effects: * None. @@ -464,8 +452,8 @@ TkpMakeContainer( */ MacDrawable * -TkMacOSXContainerId(winPtr) - TkWindow *winPtr; /* Tk's structure for an embedded window. */ +TkMacOSXContainerId( + TkWindow *winPtr) /* Tk's structure for an embedded window. */ { Container *containerPtr; @@ -484,8 +472,8 @@ TkMacOSXContainerId(winPtr) * * TkMacOSXGetHostToplevel -- * - * Given the TkWindow, return the MacDrawable for the outermost - * toplevel containing it. This will be a real Macintosh window. + * Given the TkWindow, return the MacDrawable for the outermost toplevel + * containing it. This will be a real Macintosh window. * * Results: * Returns a MacDrawable corresponding to a Macintosh Toplevel @@ -504,20 +492,18 @@ TkMacOSXGetHostToplevel( topWinPtr = winPtr->privatePtr->toplevel->winPtr; if (!Tk_IsEmbedded(topWinPtr)) { - return winPtr->privatePtr->toplevel; - } else { - contWinPtr = TkpGetOtherWindow(topWinPtr); + return winPtr->privatePtr->toplevel; + } + contWinPtr = TkpGetOtherWindow(topWinPtr); - /* - * TODO: Here we should handle out of process embedding. - */ + /* + * TODO: Here we should handle out of process embedding. + */ - if (contWinPtr != NULL) { - return TkMacOSXGetHostToplevel(contWinPtr); - } else { - return None; - } + if (contWinPtr == NULL) { + return None; } + return TkMacOSXGetHostToplevel(contWinPtr); } /* @@ -525,10 +511,10 @@ TkMacOSXGetHostToplevel( * * TkpClaimFocus -- * - * This procedure is invoked when someone asks for the input focus - * to be put on a window in an embedded application, but the - * application doesn't currently have the focus. It requests the - * input focus from the container application. + * This procedure is invoked when someone asks for the input focus to be + * put on a window in an embedded application, but the application + * doesn't currently have the focus. It requests the input focus from the + * container application. * * Results: * None. @@ -541,11 +527,11 @@ TkMacOSXGetHostToplevel( void TkpClaimFocus( - TkWindow *topLevelPtr, /* Top-level window containing desired - * focus window; should be embedded. */ - int force) /* One means that the container should - * claim the focus if it doesn't - * currently have it. */ + TkWindow *topLevelPtr, /* Top-level window containing desired focus + * window; should be embedded. */ + int force) /* One means that the container should claim + * the focus if it doesn't currently have + * it. */ { XEvent event; Container *containerPtr; @@ -560,7 +546,6 @@ TkpClaimFocus( /* Empty loop body. */ } - event.xfocus.type = FocusIn; event.xfocus.serial = LastKnownRequestProcessed(topLevelPtr->display); event.xfocus.send_event = 1; @@ -576,9 +561,8 @@ TkpClaimFocus( * * TkpTestembedCmd -- * - * This procedure implements the "testembed" command. It returns - * some or all of the information in the list pointed to by - * firstContainerPtr. + * This procedure implements the "testembed" command. It returns some or + * all of the information in the list pointed to by firstContainerPtr. * * Results: * A standard Tcl result. @@ -594,7 +578,7 @@ TkpTestembedCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int argc, /* Number of arguments. */ - CONST char **argv) /* Argument strings. */ + const char **argv) /* Argument strings. */ { int all; Container *containerPtr; @@ -612,13 +596,11 @@ TkpTestembedCmd( Tcl_DStringStartSublist(&dString); if (containerPtr->parent == None) { Tcl_DStringAppendElement(&dString, ""); + } else if (all) { + sprintf(buffer, "0x%x", (int) containerPtr->parent); + Tcl_DStringAppendElement(&dString, buffer); } else { - if (all) { - sprintf(buffer, "0x%x", (int) containerPtr->parent); - Tcl_DStringAppendElement(&dString, buffer); - } else { - Tcl_DStringAppendElement(&dString, "XXX"); - } + Tcl_DStringAppendElement(&dString, "XXX"); } if (containerPtr->parentPtr == NULL) { Tcl_DStringAppendElement(&dString, ""); @@ -628,13 +610,11 @@ TkpTestembedCmd( } if (containerPtr->embedded == None) { Tcl_DStringAppendElement(&dString, ""); + } else if (all) { + sprintf(buffer, "0x%x", (int) containerPtr->embedded); + Tcl_DStringAppendElement(&dString, buffer); } else { - if (all) { - sprintf(buffer, "0x%x", (int) containerPtr->embedded); - Tcl_DStringAppendElement(&dString, buffer); - } else { - Tcl_DStringAppendElement(&dString, "XXX"); - } + Tcl_DStringAppendElement(&dString, "XXX"); } if (containerPtr->embeddedPtr == NULL) { Tcl_DStringAppendElement(&dString, ""); @@ -653,13 +633,13 @@ TkpTestembedCmd( * * TkpRedirectKeyEvent -- * - * This procedure is invoked when a key press or release event - * arrives for an application that does not believe it owns the - * input focus. This can happen because of embedding; for example, - * X can send an event to an embedded application when the real - * focus window is in the container application and is an ancestor - * of the container. This procedure's job is to forward the event - * back to the application where it really belongs. + * This procedure is invoked when a key press or release event arrives + * for an application that does not believe it owns the input focus. This + * can happen because of embedding; for example, X can send an event to + * an embedded application when the real focus window is in the container + * application and is an ancestor of the container. This procedure's job + * is to forward the event back to the application where it really + * belongs. * * Results: * None. @@ -674,9 +654,10 @@ void TkpRedirectKeyEvent( TkWindow *winPtr, /* Window to which the event was originally * reported. */ - XEvent *eventPtr) /* X event to redirect (should be KeyPress - * or KeyRelease). */ + XEvent *eventPtr) /* X event to redirect (should be KeyPress or + * KeyRelease). */ { + /* TODO: Implement this or decide it definitely needs no implementation */ } /* @@ -684,13 +665,13 @@ TkpRedirectKeyEvent( * * TkpGetOtherWindow -- * - * If both the container and embedded window are in the same - * process, this procedure will return either one, given the other. + * If both the container and embedded window are in the same process, + * this procedure will return either one, given the other. * * Results: * If winPtr is a container, the return value is the token for the - * embedded window, and vice versa. If the "other" window isn't in - * this process, NULL is returned. + * embedded window, and vice versa. If the "other" window isn't in this + * process, NULL is returned. * * Side effects: * None. @@ -700,14 +681,14 @@ TkpRedirectKeyEvent( TkWindow * TkpGetOtherWindow( - TkWindow *winPtr) /* Tk's structure for a container or - * embedded window. */ + TkWindow *winPtr) /* Tk's structure for a container or embedded + * window. */ { Container *containerPtr; /* - * TkpGetOtherWindow returns NULL if both windows are not - * in the same process... + * TkpGetOtherWindow returns NULL if both windows are not in the same + * process... */ if (!(winPtr->flags & TK_BOTH_HALVES)) { @@ -749,7 +730,7 @@ EmbeddedEventProc( ClientData clientData, /* Token for container window. */ XEvent *eventPtr) /* ResizeRequest event. */ { - TkWindow *winPtr = (TkWindow *) clientData; + TkWindow *winPtr = clientData; if (eventPtr->type == DestroyNotify) { EmbedWindowDeleted(winPtr); @@ -762,19 +743,19 @@ EmbeddedEventProc( * ContainerEventProc -- * * This procedure is invoked by the Tk event dispatcher when various - * useful events are received for the children of a container - * window. It forwards relevant information, such as geometry - * requests, from the events into the container's application. + * useful events are received for the children of a container window. It + * forwards relevant information, such as geometry requests, from the + * events into the container's application. * - * NOTE: on the Mac, only the DestroyNotify branch is ever taken. - * We don't synthesize the other events. + * NOTE: on the Mac, only the DestroyNotify branch is ever taken. We + * don't synthesize the other events. * * Results: * None. * * Side effects: - * Depends on the event. For example, when ConfigureRequest events - * occur, geometry information gets set for the container window. + * Depends on the event. For example, when ConfigureRequest events occur, + * geometry information gets set for the container window. * *---------------------------------------------------------------------- */ @@ -784,18 +765,18 @@ ContainerEventProc( ClientData clientData, /* Token for container window. */ XEvent *eventPtr) /* ResizeRequest event. */ { - TkWindow *winPtr = (TkWindow *) clientData; + TkWindow *winPtr = clientData; Container *containerPtr; Tk_ErrorHandler errHandler; /* - * Ignore any X protocol errors that happen in this procedure - * (almost any operation could fail, for example, if the embedded - * application has deleted its window). + * Ignore any X protocol errors that happen in this procedure (almost any + * operation could fail, for example, if the embedded application has + * deleted its window). */ errHandler = Tk_CreateErrorHandler(eventPtr->xfocus.display, -1, - -1, -1, (Tk_ErrorProc *) NULL, (ClientData) NULL); + -1, -1, NULL, NULL); /* * Find the Container structure associated with the parent window. @@ -811,10 +792,9 @@ ContainerEventProc( if (eventPtr->type == CreateNotify) { /* - * A new child window has been created in the container. Record - * its id in the Container structure (if more than one child is - * created, just remember the last one and ignore the earlier - * ones). + * A new child window has been created in the container. Record its id + * in the Container structure (if more than one child is created, just + * remember the last one and ignore the earlier ones). */ containerPtr->embedded = eventPtr->xcreatewindow.window; @@ -822,14 +802,13 @@ ContainerEventProc( if ((eventPtr->xconfigurerequest.x != 0) || (eventPtr->xconfigurerequest.y != 0)) { /* - * The embedded application is trying to move itself, which - * isn't legal. At this point, the window hasn't actually - * moved, but we need to send it a ConfigureNotify event to - * let it know that its request has been denied. If the - * embedded application was also trying to resize itself, a - * ConfigureNotify will be sent by the geometry management - * code below, so we don't need to do anything. Otherwise, - * generate a synthetic event. + * The embedded application is trying to move itself, which isn't + * legal. At this point, the window hasn't actually moved, but we + * need to send it a ConfigureNotify event to let it know that its + * request has been denied. If the embedded application was also + * trying to resize itself, a ConfigureNotify will be sent by the + * geometry management code below, so we don't need to do + * anything. Otherwise, generate a synthetic event. */ if ((eventPtr->xconfigurerequest.width == winPtr->changes.width) @@ -844,8 +823,8 @@ ContainerEventProc( } else if (eventPtr->type == MapRequest) { /* * The embedded application's map request was ignored and simply - * passed on to us, so we have to map the window for it to appear - * on the screen. + * passed on to us, so we have to map the window for it to appear on + * the screen. */ XMapWindow(eventPtr->xmaprequest.display, @@ -865,11 +844,10 @@ ContainerEventProc( * * EmbedStructureProc -- * - * This procedure is invoked by the Tk event dispatcher when - * a container window owned by this application gets resized - * (and also at several other times that we don't care about). - * This procedure reflects the size change in the embedded - * window that corresponds to the container. + * This procedure is invoked by the Tk event dispatcher when a container + * window owned by this application gets resized (and also at several + * other times that we don't care about). This procedure reflects the + * size change in the embedded window that corresponds to the container. * * Results: * None. @@ -885,7 +863,7 @@ EmbedStructureProc( ClientData clientData, /* Token for container window. */ XEvent *eventPtr) /* ResizeRequest event. */ { - Container *containerPtr = (Container *) clientData; + Container *containerPtr = clientData; Tk_ErrorHandler errHandler; if (eventPtr->type == ConfigureNotify) { @@ -896,12 +874,10 @@ EmbedStructureProc( */ errHandler = Tk_CreateErrorHandler(eventPtr->xfocus.display, -1, - -1, -1, (Tk_ErrorProc *) NULL, (ClientData) NULL); + -1, -1, NULL, NULL); Tk_MoveResizeWindow((Tk_Window) containerPtr->embeddedPtr, 0, 0, - (unsigned int) Tk_Width( - (Tk_Window) containerPtr->parentPtr), - (unsigned int) Tk_Height( - (Tk_Window) containerPtr->parentPtr)); + (unsigned) Tk_Width((Tk_Window) containerPtr->parentPtr), + (unsigned) Tk_Height((Tk_Window)containerPtr->parentPtr)); Tk_DeleteErrorHandler(errHandler); } } else if (eventPtr->type == DestroyNotify) { @@ -914,10 +890,10 @@ EmbedStructureProc( * * EmbedActivateProc -- * - * This procedure is invoked by the Tk event dispatcher when - * Activate and Deactivate events occur for a container window owned - * by this application. It is responsible for forwarding an activate - * event down into the embedded toplevel. + * This procedure is invoked by the Tk event dispatcher when Activate and + * Deactivate events occur for a container window owned by this + * application. It is responsible for forwarding an activate event down + * into the embedded toplevel. * * Results: * None. @@ -933,7 +909,7 @@ EmbedActivateProc( ClientData clientData, /* Token for container window. */ XEvent *eventPtr) /* ResizeRequest event. */ { - Container *containerPtr = (Container *) clientData; + Container *containerPtr = clientData; if (containerPtr->embeddedPtr != NULL) { if (eventPtr->type == ActivateNotify) { @@ -949,11 +925,10 @@ EmbedActivateProc( * * EmbedFocusProc -- * - * This procedure is invoked by the Tk event dispatcher when - * FocusIn and FocusOut events occur for a container window owned - * by this application. It is responsible for moving the focus - * back and forth between a container application and an embedded - * application. + * This procedure is invoked by the Tk event dispatcher when FocusIn and + * FocusOut events occur for a container window owned by this + * application. It is responsible for moving the focus back and forth + * between a container application and an embedded application. * * Results: * None. @@ -969,37 +944,37 @@ EmbedFocusProc( ClientData clientData, /* Token for container window. */ XEvent *eventPtr) /* ResizeRequest event. */ { - Container *containerPtr = (Container *) clientData; + Container *containerPtr = clientData; Display *display; XEvent event; if (containerPtr->embeddedPtr != NULL) { - display = Tk_Display(containerPtr->parentPtr); + display = Tk_Display(containerPtr->parentPtr); event.xfocus.serial = LastKnownRequestProcessed(display); event.xfocus.send_event = false; event.xfocus.display = display; event.xfocus.mode = NotifyNormal; event.xfocus.window = containerPtr->embedded; - if (eventPtr->type == FocusIn) { - /* - * The focus just arrived at the container. Change the X focus - * to move it to the embedded application, if there is one. - * Ignore X errors that occur during this operation (it's - * possible that the new focus window isn't mapped). - */ + if (eventPtr->type == FocusIn) { + /* + * The focus just arrived at the container. Change the X focus to + * move it to the embedded application, if there is one. Ignore X + * errors that occur during this operation (it's possible that the + * new focus window isn't mapped). + */ event.xfocus.detail = NotifyNonlinear; event.xfocus.type = FocusIn; - } else if (eventPtr->type == FocusOut) { - /* When the container gets a FocusOut event, it has to tell the embedded app - * that it has lost the focus. - */ + /* + * When the container gets a FocusOut event, it has to tell the + * embedded app that it has lost the focus. + */ event.xfocus.type = FocusOut; event.xfocus.detail = NotifyNonlinear; - } + } Tk_QueueWindowEvent(&event, TCL_QUEUE_MARK); } @@ -1010,10 +985,10 @@ EmbedFocusProc( * * EmbedGeometryRequest -- * - * This procedure is invoked when an embedded application requests - * a particular size. It processes the request (which may or may - * not actually honor the request) and reflects the results back - * to the embedded application. + * This procedure is invoked when an embedded application requests a + * particular size. It processes the request (which may or may not + * actually honor the request) and reflects the results back to the + * embedded application. * * NOTE: On the Mac, this is a stub, since we don't synthesize * ConfigureRequest events. @@ -1022,10 +997,10 @@ EmbedFocusProc( * None. * * Side effects: - * If we deny the child's size change request, a Configure event - * is synthesized to let the child know how big it ought to be. - * Events get processed while we're waiting for the geometry - * managers to do their thing. + * If we deny the child's size change request, a Configure event is + * synthesized to let the child know how big it ought to be. Events get + * processed while we're waiting for the geometry managers to do their + * thing. * *---------------------------------------------------------------------- */ @@ -1038,13 +1013,13 @@ EmbedGeometryRequest( TkWindow *winPtr = containerPtr->parentPtr; /* - * Forward the requested size into our geometry management hierarchy - * via the container window. We need to send a Configure event back - * to the embedded application if we decide not to honor its - * request; to make this happen, process all idle event handlers - * synchronously here (so that the geometry managers have had a - * chance to do whatever they want to do), and if the window's size - * didn't change then generate a configure event. + * Forward the requested size into our geometry management hierarchy via + * the container window. We need to send a Configure event back to the + * embedded application if we decide not to honor its request; to make + * this happen, process all idle event handlers synchronously here (so + * that the geometry managers have had a chance to do whatever they want + * to do), and if the window's size didn't change then generate a + * configure event. */ Tk_GeometryRequest((Tk_Window) winPtr, width, height); @@ -1062,13 +1037,12 @@ EmbedGeometryRequest( * * EmbedSendConfigure -- * - * This is currently a stub. It is called to notify an - * embedded application of its current size and location. This - * procedure is called when the embedded application made a - * geometry request that we did not grant, so that the embedded - * application knows that its geometry didn't change after all. - * It is a response to ConfigureRequest events, which we do not - * currently synthesize on the Mac + * This is currently a stub. It is called to notify an embedded + * application of its current size and location. This procedure is called + * when the embedded application made a geometry request that we did not + * grant, so that the embedded application knows that its geometry didn't + * change after all. It is a response to ConfigureRequest events, which + * we do not currently synthesize on the Mac * * Results: * None. @@ -1090,9 +1064,9 @@ EmbedSendConfigure( * * EmbedWindowDeleted -- * - * This procedure is invoked when a window involved in embedding - * (as either the container or the embedded application) is - * destroyed. It cleans up the Container structure for the window. + * This procedure is invoked when a window involved in embedding (as + * either the container or the embedded application) is destroyed. It + * cleans up the Container structure for the window. * * Results: * None. @@ -1111,16 +1085,14 @@ EmbedWindowDeleted( Container *containerPtr, *prevPtr; /* - * Find the Container structure for this window. Delete the - * information about the embedded application and free the container's - * record. + * Find the Container structure for this window. Delete the information + * about the embedded application and free the container's record. */ prevPtr = NULL; containerPtr = firstContainerPtr; while (1) { if (containerPtr->embeddedPtr == winPtr) { - /* * We also have to destroy our parent, to clean up the container. * Fabricate an event to do this. @@ -1131,20 +1103,18 @@ EmbedWindowDeleted( XEvent event; event.xany.serial = - Tk_Display(containerPtr->parentPtr)->request; - event.xany.send_event = False; - event.xany.display = Tk_Display(containerPtr->parentPtr); - - event.xany.type = DestroyNotify; - event.xany.window = containerPtr->parent; - event.xdestroywindow.event = containerPtr->parent; - Tk_QueueWindowEvent(&event, TCL_QUEUE_HEAD); - + Tk_Display(containerPtr->parentPtr)->request; + event.xany.send_event = False; + event.xany.display = Tk_Display(containerPtr->parentPtr); + + event.xany.type = DestroyNotify; + event.xany.window = containerPtr->parent; + event.xdestroywindow.event = containerPtr->parent; + Tk_QueueWindowEvent(&event, TCL_QUEUE_HEAD); } containerPtr->embedded = None; containerPtr->embeddedPtr = NULL; - break; } if (containerPtr->parentPtr == winPtr) { diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c index 59418f5..fdaf9aa 100644 --- a/macosx/tkMacOSXInit.c +++ b/macosx/tkMacOSXInit.c @@ -8,10 +8,10 @@ * Copyright 2001, Apple Computer, Inc. * Copyright (c) 2005-2007 Daniel A. Steffen * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * See the file "license.terms" for information on usage and redistribution of + * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXInit.c,v 1.34 2007/12/13 15:27:09 dgp Exp $ + * RCS: @(#) $Id: tkMacOSXInit.c,v 1.35 2008/04/27 22:39:12 dkf Exp $ */ #include "tkMacOSXPrivate.h" @@ -24,19 +24,20 @@ #include /* - * Define the following to 0 to not attempt to use an undocumented SPI - * to notify the window server that an unbundled executable is a full - * GUI application after loading Tk. + * Define the following to 0 to not attempt to use an undocumented SPI to + * notify the window server that an unbundled executable is a full GUI + * application after loading Tk. */ + #ifndef MAC_OSX_TK_USE_CPS_SPI #define MAC_OSX_TK_USE_CPS_SPI 1 #endif /* * The following structures are used to map the script/language codes of a - * font to the name that should be passed to Tcl_GetEncoding() to obtain - * the encoding for that font. The set of numeric constants is fixed and - * defined by Apple. + * font to the name that should be passed to Tcl_GetEncoding() to obtain the + * encoding for that font. The set of numeric constants is fixed and defined + * by Apple. */ typedef struct Map { @@ -83,13 +84,13 @@ static Map scriptMap[] = { Tcl_Encoding TkMacOSXCarbonEncoding = NULL; /* - * If the App is in an App package, then we want to add the Scripts - * directory to the auto_path. + * If the App is in an App package, then we want to add the Scripts directory + * to the auto_path. */ + static char scriptPath[PATH_MAX + 1] = ""; float tkMacOSXToolboxVersionNumber = 0; - /* *---------------------------------------------------------------------- @@ -100,8 +101,8 @@ float tkMacOSXToolboxVersionNumber = 0; * tk_library variable. * * Results: - * Returns a standard Tcl result. Leaves an error message or result - * in the interp's result. + * Returns a standard Tcl result. Leaves an error message or result in + * the interp's result. * * Side effects: * Sets "tk_library" Tcl variable, runs "tk.tcl" script. @@ -119,9 +120,9 @@ TkpInit( Tk_MacOSXSetupTkNotifier(); /* - * Since it is possible for TkInit to be called multiple times - * and we don't want to do the following initialization multiple times - * we protect against doing it more than once. + * Since it is possible for TkInit to be called multiple times and we + * don't want to do the following initialization multiple times we protect + * against doing it more than once. */ if (!initialized) { @@ -130,7 +131,7 @@ TkpInit( CFURLRef bundleUrl = NULL; CFStringEncoding encoding; const char *encodingStr = NULL; - int i; + int i; struct utsname name; long osVersion = 0; @@ -145,7 +146,7 @@ TkpInit( } if (osVersion && osVersion < (MAC_OS_X_VERSION_MIN_REQUIRED-1000)/10) { Tcl_Panic("Mac OS X 10.%d or later required !", - (MAC_OS_X_VERSION_MIN_REQUIRED-1000)/10); + (MAC_OS_X_VERSION_MIN_REQUIRED-1000)/10); } TK_IF_MAC_OS_X_API (3, &kHIToolboxVersionNumber, tkMacOSXToolboxVersionNumber = kHIToolboxVersionNumber; @@ -174,7 +175,7 @@ TkpInit( "com.tcltk.tklibrary", TK_FRAMEWORK_VERSION, 1, PATH_MAX, tkLibPath) != TCL_OK) #endif - { + { /* Tk.framework not found, check if resource file is open */ Handle rsrc = Get1NamedResource('CURS', "\phand"); if (rsrc) { @@ -194,7 +195,7 @@ TkpInit( image = _dyld_get_image_header(i); if (image) { data = getsectdatafromheader(image, SEG_TEXT, - "__tk_rsrc", (void*)&size); + "__tk_rsrc", (void *) &size); if (data) { data += _dyld_get_image_vmaddr_slide(i); break; @@ -222,7 +223,7 @@ TkpInit( if (write(fd, data, size) == -1) { break; } - if(ChkErr(FSPathMakeRef, (unsigned char*)fileName, &ref, + if(ChkErr(FSPathMakeRef, (unsigned char *) fileName, &ref, NULL) != noErr) { break; } @@ -260,11 +261,14 @@ TkpInit( * executable's url and compare the resulting url with the main * bundle url. */ + int j = 3; CFURLRef url = CFBundleCopyExecutableURL(bundleRef); + while (url && j--) { - CFURLRef parent = CFURLCreateCopyDeletingLastPathComponent(NULL, - url); + CFURLRef parent = + CFURLCreateCopyDeletingLastPathComponent(NULL, url); + CFRelease(url); url = parent; } @@ -275,8 +279,11 @@ TkpInit( CFRelease(bundleUrl); } - /* If we are not a bundled executable, notify the window server that - * we are a foregroundable app. */ + /* + * If we are not a bundled executable, notify the window server that + * we are a foregroundable app. + */ + if (!bundledExecutable) { OSStatus err = procNotFound; ProcessSerialNumber psn = { 0, kCurrentProcess }; @@ -293,6 +300,7 @@ TkpInit( * server. Load the SPI symbol dynamically, so that we don't * break if it ever disappears or changes its name. */ + TkMacOSXInitNamedSymbol(CoreGraphics, OSStatus, CPSEnableForegroundOperation, ProcessSerialNumberPtr); if (CPSEnableForegroundOperation) { @@ -327,8 +335,8 @@ TkpInit( } /* - * FIXME: Close stdin & stdout for remote debugging otherwise we - * will fight with gdb for stdin & stdout + * FIXME: Close stdin & stdout for remote debugging otherwise we will + * fight with gdb for stdin & stdout */ if (getenv("XCNOSTDIN") != NULL) { @@ -389,9 +397,9 @@ TkpInit( * * TkpGetAppName -- * - * Retrieves the name of the current application from a platform - * specific location. For Unix, the application name is the tail - * of the path contained in the tcl variable argv0. + * Retrieves the name of the current application from a platform specific + * location. For Unix, the application name is the tail of the path + * contained in the tcl variable argv0. * * Results: * Returns the application name in the given Tcl_DString. @@ -426,8 +434,8 @@ TkpGetAppName( * * TkpDisplayWarning -- * - * This routines is called from Tk_Main to display warning - * messages that occur during startup. + * This routines is called from Tk_Main to display warning messages that + * occur during startup. * * Results: * None. @@ -440,10 +448,11 @@ TkpGetAppName( void TkpDisplayWarning( - CONST char *msg, /* Message to be displayed. */ - CONST char *title) /* Title of warning. */ + const char *msg, /* Message to be displayed. */ + const char *title) /* Title of warning. */ { Tcl_Channel errChannel = Tcl_GetStdChannel(TCL_STDERR); + if (errChannel) { Tcl_WriteChars(errChannel, title, -1); Tcl_WriteChars(errChannel, ": ", 2); @@ -457,13 +466,11 @@ TkpDisplayWarning( * * TkMacOSXDefaultStartupScript -- * - * - * On MacOS X, we look for a file in the Resources/Scripts - * directory called AppMain.tcl and if found, we set argv[1] to - * that, so that the rest of the code will find it, and add the - * Scripts folder to the auto_path. If we don't find the startup - * script, we just bag it, assuming the user is starting up some - * other way. + * On MacOS X, we look for a file in the Resources/Scripts directory + * called AppMain.tcl and if found, we set argv[1] to that, so that the + * rest of the code will find it, and add the Scripts folder to the + * auto_path. If we don't find the startup script, we just bag it, + * assuming the user is starting up some other way. * * Results: * None. @@ -482,24 +489,21 @@ TkMacOSXDefaultStartupScript(void) bundleRef = CFBundleGetMainBundle(); if (bundleRef != NULL) { - CFURLRef appMainURL; - appMainURL = CFBundleCopyResourceURL(bundleRef, - CFSTR("AppMain"), - CFSTR("tcl"), - CFSTR("Scripts")); + CFURLRef appMainURL = CFBundleCopyResourceURL(bundleRef, + CFSTR("AppMain"), CFSTR("tcl"), CFSTR("Scripts")); if (appMainURL != NULL) { CFURLRef scriptFldrURL; char startupScript[PATH_MAX + 1]; if (CFURLGetFileSystemRepresentation (appMainURL, true, - (unsigned char*) startupScript, PATH_MAX)) { - Tcl_SetStartupScript(Tcl_NewStringObj(startupScript, -1), NULL); - scriptFldrURL = CFURLCreateCopyDeletingLastPathComponent( - NULL, appMainURL); + (unsigned char *) startupScript, PATH_MAX)) { + Tcl_SetStartupScript(Tcl_NewStringObj(startupScript,-1), NULL); + scriptFldrURL = CFURLCreateCopyDeletingLastPathComponent(NULL, + appMainURL); if (scriptFldrURL != NULL) { - CFURLGetFileSystemRepresentation(scriptFldrURL, - true, (unsigned char*) scriptPath, PATH_MAX); + CFURLGetFileSystemRepresentation(scriptFldrURL, true, + (unsigned char *) scriptPath, PATH_MAX); CFRelease(scriptFldrURL); } } @@ -513,11 +517,9 @@ TkMacOSXDefaultStartupScript(void) * * TkMacOSXGetNamedSymbol -- * - * - * Dynamically acquire address of a named symbol from a loaded - * dynamic library, so that we can use API that may not be - * available on all OS versions. - * If module is non-NULL and not the empty string, use twolevel + * Dynamically acquire address of a named symbol from a loaded dynamic + * library, so that we can use API that may not be available on all OS + * versions. If module is non-NULL and not the empty string, use twolevel * namespace lookup. * * Results: @@ -535,18 +537,19 @@ TkMacOSXGetNamedSymbol( const char* symbol) { NSSymbol nsSymbol = NULL; + if (module && *module) { - if(NSIsSymbolNameDefinedWithHint(symbol, module)) { + if (NSIsSymbolNameDefinedWithHint(symbol, module)) { nsSymbol = NSLookupAndBindSymbolWithHint(symbol, module); } } else { - if(NSIsSymbolNameDefined(symbol)) { + if (NSIsSymbolNameDefined(symbol)) { nsSymbol = NSLookupAndBindSymbol(symbol); } } - if (nsSymbol) { - return NSAddressOfSymbol(nsSymbol); - } else { + + if (!nsSymbol) { return NULL; } + return NSAddressOfSymbol(nsSymbol); } diff --git a/macosx/tkMacOSXSend.c b/macosx/tkMacOSXSend.c index c65833b..50526d3 100644 --- a/macosx/tkMacOSXSend.c +++ b/macosx/tkMacOSXSend.c @@ -1,175 +1,171 @@ /* * tkMacOSXSend.c -- * - * This file provides procedures that implement the "send" - * command, allowing commands to be passed from interpreter - * to interpreter. This current implementation for the Mac - * has most functionality stubed out. - * - * The current plan, which we have not had time to implement, is - * for the first Wish app to create a gestalt of type 'WIsH'. - * This gestalt will point to a table, in system memory, of - * Tk apps. Each Tk app, when it starts up, will register their - * name, and process ID, in this table. This will allow us to - * implement "tk appname". - * - * Then the send command will look up the process id of the target - * app in this table, and send an AppleEvent to that process. The - * AppleEvent handler is much like the do script handler, except that - * you have to specify the name of the tk app as well, since there may - * be many interps in one wish app, and you need to send it to the - * right one. - * - * Implementing this has been on our list of things to do, but what - * with the demise of Tcl at Sun, and the lack of resources at - * Scriptics it may not get done for awhile. So this sketch is - * offered for the brave to attempt if they need the functionality... + * This file provides procedures that implement the "send" command, + * allowing commands to be passed from interpreter to interpreter. This + * current implementation for the Mac has most functionality stubed out. + * + * The current plan, which we have not had time to implement, is for the + * first Wish app to create a gestalt of type 'WIsH'. This gestalt will + * point to a table, in system memory, of Tk apps. Each Tk app, when it + * starts up, will register their name, and process ID, in this table. + * This will allow us to implement "tk appname". + * + * Then the send command will look up the process id of the target app in + * this table, and send an AppleEvent to that process. The AppleEvent + * handler is much like the do script handler, except that you have to + * specify the name of the tk app as well, since there may be many + * interps in one wish app, and you need to send it to the right one. + * + * Implementing this has been on our list of things to do, but what with + * the demise of Tcl at Sun, and the lack of resources at Scriptics it + * may not get done for awhile. So this sketch is offered for the brave + * to attempt if they need the functionality... * * Copyright (c) 1989-1994 The Regents of the University of California. * Copyright (c) 1994-1998 Sun Microsystems, Inc. * Copyright 2001, Apple Computer, Inc. * Copyright (c) 2005-2007 Daniel A. Steffen * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * See the file "license.terms" for information on usage and redistribution of + * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXSend.c,v 1.8 2007/12/13 15:27:10 dgp Exp $ + * RCS: @(#) $Id: tkMacOSXSend.c,v 1.9 2008/04/27 22:39:12 dkf Exp $ */ #include "tkMacOSXInt.h" /* - * The following structure is used to keep track of the - * interpreters registered by this process. + * 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. */ + Tcl_Interp *interp; /* Interpreter associated with name. */ struct RegisteredInterp *nextPtr; - /* Next in list of names associated - * with interps in this process. - * NULL means end of list. */ + /* Next in list of names associated with + * interps in this process. NULL means end of + * list. */ } RegisteredInterp; /* - * 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 + * 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". + * 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: + * 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. */ + 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. */ + 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; -static int initialized = false; /* A flag to denote if we have initialized yet. */ +static int initialized = false; /* A flag to denote if we have initialized + * yet. */ static RegisteredInterp *interpListPtr = NULL; -/* List of all interpreters - * registered by this process. */ - - /* - * 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. - */ - - /* - * Maximum size property that can be read at one time by - * this module: - */ + /* List of all interpreters registered by this + * process. */ + +/* + * 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. + */ + +/* + * Maximum size property that can be read at one time by this module: + */ #define MAX_PROP_WORDS 100000 @@ -178,7 +174,6 @@ static RegisteredInterp *interpListPtr = NULL; */ static int SendInit(Tcl_Interp *interp); - /* *-------------------------------------------------------------- @@ -186,34 +181,33 @@ static int SendInit(Tcl_Interp *interp); * 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. + * 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. + * 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. + * 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. * *-------------------------------------------------------------- */ -CONST char * +const char * Tk_SetAppName( - Tk_Window tkwin, /* Token for any window in the application - * to be named: it is just used to identify - * the application and the display. */ - CONST char *name) /* The name that will be used to - * refer to the interpreter in later - * "send" commands. Must be globally - * unique. */ + Tk_Window tkwin, /* Token for any window in the application to + * be named: it is just used to identify the + * application and the display. */ + const char *name) /* The name that will be used to refer to the + * interpreter in later "send" commands. Must + * be globally unique. */ { TkWindow *winPtr = (TkWindow *) tkwin; Tcl_Interp *interp = winPtr->mainPtr->interp; @@ -229,9 +223,9 @@ Tk_SetAppName( } /* - * See if the application is already registered; if so, remove its - * current name from the registry. The deletion of the command - * will take care of disposing of this entry. + * See if the application is already registered; if so, remove its current + * name from the registry. The deletion of the command will take care of + * disposing of this entry. */ for (riPtr = interpListPtr, prevPtr = NULL; riPtr != NULL; @@ -247,10 +241,9 @@ Tk_SetAppName( } /* - * 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. + * 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; @@ -301,8 +294,7 @@ Tk_SetAppName( * TODO: DeleteProc */ - Tcl_CreateObjCommand(interp, "send", Tk_SendObjCmd, - (ClientData) riPtr, NULL); + Tcl_CreateObjCommand(interp, "send", Tk_SendObjCmd, riPtr, NULL); if (Tcl_IsSafe(interp)) { Tcl_HideCommand(interp, "send", "send"); } @@ -316,8 +308,8 @@ Tk_SetAppName( * * Tk_SendObjCmd -- * - * This procedure is invoked to process the "send" Tcl command. - * See the user documentation for details on what it does. + * 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. @@ -333,7 +325,7 @@ Tk_SendObjCmd( ClientData clientData, /* Used only for deletion */ Tcl_Interp *interp, /* The interp we are sending from */ int objc, /* Number of arguments */ - Tcl_Obj *CONST objv[]) /* The arguments */ + Tcl_Obj *const objv[]) /* The arguments */ { const char *sendOptions[] = {"-async", "-displayof", "-", NULL}; char *stringRep, *destName; @@ -375,11 +367,10 @@ Tk_SendObjCmd( resultPtr = Tcl_GetObjResult(interp); /* - * See if the target interpreter is local. If so, execute - * the command directly without going through the DDE server. - * The only tricky thing is passing the result from the target - * interpreter to the invoking interpreter. Watch out: they - * could be the same! + * See if the target interpreter is local. If so, execute the command + * directly without going through the DDE 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 = interpListPtr; (riPtr != NULL) @@ -387,29 +378,29 @@ Tk_SendObjCmd( /* * Empty loop body. */ - } if (riPtr != NULL) { /* - * This command is to a local interp. No need to go through - * the server. + * This command is to a local interp. No need to go through the + * server. */ Tcl_Interp *localInterp; - Tcl_Preserve((ClientData) riPtr); + Tcl_Preserve(riPtr); localInterp = riPtr->interp; - Tcl_Preserve((ClientData) localInterp); + Tcl_Preserve(localInterp); if (firstArg == (objc - 1)) { /* - * This might be one of those cases where the new - * parser is faster. + * This might be one of those cases where the new parser is + * faster. */ - result = Tcl_EvalObjEx(localInterp, objv[firstArg], TCL_EVAL_DIRECT); + result = Tcl_EvalObjEx(localInterp, objv[firstArg], + TCL_EVAL_DIRECT); } else { - listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL); + listObjPtr = Tcl_NewListObj(0, NULL); for (i = firstArg; i < objc; i++) { Tcl_ListObjAppendList(interp, listObjPtr, objv[i]); } @@ -425,9 +416,9 @@ Tk_SendObjCmd( * 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_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); @@ -439,12 +430,12 @@ Tk_SendObjCmd( } Tcl_SetObjResult(interp, Tcl_GetObjResult(localInterp)); } - Tcl_Release((ClientData) riPtr); - Tcl_Release((ClientData) localInterp); + Tcl_Release(riPtr); + Tcl_Release(localInterp); } else { /* - * TODO: This is a non-local request. Send the script to the server and - * poll it for a result. + * TODO: This is a non-local request. Send the script to the server + * and poll it for a result. */ } @@ -456,15 +447,14 @@ Tk_SendObjCmd( * * TkGetInterpNames -- * - * This procedure is invoked to fetch a list of all the - * interpreter names currently registered for the display - * of a particular window. + * 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. + * 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. @@ -475,13 +465,13 @@ Tk_SendObjCmd( int TkGetInterpNames( Tcl_Interp *interp, /* Interpreter for returning a result. */ - Tk_Window tkwin) /* Window whose display is to be used - * for the lookup. */ + Tk_Window tkwin) /* Window whose display is to be used for the + * lookup. */ { Tcl_Obj *listObjPtr; RegisteredInterp *riPtr; - listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL); + listObjPtr = Tcl_NewListObj(0, NULL); riPtr = interpListPtr; while (riPtr != NULL) { Tcl_ListObjAppendElement(interp, listObjPtr, @@ -498,9 +488,8 @@ TkGetInterpNames( * * SendInit -- * - * This procedure is called to initialize the - * communication channels for sending commands and - * receiving results. + * This procedure is called to initialize the communication channels for + * sending commands and receiving results. * * Results: * None. @@ -513,8 +502,8 @@ TkGetInterpNames( static int SendInit( - Tcl_Interp *interp) /* Interpreter to use for error reporting - * (no errors are ever returned, but the + Tcl_Interp *interp) /* Interpreter to use for error reporting (no + * errors are ever returned, but the * interpreter is needed anyway). */ { return TCL_OK; diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 7fbde07..688d8ed 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -2,18 +2,18 @@ * tkMacOSXWm.c -- * * This module takes care of the interactions between a Tk-based - * application and the window manager. Among other things, it - * implements the "wm" command and passes geometry information - * to the window manager. + * application and the window manager. Among other things, it implements + * the "wm" command and passes geometry information to the window + * manager. * * Copyright (c) 1994-1997 Sun Microsystems, Inc. * Copyright 2001, Apple Computer, Inc. * Copyright (c) 2006-2007 Daniel A. Steffen * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * See the file "license.terms" for information on usage and redistribution of + * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXWm.c,v 1.63 2007/12/13 15:27:10 dgp Exp $ + * RCS: @(#) $Id: tkMacOSXWm.c,v 1.64 2008/04/27 22:39:12 dkf Exp $ */ #include "tkMacOSXPrivate.h" @@ -52,25 +52,24 @@ static const char *WmAttributeNames[] = { TkMacOSXWindowList *tkMacOSXWindowListPtr = NULL; /* - * The variable below is used to enable or disable tracing in this - * module. If tracing is enabled, then information is printed on - * standard output about interesting interactions with the window - * manager. + * The variable below is used to enable or disable tracing in this module. If + * tracing is enabled, then information is printed on standard output about + * interesting interactions with the window manager. */ static int wmTracing = 0; /* - * The following structure is the official type record for geometry - * management of top-level windows. + * The following structure is the official type record for geometry management + * of top-level windows. */ static void TopLevelReqProc(ClientData dummy, Tk_Window tkwin); static const Tk_GeomMgr wmMgrType = { - "wm", /* name */ - TopLevelReqProc, /* requestProc */ - (Tk_GeomLostSlaveProc *) NULL, /* lostSlaveProc */ + "wm", /* name */ + TopLevelReqProc, /* requestProc */ + NULL, /* lostSlaveProc */ }; /* @@ -174,16 +173,14 @@ static WindowGroupRef WmGetWindowGroup(TkWindow *winPtr); static void GetMinSize(TkWindow *winPtr, int *minWidthPtr, int *minHeightPtr); static void GetMaxSize(TkWindow *winPtr, int *maxWidthPtr, int *maxHeightPtr); static void RemapWindows(TkWindow *winPtr, MacDrawable *parentWin); - /* *---------------------------------------------------------------------- * * TkWmNewWindow -- * - * This procedure is invoked whenever a new top-level - * window is created. Its job is to initialize the WmInfo - * structure for the window. + * This procedure is invoked whenever a new top-level window is created. + * Its job is to initialize the WmInfo structure for the window. * * Results: * None. @@ -198,9 +195,8 @@ void TkWmNewWindow( TkWindow *winPtr) /* Newly-created top-level window. */ { - WmInfo *wmPtr; + WmInfo *wmPtr = (WmInfo *) ckalloc(sizeof(WmInfo)); - wmPtr = (WmInfo *) ckalloc(sizeof(WmInfo)); wmPtr->winPtr = winPtr; wmPtr->reparent = None; wmPtr->titleUid = NULL; @@ -233,9 +229,9 @@ TkWmNewWindow( wmPtr->x = winPtr->changes.x; wmPtr->y = winPtr->changes.y; wmPtr->parentWidth = winPtr->changes.width - + 2*winPtr->changes.border_width; + + 2*winPtr->changes.border_width; wmPtr->parentHeight = winPtr->changes.height - + 2*winPtr->changes.border_width; + + 2*winPtr->changes.border_width; wmPtr->xInParent = 0; wmPtr->yInParent = 0; wmPtr->cmapList = NULL; @@ -259,16 +255,16 @@ TkWmNewWindow( UpdateVRootGeometry(wmPtr); /* - * Tk must monitor structure events for top-level windows, in order - * to detect size and position changes caused by window managers. + * Tk must monitor structure events for top-level windows, in order to + * detect size and position changes caused by window managers. */ Tk_CreateEventHandler((Tk_Window) winPtr, StructureNotifyMask, - TopLevelEventProc, (ClientData) winPtr); + TopLevelEventProc, winPtr); /* - * Arrange for geometry requests to be reflected from the window - * to the window manager. + * Arrange for geometry requests to be reflected from the window to the + * window manager. */ Tk_ManageGeometry((Tk_Window) winPtr, &wmMgrType, (ClientData) 0); @@ -279,28 +275,28 @@ TkWmNewWindow( * * TkWmMapWindow -- * - * This procedure is invoked to map a top-level window. This - * module gets a chance to update all window-manager-related - * information in properties before the window manager sees - * the map event and checks the properties. It also gets to - * decide whether or not to even map the window after all. + * This procedure is invoked to map a top-level window. This module gets + * a chance to update all window-manager-related information in + * properties before the window manager sees the map event and checks the + * properties. It also gets to decide whether or not to even map the + * window after all. * * Results: * None. * * Side effects: - * Properties of winPtr may get updated to provide up-to-date - * information to the window manager. The window may also get - * mapped, but it may not be if this procedure decides that - * isn't appropriate (e.g. because the window is withdrawn). + * Properties of winPtr may get updated to provide up-to-date information + * to the window manager. The window may also get mapped, but it may not + * be if this procedure decides that isn't appropriate (e.g. because the + * window is withdrawn). * *---------------------------------------------------------------------- */ void TkWmMapWindow( - TkWindow *winPtr) /* Top-level window that's about to - * be mapped. */ + TkWindow *winPtr) /* Top-level window that's about to be + * mapped. */ { WmInfo *wmPtr = winPtr->wmInfoPtr; @@ -310,6 +306,7 @@ TkWmMapWindow( /* * Create the underlying Mac window for this Tk window. */ + if (!TkMacOSXHostToplevelExists(winPtr)) { TkMacOSXMakeRealWindowExist(winPtr); } @@ -321,9 +318,8 @@ TkWmMapWindow( TK_LOCATION_CHANGED); /* - * This is the first time this window has ever been mapped. - * Store all the window-manager-related information for the - * window. + * This is the first time this window has ever been mapped. Store all + * the window-manager-related information for the window. */ if (wmPtr->titleUid == NULL) { @@ -357,11 +353,12 @@ TkWmMapWindow( /* * Update geometry information. */ + wmPtr->flags |= WM_ABOUT_TO_MAP; if (wmPtr->flags & WM_UPDATE_PENDING) { - Tk_CancelIdleCall(UpdateGeometryInfo, (ClientData) winPtr); + Tk_CancelIdleCall(UpdateGeometryInfo, winPtr); } - UpdateGeometryInfo((ClientData) winPtr); + UpdateGeometryInfo(winPtr); wmPtr->flags &= ~WM_ABOUT_TO_MAP; /* @@ -376,8 +373,8 @@ TkWmMapWindow( * * TkWmUnmapWindow -- * - * This procedure is invoked to unmap a top-level window. - * On the Macintosh all we do is call XUnmapWindow. + * This procedure is invoked to unmap a top-level window. On the + * Macintosh all we do is call XUnmapWindow. * * Results: * None. @@ -390,8 +387,8 @@ TkWmMapWindow( void TkWmUnmapWindow( - TkWindow *winPtr) /* Top-level window that's about to - * be mapped. */ + TkWindow *winPtr) /* Top-level window that's about to be + * mapped. */ { XUnmapWindow(winPtr->display, winPtr->window); } @@ -401,9 +398,8 @@ TkWmUnmapWindow( * * TkWmDeadWindow -- * - * This procedure is invoked when a top-level window is - * about to be deleted. It cleans up the wm-related data - * structures for the window. + * This procedure is invoked when a top-level window is about to be + * deleted. It cleans up the wm-related data structures for the window. * * Results: * None. @@ -450,7 +446,7 @@ TkWmDeadWindow( protPtr = wmPtr->protPtr; wmPtr->protPtr = protPtr->nextPtr; - Tcl_EventuallyFree((ClientData) protPtr, TCL_DYNAMIC); + Tcl_EventuallyFree(protPtr, TCL_DYNAMIC); } if (wmPtr->cmdArgv != NULL) { ckfree((char *) wmPtr->cmdArgv); @@ -459,7 +455,7 @@ TkWmDeadWindow( ckfree((char *) wmPtr->clientMachine); } if (wmPtr->flags & WM_UPDATE_PENDING) { - Tk_CancelIdleCall(UpdateGeometryInfo, (ClientData) winPtr); + Tk_CancelIdleCall(UpdateGeometryInfo, winPtr); } ckfree((char *) wmPtr); winPtr->wmInfoPtr = NULL; @@ -470,11 +466,10 @@ TkWmDeadWindow( * * TkWmSetClass -- * - * This procedure is invoked whenever a top-level window's - * class is changed. If the window has been mapped then this - * procedure updates the window manager property for the - * class. If the window hasn't been mapped, the update is - * deferred until just before the first mapping. + * This procedure is invoked whenever a top-level window's class is + * changed. If the window has been mapped then this procedure updates the + * window manager property for the class. If the window hasn't been + * mapped, the update is deferred until just before the first mapping. * * Results: * None. @@ -497,8 +492,8 @@ TkWmSetClass( * * Tk_WmObjCmd -- * - * This procedure is invoked to process the "wm" Tcl command. - * See the user documentation for details on what it does. + * This procedure is invoked to process the "wm" Tcl command. See the + * user documentation for details on what it does. * * Results: * A standard Tcl result. @@ -543,7 +538,7 @@ Tk_WmObjCmd( TkWindow *winPtr; if (objc < 2) { -wrongNumArgs: + wrongNumArgs: Tcl_WrongNumArgs(interp, 1, objv, "option window ?arg ...?"); return TCL_ERROR; } @@ -563,7 +558,7 @@ wrongNumArgs: } if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0, - &index) != TCL_OK) { + &index) != TCL_OK) { return TCL_ERROR; } @@ -576,78 +571,77 @@ wrongNumArgs: return TCL_ERROR; } if (!Tk_IsTopLevel(winPtr) - && (index != WMOPT_MANAGE) && (index != WMOPT_FORGET) - ) { + && (index != WMOPT_MANAGE) && (index != WMOPT_FORGET)) { Tcl_AppendResult(interp, "window \"", winPtr->pathName, "\" isn't a top-level window", NULL); return TCL_ERROR; } switch ((enum options) index) { - case WMOPT_ASPECT: - return WmAspectCmd(tkwin, winPtr, interp, objc, objv); - case WMOPT_ATTRIBUTES: - return WmAttributesCmd(tkwin, winPtr, interp, objc, objv); - case WMOPT_CLIENT: - return WmClientCmd(tkwin, winPtr, interp, objc, objv); - case WMOPT_COLORMAPWINDOWS: - return WmColormapwindowsCmd(tkwin, winPtr, interp, objc, objv); - case WMOPT_COMMAND: - return WmCommandCmd(tkwin, winPtr, interp, objc, objv); - case WMOPT_DEICONIFY: - return WmDeiconifyCmd(tkwin, winPtr, interp, objc, objv); - case WMOPT_FOCUSMODEL: - return WmFocusmodelCmd(tkwin, winPtr, interp, objc, objv); - case WMOPT_FORGET: - return WmForgetCmd(tkwin, winPtr, interp, objc, objv); - case WMOPT_FRAME: - return WmFrameCmd(tkwin, winPtr, interp, objc, objv); - case WMOPT_GEOMETRY: - return WmGeometryCmd(tkwin, winPtr, interp, objc, objv); - case WMOPT_GRID: - return WmGridCmd(tkwin, winPtr, interp, objc, objv); - case WMOPT_GROUP: - return WmGroupCmd(tkwin, winPtr, interp, objc, objv); - case WMOPT_ICONBITMAP: - return WmIconbitmapCmd(tkwin, winPtr, interp, objc, objv); - case WMOPT_ICONIFY: - return WmIconifyCmd(tkwin, winPtr, interp, objc, objv); - case WMOPT_ICONMASK: - return WmIconmaskCmd(tkwin, winPtr, interp, objc, objv); - case WMOPT_ICONNAME: - return WmIconnameCmd(tkwin, winPtr, interp, objc, objv); - case WMOPT_ICONPHOTO: - return WmIconphotoCmd(tkwin, winPtr, interp, objc, objv); - case WMOPT_ICONPOSITION: - return WmIconpositionCmd(tkwin, winPtr, interp, objc, objv); - case WMOPT_ICONWINDOW: - return WmIconwindowCmd(tkwin, winPtr, interp, objc, objv); - case WMOPT_MANAGE: - return WmManageCmd(tkwin, winPtr, interp, objc, objv); - case WMOPT_MAXSIZE: - return WmMaxsizeCmd(tkwin, winPtr, interp, objc, objv); - case WMOPT_MINSIZE: - return WmMinsizeCmd(tkwin, winPtr, interp, objc, objv); - case WMOPT_OVERRIDEREDIRECT: - return WmOverrideredirectCmd(tkwin, winPtr, interp, objc, objv); - case WMOPT_POSITIONFROM: - return WmPositionfromCmd(tkwin, winPtr, interp, objc, objv); - case WMOPT_PROTOCOL: - return WmProtocolCmd(tkwin, winPtr, interp, objc, objv); - case WMOPT_RESIZABLE: - return WmResizableCmd(tkwin, winPtr, interp, objc, objv); - case WMOPT_SIZEFROM: - return WmSizefromCmd(tkwin, winPtr, interp, objc, objv); - case WMOPT_STACKORDER: - return WmStackorderCmd(tkwin, winPtr, interp, objc, objv); - case WMOPT_STATE: - return WmStateCmd(tkwin, winPtr, interp, objc, objv); - case WMOPT_TITLE: - return WmTitleCmd(tkwin, winPtr, interp, objc, objv); - case WMOPT_TRANSIENT: - return WmTransientCmd(tkwin, winPtr, interp, objc, objv); - case WMOPT_WITHDRAW: - return WmWithdrawCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_ASPECT: + return WmAspectCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_ATTRIBUTES: + return WmAttributesCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_CLIENT: + return WmClientCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_COLORMAPWINDOWS: + return WmColormapwindowsCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_COMMAND: + return WmCommandCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_DEICONIFY: + return WmDeiconifyCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_FOCUSMODEL: + return WmFocusmodelCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_FORGET: + return WmForgetCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_FRAME: + return WmFrameCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_GEOMETRY: + return WmGeometryCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_GRID: + return WmGridCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_GROUP: + return WmGroupCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_ICONBITMAP: + return WmIconbitmapCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_ICONIFY: + return WmIconifyCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_ICONMASK: + return WmIconmaskCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_ICONNAME: + return WmIconnameCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_ICONPHOTO: + return WmIconphotoCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_ICONPOSITION: + return WmIconpositionCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_ICONWINDOW: + return WmIconwindowCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_MANAGE: + return WmManageCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_MAXSIZE: + return WmMaxsizeCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_MINSIZE: + return WmMinsizeCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_OVERRIDEREDIRECT: + return WmOverrideredirectCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_POSITIONFROM: + return WmPositionfromCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_PROTOCOL: + return WmProtocolCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_RESIZABLE: + return WmResizableCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_SIZEFROM: + return WmSizefromCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_STACKORDER: + return WmStackorderCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_STATE: + return WmStateCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_TITLE: + return WmTitleCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_TRANSIENT: + return WmTransientCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_WITHDRAW: + return WmWithdrawCmd(tkwin, winPtr, interp, objc, objv); } /* This should not happen */ @@ -659,8 +653,8 @@ wrongNumArgs: * * WmAspectCmd -- * - * This procedure is invoked to process the "wm aspect" Tcl command. - * See the user documentation for details on what it does. + * This procedure is invoked to process the "wm aspect" Tcl command. See + * the user documentation for details on what it does. * * Results: * A standard Tcl result. @@ -702,15 +696,14 @@ WmAspectCmd( wmPtr->sizeHintsFlags &= ~PAspect; } else { if ((Tcl_GetIntFromObj(interp, objv[3], &numer1) != TCL_OK) - || (Tcl_GetIntFromObj(interp, objv[4], &denom1) != TCL_OK) - || (Tcl_GetIntFromObj(interp, objv[5], &numer2) != TCL_OK) - || (Tcl_GetIntFromObj(interp, objv[6], &denom2) != TCL_OK)) { + || (Tcl_GetIntFromObj(interp, objv[4], &denom1) != TCL_OK) + || (Tcl_GetIntFromObj(interp, objv[5], &numer2) != TCL_OK) + || (Tcl_GetIntFromObj(interp, objv[6], &denom2) != TCL_OK)) { return TCL_ERROR; } if ((numer1 <= 0) || (denom1 <= 0) || (numer2 <= 0) || - (denom2 <= 0)) { - Tcl_SetResult(interp, "aspect number can't be <= 0", - TCL_STATIC); + (denom2 <= 0)) { + Tcl_SetResult(interp, "aspect number can't be <= 0", TCL_STATIC); return TCL_ERROR; } wmPtr->minAspect.x = numer1; @@ -729,17 +722,19 @@ WmAspectCmd( * * WmSetAttribute -- * - * Helper routine for WmAttributesCmd. Sets the value - * of the specified attribute. + * Helper routine for WmAttributesCmd. Sets the value of the specified + * attribute. * * Returns: * - * TCL_OK if successful, TCL_ERROR otherwise. In case of an - * error, leaves a message in the interpreter's result. + * TCL_OK if successful, TCL_ERROR otherwise. In case of an error, leaves + * a message in the interpreter's result. * *---------------------------------------------------------------------- */ -static int WmSetAttribute( + +static int +WmSetAttribute( TkWindow *winPtr, /* Toplevel to work with */ WindowRef macWindow, Tcl_Interp *interp, /* Current interpreter */ @@ -750,152 +745,150 @@ static int WmSetAttribute( int boolean; switch (attribute) { - case WMATT_ALPHA: { - double dval; + case WMATT_ALPHA: { + double dval; - if (Tcl_GetDoubleFromObj(interp, value, &dval) != TCL_OK) { - return TCL_ERROR; - } - /* - * The user should give (transparent) 0 .. 1.0 (opaque) - */ - if (dval < 0.0) { - dval = 0.0; - } else if (dval > 1.0) { - dval = 1.0; - } - ChkErr(SetWindowAlpha, macWindow, dval); - break; + if (Tcl_GetDoubleFromObj(interp, value, &dval) != TCL_OK) { + return TCL_ERROR; } - case WMATT_FULLSCREEN: - if (Tcl_GetBooleanFromObj(interp, value, &boolean) != TCL_OK) { - return TCL_ERROR; - } - if (boolean != ((wmPtr->flags & WM_FULLSCREEN) != 0)) { - if(TkMacOSXMakeFullscreen(winPtr, macWindow, boolean, interp) - != TCL_OK) { - return TCL_ERROR; - } - } - break; - case WMATT_MODIFIED: - if (Tcl_GetBooleanFromObj(interp, value, &boolean) != TCL_OK) { - return TCL_ERROR; - } - if (boolean != IsWindowModified(macWindow)) { - ChkErr(SetWindowModified, macWindow, boolean); - } - break; - case WMATT_NOTIFY: - if (Tcl_GetBooleanFromObj(interp, value, &boolean) != TCL_OK) { + + /* + * The user should give (transparent) 0 .. 1.0 (opaque) + */ + + if (dval < 0.0) { + dval = 0.0; + } else if (dval > 1.0) { + dval = 1.0; + } + ChkErr(SetWindowAlpha, macWindow, dval); + break; + } + case WMATT_FULLSCREEN: + if (Tcl_GetBooleanFromObj(interp, value, &boolean) != TCL_OK) { + return TCL_ERROR; + } + if (boolean != ((wmPtr->flags & WM_FULLSCREEN) != 0)) { + if (TkMacOSXMakeFullscreen(winPtr, macWindow, boolean, interp) + != TCL_OK) { return TCL_ERROR; } - if (boolean == !tkMacOSXWmAttrNotifyVal) { - static NMRec notifyRec; - - if (boolean) { - bzero(¬ifyRec, sizeof(notifyRec)); - notifyRec.qType = nmType; - notifyRec.nmMark = 1; - ChkErr(NMInstall, ¬ifyRec); - } else { - ChkErr(NMRemove, ¬ifyRec); - } - tkMacOSXWmAttrNotifyVal = boolean; + } + break; + case WMATT_MODIFIED: + if (Tcl_GetBooleanFromObj(interp, value, &boolean) != TCL_OK) { + return TCL_ERROR; + } + if (boolean != IsWindowModified(macWindow)) { + ChkErr(SetWindowModified, macWindow, boolean); + } + break; + case WMATT_NOTIFY: + if (Tcl_GetBooleanFromObj(interp, value, &boolean) != TCL_OK) { + return TCL_ERROR; + } + if (boolean == !tkMacOSXWmAttrNotifyVal) { + static NMRec notifyRec; + + if (boolean) { + bzero(¬ifyRec, sizeof(notifyRec)); + notifyRec.qType = nmType; + notifyRec.nmMark = 1; + ChkErr(NMInstall, ¬ifyRec); + } else { + ChkErr(NMRemove, ¬ifyRec); } - break; - case WMATT_TITLEPATH: { - const char *path; - OSStatus err; - - path = Tcl_FSGetNativePath(value); - if (path && *path) { - FSRef ref; - Boolean d; - - err = ChkErr(FSPathMakeRef, (const unsigned char*) path, &ref, - &d); - if (err == noErr) { - TK_IF_MAC_OS_X_API (4, HIWindowSetProxyFSRef, + tkMacOSXWmAttrNotifyVal = boolean; + } + break; + case WMATT_TITLEPATH: { + const char *path = Tcl_FSGetNativePath(value); + OSStatus err; + + if (path && *path) { + FSRef ref; + Boolean d; + + err = ChkErr(FSPathMakeRef, (const unsigned char*)path, &ref, &d); + if (err == noErr) { + TK_IF_MAC_OS_X_API (4, HIWindowSetProxyFSRef, err = ChkErr(HIWindowSetProxyFSRef, macWindow, &ref); - ) TK_ELSE_MAC_OS_X (4, - AliasHandle alias; - - err = ChkErr(FSNewAlias, NULL, &ref, &alias); - if (err == noErr) { - err = ChkErr(SetWindowProxyAlias, macWindow, - alias); - DisposeHandle((Handle) alias); - } - ) TK_ENDIF - } - } else { - int len; + ) TK_ELSE_MAC_OS_X (4, + AliasHandle alias; - Tcl_GetStringFromObj(value, &len); - if (!len) { - err = ChkErr(RemoveWindowProxy, macWindow); - } else { - err = fnfErr; - } + err = ChkErr(FSNewAlias, NULL, &ref, &alias); + if (err == noErr) { + err = ChkErr(SetWindowProxyAlias, macWindow, alias); + DisposeHandle((Handle) alias); + } + ) TK_ENDIF } - if (err != noErr) { - return TCL_ERROR; + } else { + int len; + + Tcl_GetStringFromObj(value, &len); + if (!len) { + err = ChkErr(RemoveWindowProxy, macWindow); + } else { + err = fnfErr; } - break; } - case WMATT_TOPMOST: { - if (Tcl_GetBooleanFromObj(interp, value, &boolean) != TCL_OK) { - return TCL_ERROR; - } - if (boolean != ((wmPtr->flags & WM_TOPMOST) != 0)) { - WindowGroupRef group; + if (err != noErr) { + return TCL_ERROR; + } + break; + } + case WMATT_TOPMOST: + if (Tcl_GetBooleanFromObj(interp, value, &boolean) != TCL_OK) { + return TCL_ERROR; + } + if (boolean != ((wmPtr->flags & WM_TOPMOST) != 0)) { + WindowGroupRef group; - if (boolean) { - wmPtr->flags |= WM_TOPMOST; - } else { - wmPtr->flags &= ~WM_TOPMOST; - } - group = WmGetWindowGroup(winPtr); - if (group && group != GetWindowGroup(macWindow)) { - ChkErr(SetWindowGroup, macWindow, group); - } + if (boolean) { + wmPtr->flags |= WM_TOPMOST; + } else { + wmPtr->flags &= ~WM_TOPMOST; + } + group = WmGetWindowGroup(winPtr); + if (group && group != GetWindowGroup(macWindow)) { + ChkErr(SetWindowGroup, macWindow, group); } - break; } - case WMATT_TRANSPARENT: - if (Tcl_GetBooleanFromObj(interp, value, &boolean) != TCL_OK) { - return TCL_ERROR; + break; + case WMATT_TRANSPARENT: + if (Tcl_GetBooleanFromObj(interp, value, &boolean) != TCL_OK) { + return TCL_ERROR; + } + if (boolean != ((wmPtr->flags & WM_TRANSPARENT) != 0)) { + WindowAttributes oldAttributes = wmPtr->attributes; + + if (boolean) { + wmPtr->flags |= WM_TRANSPARENT; + wmPtr->attributes |= kWindowNoShadowAttribute; + TK_IF_MAC_OS_X_API (3, HIWindowChangeFeatures, + UInt32 features; + + ChkErr(GetWindowFeatures, macWindow, &features); + if (features & kWindowIsOpaque) { + ChkErr(HIWindowChangeFeatures, macWindow, 0, + kWindowIsOpaque); + } + ) TK_ENDIF + } else { + wmPtr->flags &= ~WM_TRANSPARENT; + wmPtr->attributes &= ~kWindowNoShadowAttribute; } - if (boolean != ((wmPtr->flags & WM_TRANSPARENT) != 0)) { - WindowAttributes oldAttributes = wmPtr->attributes; - - if (boolean) { - wmPtr->flags |= WM_TRANSPARENT; - wmPtr->attributes |= kWindowNoShadowAttribute; - TK_IF_MAC_OS_X_API (3, HIWindowChangeFeatures, - UInt32 features; - - ChkErr(GetWindowFeatures, macWindow, &features); - if (features & kWindowIsOpaque) { - ChkErr(HIWindowChangeFeatures, macWindow, 0, - kWindowIsOpaque); - } - ) TK_ENDIF - } else { - wmPtr->flags &= ~WM_TRANSPARENT; - wmPtr->attributes &= ~kWindowNoShadowAttribute; - } - ApplyWindowClassAttributeChanges(winPtr, macWindow, - wmPtr->macClass, oldAttributes, 1); - ChkErr(ReshapeCustomWindow, macWindow); - TkMacOSXInvalidateWindow((MacDrawable *)(winPtr->window), - TK_PARENT_WINDOW); + ApplyWindowClassAttributeChanges(winPtr, macWindow, + wmPtr->macClass, oldAttributes, 1); + ChkErr(ReshapeCustomWindow, macWindow); + TkMacOSXInvalidateWindow((MacDrawable *) winPtr->window, + TK_PARENT_WINDOW); } - break; - case _WMATT_LAST_ATTRIBUTE: - default: - return TCL_ERROR; + break; + case _WMATT_LAST_ATTRIBUTE: + default: + return TCL_ERROR; } return TCL_OK; } @@ -905,12 +898,14 @@ static int WmSetAttribute( * * WmGetAttribute -- * - * Helper routine for WmAttributesCmd. Returns the current value - * of the specified attribute. + * Helper routine for WmAttributesCmd. Returns the current value of the + * specified attribute. * *---------------------------------------------------------------------- */ -static Tcl_Obj *WmGetAttribute( + +static Tcl_Obj * +WmGetAttribute( TkWindow *winPtr, /* Toplevel to work with */ WindowRef macWindow, WmAttribute attribute) /* Code of attribute to get */ @@ -919,57 +914,56 @@ static Tcl_Obj *WmGetAttribute( Tcl_Obj *result = NULL; switch (attribute) { - case WMATT_ALPHA: { - float fval = 1.0; - - ChkErr(GetWindowAlpha, macWindow, &fval); - result = Tcl_NewDoubleObj(fval); - break; - } - case WMATT_FULLSCREEN: - result = Tcl_NewBooleanObj(wmPtr->flags & WM_FULLSCREEN); - break; - case WMATT_MODIFIED: - result = Tcl_NewBooleanObj(IsWindowModified(macWindow)); - break; - case WMATT_NOTIFY: - result = Tcl_NewBooleanObj(tkMacOSXWmAttrNotifyVal); - break; - case WMATT_TITLEPATH: { - FSRef ref; - UInt8 path[PATH_MAX+1]; - OSStatus err; - - TK_IF_MAC_OS_X_API (4, HIWindowSetProxyFSRef, - err = ChkErr(HIWindowGetProxyFSRef, macWindow, &ref); - ) TK_ELSE_MAC_OS_X (4, - Boolean wasChanged; - AliasHandle alias; - - err = ChkErr(GetWindowProxyAlias, macWindow, &alias); - if (err == noErr) { - err = ChkErr(FSResolveAlias, NULL, alias, &ref, - &wasChanged); - } - ) TK_ENDIF + case WMATT_ALPHA: { + float fval = 1.0; + + ChkErr(GetWindowAlpha, macWindow, &fval); + result = Tcl_NewDoubleObj(fval); + break; + } + case WMATT_FULLSCREEN: + result = Tcl_NewBooleanObj(wmPtr->flags & WM_FULLSCREEN); + break; + case WMATT_MODIFIED: + result = Tcl_NewBooleanObj(IsWindowModified(macWindow)); + break; + case WMATT_NOTIFY: + result = Tcl_NewBooleanObj(tkMacOSXWmAttrNotifyVal); + break; + case WMATT_TITLEPATH: { + FSRef ref; + UInt8 path[PATH_MAX+1]; + OSStatus err; + + TK_IF_MAC_OS_X_API (4, HIWindowSetProxyFSRef, + err = ChkErr(HIWindowGetProxyFSRef, macWindow, &ref); + ) TK_ELSE_MAC_OS_X (4, + Boolean wasChanged; + AliasHandle alias; + + err = ChkErr(GetWindowProxyAlias, macWindow, &alias); if (err == noErr) { - err = ChkErr(FSRefMakePath, &ref, path, PATH_MAX); + err = ChkErr(FSResolveAlias, NULL, alias, &ref, &wasChanged); } - if (err != noErr) { - *path = 0; - } - result = Tcl_NewStringObj((char*) path, -1); - break; + ) TK_ENDIF + if (err == noErr) { + err = ChkErr(FSRefMakePath, &ref, path, PATH_MAX); } - case WMATT_TOPMOST: - result = Tcl_NewBooleanObj(wmPtr->flags & WM_TOPMOST); - break; - case WMATT_TRANSPARENT: - result = Tcl_NewBooleanObj(wmPtr->flags & WM_TRANSPARENT); - break; - case _WMATT_LAST_ATTRIBUTE: - default: - break; + if (err != noErr) { + *path = 0; + } + result = Tcl_NewStringObj((char*) path, -1); + break; + } + case WMATT_TOPMOST: + result = Tcl_NewBooleanObj(wmPtr->flags & WM_TOPMOST); + break; + case WMATT_TRANSPARENT: + result = Tcl_NewBooleanObj(wmPtr->flags & WM_TRANSPARENT); + break; + case _WMATT_LAST_ATTRIBUTE: + default: + break; } return result; } @@ -1051,8 +1045,8 @@ WmAttributesCmd( * * WmClientCmd -- * - * This procedure is invoked to process the "wm client" Tcl command. - * See the user documentation for details on what it does. + * This procedure is invoked to process the "wm client" Tcl command. See + * the user documentation for details on what it does. * * Results: * A standard Tcl result. @@ -1096,8 +1090,7 @@ WmClientCmd( if (wmPtr->clientMachine != NULL) { ckfree((char *) wmPtr->clientMachine); } - wmPtr->clientMachine = (char *) - ckalloc((unsigned) (length + 1)); + wmPtr->clientMachine = ckalloc((unsigned) length + 1); strcpy(wmPtr->clientMachine, argv3); return TCL_OK; } @@ -1107,9 +1100,8 @@ WmClientCmd( * * WmColormapwindowsCmd -- * - * This procedure is invoked to process the "wm colormapwindows" - * Tcl command. - * See the user documentation for details on what it does. + * This procedure is invoked to process the "wm colormapwindows" Tcl + * command. See the user documentation for details on what it does. * * Results: * A standard Tcl result. @@ -1154,11 +1146,10 @@ WmColormapwindowsCmd( return TCL_ERROR; } cmapList = (TkWindow **) ckalloc((unsigned) - ((windowObjc+1)*sizeof(TkWindow*))); + ((windowObjc+1) * sizeof(TkWindow*))); for (i = 0; i < windowObjc; i++) { if (TkGetWindowFromObj(interp, tkwin, windowObjv[i], - (Tk_Window *) &winPtr2) != TCL_OK) - { + (Tk_Window *) &winPtr2) != TCL_OK) { ckfree((char *) cmapList); return TCL_ERROR; } @@ -1185,9 +1176,8 @@ WmColormapwindowsCmd( wmPtr->cmapCount = windowObjc; /* - * On the Macintosh all of this is just an excercise - * in compatability as we don't support colormaps. If - * we did they would be installed here. + * On the Macintosh all of this is just an excercise in compatability as + * we don't support colormaps. If we did they would be installed here. */ return TCL_OK; @@ -1229,8 +1219,7 @@ WmCommandCmd( } if (objc == 3) { if (wmPtr->cmdArgv != NULL) { - Tcl_SetResult(interp, - Tcl_Merge(wmPtr->cmdArgc, wmPtr->cmdArgv), + Tcl_SetResult(interp, Tcl_Merge(wmPtr->cmdArgc, wmPtr->cmdArgv), TCL_DYNAMIC); } return TCL_OK; @@ -1280,6 +1269,7 @@ WmDeiconifyCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; + if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "window"); return TCL_ERROR; @@ -1342,7 +1332,7 @@ WmFocusmodelCmd( } if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0, - &index) != TCL_OK) { + &index) != TCL_OK) { return TCL_ERROR; } if (index == OPT_ACTIVE) { @@ -1371,15 +1361,15 @@ WmFocusmodelCmd( */ static int -WmForgetCmd(tkwin, winPtr, interp, objc, objv) - Tk_Window tkwin; /* Main window of the application. */ - TkWindow *winPtr; /* Toplevel or Frame to work with */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ +WmForgetCmd( + Tk_Window tkwin, /* Main window of the application. */ + TkWindow *winPtr, /* Toplevel or Frame to work with */ + Tcl_Interp *interp, /* Current interpreter. */ + int objc, /* Number of arguments. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { #if 1 - Tcl_AppendResult(interp, "wm forget is not yet supported", (char*)NULL); + Tcl_AppendResult(interp, "wm forget is not yet supported", NULL); return TCL_ERROR; #else register Tk_Window frameWin = (Tk_Window)winPtr; @@ -1393,8 +1383,8 @@ WmForgetCmd(tkwin, winPtr, interp, objc, objv) Tk_UnmapWindow(frameWin); if (destPort != NULL) { - WindowRef winRef; - winRef = GetWindowFromPort(destPort); + WindowRef winRef = GetWindowFromPort(destPort); + TkMacOSXUnregisterMacWindow(winRef); DisposeWindow(winRef); } @@ -1404,7 +1394,8 @@ WmForgetCmd(tkwin, winPtr, interp, objc, objv) RemapWindows(winPtr, macWin); TkWmDeadWindow(winPtr); - winPtr->flags &= ~(TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED); + winPtr->flags &= + ~(TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED); TkMapTopFrame(frameWin); } else { @@ -1419,8 +1410,8 @@ WmForgetCmd(tkwin, winPtr, interp, objc, objv) * * WmFrameCmd -- * - * This procedure is invoked to process the "wm frame" Tcl command. - * See the user documentation for details on what it does. + * This procedure is invoked to process the "wm frame" Tcl command. See + * the user documentation for details on what it does. * * Results: * A standard Tcl result. @@ -1504,8 +1495,8 @@ WmGeometryCmd( width = winPtr->changes.width; height = winPtr->changes.height; } - sprintf(buf, "%dx%d%c%d%c%d", width, height, xSign, wmPtr->x, - ySign, wmPtr->y); + sprintf(buf, "%dx%d%c%d%c%d", + width, height, xSign, wmPtr->x, ySign, wmPtr->y); Tcl_SetResult(interp, buf, TCL_VOLATILE); return TCL_OK; } @@ -1524,8 +1515,8 @@ WmGeometryCmd( * * WmGridCmd -- * - * This procedure is invoked to process the "wm grid" Tcl command. - * See the user documentation for details on what it does. + * This procedure is invoked to process the "wm grid" Tcl command. See + * the user documentation for details on what it does. * * Results: * A standard Tcl result. @@ -1565,8 +1556,8 @@ WmGridCmd( } if (*Tcl_GetString(objv[3]) == '\0') { /* - * Turn off gridding and reset the width and height - * to make sense as ungridded numbers. + * Turn off gridding and reset the width and height to make sense as + * ungridded numbers. */ wmPtr->sizeHintsFlags &= ~(PBaseSize|PResizeInc); @@ -1580,9 +1571,9 @@ WmGridCmd( wmPtr->heightInc = 1; } else { if ((Tcl_GetIntFromObj(interp, objv[3], &reqWidth) != TCL_OK) - || (Tcl_GetIntFromObj(interp, objv[4], &reqHeight) != TCL_OK) - || (Tcl_GetIntFromObj(interp, objv[5], &widthInc) != TCL_OK) - || (Tcl_GetIntFromObj(interp, objv[6], &heightInc) != TCL_OK)) { + || (Tcl_GetIntFromObj(interp, objv[4], &reqHeight) != TCL_OK) + || (Tcl_GetIntFromObj(interp, objv[5], &widthInc) != TCL_OK) + || (Tcl_GetIntFromObj(interp, objv[6], &heightInc)!=TCL_OK)) { return TCL_ERROR; } if (reqWidth < 0) { @@ -1614,8 +1605,8 @@ WmGridCmd( * * WmGroupCmd -- * - * This procedure is invoked to process the "wm group" Tcl command. - * See the user documentation for details on what it does. + * This procedure is invoked to process the "wm group" Tcl command. See + * the user documentation for details on what it does. * * Results: * A standard Tcl result. @@ -1829,8 +1820,7 @@ WmIconmaskCmd( } if (objc == 3) { if (wmPtr->hints.flags & IconMaskHint) { - Tcl_SetResult(interp, - (char*)Tk_NameOfBitmap(winPtr->display, + Tcl_SetResult(interp, (char *) Tk_NameOfBitmap(winPtr->display, wmPtr->hints.icon_mask), TCL_STATIC); } return TCL_OK; @@ -1886,8 +1876,7 @@ WmIconnameCmd( return TCL_ERROR; } if (objc == 3) { - Tcl_SetResult(interp, - (char*)((wmPtr->iconName != NULL) ? + Tcl_SetResult(interp, (char *) ((wmPtr->iconName != NULL) ? wmPtr->iconName : ""), TCL_STATIC); return TCL_OK; } else { @@ -1895,7 +1884,7 @@ WmIconnameCmd( ckfree((char *) wmPtr->iconName); } argv3 = Tcl_GetStringFromObj(objv[3], &length); - wmPtr->iconName = ckalloc((unsigned) (length + 1)); + wmPtr->iconName = ckalloc((unsigned) length + 1); strcpy(wmPtr->iconName, argv3); if (!(wmPtr->flags & WM_NEVER_MAPPED)) { XSetIconName(winPtr->display, winPtr->window, wmPtr->iconName); @@ -1909,10 +1898,9 @@ WmIconnameCmd( * * WmIconphotoCmd -- * - * This procedure is invoked to process the "wm iconphoto" - * Tcl command. - * See the user documentation for details on what it does. - * Not yet implemented for OS X. + * This procedure is invoked to process the "wm iconphoto" Tcl command. + * See the user documentation for details on what it does. Not yet + * implemented for OS X. * * Results: * A standard Tcl result. @@ -1947,10 +1935,12 @@ WmIconphotoCmd( return TCL_ERROR; } } + /* * Iterate over all images to retrieve their sizes, in order to allocate a * buffer large enough to hold all images. */ + for (i = 3 + isDefault; i < objc; i++) { photo = Tk_FindPhoto(interp, Tcl_GetString(objv[i])); if (photo == NULL) { @@ -1960,10 +1950,12 @@ WmIconphotoCmd( } Tk_PhotoGetSize(photo, &width, &height); } + /* - * This requires implementation for OS X, but we silently return - * for now. + * TODO: This requires implementation for OS X, but we silently return for + * now. */ + return TCL_OK; } @@ -1972,9 +1964,8 @@ WmIconphotoCmd( * * WmIconpositionCmd -- * - * This procedure is invoked to process the "wm iconposition" - * Tcl command. - * See the user documentation for details on what it does. + * This procedure is invoked to process the "wm iconposition" Tcl + * command. See the user documentation for details on what it does. * * Results: * A standard Tcl result. @@ -2112,8 +2103,8 @@ WmIconwindowCmd( * * WmManageCmd -- * - * This procedure is invoked to process the "wm manage" Tcl command. - * See the user documentation for details on what it does. + * This procedure is invoked to process the "wm manage" Tcl command. See + * the user documentation for details on what it does. * * Results: * A standard Tcl result. @@ -2130,10 +2121,10 @@ WmManageCmd( TkWindow *winPtr, /* Toplevel or Frame to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { #if 1 - Tcl_AppendResult(interp, "wm manage is not yet supported", (char*)NULL); + Tcl_AppendResult(interp, "wm manage is not yet supported", NULL); return TCL_ERROR; #else register Tk_Window frameWin = (Tk_Window)winPtr; @@ -2159,8 +2150,9 @@ WmManageCmd( macWin->grafPtr = NULL; macWin->toplevel = macWin; RemapWindows(winPtr, macWin); - winPtr->flags |= (TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED); - TkMapTopFrame (frameWin); + winPtr->flags |= + (TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED); + TkMapTopFrame(frameWin); } else if (Tk_IsTopLevel(frameWin)) { /* Already managed by wm - ignore it */ } @@ -2260,7 +2252,7 @@ WmMinsizeCmd( return TCL_OK; } if ((Tcl_GetIntFromObj(interp, objv[3], &width) != TCL_OK) - || (Tcl_GetIntFromObj(interp, objv[4], &height) != TCL_OK)) { + || (Tcl_GetIntFromObj(interp, objv[4], &height) != TCL_OK)) { return TCL_ERROR; } wmPtr->minWidth = width; @@ -2275,9 +2267,8 @@ WmMinsizeCmd( * * WmOverrideredirectCmd -- * - * This procedure is invoked to process the "wm overrideredirect" - * Tcl command. - * See the user documentation for details on what it does. + * This procedure is invoked to process the "wm overrideredirect" Tcl + * command. See the user documentation for details on what it does. * * Results: * A standard Tcl result. @@ -2366,7 +2357,7 @@ WmPositionfromCmd( wmPtr->sizeHintsFlags &= ~(USPosition|PPosition); } else { if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0, - &index) != TCL_OK) { + &index) != TCL_OK) { return TCL_ERROR; } if (index == OPT_USER) { @@ -2421,6 +2412,7 @@ WmProtocolCmd( /* * Return a list of all defined protocols for the window. */ + for (protPtr = wmPtr->protPtr; protPtr != NULL; protPtr = protPtr->nextPtr) { Tcl_AppendElement(interp, @@ -2445,9 +2437,8 @@ WmProtocolCmd( } /* - * Delete any current protocol handler, then create a new - * one with the specified command, unless the command is - * empty. + * Delete any current protocol handler, then create a new one with the + * specified command, unless the command is empty. */ for (protPtr = wmPtr->protPtr, prevPtr = NULL; protPtr != NULL; @@ -2458,7 +2449,7 @@ WmProtocolCmd( } else { prevPtr->nextPtr = protPtr->nextPtr; } - Tcl_EventuallyFree((ClientData) protPtr, TCL_DYNAMIC); + Tcl_EventuallyFree(protPtr, TCL_DYNAMIC); break; } } @@ -2546,7 +2537,7 @@ WmResizableCmd( } WmUpdateGeom(wmPtr, winPtr); ApplyWindowClassAttributeChanges(winPtr, NULL, wmPtr->macClass, - oldAttributes, 1); + oldAttributes, 1); return TCL_OK; } @@ -2599,7 +2590,7 @@ WmSizefromCmd( wmPtr->sizeHintsFlags &= ~(USSize|PSize); } else { if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0, - &index) != TCL_OK) { + &index) != TCL_OK) { return TCL_ERROR; } if (index == OPT_USER) { @@ -2656,13 +2647,13 @@ WmStackorderCmd( windows = TkWmStackorderToplevel(winPtr); if (windows == NULL) { Tcl_Panic("TkWmStackorderToplevel failed"); - } else { - for (window_ptr = windows; *window_ptr ; window_ptr++) { - Tcl_AppendElement(interp, (*window_ptr)->pathName); - } - ckfree((char *) windows); - return TCL_OK; } + + for (window_ptr = windows; *window_ptr ; window_ptr++) { + Tcl_AppendElement(interp, (*window_ptr)->pathName); + } + ckfree((char *) windows); + return TCL_OK; } else { TkWindow *winPtr2; int index1=-1, index2=-1, result; @@ -2691,9 +2682,8 @@ WmStackorderCmd( } /* - * Lookup stacking order of all toplevels that are children - * of "." and find the position of winPtr and winPtr2 - * in the stacking order. + * Lookup stacking order of all toplevels that are children of "." and + * find the position of winPtr and winPtr2 in the stacking order. */ windows = TkWmStackorderToplevel(winPtr->mainPtr->winPtr); @@ -2703,21 +2693,25 @@ WmStackorderCmd( return TCL_ERROR; } else { for (window_ptr = windows; *window_ptr ; window_ptr++) { - if (*window_ptr == winPtr) + if (*window_ptr == winPtr) { index1 = (window_ptr - windows); - if (*window_ptr == winPtr2) + } + if (*window_ptr == winPtr2) { index2 = (window_ptr - windows); + } } - if (index1 == -1) + if (index1 == -1) { Tcl_Panic("winPtr window not found"); - if (index2 == -1) + } + if (index2 == -1) { Tcl_Panic("winPtr2 window not found"); + } ckfree((char *) windows); } if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0, - &index) != TCL_OK) { + &index) != TCL_OK) { return TCL_ERROR; } if (index == OPT_ISABOVE) { @@ -2736,8 +2730,8 @@ WmStackorderCmd( * * WmStateCmd -- * - * This procedure is invoked to process the "wm state" Tcl command. - * See the user documentation for details on what it does. + * This procedure is invoked to process the "wm state" Tcl command. See + * the user documentation for details on what it does. * * Results: * A standard Tcl result. @@ -2818,18 +2812,18 @@ WmStateCmd( ZoomState : NormalState); } switch (wmPtr->hints.initial_state) { - case NormalState: - Tcl_SetResult(interp, "normal", TCL_STATIC); - break; - case IconicState: - Tcl_SetResult(interp, "iconic", TCL_STATIC); - break; - case WithdrawnState: - Tcl_SetResult(interp, "withdrawn", TCL_STATIC); - break; - case ZoomState: - Tcl_SetResult(interp, "zoomed", TCL_STATIC); - break; + case NormalState: + Tcl_SetResult(interp, "normal", TCL_STATIC); + break; + case IconicState: + Tcl_SetResult(interp, "iconic", TCL_STATIC); + break; + case WithdrawnState: + Tcl_SetResult(interp, "withdrawn", TCL_STATIC); + break; + case ZoomState: + Tcl_SetResult(interp, "zoomed", TCL_STATIC); + break; } } } @@ -2841,8 +2835,8 @@ WmStateCmd( * * WmTitleCmd -- * - * This procedure is invoked to process the "wm title" Tcl command. - * See the user documentation for details on what it does. + * This procedure is invoked to process the "wm title" Tcl command. See + * the user documentation for details on what it does. * * Results: * A standard Tcl result. @@ -3017,7 +3011,7 @@ WmInfo *wmPtr; TkWindow *winPtr; { if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) { - Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr); + Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr); wmPtr->flags |= WM_UPDATE_PENDING; } } @@ -3028,33 +3022,33 @@ TkWindow *winPtr; * Tk_SetGrid -- * * This procedure is invoked by a widget when it wishes to set a grid - * coordinate system that controls the size of a top-level window. - * It provides a C interface equivalent to the "wm grid" command and - * is usually asscoiated with the -setgrid option. + * coordinate system that controls the size of a top-level window. It + * provides a C interface equivalent to the "wm grid" command and is + * usually asscoiated with the -setgrid option. * * Results: * None. * * Side effects: - * Grid-related information will be passed to the window manager, so - * that the top-level window associated with tkwin will resize on - * even grid units. If some other window already controls gridding - * for the top-level window then this procedure call has no effect. + * Grid-related information will be passed to the window manager, so that + * the top-level window associated with tkwin will resize on even grid + * units. If some other window already controls gridding for the + * top-level window then this procedure call has no effect. * *---------------------------------------------------------------------- */ void Tk_SetGrid( - Tk_Window tkwin, /* Token for window. New window mgr info - * will be posted for the top-level window + Tk_Window tkwin, /* Token for window. New window mgr info will + * be posted for the top-level window * associated with this window. */ - int reqWidth, /* Width (in grid units) corresponding to - * the requested geometry for tkwin. */ - int reqHeight, /* Height (in grid units) corresponding to - * the requested geometry for tkwin. */ - int widthInc, int heightInc)/* Pixel increments corresponding to a - * change of one grid unit. */ + int reqWidth, /* Width (in grid units) corresponding to the + * requested geometry for tkwin. */ + int reqHeight, /* Height (in grid units) corresponding to the + * requested geometry for tkwin. */ + int widthInc, int heightInc)/* Pixel increments corresponding to a change + * of one grid unit. */ { TkWindow *winPtr = (TkWindow *) tkwin; WmInfo *wmPtr; @@ -3094,15 +3088,15 @@ Tk_SetGrid( } /* - * If gridding was previously off, then forget about any window - * size requests made by the user or via "wm geometry": these are - * in pixel units and there's no easy way to translate them to - * grid units since the new requested size of the top-level window in - * pixels may not yet have been registered yet (it may filter up - * the hierarchy in DoWhenIdle handlers). However, if the window - * has never been mapped yet then just leave the window size alone: - * assume that it is intended to be in grid units but just happened - * to have been specified before this procedure was called. + * If gridding was previously off, then forget about any window size + * requests made by the user or via "wm geometry": these are in pixel + * units and there's no easy way to translate them to grid units since the + * new requested size of the top-level window in pixels may not yet have + * been registered yet (it may filter up the hierarchy in DoWhenIdle + * handlers). However, if the window has never been mapped yet then just + * leave the window size alone: assume that it is intended to be in grid + * units but just happened to have been specified before this procedure + * was called. */ if ((wmPtr->gridWin == NULL) && !(wmPtr->flags & WM_NEVER_MAPPED)) { @@ -3111,8 +3105,8 @@ Tk_SetGrid( } /* - * Set the new gridding information, and start the process of passing - * all of this information to the window manager. + * Set the new gridding information, and start the process of passing all + * of this information to the window manager. */ wmPtr->gridWin = tkwin; @@ -3123,7 +3117,7 @@ Tk_SetGrid( wmPtr->sizeHintsFlags |= PBaseSize|PResizeInc; wmPtr->flags |= WM_UPDATE_SIZE_HINTS; if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) { - Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr); + Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr); wmPtr->flags |= WM_UPDATE_PENDING; } } @@ -3133,16 +3127,15 @@ Tk_SetGrid( * * Tk_UnsetGrid -- * - * This procedure cancels the effect of a previous call - * to Tk_SetGrid. + * This procedure cancels the effect of a previous call to Tk_SetGrid. * * Results: * None. * * Side effects: * If tkwin currently controls gridding for its top-level window, - * gridding is cancelled for that top-level window; if some other - * window controls gridding then this procedure has no effect. + * gridding is cancelled for that top-level window; if some other window + * controls gridding then this procedure has no effect. * *---------------------------------------------------------------------- */ @@ -3181,7 +3174,7 @@ Tk_UnsetGrid( wmPtr->flags |= WM_UPDATE_SIZE_HINTS; if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) { - Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr); + Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr); wmPtr->flags |= WM_UPDATE_PENDING; } } @@ -3198,8 +3191,8 @@ Tk_UnsetGrid( * None. * * Side effects: - * Tk's internal data structures for the window get modified to - * reflect the structural change. + * Tk's internal data structures for the window get modified to reflect + * the structural change. * *---------------------------------------------------------------------- */ @@ -3209,7 +3202,7 @@ TopLevelEventProc( ClientData clientData, /* Window for which event occurred. */ XEvent *eventPtr) /* Event that just happened. */ { - TkWindow *winPtr = (TkWindow *) clientData; + TkWindow *winPtr = clientData; winPtr->wmInfoPtr->flags |= WM_VROOT_OFFSET_STALE; if (eventPtr->type == DestroyNotify) { @@ -3223,7 +3216,7 @@ TopLevelEventProc( */ Tk_ErrorHandler handler = Tk_CreateErrorHandler(winPtr->display, - -1, -1, -1, (Tk_ErrorProc *) NULL, (ClientData) NULL); + -1, -1, -1, NULL, NULL); Tk_DestroyWindow((Tk_Window) winPtr); Tk_DeleteErrorHandler(handler); } @@ -3240,15 +3233,15 @@ TopLevelEventProc( * * TopLevelReqProc -- * - * This procedure is invoked by the geometry manager whenever - * the requested size for a top-level window is changed. + * This procedure is invoked by the geometry manager whenever the + * requested size for a top-level window is changed. * * Results: * None. * * Side effects: - * Arrange for the window to be resized to satisfy the request - * (this happens as a when-idle action). + * Arrange for the window to be resized to satisfy the request (this + * happens as a when-idle action). * *---------------------------------------------------------------------- */ @@ -3265,7 +3258,7 @@ TopLevelReqProc( wmPtr = winPtr->wmInfoPtr; wmPtr->flags |= WM_UPDATE_SIZE_HINTS; if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) { - Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr); + Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr); wmPtr->flags |= WM_UPDATE_PENDING; } } @@ -3275,19 +3268,18 @@ TopLevelReqProc( * * UpdateGeometryInfo -- * - * This procedure is invoked when a top-level window is first - * mapped, and also as a when-idle procedure, to bring the - * geometry and/or position of a top-level window back into - * line with what has been requested by the user and/or widgets. - * This procedure doesn't return until the window manager has - * responded to the geometry change. + * This procedure is invoked when a top-level window is first mapped, and + * also as a when-idle procedure, to bring the geometry and/or position + * of a top-level window back into line with what has been requested by + * the user and/or widgets. This procedure doesn't return until the + * window manager has responded to the geometry change. * * Results: * None. * * Side effects: - * The window's size and location may change, unless the WM prevents - * that from happening. + * The window's size and location may change, unless the WM prevents that + * from happening. * *---------------------------------------------------------------------- */ @@ -3296,7 +3288,7 @@ static void UpdateGeometryInfo( ClientData clientData) /* Pointer to the window's record. */ { - TkWindow *winPtr = (TkWindow *) clientData; + TkWindow *winPtr = clientData; WmInfo *wmPtr = winPtr->wmInfoPtr; int x, y, width, height, min, max; unsigned long serial; @@ -3308,14 +3300,12 @@ UpdateGeometryInfo( } /* - * Compute the new size for the top-level window. See the - * user documentation for details on this, but the size - * requested depends on (a) the size requested internally - * by the window's widgets, (b) the size requested by the - * user in a "wm geometry" command or via wm-based interactive - * resizing (if any), and (c) whether or not the window is - * gridded. Don't permit sizes <= 0 because this upsets - * the X server. + * Compute the new size for the top-level window. See the user + * documentation for details on this, but the size requested depends on + * (a) the size requested internally by the window's widgets, (b) the size + * requested by the user in a "wm geometry" command or via wm-based + * interactive resizing (if any), and (c) whether or not the window is + * gridded. Don't permit sizes <= 0 because this upsets the X server. */ if (wmPtr->width == -1) { @@ -3390,10 +3380,10 @@ UpdateGeometryInfo( /* * Compute the new position for the upper-left pixel of the window's - * decorative frame. This is tricky, because we need to include the - * border widths supplied by a reparented parent in this calculation, - * but can't use the parent's current overall size since that may - * change as a result of this code. + * decorative frame. This is tricky, because we need to include the border + * widths supplied by a reparented parent in this calculation, but can't + * use the parent's current overall size since that may change as a result + * of this code. */ if (wmPtr->flags & WM_NEGATIVE_X) { @@ -3410,10 +3400,10 @@ UpdateGeometryInfo( } /* - * If the window's size is going to change and the window is - * supposed to not be resizable by the user, then we have to - * update the size hints. There may also be a size-hint-update - * request pending from somewhere else, too. + * If the window's size is going to change and the window is supposed to + * not be resizable by the user, then we have to update the size hints. + * There may also be a size-hint-update request pending from somewhere + * else, too. */ if (((width != winPtr->changes.width) @@ -3427,22 +3417,21 @@ UpdateGeometryInfo( } /* - * Reconfigure the window if it isn't already configured correctly. - * A few tricky points: + * Reconfigure the window if it isn't already configured correctly. A few + * tricky points: * - * 1. If the window is embedded and the container is also in this - * process, don't actually reconfigure the window; just pass the - * desired size on to the container. Also, zero out any position - * information, since embedded windows are not allowed to move. - * 2. Sometimes the window manager will give us a different size - * than we asked for (e.g. mwm has a minimum size for windows), so - * base the size check on what we *asked for* last time, not what we - * got. - * 3. Don't move window unless a new position has been requested for - * it. This is because of "features" in some window managers (e.g. - * twm, as of 4/24/91) where they don't interpret coordinates - * according to ICCCM. Moving a window to its current location may - * cause it to shift position on the screen. + * 1. If the window is embedded and the container is also in this process, + * don't actually reconfigure the window; just pass the desired size on + * to the container. Also, zero out any position information, since + * embedded windows are not allowed to move. + * 2. Sometimes the window manager will give us a different size than we + * asked for (e.g. mwm has a minimum size for windows), so base the + * size check on what we *asked for* last time, not what we got. + * 3. Don't move window unless a new position has been requested for it. + * This is because of "features" in some window managers (e.g. twm, as + * of 4/24/91) where they don't interpret coordinates according to + * ICCCM. Moving a window to its current location may cause it to shift + * position on the screen. */ if (Tk_IsEmbedded(winPtr)) { @@ -3456,9 +3445,9 @@ UpdateGeometryInfo( /* * This window is embedded and the container is also in this * process, so we don't need to do anything special about the - * geometry, except to make sure that the desired size is known - * by the container. Also, zero out any position information, - * since embedded windows are not allowed to move. + * geometry, except to make sure that the desired size is known by + * the container. Also, zero out any position information, since + * embedded windows are not allowed to move. */ wmPtr->x = wmPtr->y = 0; @@ -3498,9 +3487,8 @@ UpdateGeometryInfo( * * UpdateSizeHints -- * - * This procedure is called to update the window manager's - * size hints information from the information in a WmInfo - * structure. + * This procedure is called to update the window manager's size hints + * information from the information in a WmInfo structure. * * Results: * None. @@ -3518,8 +3506,6 @@ UpdateSizeHints( WmInfo *wmPtr = winPtr->wmInfoPtr; wmPtr->flags &= ~WM_UPDATE_SIZE_HINTS; - - return; } /* @@ -3527,13 +3513,12 @@ UpdateSizeHints( * * ParseGeometry -- * - * This procedure parses a geometry string and updates - * information used to control the geometry of a top-level - * window. + * This procedure parses a geometry string and updates information used + * to control the geometry of a top-level window. * * Results: - * A standard Tcl return value, plus an error message in - * the interp's result if an error occurs. + * A standard Tcl return value, plus an error message in the interp's + * result if an error occurs. * * Side effects: * The size and/or location of winPtr may change. @@ -3546,8 +3531,8 @@ ParseGeometry( Tcl_Interp *interp, /* Used for error reporting. */ char *string, /* String containing new geometry. Has the * standard form "=wxh+x+y". */ - TkWindow *winPtr) /* Pointer to top-level window whose - * geometry is to be changed. */ + TkWindow *winPtr) /* Pointer to top-level window whose geometry + * is to be changed. */ { WmInfo *wmPtr = winPtr->wmInfoPtr; int x, y, width, height, flags; @@ -3563,9 +3548,9 @@ ParseGeometry( } /* - * Parse the width and height, if they are present. Don't - * actually update any of the fields of wmPtr until we've - * successfully parsed the entire geometry string. + * Parse the width and height, if they are present. Don't actually update + * any of the fields of wmPtr until we've successfully parsed the entire + * geometry string. */ width = wmPtr->width; @@ -3619,10 +3604,10 @@ ParseGeometry( } /* - * Assume that the geometry information came from the user, - * unless an explicit source has been specified. Otherwise - * most window managers assume that the size hints were - * program-specified and they ignore them. + * Assume that the geometry information came from the user, unless an + * explicit source has been specified. Otherwise most window managers + * assume that the size hints were program-specified and they ignore + * them. */ if ((wmPtr->sizeHintsFlags & (USPosition|PPosition)) == 0) { @@ -3632,9 +3617,9 @@ ParseGeometry( } /* - * Everything was parsed OK. Update the fields of *wmPtr and - * arrange for the appropriate information to be percolated out - * to the window manager at the next idle moment. + * Everything was parsed OK. Update the fields of *wmPtr and arrange for + * the appropriate information to be percolated out to the window manager + * at the next idle moment. */ wmPtr->width = width; @@ -3654,12 +3639,12 @@ ParseGeometry( wmPtr->flags = flags; if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) { - Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr); + Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr); wmPtr->flags |= WM_UPDATE_PENDING; } return TCL_OK; -error: + error: Tcl_AppendResult(interp, "bad geometry specifier \"", string, "\"", NULL); return TCL_ERROR; } @@ -3669,15 +3654,15 @@ error: * * Tk_GetRootCoords -- * - * Given a token for a window, this procedure traces through the - * window's lineage to find the (virtual) root-window coordinates - * corresponding to point (0,0) in the window. + * Given a token for a window, this procedure traces through the window's + * lineage to find the (virtual) root-window coordinates corresponding to + * point (0,0) in the window. * * Results: - * The locations pointed to by xPtr and yPtr are filled in with - * the root coordinates of the (0,0) point in tkwin. If a virtual - * root window is in effect for the window, then the coordinates - * in the virtual root are returned. + * The locations pointed to by xPtr and yPtr are filled in with the root + * coordinates of the (0,0) point in tkwin. If a virtual root window is + * in effect for the window, then the coordinates in the virtual root are + * returned. * * Side effects: * None. @@ -3695,9 +3680,8 @@ Tk_GetRootCoords( TkWindow *winPtr = (TkWindow *) tkwin; /* - * Search back through this window's parents all the way to a - * top-level window, combining the offsets of each window within - * its parent. + * Search back through this window's parents all the way to a top-level + * window, combining the offsets of each window within its parent. */ x = y = 0; @@ -3714,15 +3698,16 @@ Tk_GetRootCoords( if (otherPtr != NULL) { /* - * The container window is in the same application. - * Query its coordinates. + * The container window is in the same application. Query + * its coordinates. */ + winPtr = otherPtr; /* - * Remember to offset by the container window here, - * since at the end of this if branch, we will - * pop out to the container's parent... + * Remember to offset by the container window here, since + * at the end of this if branch, we will pop out to the + * container's parent... */ x += winPtr->changes.x + winPtr->changes.border_width; @@ -3733,12 +3718,12 @@ Tk_GetRootCoords( if (tkMacOSXEmbedHandler->getOffsetProc != NULL) { /* - * We do not require that the changes.x & changes.y for - * a non-Tk master window be kept up to date. So we - * first subtract off the possibly bogus values that - * have been added on at the top of this pass through - * the loop, and then call out to the getOffsetProc to - * give us the correct offset. + * We do not require that the changes.x & changes.y + * for a non-Tk master window be kept up to date. So + * we first subtract off the possibly bogus values + * that have been added on at the top of this pass + * through the loop, and then call out to the + * getOffsetProc to give us the correct offset. */ x -= winPtr->changes.x + winPtr->changes.border_width; @@ -3765,14 +3750,14 @@ Tk_GetRootCoords( * * Tk_CoordsToWindow -- * - * This is a Macintosh specific implementation of this function. - * Given the root coordinates of a point, this procedure returns - * the token for the top-most window covering that point, if - * there exists such a window in this application. + * This is a Macintosh specific implementation of this function. Given + * the root coordinates of a point, this procedure returns the token for + * the top-most window covering that point, if there exists such a window + * in this application. * * Results: - * The return result is either a token for the window corresponding - * to rootX and rootY, or else NULL to indicate that there is no such + * The return result is either a token for the window corresponding to + * rootX and rootY, or else NULL to indicate that there is no such * window. * * Side effects: @@ -3783,19 +3768,19 @@ Tk_GetRootCoords( Tk_Window Tk_CoordsToWindow( - int rootX, int rootY, /* Coordinates of point in root window. If - * a virtual-root window manager is in use, + int rootX, int rootY, /* Coordinates of point in root window. If a + * virtual-root window manager is in use, * these coordinates refer to the virtual * root, not the real root. */ - Tk_Window tkwin) /* Token for any window in application; - * used to identify the display. */ + Tk_Window tkwin) /* Token for any window in application; used + * to identify the display. */ { WindowPtr whichWin; Point where; Window rootChild; TkWindow *winPtr, *childPtr; - TkWindow *nextPtr; /* Coordinates of highest child found so - * far that contains point. */ + TkWindow *nextPtr; /* Coordinates of highest child found so far + * that contains point. */ int x, y; /* Coordinates in winPtr. */ int tmpx, tmpy, bd; TkDisplay *dispPtr; @@ -3818,10 +3803,10 @@ Tk_CoordsToWindow( } /* - * Step 2: work down through the hierarchy underneath this window. - * At each level, scan through all the children to find the highest - * one in the stacking order that contains the point. Then repeat - * the whole process on that child. + * Step 2: work down through the hierarchy underneath this window. At each + * level, scan through all the children to find the highest one in the + * stacking order that contains the point. Then repeat the whole process + * on that child. */ x = rootX - winPtr->wmInfoPtr->xInParent; @@ -3888,13 +3873,12 @@ Tk_CoordsToWindow( * Given a Tk Window, and coordinates of a point relative to that window * this procedure returns the top-most child of the window (excluding * toplevels) covering that point, if there exists such a window in this - * application. - * It also sets newX, and newY to the coords of the point relative to the - * window returned. + * application. It also sets newX, and newY to the coords of the point + * relative to the window returned. * * Results: - * The return result is either a token for the window corresponding - * to rootX and rootY, or else NULL to indicate that there is no such + * The return result is either a token for the window corresponding to + * rootX and rootY, or else NULL to indicate that there is no such * window. newX and newY are also set to the coords of the point relative * to the returned window. * @@ -3906,15 +3890,15 @@ Tk_CoordsToWindow( Tk_Window Tk_TopCoordsToWindow( - Tk_Window tkwin, /* Token for a Tk Window which defines the; + Tk_Window tkwin, /* Token for a Tk Window which defines the * coordinates for rootX & rootY */ int rootX, int rootY, /* Coordinates of a point in tkWin. */ int *newX, int *newY) /* Coordinates of point in the upperMost child * of tkWin containing (rootX,rootY) */ { TkWindow *winPtr, *childPtr; - TkWindow *nextPtr; /* Coordinates of highest child found so - * far that contains point. */ + TkWindow *nextPtr; /* Coordinates of highest child found so far + * that contains point. */ int x, y; /* Coordinates in winPtr. */ Window *children; /* Children of winPtr, or NULL. */ @@ -3979,24 +3963,23 @@ Tk_TopCoordsToWindow( * * UpdateVRootGeometry -- * - * This procedure is called to update all the virtual root - * geometry information in wmPtr. + * This procedure is called to update all the virtual root geometry + * information in wmPtr. * * Results: * None. * * Side effects: - * The vRootX, vRootY, vRootWidth, and vRootHeight fields in - * wmPtr are filled with the most up-to-date information. + * The vRootX, vRootY, vRootWidth, and vRootHeight fields in wmPtr are + * filled with the most up-to-date information. * *---------------------------------------------------------------------- */ static void UpdateVRootGeometry( - WmInfo *wmPtr) /* Window manager information to be - * updated. The wmPtr->vRoot field must - * be valid. */ + WmInfo *wmPtr) /* Window manager information to be updated. + * The wmPtr->vRoot field must be valid. */ { TkWindow *winPtr = wmPtr->winPtr; unsigned int bd, dummy; @@ -4022,8 +4005,7 @@ UpdateVRootGeometry( * Refresh the virtual root information if it's out of date. */ - handler = Tk_CreateErrorHandler(winPtr->display, -1, -1, -1, - (Tk_ErrorProc *) NULL, (ClientData) NULL); + handler = Tk_CreateErrorHandler(winPtr->display, -1, -1, -1, NULL, NULL); status = XGetGeometry(winPtr->display, wmPtr->vRoot, &dummy2, &wmPtr->vRootX, &wmPtr->vRootY, &wmPtr->vRootWidth, &wmPtr->vRootHeight, &bd, &dummy); @@ -4035,7 +4017,7 @@ UpdateVRootGeometry( Tk_DeleteErrorHandler(handler); if (status == 0) { /* - * The virtual root is gone! Pretend that it never existed. + * The virtual root is gone! Pretend that it never existed. */ wmPtr->vRoot = None; @@ -4048,16 +4030,15 @@ UpdateVRootGeometry( * * Tk_GetVRootGeometry -- * - * This procedure returns information about the virtual root - * window corresponding to a particular Tk window. + * This procedure returns information about the virtual root window + * corresponding to a particular Tk window. * * Results: - * The values at xPtr, yPtr, widthPtr, and heightPtr are set - * with the offset and dimensions of the root window corresponding - * to tkwin. If tkwin is being managed by a virtual root window - * manager these values correspond to the virtual root window being - * used for tkwin; otherwise the offsets will be 0 and the - * dimensions will be those of the screen. + * The values at xPtr, yPtr, widthPtr, and heightPtr are set with the + * offset and dimensions of the root window corresponding to tkwin. If + * tkwin is being managed by a virtual root window manager these values + * correspond to the virtual root window being used for tkwin; otherwise + * the offsets will be 0 and the dimensions will be those of the screen. * * Side effects: * Vroot window information is refreshed if it is out of date. @@ -4088,8 +4069,8 @@ Tk_GetVRootGeometry( wmPtr = winPtr->wmInfoPtr; /* - * Make sure that the geometry information is up-to-date, then copy - * it out to the caller. + * Make sure that the geometry information is up-to-date, then copy it out + * to the caller. */ if (wmPtr->flags & WM_VROOT_OFFSET_STALE) { @@ -4106,18 +4087,17 @@ Tk_GetVRootGeometry( * * Tk_MoveToplevelWindow -- * - * This procedure is called instead of Tk_MoveWindow to adjust - * the x-y location of a top-level window. It delays the actual - * move to a later time and keeps window-manager information - * up-to-date with the move + * This procedure is called instead of Tk_MoveWindow to adjust the x-y + * location of a top-level window. It delays the actual move to a later + * time and keeps window-manager information up-to-date with the move. * * Results: * None. * * Side effects: * The window is eventually moved so that its upper-left corner - * (actually, the upper-left corner of the window's decorative - * frame, if there is one) is at (x,y). + * (actually, the upper-left corner of the window's decorative frame, if + * there is one) is at (x,y). * *---------------------------------------------------------------------- */ @@ -4125,8 +4105,7 @@ Tk_GetVRootGeometry( void Tk_MoveToplevelWindow( Tk_Window tkwin, /* Window to move. */ - int x, int y) /* New location for window (within - * parent). */ + int x, int y) /* New location for window (within parent). */ { TkWindow *winPtr = (TkWindow *) tkwin; WmInfo *wmPtr = winPtr->wmInfoPtr; @@ -4145,16 +4124,15 @@ Tk_MoveToplevelWindow( /* * If the window has already been mapped, must bring its geometry - * up-to-date immediately, otherwise an event might arrive from the - * server that would overwrite wmPtr->x and wmPtr->y and lose the - * new position. + * up-to-date immediately, otherwise an event might arrive from the server + * that would overwrite wmPtr->x and wmPtr->y and lose the new position. */ if (!(wmPtr->flags & WM_NEVER_MAPPED)) { if (wmPtr->flags & WM_UPDATE_PENDING) { - Tk_CancelIdleCall(UpdateGeometryInfo, (ClientData) winPtr); + Tk_CancelIdleCall(UpdateGeometryInfo, winPtr); } - UpdateGeometryInfo((ClientData) winPtr); + UpdateGeometryInfo(winPtr); } } @@ -4169,9 +4147,9 @@ Tk_MoveToplevelWindow( * None. * * Side effects: - * WinPtr gets restacked as specified by aboveBelow and otherPtr. - * This procedure doesn't return until the restack has taken - * effect and the ConfigureNotify event for it has been received. + * WinPtr gets restacked as specified by aboveBelow and otherPtr. This + * procedure doesn't return until the restack has taken effect and the + * ConfigureNotify event for it has been received. * *---------------------------------------------------------------------- */ @@ -4181,9 +4159,9 @@ TkWmRestackToplevel( TkWindow *winPtr, /* Window to restack. */ int aboveBelow, /* Gives relative position for restacking; * must be Above or Below. */ - TkWindow *otherPtr) /* Window relative to which to restack; - * if NULL, then winPtr gets restacked - * above or below *all* siblings. */ + TkWindow *otherPtr) /* Window relative to which to restack; if + * NULL, then winPtr gets restacked above or + * below *all* siblings. */ { WmInfo *wmPtr; @@ -4194,15 +4172,15 @@ TkWmRestackToplevel( /* * Get the mac window. Make sure it exists & is mapped. */ + if (winPtr->window == None) { Tk_MakeWindowExist((Tk_Window) winPtr); } if (winPtr->wmInfoPtr->flags & WM_NEVER_MAPPED) { - /* - * Can't set stacking order properly until the window is on the - * screen (mapping it may give it a reparent window), so make sure - * it's on the screen. + * Can't set stacking order properly until the window is on the screen + * (mapping it may give it a reparent window), so make sure it's on + * the screen. */ TkWmMapWindow(winPtr); @@ -4212,6 +4190,7 @@ TkWmRestackToplevel( /* * Get the window in which a raise or lower is in relation to. */ + if (otherPtr != NULL) { if (otherPtr->window == None) { Tk_MakeWindowExist((Tk_Window) otherPtr); @@ -4233,8 +4212,8 @@ TkWmRestackToplevel( */ } else if (otherMacWindow == frontWindow || otherMacWindow == NULL) { /* - * Raise the window to the top. If the window is visible then - * we also make it the active window. + * Raise the window to the top. If the window is visible then we + * also make it the active window. */ if (wmPtr->hints.initial_state == WithdrawnState) { @@ -4277,27 +4256,26 @@ TkWmRestackToplevel( * TkWmAddToColormapWindows -- * * This procedure is called to add a given window to the - * WM_COLORMAP_WINDOWS property for its top-level, if it - * isn't already there. It is invoked by the Tk code that - * creates a new colormap, in order to make sure that colormap - * information is propagated to the window manager by default. + * WM_COLORMAP_WINDOWS property for its top-level, if it isn't already + * there. It is invoked by the Tk code that creates a new colormap, in + * order to make sure that colormap information is propagated to the + * window manager by default. * * Results: * None. * * Side effects: - * WinPtr's window gets added to the WM_COLORMAP_WINDOWS - * property of its nearest top-level ancestor, unless the - * colormaps have been set explicitly with the - * "wm colormapwindows" command. + * WinPtr's window gets added to the WM_COLORMAP_WINDOWS property of its + * nearest top-level ancestor, unless the colormaps have been set + * explicitly with the "wm colormapwindows" command. * *---------------------------------------------------------------------- */ void TkWmAddToColormapWindows( - TkWindow *winPtr) /* Window with a non-default colormap. - * Should not be a top-level window. */ + TkWindow *winPtr) /* Window with a non-default colormap. Should + * not be a top-level window. */ { TkWindow *topPtr; TkWindow **oldPtr, **newPtr; @@ -4337,14 +4315,13 @@ TkWmAddToColormapWindows( } /* - * Make a new bigger array and use it to reset the property. - * Automatically add the toplevel itself as the last element - * of the list. + * Make a new bigger array and use it to reset the property. Automatically + * add the toplevel itself as the last element of the list. */ - newPtr = (TkWindow **) ckalloc((unsigned) ((count+2)*sizeof(TkWindow*))); + newPtr = (TkWindow **) ckalloc((unsigned) (count+2)*sizeof(TkWindow *)); if (count > 0) { - memcpy(newPtr, oldPtr, count * sizeof(TkWindow*)); + memcpy(newPtr, oldPtr, count * sizeof(TkWindow *)); } if (count == 0) { count++; @@ -4359,9 +4336,8 @@ TkWmAddToColormapWindows( topPtr->wmInfoPtr->cmapCount = count+1; /* - * On the Macintosh all of this is just an excercise - * in compatability as we don't support colormaps. If - * we did they would be installed here. + * On the Macintosh all of this is just an excercise in compatability as + * we don't support colormaps. If we did they would be installed here. */ } @@ -4371,16 +4347,16 @@ TkWmAddToColormapWindows( * TkWmRemoveFromColormapWindows -- * * This procedure is called to remove a given window from the - * WM_COLORMAP_WINDOWS property for its top-level. It is invoked - * when windows are deleted. + * WM_COLORMAP_WINDOWS property for its top-level. It is invoked when + * windows are deleted. * * Results: * None. * * Side effects: - * WinPtr's window gets removed from the WM_COLORMAP_WINDOWS - * property of its nearest top-level ancestor, unless the - * top-level itself is being deleted too. + * WinPtr's window gets removed from the WM_COLORMAP_WINDOWS property of + * its nearest top-level ancestor, unless the top-level itself is being + * deleted too. * *---------------------------------------------------------------------- */ @@ -4398,8 +4374,8 @@ TkWmRemoveFromColormapWindows( for (topPtr = winPtr->parentPtr; ; topPtr = topPtr->parentPtr) { if (topPtr == NULL) { /* - * Ancestors have been deleted, so skip the whole operation. - * Seems like this can't ever happen? + * Ancestors have been deleted, so skip the whole operation. Seems + * like this can't ever happen? */ return; @@ -4410,16 +4386,15 @@ TkWmRemoveFromColormapWindows( } if (topPtr->flags & TK_ALREADY_DEAD) { /* - * Top-level is being deleted, so there's no need to cleanup - * the WM_COLORMAP_WINDOWS property. + * Top-level is being deleted, so there's no need to cleanup the + * WM_COLORMAP_WINDOWS property. */ return; } /* - * Find the window and slide the following ones down to cover - * it up. + * Find the window and slide the following ones down to cover it up. */ count = topPtr->wmInfoPtr->cmapCount; @@ -4443,10 +4418,10 @@ TkWmRemoveFromColormapWindows( * Fetch the position of the mouse pointer. * * Results: - * *xPtr and *yPtr are filled in with the (virtual) root coordinates - * of the mouse pointer for tkwin's display. If the pointer isn't - * on tkwin's screen, then -1 values are returned for both - * coordinates. The argument tkwin must be a toplevel window. + * *xPtr and *yPtr are filled in with the (virtual) root coordinates of + * the mouse pointer for tkwin's display. If the pointer isn't on tkwin's + * screen, then -1 values are returned for both coordinates. The argument + * tkwin must be a toplevel window. * * Side effects: * None. @@ -4456,8 +4431,8 @@ TkWmRemoveFromColormapWindows( void TkGetPointerCoords( - Tk_Window tkwin, /* Toplevel window that identifies screen - * on which lookup is to be done. */ + Tk_Window tkwin, /* Toplevel window that identifies screen on + * which lookup is to be done. */ int *xPtr, int *yPtr) /* Store pointer coordinates here. */ { XQueryPointer(NULL, None, NULL, NULL, xPtr, yPtr, NULL, NULL, NULL); @@ -4468,10 +4443,10 @@ TkGetPointerCoords( * * InitialWindowBounds -- * - * This function calculates the initial bounds for a new Mac - * toplevel window. Unless the geometry is specified by the user - * this code will auto place the windows in a cascade diagonially - * across the main monitor of the Mac. + * This function calculates the initial bounds for a new Mac toplevel + * window. Unless the geometry is specified by the user this code will + * auto place the windows in a cascade diagonially across the main + * monitor of the Mac. * * Results: * The bounds are returned in geometry. @@ -4527,9 +4502,9 @@ InitialWindowBounds( * * TkMacOSXResizable -- * - * This function determines if the passed in window is part of - * a toplevel window that is resizable. If the window is - * resizable in the x, y or both directions, true is returned. + * This function determines if the passed in window is part of a toplevel + * window that is resizable. If the window is resizable in the x, y or + * both directions, true is returned. * * Results: * True if resizable, false otherwise. @@ -4567,10 +4542,10 @@ TkMacOSXResizable( * * TkMacOSXGrowToplevel -- * - * The function is invoked when the user clicks in the grow region - * of a Tk window. The function will handle the dragging - * procedure and not return until completed. Finally, the function - * may place information Tk's event queue is the window was resized. + * The function is invoked when the user clicks in the grow region of a + * Tk window. The function will handle the dragging procedure and not + * return until completed. Finally, the function may place information + * Tk's event queue is the window was resized. * * Results: * True if events were placed on event queue, false otherwise. @@ -4689,8 +4664,8 @@ TkMacOSXGrowToplevel( * * TkSetWMName -- * - * Set the title for a toplevel window. If the window is embedded, - * do not change the window title. + * Set the title for a toplevel window. If the window is embedded, do not + * change the window title. * * Results: * None. @@ -4712,7 +4687,7 @@ TkSetWMName( return; } - title = CFStringCreateWithBytes(NULL, (const unsigned char*) titleUid, + title = CFStringCreateWithBytes(NULL, (const unsigned char *) titleUid, strlen(titleUid), kCFStringEncodingUTF8, false); if (title) { WindowRef macWin = TkMacOSXDrawableWindow(winPtr->window); @@ -4727,8 +4702,8 @@ TkSetWMName( * * TkGetTransientMaster -- * - * If the passed window has the TRANSIENT_FOR property set this - * will return the master window. Otherwise it will return None. + * If the passed window has the TRANSIENT_FOR property set this will + * return the master window. Otherwise it will return None. * * Results: * The master window or None. @@ -4786,10 +4761,9 @@ TkMacOSXGetXWindow( * * TkMacOSXIsWindowZoomed -- * - * Ask Carbon if the given window is in the zoomed out state. - * Because dragging & growing a window can change the Carbon - * zoom state, we cannot rely on wmInfoPtr->hints.initial_state - * for this information. + * Ask Carbon if the given window is in the zoomed out state. Because + * dragging & growing a window can change the Carbon zoom state, we + * cannot rely on wmInfoPtr->hints.initial_state for this information. * * Results: * True if window is zoomed out, false otherwise. @@ -4846,11 +4820,10 @@ TkMacOSXIsWindowZoomed( * * TkMacOSXZoomToplevel -- * - * The function is invoked when the user clicks in the zoom region - * of a Tk window or when the window state is set/unset to "zoomed" - * manually. If the window is to be zoomed (in or out), the window - * size is changed and events are generated to let Tk know what - * happened. + * The function is invoked when the user clicks in the zoom region of a + * Tk window or when the window state is set/unset to "zoomed" manually. + * If the window is to be zoomed (in or out), the window size is changed + * and events are generated to let Tk know what happened. * * Results: * True if events were placed on event queue, false otherwise. @@ -4915,13 +4888,12 @@ TkMacOSXZoomToplevel( } err = ChkErr(ZoomWindowIdeal, whichWindow, zoomPart, &idealSize); - if (err == noErr) { - wmPtr->hints.initial_state = - (zoomPart == inZoomIn ? NormalState : ZoomState); - return true; - } else { + if (err != noErr) { return false; } + wmPtr->hints.initial_state = + (zoomPart == inZoomIn ? NormalState : ZoomState); + return true; } /* @@ -4930,9 +4902,8 @@ TkMacOSXZoomToplevel( * TkUnsupported1Cmd -- * * This procedure is invoked to process the - * "::tk::unsupported::MacWindowStyle" Tcl command. - * This command allows you to set the style of decoration - * for a Macintosh window. + * "::tk::unsupported::MacWindowStyle" Tcl command. This command allows + * you to set the style of decoration for a Macintosh window. * * Results: * A standard Tcl result. @@ -4946,11 +4917,10 @@ TkMacOSXZoomToplevel( /* ARGSUSED */ int TkUnsupported1ObjCmd( - ClientData clientData, /* Main window associated with - * interpreter. */ + ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj * const objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { static const char *subcmds[] = { "style", NULL @@ -4958,7 +4928,7 @@ TkUnsupported1ObjCmd( enum SubCmds { TKMWS_STYLE }; - Tk_Window tkwin = (Tk_Window) clientData; + Tk_Window tkwin = clientData; TkWindow *winPtr; int index; @@ -4967,8 +4937,8 @@ TkUnsupported1ObjCmd( return TCL_ERROR; } - winPtr = (TkWindow *) Tk_NameToWindow(interp, - Tcl_GetString(objv[2]), tkwin); + winPtr = (TkWindow *) + Tk_NameToWindow(interp, Tcl_GetString(objv[2]), tkwin); if (winPtr == NULL) { return TCL_ERROR; } @@ -5000,9 +4970,8 @@ TkUnsupported1ObjCmd( * WmWinStyle -- * * This procedure is invoked to process the - * "::tk::unsupported::MacWindowStyle style" subcommand. - * This command allows you to set the style of decoration - * for a Macintosh window. + * "::tk::unsupported::MacWindowStyle style" subcommand. This command + * allows you to set the style of decoration for a Macintosh window. * * Results: * A standard Tcl result. @@ -5012,6 +4981,7 @@ TkUnsupported1ObjCmd( * *---------------------------------------------------------------------- */ + static int WmWinStyle( Tcl_Interp *interp, /* Current interpreter. */ @@ -5100,7 +5070,7 @@ WmWinStyle( if (objc == 3) { if (wmPtr->style != -1) { for (i = 0; styleMap[i].strValue != NULL; i++) { - if (wmPtr->style == (short)(styleMap[i].intValue)) { + if (wmPtr->style == (short) styleMap[i].intValue) { Tcl_SetObjResult(interp, Tcl_NewStringObj(styleMap[i].strValue, -1)); return TCL_OK; @@ -5201,8 +5171,8 @@ WmWinStyle( * * TkpMakeMenuWindow -- * - * Configure the window to be either a undecorated pull-down - * (or pop-up) menu, or as a toplevel floating menu (palette). + * Configure the window to be either a undecorated pull-down (or pop-up) + * menu, or as a toplevel floating menu (palette). * * Results: * None. @@ -5216,10 +5186,10 @@ WmWinStyle( void TkpMakeMenuWindow( Tk_Window tkwin, /* New window. */ - int transient) /* 1 means menu is only posted briefly as - * a popup or pulldown or cascade. 0 means - * menu is always visible, e.g. as a - * floating menu. */ + int transient) /* 1 means menu is only posted briefly as a + * popup or pulldown or cascade. 0 means menu + * is always visible, e.g. as a floating + * menu. */ { TkWindow *winPtr = (TkWindow *) tkwin; @@ -5239,8 +5209,8 @@ TkpMakeMenuWindow( * * TkMacOSXMakeRealWindowExist -- * - * This function finally creates the real Macintosh window that - * the Mac actually understands. + * This function finally creates the real Macintosh window that the Mac + * actually understands. * * Results: * None. @@ -5390,8 +5360,8 @@ TkMacOSXMakeRealWindowExist( * * TkMacOSXRegisterOffScreenWindow -- * - * This function adds the passed in Off Screen Port to the - * hash table that maps Mac windows to root X windows. + * This function adds the passed in Off Screen Port to the hash table + * that maps Mac windows to root X windows. * * Results: * None. @@ -5426,9 +5396,8 @@ TkMacOSXRegisterOffScreenWindow( * * TkMacOSXUnregisterMacWindow -- * - * Given a macintosh port window, this function removes the - * association between this window and the root X window that - * Tk cares about. + * Given a macintosh port window, this function removes the association + * between this window and the root X window that Tk cares about. * * Results: * None. @@ -5461,9 +5430,8 @@ TkMacOSXUnregisterMacWindow( * * TkMacOSXSetScrollbarGrow -- * - * Sets a flag for a toplevel window indicating that the passed - * Tk scrollbar window will display the grow region for the - * toplevel window. + * Sets a flag for a toplevel window indicating that the passed Tk + * scrollbar window will display the grow region for the toplevel window. * * Results: * None. @@ -5495,15 +5463,15 @@ TkMacOSXSetScrollbarGrow( * TkWmFocusToplevel -- * * This is a utility procedure invoked by focus-management code. It - * exists because of the extra wrapper windows that exist under - * Unix; its job is to map from wrapper windows to the - * corresponding toplevel windows. On PCs and Macs there are no - * wrapper windows so no mapping is necessary; this procedure just - * determines whether a window is a toplevel or not. + * exists because of the extra wrapper windows that exist under Unix; its + * job is to map from wrapper windows to the corresponding toplevel + * windows. On PCs and Macs there are no wrapper windows so no mapping is + * necessary; this procedure just determines whether a window is a + * toplevel or not. * * Results: - * If winPtr is a toplevel window, returns the pointer to the - * window; otherwise returns NULL. + * If winPtr is a toplevel window, returns the pointer to the window; + * otherwise returns NULL. * * Side effects: * None. @@ -5527,13 +5495,13 @@ TkWmFocusToplevel( * * TkpGetWrapperWindow -- * - * This is a utility procedure invoked by focus-management code. It - * maps to the wrapper for a top-level, which is just the same - * as the top-level on Macs and PCs. + * This is a utility procedure invoked by focus-management code. It maps + * to the wrapper for a top-level, which is just the same as the + * top-level on Macs and PCs. * * Results: - * If winPtr is a toplevel window, returns the pointer to the - * window; otherwise returns NULL. + * If winPtr is a toplevel window, returns the pointer to the window; + * otherwise returns NULL. * * Side effects: * None. @@ -5557,8 +5525,8 @@ TkpGetWrapperWindow( * * TkpWmSetState -- * - * Sets the window manager state for the wrapper window of a - * given toplevel window. + * Sets the window manager state for the wrapper window of a given + * toplevel window. * * Results: * None. @@ -5570,9 +5538,9 @@ TkpGetWrapperWindow( */ void -TkpWmSetState(winPtr, state) - TkWindow *winPtr; /* Toplevel window to operate on. */ - int state; /* One of IconicState, ZoomState, NormalState, +TkpWmSetState( + TkWindow *winPtr, /* Toplevel window to operate on. */ + int state) /* One of IconicState, ZoomState, NormalState, * or WithdrawnState. */ { WmInfo *wmPtr = winPtr->wmInfoPtr; @@ -5589,9 +5557,10 @@ TkpWmSetState(winPtr, state) Tk_UnmapWindow((Tk_Window) winPtr); } else if (state == IconicState) { /* - * The window always gets unmapped. If we can show the - * icon version of the window we also collapse it. + * The window always gets unmapped. If we can show the icon version of + * the window we also collapse it. */ + if (IsWindowCollapsable(macWin) && !IsWindowCollapsed(macWin)) { CollapseWindow(macWin, true); } @@ -5669,9 +5638,9 @@ TkMacOSXWindowClass( * * TkMacOSXWindowOffset -- * - * Determines the x and y offset from the orgin of the toplevel - * window dressing (the structure region, ie. title bar) and the - * orgin of the content area. + * Determines the x and y offset from the orgin of the toplevel window + * dressing (the structure region, i.e. title bar) and the orgin of the + * content area. * * Results: * The x & y offset in pixels. @@ -5704,8 +5673,8 @@ TkMacOSXWindowOffset( * * TkpGetMS -- * - * Return a relative time in milliseconds. It doesn't matter - * when the epoch was. + * Return a relative time in milliseconds. It doesn't matter when the + * epoch was. * * Results: * Number of milliseconds. @@ -5758,15 +5727,14 @@ XSetInputFocus( * * TkpChangeFocus -- * - * This procedure is a stub on the Mac because we always own the - * focus if we are a front most application. + * This procedure is a stub on the Mac because we always own the focus if + * we are a front most application. * * Results: - * The return value is the serial number of the command that - * changed the focus. It may be needed by the caller to filter - * out focus change events that were queued before the command. - * If the procedure doesn't actually change the focus then - * it returns 0. + * The return value is the serial number of the command that changed the + * focus. It may be needed by the caller to filter out focus change + * events that were queued before the command. If the procedure doesn't + * actually change the focus then it returns 0. * * Side effects: * None. @@ -5775,15 +5743,15 @@ XSetInputFocus( */ int -TkpChangeFocus(winPtr, force) - TkWindow *winPtr; /* Window that is to receive the X focus. */ - int force; /* Non-zero means claim the focus even - * if it didn't originally belong to - * topLevelPtr's application. */ +TkpChangeFocus( + TkWindow *winPtr, /* Window that is to receive the X focus. */ + int force) /* Non-zero means claim the focus even if it + * didn't originally belong to topLevelPtr's + * application. */ { /* - * We don't really need to do anything on the Mac. Tk will - * keep all this state for us. + * We don't really need to do anything on the Mac. Tk will keep all this + * state for us. */ if (winPtr->atts.override_redirect) { @@ -5791,10 +5759,10 @@ TkpChangeFocus(winPtr, force) } /* - * Remember the current serial number for the X server and issue - * a dummy server request. This marks the position at which we - * changed the focus, so we can distinguish FocusIn and FocusOut - * events on either side of the mark. + * Remember the current serial number for the X server and issue a dummy + * server request. This marks the position at which we changed the focus, + * so we can distinguish FocusIn and FocusOut events on either side of the + * mark. */ return NextRequest(winPtr->display); @@ -5805,13 +5773,12 @@ TkpChangeFocus(winPtr, force) * * WmStackorderToplevelWrapperMap -- * - * This procedure will create a table that maps the reparent wrapper - * X id for a toplevel to the TkWindow structure that is wraps. - * Tk keeps track of a mapping from the window X id to the TkWindow - * structure but that does us no good here since we only get the X - * id of the wrapper window. Only those toplevel windows that are - * mapped have a position in the stacking order. - * + * This procedure will create a table that maps the reparent wrapper X id + * for a toplevel to the TkWindow structure that is wraps. Tk keeps track + * of a mapping from the window X id to the TkWindow structure but that + * does us no good here since we only get the X id of the wrapper window. + * Only those toplevel windows that are mapped have a position in the + * stacking order. * * Results: * None. @@ -5838,7 +5805,7 @@ WmStackorderToplevelWrapperMap( macWindow = TkMacOSXDrawableWindow(winPtr->window); hPtr = Tcl_CreateHashEntry(table, - (const char *) macWindow, &newEntry); + (const char *) macWindow, &newEntry); Tcl_SetHashValue(hPtr, winPtr); } @@ -5856,8 +5823,8 @@ WmStackorderToplevelWrapperMap( * This procedure returns the stack order of toplevel windows. * * Results: - * An array of pointers to tk window objects in stacking order - * or else NULL if there was an error. + * An array of pointers to tk window objects in stacking order or else + * NULL if there was an error. * * Side effects: * None. @@ -5866,8 +5833,8 @@ WmStackorderToplevelWrapperMap( */ TkWindow ** -TkWmStackorderToplevel(parentPtr) - TkWindow *parentPtr; /* Parent toplevel window. */ +TkWmStackorderToplevel( + TkWindow *parentPtr) /* Parent toplevel window. */ { WindowRef frontWindow; TkWindow *childWinPtr, **windows, **window_ptr; @@ -5882,12 +5849,12 @@ TkWmStackorderToplevel(parentPtr) Tcl_InitHashTable(&table, TCL_ONE_WORD_KEYS); WmStackorderToplevelWrapperMap(parentPtr, parentPtr->display, &table); - windows = (TkWindow **) ckalloc((table.numEntries+1) - * sizeof(TkWindow *)); + windows = (TkWindow **) + ckalloc((table.numEntries+1) * sizeof(TkWindow *)); /* - * Special cases: If zero or one toplevels were mapped - * there is no need to enumerate Windows. + * Special cases: If zero or one toplevels were mapped there is no need to + * enumerate Windows. */ switch (table.numEntries) { @@ -5896,7 +5863,7 @@ TkWmStackorderToplevel(parentPtr) goto done; case 1: hPtr = Tcl_FirstHashEntry(&table, &search); - windows[0] = (TkWindow *) Tcl_GetHashValue(hPtr); + windows[0] = Tcl_GetHashValue(hPtr); windows[1] = NULL; goto done; } @@ -5908,20 +5875,21 @@ TkWmStackorderToplevel(parentPtr) } else { window_ptr = windows + table.numEntries; *window_ptr-- = NULL; - while (frontWindow != NULL) { - hPtr = Tcl_FindHashEntry(&table, (char *) frontWindow); - if (hPtr != NULL) { - childWinPtr = (TkWindow *) Tcl_GetHashValue(hPtr); - *window_ptr-- = childWinPtr; - } - frontWindow = GetNextWindow(frontWindow); + while (frontWindow != NULL) { + hPtr = Tcl_FindHashEntry(&table, (char *) frontWindow); + if (hPtr != NULL) { + childWinPtr = (TkWindow *) Tcl_GetHashValue(hPtr); + *window_ptr-- = childWinPtr; } - if (window_ptr != (windows-1)) + frontWindow = GetNextWindow(frontWindow); + } + if (window_ptr != (windows-1)) { Tcl_Panic("num matched toplevel windows does not equal num " "children"); + } } - done: + done: Tcl_DeleteHashTable(&table); return windows; } @@ -5977,7 +5945,7 @@ ApplyWindowClassAttributeChanges( if (wmPtr->macClass != oldClass) { TK_IF_MAC_OS_X_API (4, HIWindowChangeClass, ChkErr(HIWindowChangeClass, macWindow, wmPtr->macClass); - ) TK_ENDIF + ) TK_ENDIF; ChkErr(GetWindowClass, macWindow, &(wmPtr->macClass)); } if (newAttributes != oldAttributes) { @@ -5998,7 +5966,7 @@ ApplyWindowClassAttributeChanges( } } TkMacOSXInvalClipRgns((Tk_Window) winPtr); - TkMacOSXInvalidateWindow((MacDrawable *)(winPtr->window), + TkMacOSXInvalidateWindow((MacDrawable *) winPtr->window, TK_PARENT_WINDOW); } @@ -6006,6 +5974,7 @@ ApplyWindowClassAttributeChanges( * The change of window class/attributes might have changed the window * structure widths: */ + GetWindowStructureWidths(macWindow, &strWidths); wmPtr->xInParent = strWidths.left; wmPtr->yInParent = strWidths.top; @@ -6068,7 +6037,7 @@ ApplyMasterOverrideChanges( WindowGroupRef group; ApplyWindowClassAttributeChanges(winPtr, macWindow, oldClass, - oldAttributes, 0); + oldAttributes, 0); if (winPtr->atts.override_redirect && wmPtr->master != None) { wmPtr->flags |= WM_TOPMOST; @@ -6109,8 +6078,8 @@ WmGetWindowGroup( group = GetWindowGroupOfClass(kUtilityWindowClass); } else if (wmPtr->master != None) { TkDisplay *dispPtr = TkGetDisplayList(); - TkWindow *masterWinPtr = (TkWindow *)Tk_IdToWindow(dispPtr->display, - wmPtr->master); + TkWindow *masterWinPtr = (TkWindow *) + Tk_IdToWindow(dispPtr->display, wmPtr->master); if (masterWinPtr && masterWinPtr->window != None && TkMacOSXHostToplevelExists(masterWinPtr)) { @@ -6165,9 +6134,11 @@ TkMacOSXMakeFullscreen( if (fullscreen) { int screenWidth = WidthOfScreen(Tk_Screen(winPtr)); int screenHeight = HeightOfScreen(Tk_Screen(winPtr)); + /* * Check max width and height if set by the user. */ + if ((wmPtr->maxWidth > 0 && wmPtr->maxWidth < screenWidth) || (wmPtr->maxHeight > 0 && wmPtr->maxHeight < screenHeight)) { if (interp) { @@ -6272,8 +6243,8 @@ TkMacOSXEnterExitFullscreen( * * GetMinSize -- * - * This function computes the current minWidth and minHeight values for - * a window, taking into account the possibility that they may be + * This function computes the current minWidth and minHeight values for a + * window, taking into account the possibility that they may be * defaulted. * * Results: @@ -6307,41 +6278,43 @@ GetMinSize( */ switch (wmPtr->macClass) { - case kDocumentWindowClass: - case kMovableAlertWindowClass: - case kMovableModalWindowClass: - minWidth = 72; - if (wmPtr->attributes & kWindowResizableAttribute) { - minHeight = 15; - } - if (wmPtr->attributes & kWindowToolbarButtonAttribute) { - minWidth += 29; - } - break; - case kFloatingWindowClass: - case kUtilityWindowClass: - minWidth = 59; - if (wmPtr->attributes & kWindowResizableAttribute) { - minHeight = 11; - } - if (wmPtr->attributes & kWindowSideTitlebarAttribute) { - int tmp = minWidth; - minWidth = minHeight; - minHeight = tmp; - } else if (wmPtr->attributes & kWindowToolbarButtonAttribute) { - minWidth += 29; - } - break; - default: - if (wmPtr->attributes & kWindowResizableAttribute) { - minWidth = 15; - minHeight = 15; - } - break; + case kDocumentWindowClass: + case kMovableAlertWindowClass: + case kMovableModalWindowClass: + minWidth = 72; + if (wmPtr->attributes & kWindowResizableAttribute) { + minHeight = 15; + } + if (wmPtr->attributes & kWindowToolbarButtonAttribute) { + minWidth += 29; + } + break; + case kFloatingWindowClass: + case kUtilityWindowClass: + minWidth = 59; + if (wmPtr->attributes & kWindowResizableAttribute) { + minHeight = 11; + } + if (wmPtr->attributes & kWindowSideTitlebarAttribute) { + int tmp = minWidth; + + minWidth = minHeight; + minHeight = tmp; + } else if (wmPtr->attributes & kWindowToolbarButtonAttribute) { + minWidth += 29; + } + break; + default: + if (wmPtr->attributes & kWindowResizableAttribute) { + minWidth = 15; + minHeight = 15; + } + break; } if (wmPtr->gridWin != NULL) { int base = winPtr->reqWidth - (wmPtr->reqGridWidth * wmPtr->widthInc); + if (base < 0) { base = 0; } @@ -6367,8 +6340,8 @@ GetMinSize( * * GetMaxSize -- * - * This function computes the current maxWidth and maxHeight values for - * a window, taking into account the possibility that they may be + * This function computes the current maxWidth and maxHeight values for a + * window, taking into account the possibility that they may be * defaulted. * * Results: @@ -6398,6 +6371,7 @@ GetMaxSize( *maxWidthPtr = wmPtr->maxWidth; } else { int maxWidth = maxBounds->right - maxBounds->left - wmPtr->xInParent; + if (wmPtr->gridWin != NULL) { maxWidth = wmPtr->reqGridWidth + (maxWidth - winPtr->reqWidth)/wmPtr->widthInc; @@ -6408,6 +6382,7 @@ GetMaxSize( *maxHeightPtr = wmPtr->maxHeight; } else { int maxHeight = maxBounds->bottom - maxBounds->top - wmPtr->yInParent; + if (wmPtr->gridWin != NULL) { maxHeight = wmPtr->reqGridHeight + (maxHeight - winPtr->reqHeight)/wmPtr->heightInc; @@ -6421,8 +6396,7 @@ GetMaxSize( * * RemapWindows * - * Adjust parent/child relation ships of - * the given window hierarchy. + * Adjust parent/child relation ships of the given window hierarchy. * * Results: * none @@ -6432,16 +6406,22 @@ GetMaxSize( * *---------------------------------------------------------------------- */ + static void -RemapWindows(TkWindow *winPtr, MacDrawable *parentWin) +RemapWindows( + TkWindow *winPtr, + MacDrawable *parentWin) { TkWindow *childPtr; - /* Remove the OS specific window. - * It will get rebuilt when the window gets Mapped. + /* + * Remove the OS specific window. It will get rebuilt when the window gets + * Mapped. */ + if (winPtr->window != None) { MacDrawable *macWin = (MacDrawable *) winPtr->window; + macWin->grafPtr = NULL; macWin->toplevel = parentWin->toplevel; winPtr->flags &= ~TK_MAPPED; diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c index 2e66cb4..d936d9c 100644 --- a/macosx/tkMacOSXXStubs.c +++ b/macosx/tkMacOSXXStubs.c @@ -1,19 +1,19 @@ /* * tkMacOSXXStubs.c -- * - * This file contains most of the X calls called by Tk. Many of - * these calls are just stubs and either don't make sense on the - * Macintosh or thier implamentation just doesn't do anything. Other - * calls will eventually be moved into other files. + * This file contains most of the X calls called by Tk. Many of these + * calls are just stubs and either don't make sense on the Macintosh or + * their implamentation just doesn't do anything. Other calls will + * eventually be moved into other files. * * Copyright (c) 1995-1997 Sun Microsystems, Inc. * Copyright 2001, Apple Computer, Inc. * Copyright (c) 2005-2007 Daniel A. Steffen * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * See the file "license.terms" for information on usage and redistribution of + * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXXStubs.c,v 1.25 2007/12/13 15:27:10 dgp Exp $ + * RCS: @(#) $Id: tkMacOSXXStubs.c,v 1.26 2008/04/27 22:39:12 dkf Exp $ */ #include "tkMacOSXPrivate.h" @@ -23,8 +23,8 @@ /* * Because this file is still under major development Debugger statements are - * used through out this file. The define TCL_DEBUG will decide whether - * the debugger statements actually call the debugger or not. + * used through out this file. The define TCL_DEBUG will decide whether the + * debugger statements actually call the debugger or not. */ #ifndef TCL_DEBUG @@ -37,29 +37,32 @@ * Declarations of static variables used in this file. */ -static TkDisplay *gMacDisplay = NULL; /* Macintosh display. */ -static const char *macScreenName = ":0"; /* Default name of macintosh display. */ +static TkDisplay *gMacDisplay = NULL; + /* Macintosh display. */ +static const char *macScreenName = ":0"; + /* Default name of macintosh display. */ /* * Forward declarations of procedures used in this file. */ -static XID MacXIdAlloc(Display *display); -static int DefaultErrorHandler(Display* display, XErrorEvent* err_evt); +static XID MacXIdAlloc(Display *display); +static int DefaultErrorHandler(Display *display, + XErrorEvent *err_evt); /* * Other declarations */ -static int DestroyImage(XImage *image); -static unsigned long ImageGetPixel(XImage *image, int x, int y); -static int PutPixel(XImage *image, int x, int y, unsigned long pixel); +static int DestroyImage(XImage *image); +static unsigned long ImageGetPixel(XImage *image, int x, int y); +static int PutPixel(XImage *image, int x, int y, + unsigned long pixel); #if 0 -static XImage *SubImage(XImage *image, int x, int y, - unsigned int width, unsigned int height); -static int AddPixel(XImage *image, long value); +static XImage * SubImage(XImage *image, int x, int y, + unsigned int width, unsigned int height); +static int AddPixel(XImage *image, long value); #endif - /* *---------------------------------------------------------------------- @@ -79,7 +82,8 @@ static int AddPixel(XImage *image, long value); */ void -TkMacOSXDisplayChanged(Display *display) +TkMacOSXDisplayChanged( + Display *display) { GDHandle graphicsDevice; Screen *screen; @@ -91,17 +95,17 @@ TkMacOSXDisplayChanged(Display *display) screen = display->screens; graphicsDevice = GetMainDevice(); - screen->root_depth = (*(*graphicsDevice)->gdPMap)->cmpSize * - (*(*graphicsDevice)->gdPMap)->cmpCount; - screen->height = (*graphicsDevice)->gdRect.bottom - - (*graphicsDevice)->gdRect.top; - screen->width = (*graphicsDevice)->gdRect.right - - (*graphicsDevice)->gdRect.left; + screen->root_depth = (*(*graphicsDevice)->gdPMap)->cmpSize * + (*(*graphicsDevice)->gdPMap)->cmpCount; + screen->height = (*graphicsDevice)->gdRect.bottom - + (*graphicsDevice)->gdRect.top; + screen->width = (*graphicsDevice)->gdRect.right - + (*graphicsDevice)->gdRect.left; - screen->mwidth = (screen->width * 254 + 360) / 720; - screen->mheight = (screen->height * 254 + 360) / 720; + screen->mwidth = (screen->width * 254 + 360) / 720; + screen->mheight = (screen->height * 254 + 360) / 720; - maxBounds = (Rect*) screen->ext_data; + maxBounds = (Rect *) screen->ext_data; *maxBounds = bounds; graphicsDevice = GetDeviceList(); while (graphicsDevice) { @@ -121,8 +125,8 @@ TkMacOSXDisplayChanged(Display *display) * * TkpOpenDisplay -- * - * Create the Display structure and fill it with device - * specific information. + * Create the Display structure and fill it with device specific + * information. * * Results: * Returns a Display structure on success or NULL on failure. @@ -135,7 +139,7 @@ TkMacOSXDisplayChanged(Display *display) TkDisplay * TkpOpenDisplay( - CONST char *display_name) + const char *display_name) { Display *display; Screen *screen; @@ -162,13 +166,13 @@ TkpOpenDisplay( display->screens = screen; display->nscreens = 1; display->default_screen = 0; - display->display_name = (char*)macScreenName; + display->display_name = (char *) macScreenName; - Gestalt(gestaltQuickdrawVersion, (long*)&display->proto_minor_version); + Gestalt(gestaltQuickdrawVersion, (long *) &display->proto_minor_version); display->proto_major_version = 10; display->proto_minor_version -= gestaltMacOSXQD; display->vendor = "Apple"; - Gestalt(gestaltSystemVersion, (long*)&display->release); + Gestalt(gestaltSystemVersion, (long *) &display->release); /* * These screen bits never change @@ -177,7 +181,7 @@ TkpOpenDisplay( screen->display = display; screen->black_pixel = 0x00000000 | PIXEL_MAGIC << 24; screen->white_pixel = 0x00FFFFFF | PIXEL_MAGIC << 24; - screen->ext_data = (XExtData*) &maxBounds; + screen->ext_data = (XExtData *) &maxBounds; screen->root_visual = (Visual *) ckalloc(sizeof(Visual)); screen->root_visual->visualid = 0; @@ -191,13 +195,14 @@ TkpOpenDisplay( /* * Initialize screen bits that may change */ + TkMacOSXDisplayChanged(display); gMacDisplay = (TkDisplay *) ckalloc(sizeof(TkDisplay)); /* - * This is the quickest way to make sure that all the *Init - * flags get properly initialized + * This is the quickest way to make sure that all the *Init flags get + * properly initialized */ bzero(gMacDisplay, sizeof(TkDisplay)); @@ -226,13 +231,14 @@ TkpCloseDisplay( TkDisplay *displayPtr) { Display *display = displayPtr->display; + if (gMacDisplay != displayPtr) { Tcl_Panic("TkpCloseDisplay: tried to call TkpCloseDisplay on bad display"); } gMacDisplay = NULL; - if (display->screens != (Screen *) NULL) { - if (display->screens->root_visual != (Visual *) NULL) { + if (display->screens != NULL) { + if (display->screens->root_visual != NULL) { ckfree((char *) display->screens->root_visual); } ckfree((char *) display->screens); @@ -245,11 +251,10 @@ TkpCloseDisplay( * * TkClipCleanup -- * - * This procedure is called to cleanup resources associated with - * claiming clipboard ownership and for receiving selection get - * results. This function is called in tkWindow.c. This has to be - * called by the display cleanup function because we still need the - * access display elements. + * This procedure is called to cleanup resources associated with claiming + * clipboard ownership and for receiving selection get results. This + * function is called in tkWindow.c. This has to be called by the display + * cleanup function because we still need the access display elements. * * Results: * None. @@ -261,12 +266,12 @@ TkpCloseDisplay( */ void -TkClipCleanup(dispPtr) - TkDisplay *dispPtr; /* display associated with clipboard */ +TkClipCleanup( + TkDisplay *dispPtr) /* display associated with clipboard */ { /* - * Make sure that the local scrap is transfered to the global - * scrap if needed. + * Make sure that the local scrap is transfered to the global scrap if + * needed. */ TkSuspendClipboard(); @@ -278,7 +283,7 @@ TkClipCleanup(dispPtr) dispPtr->windowAtom); Tk_DestroyWindow(dispPtr->clipWindow); - Tcl_Release((ClientData) dispPtr->clipWindow); + Tcl_Release(dispPtr->clipWindow); dispPtr->clipWindow = NULL; } } @@ -288,31 +293,31 @@ TkClipCleanup(dispPtr) * * MacXIdAlloc -- * - * This procedure is invoked by Xlib as the resource allocator - * for a display. + * 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. + * 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. + * The identifier is removed from the stack of free identifiers, if it + * was previously on the stack. * *---------------------------------------------------------------------- */ static XID MacXIdAlloc( - Display *display) /* Display for which to allocate. */ + Display *display) /* Display for which to allocate. */ { - static long int cur_id = 100; - /* - * Some special XIds are reserved - * - this is why we start at 100 - */ + static long int cur_id = 100; + /* + * Some special XIds are reserved + * - this is why we start at 100 + */ - return ++cur_id; + return ++cur_id; } /* @@ -347,8 +352,8 @@ TkpWindowWasRecentlyDeleted( * * DefaultErrorHandler -- * - * This procedure is the default X error handler. Tk uses it's - * own error handler so this call should never be called. + * This procedure is the default X error handler. Tk uses it's own error + * handler so this call should never be called. * * Results: * None. @@ -365,14 +370,14 @@ DefaultErrorHandler( XErrorEvent* err_evt) { /* - * This call should never be called. Tk replaces - * it with its own error handler. + * This call should never be called. Tk replaces it with its own error + * handler. */ + Tcl_Panic("Warning hit bogus error handler!"); return 0; } - char * XGetAtomName( Display * display, @@ -383,7 +388,8 @@ XGetAtomName( } int -_XInitImageFuncPtrs(XImage *image) +_XInitImageFuncPtrs( + XImage *image) { return 0; } @@ -396,24 +402,25 @@ XSetErrorHandler( } Window -XRootWindow(Display *display, int screen_number) +XRootWindow( + Display *display, + int screen_number) { display->request++; return ROOT_ID; } int -XGetGeometry(display, d, root_return, x_return, y_return, width_return, - height_return, border_width_return, depth_return) - Display* display; - Drawable d; - Window* root_return; - int* x_return; - int* y_return; - unsigned int* width_return; - unsigned int* height_return; - unsigned int* border_width_return; - unsigned int* depth_return; +XGetGeometry( + Display *display, + Drawable d, + Window *root_return, + int *x_return, + int *y_return, + unsigned int *width_return, + unsigned int *height_return, + unsigned int *border_width_return, + unsigned int *depth_return) { TkWindow *winPtr = ((MacDrawable *) d)->winPtr; @@ -488,8 +495,8 @@ XSizeHints * XAllocSizeHints(void) { /* - * Always return NULL. Tk code checks to see if NULL - * is returned & does nothing if it is. + * Always return NULL. Tk code checks to see if NULL is returned & does + * nothing if it is. */ return NULL; @@ -670,10 +677,11 @@ XForceScreenSaver( int mode) { /* - * This function is just a no-op. It is defined to - * reset the screen saver. However, there is no real - * way to do this on a Mac. Let me know if there is! + * This function is just a no-op. It is defined to reset the screen saver. + * However, there is no real way to do this on a Mac. Let me know if there + * is! */ + display->request++; } @@ -727,9 +735,9 @@ XSetClipRectangles( * * TkGetServerInfo -- * - * Given a window, this procedure returns information about - * the window server for that window. This procedure provides - * the guts of the "winfo server" command. + * Given a window, this procedure returns information about the window + * server for that window. This procedure provides the guts of the "winfo + * server" command. * * Results: * None. @@ -742,10 +750,10 @@ XSetClipRectangles( void TkGetServerInfo( - Tcl_Interp *interp, /* The server information is returned in - * this interpreter's result. */ - Tk_Window tkwin) /* Token for window; this selects a - * particular display and server. */ + Tcl_Interp *interp, /* The server information is returned in this + * interpreter's result. */ + Tk_Window tkwin) /* Token for window; this selects a particular + * display and server. */ { char buffer[8 + TCL_INTEGER_SPACE * 2]; char buffer2[TCL_INTEGER_SPACE]; @@ -880,11 +888,15 @@ XGetImage( if (TkMacOSXGetDrawablePort(d)) { if (format == ZPixmap) { if (width > 0 && height > 0) { - /* Tk_GetPixmap fails for zero width or height */ + /* + * Tk_GetPixmap fails for zero width or height. + */ + pixmap = Tk_GetPixmap(display, d, width, height, depth); } if (win) { XGCValues values; + gc = Tk_GetGC(win, 0, &values); } else { gc = XCreateGC(display, pixmap, 0, NULL); @@ -893,18 +905,22 @@ XGetImage( XCopyArea(display, d, pixmap, gc, x, y, width, height, 0, 0); } imagePtr = XCreateImage(display, NULL, depth, format, offset, - (char*)TkMacOSXGetDrawablePort(pixmap), - width, height, bitmap_pad, bytes_per_line); - /* Track Pixmap underlying the XImage in the unused obdata field * - * so that we can treat XImages coming from XGetImage specially. */ + (char *) TkMacOSXGetDrawablePort(pixmap), + width, height, bitmap_pad, bytes_per_line); + + /* + * Track Pixmap underlying the XImage in the unused obdata field + * so that we can treat XImages coming from XGetImage specially. + */ + imagePtr->obdata = (XPointer) pixmap; if (!win) { XFreeGC(display, gc); } } else { TkpDisplayWarning( - "XGetImage: only ZPixmap types are implemented", - "XGetImage Failure"); + "XGetImage: only ZPixmap types are implemented", + "XGetImage Failure"); } } return imagePtr; @@ -968,11 +984,14 @@ ImageGetPixel( RGBColor cPix; unsigned long r, g, b, c; - destPort = (CGrafPtr)image->data; + destPort = (CGrafPtr) image->data; portChanged = QDSwapPort(destPort, &savePort); GetCPixel(x, y, &cPix); if (image->obdata) { - /* Image from XGetImage, 16 bit color values */ + /* + * Image from XGetImage, 16 bit color values. + */ + r = (cPix . red) >> 8; g = (cPix . green) >> 8; b = (cPix . blue) >> 8; @@ -1018,18 +1037,21 @@ PutPixel( destPort = (CGrafPtr)image->data; portChanged = QDSwapPort(destPort, &savePort); - r = (pixel & image->red_mask)>>16; - g = (pixel & image->green_mask)>>8; - b = (pixel & image->blue_mask); + r = (pixel & image->red_mask)>>16; + g = (pixel & image->green_mask)>>8; + b = (pixel & image->blue_mask); if (image->obdata) { - /* Image from XGetImage, 16 bit color values */ - cPix . red = r << 8; - cPix . green = g << 8; - cPix . blue = b << 8; + /* + * Image from XGetImage, 16 bit color values. + */ + + cPix.red = r << 8; + cPix.green = g << 8; + cPix.blue = b << 8; } else { - cPix . red = r; - cPix . green = g; - cPix . blue = b; + cPix.red = r; + cPix.green = g; + cPix.blue = b; } SetCPixel(x, y, &cPix); if (portChanged) { @@ -1068,8 +1090,8 @@ AddPixel( * XSetWindowBackgroundPixmap, XSetWindowBorder, XSetWindowBorderPixmap, * XSetWindowBorderWidth, XSetWindowColormap * - * These functions are all no-ops. They all have equivilent - * Tk calls that should always be used instead. + * These functions are all no-ops. They all have equivilent Tk calls that + * should always be used instead. * * Results: * None. @@ -1180,10 +1202,10 @@ XCreateIC( *---------------------------------------------------------------------- */ -CONST char * +const char * TkGetDefaultScreenName( Tcl_Interp *interp, /* Not used. */ - CONST char *screenName) /* If NULL, use default string. */ + const char *screenName) /* If NULL, use default string. */ { #if 0 if ((screenName == NULL) || (screenName[0] == '\0')) { @@ -1202,8 +1224,8 @@ TkGetDefaultScreenName( * Return the number of milliseconds the user was inactive. * * Results: - * The number of milliseconds the user has been inactive, - * or -1 if querying the inactive time is not supported. + * The number of milliseconds the user has been inactive, or -1 if + * querying the inactive time is not supported. * * Side effects: * None. @@ -1211,13 +1233,15 @@ TkGetDefaultScreenName( */ long -Tk_GetUserInactiveTime(Display *dpy) +Tk_GetUserInactiveTime( + Display *dpy) { io_registry_entry_t regEntry; CFMutableDictionaryRef props = NULL; CFTypeRef timeObj; long ret = -1l; uint64_t time; + IOReturn result; regEntry = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOHIDSystem")); @@ -1226,7 +1250,7 @@ Tk_GetUserInactiveTime(Display *dpy) return -1l; } - IOReturn result = IORegistryEntryCreateCFProperties(regEntry, &props, + result = IORegistryEntryCreateCFProperties(regEntry, &props, kCFAllocatorDefault, 0); IOObjectRelease(regEntry); @@ -1244,13 +1268,13 @@ Tk_GetUserInactiveTime(Display *dpy) CFRangeMake(0, sizeof(time)), (UInt8 *) &time); /* Convert nanoseconds to milliseconds. */ /* ret /= kMillisecondScale; */ - ret = (long)(time/kMillisecondScale); + ret = (long) (time/kMillisecondScale); } else if (type == CFNumberGetTypeID()) { /* Panther+ */ CFNumberGetValue((CFNumberRef)timeObj, kCFNumberSInt64Type, &time); /* Convert nanoseconds to milliseconds. */ /* ret /= kMillisecondScale; */ - ret = (long)(time/kMillisecondScale); + ret = (long) (time/kMillisecondScale); } else { ret = -1l; } @@ -1272,14 +1296,15 @@ Tk_GetUserInactiveTime(Display *dpy) * none * * Side effects: - * The user inactivity timer of the underlaying windowing system - * is reset to zero. + * The user inactivity timer of the underlaying windowing system is reset + * to zero. * *---------------------------------------------------------------------- */ void -Tk_ResetUserInactiveTime(Display *dpy) +Tk_ResetUserInactiveTime( + Display *dpy) { UpdateSystemActivity(OverallAct); } diff --git a/unix/tkAppInit.c b/unix/tkAppInit.c index 526a3e8..9ae77f1 100644 --- a/unix/tkAppInit.c +++ b/unix/tkAppInit.c @@ -10,14 +10,14 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkAppInit.c,v 1.8 2007/02/22 13:56:33 dkf Exp $ + * RCS: @(#) $Id: tkAppInit.c,v 1.9 2008/04/27 22:39:12 dkf Exp $ */ #include "tk.h" #include "locale.h" #ifdef TK_TEST -extern int Tktest_Init _ANSI_ARGS_((Tcl_Interp *interp)); +extern int Tktest_Init(Tcl_Interp *interp); #endif /* TK_TEST */ /* @@ -52,7 +52,7 @@ main( #ifndef TK_LOCAL_APPINIT #define TK_LOCAL_APPINIT Tcl_AppInit #endif - extern int TK_LOCAL_APPINIT _ANSI_ARGS_((Tcl_Interp *interp)); + extern int TK_LOCAL_APPINIT(Tcl_Interp *interp); /* * The following #if block allows you to change how Tcl finds the startup @@ -61,7 +61,7 @@ main( */ #ifdef TK_LOCAL_MAIN_HOOK - extern int TK_LOCAL_MAIN_HOOK _ANSI_ARGS_((int *argc, char ***argv)); + extern int TK_LOCAL_MAIN_HOOK(int *argc, char ***argv); TK_LOCAL_MAIN_HOOK(&argc, &argv); #endif diff --git a/unix/tkUnix.c b/unix/tkUnix.c index cd44149..986ca96 100644 --- a/unix/tkUnix.c +++ b/unix/tkUnix.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnix.c,v 1.15 2007/12/13 15:28:50 dgp Exp $ + * RCS: @(#) $Id: tkUnix.c,v 1.16 2008/04/27 22:39:13 dkf Exp $ */ #include "tkInt.h" @@ -71,11 +71,11 @@ TkGetServerInfo( *---------------------------------------------------------------------- */ -CONST char * +const char * TkGetDefaultScreenName( Tcl_Interp *interp, /* Interp used to find environment * variables. */ - CONST char *screenName) /* Screen name from command line, or NULL. */ + const char *screenName) /* Screen name from command line, or NULL. */ { if ((screenName == NULL) || (screenName[0] == '\0')) { screenName = Tcl_GetVar2(interp, "env", "DISPLAY", TCL_GLOBAL_ONLY); diff --git a/unix/tkUnixConfig.c b/unix/tkUnixConfig.c index 91a992a..65a23d7 100644 --- a/unix/tkUnixConfig.c +++ b/unix/tkUnixConfig.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixConfig.c,v 1.6 2007/12/13 15:28:50 dgp Exp $ + * RCS: @(#) $Id: tkUnixConfig.c,v 1.7 2008/04/27 22:39:13 dkf Exp $ */ #include "tkInt.h" @@ -37,8 +37,8 @@ Tcl_Obj * TkpGetSystemDefault( Tk_Window tkwin, /* A window to use. */ - CONST char *dbName, /* The option database name. */ - CONST char *className) /* The name of the option class. */ + const char *dbName, /* The option database name. */ + const char *className) /* The name of the option class. */ { return NULL; } diff --git a/unix/tkUnixCursor.c b/unix/tkUnixCursor.c index d57db13..103fd13 100644 --- a/unix/tkUnixCursor.c +++ b/unix/tkUnixCursor.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixCursor.c,v 1.13 2008/03/26 19:34:53 dgp Exp $ + * RCS: @(#) $Id: tkUnixCursor.c,v 1.14 2008/04/27 22:39:13 dkf Exp $ */ #include "tkInt.h" @@ -30,8 +30,8 @@ typedef struct { * the official cursor font: */ -static struct CursorName { - CONST char *name; +static const struct CursorName { + const char *name; unsigned int shape; } cursorNames[] = { {"X_cursor", XC_X_cursor}, @@ -161,8 +161,8 @@ static struct CursorName { #endif /* DEFINE_MYARROW_CURSOR */ -static struct TkCursorName { - char *name; +static const struct TkCursorName { + const char *name; char *data; char *mask; } tkCursorNames[] = { @@ -182,8 +182,8 @@ static struct TkCursorName { #endif static Cursor CreateCursorFromTableOrFile(Tcl_Interp *interp, - Tk_Window tkwin, int argc, CONST char **argv, - struct TkCursorName *tkCursorPtr); + Tk_Window tkwin, int argc, const char **argv, + const struct TkCursorName *tkCursorPtr); /* *---------------------------------------------------------------------- @@ -213,10 +213,10 @@ TkGetCursorByName( TkUnixCursor *cursorPtr = NULL; Cursor cursor = None; int argc; - CONST char **argv = NULL; + const char **argv = NULL; Display *display = Tk_Display(tkwin); int inTkTable = 0; - struct TkCursorName* tkCursorPtr = NULL; + const struct TkCursorName *tkCursorPtr = NULL; if (Tcl_SplitList(interp, string, &argc, &argv) != TCL_OK) { return NULL; @@ -247,7 +247,7 @@ TkGetCursorByName( if ((argv[0][0] != '@') && !inTkTable) { XColor fg, bg; unsigned int maskIndex; - register struct CursorName *namePtr; + register const struct CursorName *namePtr; TkDisplay *dispPtr; /* @@ -377,8 +377,8 @@ CreateCursorFromTableOrFile( Tcl_Interp *interp, /* Interpreter to use for error reporting. */ Tk_Window tkwin, /* Window in which cursor will be used. */ int argc, - CONST char **argv, /* Cursor spec parsed into elements. */ - struct TkCursorName *tkCursorPtr) + const char **argv, /* Cursor spec parsed into elements. */ + const struct TkCursorName *tkCursorPtr) /* Non-NULL when cursor is defined in Tk * table. */ { @@ -388,8 +388,8 @@ CreateCursorFromTableOrFile( int xHot = -1, yHot = -1; int dummy1, dummy2; XColor fg, bg; - CONST char *fgColor; - CONST char *bgColor; + const char *fgColor; + const char *bgColor; int inTkTable = (tkCursorPtr != NULL); Display *display = Tk_Display(tkwin); @@ -430,7 +430,7 @@ CreateCursorFromTableOrFile( ckfree(data); } else { if (TkReadBitmapFile(display, drawable, &argv[0][1], - (unsigned int *) &width, (unsigned int *) &height, + (unsigned *) &width, (unsigned *) &height, &source, &xHot, &yHot) != BitmapSuccess) { Tcl_AppendResult(interp, "cleanup reading bitmap file \"", &argv[0][1], "\"", NULL); @@ -570,8 +570,8 @@ CreateCursorFromTableOrFile( TkCursor * TkCreateCursorFromData( Tk_Window tkwin, /* Window in which cursor will be used. */ - CONST char *source, /* Bitmap data for cursor shape. */ - CONST char *mask, /* Bitmap data for cursor mask. */ + const char *source, /* Bitmap data for cursor shape. */ + const char *mask, /* Bitmap data for cursor mask. */ int width, int height, /* Dimensions of cursor. */ int xHot, int yHot, /* Location of hot-spot in cursor. */ XColor fgColor, /* Foreground color for cursor. */ diff --git a/unix/tkUnixDialog.c b/unix/tkUnixDialog.c index 1299e90..851edf3 100644 --- a/unix/tkUnixDialog.c +++ b/unix/tkUnixDialog.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixDialog.c,v 1.6 2007/12/13 15:28:50 dgp Exp $ + * RCS: @(#) $Id: tkUnixDialog.c,v 1.7 2008/04/27 22:39:13 dkf Exp $ * */ @@ -42,7 +42,7 @@ EvalObjv( Tcl_Interp *interp, /* Current interpreter. */ char *cmdName, /* Name of the TCL command to call */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST *objv) /* Arguments. */ + Tcl_Obj *const *objv) /* Arguments. */ { Tcl_Obj *cmdObj, **objs; int result; @@ -85,7 +85,7 @@ Tk_ChooseColorObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST *objv) /* Arguments. */ + Tcl_Obj *const *objv) /* Arguments. */ { return EvalObjv(interp, "tk::ColorDialog", objc-1, objv+1); } @@ -114,9 +114,9 @@ Tk_GetOpenFileObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST *objv) /* Arguments. */ + Tcl_Obj *const *objv) /* Arguments. */ { - Tk_Window tkwin = (Tk_Window)clientData; + Tk_Window tkwin = clientData; if (Tk_StrictMotif(tkwin)) { return EvalObjv(interp, "tk::MotifOpenFDialog", objc-1, objv+1); @@ -146,9 +146,9 @@ Tk_GetSaveFileObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST *objv) /* Arguments. */ + Tcl_Obj *const *objv) /* Arguments. */ { - Tk_Window tkwin = (Tk_Window)clientData; + Tk_Window tkwin = clientData; if (Tk_StrictMotif(tkwin)) { return EvalObjv(interp, "tk::MotifSaveFDialog", objc-1, objv+1); @@ -180,7 +180,7 @@ Tk_MessageBoxCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST *objv) /* Arguments. */ + Tcl_Obj *const *objv) /* Arguments. */ { return EvalObjv(interp, "tk::MessageBox", objc-1, objv+1); } diff --git a/unix/tkUnixEmbed.c b/unix/tkUnixEmbed.c index 9b93cb6..028d081 100644 --- a/unix/tkUnixEmbed.c +++ b/unix/tkUnixEmbed.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixEmbed.c,v 1.12 2007/12/13 15:28:50 dgp Exp $ + * RCS: @(#) $Id: tkUnixEmbed.c,v 1.13 2008/04/27 22:39:13 dkf Exp $ */ #include "tkUnixInt.h" @@ -97,7 +97,7 @@ TkpUseWindow( * string is bogus. */ Tk_Window tkwin, /* Tk window that does not yet have an * associated X window. */ - CONST char *string) /* String identifying an X window to use for + const char *string) /* String identifying an X window to use for * tkwin; must be an integer value. */ { TkWindow *winPtr = (TkWindow *) tkwin; @@ -867,7 +867,7 @@ TkpTestembedCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int argc, /* Number of arguments. */ - CONST char **argv) /* Argument strings. */ + const char **argv) /* Argument strings. */ { int all; Container *containerPtr; diff --git a/unix/tkUnixEvent.c b/unix/tkUnixEvent.c index bb66552..8335b09 100644 --- a/unix/tkUnixEvent.c +++ b/unix/tkUnixEvent.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixEvent.c,v 1.27 2008/03/26 19:04:10 jenglish Exp $ + * RCS: @(#) $Id: tkUnixEvent.c,v 1.28 2008/04/27 22:39:13 dkf Exp $ */ #include "tkUnixInt.h" @@ -115,7 +115,7 @@ DisplayExitHandler( TkDisplay * TkpOpenDisplay( - CONST char *displayNameStr) + const char *displayNameStr) { TkDisplay *dispPtr; Display *display = XOpenDisplay(displayNameStr); diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c index d97723b..286ac32 100644 --- a/unix/tkUnixFont.c +++ b/unix/tkUnixFont.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixFont.c,v 1.33 2007/02/28 09:23:30 dkf Exp $ + * RCS: @(#) $Id: tkUnixFont.c,v 1.34 2008/04/27 22:39:13 dkf Exp $ */ #include "tkUnixInt.h" @@ -21,7 +21,7 @@ * The preferred font encodings. */ -static CONST char *encodingList[] = { +static const char *encodingList[] = { "iso8859-1", "jis0208", "jis0212", NULL }; @@ -207,31 +207,31 @@ static void FontPkgCleanup(ClientData clientData); static FontFamily * AllocFontFamily(Display *display, XFontStruct *fontStructPtr, int base); static SubFont * CanUseFallback(UnixFont *fontPtr, - CONST char *fallbackName, int ch, + const char *fallbackName, int ch, SubFont **fixSubFontPtrPtr); static SubFont * CanUseFallbackWithAliases(UnixFont *fontPtr, char *fallbackName, int ch, Tcl_DString *nameTriedPtr, SubFont **fixSubFontPtrPtr); -static int ControlUtfProc(ClientData clientData, CONST char *src, +static int ControlUtfProc(ClientData clientData, const char *src, int srcLen, int flags, Tcl_EncodingState*statePtr, char *dst, int dstLen, int *srcReadPtr, int *dstWrotePtr, int *dstCharsPtr); static XFontStruct * CreateClosestFont(Tk_Window tkwin, - CONST TkFontAttributes *faPtr, - CONST TkXLFDAttributes *xaPtr); + const TkFontAttributes *faPtr, + const TkXLFDAttributes *xaPtr); static SubFont * FindSubFontForChar(UnixFont *fontPtr, int ch, SubFont **fixSubFontPtrPtr); static void FontMapInsert(SubFont *subFontPtr, int ch); static void FontMapLoadPage(SubFont *subFontPtr, int row); static int FontMapLookup(SubFont *subFontPtr, int ch); static void FreeFontFamily(FontFamily *afPtr); -static CONST char * GetEncodingAlias(CONST char *name); +static const char * GetEncodingAlias(const char *name); static int GetFontAttributes(Display *display, XFontStruct *fontStructPtr, FontAttributes *faPtr); static XFontStruct * GetScreenFont(Display *display, FontAttributes *wantPtr, char **nameList, - int bestIdx[], unsigned int bestScore[]); + int bestIdx[], unsigned bestScore[]); static XFontStruct * GetSystemFont(Display *display); static int IdentifySymbolEncodings(FontAttributes *faPtr); static void InitFont(Tk_Window tkwin, XFontStruct *fontStructPtr, @@ -239,21 +239,21 @@ static void InitFont(Tk_Window tkwin, XFontStruct *fontStructPtr, static void InitSubFont(Display *display, XFontStruct *fontStructPtr, int base, SubFont *subFontPtr); -static char ** ListFonts(Display *display, CONST char *faceName, +static char ** ListFonts(Display *display, const char *faceName, int *numNamesPtr); -static char ** ListFontOrAlias(Display *display, CONST char*faceName, +static char ** ListFontOrAlias(Display *display, const char*faceName, int *numNamesPtr); -static unsigned int RankAttributes(FontAttributes *wantPtr, +static unsigned RankAttributes(FontAttributes *wantPtr, FontAttributes *gotPtr); static void ReleaseFont(UnixFont *fontPtr); static void ReleaseSubFont(Display *display, SubFont *subFontPtr); -static int SeenName(CONST char *name, Tcl_DString *dsPtr); +static int SeenName(const char *name, Tcl_DString *dsPtr); #ifndef WORDS_BIGENDIAN -static int Ucs2beToUtfProc(ClientData clientData, CONST char*src, +static int Ucs2beToUtfProc(ClientData clientData, const char*src, int srcLen, int flags, Tcl_EncodingState*statePtr, char *dst, int dstLen, int *srcReadPtr, int *dstWrotePtr, int *dstCharsPtr); -static int UtfToUcs2beProc(ClientData clientData, CONST char*src, +static int UtfToUcs2beProc(ClientData clientData, const char*src, int srcLen, int flags, Tcl_EncodingState*statePtr, char *dst, int dstLen, int *srcReadPtr, int *dstWrotePtr, int *dstCharsPtr); @@ -281,7 +281,7 @@ static void FontPkgCleanup( ClientData clientData) { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (tsdPtr->controlFamily.encoding != NULL) { @@ -320,7 +320,7 @@ void TkpFontPkgInit( TkMainInfo *mainPtr) /* The application being created. */ { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_EncodingType type; SubFont dummy; @@ -382,7 +382,7 @@ TkpFontPkgInit( static int ControlUtfProc( ClientData clientData, /* Not used. */ - CONST char *src, /* Source string in UTF-8. */ + const char *src, /* Source string in UTF-8. */ int srcLen, /* Source string length in bytes. */ int flags, /* Conversion control flags. */ Tcl_EncodingState *statePtr,/* Place for conversion routine to store state @@ -406,7 +406,7 @@ ControlUtfProc( * correspond to the bytes stored in the * output buffer. */ { - CONST char *srcStart, *srcEnd; + const char *srcStart, *srcEnd; char *dstStart, *dstEnd; Tcl_UniChar ch; int result; @@ -475,7 +475,7 @@ ControlUtfProc( static int Ucs2beToUtfProc( ClientData clientData, /* Not used. */ - CONST char *src, /* Source string in Unicode. */ + const char *src, /* Source string in Unicode. */ int srcLen, /* Source string length in bytes. */ int flags, /* Conversion control flags. */ Tcl_EncodingState *statePtr,/* Place for conversion routine to store state @@ -499,7 +499,7 @@ Ucs2beToUtfProc( * correspond to the bytes stored in the * output buffer. */ { - CONST char *srcStart, *srcEnd; + const char *srcStart, *srcEnd; char *dstEnd, *dstStart; int result, numChars; @@ -558,7 +558,7 @@ static int UtfToUcs2beProc( ClientData clientData, /* TableEncodingData that specifies * encoding. */ - CONST char *src, /* Source string in UTF-8. */ + const char *src, /* Source string in UTF-8. */ int srcLen, /* Source string length in bytes. */ int flags, /* Conversion control flags. */ Tcl_EncodingState *statePtr,/* Place for conversion routine to store state @@ -582,7 +582,7 @@ UtfToUcs2beProc( * correspond to the bytes stored in the * output buffer. */ { - CONST char *srcStart, *srcEnd, *srcClose, *dstStart, *dstEnd; + const char *srcStart, *srcEnd, *srcClose, *dstStart, *dstEnd; int result, numChars; Tcl_UniChar ch; @@ -658,12 +658,12 @@ UtfToUcs2beProc( TkFont * TkpGetNativeFont( Tk_Window tkwin, /* For display where font will be used. */ - CONST char *name) /* Platform-specific font name. */ + const char *name) /* Platform-specific font name. */ { UnixFont *fontPtr; XFontStruct *fontStructPtr; FontAttributes fa; - CONST char *p; + const char *p; int hasSpace, dashes, hasWild; /* @@ -765,7 +765,7 @@ TkpGetFontFromAttributes( * will be released. If NULL, a new TkFont * structure is allocated. */ Tk_Window tkwin, /* For display where font will be used. */ - CONST TkFontAttributes *faPtr) + const TkFontAttributes *faPtr) /* Set of attributes to match. */ { UnixFont *fontPtr; @@ -960,6 +960,7 @@ TkpGetFontAttrsForChar( SubFont *thisSubFontPtr = FindSubFontForChar(fontPtr, c, &lastSubFontPtr); /* Pointer to the subfont to use for the given * character */ + GetFontAttributes(Tk_Display(tkwin), thisSubFontPtr->fontStructPtr, &atts); *faPtr = atts.fa; } @@ -988,7 +989,7 @@ TkpGetFontAttrsForChar( int Tk_MeasureChars( Tk_Font tkfont, /* Font in which characters will be drawn. */ - CONST char *source, /* UTF-8 string to be displayed. Need not be + const char *source, /* UTF-8 string to be displayed. Need not be * '\0' terminated. */ int numBytes, /* Maximum number of bytes to consider from * source string. */ @@ -1027,7 +1028,7 @@ Tk_MeasureChars( curX = 0; curByte = 0; } else if (maxLength < 0) { - CONST char *p, *end, *next; + const char *p, *end, *next; Tcl_UniChar ch; SubFont *thisSubFontPtr; FontFamily *familyPtr; @@ -1080,7 +1081,7 @@ Tk_MeasureChars( Tcl_DStringFree(&runString); curByte = numBytes; } else { - CONST char *p, *end, *next, *term; + const char *p, *end, *next, *term; int newX, termX, sawNonSpace, dstWrote; Tcl_UniChar ch; FontFamily *familyPtr; @@ -1202,7 +1203,7 @@ Tk_MeasureChars( int TkpMeasureCharsInContext( Tk_Font tkfont, /* Font in which characters will be drawn. */ - CONST char *source, /* UTF-8 string to be displayed. Need not be + const char *source, /* UTF-8 string to be displayed. Need not be * '\0' terminated. */ int numBytes, /* Maximum number of bytes to consider from * source string in all. */ @@ -1255,7 +1256,7 @@ Tk_DrawChars( GC gc, /* Graphics context for drawing characters. */ Tk_Font tkfont, /* Font in which characters will be drawn; * must be the same as font used in GC. */ - CONST char *source, /* UTF-8 string to be displayed. Need not be + const char *source, /* UTF-8 string to be displayed. Need not be * '\0' terminated. All Tk meta-characters * (tabs, control characters, and newlines) * should be stripped out of the string that @@ -1266,22 +1267,20 @@ Tk_DrawChars( int x, int y) /* Coordinates at which to place origin of * string when drawing. */ { - UnixFont *fontPtr; + UnixFont *fontPtr = (UnixFont *) tkfont; SubFont *thisSubFontPtr, *lastSubFontPtr; Tcl_DString runString; - CONST char *p, *end, *next; + const char *p, *end, *next; int xStart, needWidth, window_width, do_width; Tcl_UniChar ch; FontFamily *familyPtr; #ifdef TK_DRAW_CHAR_XWINDOW_CHECK int rx, ry; - unsigned int width, height, border_width, depth; + unsigned width, height, border_width, depth; Drawable root; #endif - fontPtr = (UnixFont *) tkfont; lastSubFontPtr = &fontPtr->subFontArray[0]; - xStart = x; #ifdef TK_DRAW_CHAR_XWINDOW_CHECK @@ -1394,7 +1393,7 @@ TkpDrawCharsInContext( GC gc, /* Graphics context for drawing characters. */ Tk_Font tkfont, /* Font in which characters will be drawn; * must be the same as font used in GC. */ - CONST char *source, /* UTF-8 string to be displayed. Need not be + const char *source, /* UTF-8 string to be displayed. Need not be * '\0' terminated. All Tk meta-characters * (tabs, control characters, and newlines) * should be stripped out of the string that @@ -1443,9 +1442,9 @@ TkpDrawCharsInContext( static XFontStruct * CreateClosestFont( Tk_Window tkwin, /* For display where font will be used. */ - CONST TkFontAttributes *faPtr, + const TkFontAttributes *faPtr, /* Set of generic attributes to match. */ - CONST TkXLFDAttributes *xaPtr) + const TkXLFDAttributes *xaPtr) /* Set of X-specific attributes to match. */ { FontAttributes want; @@ -1453,7 +1452,7 @@ CreateClosestFont( int numNames, nameIdx, bestIdx[2]; Display *display; XFontStruct *fontStructPtr; - unsigned int bestScore[2]; + unsigned bestScore[2]; want.fa = *faPtr; want.xa = *xaPtr; @@ -1515,12 +1514,12 @@ CreateClosestFont( found: bestIdx[0] = -1; bestIdx[1] = -1; - bestScore[0] = (unsigned int) -1; - bestScore[1] = (unsigned int) -1; + bestScore[0] = (unsigned) -1; + bestScore[1] = (unsigned) -1; for (nameIdx = 0; nameIdx < numNames; nameIdx++) { FontAttributes got; int scalable; - unsigned int score; + unsigned score; if (TkFontParseXLFD(nameList[nameIdx], &got.fa, &got.xa) != TCL_OK) { continue; @@ -1576,7 +1575,7 @@ InitFont( UnixFont *fontPtr) /* Filled with information constructed from * the above arguments. */ { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); unsigned long value; int minHi, maxHi, minLo, maxLo, fixed, width, limit, i, n; @@ -1829,7 +1828,7 @@ AllocFontFamily( FontFamily *familyPtr; FontAttributes fa; Tcl_Encoding encoding; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); GetFontAttributes(display, fontStructPtr, &fa); @@ -1903,7 +1902,7 @@ FreeFontFamily( FontFamily *familyPtr) /* The FontFamily to delete. */ { FontFamily **familyPtrPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); int i; @@ -2206,7 +2205,7 @@ FontMapLoadPage( Tcl_Encoding encoding; XFontStruct *fontStructPtr; XCharStruct *widths; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); subFontPtr->fontMap[row] = (char *) ckalloc(FONTMAP_BITSPERPAGE / 8); @@ -2343,11 +2342,11 @@ CanUseFallbackWithAliases( static int SeenName( - CONST char *name, /* The name to check. */ + const char *name, /* The name to check. */ Tcl_DString *dsPtr) /* Contains names that have already been * seen. */ { - CONST char *seen, *end; + const char *seen, *end; seen = Tcl_DStringValue(dsPtr); end = seen + Tcl_DStringLength(dsPtr); @@ -2392,7 +2391,7 @@ static SubFont * CanUseFallback( UnixFont *fontPtr, /* The font object that will own the new * screen font. */ - CONST char *faceName, /* Desired face name for new screen font. */ + const char *faceName, /* Desired face name for new screen font. */ int ch, /* The Unicode character that the new screen * font must be able to display. */ SubFont **fixSubFontPtrPtr) /* Subfont reference to fix up if we @@ -2400,8 +2399,8 @@ CanUseFallback( { int i, nameIdx, numNames, srcLen, numEncodings, bestIdx[2]; Tk_Uid hateFoundry; - CONST char *charset, *hateCharset; - unsigned int bestScore[2]; + const char *charset, *hateCharset; + unsigned bestScore[2]; char **nameList, **nameListOrig, src[TCL_UTF_MAX]; FontAttributes want, got; Display *display; @@ -2450,13 +2449,13 @@ CanUseFallback( retry: bestIdx[0] = -1; bestIdx[1] = -1; - bestScore[0] = (unsigned int) -1; - bestScore[1] = (unsigned int) -1; + bestScore[0] = (unsigned) -1; + bestScore[1] = (unsigned) -1; for (nameIdx = 0; nameIdx < numNames; nameIdx++) { Tcl_Encoding encoding; char dst[16]; int scalable, srcRead, dstWrote; - unsigned int score; + unsigned score; if (nameList[nameIdx] == NULL) { continue; @@ -2624,12 +2623,12 @@ CanUseFallback( *--------------------------------------------------------------------------- */ -static unsigned int +static unsigned RankAttributes( FontAttributes *wantPtr, /* The desired attributes. */ FontAttributes *gotPtr) /* The attributes we have to live with. */ { - unsigned int penalty; + unsigned penalty; penalty = 0; if (gotPtr->xa.foundry != wantPtr->xa.foundry) { @@ -2676,7 +2675,7 @@ RankAttributes( } if (gotPtr->xa.charset != wantPtr->xa.charset) { int i; - CONST char *gotAlias, *wantAlias; + const char *gotAlias, *wantAlias; penalty += 65000; gotAlias = GetEncodingAlias(gotPtr->xa.charset); @@ -2721,7 +2720,7 @@ GetScreenFont( char **nameList, /* Array of XLFDs. */ int bestIdx[2], /* Indices into above array for XLFD of best * bitmapped and best scalable font. */ - unsigned int bestScore[2]) /* Scores of best bitmapped and best scalable + unsigned bestScore[2]) /* Scores of best bitmapped and best scalable * font. XLFD corresponding to lowest score * will be constructed. */ { @@ -2890,7 +2889,7 @@ GetFontAttributes( static char ** ListFonts( Display *display, /* Display to query. */ - CONST char *faceName, /* Desired face name, or "*" for all. */ + const char *faceName, /* Desired face name, or "*" for all. */ int *numNamesPtr) /* Filled with length of returned array, or 0 * if no names were found. */ { @@ -2903,7 +2902,7 @@ ListFonts( static char ** ListFontOrAlias( Display *display, /* Display to query. */ - CONST char *faceName, /* Desired face name, or "*" for all. */ + const char *faceName, /* Desired face name, or "*" for all. */ int *numNamesPtr) /* Filled with length of returned array, or 0 * if no names were found. */ { @@ -2995,9 +2994,9 @@ IdentifySymbolEncodings( *--------------------------------------------------------------------------- */ -static CONST char * +static const char * GetEncodingAlias( - CONST char *name) /* The name to look up. */ + const char *name) /* The name to look up. */ { EncodingAlias *aliasPtr; diff --git a/unix/tkUnixInit.c b/unix/tkUnixInit.c index 50797f2..7c07e4d 100644 --- a/unix/tkUnixInit.c +++ b/unix/tkUnixInit.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixInit.c,v 1.10 2007/12/13 15:28:50 dgp Exp $ + * RCS: @(#) $Id: tkUnixInit.c,v 1.11 2008/04/27 22:39:13 dkf Exp $ */ #include "tkUnixInt.h" @@ -69,7 +69,7 @@ TkpGetAppName( Tcl_Interp *interp, Tcl_DString *namePtr) /* A previously initialized Tcl_DString. */ { - CONST char *p, *name; + const char *p, *name; name = Tcl_GetVar(interp, "argv0", TCL_GLOBAL_ONLY); if ((name == NULL) || (*name == 0)) { @@ -102,10 +102,11 @@ TkpGetAppName( void TkpDisplayWarning( - CONST char *msg, /* Message to be displayed. */ - CONST char *title) /* Title of warning. */ + const char *msg, /* Message to be displayed. */ + const char *title) /* Title of warning. */ { Tcl_Channel errChannel = Tcl_GetStdChannel(TCL_STDERR); + if (errChannel) { Tcl_WriteChars(errChannel, title, -1); Tcl_WriteChars(errChannel, ": ", 2); diff --git a/unix/tkUnixMenu.c b/unix/tkUnixMenu.c index 0fcadb6..ec77732 100644 --- a/unix/tkUnixMenu.c +++ b/unix/tkUnixMenu.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixMenu.c,v 1.19 2007/12/13 15:28:50 dgp Exp $ + * RCS: @(#) $Id: tkUnixMenu.c,v 1.20 2008/04/27 22:39:13 dkf Exp $ */ #include "default.h" @@ -53,7 +53,7 @@ MODULE_SCOPE void TkpDrawCheckIndicator(Tk_Window tkwin, static void SetHelpMenu(TkMenu *menuPtr); static void DrawMenuEntryAccelerator(TkMenu *menuPtr, TkMenuEntry *mePtr, Drawable d, GC gc, - Tk_Font tkfont, CONST Tk_FontMetrics *fmPtr, + Tk_Font tkfont, const Tk_FontMetrics *fmPtr, Tk_3DBorder activeBorder, int x, int y, int width, int height, int drawArrow); static void DrawMenuEntryBackground(TkMenu *menuPtr, @@ -64,42 +64,42 @@ static void DrawMenuEntryIndicator(TkMenu *menuPtr, TkMenuEntry *mePtr, Drawable d, Tk_3DBorder border, XColor *indicatorColor, XColor *disableColor, Tk_Font tkfont, - CONST Tk_FontMetrics *fmPtr, int x, int y, + const Tk_FontMetrics *fmPtr, int x, int y, int width, int height); static void DrawMenuEntryLabel(TkMenu * menuPtr, TkMenuEntry *mePtr, Drawable d, GC gc, - Tk_Font tkfont, CONST Tk_FontMetrics *fmPtr, + Tk_Font tkfont, const Tk_FontMetrics *fmPtr, int x, int y, int width, int height); static void DrawMenuSeparator(TkMenu *menuPtr, TkMenuEntry *mePtr, Drawable d, GC gc, - Tk_Font tkfont, CONST Tk_FontMetrics *fmPtr, + Tk_Font tkfont, const Tk_FontMetrics *fmPtr, int x, int y, int width, int height); static void DrawTearoffEntry(TkMenu *menuPtr, TkMenuEntry *mePtr, Drawable d, GC gc, - Tk_Font tkfont, CONST Tk_FontMetrics *fmPtr, + Tk_Font tkfont, const Tk_FontMetrics *fmPtr, int x, int y, int width, int height); static void DrawMenuUnderline(TkMenu *menuPtr, TkMenuEntry *mePtr, Drawable d, GC gc, - Tk_Font tkfont, CONST Tk_FontMetrics *fmPtr, + Tk_Font tkfont, const Tk_FontMetrics *fmPtr, int x, int y, int width, int height); static void GetMenuAccelGeometry(TkMenu *menuPtr, TkMenuEntry *mePtr, Tk_Font tkfont, - CONST Tk_FontMetrics *fmPtr, int *widthPtr, + const Tk_FontMetrics *fmPtr, int *widthPtr, int *heightPtr); static void GetMenuLabelGeometry(TkMenuEntry *mePtr, - Tk_Font tkfont, CONST Tk_FontMetrics *fmPtr, + Tk_Font tkfont, const Tk_FontMetrics *fmPtr, int *widthPtr, int *heightPtr); static void GetMenuIndicatorGeometry(TkMenu *menuPtr, TkMenuEntry *mePtr, Tk_Font tkfont, - CONST Tk_FontMetrics *fmPtr, + const Tk_FontMetrics *fmPtr, int *widthPtr, int *heightPtr); static void GetMenuSeparatorGeometry(TkMenu *menuPtr, TkMenuEntry *mePtr, Tk_Font tkfont, - CONST Tk_FontMetrics *fmPtr, + const Tk_FontMetrics *fmPtr, int *widthPtr, int *heightPtr); static void GetTearoffEntryGeometry(TkMenu *menuPtr, TkMenuEntry *mePtr, Tk_Font tkfont, - CONST Tk_FontMetrics *fmPtr, int *widthPtr, + const Tk_FontMetrics *fmPtr, int *widthPtr, int *heightPtr); /* @@ -326,7 +326,7 @@ GetMenuIndicatorGeometry( TkMenu *menuPtr, /* The menu we are drawing. */ TkMenuEntry *mePtr, /* The entry we are interested in. */ Tk_Font tkfont, /* The precalculated font */ - CONST Tk_FontMetrics *fmPtr,/* The precalculated metrics */ + const Tk_FontMetrics *fmPtr,/* The precalculated metrics */ int *widthPtr, /* The resulting width */ int *heightPtr) /* The resulting height */ { @@ -393,7 +393,7 @@ GetMenuAccelGeometry( TkMenu *menuPtr, /* The menu was are drawing */ TkMenuEntry *mePtr, /* The entry we are getting the geometry for */ Tk_Font tkfont, /* The precalculated font */ - CONST Tk_FontMetrics *fmPtr,/* The precalculated font metrics */ + const Tk_FontMetrics *fmPtr,/* The precalculated font metrics */ int *widthPtr, /* The width of the acclerator area */ int *heightPtr) /* The height of the accelerator area */ { @@ -485,7 +485,7 @@ DrawMenuEntryAccelerator( Drawable d, /* The drawable we are drawing into */ GC gc, /* The precalculated gc to draw with */ Tk_Font tkfont, /* The precalculated font */ - CONST Tk_FontMetrics *fmPtr,/* The precalculated metrics */ + const Tk_FontMetrics *fmPtr,/* The precalculated metrics */ Tk_3DBorder activeBorder, /* The border for an active item */ int x, /* Left coordinate of entry rect */ int y, /* Top coordinate of entry rect */ @@ -559,7 +559,7 @@ DrawMenuEntryIndicator( XColor *indicatorColor, /* The color to draw indicators with */ XColor *disableColor, /* The color use use when disabled */ Tk_Font tkfont, /* The font to draw with */ - CONST Tk_FontMetrics *fmPtr,/* The font metrics of the font */ + const Tk_FontMetrics *fmPtr,/* The font metrics of the font */ int x, /* The left of the entry rect */ int y, /* The top of the entry rect */ int width, /* Width of menu entry */ @@ -631,7 +631,7 @@ DrawMenuSeparator( Drawable d, /* The drawable we are using */ GC gc, /* The gc to draw into */ Tk_Font tkfont, /* The font to draw with */ - CONST Tk_FontMetrics *fmPtr,/* The font metrics from the font */ + const Tk_FontMetrics *fmPtr,/* The font metrics from the font */ int x, int y, int width, int height) { @@ -674,7 +674,7 @@ DrawMenuEntryLabel( Drawable d, /* What we are drawing into. */ GC gc, /* The gc we are drawing into.*/ Tk_Font tkfont, /* The precalculated font. */ - CONST Tk_FontMetrics *fmPtr,/* The precalculated font metrics. */ + const Tk_FontMetrics *fmPtr,/* The precalculated font metrics. */ int x, /* Left edge. */ int y, /* Top edge. */ int width, /* width of entry. */ @@ -851,7 +851,7 @@ DrawMenuUnderline( Drawable d, /* What we are drawing into */ GC gc, /* The gc to draw into */ Tk_Font tkfont, /* The precalculated font */ - CONST Tk_FontMetrics *fmPtr,/* The precalculated font metrics */ + const Tk_FontMetrics *fmPtr,/* The precalculated font metrics */ int x, int y, int width, int height) { @@ -865,7 +865,7 @@ DrawMenuUnderline( Tcl_GetUnicodeFromObj(mePtr->labelPtr, &len); if (mePtr->underline < len) { int activeBorderWidth, leftEdge; - CONST char *label, *start, *end; + const char *label, *start, *end; label = Tcl_GetStringFromObj(mePtr->labelPtr, NULL); start = Tcl_UtfAtIndex(label, mePtr->underline); @@ -931,7 +931,7 @@ GetMenuSeparatorGeometry( TkMenu *menuPtr, /* The menu we are measuring */ TkMenuEntry *mePtr, /* The entry we are measuring */ Tk_Font tkfont, /* The precalculated font */ - CONST Tk_FontMetrics *fmPtr,/* The precalcualted font metrics */ + const Tk_FontMetrics *fmPtr,/* The precalcualted font metrics */ int *widthPtr, /* The resulting width */ int *heightPtr) /* The resulting height */ { @@ -960,7 +960,7 @@ GetTearoffEntryGeometry( TkMenu *menuPtr, /* The menu we are drawing */ TkMenuEntry *mePtr, /* The entry we are measuring */ Tk_Font tkfont, /* The precalculated font */ - CONST Tk_FontMetrics *fmPtr,/* The precalculated font metrics */ + const Tk_FontMetrics *fmPtr,/* The precalculated font metrics */ int *widthPtr, /* The resulting width */ int *heightPtr) /* The resulting height */ { @@ -1181,7 +1181,7 @@ DrawTearoffEntry( Drawable d, /* The drawable we are drawing into */ GC gc, /* The gc we are drawing with */ Tk_Font tkfont, /* The font we are drawing with */ - CONST Tk_FontMetrics *fmPtr,/* The metrics we are drawing with */ + const Tk_FontMetrics *fmPtr,/* The metrics we are drawing with */ int x, int y, int width, int height) { @@ -1310,7 +1310,7 @@ TkpDrawMenuEntry( TkMenuEntry *mePtr, /* The entry to draw */ Drawable d, /* What to draw into */ Tk_Font tkfont, /* Precalculated font for menu */ - CONST Tk_FontMetrics *menuMetricsPtr, + const Tk_FontMetrics *menuMetricsPtr, /* Precalculated metrics for menu */ int x, /* X-coordinate of topleft of entry */ int y, /* Y-coordinate of topleft of entry */ @@ -1325,7 +1325,7 @@ TkpDrawMenuEntry( XColor *indicatorColor, *disableColor = NULL; TkMenu *menuPtr = mePtr->menuPtr; Tk_3DBorder bgBorder, activeBorder; - CONST Tk_FontMetrics *fmPtr; + const Tk_FontMetrics *fmPtr; Tk_FontMetrics entryMetrics; int padY = (menuPtr->menuType == MENUBAR) ? 3 : 0; int adjustedY = y + padY; @@ -1460,7 +1460,7 @@ static void GetMenuLabelGeometry( TkMenuEntry *mePtr, /* The entry we are computing */ Tk_Font tkfont, /* The precalculated font */ - CONST Tk_FontMetrics *fmPtr,/* The precalculated metrics */ + const Tk_FontMetrics *fmPtr,/* The precalculated metrics */ int *widthPtr, /* The resulting width of the label portion */ int *heightPtr) /* The resulting height of the label * portion */ diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c index 73e091c..3bea31f 100644 --- a/unix/tkUnixRFont.c +++ b/unix/tkUnixRFont.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixRFont.c,v 1.24 2008/03/12 16:35:27 jenglish Exp $ + * RCS: @(#) $Id: tkUnixRFont.c,v 1.25 2008/04/27 22:39:13 dkf Exp $ */ #include "tkUnixInt.h" @@ -303,7 +303,7 @@ FinishedWithFont( TkFont * TkpGetNativeFont( Tk_Window tkwin, /* For display where font will be used. */ - CONST char *name) /* Platform-specific font name. */ + const char *name) /* Platform-specific font name. */ { UnixFtFont *fontPtr; FcPattern *pattern; @@ -337,7 +337,7 @@ TkpGetFontFromAttributes( * will be released. If NULL, a new TkFont * structure is allocated. */ Tk_Window tkwin, /* For display where font will be used. */ - CONST TkFontAttributes *faPtr) + const TkFontAttributes *faPtr) /* Set of attributes to match. */ { XftPattern *pattern; @@ -524,7 +524,7 @@ TkpGetFontAttrsForChar( int Tk_MeasureChars( Tk_Font tkfont, /* Font in which characters will be drawn. */ - CONST char *source, /* UTF-8 string to be displayed. Need not be + const char *source, /* UTF-8 string to be displayed. Need not be * '\0' terminated. */ int numBytes, /* Maximum number of bytes to consider from * source string. */ @@ -620,7 +620,7 @@ Tk_MeasureChars( int TkpMeasureCharsInContext( Tk_Font tkfont, - CONST char *source, + const char *source, int numBytes, int rangeStart, int rangeLength, @@ -643,7 +643,7 @@ Tk_DrawChars( GC gc, /* Graphics context for drawing characters. */ Tk_Font tkfont, /* Font in which characters will be drawn; * must be the same as font used in GC. */ - CONST char *source, /* UTF-8 string to be displayed. Need not be + const char *source, /* UTF-8 string to be displayed. Need not be * '\0' terminated. All Tk meta-characters * (tabs, control characters, and newlines) * should be stripped out of the string that diff --git a/unix/tkUnixSend.c b/unix/tkUnixSend.c index b2083f3..9a0aacf 100644 --- a/unix/tkUnixSend.c +++ b/unix/tkUnixSend.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixSend.c,v 1.20 2007/12/13 15:28:51 dgp Exp $ + * RCS: @(#) $Id: tkUnixSend.c,v 1.21 2008/04/27 22:39:13 dkf Exp $ */ #include "tkUnixInt.h" @@ -79,7 +79,7 @@ typedef struct NameRegistry { typedef struct PendingCommand { int serial; /* Serial number expected in result. */ TkDisplay *dispPtr; /* Display being used for communication. */ - CONST char *target; /* Name of interpreter command is being sent + const 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 @@ -212,10 +212,10 @@ static void AppendPropCarefully(Display *display, int length, PendingCommand *pendingPtr); static void DeleteProc(ClientData clientData); static void RegAddName(NameRegistry *regPtr, - CONST char *name, Window commWindow); + const char *name, Window commWindow); static void RegClose(NameRegistry *regPtr); -static void RegDeleteName(NameRegistry *regPtr, CONST char *name); -static Window RegFindName(NameRegistry *regPtr, CONST char *name); +static void RegDeleteName(NameRegistry *regPtr, const char *name); +static Window RegFindName(NameRegistry *regPtr, const char *name); static NameRegistry * RegOpen(Tcl_Interp *interp, TkDisplay *dispPtr, int lock); static void SendEventProc(ClientData clientData, XEvent *eventPtr); @@ -224,7 +224,7 @@ static Tk_RestrictAction SendRestrictProc(ClientData clientData, XEvent *eventPtr); static int ServerSecure(TkDisplay *dispPtr); static void UpdateCommWindow(TkDisplay *dispPtr); -static int ValidateName(TkDisplay *dispPtr, CONST char *name, +static int ValidateName(TkDisplay *dispPtr, const char *name, Window commWindow, int oldOK); /* @@ -349,7 +349,7 @@ static Window RegFindName( NameRegistry *regPtr, /* Pointer to a registry opened with a * previous call to RegOpen. */ - CONST char *name) /* Name of an application. */ + const char *name) /* Name of an application. */ { char *p; @@ -360,7 +360,7 @@ RegFindName( p++; } if ((*p != 0) && (strcmp(name, p+1) == 0)) { - unsigned int id; + unsigned id; if (sscanf(entry, "%x", &id) == 1) { /* @@ -402,7 +402,7 @@ static void RegDeleteName( NameRegistry *regPtr, /* Pointer to a registry opened with a * previous call to RegOpen. */ - CONST char *name) /* Name of an application. */ + const char *name) /* Name of an application. */ { char *p; @@ -464,7 +464,7 @@ static void RegAddName( NameRegistry *regPtr, /* Pointer to a registry opened with a * previous call to RegOpen. */ - CONST char *name, /* Name of an application. The caller must + const 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 @@ -473,7 +473,7 @@ RegAddName( char id[30], *newProp; int idLength, newBytes; - sprintf(id, "%x ", (unsigned int) commWindow); + sprintf(id, "%x ", (unsigned) commWindow); idLength = strlen(id); newBytes = idLength + strlen(name) + 1; newProp = ckalloc((unsigned) (regPtr->propLength + newBytes)); @@ -575,7 +575,7 @@ static int ValidateName( TkDisplay *dispPtr, /* Display for which to perform the * validation. */ - CONST char *name, /* The name of an application. */ + const 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 @@ -588,7 +588,7 @@ ValidateName( Atom actualType; char *property, **propertyPtr = &property; Tk_ErrorHandler handler; - CONST char **argv; + const char **argv; property = NULL; @@ -716,12 +716,12 @@ ServerSecure( *-------------------------------------------------------------- */ -CONST char * +const char * Tk_SetAppName( Tk_Window tkwin, /* Token for any window in the application to * be named: it is just used to identify the * application and the display. */ - CONST char *name) /* The name that will be used to refer to the + const char *name) /* The name that will be used to refer to the * interpreter in later "send" commands. Must * be globally unique. */ { @@ -731,10 +731,10 @@ Tk_SetAppName( TkDisplay *dispPtr = winPtr->dispPtr; NameRegistry *regPtr; Tcl_Interp *interp; - CONST char *actualName; + const char *actualName; Tcl_DString dString; int offset, i; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); interp = winPtr->mainPtr->interp; @@ -762,8 +762,7 @@ Tk_SetAppName( riPtr->nextPtr = tsdPtr->interpListPtr; tsdPtr->interpListPtr = riPtr; riPtr->name = NULL; - Tcl_CreateCommand(interp, "send", Tk_SendCmd, (ClientData) riPtr, - DeleteProc); + Tcl_CreateCommand(interp, "send", Tk_SendCmd, riPtr, DeleteProc); if (Tcl_IsSafe(interp)) { Tcl_HideCommand(interp, "send", "send"); } @@ -874,13 +873,13 @@ Tk_SendCmd( * field is used). */ Tcl_Interp *interp, /* Current interpreter. */ int argc, /* Number of arguments. */ - CONST char **argv) /* Argument strings. */ + const char **argv) /* Argument strings. */ { TkWindow *winPtr; Window commWindow; PendingCommand pending; register RegisteredInterp *riPtr; - CONST char *destName; + const char *destName; int result, c, async, i, firstArg; size_t length; Tk_RestrictProc *prevRestrictProc; @@ -889,7 +888,7 @@ Tk_SendCmd( Tcl_Time timeout; NameRegistry *regPtr; Tcl_DString request; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_Interp *localInterp; /* Used when the interpreter to send the * command to is within the same process. */ @@ -956,9 +955,9 @@ Tk_SendCmd( || (strcmp(riPtr->name, destName) != 0)) { continue; } - Tcl_Preserve((ClientData) riPtr); + Tcl_Preserve(riPtr); localInterp = riPtr->interp; - Tcl_Preserve((ClientData) localInterp); + Tcl_Preserve(localInterp); if (firstArg == (argc-1)) { result = Tcl_GlobalEval(localInterp, argv[firstArg]); } else { @@ -994,8 +993,8 @@ Tk_SendCmd( Tcl_SetObjResult(interp, Tcl_GetObjResult(localInterp)); Tcl_ResetResult(localInterp); } - Tcl_Release((ClientData) riPtr); - Tcl_Release((ClientData) localInterp); + Tcl_Release(riPtr); + Tcl_Release(localInterp); return result; } @@ -1024,7 +1023,7 @@ Tk_SendCmd( char buffer[TCL_INTEGER_SPACE * 2]; sprintf(buffer, "%x %d", - (unsigned int) Tk_WindowId(dispPtr->commTkwin), + (unsigned) Tk_WindowId(dispPtr->commTkwin), localData.sendSerial); Tcl_DStringAppend(&request, "\0-r ", 4); Tcl_DStringAppend(&request, buffer, -1); @@ -1178,9 +1177,9 @@ TkGetInterpNames( for (p=regPtr->property ; p-regPtr->property<(int)regPtr->propLength ;) { char *entry = p, *entryName; Window commWindow; - unsigned int id; + unsigned id; - if (sscanf(p, "%x",(unsigned int *) &id) != 1) { + if (sscanf(p, "%x", (unsigned *) &id) != 1) { commWindow = None; } else { commWindow = id; @@ -1250,9 +1249,9 @@ TkSendCleanup( { if (dispPtr->commTkwin != NULL) { Tk_DeleteEventHandler(dispPtr->commTkwin, PropertyChangeMask, - SendEventProc, (ClientData) dispPtr); + SendEventProc, dispPtr); Tk_DestroyWindow(dispPtr->commTkwin); - Tcl_Release((ClientData) dispPtr->commTkwin); + Tcl_Release(dispPtr->commTkwin); dispPtr->commTkwin = NULL; } } @@ -1293,12 +1292,12 @@ SendInit( if (dispPtr->commTkwin == NULL) { Tcl_Panic("Tk_CreateWindow failed in SendInit!"); } - Tcl_Preserve((ClientData) dispPtr->commTkwin); + Tcl_Preserve(dispPtr->commTkwin); atts.override_redirect = True; Tk_ChangeWindowAttributes(dispPtr->commTkwin, CWOverrideRedirect, &atts); Tk_CreateEventHandler(dispPtr->commTkwin, PropertyChangeMask, - SendEventProc, (ClientData) dispPtr); + SendEventProc, dispPtr); Tk_MakeWindowExist(dispPtr->commTkwin); /* @@ -1339,14 +1338,14 @@ SendEventProc( ClientData clientData, /* Display information. */ XEvent *eventPtr) /* Information about event. */ { - TkDisplay *dispPtr = (TkDisplay *) clientData; + TkDisplay *dispPtr = clientData; char *propInfo, **propInfoPtr = &propInfo; register char *p; int result, actualFormat; unsigned long numItems, bytesAfter; Atom actualType; Tcl_Interp *remoteInterp; /* Interp in which to execute the command. */ - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if ((eventPtr->xproperty.atom != dispPtr->commProperty) @@ -1485,7 +1484,7 @@ SendEventProc( break; } } - Tcl_Preserve((ClientData) riPtr); + Tcl_Preserve(riPtr); /* * We must protect the interpreter because the script may enter @@ -1493,7 +1492,7 @@ SendEventProc( */ remoteInterp = riPtr->interp; - Tcl_Preserve((ClientData) remoteInterp); + Tcl_Preserve(remoteInterp); result = Tcl_GlobalEval(remoteInterp, script); @@ -1508,7 +1507,7 @@ SendEventProc( Tcl_DStringAppend(&reply, Tcl_GetStringResult(remoteInterp), -1); if (result == TCL_ERROR) { - CONST char *varValue; + const char *varValue; varValue = Tcl_GetVar2(remoteInterp, "errorInfo", NULL, TCL_GLOBAL_ONLY); @@ -1524,8 +1523,8 @@ SendEventProc( } } } - Tcl_Release((ClientData) remoteInterp); - Tcl_Release((ClientData) riPtr); + Tcl_Release(remoteInterp); + Tcl_Release(riPtr); /* * Return the result to the sender if a commWindow was specified @@ -1617,19 +1616,19 @@ SendEventProc( } pcPtr->code = code; if (resultString != NULL) { - pcPtr->result = (char *) ckalloc((unsigned) - (strlen(resultString) + 1)); + pcPtr->result = + ckalloc((unsigned) (strlen(resultString) + 1)); strcpy(pcPtr->result, resultString); } if (code == TCL_ERROR) { if (errorInfo != NULL) { - pcPtr->errorInfo = (char *) ckalloc((unsigned) - (strlen(errorInfo) + 1)); + pcPtr->errorInfo = + ckalloc((unsigned) (strlen(errorInfo) + 1)); strcpy(pcPtr->errorInfo, errorInfo); } if (errorCode != NULL) { - pcPtr->errorCode = (char *) ckalloc((unsigned) - (strlen(errorCode) + 1)); + pcPtr->errorCode = + ckalloc((unsigned) (strlen(errorCode) + 1)); strcpy(pcPtr->errorCode, errorCode); } } @@ -1685,7 +1684,7 @@ AppendPropCarefully( Tk_ErrorHandler handler; handler = Tk_CreateErrorHandler(display, -1, -1, -1, AppendErrorProc, - (ClientData) pendingPtr); + pendingPtr); XChangeProperty(display, window, property, XA_STRING, 8, PropModeAppend, (unsigned char *) value, length); Tk_DeleteErrorHandler(handler); @@ -1702,9 +1701,9 @@ AppendErrorProc( ClientData clientData, /* Command to mark complete, or NULL. */ XErrorEvent *errorPtr) /* Information about error. */ { - PendingCommand *pendingPtr = (PendingCommand *) clientData; + PendingCommand *pendingPtr = clientData; register PendingCommand *pcPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (pendingPtr == NULL) { @@ -1752,10 +1751,10 @@ DeleteProc( ClientData clientData) /* Info about registration, passed as * ClientData. */ { - RegisteredInterp *riPtr = (RegisteredInterp *) clientData; + RegisteredInterp *riPtr = clientData; register RegisteredInterp *riPtr2; NameRegistry *regPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); regPtr = RegOpen(riPtr->interp, riPtr->dispPtr, 1); @@ -1776,7 +1775,7 @@ DeleteProc( ckfree((char *) riPtr->name); riPtr->interp = NULL; UpdateCommWindow(riPtr->dispPtr); - Tcl_EventuallyFree((ClientData) riPtr, TCL_DYNAMIC); + Tcl_EventuallyFree(riPtr, TCL_DYNAMIC); } /* @@ -1844,7 +1843,7 @@ UpdateCommWindow( { Tcl_DString names; RegisteredInterp *riPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_DStringInit(&names); @@ -1883,9 +1882,9 @@ TkpTestsendCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int argc, /* Number of arguments. */ - CONST char **argv) /* Argument strings. */ + const char **argv) /* Argument strings. */ { - TkWindow *winPtr = (TkWindow *) clientData; + TkWindow *winPtr = clientData; if (argc < 2) { Tcl_AppendResult(interp, "wrong # args; must be \"", argv[0], diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c index d8082ff..e4c250c 100644 --- a/unix/tkUnixWm.c +++ b/unix/tkUnixWm.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixWm.c,v 1.58 2007/12/13 15:28:51 dgp Exp $ + * RCS: @(#) $Id: tkUnixWm.c,v 1.59 2008/04/27 22:39:13 dkf Exp $ */ #include "tkUnixInt.h" @@ -207,7 +207,7 @@ typedef struct TkWmInfo { ProtocolHandler *protPtr; /* First in list of protocol handlers for this * window (NULL means none). */ int cmdArgc; /* Number of elements in cmdArgv below. */ - CONST char **cmdArgv; /* Array of strings to store in the WM_COMMAND + const char **cmdArgv; /* Array of strings to store in the WM_COMMAND * property. NULL means nothing available. */ char *clientMachine; /* String to store in WM_CLIENT_MACHINE * property, or NULL. */ @@ -363,100 +363,100 @@ static void WrapperEventProc(ClientData clientData, static void WmWaitMapProc(ClientData clientData, XEvent *eventPtr); static int WmAspectCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmAttributesCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmClientCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmColormapwindowsCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmCommandCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmDeiconifyCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmFocusmodelCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmForgetCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmFrameCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmGeometryCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmGridCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmGroupCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmIconbitmapCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmIconifyCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmIconmaskCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmIconnameCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmIconphotoCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmIconpositionCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmIconwindowCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmManageCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmMaxsizeCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmMinsizeCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmOverrideredirectCmd(Tk_Window tkwin,TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmPositionfromCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmProtocolCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmResizableCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmSizefromCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmStackorderCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmStateCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmTitleCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmTransientCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmWithdrawCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static void WmUpdateGeom(WmInfo *wmPtr, TkWindow *winPtr); /* @@ -511,7 +511,7 @@ void TkWmCleanup( protPtr = wmPtr->protPtr; wmPtr->protPtr = protPtr->nextPtr; - Tcl_EventuallyFree((ClientData) protPtr, TCL_DYNAMIC); + Tcl_EventuallyFree(protPtr, TCL_DYNAMIC); } if (wmPtr->cmdArgv != NULL) { ckfree((char *) wmPtr->cmdArgv); @@ -569,6 +569,7 @@ TkWmNewWindow( /* * Initialize attributes. */ + wmPtr->attributes.alpha = 1.0; wmPtr->attributes.topmost = 0; wmPtr->attributes.zoomed = 0; @@ -724,16 +725,16 @@ TkWmMapWindow( */ if (wmPtr->flags & WM_UPDATE_PENDING) { - Tcl_CancelIdleCall(UpdateGeometryInfo, (ClientData) winPtr); + Tcl_CancelIdleCall(UpdateGeometryInfo, winPtr); } - UpdateGeometryInfo((ClientData) winPtr); + UpdateGeometryInfo(winPtr); return; } wmPtr->flags |= WM_ABOUT_TO_MAP; if (wmPtr->flags & WM_UPDATE_PENDING) { - Tcl_CancelIdleCall(UpdateGeometryInfo, (ClientData) winPtr); + Tcl_CancelIdleCall(UpdateGeometryInfo, winPtr); } - UpdateGeometryInfo((ClientData) winPtr); + UpdateGeometryInfo(winPtr); wmPtr->flags &= ~WM_ABOUT_TO_MAP; /* @@ -877,11 +878,10 @@ TkWmDeadWindow( Tk_DestroyWindow((Tk_Window) wmPtr->wrapperPtr); } while (wmPtr->protPtr != NULL) { - ProtocolHandler *protPtr; + ProtocolHandler *protPtr = wmPtr->protPtr; - protPtr = wmPtr->protPtr; wmPtr->protPtr = protPtr->nextPtr; - Tcl_EventuallyFree((ClientData) protPtr, TCL_DYNAMIC); + Tcl_EventuallyFree(protPtr, TCL_DYNAMIC); } if (wmPtr->cmdArgv != NULL) { ckfree((char *) wmPtr->cmdArgv); @@ -890,7 +890,7 @@ TkWmDeadWindow( ckfree((char *) wmPtr->clientMachine); } if (wmPtr->flags & WM_UPDATE_PENDING) { - Tcl_CancelIdleCall(UpdateGeometryInfo, (ClientData) winPtr); + Tcl_CancelIdleCall(UpdateGeometryInfo, winPtr); } /* @@ -902,8 +902,7 @@ TkWmDeadWindow( if (wmPtr2->masterPtr == winPtr) { wmPtr->numTransients--; Tk_DeleteEventHandler((Tk_Window) wmPtr2->masterPtr, - StructureNotifyMask, - WmWaitMapProc, (ClientData) wmPtr2->winPtr); + StructureNotifyMask, WmWaitMapProc, wmPtr2->winPtr); wmPtr2->masterPtr = NULL; if (!(wmPtr2->flags & WM_NEVER_MAPPED)) { XDeleteProperty(winPtr->display, wmPtr2->wrapperPtr->window, @@ -999,10 +998,10 @@ Tk_WmObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window tkwin = (Tk_Window) clientData; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "aspect", "attributes", "client", "colormapwindows", "command", "deiconify", "focusmodel", "forget", "frame", "geometry", "grid", "group", "iconbitmap", @@ -1174,7 +1173,7 @@ WmAspectCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; int numer1, denom1, numer2, denom2; @@ -1371,7 +1370,7 @@ WmAttributesCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { int attribute = 0; @@ -1435,7 +1434,7 @@ WmClientCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; char *argv3; @@ -1466,8 +1465,7 @@ WmClientCmd( if (wmPtr->clientMachine != NULL) { ckfree((char *) wmPtr->clientMachine); } - wmPtr->clientMachine = (char *) - ckalloc((unsigned) (length + 1)); + wmPtr->clientMachine = ckalloc((unsigned) (length + 1)); strcpy(wmPtr->clientMachine, argv3); if (!(wmPtr->flags & WM_NEVER_MAPPED)) { XTextProperty textProp; @@ -1521,7 +1519,7 @@ WmColormapwindowsCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; Window *cmapList; @@ -1621,12 +1619,12 @@ WmCommandCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; char *argv3; int cmdArgc; - CONST char **cmdArgv; + const char **cmdArgv; if ((objc != 3) && (objc != 4)) { Tcl_WrongNumArgs(interp, 2, objv, "window ?value?"); @@ -1689,7 +1687,7 @@ WmDeiconifyCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; @@ -1735,10 +1733,10 @@ WmFocusmodelCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "active", "passive", NULL }; enum options { OPT_ACTIVE, OPT_PASSIVE }; @@ -1785,12 +1783,12 @@ WmFocusmodelCmd( */ static int -WmForgetCmd(tkwin, winPtr, interp, objc, objv) - Tk_Window tkwin; /* Main window of the application. */ - TkWindow *winPtr; /* Toplevel or Frame to work with */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ +WmForgetCmd( + Tk_Window tkwin, /* Main window of the application. */ + TkWindow *winPtr, /* Toplevel or Frame to work with */ + Tcl_Interp *interp, /* Current interpreter. */ + int objc, /* Number of arguments. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register Tk_Window frameWin = (Tk_Window)winPtr; @@ -1798,7 +1796,8 @@ WmForgetCmd(tkwin, winPtr, interp, objc, objv) TkFocusJoin(winPtr); Tk_UnmapWindow(frameWin); TkWmDeadWindow(winPtr); - winPtr->flags &= ~(TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED); + winPtr->flags &= + ~(TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED); RemapWindows(winPtr, winPtr->parentPtr); /* flags (above) must be cleared before calling */ /* TkMapTopFrame (below) */ @@ -1832,7 +1831,7 @@ WmFrameCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; Window window; @@ -1874,7 +1873,7 @@ WmGeometryCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; char xSign, ySign; @@ -1937,7 +1936,7 @@ WmGridCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; int reqWidth, reqHeight, widthInc, heightInc; @@ -2027,7 +2026,7 @@ WmGroupCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; Tk_Window tkwin2; @@ -2103,7 +2102,7 @@ WmIconbitmapCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; Pixmap pixmap; @@ -2163,7 +2162,7 @@ WmIconifyCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; if (objc != 3) { @@ -2222,7 +2221,7 @@ WmIconmaskCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; Pixmap pixmap; @@ -2281,7 +2280,7 @@ WmIconnameCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; char *argv3; @@ -2333,7 +2332,7 @@ WmIconphotoCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; Tk_PhotoHandle photo; @@ -2483,7 +2482,7 @@ WmIconpositionCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; int x, y; @@ -2540,7 +2539,7 @@ WmIconwindowCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; Tk_Window tkwin2; @@ -2650,12 +2649,12 @@ WmIconwindowCmd( */ static int -WmManageCmd(tkwin, winPtr, interp, objc, objv) - Tk_Window tkwin; /* Main window of the application. */ - TkWindow *winPtr; /* Toplevel or Frame to work with */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ +WmManageCmd( + Tk_Window tkwin, /* Main window of the application. */ + TkWindow *winPtr, /* Toplevel or Frame to work with */ + Tcl_Interp *interp, /* Current interpreter. */ + int objc, /* Number of arguments. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register Tk_Window frameWin = (Tk_Window)winPtr; register WmInfo *wmPtr = winPtr->wmInfoPtr; @@ -2704,7 +2703,7 @@ WmMaxsizeCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; int width, height; @@ -2762,7 +2761,7 @@ WmMinsizeCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; int width, height; @@ -2812,7 +2811,7 @@ WmOverrideredirectCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { int boolean, curValue; XSetWindowAttributes atts; @@ -2870,10 +2869,10 @@ WmPositionfromCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "program", "user", NULL }; enum options { OPT_PROGRAM, OPT_USER }; @@ -2934,7 +2933,7 @@ WmProtocolCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; register ProtocolHandler *protPtr, *prevPtr; @@ -3039,7 +3038,7 @@ WmResizableCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; int width, height; @@ -3099,10 +3098,10 @@ WmSizefromCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "program", "user", NULL }; enum options { OPT_PROGRAM, OPT_USER }; @@ -3164,10 +3163,10 @@ WmStackorderCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { TkWindow **windows, **window_ptr; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "isabove", "isbelow", NULL }; enum options { OPT_ISABOVE, OPT_ISBELOW }; @@ -3284,10 +3283,10 @@ WmStateCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "normal", "iconic", "withdrawn", NULL }; enum options { OPT_NORMAL, OPT_ICONIC, OPT_WITHDRAWN }; @@ -3378,7 +3377,7 @@ WmTitleCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; char *argv3; @@ -3431,7 +3430,7 @@ WmTransientCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; TkWindow *masterPtr = wmPtr->masterPtr; @@ -3571,7 +3570,7 @@ WmWithdrawCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; @@ -6039,7 +6038,7 @@ TkWmProtocolEventProc( register ProtocolHandler *protPtr; Atom protocol; int result; - CONST char *protocolName; + const char *protocolName; Tcl_Interp *interp; protocol = (Atom) eventPtr->xclient.data.l[0]; diff --git a/unix/tkUnixXId.c b/unix/tkUnixXId.c index af43b7f..0131181 100644 --- a/unix/tkUnixXId.c +++ b/unix/tkUnixXId.c @@ -16,7 +16,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixXId.c,v 1.10 2007/12/13 15:28:51 dgp Exp $ + * RCS: @(#) $Id: tkUnixXId.c,v 1.11 2008/04/27 22:39:14 dkf Exp $ */ /* @@ -76,7 +76,7 @@ TkInitXId( TkDisplay *dispPtr) /* Tk's information about the display. */ { dispPtr->idStackPtr = NULL; - dispPtr->defaultAllocProc = (XID (*) _ANSI_ARGS_((Display *display))) + dispPtr->defaultAllocProc = (XID (*) (Display *display)) dispPtr->display->resource_alloc; dispPtr->display->resource_alloc = AllocXId; dispPtr->windowStackPtr = NULL; @@ -324,7 +324,7 @@ TkFreeWindowId( if (!dispPtr->idCleanupScheduled) { dispPtr->idCleanupScheduled = Tcl_CreateTimerHandler(100, - WindowIdCleanup, (ClientData) dispPtr); + WindowIdCleanup, dispPtr); } } @@ -351,7 +351,7 @@ static void WindowIdCleanup( ClientData clientData) /* Pointer to TkDisplay for display */ { - TkDisplay *dispPtr = (TkDisplay *) clientData; + TkDisplay *dispPtr = clientData; int anyEvents, delta; Tk_RestrictProc *oldProc; ClientData oldData; @@ -379,8 +379,7 @@ WindowIdCleanup( XSync(dispPtr->display, False); } anyEvents = 0; - oldProc = Tk_RestrictEvents(CheckRestrictProc, (ClientData) &anyEvents, - &oldData); + oldProc = Tk_RestrictEvents(CheckRestrictProc, &anyEvents, &oldData); TkUnixDoOneXEvent(&timeout); Tk_RestrictEvents(oldProc, oldData, &oldData); if (anyEvents) { @@ -394,7 +393,7 @@ WindowIdCleanup( if (dispPtr->windowStackPtr != NULL) { Tcl_CreateTimerHandler(5000, WindowIdCleanup2, - (ClientData) dispPtr->windowStackPtr); + dispPtr->windowStackPtr); dispPtr->windowStackPtr = NULL; } return; @@ -405,7 +404,7 @@ WindowIdCleanup( tryAgain: dispPtr->idCleanupScheduled = Tcl_CreateTimerHandler(500, - WindowIdCleanup, (ClientData) dispPtr); + WindowIdCleanup, dispPtr); } /* @@ -430,7 +429,7 @@ static void WindowIdCleanup2( ClientData clientData) /* Pointer to TkIdStack list. */ { - TkIdStack *stackPtr = (TkIdStack *) clientData; + TkIdStack *stackPtr = clientData; TkIdStack *lastPtr; lastPtr = stackPtr; @@ -465,7 +464,8 @@ CheckRestrictProc( ClientData clientData, /* Pointer to flag to set. */ XEvent *eventPtr) /* Event to filter; not used. */ { - int *flag = (int *) clientData; + int *flag = clientData; + *flag = 1; return TK_DEFER_EVENT; } @@ -585,7 +585,7 @@ TkpWindowWasRecentlyDeleted( int TkpScanWindowId( Tcl_Interp *interp, - CONST char *string, + const char *string, Window *idPtr) { int value; diff --git a/win/stubs.c b/win/stubs.c index 678b176..cf0983f 100644 --- a/win/stubs.c +++ b/win/stubs.c @@ -252,7 +252,7 @@ void XSetCommand( Display *display, Window w, - CONST char **argv, + const char **argv, int argc) { } diff --git a/win/tkWinConfig.c b/win/tkWinConfig.c index 73e20f9..59faacc 100644 --- a/win/tkWinConfig.c +++ b/win/tkWinConfig.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinConfig.c,v 1.6 2007/12/13 15:28:53 dgp Exp $ + * RCS: @(#) $Id: tkWinConfig.c,v 1.7 2008/04/27 22:39:14 dkf Exp $ */ #include "tkWinInt.h" @@ -37,8 +37,8 @@ Tcl_Obj * TkpGetSystemDefault( Tk_Window tkwin, /* A window to use. */ - CONST char *dbName, /* The option database name. */ - CONST char *className) /* The name of the option class. */ + const char *dbName, /* The option database name. */ + const char *className) /* The name of the option class. */ { Tcl_Obj *valueObjPtr; Tk_Uid classUid; diff --git a/win/tkWinCursor.c b/win/tkWinCursor.c index e22a1c7..b35a2c8 100644 --- a/win/tkWinCursor.c +++ b/win/tkWinCursor.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinCursor.c,v 1.15 2007/12/13 15:28:55 dgp Exp $ + * RCS: @(#) $Id: tkWinCursor.c,v 1.16 2008/04/27 22:39:14 dkf Exp $ */ #include "tkWinInt.h" @@ -98,7 +98,7 @@ TkGetCursorByName( struct CursorName *namePtr; TkWinCursor *cursorPtr; int argc; - CONST char **argv = NULL; + const char **argv = NULL; /* * All cursor names are valid lists of one element (for @@ -191,8 +191,8 @@ TkGetCursorByName( TkCursor * TkCreateCursorFromData( Tk_Window tkwin, /* Window in which cursor will be used. */ - CONST char *source, /* Bitmap data for cursor shape. */ - CONST char *mask, /* Bitmap data for cursor mask. */ + const char *source, /* Bitmap data for cursor shape. */ + const char *mask, /* Bitmap data for cursor mask. */ int width, int height, /* Dimensions of cursor. */ int xHot, int yHot, /* Location of hot-spot in cursor. */ XColor fgColor, /* Foreground color for cursor. */ diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c index da88672..93d2d57 100644 --- a/win/tkWinDialog.c +++ b/win/tkWinDialog.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinDialog.c,v 1.51 2008/04/14 20:48:50 patthoyts Exp $ + * RCS: @(#) $Id: tkWinDialog.c,v 1.52 2008/04/27 22:39:14 dkf Exp $ * */ @@ -175,10 +175,10 @@ static UINT CALLBACK ColorDlgHookProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); static int GetFileNameA(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[], int isOpen); + Tcl_Obj *const objv[], int isOpen); static int GetFileNameW(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[], int isOpen); + Tcl_Obj *const objv[], int isOpen); static int MakeFilter(Tcl_Interp *interp, Tcl_Obj *valuePtr, Tcl_DString *dsPtr, Tcl_Obj *initialPtr, int *index); @@ -290,7 +290,7 @@ Tk_ChooseColorObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window tkwin, parent; HWND hWnd; @@ -299,7 +299,7 @@ Tk_ChooseColorObjCmd( static int inited = 0; static COLORREF dwCustColors[16]; static long oldColor; /* the color selected last time */ - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "-initialcolor", "-parent", "-title", NULL }; enum options { @@ -502,7 +502,7 @@ Tk_GetOpenFileObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { if (TkWinGetPlatformId() == VER_PLATFORM_WIN32_NT) { return GetFileNameW(clientData, interp, objc, objv, 1); @@ -533,7 +533,7 @@ Tk_GetSaveFileObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { if (TkWinGetPlatformId() == VER_PLATFORM_WIN32_NT) { return GetFileNameW(clientData, interp, objc, objv, 0); @@ -563,7 +563,7 @@ GetFileNameW( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[], /* Argument objects. */ + Tcl_Obj *const objv[], /* Argument objects. */ int open) /* 1 to call GetOpenFileName(), 0 to call * GetSaveFileName(). */ { @@ -579,15 +579,15 @@ GetFileNameW( Tcl_Encoding unicodeEncoding = TkWinGetUnicodeEncoding(); ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - static CONST char *saveOptionStrings[] = { + static const char *saveOptionStrings[] = { "-defaultextension", "-filetypes", "-initialdir", "-initialfile", "-parent", "-title", "-typevariable", NULL }; - static CONST char *openOptionStrings[] = { + static const char *openOptionStrings[] = { "-defaultextension", "-filetypes", "-initialdir", "-initialfile", "-multiple", "-parent", "-title", "-typevariable", NULL }; - CONST char **optionStrings; + const char **optionStrings; enum options { FILE_DEFAULT, FILE_TYPES, FILE_INITDIR, FILE_INITFILE, @@ -1007,7 +1007,7 @@ GetFileNameA( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[], /* Argument objects. */ + Tcl_Obj *const objv[], /* Argument objects. */ int open) /* 1 to call GetOpenFileName(), 0 to call * GetSaveFileName(). */ { @@ -1022,15 +1022,15 @@ GetFileNameA( Tcl_DString extString, filterString, dirString, titleString; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - static CONST char *saveOptionStrings[] = { + static const char *saveOptionStrings[] = { "-defaultextension", "-filetypes", "-initialdir", "-initialfile", "-parent", "-title", "-typevariable", NULL }; - static CONST char *openOptionStrings[] = { + static const char *openOptionStrings[] = { "-defaultextension", "-filetypes", "-initialdir", "-initialfile", "-multiple", "-parent", "-title", "-typevariable", NULL }; - CONST char **optionStrings; + const char **optionStrings; enum options { FILE_DEFAULT, FILE_TYPES, FILE_INITDIR, FILE_INITFILE, @@ -1674,7 +1674,7 @@ Tk_ChooseDirectoryObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { char path[MAX_PATH]; int oldMode, result, i; @@ -1689,7 +1689,7 @@ Tk_ChooseDirectoryObjCmd( TCHAR saveDir[MAX_PATH]; Tcl_DString titleString; /* UTF Title */ Tcl_DString initDirString; /* Initial directory */ - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "-initialdir", "-mustexist", "-parent", "-title", NULL }; enum options { @@ -2056,7 +2056,7 @@ Tk_MessageBoxObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window tkwin, parent; HWND hWnd; @@ -2064,7 +2064,7 @@ Tk_MessageBoxObjCmd( int defaultBtn, icon, type; int i, oldMode, winCode; UINT flags; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "-default", "-detail", "-icon", "-message", "-parent", "-title", "-type", NULL }; diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c index 35762d4..c082b58 100644 --- a/win/tkWinDraw.c +++ b/win/tkWinDraw.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinDraw.c,v 1.20 2007/12/13 15:28:55 dgp Exp $ + * RCS: @(#) $Id: tkWinDraw.c,v 1.21 2008/04/27 22:39:16 dkf Exp $ */ #include "tkWinInt.h" @@ -103,7 +103,7 @@ int tkpWinBltModes[] = { * The followng typedef is used to pass Windows GDI drawing functions. */ -typedef BOOL (CALLBACK *WinDrawFunc)(HDC dc, CONST POINT* points, int npoints); +typedef BOOL (CALLBACK *WinDrawFunc)(HDC dc, const POINT *points, int npoints); typedef struct ThreadSpecificData { POINT *winPoints; /* Array of points that is reused. */ diff --git a/win/tkWinEmbed.c b/win/tkWinEmbed.c index 80b1204..bf49dcd 100644 --- a/win/tkWinEmbed.c +++ b/win/tkWinEmbed.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinEmbed.c,v 1.34 2008/04/08 03:28:05 kennykb Exp $ + * RCS: @(#) $Id: tkWinEmbed.c,v 1.35 2008/04/27 22:39:17 dkf Exp $ */ #include "tkWinInt.h" @@ -104,7 +104,7 @@ TkpTestembedCmd( ClientData clientData, Tcl_Interp *interp, int argc, - CONST char **argv) + const char **argv) { return TCL_OK; } @@ -232,7 +232,7 @@ TkpUseWindow( * string is bogus. */ Tk_Window tkwin, /* Tk window that does not yet have an * associated X window. */ - CONST char *string) /* String identifying an X window to use for + const char *string) /* String identifying an X window to use for * tkwin; must be an integer value. */ { TkWindow *winPtr = (TkWindow *) tkwin; diff --git a/win/tkWinFont.c b/win/tkWinFont.c index 29e5fff..c6ce1e7 100644 --- a/win/tkWinFont.c +++ b/win/tkWinFont.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinFont.c,v 1.38 2007/12/13 15:28:55 dgp Exp $ + * RCS: @(#) $Id: tkWinFont.c,v 1.39 2008/04/27 22:39:17 dkf Exp $ */ #include "tkWinInt.h" @@ -174,7 +174,7 @@ typedef struct ThreadSpecificData { * currently loaded. As screen fonts are * loaded, this list grows to hold information * about what characters exist in each font - * family. */ + * family. */ Tcl_HashTable uidTable; } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; @@ -196,33 +196,33 @@ static SubFont * CanUseFallback(HDC hdc, WinFont *fontPtr, static SubFont * CanUseFallbackWithAliases(HDC hdc, WinFont *fontPtr, char *faceName, int ch, Tcl_DString *nameTriedPtr, SubFont **subFontPtrPtr); -static int FamilyExists(HDC hdc, CONST char *faceName); -static char * FamilyOrAliasExists(HDC hdc, CONST char *faceName); +static int FamilyExists(HDC hdc, const char *faceName); +static char * FamilyOrAliasExists(HDC hdc, const char *faceName); static SubFont * FindSubFontForChar(WinFont *fontPtr, int ch, SubFont **subFontPtrPtr); static void FontMapInsert(SubFont *subFontPtr, int ch); static void FontMapLoadPage(SubFont *subFontPtr, int row); static int FontMapLookup(SubFont *subFontPtr, int ch); static void FreeFontFamily(FontFamily *familyPtr); -static HFONT GetScreenFont(CONST TkFontAttributes *faPtr, - CONST char *faceName, int pixelSize); +static HFONT GetScreenFont(const TkFontAttributes *faPtr, + const char *faceName, int pixelSize); static void InitFont(Tk_Window tkwin, HFONT hFont, int overstrike, WinFont *tkFontPtr); static void InitSubFont(HDC hdc, HFONT hFont, int base, SubFont *subFontPtr); static int CreateNamedSystemLogFont(Tcl_Interp *interp, - Tk_Window tkwin, CONST char* name, + Tk_Window tkwin, const char* name, LOGFONT* logFontPtr); static int CreateNamedSystemFont(Tcl_Interp *interp, - Tk_Window tkwin, CONST char* name, HFONT hFont); + Tk_Window tkwin, const char* name, HFONT hFont); static int LoadFontRanges(HDC hdc, HFONT hFont, USHORT **startCount, USHORT **endCount, int *symbolPtr); static void MultiFontTextOut(HDC hdc, WinFont *fontPtr, - CONST char *source, int numBytes, int x, int y); + const char *source, int numBytes, int x, int y); static void ReleaseFont(WinFont *fontPtr); static void ReleaseSubFont(SubFont *subFontPtr); -static int SeenName(CONST char *name, Tcl_DString *dsPtr); +static int SeenName(const char *name, Tcl_DString *dsPtr); static void SwapLong(PULONG p); static void SwapShort(USHORT *p); static int CALLBACK WinFontCanUseProc(ENUMLOGFONT *lfPtr, @@ -300,7 +300,7 @@ TkpFontPkgInit( TkFont * TkpGetNativeFont( Tk_Window tkwin, /* For display where font will be used. */ - CONST char *name) /* Platform-specific font name. */ + const char *name) /* Platform-specific font name. */ { int object; WinFont *fontPtr; @@ -335,7 +335,7 @@ static int CreateNamedSystemLogFont( Tcl_Interp *interp, Tk_Window tkwin, - CONST char* name, + const char* name, LOGFONTA* logFontPtr) { HFONT hFont; @@ -365,7 +365,7 @@ static int CreateNamedSystemFont( Tcl_Interp *interp, Tk_Window tkwin, - CONST char* name, + const char* name, HFONT hFont) { WinFont winfont; @@ -403,14 +403,14 @@ TkWinSetupSystemFonts(TkMainInfo *mainPtr) /* force this for now */ if (((TkWindow *) tkwin)->mainPtr == NULL) { - ((TkWindow *) tkwin)->mainPtr = mainPtr; + ((TkWindow *) tkwin)->mainPtr = mainPtr; } /* - * If this API call fails then we will fallback to setting these - * named fonts from script in ttk/fonts.tcl. So far I've only - * seen it fail when WINVER has been defined for a higher platform than - * we are running on. (ie: WINVER=0x0600 and running on XP). + * If this API call fails then we will fallback to setting these named + * fonts from script in ttk/fonts.tcl. So far I've only seen it fail when + * WINVER has been defined for a higher platform than we are running on. + * (i.e. WINVER=0x0600 and running on XP). */ ZeroMemory(&ncMetrics, sizeof(ncMetrics)); @@ -418,29 +418,29 @@ TkWinSetupSystemFonts(TkMainInfo *mainPtr) if (SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncMetrics), &ncMetrics, 0)) { CreateNamedSystemLogFont(interp, tkwin, "TkDefaultFont", - &ncMetrics.lfMessageFont); + &ncMetrics.lfMessageFont); CreateNamedSystemLogFont(interp, tkwin, "TkHeadingFont", - &ncMetrics.lfMessageFont); + &ncMetrics.lfMessageFont); CreateNamedSystemLogFont(interp, tkwin, "TkTextFont", - &ncMetrics.lfMessageFont); + &ncMetrics.lfMessageFont); CreateNamedSystemLogFont(interp, tkwin, "TkMenuFont", - &ncMetrics.lfMenuFont); + &ncMetrics.lfMenuFont); CreateNamedSystemLogFont(interp, tkwin, "TkTooltipFont", - &ncMetrics.lfStatusFont); + &ncMetrics.lfStatusFont); CreateNamedSystemLogFont(interp, tkwin, "TkCaptionFont", - &ncMetrics.lfCaptionFont); + &ncMetrics.lfCaptionFont); CreateNamedSystemLogFont(interp, tkwin, "TkSmallCaptionFont", - &ncMetrics.lfSmCaptionFont); + &ncMetrics.lfSmCaptionFont); } iconMetrics.cbSize = sizeof(iconMetrics); if (SystemParametersInfo(SPI_GETICONMETRICS, sizeof(iconMetrics), &iconMetrics, 0)) { CreateNamedSystemLogFont(interp, tkwin, "TkIconFont", - &iconMetrics.lfFont); + &iconMetrics.lfFont); } - hFont = (HFONT)GetStockObject(ANSI_FIXED_FONT); + hFont = (HFONT) GetStockObject(ANSI_FIXED_FONT); CreateNamedSystemFont(interp, tkwin, "TkFixedFont", hFont); /* @@ -448,8 +448,8 @@ TkWinSetupSystemFonts(TkMainInfo *mainPtr) */ for (mapPtr = systemMap; mapPtr->strKey != NULL; mapPtr++) { - hFont = (HFONT)GetStockObject(mapPtr->numKey); - CreateNamedSystemFont(interp, tkwin, mapPtr->strKey, hFont); + hFont = (HFONT) GetStockObject(mapPtr->numKey); + CreateNamedSystemFont(interp, tkwin, mapPtr->strKey, hFont); } } @@ -491,7 +491,7 @@ TkpGetFontFromAttributes( * will be released. If NULL, a new TkFont * structure is allocated. */ Tk_Window tkwin, /* For display where font will be used. */ - CONST TkFontAttributes *faPtr) + const TkFontAttributes *faPtr) /* Set of attributes to match. */ { int i, j; @@ -764,7 +764,7 @@ TkpGetFontAttrsForChar( /* *--------------------------------------------------------------------------- * - * Tk_MeasureChars -- + * Tk_MeasureChars -- * * Determine the number of bytes from the string that will fit in the * given horizontal span. The measurement is done under the assumption @@ -784,7 +784,7 @@ TkpGetFontAttrsForChar( int Tk_MeasureChars( Tk_Font tkfont, /* Font in which characters will be drawn. */ - CONST char *source, /* UTF-8 string to be displayed. Need not be + const char *source, /* UTF-8 string to be displayed. Need not be * '\0' terminated. */ int numBytes, /* Maximum number of bytes to consider from * source string. */ @@ -815,7 +815,7 @@ Tk_MeasureChars( FontFamily *familyPtr; Tcl_DString runString; SubFont *thisSubFontPtr, *lastSubFontPtr; - CONST char *p, *end, *next = NULL, *start; + const char *p, *end, *next = NULL, *start; if (numBytes == 0) { *lengthPtr = 0; @@ -952,7 +952,7 @@ Tk_MeasureChars( * procedure without the maxLength limit or any flags. */ - CONST char *lastWordBreak = NULL; + const char *lastWordBreak = NULL; Tcl_UniChar ch2; end = p; @@ -986,7 +986,7 @@ Tk_MeasureChars( /* *--------------------------------------------------------------------------- * - * TkpMeasureCharsInContext -- + * TkpMeasureCharsInContext -- * * Determine the number of bytes from the string that will fit in the * given horizontal span. The measurement is done under the assumption @@ -1011,7 +1011,7 @@ Tk_MeasureChars( int TkpMeasureCharsInContext( Tk_Font tkfont, /* Font in which characters will be drawn. */ - CONST char *source, /* UTF-8 string to be displayed. Need not be + const char *source, /* UTF-8 string to be displayed. Need not be * '\0' terminated. */ int numBytes, /* Maximum number of bytes to consider from * source string in all. */ @@ -1063,7 +1063,7 @@ Tk_DrawChars( GC gc, /* Graphics context for drawing characters. */ Tk_Font tkfont, /* Font in which characters will be drawn; * must be the same as font used in GC. */ - CONST char *source, /* UTF-8 string to be displayed. Need not be + const char *source, /* UTF-8 string to be displayed. Need not be * '\0' terminated. All Tk meta-characters * (tabs, control characters, and newlines) * should be stripped out of the string that @@ -1227,7 +1227,7 @@ TkpDrawCharsInContext( GC gc, /* Graphics context for drawing characters. */ Tk_Font tkfont, /* Font in which characters will be drawn; * must be the same as font used in GC. */ - CONST char *source, /* UTF-8 string to be displayed. Need not be + const char *source, /* UTF-8 string to be displayed. Need not be * '\0' terminated. All Tk meta-characters * (tabs, control characters, and newlines) * should be stripped out of the string that @@ -1271,7 +1271,7 @@ MultiFontTextOut( HDC hdc, /* HDC to draw into. */ WinFont *fontPtr, /* Contains set of fonts to use when drawing * following string. */ - CONST char *source, /* Potentially multilingual UTF-8 string. */ + const char *source, /* Potentially multilingual UTF-8 string. */ int numBytes, /* Length of string in bytes. */ int x, int y) /* Coordinates at which to place origin of * string when drawing. */ @@ -1281,7 +1281,7 @@ MultiFontTextOut( HFONT oldFont; FontFamily *familyPtr; Tcl_DString runString; - CONST char *p, *end, *next; + const char *p, *end, *next; SubFont *lastSubFontPtr, *thisSubFontPtr; TEXTMETRIC tm; @@ -1705,7 +1705,7 @@ FreeFontFamily( for (familyPtrPtr = &tsdPtr->fontFamilyList; ; ) { if (*familyPtrPtr == familyPtr) { - *familyPtrPtr = familyPtr->nextPtr; + *familyPtrPtr = familyPtr->nextPtr; break; } familyPtrPtr = &(*familyPtrPtr)->nextPtr; @@ -1850,7 +1850,7 @@ FindSubFontForChar( if (subFontPtr == NULL) { /* - * No font can display this character. We will use the base font and + * No font can display this character. We will use the base font and * have it display the "unknown" character. */ @@ -2146,11 +2146,11 @@ CanUseFallbackWithAliases( static int SeenName( - CONST char *name, /* The name to check. */ + const char *name, /* The name to check. */ Tcl_DString *dsPtr) /* Contains names that have already been * seen. */ { - CONST char *seen, *end; + const char *seen, *end; seen = Tcl_DStringValue(dsPtr); end = seen + Tcl_DStringLength(dsPtr); @@ -2277,9 +2277,9 @@ CanUseFallback( static HFONT GetScreenFont( - CONST TkFontAttributes *faPtr, + const TkFontAttributes *faPtr, /* Desired font attributes for new HFONT. */ - CONST char *faceName, /* Overrides font family specified in font + const char *faceName, /* Overrides font family specified in font * attributes. */ int pixelSize) /* Overrides size specified in font * attributes. */ @@ -2359,7 +2359,7 @@ GetScreenFont( static int FamilyExists( HDC hdc, /* HDC in which font family will be used. */ - CONST char *faceName) /* Font family to query. */ + const char *faceName) /* Font family to query. */ { int result; Tcl_DString faceString; @@ -2403,7 +2403,7 @@ FamilyExists( static char * FamilyOrAliasExists( HDC hdc, - CONST char *faceName) + const char *faceName) { char **aliases; int i; @@ -2439,7 +2439,7 @@ WinFontExistProc( #pragma pack(1) /* Structures are byte aligned in file. */ -#define CMAPHEX 0x636d6170 /* Key for character map resource. */ +#define CMAPHEX 0x636d6170 /* Key for character map resource. */ typedef struct CMAPTABLE { USHORT version; /* Table version number (0). */ @@ -2481,7 +2481,7 @@ typedef struct SUBHEADER { } SUBHEADER; typedef struct HIBYTETABLE { - USHORT format; /* Format number is set to 2. */ + USHORT format; /* Format number is set to 2. */ USHORT length; /* The actual length in bytes of this * subtable. */ USHORT version; /* Version number (starts at 0). */ diff --git a/win/tkWinInit.c b/win/tkWinInit.c index 1a7f2be..a1b06ff 100644 --- a/win/tkWinInit.c +++ b/win/tkWinInit.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinInit.c,v 1.14 2007/12/13 15:28:55 dgp Exp $ + * RCS: @(#) $Id: tkWinInit.c,v 1.15 2008/04/27 22:39:17 dkf Exp $ */ #include "tkWinInt.h" @@ -70,7 +70,7 @@ TkpGetAppName( Tcl_DString *namePtr) /* A previously initialized Tcl_DString. */ { int argc, namelength; - CONST char **argv = NULL, *name, *p; + const char **argv = NULL, *name, *p; name = Tcl_GetVar(interp, "argv0", TCL_GLOBAL_ONLY); namelength = -1; @@ -115,8 +115,8 @@ TkpGetAppName( void TkpDisplayWarning( - CONST char *msg, /* Message to be displayed. */ - CONST char *title) /* Title of warning. */ + const char *msg, /* Message to be displayed. */ + const char *title) /* Title of warning. */ { Tcl_DString msgString, titleString; Tcl_Encoding unicodeEncoding = TkWinGetUnicodeEncoding(); diff --git a/win/tkWinTest.c b/win/tkWinTest.c index 0cdcb58..6de5563 100644 --- a/win/tkWinTest.c +++ b/win/tkWinTest.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinTest.c,v 1.16 2008/04/14 20:48:51 patthoyts Exp $ + * RCS: @(#) $Id: tkWinTest.c,v 1.17 2008/04/27 22:39:17 dkf Exp $ */ #include "tkWinInt.h" @@ -24,15 +24,15 @@ HWND tkWinCurrentDialog; static int TestclipboardObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TestwineventCmd(ClientData clientData, - Tcl_Interp *interp, int argc, CONST char **argv); + Tcl_Interp *interp, int argc, const char **argv); static int TestfindwindowObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int TestgetwindowinfoObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); MODULE_SCOPE int TkplatformtestInit(Tcl_Interp *interp); @@ -180,7 +180,7 @@ TestclipboardObjCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument values. */ + Tcl_Obj *const objv[]) /* Argument values. */ { HGLOBAL handle; char *data; @@ -238,7 +238,7 @@ TestwineventCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int argc, /* Number of arguments. */ - CONST char **argv) /* Argument strings. */ + const char **argv) /* Argument strings. */ { HWND hwnd = 0; HWND child = 0; @@ -379,7 +379,7 @@ TestfindwindowObjCmd( ClientData clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument values. */ + Tcl_Obj *const objv[]) /* Argument values. */ { const char *title = NULL, *class = NULL; HWND hwnd = NULL; @@ -418,7 +418,7 @@ TestgetwindowinfoObjCmd( ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) { HWND hwnd = NULL; Tcl_Obj *resObj = NULL, *classObj = NULL, *textObj = NULL; diff --git a/win/tkWinWindow.c b/win/tkWinWindow.c index e7a25af..1c2745c 100644 --- a/win/tkWinWindow.c +++ b/win/tkWinWindow.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinWindow.c,v 1.15 2007/02/23 14:15:34 dkf Exp $ + * RCS: @(#) $Id: tkWinWindow.c,v 1.16 2008/04/27 22:39:17 dkf Exp $ */ #include "tkWinInt.h" @@ -203,7 +203,7 @@ TkpPrintWindowId( int TkpScanWindowId( Tcl_Interp *interp, /* Interpreter to use for error reporting. */ - CONST char *string, /* String containing a (possibly signed) + const char *string, /* String containing a (possibly signed) * integer in a form acceptable to strtol. */ Window *idPtr) /* Place to store converted result. */ { diff --git a/win/tkWinWm.c b/win/tkWinWm.c index d9fc1ac..b4d5705 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinWm.c,v 1.124 2007/12/14 15:56:09 patthoyts Exp $ + * RCS: @(#) $Id: tkWinWm.c,v 1.125 2008/04/27 22:39:17 dkf Exp $ */ #include "tkWinInt.h" @@ -265,7 +265,7 @@ typedef struct TkWmInfo { ProtocolHandler *protPtr; /* First in list of protocol handlers for this * window (NULL means none). */ int cmdArgc; /* Number of elements in cmdArgv below. */ - CONST char **cmdArgv; /* Array of strings to store in the WM_COMMAND + const char **cmdArgv; /* Array of strings to store in the WM_COMMAND * property. NULL means nothing available. */ char *clientMachine; /* String to store in WM_CLIENT_MACHINE * property, or NULL. */ @@ -462,100 +462,100 @@ static void DecrIconRefCount(WinIconPtr titlebaricon); static int WmAspectCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmAttributesCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmClientCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmColormapwindowsCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmCommandCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmDeiconifyCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmFocusmodelCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmForgetCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmFrameCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmGeometryCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmGridCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmGroupCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmIconbitmapCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmIconifyCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmIconmaskCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmIconnameCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmIconphotoCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmIconpositionCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmIconwindowCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmManageCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmMaxsizeCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmMinsizeCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmOverrideredirectCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmPositionfromCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmProtocolCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmResizableCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmSizefromCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmStackorderCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmStateCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmTitleCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmTransientCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static int WmWithdrawCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); static void WmUpdateGeom(WmInfo *wmPtr, TkWindow *winPtr); /* @@ -1294,7 +1294,7 @@ ReadIconFromFile( SHFILEINFO sfiSM; Tcl_DString ds, ds2; DWORD *res; - CONST char *file; + const char *file; file = Tcl_TranslateFileName(interp, Tcl_GetString(fileName), &ds); if (file == NULL) { @@ -2831,10 +2831,10 @@ Tk_WmObjCmd( ClientData clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window tkwin = (Tk_Window) clientData; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "aspect", "attributes", "client", "colormapwindows", "command", "deiconify", "focusmodel", "forget", "frame", "geometry", "grid", "group", "iconbitmap", @@ -3007,7 +3007,7 @@ WmAspectCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; int numer1, denom1, numer2, denom2; @@ -3074,7 +3074,7 @@ WmAttributesCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; LONG style, exStyle, styleBit, *stylePtr = NULL; @@ -3365,7 +3365,7 @@ WmClientCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; char *argv3; @@ -3435,7 +3435,7 @@ WmColormapwindowsCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; TkWindow **cmapList; @@ -3528,12 +3528,12 @@ WmCommandCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; char *argv3; int cmdArgc; - CONST char **cmdArgv; + const char **cmdArgv; if ((objc != 3) && (objc != 4)) { Tcl_WrongNumArgs(interp, 2, objv, "window ?value?"); @@ -3595,7 +3595,7 @@ WmDeiconifyCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; @@ -3643,10 +3643,10 @@ WmFocusmodelCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "active", "passive", NULL }; enum options { @@ -3694,12 +3694,12 @@ WmFocusmodelCmd( */ static int -WmForgetCmd(tkwin, winPtr, interp, objc, objv) - Tk_Window tkwin; /* Main window of the application. */ - TkWindow *winPtr; /* Toplevel or Frame to work with */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ +WmForgetCmd( + Tk_Window tkwin, /* Main window of the application. */ + TkWindow *winPtr, /* Toplevel or Frame to work with */ + Tcl_Interp *interp, /* Current interpreter. */ + int objc, /* Number of arguments. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register Tk_Window frameWin = (Tk_Window)winPtr; @@ -3739,7 +3739,7 @@ WmFrameCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; HWND hwnd; @@ -3784,7 +3784,7 @@ WmGeometryCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; char xSign, ySign; @@ -3854,7 +3854,7 @@ WmGridCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; int reqWidth, reqHeight, widthInc, heightInc; @@ -3943,7 +3943,7 @@ WmGroupCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; Tk_Window tkwin2; @@ -4006,7 +4006,7 @@ WmIconbitmapCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; TkWindow *useWinPtr = winPtr; /* window to apply to (NULL if -default) */ @@ -4140,7 +4140,7 @@ WmIconifyCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; if (objc != 3) { @@ -4196,7 +4196,7 @@ WmIconmaskCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; Pixmap pixmap; @@ -4254,7 +4254,7 @@ WmIconnameCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; char *argv3; @@ -4306,7 +4306,7 @@ WmIconphotoCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { TkWindow *useWinPtr = winPtr; /* window to apply to (NULL if -default) */ Tk_PhotoHandle photo; @@ -4431,7 +4431,7 @@ WmIconpositionCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; int x, y; @@ -4487,7 +4487,7 @@ WmIconwindowCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; Tk_Window tkwin2; @@ -4589,12 +4589,12 @@ WmIconwindowCmd( */ static int -WmManageCmd(tkwin, winPtr, interp, objc, objv) - Tk_Window tkwin; /* Main window of the application. */ - TkWindow *winPtr; /* Toplevel or Frame to work with */ - Tcl_Interp *interp; /* Current interpreter. */ - int objc; /* Number of arguments. */ - Tcl_Obj *CONST objv[]; /* Argument objects. */ +WmManageCmd( + Tk_Window tkwin, /* Main window of the application. */ + TkWindow *winPtr, /* Toplevel or Frame to work with */ + Tcl_Interp *interp, /* Current interpreter. */ + int objc, /* Number of arguments. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register Tk_Window frameWin = (Tk_Window)winPtr; register WmInfo *wmPtr = winPtr->wmInfoPtr; @@ -4641,7 +4641,7 @@ WmMaxsizeCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; int width, height; @@ -4691,7 +4691,7 @@ WmMinsizeCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; int width, height; @@ -4741,7 +4741,7 @@ WmOverrideredirectCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; int boolean, curValue; @@ -4812,10 +4812,10 @@ WmPositionfromCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "program", "user", NULL }; enum options { @@ -4877,7 +4877,7 @@ WmProtocolCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; register ProtocolHandler *protPtr, *prevPtr; @@ -4969,7 +4969,7 @@ WmResizableCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; int width, height; @@ -5032,10 +5032,10 @@ WmSizefromCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "program", "user", NULL }; enum options { @@ -5098,10 +5098,10 @@ WmStackorderCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { TkWindow **windows, **window_ptr; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "isabove", "isbelow", NULL }; enum options { @@ -5219,10 +5219,10 @@ WmStateCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; - static CONST char *optionStrings[] = { + static const char *optionStrings[] = { "normal", "iconic", "withdrawn", "zoomed", NULL }; enum options { @@ -5361,7 +5361,7 @@ WmTitleCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; char *argv3; @@ -5435,7 +5435,7 @@ WmTransientCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; TkWindow *masterPtr = wmPtr->masterPtr, **masterPtrPtr = &masterPtr; @@ -5556,7 +5556,7 @@ WmWithdrawCmd( TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[]) /* Argument objects. */ + Tcl_Obj *const objv[]) /* Argument objects. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; @@ -6530,7 +6530,7 @@ TkWmProtocolEventProc( * the eval. */ - CONST char *name = Tk_GetAtomName((Tk_Window) winPtr, protocol); + const char *name = Tk_GetAtomName((Tk_Window) winPtr, protocol); Tcl_Preserve((ClientData) protPtr); interp = protPtr->interp; diff --git a/win/tkWinX.c b/win/tkWinX.c index e5e9e7b..9632bd2 100644 --- a/win/tkWinX.c +++ b/win/tkWinX.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinX.c,v 1.57 2007/12/13 15:28:56 dgp Exp $ + * RCS: @(#) $Id: tkWinX.c,v 1.58 2008/04/27 22:39:17 dkf Exp $ */ /* @@ -70,7 +70,7 @@ static TkWinProcs asciiProcs = { WPARAM wParam, LPARAM lParam)) CallWindowProcA, (LRESULT (WINAPI *)(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)) DefWindowProcA, - (ATOM (WINAPI *)(CONST WNDCLASS *lpWndClass)) RegisterClassA, + (ATOM (WINAPI *)(const WNDCLASS *lpWndClass)) RegisterClassA, (BOOL (WINAPI *)(HWND hWnd, LPCTSTR lpString)) SetWindowTextA, (HWND (WINAPI *)(DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, @@ -88,7 +88,7 @@ static TkWinProcs unicodeProcs = { WPARAM wParam, LPARAM lParam)) CallWindowProcW, (LRESULT (WINAPI *)(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)) DefWindowProcW, - (ATOM (WINAPI *)(CONST WNDCLASS *lpWndClass)) RegisterClassW, + (ATOM (WINAPI *)(const WNDCLASS *lpWndClass)) RegisterClassW, (BOOL (WINAPI *)(HWND hWnd, LPCTSTR lpString)) SetWindowTextW, (HWND (WINAPI *)(DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, @@ -464,10 +464,10 @@ TkWinGetPlatformTheme(void) *---------------------------------------------------------------------- */ -CONST char * +const char * TkGetDefaultScreenName( Tcl_Interp *interp, /* Not used. */ - CONST char *screenName) /* If NULL, use default string. */ + const char *screenName) /* If NULL, use default string. */ { if ((screenName == NULL) || (screenName[0] == '\0')) { screenName = winScreenName; @@ -589,7 +589,7 @@ TkWinDisplayChanged( TkDisplay * TkpOpenDisplay( - CONST char *display_name) + const char *display_name) { Screen *screen; TkWinDrawable *twdPtr; diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c index a0a485c..03eaab9 100644 --- a/win/ttkWinXPTheme.c +++ b/win/ttkWinXPTheme.c @@ -1,5 +1,5 @@ /* - * $Id: ttkWinXPTheme.c,v 1.19 2008/04/08 23:30:46 patthoyts Exp $ + * $Id: ttkWinXPTheme.c,v 1.20 2008/04/27 22:39:17 dkf Exp $ * * Tk theme engine which uses the Windows XP "Visual Styles" API * Adapted from Georgios Petasis' XP theme patch. @@ -50,8 +50,8 @@ typedef HRESULT (STDAPICALLTYPE GetThemeTextExtentProc)(HTHEME hTheme, HDC hdc, typedef HRESULT (STDAPICALLTYPE DrawThemeTextProc)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags, DWORD dwTextFlags2, const RECT *pRect); -typedef BOOL (STDAPICALLTYPE IsThemeActiveProc)(VOID); -typedef BOOL (STDAPICALLTYPE IsAppThemedProc)(VOID); +typedef BOOL (STDAPICALLTYPE IsThemeActiveProc)(void); +typedef BOOL (STDAPICALLTYPE IsAppThemedProc)(void); typedef struct { @@ -992,7 +992,8 @@ Ttk_CreateVsapiElement( void *clientData, Ttk_Theme theme, const char *elementName, - int objc, Tcl_Obj *CONST objv[]) + int objc, + Tcl_Obj *const objv[]) { XPThemeData *themeData = clientData; ElementInfo *elementPtr = NULL; @@ -1028,34 +1029,38 @@ Ttk_CreateVsapiElement( int tmp = 0; if (i == objc -1) { Tcl_AppendResult(interp, "Missing value for \"", - Tcl_GetString(objv[i]), "\".", NULL); + Tcl_GetString(objv[i]), "\".", NULL); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[i], optionStrings, "option", 0, &option) != TCL_OK) return TCL_ERROR; switch (option) { - case O_PADDING: - if (Ttk_GetBorderFromObj(interp, objv[i+1], &pad) != TCL_OK) - return TCL_ERROR; - break; - case O_MARGINS: - if (Ttk_GetBorderFromObj(interp, objv[i+1], &pad) != TCL_OK) - return TCL_ERROR; - flags |= PAD_MARGINS; - break; - case O_WIDTH: - if (Tcl_GetIntFromObj(interp, objv[i+1], &tmp) != TCL_OK) - return TCL_ERROR; - pad.left = pad.right = tmp; - flags |= IGNORE_THEMESIZE; - break; - case O_HEIGHT: - if (Tcl_GetIntFromObj(interp, objv[i+1], &tmp) != TCL_OK) - return TCL_ERROR; - pad.top = pad.bottom = tmp; - flags |= IGNORE_THEMESIZE; - break; + case O_PADDING: + if (Ttk_GetBorderFromObj(interp, objv[i+1], &pad) != TCL_OK) { + return TCL_ERROR; + } + break; + case O_MARGINS: + if (Ttk_GetBorderFromObj(interp, objv[i+1], &pad) != TCL_OK) { + return TCL_ERROR; + } + flags |= PAD_MARGINS; + break; + case O_WIDTH: + if (Tcl_GetIntFromObj(interp, objv[i+1], &tmp) != TCL_OK) { + return TCL_ERROR; + } + pad.left = pad.right = tmp; + flags |= IGNORE_THEMESIZE; + break; + case O_HEIGHT: + if (Tcl_GetIntFromObj(interp, objv[i+1], &tmp) != TCL_OK) { + return TCL_ERROR; + } + pad.top = pad.bottom = tmp; + flags |= IGNORE_THEMESIZE; + break; } } } @@ -1068,7 +1073,7 @@ Ttk_CreateVsapiElement( return TCL_ERROR; /* we over-allocate to ensure there is a terminating entry */ stateTable = (Ttk_StateTable *) - ckalloc(sizeof(Ttk_StateTable) * (count + 1)); + ckalloc(sizeof(Ttk_StateTable) * (count + 1)); memset(stateTable, 0, sizeof(Ttk_StateTable) * (count + 1)); for (n = 0, j = 0; status == TCL_OK && n < count; n += 2, ++j) { Ttk_StateSpec spec = {0,0}; @@ -1077,7 +1082,7 @@ Ttk_CreateVsapiElement( stateTable[j].onBits = spec.onbits; stateTable[j].offBits = spec.offbits; status = Tcl_GetIntFromObj(interp, specs[n+1], - &stateTable[j].index); + &stateTable[j].index); } } if (status != TCL_OK) { @@ -1102,7 +1107,7 @@ Ttk_CreateVsapiElement( elementPtr->elementName = name; /* set the class name to an allocated copy */ - wname = (LPWSTR)ckalloc(sizeof(WCHAR) * (length + 1)); + wname = (LPWSTR) ckalloc(sizeof(WCHAR) * (length + 1)); wcscpy(wname, className); elementPtr->className = wname; diff --git a/win/winMain.c b/win/winMain.c index 254d194..c75c22c 100644 --- a/win/winMain.c +++ b/win/winMain.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: winMain.c,v 1.26 2007/12/13 15:28:56 dgp Exp $ + * RCS: @(#) $Id: winMain.c,v 1.27 2008/04/27 22:39:17 dkf Exp $ */ #include "tkInt.h" @@ -28,7 +28,7 @@ * Forward declarations for procedures defined later in this file: */ -static void WishPanic(CONST char *format, ...); +static void WishPanic(const char *format, ...); #ifdef TK_TEST extern int Tktest_Init(Tcl_Interp *interp); #endif /* TK_TEST */ @@ -224,7 +224,7 @@ error: void WishPanic( - CONST char *format, ...) + const char *format, ...) { va_list argList; char buf[1024]; -- cgit v0.12 From 0c02362da257d3535b17206211d8acb98d6d9e27 Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 28 Apr 2008 08:32:25 +0000 Subject: Forgot to check in critical helper macro! --- generic/tkCanvas.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/generic/tkCanvas.h b/generic/tkCanvas.h index 5909611..877ecfe 100644 --- a/generic/tkCanvas.h +++ b/generic/tkCanvas.h @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCanvas.h,v 1.13 2007/12/13 15:24:13 dgp Exp $ + * RCS: @(#) $Id: tkCanvas.h,v 1.14 2008/04/28 08:32:25 dkf Exp $ */ #ifndef _TKCANVAS @@ -293,7 +293,7 @@ typedef struct TkCanvas { */ MODULE_SCOPE int TkCanvPostscriptCmd(TkCanvas *canvasPtr, - Tcl_Interp *interp, int argc, CONST char **argv); + Tcl_Interp *interp, int argc, const char **argv); MODULE_SCOPE int TkCanvTranslatePath(TkCanvas *canvPtr, int numVertex, double *coordPtr, int closed, XPoint *outPtr); @@ -305,4 +305,10 @@ MODULE_SCOPE Tk_ItemType tkArcType, tkBitmapType, tkImageType, tkLineType; MODULE_SCOPE Tk_ItemType tkOvalType, tkPolygonType; MODULE_SCOPE Tk_ItemType tkRectangleType, tkTextType, tkWindowType; +/* + * Convenience macro. + */ + +#define Canvas(canvas) ((TkCanvas *) (canvas)) + #endif /* _TKCANVAS */ -- cgit v0.12 From 92a33ad5ca7cab82ebae7b4f54c3cbffa840d73d Mon Sep 17 00:00:00 2001 From: dkf Date: Fri, 2 May 2008 10:28:18 +0000 Subject: More elimination of pre-C89-isms. --- compat/stdlib.h | 51 ++++--- compat/unistd.h | 110 ++++++++------- generic/tkEntry.h | 4 +- generic/tkFont.h | 14 +- win/tkWinWm.c | 397 +++++++++++++++++++++++++++--------------------------- 5 files changed, 287 insertions(+), 289 deletions(-) diff --git a/compat/stdlib.h b/compat/stdlib.h index 4b76fe5..546e5ed 100644 --- a/compat/stdlib.h +++ b/compat/stdlib.h @@ -1,20 +1,19 @@ /* * stdlib.h -- * - * Declares facilities exported by the "stdlib" portion of - * the C library. This file isn't complete in the ANSI-C - * sense; it only declares things that are needed by Tcl. - * This file is needed even on many systems with their own - * stdlib.h (e.g. SunOS) because not all stdlib.h files - * declare all the procedures needed here (such as strtod). + * Declares facilities exported by the "stdlib" portion of the C library. + * This file isn't complete in the ANSI-C sense; it only declares things + * that are needed by Tk. This file is needed even on many systems with + * their own stdlib.h (e.g. SunOS) because not all stdlib.h files declare + * all the procedures needed here (such as strtod). * * Copyright (c) 1991 The Regents of the University of California. * Copyright (c) 1994-1998 Sun Microsystems, Inc. * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * See the file "license.terms" for information on usage and redistribution of + * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: stdlib.h,v 1.3 1999/04/16 01:51:07 stanton Exp $ + * RCS: @(#) $Id: stdlib.h,v 1.4 2008/05/02 10:28:18 dkf Exp $ */ #ifndef _STDLIB @@ -22,24 +21,20 @@ #include -extern void abort _ANSI_ARGS_((void)); -extern double atof _ANSI_ARGS_((CONST char *string)); -extern int atoi _ANSI_ARGS_((CONST char *string)); -extern long atol _ANSI_ARGS_((CONST char *string)); -extern char * calloc _ANSI_ARGS_((unsigned int numElements, - unsigned int size)); -extern void exit _ANSI_ARGS_((int status)); -extern int free _ANSI_ARGS_((char *blockPtr)); -extern char * getenv _ANSI_ARGS_((CONST char *name)); -extern char * malloc _ANSI_ARGS_((unsigned int numBytes)); -extern void qsort _ANSI_ARGS_((VOID *base, int n, int size, - int (*compar)(CONST VOID *element1, CONST VOID - *element2))); -extern char * realloc _ANSI_ARGS_((char *ptr, unsigned int numBytes)); -extern double strtod _ANSI_ARGS_((CONST char *string, char **endPtr)); -extern long strtol _ANSI_ARGS_((CONST char *string, char **endPtr, - int base)); -extern unsigned long strtoul _ANSI_ARGS_((CONST char *string, - char **endPtr, int base)); +extern void abort(void); +extern double atof(const char *string); +extern int atoi(const char *string); +extern long atol(const char *string); +extern char * calloc(unsigned int numElements, unsigned int size); +extern void exit(int status); +extern int free(char *blockPtr); +extern char * getenv(const char *name); +extern char * malloc(unsigned int numBytes); +extern void qsort(void *base, int n, int size, int (*compar)( + const void *element1, const void *element2)); +extern char * realloc(char *ptr, unsigned int numBytes); +extern double strtod(const char *string, char **endPtr); +extern long strtol(const char *string, char **endPtr, int base); +extern unsigned long strtoul(const char *string, char **endPtr, int base); #endif /* _STDLIB */ diff --git a/compat/unistd.h b/compat/unistd.h index a7ec148..cb9f8c3 100644 --- a/compat/unistd.h +++ b/compat/unistd.h @@ -1,18 +1,16 @@ /* * unistd.h -- * - * Macros, CONSTants and prototypes for Posix conformance. + * Macros, constants and prototypes for Posix conformance. * - * Copyright 1989 Regents of the University of California - * Permission to use, copy, modify, and distribute this - * software and its documentation for any purpose and without - * fee is hereby granted, provided that the above copyright - * notice appear in all copies. The University of California - * makes no representations about the suitability of this - * software for any purpose. It is provided "as is" without - * express or implied warranty. + * Copyright 1989 Regents of the University of California Permission to use, + * copy, modify, and distribute this software and its documentation for any + * purpose and without fee is hereby granted, provided that the above + * copyright notice appear in all copies. The University of California makes + * no representations about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. * - * RCS: @(#) $Id: unistd.h,v 1.2 1998/09/14 18:03:09 stanton Exp $ + * RCS: @(#) $Id: unistd.h,v 1.3 2008/05/02 10:28:18 dkf Exp $ */ #ifndef _UNISTD @@ -28,56 +26,56 @@ #endif /* - * Strict POSIX stuff goes here. Extensions go down below, in the - * ifndef _POSIX_SOURCE section. + * Strict POSIX stuff goes here. Extensions go down below, in the ifndef + * _POSIX_SOURCE section. */ -extern void _exit _ANSI_ARGS_((int status)); -extern int access _ANSI_ARGS_((CONST char *path, int mode)); -extern int chdir _ANSI_ARGS_((CONST char *path)); -extern int chown _ANSI_ARGS_((CONST char *path, uid_t owner, gid_t group)); -extern int close _ANSI_ARGS_((int fd)); -extern int dup _ANSI_ARGS_((int oldfd)); -extern int dup2 _ANSI_ARGS_((int oldfd, int newfd)); -extern int execl _ANSI_ARGS_((CONST char *path, ...)); -extern int execle _ANSI_ARGS_((CONST char *path, ...)); -extern int execlp _ANSI_ARGS_((CONST char *file, ...)); -extern int execv _ANSI_ARGS_((CONST char *path, char **argv)); -extern int execve _ANSI_ARGS_((CONST char *path, char **argv, char **envp)); -extern int execvp _ANSI_ARGS_((CONST char *file, char **argv)); -extern pid_t fork _ANSI_ARGS_((void)); -extern char *getcwd _ANSI_ARGS_((char *buf, size_t size)); -extern gid_t getegid _ANSI_ARGS_((void)); -extern uid_t geteuid _ANSI_ARGS_((void)); -extern gid_t getgid _ANSI_ARGS_((void)); -extern int getgroups _ANSI_ARGS_((int bufSize, int *buffer)); -extern pid_t getpid _ANSI_ARGS_((void)); -extern uid_t getuid _ANSI_ARGS_((void)); -extern int isatty _ANSI_ARGS_((int fd)); -extern long lseek _ANSI_ARGS_((int fd, long offset, int whence)); -extern int pipe _ANSI_ARGS_((int *fildes)); -extern int read _ANSI_ARGS_((int fd, char *buf, size_t size)); -extern int setgid _ANSI_ARGS_((gid_t group)); -extern int setuid _ANSI_ARGS_((uid_t user)); -extern unsigned sleep _ANSI_ARGS_ ((unsigned seconds)); -extern char *ttyname _ANSI_ARGS_((int fd)); -extern int unlink _ANSI_ARGS_((CONST char *path)); -extern int write _ANSI_ARGS_((int fd, CONST char *buf, size_t size)); +extern void _exit(int status); +extern int access(const char *path, int mode); +extern int chdir(const char *path); +extern int chown(const char *path, uid_t owner, gid_t group); +extern int close(int fd); +extern int dup(int oldfd); +extern int dup2(int oldfd, int newfd); +extern int execl(const char *path, ...); +extern int execle(const char *path, ...); +extern int execlp(const char *file, ...); +extern int execv(const char *path, char **argv); +extern int execve(const char *path, char **argv, char **envp); +extern int execvp(const char *file, char **argv); +extern pid_t fork(void); +extern char * getcwd(char *buf, size_t size); +extern gid_t getegid(void); +extern uid_t geteuid(void); +extern gid_t getgid(void); +extern int getgroups(int bufSize, int *buffer); +extern pid_t getpid(void); +extern uid_t getuid(void); +extern int isatty(int fd); +extern long lseek(int fd, long offset, int whence); +extern int pipe(int *fildes); +extern int read(int fd, char *buf, size_t size); +extern int setgid(gid_t group); +extern int setuid(uid_t user); +extern unsigned sleep(unsigned seconds); +extern char * ttyname(int fd); +extern int unlink(const char *path); +extern int write(int fd, const char *buf, size_t size); #ifndef _POSIX_SOURCE -extern char *crypt _ANSI_ARGS_((CONST char *, CONST char *)); -extern int fchown _ANSI_ARGS_((int fd, uid_t owner, gid_t group)); -extern int flock _ANSI_ARGS_((int fd, int operation)); -extern int ftruncate _ANSI_ARGS_((int fd, unsigned long length)); -extern int ioctl _ANSI_ARGS_((int fd, int request, ...)); -extern int readlink _ANSI_ARGS_((CONST char *path, char *buf, int bufsize)); -extern int setegid _ANSI_ARGS_((gid_t group)); -extern int seteuid _ANSI_ARGS_((uid_t user)); -extern int setreuid _ANSI_ARGS_((int ruid, int euid)); -extern int symlink _ANSI_ARGS_((CONST char *, CONST char *)); -extern int ttyslot _ANSI_ARGS_((void)); -extern int truncate _ANSI_ARGS_((CONST char *path, unsigned long length)); -extern int vfork _ANSI_ARGS_((void)); +extern char * crypt(const char *, const char *); +extern int fchown(int fd, uid_t owner, gid_t group); +extern int flock(int fd, int operation); +extern int ftruncate(int fd, unsigned long length); +extern int ioctl(int fd, int request, ...); +extern int readlink(const char *path, char *buf, int bufsize); +extern int setegid(gid_t group); +extern int seteuid(uid_t user); +extern int setreuid(int ruid, int euid); +extern int symlink(const char *, const char *); +extern int ttyslot(void); +extern int truncate(const char *path, unsigned long length); +extern int vfork(void); #endif /* _POSIX_SOURCE */ #endif /* _UNISTD */ diff --git a/generic/tkEntry.h b/generic/tkEntry.h index 7f8aa1f..764049d 100644 --- a/generic/tkEntry.h +++ b/generic/tkEntry.h @@ -48,7 +48,7 @@ typedef struct { * Fields that are set by widget commands other than "configure". */ - CONST char *string; /* Pointer to storage for string; + const char *string; /* Pointer to storage for string; * NULL-terminated; malloc-ed. */ int insertPos; /* Character index before which next typed * character will be inserted. */ @@ -138,7 +138,7 @@ typedef struct { * configuration settings above. */ - CONST char *displayString; /* String to use when displaying. This may be + const char *displayString; /* String to use when displaying. This may be * a pointer to string, or a pointer to * malloced memory with the same character * length as string but whose characters are diff --git a/generic/tkFont.h b/generic/tkFont.h index 448423d..1253700 100644 --- a/generic/tkFont.h +++ b/generic/tkFont.h @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkFont.h,v 1.10 2007/05/04 21:29:22 patthoyts Exp $ + * RCS: @(#) $Id: tkFont.h,v 1.11 2008/05/02 10:28:18 dkf Exp $ */ #ifndef _TKFONT @@ -195,18 +195,18 @@ typedef struct TkXLFDAttributes { #define TkInitFontAttributes(fa) memset((fa), 0, sizeof(TkFontAttributes)); #define TkInitXLFDAttributes(xa) memset((xa), 0, sizeof(TkXLFDAttributes)); -MODULE_SCOPE int TkFontParseXLFD(CONST char *string, +MODULE_SCOPE int TkFontParseXLFD(const char *string, TkFontAttributes *faPtr, TkXLFDAttributes *xaPtr); -MODULE_SCOPE char ** TkFontGetAliasList(CONST char *faceName); +MODULE_SCOPE char ** TkFontGetAliasList(const char *faceName); MODULE_SCOPE char *** TkFontGetFallbacks(void); MODULE_SCOPE int TkFontGetPixels(Tk_Window tkwin, int size); MODULE_SCOPE int TkFontGetPoints(Tk_Window tkwin, int size); MODULE_SCOPE char ** TkFontGetGlobalClass(void); MODULE_SCOPE char ** TkFontGetSymbolClass(void); MODULE_SCOPE int TkCreateNamedFont(Tcl_Interp *interp, Tk_Window tkwin, - CONST char *name, TkFontAttributes *faPtr); + const char *name, TkFontAttributes *faPtr); MODULE_SCOPE int TkDeleteNamedFont(Tcl_Interp *interp, - Tk_Window tkwin, CONST char *name); + Tk_Window tkwin, const char *name); MODULE_SCOPE int TkFontGetFirstTextLayout(Tk_TextLayout layout, Tk_Font *font, char *dst); @@ -217,10 +217,10 @@ MODULE_SCOPE int TkFontGetFirstTextLayout(Tk_TextLayout layout, MODULE_SCOPE void TkpDeleteFont(TkFont *tkFontPtr); MODULE_SCOPE void TkpFontPkgInit(TkMainInfo *mainPtr); MODULE_SCOPE TkFont * TkpGetFontFromAttributes(TkFont *tkFontPtr, - Tk_Window tkwin, CONST TkFontAttributes *faPtr); + Tk_Window tkwin, const TkFontAttributes *faPtr); MODULE_SCOPE void TkpGetFontFamilies(Tcl_Interp *interp, Tk_Window tkwin); -MODULE_SCOPE TkFont * TkpGetNativeFont(Tk_Window tkwin, CONST char *name); +MODULE_SCOPE TkFont * TkpGetNativeFont(Tk_Window tkwin, const char *name); #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT diff --git a/win/tkWinWm.c b/win/tkWinWm.c index b4d5705..e2cda93 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinWm.c,v 1.125 2008/04/27 22:39:17 dkf Exp $ + * RCS: @(#) $Id: tkWinWm.c,v 1.126 2008/05/02 10:28:18 dkf Exp $ */ #include "tkWinInt.h" @@ -646,7 +646,7 @@ static LPSTR FindDIBBits( LPSTR lpbi) { - return lpbi + *(LPDWORD)lpbi + PaletteSize(lpbi); + return lpbi + *((LPDWORD) lpbi) + PaletteSize(lpbi); } /* @@ -702,7 +702,7 @@ AdjustIconImagePointers( * BITMAPINFO is at beginning of bits. */ - lpImage->lpbi = (LPBITMAPINFO)lpImage->lpBits; + lpImage->lpbi = (LPBITMAPINFO) lpImage->lpBits; /* * Width - simple enough. @@ -728,14 +728,14 @@ AdjustIconImagePointers( * XOR bits follow the header and color table. */ - lpImage->lpXOR = (LPBYTE)FindDIBBits(((LPSTR)lpImage->lpbi)); + lpImage->lpXOR = (LPBYTE) FindDIBBits((LPSTR) lpImage->lpbi); /* * AND bits follow the XOR bits. */ - lpImage->lpAND = lpImage->lpXOR + (lpImage->Height* - BytesPerLine((LPBITMAPINFOHEADER)(lpImage->lpbi))); + lpImage->lpAND = lpImage->lpXOR + + lpImage->Height*BytesPerLine((LPBITMAPINFOHEADER) lpImage->lpbi); return TRUE; } @@ -758,18 +758,15 @@ MakeIconOrCursorFromResource( LPICONIMAGE lpIcon, BOOL isIcon) { - HICON hIcon ; - static FARPROC pfnCreateIconFromResourceEx=NULL; - static int initinfo=0; + HICON hIcon; + static FARPROC pfnCreateIconFromResourceEx = NULL; + static int initinfo = 0; /* * Sanity Check */ - if (lpIcon == NULL) { - return NULL; - } - if (lpIcon->lpBits == NULL) { + if (lpIcon == NULL || lpIcon->lpBits == NULL) { return NULL; } @@ -788,10 +785,10 @@ MakeIconOrCursorFromResource( */ if (pfnCreateIconFromResourceEx != NULL) { - hIcon = (HICON) (pfnCreateIconFromResourceEx) (lpIcon->lpBits, + hIcon = (HICON) pfnCreateIconFromResourceEx(lpIcon->lpBits, lpIcon->dwNumBytes, isIcon, 0x00030000, - (*(LPBITMAPINFOHEADER)(lpIcon->lpBits)).biWidth, - (*(LPBITMAPINFOHEADER)(lpIcon->lpBits)).biHeight/2, 0); + (*(LPBITMAPINFOHEADER) lpIcon->lpBits).biWidth, + (*(LPBITMAPINFOHEADER) lpIcon->lpBits).biHeight/2, 0); } else { hIcon = NULL; } @@ -800,7 +797,7 @@ MakeIconOrCursorFromResource( * It failed, odds are good we're on NT so try the non-Ex way. */ - if (hIcon == NULL) { + if (hIcon == NULL) { /* * We would break on NT if we try with a 16bpp image. */ @@ -831,18 +828,19 @@ static int ReadICOHeader( Tcl_Channel channel) { - WORD Input; - DWORD dwBytesRead; + union { + WORD word; + char bytes[sizeof(WORD)]; + } input; /* * Read the 'reserved' WORD, which should be a zero word. */ - dwBytesRead = Tcl_Read(channel, (char*) &Input, sizeof(WORD)); - if (dwBytesRead != sizeof(WORD)) { + if (Tcl_Read(channel, input.bytes, sizeof(WORD)) != sizeof(WORD)) { return -1; } - if (Input != 0) { + if (input.word != 0) { return -1; } @@ -850,28 +848,21 @@ ReadICOHeader( * Read the type WORD, which should be of type 1. */ - dwBytesRead = Tcl_Read(channel, (char*)&Input, sizeof(WORD)); - if (dwBytesRead != sizeof(WORD)) { + if (Tcl_Read(channel, input.bytes, sizeof(WORD)) != sizeof(WORD)) { return -1; } - if (Input != 1) { + if (input.word != 1) { return -1; } /* - * Get the count of images + * Get and return the count of images. */ - dwBytesRead = Tcl_Read( channel, (char*)&Input, sizeof( WORD )); - if (dwBytesRead != sizeof(WORD)) { + if (Tcl_Read(channel, input.bytes, sizeof(WORD)) != sizeof(WORD)) { return -1; } - - /* - * Return the count - */ - - return (int)Input; + return (int) input.word; } /* @@ -894,23 +885,25 @@ static int InitWindowClass( WinIconPtr titlebaricon) { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - if (! tsdPtr->initialized) { + if (!tsdPtr->initialized) { tsdPtr->initialized = 1; tsdPtr->firstWindow = 1; tsdPtr->iconPtr = NULL; } - if (! initialized) { + if (!initialized) { Tcl_MutexLock(&winWmMutex); - if (! initialized) { + if (!initialized) { Tcl_DString classString; WNDCLASS class; + initialized = 1; if (shgetfileinfoProc == NULL) { HINSTANCE hInstance = LoadLibraryA("shell32"); + if (hInstance != NULL) { shgetfileinfoProc = (DWORD* (WINAPI *) (LPCTSTR pszPath, DWORD dwFileAttributes, SHFILEINFO* psfi, @@ -921,6 +914,7 @@ InitWindowClass( } if (setLayeredWindowAttributesProc == NULL) { HINSTANCE hInstance = LoadLibraryA("user32"); + if (hInstance != NULL) { setLayeredWindowAttributesProc = (BOOL (WINAPI*)(HWND hwnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags)) @@ -958,7 +952,7 @@ InitWindowClass( } class.hCursor = LoadCursor(NULL, IDC_ARROW); - if (!(*tkWinProcs->registerClass)(&class)) { + if (!tkWinProcs->registerClass(&class)) { Tcl_Panic("Unable to register TkTopLevel class"); } @@ -1045,7 +1039,7 @@ WinSetIcon( * We must get the window's wrapper, not the window itself. */ - wmPtr = ((TkWindow*)tkw)->wmInfoPtr; + wmPtr = ((TkWindow *) tkw)->wmInfoPtr; hwnd = wmPtr->wrapper; if (application) { @@ -1119,7 +1113,7 @@ WinSetIcon( */ UpdateWrapper(wmPtr->winPtr); - wmPtr = ((TkWindow*)tkw)->wmInfoPtr; + wmPtr = ((TkWindow *) tkw)->wmInfoPtr; hwnd = wmPtr->wrapper; if (hwnd == NULL) { Tcl_AppendResult(interp, @@ -1178,7 +1172,7 @@ TkWinGetIcon( { WmInfo *wmPtr; HICON icon; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (tsdPtr->iconPtr != NULL) { @@ -1186,7 +1180,7 @@ TkWinGetIcon( * return default toplevel icon */ - return GetIcon(tsdPtr->iconPtr, (int)iconsize); + return GetIcon(tsdPtr->iconPtr, (int) iconsize); } /* @@ -1210,7 +1204,7 @@ TkWinGetIcon( * return window toplevel icon */ - return GetIcon(wmPtr->iconPtr, (int)iconsize); + return GetIcon(wmPtr->iconPtr, (int) iconsize); } /* @@ -1272,11 +1266,13 @@ ReadIconFromFile( WinIconPtr titlebaricon = NULL; BlockOfIconImagesPtr lpIR; +#if 0 /* TODO: Dead code? */ if (0 /* If we already have an icon for this filename */) { titlebaricon = NULL; /* Get the real value from a lookup */ titlebaricon->refCount++; return titlebaricon; } +#endif /* * First check if it is a .ico file. @@ -1302,7 +1298,7 @@ ReadIconFromFile( } Tcl_UtfToExternalDString(NULL, file, -1, &ds2); Tcl_DStringFree(&ds); - res = (*shgetfileinfoProc)(Tcl_DStringValue(&ds2), 0, &sfiSM, + res = shgetfileinfoProc(Tcl_DStringValue(&ds2), 0, &sfiSM, sizeof(SHFILEINFO), SHGFI_SMALLICON|SHGFI_ICON); if (res != 0) { @@ -1310,7 +1306,7 @@ ReadIconFromFile( unsigned size; Tcl_ResetResult(interp); - res = (*shgetfileinfoProc)(Tcl_DStringValue(&ds2), 0, &sfi, + res = shgetfileinfoProc(Tcl_DStringValue(&ds2), 0, &sfi, sizeof(SHFILEINFO), SHGFI_ICON); /* @@ -1395,7 +1391,7 @@ GetIconFromPixmap( Pixmap pixmap) { WinIconPtr titlebaricon = NULL; - TkWinDrawable *twdPtr = (TkWinDrawable*) pixmap; + TkWinDrawable *twdPtr = (TkWinDrawable *) pixmap; BlockOfIconImagesPtr lpIR; ICONINFO icon; HICON hIcon; @@ -1405,11 +1401,13 @@ GetIconFromPixmap( return NULL; } +#if 0 /* TODO: Dead code?*/ if (0 /* If we already have an icon for this pixmap */) { titlebaricon = NULL; /* Get the real value from a lookup */ titlebaricon->refCount++; return titlebaricon; } +#endif Tk_SizeOfBitmap(dsPtr, pixmap, &width, &height); @@ -1481,7 +1479,7 @@ DecrIconRefCount( } titlebaricon->iconBlock = NULL; - ckfree((char*)titlebaricon); + ckfree((char *) titlebaricon); } } @@ -1512,15 +1510,15 @@ FreeIconBlock( * Free all the bits. */ - for (i=0; i< lpIR->nNumImages; i++) { + for (i=0 ; inNumImages ; i++) { if (lpIR->IconImages[i].lpBits != NULL) { - ckfree((char*)lpIR->IconImages[i].lpBits); + ckfree((char *) lpIR->IconImages[i].lpBits); } if (lpIR->IconImages[i].hIcon != NULL) { DestroyIcon(lpIR->IconImages[i].hIcon); } } - ckfree ((char*)lpIR); + ckfree((char *) lpIR); } /* @@ -1542,6 +1540,8 @@ GetIcon( int icon_size) { BlockOfIconImagesPtr lpIR; + unsigned int size = (icon_size == 0 ? 16 : 32); + int i; if (titlebaricon == NULL) { return NULL; @@ -1550,30 +1550,27 @@ GetIcon( lpIR = titlebaricon->iconBlock; if (lpIR == NULL) { return NULL; - } else { - unsigned int size = (icon_size == 0 ? 16 : 32); - int i; - - for (i = 0; i < lpIR->nNumImages; i++) { - /* - * Take the first or a 32x32 16 color icon - */ - - if ((lpIR->IconImages[i].Height == size) - && (lpIR->IconImages[i].Width == size) - && (lpIR->IconImages[i].Colors >= 4)) { - return lpIR->IconImages[i].hIcon; - } - } + } + for (i=0 ; inNumImages ; i++) { /* - * If we get here, then just return the first one, it will have to do! + * Take the first or a 32x32 16 color icon */ - if (lpIR->nNumImages >= 1) { - return lpIR->IconImages[0].hIcon; + if ((lpIR->IconImages[i].Height == size) + && (lpIR->IconImages[i].Width == size) + && (lpIR->IconImages[i].Colors >= 4)) { + return lpIR->IconImages[i].hIcon; } } + + /* + * If we get here, then just return the first one, it will have to do! + */ + + if (lpIR->nNumImages >= 1) { + return lpIR->IconImages[0].hIcon; + } return NULL; } @@ -1658,10 +1655,11 @@ ReadIconOrCursorFromFile( * Read in the header */ - if ((lpIR->nNumImages = ReadICOHeader(channel)) == -1) { + lpIR->nNumImages = ReadICOHeader(channel); + if (lpIR->nNumImages == -1) { Tcl_AppendResult(interp, "Invalid file header", NULL); Tcl_Close(NULL, channel); - ckfree((char*) lpIR); + ckfree((char *) lpIR); return NULL; } @@ -1669,9 +1667,9 @@ ReadIconOrCursorFromFile( * Adjust the size of the struct to account for the images. */ - lpIR = (BlockOfIconImagesPtr) ckrealloc((char*) lpIR, + lpIR = (BlockOfIconImagesPtr) ckrealloc((char *) lpIR, sizeof(BlockOfIconImages) - + ((lpIR->nNumImages - 1) * sizeof(ICONIMAGE))); + + (lpIR->nNumImages - 1) * sizeof(ICONIMAGE)); /* * Allocate enough memory for the icon directory entries. @@ -1683,8 +1681,8 @@ ReadIconOrCursorFromFile( * Read in the icon directory entries. */ - dwBytesRead = Tcl_Read(channel, (char*) lpIDE, - (int)(lpIR->nNumImages * sizeof(ICONDIRENTRY))); + dwBytesRead = Tcl_Read(channel, (char *) lpIDE, + (int) (lpIR->nNumImages * sizeof(ICONDIRENTRY))); if (dwBytesRead != lpIR->nNumImages * sizeof(ICONDIRENTRY)) { Tcl_AppendResult(interp, "Error reading file", NULL); Tcl_Close(NULL, channel); @@ -1791,7 +1789,7 @@ static TkWindow * GetTopLevel( HWND hwnd) { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* @@ -1933,8 +1931,7 @@ TkWinWmCleanup( } initialized = 0; - tsdPtr = (ThreadSpecificData *) - Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (!tsdPtr->initialized) { return; @@ -1965,9 +1962,7 @@ void TkWmNewWindow( TkWindow *winPtr) /* Newly-created top-level window. */ { - register WmInfo *wmPtr; - - wmPtr = (WmInfo *) ckalloc(sizeof(WmInfo)); + register WmInfo *wmPtr = (WmInfo *) ckalloc(sizeof(WmInfo)); /* * Initialize full structure, then set what isn't NULL @@ -2019,7 +2014,7 @@ TkWmNewWindow( */ Tk_CreateEventHandler((Tk_Window) winPtr, StructureNotifyMask, - TopLevelEventProc, (ClientData) winPtr); + TopLevelEventProc, winPtr); /* * Arrange for geometry requests to be reflected from the window to the @@ -2061,7 +2056,7 @@ UpdateWrapper( HICON hBigIcon = NULL; Tcl_DString titleString, classString; int *childStateInfo = NULL; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (winPtr->window == None) { @@ -2129,8 +2124,8 @@ UpdateWrapper( wmPtr->style = WM_TRANSIENT_STYLE; wmPtr->exStyle = EX_TRANSIENT_STYLE; parentHWND = Tk_GetHWND(Tk_WindowId(wmPtr->masterPtr)); - if (! ((wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) && - (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE))) { + if (! ((wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) + && (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE))) { wmPtr->style |= WS_THICKFRAME; } } else { @@ -2151,7 +2146,7 @@ UpdateWrapper( */ wmPtr->flags |= WM_CREATE_PENDING|WM_MOVE_PENDING; - UpdateGeometryInfo((ClientData)winPtr); + UpdateGeometryInfo(winPtr); wmPtr->flags &= ~(WM_CREATE_PENDING|WM_MOVE_PENDING); width = wmPtr->borderWidth + winPtr->changes.width; @@ -2189,7 +2184,7 @@ UpdateWrapper( Tcl_WinUtfToTChar(TK_WIN_TOPLEVEL_CLASS_NAME, -1, &classString); - wmPtr->wrapper = (*tkWinProcs->createWindowEx)(wmPtr->exStyle, + wmPtr->wrapper = tkWinProcs->createWindowEx(wmPtr->exStyle, (LPCTSTR) Tcl_DStringValue(&classString), (LPCTSTR) Tcl_DStringValue(&titleString), wmPtr->style, x, y, width, height, @@ -2296,11 +2291,11 @@ UpdateWrapper( } wmPtr->flags &= ~WM_NEVER_MAPPED; - if (winPtr->flags & TK_EMBEDDED - && SendMessage(wmPtr->wrapper, TK_ATTACHWINDOW, (WPARAM)child, 0)){ + if (winPtr->flags & TK_EMBEDDED && + SendMessage(wmPtr->wrapper, TK_ATTACHWINDOW, (WPARAM) child, 0)) { SendMessage(wmPtr->wrapper, TK_GEOMETRYREQ, - Tk_ReqWidth((Tk_Window)winPtr), - Tk_ReqHeight((Tk_Window)winPtr)); + Tk_ReqWidth((Tk_Window) winPtr), + Tk_ReqHeight((Tk_Window) winPtr)); SendMessage(wmPtr->wrapper, TK_SETMENU, (WPARAM) wmPtr->hMenu, (LPARAM) Tk_GetMenuHWND((Tk_Window) winPtr)); } @@ -2321,10 +2316,11 @@ UpdateWrapper( wmPtr->hints.initial_state = state; if (hSmallIcon != NULL) { - SendMessage(wmPtr->wrapper,WM_SETICON,ICON_SMALL,(LPARAM)hSmallIcon); + SendMessage(wmPtr->wrapper, WM_SETICON, ICON_SMALL, + (LPARAM) hSmallIcon); } if (hBigIcon != NULL) { - SendMessage(wmPtr->wrapper,WM_SETICON,ICON_BIG,(LPARAM)hBigIcon); + SendMessage(wmPtr->wrapper, WM_SETICON, ICON_BIG, (LPARAM) hBigIcon); } /* @@ -2420,7 +2416,7 @@ TkWmMapWindow( * mapped. */ { register WmInfo *wmPtr = winPtr->wmInfoPtr; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (!tsdPtr->initialized) { @@ -2432,8 +2428,7 @@ TkWmMapWindow( * Don't map a transient if the master is not mapped. */ - if (wmPtr->masterPtr != NULL && - !Tk_IsMapped(wmPtr->masterPtr)) { + if (wmPtr->masterPtr != NULL && !Tk_IsMapped(wmPtr->masterPtr)) { wmPtr->hints.initial_state = WithdrawnState; return; } @@ -2659,6 +2654,7 @@ TkWmDeadWindow( winPtr->dispPtr->firstWmPtr = wmPtr->nextPtr; } else { register WmInfo *prevPtr; + for (prevPtr = winPtr->dispPtr->firstWmPtr; ; prevPtr = prevPtr->nextPtr) { if (prevPtr == NULL) { @@ -2681,7 +2677,7 @@ TkWmDeadWindow( wmPtr->numTransients--; Tk_DeleteEventHandler((Tk_Window) wmPtr2->masterPtr, VisibilityChangeMask|StructureNotifyMask, - WmWaitVisibilityOrMapProc, (ClientData) wmPtr2->winPtr); + WmWaitVisibilityOrMapProc, wmPtr2->winPtr); wmPtr2->masterPtr = NULL; if ((wmPtr2->wrapper != None) && !(wmPtr2->flags & (WM_NEVER_MAPPED))) { @@ -2721,7 +2717,7 @@ TkWmDeadWindow( protPtr = wmPtr->protPtr; wmPtr->protPtr = protPtr->nextPtr; - Tcl_EventuallyFree((ClientData) protPtr, TCL_DYNAMIC); + Tcl_EventuallyFree(protPtr, TCL_DYNAMIC); } if (wmPtr->cmdArgv != NULL) { ckfree((char *) wmPtr->cmdArgv); @@ -2730,7 +2726,7 @@ TkWmDeadWindow( ckfree((char *) wmPtr->clientMachine); } if (wmPtr->flags & WM_UPDATE_PENDING) { - Tcl_CancelIdleCall(UpdateGeometryInfo, (ClientData) winPtr); + Tcl_CancelIdleCall(UpdateGeometryInfo, winPtr); } if (wmPtr->masterPtr != NULL) { wmPtr2 = wmPtr->masterPtr->wmInfoPtr; @@ -2744,7 +2740,7 @@ TkWmDeadWindow( } Tk_DeleteEventHandler((Tk_Window) wmPtr->masterPtr, VisibilityChangeMask|StructureNotifyMask, - WmWaitVisibilityOrMapProc, (ClientData) winPtr); + WmWaitVisibilityOrMapProc, winPtr); wmPtr->masterPtr = NULL; } if (wmPtr->crefObj != NULL) { @@ -2833,7 +2829,7 @@ Tk_WmObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - Tk_Window tkwin = (Tk_Window) clientData; + Tk_Window tkwin = clientData; static const char *optionStrings[] = { "aspect", "attributes", "client", "colormapwindows", "command", "deiconify", "focusmodel", "forget", "frame", @@ -2847,11 +2843,13 @@ Tk_WmObjCmd( }; enum options { WMOPT_ASPECT, WMOPT_ATTRIBUTES, WMOPT_CLIENT, WMOPT_COLORMAPWINDOWS, - WMOPT_COMMAND, WMOPT_DEICONIFY, WMOPT_FOCUSMODEL, WMOPT_FORGET, WMOPT_FRAME, + WMOPT_COMMAND, WMOPT_DEICONIFY, WMOPT_FOCUSMODEL, WMOPT_FORGET, + WMOPT_FRAME, WMOPT_GEOMETRY, WMOPT_GRID, WMOPT_GROUP, WMOPT_ICONBITMAP, WMOPT_ICONIFY, WMOPT_ICONMASK, WMOPT_ICONNAME, WMOPT_ICONPHOTO, WMOPT_ICONPOSITION, - WMOPT_ICONWINDOW, WMOPT_MANAGE, WMOPT_MAXSIZE, WMOPT_MINSIZE, WMOPT_OVERRIDEREDIRECT, + WMOPT_ICONWINDOW, WMOPT_MANAGE, WMOPT_MAXSIZE, WMOPT_MINSIZE, + WMOPT_OVERRIDEREDIRECT, WMOPT_POSITIONFROM, WMOPT_PROTOCOL, WMOPT_RESIZABLE, WMOPT_SIZEFROM, WMOPT_STACKORDER, WMOPT_STATE, WMOPT_TITLE, WMOPT_TRANSIENT, WMOPT_WITHDRAW @@ -2906,8 +2904,8 @@ Tk_WmObjCmd( != TCL_OK) { return TCL_ERROR; } - if (!Tk_IsTopLevel(winPtr) && - (index != WMOPT_MANAGE) && (index != WMOPT_FORGET)) { + if (!Tk_IsTopLevel(winPtr) && (index != WMOPT_MANAGE) + && (index != WMOPT_FORGET)) { Tcl_AppendResult(interp, "window \"", winPtr->pathName, "\" isn't a top-level window", NULL); return TCL_ERROR; @@ -3221,10 +3219,11 @@ WmAttributesCmd( /* * Only ever add the WS_EX_LAYERED bit, as it can cause - * flashing to change this window style. This allows things + * flashing to change this window style. This allows things * like fading tooltips to avoid flash ugliness without * forcing all window to be layered. */ + if ((wmPtr->alpha < 1.0) || (wmPtr->crefObj != NULL)) { *stylePtr |= styleBit; } @@ -3248,9 +3247,9 @@ WmAttributesCmd( } } } else { - if ((i < objc-1) && - (Tcl_GetBooleanFromObj(interp, objv[i+1], &boolean) - != TCL_OK)) { + if ((i < objc-1) + && Tcl_GetBooleanFromObj(interp, objv[i+1], &boolean) + != TCL_OK) { return TCL_ERROR; } if (config_fullscreen) { @@ -3276,6 +3275,7 @@ WmAttributesCmd( * Force the topmost position aspect to ensure that switching * between (no)topmost reflects properly when rewrapped. */ + SetWindowPos(wmPtr->wrapper, ((exStyle & WS_EX_TOPMOST) ? HWND_TOPMOST : HWND_NOTOPMOST), 0, 0, 0, 0, @@ -3384,7 +3384,7 @@ WmClientCmd( argv3 = Tcl_GetStringFromObj(objv[3], &length); if (argv3[0] == 0) { if (wmPtr->clientMachine != NULL) { - ckfree((char *) wmPtr->clientMachine); + ckfree(wmPtr->clientMachine); wmPtr->clientMachine = NULL; if (!(wmPtr->flags & WM_NEVER_MAPPED)) { XDeleteProperty(winPtr->display, winPtr->window, @@ -3394,11 +3394,10 @@ WmClientCmd( return TCL_OK; } if (wmPtr->clientMachine != NULL) { - ckfree((char *) wmPtr->clientMachine); + ckfree(wmPtr->clientMachine); } - wmPtr->clientMachine = (char *) - ckalloc((unsigned) (length + 1)); - strcpy(wmPtr->clientMachine, argv3); + wmPtr->clientMachine = ckalloc((unsigned) length + 1); + memcpy(wmPtr->clientMachine, argv3, (unsigned) length + 1); if (!(wmPtr->flags & WM_NEVER_MAPPED)) { XTextProperty textProp; @@ -3462,8 +3461,8 @@ WmColormapwindowsCmd( != TCL_OK) { return TCL_ERROR; } - cmapList = (TkWindow **) ckalloc((unsigned) - ((windowObjc+1)*sizeof(TkWindow*))); + cmapList = (TkWindow **) + ckalloc((unsigned) (windowObjc + 1) * sizeof(TkWindow*)); gotToplevel = 0; for (i = 0; i < windowObjc; i++) { if (TkGetWindowFromObj(interp, tkwin, windowObjv[i], @@ -3488,7 +3487,7 @@ WmColormapwindowsCmd( } wmPtr->flags |= WM_COLORMAPS_EXPLICIT; if (wmPtr->cmapList != NULL) { - ckfree((char *)wmPtr->cmapList); + ckfree((char *) wmPtr->cmapList); } wmPtr->cmapList = cmapList; wmPtr->cmapCount = windowObjc; @@ -3701,7 +3700,7 @@ WmForgetCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - register Tk_Window frameWin = (Tk_Window)winPtr; + register Tk_Window frameWin = (Tk_Window) winPtr; if (Tk_IsTopLevel(frameWin)) { Tk_UnmapWindow(frameWin); @@ -3977,8 +3976,8 @@ WmGroupCmd( } wmPtr->hints.window_group = Tk_WindowId(tkwin2); wmPtr->hints.flags |= WindowGroupHint; - wmPtr->leaderName = ckalloc((unsigned) (length + 1)); - strcpy(wmPtr->leaderName, argv3); + wmPtr->leaderName = ckalloc((unsigned) length + 1); + memcpy(wmPtr->leaderName, argv3, (unsigned) length + 1); } return TCL_OK; } @@ -4274,8 +4273,8 @@ WmIconnameCmd( ckfree((char *) wmPtr->iconName); } argv3 = Tcl_GetStringFromObj(objv[3], &length); - wmPtr->iconName = ckalloc((unsigned) (length + 1)); - strcpy(wmPtr->iconName, argv3); + wmPtr->iconName = ckalloc((unsigned) length + 1); + memcpy(wmPtr->iconName, argv3, (unsigned) length + 1); if (!(wmPtr->flags & WM_NEVER_MAPPED)) { XSetIconName(winPtr->display, winPtr->window, wmPtr->iconName); } @@ -4596,7 +4595,7 @@ WmManageCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - register Tk_Window frameWin = (Tk_Window)winPtr; + register Tk_Window frameWin = (Tk_Window) winPtr; register WmInfo *wmPtr = winPtr->wmInfoPtr; if (!Tk_IsTopLevel(frameWin)) { @@ -4781,7 +4780,7 @@ WmOverrideredirectCmd( Tk_ChangeWindowAttributes((Tk_Window) winPtr, CWOverrideRedirect, &atts); if (!(wmPtr->flags & (WM_NEVER_MAPPED)) - && !(winPtr->flags & TK_EMBEDDED)) { + && !(winPtr->flags & TK_EMBEDDED)) { UpdateWrapper(winPtr); } } @@ -4930,7 +4929,7 @@ WmProtocolCmd( } else { prevPtr->nextPtr = protPtr->nextPtr; } - Tcl_EventuallyFree((ClientData) protPtr, TCL_DYNAMIC); + Tcl_EventuallyFree(protPtr, TCL_DYNAMIC); break; } } @@ -5374,7 +5373,7 @@ WmTitleCmd( } if(winPtr->flags & TK_EMBEDDED) { - wrapper = (HWND)SendMessage(wmPtr->wrapper, TK_GETFRAMEWID, 0, 0); + wrapper = (HWND) SendMessage(wmPtr->wrapper, TK_GETFRAMEWID, 0, 0); } else { wrapper = wmPtr->wrapper; } @@ -5384,7 +5383,7 @@ WmTitleCmd( Tcl_DString titleString; int size = tkWinProcs->useWide ? 256 : 512; - (*tkWinProcs->getWindowText)(wrapper, (LPCTSTR)buf, size); + tkWinProcs->getWindowText(wrapper, (LPCTSTR) buf, size); Tcl_WinTCharToUtf(buf, -1, &titleString); Tcl_SetResult(interp, Tcl_DStringValue(&titleString),TCL_VOLATILE); Tcl_DStringFree(&titleString); @@ -5395,16 +5394,17 @@ WmTitleCmd( } } else { if (wmPtr->title != NULL) { - ckfree((char *) wmPtr->title); + ckfree(wmPtr->title); } argv3 = Tcl_GetStringFromObj(objv[3], &length); - wmPtr->title = ckalloc((unsigned) (length + 1)); - strcpy(wmPtr->title, argv3); + wmPtr->title = ckalloc((unsigned) length + 1); + memcpy(wmPtr->title, argv3, (unsigned) length + 1); if (!(wmPtr->flags & WM_NEVER_MAPPED) && wmPtr->wrapper != NULL) { Tcl_DString titleString; + Tcl_WinUtfToTChar(wmPtr->title, -1, &titleString); - (*tkWinProcs->setWindowText)(wrapper, + tkWinProcs->setWindowText(wrapper, (LPCTSTR) Tcl_DStringValue(&titleString)); Tcl_DStringFree(&titleString); } @@ -5461,7 +5461,7 @@ WmTransientCmd( masterPtr->wmInfoPtr->numTransients--; Tk_DeleteEventHandler((Tk_Window) masterPtr, VisibilityChangeMask|StructureNotifyMask, - WmWaitVisibilityOrMapProc, (ClientData) winPtr); + WmWaitVisibilityOrMapProc, winPtr); } wmPtr->masterPtr = NULL; @@ -5510,21 +5510,21 @@ WmTransientCmd( wmPtr->masterPtr->wmInfoPtr->numTransients--; Tk_DeleteEventHandler((Tk_Window) wmPtr->masterPtr, VisibilityChangeMask|StructureNotifyMask, - WmWaitVisibilityOrMapProc, (ClientData) winPtr); + WmWaitVisibilityOrMapProc, winPtr); } masterPtr->wmInfoPtr->numTransients++; Tk_CreateEventHandler((Tk_Window) masterPtr, VisibilityChangeMask|StructureNotifyMask, - WmWaitVisibilityOrMapProc, (ClientData) winPtr); + WmWaitVisibilityOrMapProc, winPtr); wmPtr->masterPtr = masterPtr; } } if (!((wmPtr->flags & WM_NEVER_MAPPED) && !(winPtr->flags & TK_EMBEDDED))) { - if (wmPtr->masterPtr != NULL && - !Tk_IsMapped(wmPtr->masterPtr)) { + if (wmPtr->masterPtr != NULL + && !Tk_IsMapped(wmPtr->masterPtr)) { TkpWmSetState(winPtr, WithdrawnState); } else { UpdateWrapper(winPtr); @@ -5594,7 +5594,7 @@ WmUpdateGeom( TkWindow *winPtr) { if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) { - Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr); + Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr); wmPtr->flags |= WM_UPDATE_PENDING; } } @@ -5605,7 +5605,7 @@ WmWaitVisibilityOrMapProc( ClientData clientData, /* Pointer to window. */ XEvent *eventPtr) /* Information about event. */ { - TkWindow *winPtr = (TkWindow *) clientData; + TkWindow *winPtr = clientData; TkWindow *masterPtr = winPtr->wmInfoPtr->masterPtr; if (masterPtr == NULL) @@ -5734,7 +5734,7 @@ Tk_SetGrid( wmPtr->heightInc = heightInc; wmPtr->sizeHintsFlags |= PBaseSize|PResizeInc; if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) { - Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr); + Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr); wmPtr->flags |= WM_UPDATE_PENDING; } } @@ -5794,7 +5794,7 @@ Tk_UnsetGrid( wmPtr->heightInc = 1; if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) { - Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr); + Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr); wmPtr->flags |= WM_UPDATE_PENDING; } } @@ -5822,7 +5822,7 @@ TopLevelEventProc( ClientData clientData, /* Window for which event occurred. */ XEvent *eventPtr) /* Event that just happened. */ { - register TkWindow *winPtr = (TkWindow *) clientData; + register TkWindow *winPtr = clientData; if (eventPtr->type == DestroyNotify) { Tk_ErrorHandler handler; @@ -5837,7 +5837,7 @@ TopLevelEventProc( */ handler = Tk_CreateErrorHandler(winPtr->display, -1, -1, -1, - (Tk_ErrorProc *) NULL, (ClientData) NULL); + NULL, NULL); Tk_DestroyWindow((Tk_Window) winPtr); Tk_DeleteErrorHandler(handler); } @@ -5877,7 +5877,7 @@ TopLevelReqProc( Tk_ReqHeight(tkwin)); } if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) { - Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr); + Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr); wmPtr->flags |= WM_UPDATE_PENDING; } } @@ -5911,7 +5911,7 @@ UpdateGeometryInfo( int width, height; /* Size of client area. */ int min, max; RECT rect; - register TkWindow *winPtr = (TkWindow *) clientData; + register TkWindow *winPtr = clientData; register WmInfo *wmPtr = winPtr->wmInfoPtr; wmPtr->flags &= ~WM_UPDATE_PENDING; @@ -6287,7 +6287,7 @@ ParseGeometry( wmPtr->flags = flags; if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) { - Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr); + Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr); wmPtr->flags |= WM_UPDATE_PENDING; } return TCL_OK; @@ -6482,9 +6482,9 @@ Tk_MoveToplevelWindow( if (!(wmPtr->flags & WM_NEVER_MAPPED)) { if (wmPtr->flags & WM_UPDATE_PENDING) { - Tcl_CancelIdleCall(UpdateGeometryInfo, (ClientData) winPtr); + Tcl_CancelIdleCall(UpdateGeometryInfo, winPtr); } - UpdateGeometryInfo((ClientData) winPtr); + UpdateGeometryInfo(winPtr); } } @@ -6532,9 +6532,9 @@ TkWmProtocolEventProc( const char *name = Tk_GetAtomName((Tk_Window) winPtr, protocol); - Tcl_Preserve((ClientData) protPtr); + Tcl_Preserve(protPtr); interp = protPtr->interp; - Tcl_Preserve((ClientData) interp); + Tcl_Preserve(interp); result = Tcl_GlobalEval(interp, protPtr->command); if (result != TCL_OK) { Tcl_AddErrorInfo(interp, "\n (command for \""); @@ -6542,8 +6542,8 @@ TkWmProtocolEventProc( Tcl_AddErrorInfo(interp, "\" window manager protocol)"); Tcl_BackgroundError(interp); } - Tcl_Release((ClientData) interp); - Tcl_Release((ClientData) protPtr); + Tcl_Release(interp); + Tcl_Release(protPtr); return; } } @@ -6590,7 +6590,7 @@ TkWmStackorderToplevelEnumProc( hPtr = Tcl_FindHashEntry(pair->table, (char *) hwnd); if (hPtr != NULL) { - childWinPtr = (TkWindow *) Tcl_GetHashValue(hPtr); + childWinPtr = Tcl_GetHashValue(hPtr); /* * Double check that same HWND does not get passed twice. @@ -6638,8 +6638,8 @@ TkWmStackorderToplevelWrapperMap( HWND wrapper; int newEntry; - if (Tk_IsMapped(winPtr) && Tk_IsTopLevel(winPtr) && - !Tk_IsEmbedded(winPtr) && (winPtr->display == display)) { + if (Tk_IsMapped(winPtr) && Tk_IsTopLevel(winPtr) + && !Tk_IsEmbedded(winPtr) && (winPtr->display == display)) { wrapper = TkWinGetWrapperWindow((Tk_Window) winPtr); /* @@ -6690,8 +6690,8 @@ TkWmStackorderToplevel( Tcl_InitHashTable(&table, TCL_ONE_WORD_KEYS); TkWmStackorderToplevelWrapperMap(parentPtr, parentPtr->display, &table); - windows = (TkWindow **) ckalloc((table.numEntries+1) - * sizeof(TkWindow *)); + windows = (TkWindow **) + ckalloc((table.numEntries+1) * sizeof(TkWindow *)); /* * Special cases: If zero or one toplevels were mapped there is no need to @@ -6704,7 +6704,7 @@ TkWmStackorderToplevel( goto done; case 1: hPtr = Tcl_FirstHashEntry(&table, &search); - windows[0] = (TkWindow *) Tcl_GetHashValue(hPtr); + windows[0] = Tcl_GetHashValue(hPtr); windows[1] = NULL; goto done; } @@ -6790,7 +6790,7 @@ TkWmRestackToplevel( if (winPtr->flags & TK_EMBEDDED) { SendMessage(winPtr->wmInfoPtr->wrapper, TK_RAISEWINDOW, - (WPARAM)insertAfter, aboveBelow); + (WPARAM) insertAfter, aboveBelow); } else { TkWinSetWindowPos(hwnd, insertAfter, aboveBelow); } @@ -6869,7 +6869,7 @@ TkWmAddToColormapWindows( * Automatically add the toplevel itself as the last element of the list. */ - newPtr = (TkWindow **) ckalloc((unsigned) ((count+2)*sizeof(TkWindow*))); + newPtr = (TkWindow **) ckalloc((unsigned) (count+2) * sizeof(TkWindow *)); if (count > 0) { memcpy(newPtr, oldPtr, count * sizeof(TkWindow*)); } @@ -7011,12 +7011,12 @@ TkWinSetMenu( } if (!(winPtr->flags & TK_EMBEDDED)) { if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) { - Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr); + Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr); wmPtr->flags |= WM_UPDATE_PENDING|WM_MOVE_PENDING; } } else { - SendMessage(wmPtr->wrapper, TK_SETMENU, - (WPARAM)hMenu, (LPARAM)Tk_GetMenuHWND(tkwin)); + SendMessage(wmPtr->wrapper, TK_SETMENU, (WPARAM) hMenu, + (LPARAM) Tk_GetMenuHWND(tkwin)); } } @@ -7096,7 +7096,7 @@ ConfigureTopLevel( */ if (!(wmPtr->flags & WM_UPDATE_PENDING)) { - Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr); + Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr); wmPtr->flags |= WM_UPDATE_PENDING; } /* fall through */ @@ -7329,11 +7329,9 @@ InstallColormaps( SelectPalette(dc, oldPalette, TRUE); RealizePalette(dc); ReleaseDC(hwnd, dc); - SendMessage(hwnd, WM_PALETTECHANGED, (WPARAM)hwnd, - (LPARAM)NULL); + SendMessage(hwnd, WM_PALETTECHANGED, (WPARAM) hwnd, (LPARAM) NULL); return TRUE; } - } else { /* * Window is being notified of a change in the system palette. If this @@ -7858,7 +7856,7 @@ WmProc( case WM_PALETTECHANGED: result = InstallColormaps(hwnd, WM_PALETTECHANGED, - hwnd == (HWND)wParam); + hwnd == (HWND) wParam); goto done; case WM_QUERYNEWPALETTE: @@ -7898,15 +7896,15 @@ WmProc( case WM_MOUSEACTIVATE: { ActivateEvent *eventPtr; - winPtr = GetTopLevel((HWND) wParam); + winPtr = GetTopLevel((HWND) wParam); if (winPtr && (TkGrabState(winPtr) != TK_GRAB_EXCLUDED)) { /* * This allows us to pass the message onto the native menus [Bug: * 2272] */ - result = (*tkWinProcs->defWindowProc)(hwnd, message, + result = tkWinProcs->defWindowProc(hwnd, message, wParam, lParam); goto done; } @@ -7918,10 +7916,10 @@ WmProc( */ if (winPtr) { - eventPtr = (ActivateEvent *)ckalloc(sizeof(ActivateEvent)); + eventPtr = (ActivateEvent *) ckalloc(sizeof(ActivateEvent)); eventPtr->ev.proc = ActivateWindow; eventPtr->winPtr = winPtr; - Tcl_QueueEvent((Tcl_Event*)eventPtr, TCL_QUEUE_TAIL); + Tcl_QueueEvent((Tcl_Event *) eventPtr, TCL_QUEUE_TAIL); } result = MA_NOACTIVATE; goto done; @@ -7958,7 +7956,7 @@ WmProc( case WM_MENUSELECT: case WM_ENTERIDLE: case WM_INITMENUPOPUP: { - HWND hMenuHWnd = Tk_GetEmbeddedMenuHWND((Tk_Window)winPtr); + HWND hMenuHWnd = Tk_GetEmbeddedMenuHWND((Tk_Window) winPtr); if (hMenuHWnd) { if (SendMessage(hMenuHWnd, message, wParam, lParam)) { @@ -7980,11 +7978,10 @@ WmProc( result = 0; } else if (!Tk_TranslateWinEvent(child, message, wParam, lParam, &result)) { - result = (*tkWinProcs->defWindowProc)(hwnd, message, - wParam, lParam); + result = tkWinProcs->defWindowProc(hwnd, message, wParam, lParam); } } else { - result = (*tkWinProcs->defWindowProc)(hwnd, message, wParam, lParam); + result = tkWinProcs->defWindowProc(hwnd, message, wParam, lParam); } done: @@ -8030,8 +8027,8 @@ TkpMakeMenuWindow( if ((atts.override_redirect != Tk_Attributes(tkwin)->override_redirect) || (atts.save_under != Tk_Attributes(tkwin)->save_under)) { - Tk_ChangeWindowAttributes(tkwin, - CWOverrideRedirect|CWSaveUnder, &atts); + Tk_ChangeWindowAttributes(tkwin, CWOverrideRedirect|CWSaveUnder, + &atts); } } @@ -8056,8 +8053,9 @@ HWND TkWinGetWrapperWindow( Tk_Window tkwin) /* The window we need the wrapper from */ { - TkWindow *winPtr = (TkWindow *)tkwin; - return (winPtr->wmInfoPtr->wrapper); + TkWindow *winPtr = (TkWindow *) tkwin; + + return winPtr->wmInfoPtr->wrapper; } /* @@ -8219,6 +8217,7 @@ TkpWinToplevelWithDraw( TkWindow *winPtr) { register WmInfo *wmPtr = winPtr->wmInfoPtr; + wmPtr->flags |= WM_WITHDRAWN; TkpWmSetState(winPtr, WithdrawnState); } @@ -8278,10 +8277,10 @@ TkpWinToplevelDeiconify( * deiconified by TkpWmSetState. Don't bother if we've never been mapped. */ - if ((wmPtr->flags & WM_UPDATE_PENDING) && - !(wmPtr->flags & WM_NEVER_MAPPED)) { - Tcl_CancelIdleCall(UpdateGeometryInfo, (ClientData) winPtr); - UpdateGeometryInfo((ClientData) winPtr); + if ((wmPtr->flags & WM_UPDATE_PENDING) + && !(wmPtr->flags & WM_NEVER_MAPPED)) { + Tcl_CancelIdleCall(UpdateGeometryInfo, winPtr); + UpdateGeometryInfo(winPtr); } /* @@ -8338,11 +8337,10 @@ TkpWinToplevelIsControlledByWm( { register WmInfo *wmPtr = winPtr->wmInfoPtr; - if (wmPtr) { - return ((wmPtr->width != -1) && (wmPtr->height != -1))? 1:0; - } else { + if (!wmPtr) { return 0; } + return ((wmPtr->width != -1) && (wmPtr->height != -1)) ? 1 : 0; } /* @@ -8370,7 +8368,7 @@ TkpWinToplevelMove( register WmInfo *wmPtr = winPtr->wmInfoPtr; if (wmPtr && x >= 0 && y >= 0 && !TkpWinToplevelIsControlledByWm(winPtr)) { - Tk_MoveToplevelWindow((Tk_Window)winPtr, x, y); + Tk_MoveToplevelWindow((Tk_Window) winPtr, x, y); } return ((winPtr->changes.x << 16) & 0xffff0000) | (winPtr->changes.y & 0xffff); @@ -8402,7 +8400,9 @@ TkpWinToplevelOverrideRedirect( register WmInfo *wmPtr = winPtr->wmInfoPtr; curValue = Tk_Attributes((Tk_Window) winPtr)->override_redirect; - if(reqValue < 0) return curValue; + if (reqValue < 0) { + return curValue; + } if (curValue != reqValue) { XSetWindowAttributes atts; @@ -8468,8 +8468,7 @@ TkpWinToplevelDetachWindow( * * RemapWindows * - * Adjust parent/child relation ships of - * the given window hierarchy. + * Adjust parent/child relation ships of the given window hierarchy. * * Results: * none @@ -8481,13 +8480,16 @@ TkpWinToplevelDetachWindow( */ static void -RemapWindows(winPtr, parentHWND) - TkWindow *winPtr; - HWND parentHWND; +RemapWindows( + TkWindow *winPtr, + HWND parentHWND) { TkWindow *childPtr; - /* Skip Menus as they are handled differently */ + /* + * Skip menus as they are handled differently. + */ + if (strcmp(Tk_Class(winPtr), "Menu") == 0) { return; } @@ -8495,9 +8497,12 @@ RemapWindows(winPtr, parentHWND) SetParent(Tk_GetHWND(winPtr->window), parentHWND); } - /* Repeat for all the children */ + /* + * Repeat for all the children. + */ + for (childPtr = winPtr->childList; childPtr != NULL; - childPtr = childPtr->nextPtr) { + childPtr = childPtr->nextPtr) { RemapWindows(childPtr, winPtr->window ? Tk_GetHWND(winPtr->window) : NULL); } -- cgit v0.12 From 9262175205c42058db89f5fd134678531c223f9b Mon Sep 17 00:00:00 2001 From: das Date: Sat, 3 May 2008 19:53:02 +0000 Subject: fix constness warnings --- generic/tkCanvas.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index 3d5240e..79c7345 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCanvas.c,v 1.48 2008/04/27 22:38:55 dkf Exp $ + * RCS: @(#) $Id: tkCanvas.c,v 1.49 2008/05/03 19:53:02 das Exp $ */ /* #define USE_OLD_TAG_SEARCH 1 */ @@ -4811,12 +4811,12 @@ CanvasDoEvent( (numObjects * sizeof(ClientData))); } #ifdef USE_OLD_TAG_SEARCH - objectPtr[0] = Tk_GetUid("all"); + objectPtr[0] = (ClientData) Tk_GetUid("all"); #else /* USE_OLD_TAG_SEARCH */ - objectPtr[0] = searchUids->allUid; + objectPtr[0] = (ClientData) searchUids->allUid; #endif /* USE_OLD_TAG_SEARCH */ for (i = itemPtr->numTags-1; i >= 0; i--) { - objectPtr[i+1] = itemPtr->tagPtr[i]; + objectPtr[i+1] = (ClientData) itemPtr->tagPtr[i]; } objectPtr[itemPtr->numTags+1] = itemPtr; -- cgit v0.12 From 928356b19cc8e6012f2b30356855895085b34439 Mon Sep 17 00:00:00 2001 From: das Date: Sat, 3 May 2008 21:12:55 +0000 Subject: fix typos, whitespace --- macosx/tkMacOSXWm.c | 6 +++--- macosx/tkMacOSXXStubs.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 688d8ed..d2c4a61 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXWm.c,v 1.64 2008/04/27 22:39:12 dkf Exp $ + * RCS: @(#) $Id: tkMacOSXWm.c,v 1.65 2008/05/03 21:12:55 das Exp $ */ #include "tkMacOSXPrivate.h" @@ -812,7 +812,7 @@ WmSetAttribute( err = ChkErr(FSPathMakeRef, (const unsigned char*)path, &ref, &d); if (err == noErr) { TK_IF_MAC_OS_X_API (4, HIWindowSetProxyFSRef, - err = ChkErr(HIWindowSetProxyFSRef, macWindow, &ref); + err = ChkErr(HIWindowSetProxyFSRef, macWindow, &ref); ) TK_ELSE_MAC_OS_X (4, AliasHandle alias; @@ -5945,7 +5945,7 @@ ApplyWindowClassAttributeChanges( if (wmPtr->macClass != oldClass) { TK_IF_MAC_OS_X_API (4, HIWindowChangeClass, ChkErr(HIWindowChangeClass, macWindow, wmPtr->macClass); - ) TK_ENDIF; + ) TK_ENDIF ChkErr(GetWindowClass, macWindow, &(wmPtr->macClass)); } if (newAttributes != oldAttributes) { diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c index d936d9c..3f9c038 100644 --- a/macosx/tkMacOSXXStubs.c +++ b/macosx/tkMacOSXXStubs.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXXStubs.c,v 1.26 2008/04/27 22:39:12 dkf Exp $ + * RCS: @(#) $Id: tkMacOSXXStubs.c,v 1.27 2008/05/03 21:12:55 das Exp $ */ #include "tkMacOSXPrivate.h" @@ -1090,7 +1090,7 @@ AddPixel( * XSetWindowBackgroundPixmap, XSetWindowBorder, XSetWindowBorderPixmap, * XSetWindowBorderWidth, XSetWindowColormap * - * These functions are all no-ops. They all have equivilent Tk calls that + * These functions are all no-ops. They all have equivalent Tk calls that * should always be used instead. * * Results: -- cgit v0.12 From 4ed1eb5d0267fed22ad66b46746e21adf8b6db53 Mon Sep 17 00:00:00 2001 From: jenglish Date: Sun, 4 May 2008 17:17:33 +0000 Subject: "default" and "focus" adornments should not be disjoint [Bug 1942785] --- ChangeLog | 5 +++++ macosx/ttkMacOSXTheme.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b954a8c..637c05d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-05-04 Joe English + + * macosx/ttkMacOSAquaTheme.c: "default" and "focus" adornments + should not be disjoint [Bug 1942785] + 2008-04-27 Donal K. Fellows * */*.c: A large tranche of getting rid of pre-C89-isms; if your diff --git a/macosx/ttkMacOSXTheme.c b/macosx/ttkMacOSXTheme.c index 585221c..61fb213 100644 --- a/macosx/ttkMacOSXTheme.c +++ b/macosx/ttkMacOSXTheme.c @@ -27,7 +27,7 @@ * top-level window, not to the Tk_Window. BoxToRect() * accounts for this. * - * RCS: @(#) $Id: ttkMacOSXTheme.c,v 1.21 2007/12/13 15:27:10 dgp Exp $ + * RCS: @(#) $Id: ttkMacOSXTheme.c,v 1.22 2008/05/04 17:17:33 jenglish Exp $ */ #include "tkMacOSXPrivate.h" @@ -160,6 +160,8 @@ static Ttk_StateTable ButtonValueTable[] = { }; static Ttk_StateTable ButtonAdornmentTable[] = { + { kThemeAdornmentDefault| kThemeAdornmentFocus, + TTK_STATE_ALTERNATE| TTK_STATE_FOCUS, 0 }, { kThemeAdornmentDefault, TTK_STATE_ALTERNATE, 0 }, { kThemeAdornmentFocus, TTK_STATE_FOCUS, 0 }, { kThemeAdornmentNone, 0, 0 } -- cgit v0.12 From 9b79751f35d7692313b363992525356da24a4201 Mon Sep 17 00:00:00 2001 From: das Date: Tue, 6 May 2008 16:33:20 +0000 Subject: fix Makefile dependency --- macosx/GNUmakefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/macosx/GNUmakefile b/macosx/GNUmakefile index 771ce4c..38a815d 100644 --- a/macosx/GNUmakefile +++ b/macosx/GNUmakefile @@ -9,7 +9,7 @@ # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: GNUmakefile,v 1.9 2008/03/11 22:33:22 das Exp $ +# RCS: @(#) $Id: GNUmakefile,v 1.10 2008/05/06 16:33:20 das Exp $ # ######################################################################################################## @@ -86,7 +86,7 @@ OBJ_DIR = ${OBJROOT}/${BUILD_STYLE} empty := space := ${empty} ${empty} -objdir := $(subst ${space},\ ,${OBJ_DIR}) +objdir = $(subst ${space},\ ,${OBJ_DIR}) develop_make_args := BUILD_STYLE=Development CONFIGURE_ARGS=--enable-symbols deploy_make_args := BUILD_STYLE=Deployment INSTALL_TARGET=install-strip -- cgit v0.12 From 38ef6a506f242815f3c11aaa905f65d68dd5793c Mon Sep 17 00:00:00 2001 From: patthoyts Date: Fri, 9 May 2008 18:34:59 +0000 Subject: Document the identify command as present on all ttk widgets --- ChangeLog | 4 ++++ doc/ttk_button.n | 15 +++++---------- doc/ttk_checkbutton.n | 4 ++-- doc/ttk_combobox.n | 6 +++--- doc/ttk_frame.n | 4 ++-- doc/ttk_label.n | 14 ++++---------- doc/ttk_labelframe.n | 4 ++-- doc/ttk_menubutton.n | 4 ++-- doc/ttk_notebook.n | 6 +++++- doc/ttk_panedwindow.n | 10 +++++----- doc/ttk_progressbar.n | 6 +++++- doc/ttk_radiobutton.n | 4 ++-- doc/ttk_scale.n | 12 +++++------- doc/ttk_scrollbar.n | 12 +++++------- doc/ttk_separator.n | 4 ++-- doc/ttk_sizegrip.n | 4 ++-- doc/ttk_widget.n | 8 +++++++- 17 files changed, 62 insertions(+), 59 deletions(-) diff --git a/ChangeLog b/ChangeLog index 637c05d..39c1746 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-05-09 Pat Thoyts + + * doc/ttk_*: 'identify' widget command is on all ttk widgets. + 2008-05-04 Joe English * macosx/ttkMacOSAquaTheme.c: "default" and "focus" adornments diff --git a/doc/ttk_button.n b/doc/ttk_button.n index 66acf14..fca276b 100644 --- a/doc/ttk_button.n +++ b/doc/ttk_button.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_button.n,v 1.11 2008/01/29 15:38:00 dkf Exp $ +'\" RCS: @(#) $Id: ttk_button.n,v 1.12 2008/05/09 18:35:00 patthoyts Exp $ '\" .so man.macros .TH ttk::button n 8.5 Tk "Tk Themed Widget" @@ -56,18 +56,13 @@ in the style. .\" .OP \-padding padding Padding .\" .OP \-relief relief Relief .SH "WIDGET COMMAND" +In addition to the standard +\fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR +commands, checkbuttons support the following additional +widget commands: .TP \fIpathName \fBinvoke\fR Invokes the command associated with the button. -.TP -\fIpathName \fBcget\fR \fIoption\fR -.TP -\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? -.TP -\fIpathName \fBinstate \fIstateSpec\fR ?\fIscript\fR? -.TP -\fIpathName \fBstate\fR ?\fIstateSpec\fR? -See \fIttk::widget(n)\fR .SH "COMPATIBILITY OPTIONS" .OP \-state state State May be set to \fBnormal\fR or \fBdisabled\fR to control the diff --git a/doc/ttk_checkbutton.n b/doc/ttk_checkbutton.n index 5d717e0..90d4368 100644 --- a/doc/ttk_checkbutton.n +++ b/doc/ttk_checkbutton.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_checkbutton.n,v 1.12 2008/01/29 15:38:00 dkf Exp $ +'\" RCS: @(#) $Id: ttk_checkbutton.n,v 1.13 2008/05/09 18:35:00 patthoyts Exp $ '\" .so man.macros .TH ttk::checkbutton n 8.5 Tk "Tk Themed Widget" @@ -38,7 +38,7 @@ The name of a global variable whose value is linked to the widget. Defaults to the widget pathname if not specified. .SH "WIDGET COMMAND" In addition to the standard -\fBcget\fR, \fBconfigure\fR, \fBinstate\fR, and \fBstate\fR +\fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR commands, checkbuttons support the following additional widget commands: .TP diff --git a/doc/ttk_combobox.n b/doc/ttk_combobox.n index 9f3b83a..1a313c3 100644 --- a/doc/ttk_combobox.n +++ b/doc/ttk_combobox.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_combobox.n,v 1.15 2008/02/23 18:41:06 jenglish Exp $ +'\" RCS: @(#) $Id: ttk_combobox.n,v 1.16 2008/05/09 18:35:00 patthoyts Exp $ '\" .so man.macros .TH ttk::combobox n 8.5 Tk "Tk Themed Widget" @@ -74,8 +74,8 @@ Otherwise, returns the index of the current value in the list of Returns the current value of the combobox. .TP \fIpathName \fBidentify \fIx y\fR -Returns the name of the element at position \fIx\fR, \fIy\fR, -or the empty string if the coordinates are outside the window. +Returns the name of the element at position \fIx\fR, \fIy\fR. +See \fIttk::widget(n)\fR. .TP \fIpathName \fBinstate \fIstateSpec\fR ?\fIscript\fR? Test the widget state. diff --git a/doc/ttk_frame.n b/doc/ttk_frame.n index d51e1c3..370ebff 100644 --- a/doc/ttk_frame.n +++ b/doc/ttk_frame.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_frame.n,v 1.9 2008/01/29 15:38:00 dkf Exp $ +'\" RCS: @(#) $Id: ttk_frame.n,v 1.10 2008/05/09 18:35:00 patthoyts Exp $ '\" .so man.macros .TH ttk::frame n 8.5 Tk "Tk Themed Widget" @@ -37,7 +37,7 @@ If specified, the widget's requested width in pixels. If specified, the widget's requested height in pixels. .SH "WIDGET COMMAND" Supports the standard widget commands -\fBconfigure\fR, \fBcget\fR, \fBinstate\fR, and \fBstate\fR; +\fBconfigure\fR, \fBcget\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR; see \fIttk::widget(n)\fR. .SH "NOTES" Note that if the \fBpack\fR, \fBgrid\fR, or other geometry managers diff --git a/doc/ttk_label.n b/doc/ttk_label.n index f9bf6c6..419d7e4 100644 --- a/doc/ttk_label.n +++ b/doc/ttk_label.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_label.n,v 1.9 2008/01/29 15:38:00 dkf Exp $ +'\" RCS: @(#) $Id: ttk_label.n,v 1.10 2008/05/09 18:35:00 patthoyts Exp $ '\" .so man.macros .TH ttk::label n 8.5 Tk "Tk Themed Widget" @@ -68,14 +68,8 @@ then automatic wrapping is not performed; otherwise the text is split into lines such that no line is longer than the specified value. .SH "WIDGET COMMAND" -.TP -\fIpathName \fBcget\fR \fIoption\fR -.TP -\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? -.TP -\fIpathName \fBinstate \fIstateSpec\fR ?\fIscript\fR? -.TP -\fIpathName \fBstate\fR ?\fIstateSpec\fR? -See \fIttk::widget(n)\fR +Supports the standard widget commands +\fBconfigure\fR, \fBcget\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR; +see \fIttk::widget(n)\fR. .SH "SEE ALSO" ttk::widget(n), label(n) diff --git a/doc/ttk_labelframe.n b/doc/ttk_labelframe.n index 5a302f9..243878d 100644 --- a/doc/ttk_labelframe.n +++ b/doc/ttk_labelframe.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_labelframe.n,v 1.9 2008/01/29 15:38:00 dkf Exp $ +'\" RCS: @(#) $Id: ttk_labelframe.n,v 1.10 2008/05/09 18:35:00 patthoyts Exp $ '\" .so man.macros .TH ttk::labelframe n 8.5 Tk "Tk Themed Widget" @@ -65,7 +65,7 @@ If specified, the widget's requested height in pixels. \fB\-height\fR). .SH "WIDGET COMMAND" Supports the standard widget commands -\fBconfigure\fR, \fBcget\fR, \fBinstate\fR, and \fBstate\fR; +\fBconfigure\fR, \fBcget\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR; see \fIttk::widget(n)\fR. .SH "SEE ALSO" ttk::widget(n), ttk::frame(n), labelframe(n) diff --git a/doc/ttk_menubutton.n b/doc/ttk_menubutton.n index 7999019..7a45da4 100644 --- a/doc/ttk_menubutton.n +++ b/doc/ttk_menubutton.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_menubutton.n,v 1.9 2008/01/29 15:38:00 dkf Exp $ +'\" RCS: @(#) $Id: ttk_menubutton.n,v 1.10 2008/05/09 18:35:00 patthoyts Exp $ '\" .so man.macros .TH ttk::menubutton n 8.5 Tk "Tk Themed Widget" @@ -39,7 +39,7 @@ menubutton. .\" .OP \-padding padding Pad .SH "WIDGET COMMAND" Menubutton widgets support the standard -\fBcget\fR, \fBconfigure\fR, \fBinstate\fR, and \fBstate\fR +\fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR methods. No other widget methods are used. .SH "SEE ALSO" ttk::widget(n), menu(n), menubutton(n) diff --git a/doc/ttk_notebook.n b/doc/ttk_notebook.n index 7d7e4d1..c407509 100644 --- a/doc/ttk_notebook.n +++ b/doc/ttk_notebook.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_notebook.n,v 1.12 2008/03/06 16:33:30 jenglish Exp $ +'\" RCS: @(#) $Id: ttk_notebook.n,v 1.13 2008/05/09 18:35:00 patthoyts Exp $ '\" .so man.macros .TH ttk::notebook n 8.5 Tk "Tk Themed Widget" @@ -124,6 +124,10 @@ The tab will not be displayed, but the associated window remains managed by the notebook and its configuration remembered. Hidden tabs may be restored with the \fBadd\fR command. .TP +\fIpathName \fBidentify\fR \fIx y\fR +Returns the name of the element at position \fIx\fR, \fIy\fR. +See \fIttk::widget(n)\fR. +.TP \fIpathname \fBindex\fR \fItabid\fR Returns the numeric index of the tab specified by \fItabid\fR, or the total number of tabs if \fItabid\fR is the string diff --git a/doc/ttk_panedwindow.n b/doc/ttk_panedwindow.n index a3cb277..18685cc 100644 --- a/doc/ttk_panedwindow.n +++ b/doc/ttk_panedwindow.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_panedwindow.n,v 1.15 2008/01/29 15:38:00 dkf Exp $ +'\" RCS: @(#) $Id: ttk_panedwindow.n,v 1.16 2008/05/09 18:35:00 patthoyts Exp $ '\" .so man.macros .TH ttk::panedwindow n 8.5 Tk "Tk Themed Widget" @@ -62,6 +62,10 @@ See \fBPANE OPTIONS\fR for the list of available options. Removes the specified subpane from the widget. \fIpane\fR is either an integer index or the name of a managed subwindow. .TP +\fIpathname\fR \fBidentify\fR \fIx y\fR +Returns the index of the sash at point \fIx,y\fR, +or the empty string if \fIx,y\fR is not over a sash. +.TP \fIpathname \fBinsert\fR \fIpos\fR \fIsubwindow\fR \fIoptions...\fR Inserts a pane at the specified position. \fIpos\fR is either the string \fBend\fR, an integer index, @@ -90,9 +94,5 @@ and the total size of the widget. .\" depending on which changed most recently. Returns the new position of sash number \fIindex\fR. .\" Full story: new position may be different than the requested position. -.TP -\fIpathname\fR \fBidentify\fR \fIx y\fR -Returns the index of the sash at point \fIx,y\fR, -or the empty string if \fIx,y\fR is not over a sash. .SH "SEE ALSO" ttk::widget(n), ttk::notebook(n), panedwindow(n) diff --git a/doc/ttk_progressbar.n b/doc/ttk_progressbar.n index 44be482..a91e098 100644 --- a/doc/ttk_progressbar.n +++ b/doc/ttk_progressbar.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_progressbar.n,v 1.10 2008/01/29 15:38:00 dkf Exp $ +'\" RCS: @(#) $Id: ttk_progressbar.n,v 1.11 2008/05/09 18:35:00 patthoyts Exp $ '\" .so man.macros .TH ttk::progressbar n 8.5 Tk "Tk Themed Widget" @@ -63,6 +63,10 @@ Returns the current value of the specified \fIoption\fR; see \fIttk::widget(n)\f \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? Modify or query widget options; see \fIttk::widget(n)\fR. .TP +\fIpathName \fBidentify\fR \fIx y\fR +Returns the name of the element at position \fIx\fR, \fIy\fR. +See \fIttk::widget(n)\fR. +.TP \fIpathName \fBinstate \fIstatespec\fR ?\fIscript\fR? Test the widget state; see \fIttk::widget(n)\fR. .TP diff --git a/doc/ttk_radiobutton.n b/doc/ttk_radiobutton.n index 251577b..fe93e76 100644 --- a/doc/ttk_radiobutton.n +++ b/doc/ttk_radiobutton.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_radiobutton.n,v 1.11 2008/01/29 15:38:00 dkf Exp $ +'\" RCS: @(#) $Id: ttk_radiobutton.n,v 1.12 2008/05/09 18:35:00 patthoyts Exp $ '\" .so man.macros .TH ttk::radiobutton n 8.5 Tk "Tk Themed Widget" @@ -37,7 +37,7 @@ The name of a global variable whose value is linked to the widget. Default value is \fB::selectedButton\fR. .SH "WIDGET COMMAND" In addition to the standard -\fBcget\fR, \fBconfigure\fR, \fBinstate\fR, and \fBstate\fR +\fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR commands, radiobuttons support the following additional widget commands: .TP diff --git a/doc/ttk_scale.n b/doc/ttk_scale.n index 0806c36..c1a2b43 100644 --- a/doc/ttk_scale.n +++ b/doc/ttk_scale.n @@ -4,7 +4,7 @@ .\" See the file "license.terms" for information on usage and redistribution .\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. .\" -.\" CVS: @(#) $Id: ttk_scale.n,v 1.1 2008/02/06 14:34:57 dkf Exp $ +.\" CVS: @(#) $Id: ttk_scale.n,v 1.2 2008/05/09 18:35:00 patthoyts Exp $ .\" .so man.macros .TH ttk::scale n 8.5 Tk "Tk Themed Widget" @@ -65,6 +65,10 @@ Get the current value of the \fB\-value\fR option, or the value corresponding to the coordinates \fIx,y\fR if they are specified. \fIX\fR and \fIy\fR are pixel coordinates relative to the scale widget origin. .TP +\fIpathName \fBidentify\fR \fIx y\fR +Returns the name of the element at position \fIx\fR, \fIy\fR. +See \fIttk::widget(n)\fR. +.TP \fIpathName \fBinstate \fIstatespec\fR ?\fIscript\fR? . Test the widget state; see \fIttk::widget(n)\fR. @@ -86,12 +90,6 @@ Modify or query the widget state; see \fIttk::widget(n)\fR. Get the coordinates corresponding to \fIvalue\fR, or the coordinates corresponding to the current value of the \fB\-value\fR option if \fIvalue\fR is omitted. -.TP -\fIpathName \fBidentify \fIx y\fR -. -Returns the name of the element under the point given by \fIx\fR and \fIy\fR, -or an empty string if the point does not lie in any element of the scale. -\fIX\fR and \fIy\fR are pixel coordinates relative to the scale widget origin. .SH "SEE ALSO" ttk::widget(n), scale(n) .SH KEYWORDS diff --git a/doc/ttk_scrollbar.n b/doc/ttk_scrollbar.n index d4128f8..5fa55f9 100644 --- a/doc/ttk_scrollbar.n +++ b/doc/ttk_scrollbar.n @@ -6,7 +6,7 @@ '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" '\" SOURCE: tk/doc/scrollbar.n, r1.4 -'\" RCS: @(#) $Id: ttk_scrollbar.n,v 1.12 2008/01/29 15:38:00 dkf Exp $ +'\" RCS: @(#) $Id: ttk_scrollbar.n,v 1.13 2008/05/09 18:35:00 patthoyts Exp $ '\" .so man.macros .TH ttk::scrollbar n 8.5 Tk "Tk Themed Widget" @@ -59,6 +59,10 @@ Modify or query widget options; see \fIttk::widget(n)\fR. Returns the scrollbar settings in the form of a list whose elements are the arguments to the most recent \fBset\fR widget command. .TP +\fIpathName \fBidentify\fR \fIx y\fR +Returns the name of the element at position \fIx\fR, \fIy\fR. +See \fIttk::widget(n)\fR. +.TP \fIpathName \fBinstate \fIstatespec\fR ?\fIscript\fR? Test the widget state; see \fIttk::widget(n)\fR. .TP @@ -94,12 +98,6 @@ and 1.0 corresponds to the bottom or right. widget. If \fIx\fR and \fIy\fR refer to a point outside the trough, the closest point in the trough is used. -.TP -\fIpathName \fBidentify\fR \fIx y\fR -Returns the name of the element under the point given -by \fIx\fR and \fIy\fR, or an empty string if the point does -not lie in any element of the scrollbar. -\fIX\fR and \fIy\fR are pixel coordinates relative to the scrollbar widget. .SH "SCROLLING COMMANDS" When the user interacts with the scrollbar, for example by dragging the thumb, the scrollbar notifies the associated widget that it diff --git a/doc/ttk_separator.n b/doc/ttk_separator.n index 87dfecb..ddfde59 100644 --- a/doc/ttk_separator.n +++ b/doc/ttk_separator.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_separator.n,v 1.8 2008/01/29 15:38:00 dkf Exp $ +'\" RCS: @(#) $Id: ttk_separator.n,v 1.9 2008/05/09 18:35:00 patthoyts Exp $ '\" .so man.macros .TH ttk::separator n 8.5 Tk "Tk Themed Widget" @@ -27,7 +27,7 @@ One of \fBhorizontal\fR or \fBvertical\fR. Specifies the orientation of the separator. .SH "WIDGET COMMAND" Separator widgets support the standard -\fBcget\fR, \fBconfigure\fR, \fBinstate\fR, and \fBstate\fR +\fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR methods. No other widget methods are used. .SH "SEE ALSO" ttk::widget(n) diff --git a/doc/ttk_sizegrip.n b/doc/ttk_sizegrip.n index d3ea7d9..308422a 100644 --- a/doc/ttk_sizegrip.n +++ b/doc/ttk_sizegrip.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_sizegrip.n,v 1.15 2008/01/29 15:38:00 dkf Exp $ +'\" RCS: @(#) $Id: ttk_sizegrip.n,v 1.16 2008/05/09 18:35:00 patthoyts Exp $ '\" .so man.macros .TH ttk::sizegrip n 8.5 Tk "Tk Themed Widget" @@ -24,7 +24,7 @@ by pressing and dragging the grip. .SE .SH "WIDGET COMMAND" Sizegrip widgets support the standard -\fBcget\fR, \fBconfigure\fR, \fBinstate\fR, and \fBstate\fR +\fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR methods. No other widget methods are used. .SH "PLATFORM-SPECIFIC NOTES" On Mac OSX, toplevel windows automatically include a built-in diff --git a/doc/ttk_widget.n b/doc/ttk_widget.n index 13af321..897cfbd 100644 --- a/doc/ttk_widget.n +++ b/doc/ttk_widget.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_widget.n,v 1.13 2007/12/13 15:23:44 dgp Exp $ +'\" RCS: @(#) $Id: ttk_widget.n,v 1.14 2008/05/09 18:35:00 patthoyts Exp $ '\" .so man.macros .TH ttk::widget n 8.5 Tk "Tk Themed Widget" @@ -144,6 +144,12 @@ and current value. .\" Note: Ttk widgets don't use TK_OPTION_SYNONYM. If no \fIoption\fR is specified, returns a list describing all of the available options for \fIpathName\fR. +.TP +\fIpathName \fBidentify\fR \fIx y\fR +Returns the name of the element under the point given +by \fIx\fR and \fIy\fR, or an empty string if the point does +not lie within any element. +\fIx\fR and \fIy\fR are pixel coordinates relative to the widget. .TP \fIpathName \fBinstate\fR \fIstatespec\fR ?\fIscript\fR? Test the widget's state. -- cgit v0.12 From 92a1564dea06b0ff57f2c4b6baa85de82e26ce54 Mon Sep 17 00:00:00 2001 From: patthoyts Date: Sun, 11 May 2008 00:12:01 +0000 Subject: Note negative widths for button --- ChangeLog | 4 ++++ doc/button.n | 8 +++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 39c1746..2854250 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-05-11 Pat Thoyts + + * doc/button.n: Note negative widths for button [Patch #1883418] + 2008-05-09 Pat Thoyts * doc/ttk_*: 'identify' widget command is on all ttk widgets. diff --git a/doc/button.n b/doc/button.n index 2935c48..1a7d2ec 100644 --- a/doc/button.n +++ b/doc/button.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: button.n,v 1.16 2008/04/20 19:19:23 patthoyts Exp $ +'\" RCS: @(#) $Id: button.n,v 1.17 2008/05/11 00:12:02 patthoyts Exp $ '\" .so man.macros .TH button n 4.4 Tk "Tk Built-In Commands" @@ -70,8 +70,10 @@ In this state the \fBdisabledForeground\fR and .OP \-width width Width Specifies a desired width for the button. If an image or bitmap is being displayed in the button then the value is in -screen units (i.e. any of the forms acceptable to \fBTk_GetPixels\fR); -for text it is in characters. +screen units (i.e. any of the forms acceptable to \fBTk_GetPixels\fR). +For a text button (no image or with \fB\-compound none\fR) then the width +specifies how much space in characters to allocate for the text label. +If the width is negative then this specifies a minimum width. If this option is not specified, the button's desired width is computed from the size of the image or bitmap or text being displayed in it. .BE -- cgit v0.12 From b992c9e7639b7803826833d1bcee122456714364 Mon Sep 17 00:00:00 2001 From: patthoyts Date: Sun, 11 May 2008 00:47:22 +0000 Subject: Support for ttk widgets in AmpWidget --- ChangeLog | 1 + library/tk.tcl | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2854250..84e4681 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 2008-05-11 Pat Thoyts + * library/tk.tcl: Support for ttk widgets in AmpWidget * doc/button.n: Note negative widths for button [Patch #1883418] 2008-05-09 Pat Thoyts diff --git a/library/tk.tcl b/library/tk.tcl index c0e0e25..69afb5c 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -3,7 +3,7 @@ # Initialization script normally executed in the interpreter for each # Tk-based application. Arranges class bindings for widgets. # -# RCS: @(#) $Id: tk.tcl,v 1.74 2008/04/01 16:30:54 dgp Exp $ +# RCS: @(#) $Id: tk.tcl,v 1.75 2008/05/11 00:47:22 patthoyts Exp $ # # Copyright (c) 1992-1994 The Regents of the University of California. # Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -355,7 +355,7 @@ if {![llength [info command tk_chooseDirectory]]} { # Define the set of common virtual events. #---------------------------------------------------------------------- -switch -- [tk windowingsystem] { +switch -exact -- [tk windowingsystem] { "x11" { event add <> event add <> @@ -510,7 +510,7 @@ proc ::tk::AmpWidget {class path args} { } } set result [$class $path {*}$options] - if {$class eq "button"} { + if {[string match "*button" $class]} { bind $path <> [list $path invoke] } return $result @@ -539,8 +539,8 @@ proc ::tk::AmpMenuArgs {widget add type args} { # proc ::tk::FindAltKeyTarget {path char} { switch -- [winfo class $path] { - Button - - Label { + Button - Label - + TButton - TLabel - TCheckbutton { if {[string equal -nocase $char \ [string index [$path cget -text] [$path cget -underline]]]} { return $path -- cgit v0.12 From 921798aef46a0298ce087f8dccf1f5b9f624512a Mon Sep 17 00:00:00 2001 From: patthoyts Date: Tue, 13 May 2008 12:39:27 +0000 Subject: Fixed a hangup in the tk_chooseColor tests by ensuring the temporary array is unset --- ChangeLog | 4 ++++ tests/winDialog.test | 31 +++++++++++++++++++------------ 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 84e4681..ea9571d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-05-13 Pat Thoyts + + * tests/winDialog.test: Fixed hanging tk_chooseColor tests. + 2008-05-11 Pat Thoyts * library/tk.tcl: Support for ttk widgets in AmpWidget diff --git a/tests/winDialog.test b/tests/winDialog.test index 2ba2873..219255b 100644 --- a/tests/winDialog.test +++ b/tests/winDialog.test @@ -1,3 +1,4 @@ +# -*- tcl -*- # This file is a Tcl script to test the Windows specific behavior of # the common dialog boxes. It is organized in the standard # fashion for Tcl tests. @@ -6,7 +7,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # Copyright (c) 1998-1999 ActiveState Corporation. # -# RCS: @(#) $Id: winDialog.test,v 1.16 2008/04/14 20:48:50 patthoyts Exp $ +# RCS: @(#) $Id: winDialog.test,v 1.17 2008/05/13 12:39:28 patthoyts Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -85,41 +86,47 @@ test winDialog-1.1.2 {Tk_ChooseColorObjCmd} -constraints { } -result [list 0 "#ff9933"] test winDialog-1.1.3 {Tk_ChooseColorObjCmd: -title} -constraints { testwinevent -} -body { +} -setup {unset a x} -body { set x {} start {set clr [tk_chooseColor -initialcolor "#ff9933" -title "Hello"]} then { - array set a [testgetwindowinfo $::tk_dialog] - if {[info exists a(text)]} {lappend x $a(text)} + if {[catch { + array set a [testgetwindowinfo $::tk_dialog] + if {[info exists a(text)]} {lappend x $a(text)} + } err]} { lappend x $err } lappend x [Click 1] } lappend x $clr } -result [list Hello 0 "#ff9933"] test winDialog-1.1.4 {Tk_ChooseColorObjCmd: -title} -constraints { testwinevent -} -body { +} -setup {unset a x} -body { set x {} start { set clr [tk_chooseColor -initialcolor "#ff9933" \ -title "\u041f\u0440\u0438\u0432\u0435\u0442"] } then { - array set a [testgetwindowinfo $::tk_dialog] - if {[info exists a(text)]} {lappend x $a(text)} + if {[catch { + array set a [testgetwindowinfo $::tk_dialog] + if {[info exists a(text)]} {lappend x $a(text)} + } err]} { lappend x $err } lappend x [Click 1] } lappend x $clr } -result [list "\u041f\u0440\u0438\u0432\u0435\u0442" 0 "#ff9933"] test winDialog-1.1.5 {Tk_ChooseColorObjCmd: -parent} -constraints { testwinevent -} -body { +} -setup {unset a x} -body { start {set clr [tk_chooseColor -initialcolor "#ff9933" -parent .]} set x {} then { - array set a [testgetwindowinfo $::tk_dialog] - if {[info exists a(parent)]} { - append x [expr {$a(parent) == [wm frame .]}] - } + if {[catch { + array set a [testgetwindowinfo $::tk_dialog] + if {[info exists a(parent)]} { + append x [expr {$a(parent) == [wm frame .]}] + } + } err]} {lappend x $err} Click 1 } list $x $clr -- cgit v0.12 From 5455d198e07230942a6c8a35927cbf2ac91afa0f Mon Sep 17 00:00:00 2001 From: patthoyts Date: Tue, 13 May 2008 13:17:25 +0000 Subject: -activestyle default is underline on windows --- ChangeLog | 1 + tests/listbox.test | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ea9571d..8846f59 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 2008-05-13 Pat Thoyts + * tests/listbox.test: -activestyle default is underline on windows. * tests/winDialog.test: Fixed hanging tk_chooseColor tests. 2008-05-11 Pat Thoyts diff --git a/tests/listbox.test b/tests/listbox.test index a123363..e291735 100644 --- a/tests/listbox.test +++ b/tests/listbox.test @@ -6,7 +6,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: listbox.test,v 1.28 2007/12/13 15:27:54 dgp Exp $ +# RCS: @(#) $Id: listbox.test,v 1.29 2008/05/13 13:17:26 patthoyts Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -2131,11 +2131,16 @@ test listbox-28.1 {listbox -activestyle} { listbox .l -activ non .l cget -activestyle } none -test listbox-28.2 {listbox -activestyle} { +test listbox-28.2 {listbox -activestyle} {!win} { destroy .l listbox .l .l cget -activestyle } dotbox +test listbox-28.2 {listbox -activestyle} {win} { + destroy .l + listbox .l + .l cget -activestyle +} underline test listbox-28.3 {listbox -activestyle} { destroy .l listbox .l -activestyle und -- cgit v0.12 From d853863c8bbda281a220cea42a6e295b76ebc8ea Mon Sep 17 00:00:00 2001 From: patthoyts Date: Tue, 13 May 2008 13:25:17 +0000 Subject: Support pixel sized font in the +/- keybindings --- ChangeLog | 1 + library/console.tcl | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8846f59..14541db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 2008-05-13 Pat Thoyts + * library/console.tcl: Support pixel sized font in +/- keybinding. * tests/listbox.test: -activestyle default is underline on windows. * tests/winDialog.test: Fixed hanging tk_chooseColor tests. diff --git a/library/console.tcl b/library/console.tcl index 6c176bc..cc38ca5 100644 --- a/library/console.tcl +++ b/library/console.tcl @@ -4,7 +4,7 @@ # can be used by non-unix systems that do not have built-in support # for shells. # -# RCS: @(#) $Id: console.tcl,v 1.37 2007/12/13 15:26:27 dgp Exp $ +# RCS: @(#) $Id: console.tcl,v 1.38 2008/05/13 13:25:18 patthoyts Exp $ # # Copyright (c) 1995-1997 Sun Microsystems, Inc. # Copyright (c) 1998-2000 Ajuba Solutions. @@ -554,11 +554,16 @@ proc ::tk::ConsoleBind {w} { } bind Console <> { set size [font configure TkConsoleFont -size] - font configure TkConsoleFont -size [incr size] + if {$size < 0} {set sign -1} else {set sign 1} + set size [expr {(abs($size) + 1) * $sign}] + font configure TkConsoleFont -size $size } bind Console <> { set size [font configure TkConsoleFont -size] - font configure TkConsoleFont -size [incr size -1] + if {abs($size) < 2} { return } + if {$size < 0} {set sign -1} else {set sign 1} + set size [expr {(abs($size) - 1) * $sign}] + font configure TkConsoleFont -size $size } ## -- cgit v0.12 From 55409abda8f00f6af3def7318ec66de03beded37 Mon Sep 17 00:00:00 2001 From: dkf Date: Wed, 14 May 2008 08:29:05 +0000 Subject: Apply fix for [Bug 1639824] --- ChangeLog | 6 ++++++ generic/tkPanedWindow.c | 17 +++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 14541db..0c27119 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-05-14 Donal K. Fellows + + * generic/tkPanedWindow.c (PanedWindowProxyCommand) + (DisplayPanedWindow): Ensure that a zero width never gets fed to the + underlying window system. [Bug 1639824] + 2008-05-13 Pat Thoyts * library/console.tcl: Support pixel sized font in +/- keybinding. diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index f80e257..cffac53 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkPanedWindow.c,v 1.31 2008/04/27 22:38:56 dkf Exp $ + * RCS: @(#) $Id: tkPanedWindow.c,v 1.32 2008/05/14 08:29:07 dkf Exp $ */ #include "default.h" @@ -1459,9 +1459,11 @@ DisplayPanedWindow( if (slavePtr->hide) { continue; } - Tk_Fill3DRectangle(tkwin, pixmap, pwPtr->background, - slavePtr->sashx, slavePtr->sashy, - sashWidth, sashHeight, 1, pwPtr->sashRelief); + if (sashWidth > 0 && sashHeight > 0) { + Tk_Fill3DRectangle(tkwin, pixmap, pwPtr->background, + slavePtr->sashx, slavePtr->sashy, sashWidth, sashHeight, + 1, pwPtr->sashRelief); + } if (pwPtr->showHandle) { Tk_Fill3DRectangle(tkwin, pixmap, pwPtr->background, slavePtr->handlex, slavePtr->handley, @@ -2831,6 +2833,13 @@ PanedWindowProxyCommand( (2 * Tk_InternalBorderWidth(pwPtr->tkwin)); } + if (sashWidth < 1) { + sashWidth = 1; + } + if (sashHeight < 1) { + sashHeight = 1; + } + /* * Stash the proxy coordinates for future "proxy coord" calls. */ -- cgit v0.12 From a4067b2f9b9e15de47baf424516fdc4bedd120e1 Mon Sep 17 00:00:00 2001 From: patthoyts Date: Thu, 15 May 2008 00:06:18 +0000 Subject: We should use the thread allocator for threaded builds. Added 'tclalloc' option to disable. --- ChangeLog | 5 +++++ win/makefile.vc | 9 ++++++--- win/rules.vc | 7 +++++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0c27119..1495f58 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-05-15 Pat Thoyts + + * win/makefile.vc: We should use the thread allocator for threaded + * win/rules.vc: builds. Added 'tclalloc' option to disable. + 2008-05-14 Donal K. Fellows * generic/tkPanedWindow.c (PanedWindowProxyCommand) diff --git a/win/makefile.vc b/win/makefile.vc index a945084..b8a790e 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -1,4 +1,4 @@ -#------------------------------------------------------------------------------ +#------------------------------------------------------------- -*- makefile -*- # makefile.vc -- # # Microsoft Visual C++ makefile for use with nmake.exe v1.62+ (VC++ 5.0+) @@ -10,9 +10,10 @@ # Copyright (c) 1998-2000 Ajuba Solutions. # Copyright (c) 2001-2005 ActiveState Corporation. # Copyright (c) 2001-2004 David Gravereaux. +# Copyright (c) 2003-2008 Pat Thoyts. # #------------------------------------------------------------------------------ -# RCS: @(#) $Id: makefile.vc,v 1.121 2008/04/20 19:57:03 patthoyts Exp $ +# RCS: @(#) $Id: makefile.vc,v 1.122 2008/05/15 00:06:19 patthoyts Exp $ #------------------------------------------------------------------------------ # Check to see we are configured to build with MSVC (MSDEVDIR or MSVCDIR) @@ -88,7 +89,9 @@ the build instructions. # staticpkg= Affects the static option only to switch wishXX.exe # to have the dde and reg extension linked inside it. # threads = Turns on full multithreading support. -# thrdalloc= Use the thread allocator (shared global free pool). +# thrdalloc = Use the thread allocator (shared global free pool) +# This is the default on threaded builds. +# tclalloc = Use the old non-thread allocator # symbols = Adds symbols for step debugging. # profile = Adds profiling hooks. Map file is assumed. # loimpact = Adds a flag for how NT treats the heap to keep diff --git a/win/rules.vc b/win/rules.vc index 0084520..73215e8 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -11,7 +11,7 @@ # Copyright (c) 2003-2007 Patrick Thoyts # #------------------------------------------------------------------------------ -# RCS: @(#) $Id: rules.vc,v 1.21 2007/12/13 15:28:52 dgp Exp $ +# RCS: @(#) $Id: rules.vc,v 1.22 2008/05/15 00:06:19 patthoyts Exp $ #------------------------------------------------------------------------------ !ifndef _RULES_VC @@ -242,6 +242,7 @@ TCL_USE_STATIC_PACKAGES = 0 !if [nmakehlp -f $(OPTS) "threads"] !message *** Doing threads TCL_THREADS = 1 +USE_THREAD_ALLOC= 1 !else TCL_THREADS = 0 !endif @@ -266,7 +267,9 @@ LOIMPACT = 0 !if [nmakehlp -f $(OPTS) "thrdalloc"] !message *** Doing thrdalloc USE_THREAD_ALLOC = 1 -!else +!endif +!if [nmakehlp -f $(OPTS) "tclalloc"] +!message *** Doing thrdalloc USE_THREAD_ALLOC = 0 !endif !if [nmakehlp -f $(OPTS) "unchecked"] -- cgit v0.12 From 2cef89254b6055b551abf622fe895276984a59ec Mon Sep 17 00:00:00 2001 From: patthoyts Date: Thu, 15 May 2008 23:41:08 +0000 Subject: Add correct border to combobox on Vista --- ChangeLog | 4 ++++ library/ttk/xpTheme.tcl | 25 ++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1495f58..f7cd6a5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-05-16 Pat Thoyts + + * library/ttk/xpTheme.tcl: Add correct border to combobox on Vista + 2008-05-15 Pat Thoyts * win/makefile.vc: We should use the thread allocator for threaded diff --git a/library/ttk/xpTheme.tcl b/library/ttk/xpTheme.tcl index a82315b..d85d415 100644 --- a/library/ttk/xpTheme.tcl +++ b/library/ttk/xpTheme.tcl @@ -1,5 +1,5 @@ # -# $Id: xpTheme.tcl,v 1.7 2008/04/03 11:52:42 patthoyts Exp $ +# $Id: xpTheme.tcl,v 1.8 2008/05/15 23:41:08 patthoyts Exp $ # # Settings for 'xpnative' theme # @@ -60,5 +60,28 @@ namespace eval ttk::theme::xpnative { ; ttk::style configure Toolbutton -padding {4 4} + + # Vista requires some style modifications. There are some + # additional or different elements in use. + if {[tk windowingsystem] eq "win32" + && [info exists tcl_platform(osVersion)] + && $tcl_platform(osVersion) >= 6.0} { + + ttk::style element create Combobox.field vsapi \ + COMBOBOX 2 {{} 1} + ttk::style element create Combobox.border vsapi \ + COMBOBOX 4 {disabled 4 focus 3 active 2 {} 1} + ttk::style layout TCombobox { + Combobox.border -sticky nswe -border 0 -children { + Combobox.downarrow -side right -sticky ns + Combobox.padding -expand 1 -sticky nswe -children { + Combobox.focus -expand 1 -sticky nswe -children { + Combobox.textarea -sticky nswe + } + } + } + } + + } } } -- cgit v0.12 From 2652f3815730b047a1d7a1b8be97accec9da4d85 Mon Sep 17 00:00:00 2001 From: jenglish Date: Fri, 23 May 2008 17:58:32 +0000 Subject: Avoid passing width or height <= 0 to Tk_RedrawImage, as this leads to a panic on Windows [Bug 1967576] --- ChangeLog | 6 ++++++ generic/ttk/ttkLabel.c | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f7cd6a5..1468ecc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-05-23 Joe English + + * generic/ttk/ttkLabel.c: Avoid passing width or height <= 0 to + Tk_RedrawImage, as this leads to a panic on Windows [Bug 1967576] + 2008-05-16 Pat Thoyts * library/ttk/xpTheme.tcl: Add correct border to combobox on Vista @@ -28,6 +33,7 @@ * doc/ttk_*: 'identify' widget command is on all ttk widgets. +>>>>>>> 1.1929 2008-05-04 Joe English * macosx/ttkMacOSAquaTheme.c: "default" and "focus" adornments diff --git a/generic/ttk/ttkLabel.c b/generic/ttk/ttkLabel.c index a95e305..3c7902e 100644 --- a/generic/ttk/ttkLabel.c +++ b/generic/ttk/ttkLabel.c @@ -1,4 +1,4 @@ -/* $Id: ttkLabel.c,v 1.11 2007/12/13 15:26:26 dgp Exp $ +/* $Id: ttkLabel.c,v 1.12 2008/05/23 17:58:33 jenglish Exp $ * * text, image, and label elements. * @@ -314,6 +314,12 @@ static void ImageDraw( height = Tk_Height(tkwin) - b.y; } + if (height <= 0 || width <= 0) { + /* Completely clipped - bail out. + */ + return; + } + Tk_RedrawImage(image->tkimg, 0,0, width, height, d, b.x, b.y); /* If we're disabled there's no state-specific 'disabled' image, -- cgit v0.12 From c2ee900569916fac1b939549e153c9344dca8c0a Mon Sep 17 00:00:00 2001 From: jenglish Date: Fri, 23 May 2008 18:00:38 +0000 Subject: (remove conflict marker -- oops) --- ChangeLog | 1 - 1 file changed, 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1468ecc..513d8a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -33,7 +33,6 @@ * doc/ttk_*: 'identify' widget command is on all ttk widgets. ->>>>>>> 1.1929 2008-05-04 Joe English * macosx/ttkMacOSAquaTheme.c: "default" and "focus" adornments -- cgit v0.12 From ee1814c0cdbcfe9807b18e2b2732c299789897a3 Mon Sep 17 00:00:00 2001 From: jenglish Date: Fri, 23 May 2008 20:20:05 +0000 Subject: Batch of ttk::treeview enhancements: + Added [$tv identify region], [$tv identify element], and [$tv identify item] subcommands. + Simplified bindings. + Added [$tv tag has] subcommand. + Tag-related display improvements: setting a tag -background or -foreground no longer overrides selection feedback. + Don't need separate 'Item', 'Cell', and 'Row' style settings anymore, only the base "Treeview" style is used. --- ChangeLog | 23 ++ doc/ttk_treeview.n | 44 +++- generic/ttk/ttkLayout.c | 23 +- generic/ttk/ttkTagSet.c | 191 ++++++++++---- generic/ttk/ttkTheme.c | 53 ++-- generic/ttk/ttkTheme.h | 7 +- generic/ttk/ttkThemeInt.h | 3 +- generic/ttk/ttkTreeview.c | 591 ++++++++++++++++++++++++++----------------- generic/ttk/ttkWidget.h | 33 ++- library/ttk/altTheme.tcl | 13 +- library/ttk/aquaTheme.tcl | 10 +- library/ttk/clamTheme.tcl | 13 +- library/ttk/classicTheme.tcl | 10 +- library/ttk/defaults.tcl | 19 +- library/ttk/treeview.tcl | 53 ++-- library/ttk/winTheme.tcl | 13 +- library/ttk/xpTheme.tcl | 13 +- tests/ttk/treeview.test | 116 ++++++++- 18 files changed, 782 insertions(+), 446 deletions(-) diff --git a/ChangeLog b/ChangeLog index 513d8a0..d8aefff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,28 @@ 2008-05-23 Joe English + * doc/ttk_treeview.n, generic/ttk/ttkTreeview.c, + generic/ttk/ttkTagSet.c, generic/ttk/ttkLayout.c, + generic/ttk/ttkTheme.c, generic/ttk/ttkTheme.h, + generic/ttk/ttkThemeInt.h, generic/ttk/ttkWidget.h: + + Added [$tv identify region], [$tv identify element], + and [$tv identify item] subcommands. Simplified + bindings. Added [$tv tag has] subcommand. Tag-related + display improvements; setting a tag -background or -foreground + no longer overrides selection feedback. + + + * library/ttk/altTheme.tcl, library/ttk/aquaTheme.tcl, + library/ttk/clamTheme.tcl, library/ttk/classicTheme.tcl, + library/ttk/defaults.tcl, library/ttk/treeview.tcl, + library/ttk/winTheme.tcl, library/ttk/xpTheme.tcl: + + Don't need separate 'Item', 'Cell', and 'Row' style + settings anymore, only the base "Treeview" style is used. + + +2008-05-23 Joe English + * generic/ttk/ttkLabel.c: Avoid passing width or height <= 0 to Tk_RedrawImage, as this leads to a panic on Windows [Bug 1967576] diff --git a/doc/ttk_treeview.n b/doc/ttk_treeview.n index fbe84b1..e2ecc4c 100644 --- a/doc/ttk_treeview.n +++ b/doc/ttk_treeview.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_treeview.n,v 1.17 2008/01/29 15:38:00 dkf Exp $ +'\" RCS: @(#) $Id: ttk_treeview.n,v 1.18 2008/05/23 20:20:05 jenglish Exp $ '\" .so man.macros .TH ttk::treeview n 8.5 Tk "Tk Themed Widget" @@ -58,11 +58,8 @@ A list of column identifiers specifying which data columns are displayed and the order in which they appear, or the string \fB#all\fP. -.RS -.PP -If set to \fB#all\fP (the default), all columns are shown in the order -given. -.RE +If set to \fB#all\fP (the default), +all columns are shown in the order given. .OP \-height height Height Specifies the number of rows which should be visible. Note: @@ -104,7 +101,7 @@ Returns the bounding box (relative to the treeview widget's window) of the specified \fIitem\fR in the form \fIx y width height\fR. If \fIcolumn\fR is specified, returns the bounding box of that cell. -If the \fIitem\fR is not visible +If the \fIitem\fR is not visible (i.e., if it is a descendant of a closed item or is scrolled offscreen), returns the empty list. .TP @@ -215,12 +212,35 @@ or the empty string if no such \fIcomponent\fR is present at that position. The following subcommands are supported: .RS .TP -\fIpathname \fBidentify row\fR \fIx y\fR +\fIpathname \fBidentify region\fR \fI x y\fR +.RS +Returns one of: +.IP heading +Tree heading area; +use [\fBpathname identify column \fIx y\fR] +to determine the heading number. +.IP separator +Space between two column headings; +[\fBpathname identify column \fIx y\fR] +will return the display column identifier +of the heading to left of the separator. +.IP tree +The tree area. +.IP cell +A data cell. +.RE +\fIpathname \fBidentify item\fR \fIx y\fR Returns the item ID of the item at position \fIy\fR. .TP \fIpathname \fBidentify column\fR \fIx y\fR Returns the data column identifier of the cell at position \fIx\fR. The tree column has ID \fB#0\fR. +.TP +\fIpathname \fBidentify element\fR \fIx y\fR +The element at position \fIx,y\fR. +.TP +\fIpathname \fBidentify row\fR \fIx y\fR +Obsolescent synonym for \fIpathname \fBidentify item\fR. .PP See \fBCOLUMN IDENTIFIERS\fR for a discussion of display columns and data columns. @@ -310,7 +330,7 @@ Toggle the selection state of each item in \fIitemList\fR. .TP \fIpathname \fBset\fR \fIitem\fR ?\fIcolumn\fR? ?\fIvalue\fR? With one argument, returns a dictionary of column/value pairs -for the specified \fIitem\fR. +for the specified \fIitem\fR. With two arguments, returns the current value of the specified \fIcolumn\fR. With three arguments, sets the value of column \fIcolumn\fR in item \fIitem\fR to the specified \fIvalue\fR. @@ -349,6 +369,12 @@ returns the value of that option With no additional arguments, returns a dictionary of the option settings for \fItagName\fR. See \fBTAG OPTIONS\fR for the list of available options. +.TP +\fIpathName \fBtag has\fR \fItagName\fR ?\fIitem\fR? +If \fIitem\fR is specified, returns 1 or 0 +depending on whether the specified item has the named tag. +Otherwise, returns a list of all items which have +the specified tag. .RE .TP \fIpathName \fBxview \fIargs\fR diff --git a/generic/ttk/ttkLayout.c b/generic/ttk/ttkLayout.c index bfa10c4..c1e239a 100644 --- a/generic/ttk/ttkLayout.c +++ b/generic/ttk/ttkLayout.c @@ -5,7 +5,7 @@ * * Copyright (c) 2003 Joe English. Freely redistributable. * - * $Id: ttkLayout.c,v 1.11 2007/12/13 15:26:26 dgp Exp $ + * $Id: ttkLayout.c,v 1.12 2008/05/23 20:20:05 jenglish Exp $ */ #include @@ -47,8 +47,6 @@ Ttk_NewBoxObj(Ttk_Box box) return Tcl_NewListObj(4, result); } - - /* * packTop, packBottom, packLeft, packRight -- * Carve out a parcel of the specified height (resp width) @@ -768,7 +766,7 @@ void Ttk_RegisterLayouts(Ttk_Theme theme, Ttk_LayoutSpec spec) } } -Tcl_Obj *Ttk_UnparseLayoutTemplate(Ttk_TemplateNode *node) +Tcl_Obj *Ttk_UnparseLayoutTemplate(Ttk_TemplateNode *node) { Tcl_Obj *result = Tcl_NewListObj(0,0); @@ -785,14 +783,14 @@ Tcl_Obj *Ttk_UnparseLayoutTemplate(Ttk_TemplateNode *node) */ if (flags & TTK_EXPAND) { APPENDSTR("-expand"); - APPENDSTR("1"); + APPENDSTR("1"); } else { if (flags & _TTK_MASK_PACK) { int side = 0; unsigned sideFlags = flags & _TTK_MASK_PACK; while ((sideFlags & TTK_PACK_LEFT) == 0) { - ++side; + ++side; sideFlags >>= 1; } APPENDSTR("-side"); @@ -891,7 +889,7 @@ Ttk_Layout Ttk_CreateLayout( * Creates a new sublayout. * * Sublayouts are used to draw subparts of a compound widget. - * They use the same Tk_Window, but a different option table + * They use the same Tk_Window, but a different option table * and data record. */ Ttk_Layout @@ -924,7 +922,7 @@ Ttk_CreateSublayout( Tcl_DStringFree(&buf); return TTKNewLayout( - style, 0, optionTable, parentLayout->tkwin, + style, 0, optionTable, parentLayout->tkwin, Ttk_InstantiateLayout(themePtr, layoutTemplate)); } @@ -947,6 +945,15 @@ Tcl_Obj *Ttk_QueryOption( layout->style,layout->recordPtr,layout->optionTable,optionName,state); } +/* + * Ttk_LayoutStyle -- + * Extract Ttk_Style from Ttk_Layout. + */ +Ttk_Style Ttk_LayoutStyle(Ttk_Layout layout) +{ + return layout->style; +} + /*------------------------------------------------------------------------ * +++ Size computation. */ diff --git a/generic/ttk/ttkTagSet.c b/generic/ttk/ttkTagSet.c index 85624a2..d925a78 100644 --- a/generic/ttk/ttkTagSet.c +++ b/generic/ttk/ttkTagSet.c @@ -1,6 +1,6 @@ -/* $Id: ttkTagSet.c,v 1.3 2007/01/11 19:59:26 jenglish Exp $ +/* $Id: ttkTagSet.c,v 1.4 2008/05/23 20:20:05 jenglish Exp $ * - * Ttk widget set: tag tables. Half-baked, work in progress. + * Tag tables. 3/4-baked, work in progress. * * Copyright (C) 2005, Joe English. Freely redistributable. */ @@ -16,12 +16,16 @@ * +++ Internal data structures. */ struct TtkTag { - Tcl_Obj **tagRecord; /* ... hrmph. */ + int priority; /* 1=>highest */ + void *tagRecord; }; struct TtkTagTable { - Tk_OptionTable tagOptionTable; /* ... */ - int tagRecordSize; /* size of tag record */ + Tk_Window tkwin; /* owner window */ + Tk_OptionSpec *optionSpecs; /* ... */ + Tk_OptionTable optionTable; /* ... */ + int recordSize; /* size of tag record */ + int nTags; /* #tags defined so far */ Tcl_HashTable tags; /* defined tags */ }; @@ -31,38 +35,34 @@ struct TtkTagTable { static Ttk_Tag NewTag(Ttk_TagTable tagTable) { Ttk_Tag tag = (Ttk_Tag)ckalloc(sizeof(*tag)); - tag->tagRecord = (Tcl_Obj **)ckalloc(tagTable->tagRecordSize); - memset(tag->tagRecord, 0, tagTable->tagRecordSize); + tag->tagRecord = ckalloc(tagTable->recordSize); + memset(tag->tagRecord, 0, tagTable->recordSize); + /* Don't need Tk_InitOptions() here, all defaults should be NULL. */ + tag->priority = ++tagTable->nTags; return tag; } -static void DeleteTag(Ttk_Tag tag, int nOptions) +static void DeleteTag(Ttk_TagTable tagTable, Ttk_Tag tag) { - int i; - for (i = 0; i < nOptions; ++i) { - if (tag->tagRecord[i]) { - Tcl_DecrRefCount(tag->tagRecord[i]); - } - } - ckfree((void*)tag->tagRecord); + Tk_FreeConfigOptions(tag->tagRecord,tagTable->optionTable,tagTable->tkwin); + ckfree(tag->tagRecord); ckfree((void*)tag); } -Tcl_Obj **Ttk_TagRecord(Ttk_Tag tag) -{ - return tag->tagRecord; -} - /*------------------------------------------------------------------------ * +++ Tag tables. */ Ttk_TagTable Ttk_CreateTagTable( - Tk_OptionTable tagOptionTable, int tagRecordSize) + Tcl_Interp *interp, Tk_Window tkwin, + Tk_OptionSpec optionSpecs[], int recordSize) { Ttk_TagTable tagTable = (Ttk_TagTable)ckalloc(sizeof(*tagTable)); - tagTable->tagOptionTable = tagOptionTable; - tagTable->tagRecordSize = tagRecordSize; + tagTable->tkwin = tkwin; + tagTable->optionSpecs = optionSpecs; + tagTable->optionTable = Tk_CreateOptionTable(interp, optionSpecs); + tagTable->recordSize = recordSize; + tagTable->nTags = 0; Tcl_InitHashTable(&tagTable->tags, TCL_STRING_KEYS); return tagTable; } @@ -71,11 +71,10 @@ void Ttk_DeleteTagTable(Ttk_TagTable tagTable) { Tcl_HashSearch search; Tcl_HashEntry *entryPtr; - int nOptions = tagTable->tagRecordSize / sizeof(Tcl_Obj *); entryPtr = Tcl_FirstHashEntry(&tagTable->tags, &search); while (entryPtr != NULL) { - DeleteTag(Tcl_GetHashValue(entryPtr), nOptions); + DeleteTag(tagTable, Tcl_GetHashValue(entryPtr)); entryPtr = Tcl_NextHashEntry(&search); } @@ -100,48 +99,144 @@ Ttk_Tag Ttk_GetTagFromObj(Ttk_TagTable tagTable, Tcl_Obj *objPtr) return Ttk_GetTag(tagTable, Tcl_GetString(objPtr)); } -/* Ttk_GetTagListFromObj -- +/*------------------------------------------------------------------------ + * +++ Tag sets. + */ + +/* Ttk_GetTagSetFromObj -- * Extract an array of pointers to Ttk_Tags from a Tcl_Obj. - * (suitable for passing to Tk_BindEvent). + * objPtr may be NULL, in which case a new empty tag set is returned. * - * Result must be passed to Ttk_FreeTagList(). + * Returns NULL and leaves an error message in interp->result on error. + * + * Non-NULL results must be passed to Ttk_FreeTagSet(). */ -extern int Ttk_GetTagListFromObj( - Tcl_Interp *interp, - Ttk_TagTable tagTable, - Tcl_Obj *objPtr, - int *nTags_rtn, - void **taglist_rtn) +Ttk_TagSet Ttk_GetTagSetFromObj( + Tcl_Interp *interp, Ttk_TagTable tagTable, Tcl_Obj *objPtr) { + Ttk_TagSet tagset = (Ttk_TagSet)(ckalloc(sizeof *tagset)); Tcl_Obj **objv; int i, objc; - void **tags; - - *taglist_rtn = NULL; *nTags_rtn = 0; if (objPtr == NULL) { - return TCL_OK; + tagset->tags = NULL; + tagset->nTags = 0; + return tagset; } if (Tcl_ListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) { - return TCL_ERROR; + ckfree((ClientData)tagset); + return NULL; } - tags = (void**)ckalloc((objc+1) * sizeof(void*)); + tagset->tags = (Ttk_Tag*)ckalloc((objc+1) * sizeof(Ttk_Tag)); for (i=0; itags[i] = Ttk_GetTagFromObj(tagTable, objv[i]); } - tags[i] = NULL; + tagset->tags[i] = NULL; + tagset->nTags = objc; + + return tagset; +} + +void Ttk_FreeTagSet(Ttk_TagSet tagset) +{ + ckfree((ClientData)tagset->tags); + ckfree((ClientData)tagset); +} + +/* Ttk_TagSetContains -- test if tag set contains a tag. + */ +int Ttk_TagSetContains(Ttk_TagSet tagset, Ttk_Tag tag) +{ + int i; + for (i = 0; i < tagset->nTags; ++i) { + if (tagset->tags[i] == tag) { + return 1; + } + } + return 0; +} - *taglist_rtn = tags; - *nTags_rtn = objc; +/*------------------------------------------------------------------------ + * +++ Utilities for widget commands. + */ + +/* Ttk_EnumerateTagOptions -- implements [$w tag configure $tag] + */ +int Ttk_EnumerateTagOptions( + Tcl_Interp *interp, Ttk_TagTable tagTable, Ttk_Tag tag) +{ + return TtkEnumerateOptions(interp, tag->tagRecord, + tagTable->optionSpecs, tagTable->optionTable, tagTable->tkwin); +} + +Tcl_Obj *Ttk_TagOptionValue( + Tcl_Interp *interp, + Ttk_TagTable tagTable, + Ttk_Tag tag, + Tcl_Obj *optionName) +{ + return Tk_GetOptionValue(interp, + tag->tagRecord, tagTable->optionTable, optionName, tagTable->tkwin); +} + +/* Ttk_ConfigureTag -- implements [$w tag configure $tag -option value...] + */ +int Ttk_ConfigureTag( + Tcl_Interp *interp, + Ttk_TagTable tagTable, + Ttk_Tag tag, + int objc, Tcl_Obj *const objv[]) +{ + return Tk_SetOptions( + interp, tag->tagRecord, tagTable->optionTable, + objc, objv, tagTable->tkwin, NULL/*savedOptions*/, NULL/*mask*/); +} + +/*------------------------------------------------------------------------ + * +++ Tag values. + */ - return TCL_OK; +#define OBJ_AT(record, offset) (*(Tcl_Obj**)(((char*)record)+offset)) + +void Ttk_TagSetValues(Ttk_TagTable tagTable, Ttk_TagSet tagSet, void *record) +{ + const int LOWEST_PRIORITY = 0x7FFFFFFF; + int i, j; + + memset(record, 0, tagTable->recordSize); + + for (i = 0; tagTable->optionSpecs[i].type != TK_OPTION_END; ++i) { + Tk_OptionSpec *optionSpec = tagTable->optionSpecs + i; + int offset = optionSpec->objOffset; + int prio = LOWEST_PRIORITY; + + for (j = 0; j < tagSet->nTags; ++j) { + Ttk_Tag tag = tagSet->tags[j]; + if (OBJ_AT(tag->tagRecord, offset) != 0 && tag->priority < prio) { + OBJ_AT(record, offset) = OBJ_AT(tag->tagRecord, offset); + prio = tag->priority; + } + } + } } -void Ttk_FreeTagList(void **taglist) +void Ttk_TagSetApplyStyle( + Ttk_TagTable tagTable, Ttk_Style style, Ttk_State state, void *record) { - if (taglist) - ckfree((ClientData)taglist); + Tk_OptionSpec *optionSpec = tagTable->optionSpecs; + + while (optionSpec->type != TK_OPTION_END) { + int offset = optionSpec->objOffset; + const char *optionName = optionSpec->optionName; + Tcl_Obj *val = Ttk_StyleMap(style, optionName, state); + if (val) { + OBJ_AT(record, offset) = val; + } else if (OBJ_AT(record, offset) == 0) { + OBJ_AT(record, offset) = Ttk_StyleDefault(style, optionName); + } + ++optionSpec; + } } diff --git a/generic/ttk/ttkTheme.c b/generic/ttk/ttkTheme.c index 3439ef0..45049b6 100644 --- a/generic/ttk/ttkTheme.c +++ b/generic/ttk/ttkTheme.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * $Id: ttkTheme.c,v 1.12 2008/04/27 22:41:12 dkf Exp $ + * $Id: ttkTheme.c,v 1.13 2008/05/23 20:20:05 jenglish Exp $ */ #include @@ -85,34 +85,35 @@ static void FreeStyle(Style *stylePtr) } /* - * LookupStateMap -- - * Look up dynamic resource settings in the in the specified style. + * Ttk_StyleMap -- + * Look up state-specific option value from specified style. */ - -static Ttk_StateMap LookupStateMap(Ttk_Style stylePtr, const char *optionName) +Tcl_Obj *Ttk_StyleMap(Ttk_Style style, const char *optionName, Ttk_State state) { - while (stylePtr) { + while (style) { Tcl_HashEntry *entryPtr = - Tcl_FindHashEntry(&stylePtr->settingsTable, optionName); - if (entryPtr) - return (Ttk_StateMap)Tcl_GetHashValue(entryPtr); - stylePtr = stylePtr->parentStyle; + Tcl_FindHashEntry(&style->settingsTable, optionName); + if (entryPtr) { + Ttk_StateMap stateMap = Tcl_GetHashValue(entryPtr); + return Ttk_StateMapLookup(NULL, stateMap, state); + } + style = style->parentStyle; } return 0; } /* - * LookupDefault -- + * Ttk_StyleDefault -- * Look up default resource setting the in the specified style. */ -static Tcl_Obj *LookupDefault(Ttk_Style stylePtr, const char *optionName) +Tcl_Obj *Ttk_StyleDefault(Ttk_Style style, const char *optionName) { - while (stylePtr) { + while (style) { Tcl_HashEntry *entryPtr = - Tcl_FindHashEntry(&stylePtr->defaultsTable, optionName); + Tcl_FindHashEntry(&style->defaultsTable, optionName); if (entryPtr) return (Tcl_Obj *)Tcl_GetHashValue(entryPtr); - stylePtr = stylePtr->parentStyle; + style= style->parentStyle; } return 0; } @@ -296,7 +297,6 @@ static void FreeElementImpl(ElementImpl *elementImpl) ckfree((ClientData)elementImpl); } - /*------------------------------------------------------------------------ * +++ Themes. */ @@ -993,15 +993,10 @@ int InitializeElementRecord( Tcl_Obj **dest = (Tcl_Obj **) (elementRecord + elementOption->offset); const char *optionName = elementOption->optionName; - Tcl_Obj *stateMap = LookupStateMap(style, optionName); - Tcl_Obj *dynamicSetting = 0; + Tcl_Obj *dynamicSetting = Ttk_StyleMap(style, optionName, state); Tcl_Obj *widgetValue = 0; Tcl_Obj *elementDefault = element->defaultValues[i]; - if (stateMap) { - dynamicSetting = Ttk_StateMapLookup(NULL, stateMap, state); - } - if (optionMap[i]) { widgetValue = *(Tcl_Obj **) (widgetRecord + optionMap[i]->objOffset); @@ -1012,7 +1007,7 @@ int InitializeElementRecord( } else if (dynamicSetting) { *dest = dynamicSetting; } else { - Tcl_Obj *styleDefault = LookupDefault(style, optionName); + Tcl_Obj *styleDefault = Ttk_StyleDefault(style, optionName); *dest = styleDefault ? styleDefault : elementDefault; } @@ -1039,7 +1034,6 @@ Tcl_Obj *Ttk_QueryStyle( const char *optionName, /* Option name */ Ttk_State state) /* Current state */ { - Tcl_Obj *stateMap; const Tk_OptionSpec *optionSpec; Tcl_Obj *result; @@ -1057,18 +1051,15 @@ Tcl_Obj *Ttk_QueryStyle( /* * Check dynamic settings: */ - stateMap = LookupStateMap(style, optionName); - if (stateMap) { - result = Ttk_StateMapLookup(NULL, stateMap, state); - if (result) { - return result; - } + result = Ttk_StyleMap(style, optionName, state); + if (result) { + return result; } /* * Use style default: */ - return LookupDefault(style, optionName); + return Ttk_StyleDefault(style, optionName); } /* diff --git a/generic/ttk/ttkTheme.h b/generic/ttk/ttkTheme.h index 5e7dc88..c5de39b 100644 --- a/generic/ttk/ttkTheme.h +++ b/generic/ttk/ttkTheme.h @@ -1,4 +1,4 @@ -/* $Id: ttkTheme.h,v 1.13 2007/12/13 15:26:26 dgp Exp $ +/* $Id: ttkTheme.h,v 1.14 2008/05/23 20:20:05 jenglish Exp $ * Copyright (c) 2003 Joe English. Freely redistributable. * * Declarations for Tk theme engine. @@ -205,6 +205,7 @@ typedef struct Ttk_Theme_ *Ttk_Theme; typedef struct Ttk_ElementImpl_ *Ttk_ElementImpl; typedef struct Ttk_Layout_ *Ttk_Layout; typedef struct Ttk_LayoutNode_ Ttk_LayoutNode; +typedef struct Ttk_Style_ *Ttk_Style; TTKAPI Ttk_Theme Ttk_GetTheme(Tcl_Interp *interp, const char *name); TTKAPI Ttk_Theme Ttk_GetDefaultTheme(Tcl_Interp *interp); @@ -341,6 +342,10 @@ MODULE_SCOPE void Ttk_ChangeElementState(Ttk_LayoutNode *,unsigned set,unsigned MODULE_SCOPE Tcl_Obj *Ttk_QueryOption(Ttk_Layout, const char *, Ttk_State); +TTKAPI Ttk_Style Ttk_LayoutStyle(Ttk_Layout); +TTKAPI Tcl_Obj *Ttk_StyleDefault(Ttk_Style, const char *optionName); +TTKAPI Tcl_Obj *Ttk_StyleMap(Ttk_Style, const char *optionName, Ttk_State); + /*------------------------------------------------------------------------ * +++ Resource cache. * See resource.c for explanation. diff --git a/generic/ttk/ttkThemeInt.h b/generic/ttk/ttkThemeInt.h index a7c19aa..1f61b73 100644 --- a/generic/ttk/ttkThemeInt.h +++ b/generic/ttk/ttkThemeInt.h @@ -1,5 +1,5 @@ /* - * $Id: ttkThemeInt.h,v 1.5 2007/12/13 15:26:26 dgp Exp $ + * $Id: ttkThemeInt.h,v 1.6 2008/05/23 20:20:05 jenglish Exp $ * * Theme engine: private definitions. * @@ -11,7 +11,6 @@ #include "ttkTheme.h" -typedef struct Ttk_Style_ *Ttk_Style; typedef struct Ttk_TemplateNode_ Ttk_TemplateNode, *Ttk_LayoutTemplate; MODULE_SCOPE Ttk_ElementImpl Ttk_GetElement(Ttk_Theme theme, const char *name); diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index 95c9a99..ffe1351 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -1,4 +1,4 @@ -/* $Id: ttkTreeview.c,v 1.24 2008/04/27 22:41:12 dkf Exp $ +/* $Id: ttkTreeview.c,v 1.25 2008/05/23 20:20:05 jenglish Exp $ * Copyright (c) 2004, Joe English * * ttk::treeview widget implementation. @@ -33,8 +33,7 @@ static const int HALO = 4; /* separator */ */ typedef struct TreeItemRec TreeItem; -struct TreeItemRec -{ +struct TreeItemRec { Tcl_HashEntry *entryPtr; /* Back-pointer to hash table entry */ TreeItem *parent; /* Parent item */ TreeItem *children; /* Linked list of child items */ @@ -50,16 +49,24 @@ struct TreeItemRec Tcl_Obj *valuesObj; Tcl_Obj *openObj; Tcl_Obj *tagsObj; + + /* + * Derived resources: + */ + Ttk_TagSet tagset; + Ttk_ImageSpec *imagespec; }; -static Tk_OptionSpec ItemOptionSpecs[] = -{ +#define ITEM_OPTION_TAGS_CHANGED 0x100 +#define ITEM_OPTION_IMAGE_CHANGED 0x200 + +static Tk_OptionSpec ItemOptionSpecs[] = { {TK_OPTION_STRING, "-text", "text", "Text", "", Tk_Offset(TreeItem,textObj), -1, 0,0,0 }, {TK_OPTION_STRING, "-image", "image", "Image", NULL, Tk_Offset(TreeItem,imageObj), -1, - TK_OPTION_NULL_OK,0,0 }, + TK_OPTION_NULL_OK,0,ITEM_OPTION_IMAGE_CHANGED }, {TK_OPTION_STRING, "-values", "values", "Values", NULL, Tk_Offset(TreeItem,valuesObj), -1, TK_OPTION_NULL_OK,0,0 }, @@ -68,7 +75,7 @@ static Tk_OptionSpec ItemOptionSpecs[] = 0,0,0 }, {TK_OPTION_STRING, "-tags", "tags", "Tags", NULL, Tk_Offset(TreeItem,tagsObj), -1, - TK_OPTION_NULL_OK,0,0 }, + TK_OPTION_NULL_OK,0,ITEM_OPTION_TAGS_CHANGED }, {TK_OPTION_END, 0,0,0, NULL, -1,-1, 0,0,0} }; @@ -90,6 +97,9 @@ static TreeItem *NewItem(void) item->openObj = NULL; item->tagsObj = NULL; + item->tagset = NULL; + item->imagespec = NULL; + return item; } @@ -103,6 +113,10 @@ static void FreeItem(TreeItem *item) if (item->valuesObj) { Tcl_DecrRefCount(item->valuesObj); } if (item->openObj) { Tcl_DecrRefCount(item->openObj); } if (item->tagsObj) { Tcl_DecrRefCount(item->tagsObj); } + + if (item->tagset) { Ttk_FreeTagSet(item->tagset); } + if (item->imagespec) { TtkFreeImageSpec(item->imagespec); } + ckfree((ClientData)item); } @@ -168,14 +182,13 @@ static TreeItem *NextPreorder(TreeItem *item) typedef struct { Tcl_Obj *textObj; /* taken from item / data cell */ Tcl_Obj *imageObj; /* taken from item */ - Tcl_Obj *anchorObj; /* from column */ + Tcl_Obj *anchorObj; /* from column <> */ Tcl_Obj *backgroundObj; /* remainder from tag */ Tcl_Obj *foregroundObj; Tcl_Obj *fontObj; } DisplayItem; -static Tk_OptionSpec TagOptionSpecs[] = -{ +static Tk_OptionSpec TagOptionSpecs[] = { {TK_OPTION_STRING, "-text", "text", "Text", NULL, Tk_Offset(DisplayItem,textObj), -1, TK_OPTION_NULL_OK,0,0 }, @@ -184,14 +197,14 @@ static Tk_OptionSpec TagOptionSpecs[] = TK_OPTION_NULL_OK,0,0 }, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", NULL, Tk_Offset(DisplayItem,anchorObj), -1, - TK_OPTION_NULL_OK, 0, GEOMETRY_CHANGED}, - {TK_OPTION_STRING, "-background", "windowColor", "WindowColor", /*SB:COLOR*/ + TK_OPTION_NULL_OK, 0, GEOMETRY_CHANGED}, /* <> */ + {TK_OPTION_COLOR, "-background", "windowColor", "WindowColor", NULL, Tk_Offset(DisplayItem,backgroundObj), -1, TK_OPTION_NULL_OK,0,0 }, - {TK_OPTION_STRING, "-foreground", "textColor", "TextColor", /*SB:COLOR*/ + {TK_OPTION_COLOR, "-foreground", "textColor", "TextColor", NULL, Tk_Offset(DisplayItem,foregroundObj), -1, TK_OPTION_NULL_OK,0,0 }, - {TK_OPTION_STRING, "-font", "font", "Font", /* SB:FONT */ + {TK_OPTION_FONT, "-font", "font", "Font", NULL, Tk_Offset(DisplayItem,fontObj), -1, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, @@ -211,7 +224,7 @@ typedef struct { int stretch; /* Should column stretch while resizing? */ Tcl_Obj *idObj; /* Column identifier, from -columns option */ - Tcl_Obj *anchorObj; /* -anchor for cell data */ + Tcl_Obj *anchorObj; /* -anchor for cell data <> */ /* Column heading data: */ @@ -259,8 +272,7 @@ static void FreeColumn(TreeColumn *column) /* Don't touch column->data, it's scratch storage */ } -static Tk_OptionSpec ColumnOptionSpecs[] = -{ +static Tk_OptionSpec ColumnOptionSpecs[] = { {TK_OPTION_INT, "-width", "width", "Width", DEF_COLWIDTH, -1, Tk_Offset(TreeColumn,width), 0,0,GEOMETRY_CHANGED }, @@ -271,7 +283,7 @@ static Tk_OptionSpec ColumnOptionSpecs[] = "1", -1, Tk_Offset(TreeColumn,stretch), 0,0,0 }, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", - "w", Tk_Offset(TreeColumn,anchorObj), -1, + "w", Tk_Offset(TreeColumn,anchorObj), -1, /* <> */ 0,0,0 }, {TK_OPTION_STRING, "-id", "id", "ID", NULL, Tk_Offset(TreeColumn,idObj), -1, @@ -279,8 +291,7 @@ static Tk_OptionSpec ColumnOptionSpecs[] = {TK_OPTION_END, 0,0,0, NULL, -1,-1, 0,0,0} }; -static Tk_OptionSpec HeadingOptionSpecs[] = -{ +static Tk_OptionSpec HeadingOptionSpecs[] = { {TK_OPTION_STRING, "-text", "text", "Text", "", Tk_Offset(TreeColumn,headingObj), -1, 0,0,0 }, @@ -349,8 +360,7 @@ static int GetEnumSetFromObj( * headingHeight: [layout] * rowHeight, indent: style */ -typedef struct -{ +typedef struct { /* Resources acquired at initialization-time: */ Tk_OptionTable itemOptionTable; @@ -425,8 +435,7 @@ typedef struct { static const char *SelectModeStrings[] = { "none", "browse", "extended", NULL }; -static Tk_OptionSpec TreeviewOptionSpecs[] = -{ +static Tk_OptionSpec TreeviewOptionSpecs[] = { WIDGET_TAKES_FOCUS, {TK_OPTION_STRING, "-columns", "columns", "Columns", @@ -887,14 +896,14 @@ static int DistributeWidth(Treeview *tv, int n) /* + ResizeColumns -- * Recompute column widths based on available width. - * Pick up slack first; + * Pick up slack first; * Distribute the remainder evenly across stretchable columns; * If any is still left over due to minwidth constraints, shove left. */ static void ResizeColumns(Treeview *tv, int newWidth) { int delta = newWidth - (TreeWidth(tv) + tv->tree.slack); - DepositSlack(tv, + DepositSlack(tv, ShoveLeft(tv, tv->tree.nDisplayColumns - 1, DistributeWidth(tv, PickupSlack(tv, delta)))); } @@ -915,7 +924,7 @@ static void DragColumn(Treeview *tv, int i, int delta) * +++ Event handlers. */ -static TreeItem *IdentifyItem(Treeview *tv,int y,Ttk_Box *itemPos); /*forward*/ +static TreeItem *IdentifyItem(Treeview *tv, int y); /*forward*/ static const unsigned int TreeviewBindEventMask = KeyPressMask|KeyReleaseMask @@ -928,14 +937,11 @@ static void TreeviewBindEventProc(void *clientData, XEvent *event) { Treeview *tv = clientData; TreeItem *item = NULL; - Ttk_Box unused; - void *taglist; - int nTags; + Ttk_TagSet tagset; /* * Figure out where to deliver the event. */ - switch (event->type) { case KeyPress: @@ -945,10 +951,10 @@ static void TreeviewBindEventProc(void *clientData, XEvent *event) break; case ButtonPress: case ButtonRelease: - item = IdentifyItem(tv, event->xbutton.y, &unused); + item = IdentifyItem(tv, event->xbutton.y); break; case MotionNotify: - item = IdentifyItem(tv, event->xmotion.y, &unused); + item = IdentifyItem(tv, event->xmotion.y); break; default: break; @@ -958,18 +964,21 @@ static void TreeviewBindEventProc(void *clientData, XEvent *event) return; } - /* ASSERT: Ttk_GetTagListFromObj returns TCL_OK. */ - Ttk_GetTagListFromObj(NULL, tv->tree.tagTable, item->tagsObj, - &nTags, &taglist); + /* ASSERT: Ttk_GetTagSetFromObj succeeds. + * NB: must use a local copy of the tagset, + * in case a binding script stomps on -tags. + */ + tagset = Ttk_GetTagSetFromObj(NULL, tv->tree.tagTable, item->tagsObj); /* * Fire binding: */ Tcl_Preserve(clientData); - Tk_BindEvent(tv->tree.bindingTable, event, tv->core.tkwin, nTags, taglist); + Tk_BindEvent(tv->tree.bindingTable, event, tv->core.tkwin, + tagset->nTags, (void **)tagset->tags); Tcl_Release(clientData); - Ttk_FreeTagList(taglist); + Ttk_FreeTagSet(tagset); } /*------------------------------------------------------------------------ @@ -991,7 +1000,7 @@ static int TreeviewInitialize(Tcl_Interp *interp, void *recordPtr) Tk_CreateOptionTable(interp, TagOptionSpecs); tv->tree.tagTable = Ttk_CreateTagTable( - tv->tree.tagOptionTable, sizeof(DisplayItem)); + interp, tv->core.tkwin, TagOptionSpecs, sizeof(DisplayItem)); tv->tree.bindingTable = Tk_CreateBindingTable(interp); Tk_CreateEventHandler(tv->core.tkwin, TreeviewBindEventMask, TreeviewBindEventProc, tv); @@ -1028,6 +1037,7 @@ static int TreeviewInitialize(Tcl_Interp *interp, void *recordPtr) tv->tree.root = NewItem(); Tk_InitOptions(interp, (ClientData)tv->tree.root, tv->tree.itemOptionTable, tv->core.tkwin); + tv->tree.root->tagset = Ttk_GetTagSetFromObj(NULL, tv->tree.tagTable, NULL); tv->tree.root->entryPtr = Tcl_CreateHashEntry(&tv->tree.items, "", &unused); Tcl_SetHashValue(tv->tree.root->entryPtr, tv->tree.root); @@ -1122,9 +1132,12 @@ static int ConfigureItem( int objc, Tcl_Obj *const objv[]) { Tk_SavedOptions savedOptions; + unsigned mask; + Ttk_ImageSpec *newImageSpec = NULL; + Ttk_TagSet newTagSet = NULL; if (Tk_SetOptions(interp, (ClientData)item, tv->tree.itemOptionTable, - objc, objv, tv->core.tkwin,&savedOptions,0) != TCL_OK) + objc, objv, tv->core.tkwin,&savedOptions,&mask) != TCL_OK) { return TCL_ERROR; } @@ -1137,15 +1150,24 @@ static int ConfigureItem( goto error; } - /* Validate -image option. + /* Check -image. */ - if (item->imageObj) { - Ttk_ImageSpec *imageSpec = - TtkGetImageSpec(interp, tv->core.tkwin, item->imageObj); - if (!imageSpec) { + if ((mask & ITEM_OPTION_IMAGE_CHANGED) && item->imageObj) { + newImageSpec = TtkGetImageSpec(interp, tv->core.tkwin, item->imageObj); + if (!newImageSpec) { + goto error; + } + } + + /* Check -tags. + * Side effect: may create new tags. + */ + if (mask & ITEM_OPTION_TAGS_CHANGED) { + newTagSet = Ttk_GetTagSetFromObj( + interp, tv->tree.tagTable, item->tagsObj); + if (!newTagSet) { goto error; } - TtkFreeImageSpec(imageSpec); /* @@@TODO: Keep this around */ } /* Keep TTK_STATE_OPEN flag in sync with item->openObj. @@ -1162,28 +1184,24 @@ static int ConfigureItem( item->state &= ~TTK_STATE_OPEN; } - /* Make sure -tags is a valid list - * (side effect: may create new tags) - */ - if (item->tagsObj) { - void *taglist; - int nTags; - if (Ttk_GetTagListFromObj(interp, tv->tree.tagTable, item->tagsObj, - &nTags, &taglist) != TCL_OK) - { - goto error; - } - Ttk_FreeTagList(taglist); - } - /* All OK. */ Tk_FreeSavedOptions(&savedOptions); + if (mask & ITEM_OPTION_TAGS_CHANGED) { + if (item->tagset) { Ttk_FreeTagSet(item->tagset); } + item->tagset = newTagSet; + } + if (mask & ITEM_OPTION_IMAGE_CHANGED) { + if (item->imagespec) { TtkFreeImageSpec(item->imagespec); } + item->imagespec = newImageSpec; + } TtkRedisplayWidget(&tv->core); return TCL_OK; error: Tk_RestoreSavedOptions(&savedOptions); + if (newTagSet) { Ttk_FreeTagSet(newTagSet); } + if (newImageSpec) { TtkFreeImageSpec(newImageSpec); } return TCL_ERROR; } @@ -1300,21 +1318,18 @@ static int CountRows(TreeItem *item) static TreeItem *IdentifyRow( Treeview *tv, /* Widget record */ TreeItem *item, /* Where to start search */ - Ttk_Box *bp, /* Scan position */ + int *ypos, /* Scan position */ int y) /* Target y coordinate */ { while (item) { - int next_ypos = bp->y + tv->tree.rowHeight; - if (bp->y <= y && y <= next_ypos) { - bp->height = tv->tree.rowHeight; + int next_ypos = *ypos + tv->tree.rowHeight; + if (*ypos <= y && y <= next_ypos) { return item; } - bp->y = next_ypos; + *ypos = next_ypos; if (item->state & TTK_STATE_OPEN) { - TreeItem *subitem = IdentifyRow(tv, item->children, bp, y); + TreeItem *subitem = IdentifyRow(tv, item->children, ypos, y); if (subitem) { - bp->x += tv->tree.indent; - bp->width -= tv->tree.indent; return subitem; } } @@ -1325,17 +1340,12 @@ static TreeItem *IdentifyRow( /* + IdentifyItem -- * Locate the item at the specified y position, if any. - * On return, *itemPos holds the parcel of the tree item. */ -static TreeItem *IdentifyItem(Treeview *tv, int y, Ttk_Box *itemPos) +static TreeItem *IdentifyItem(Treeview *tv, int y) { int rowHeight = tv->tree.rowHeight; - *itemPos = Ttk_MakeBox( - tv->tree.treeArea.x, - tv->tree.treeArea.y - tv->tree.yscroll.first * rowHeight, - tv->tree.column0.width, - rowHeight); - return IdentifyRow(tv, tv->tree.root->children, itemPos, y); + int ypos = tv->tree.treeArea.y - tv->tree.yscroll.first * rowHeight; + return IdentifyRow(tv, tv->tree.root->children, &ypos, y); } /* + IdentifyDisplayColumn -- @@ -1361,6 +1371,51 @@ static int IdentifyDisplayColumn(Treeview *tv, int x, int *x1) return -1; } +/* + RowNumber -- + * Calculate which row the specified item appears on; + * returns -1 if the item is not viewable. + * Xref: DrawForest, IdentifyItem. + */ +static int RowNumber(Treeview *tv, TreeItem *item) +{ + TreeItem *p = tv->tree.root->children; + int n = 0; + + while (p) { + if (p == item) + return n; + + ++n; + + /* Find next viewable item in preorder traversal order + */ + if (p->children && (p->state & TTK_STATE_OPEN)) { + p = p->children; + } else { + while (!p->next && p && p->parent) + p = p->parent; + if (p) + p = p->next; + } + } + + return -1; +} + +/* + ItemDepth -- return the depth of a tree item. + * The depth of an item is equal to the number of proper ancestors, + * not counting the root node. + */ +static int ItemDepth(TreeItem *item) +{ + int depth = 0; + while (item->parent) { + ++depth; + item = item->parent; + } + return depth-1; +} + /* + ItemRow -- * Returns row number of specified item relative to root, * -1 if item is not viewable. @@ -1388,6 +1443,93 @@ static int ItemRow(Treeview *tv, TreeItem *p) } } +/* + BoundingBox -- + * Compute the parcel of the specified column of the specified item, + * (or the entire item if column is NULL) + * Returns: 0 if item or column is not viewable, 1 otherwise. + */ +static int BoundingBox( + Treeview *tv, /* treeview widget */ + TreeItem *item, /* desired item */ + TreeColumn *column, /* desired column */ + Ttk_Box *bbox_rtn) /* bounding box of item */ +{ + int row = ItemRow(tv, item); + Ttk_Box bbox = tv->tree.treeArea; + + if (row < tv->tree.yscroll.first || row > tv->tree.yscroll.last) { + /* not viewable, or off-screen */ + return 0; + } + + bbox.y += (row - tv->tree.yscroll.first) * tv->tree.rowHeight; + bbox.height = tv->tree.rowHeight; + + if (column) { + int xpos = 0, i = FirstColumn(tv); + while (i < tv->tree.nDisplayColumns) { + if (tv->tree.displayColumns[i] == column) { + break; + } + xpos += tv->tree.displayColumns[i]->width; + ++i; + } + if (i == tv->tree.nDisplayColumns) { /* specified column unviewable */ + return 0; + } + bbox.x += xpos; + bbox.width = column->width; + + /* Account for indentation in tree column: + */ + if (column == &tv->tree.column0) { + int indent = tv->tree.indent * ItemDepth(item); + bbox.x += indent; + bbox.width -= indent; + } + } + *bbox_rtn = bbox; + return 1; +} + +/* + IdentifyRegion -- + */ + +typedef enum { + REGION_NOTHING = 0, + REGION_HEADING, + REGION_SEPARATOR, + REGION_TREE, + REGION_CELL +} TreeRegion; + +static const char *regionStrings[] = { + "nothing", "heading", "separator", "tree", "cell", 0 +}; + +static TreeRegion IdentifyRegion(Treeview *tv, int x, int y) +{ + int x1, colno = IdentifyDisplayColumn(tv, x, &x1); + + if (Ttk_BoxContains(tv->tree.headingArea, x, y)) { + if (colno < 0) { + return REGION_NOTHING; + } else if (-HALO <= x1 - x && x1 - x <= HALO) { + return REGION_SEPARATOR; + } else { + return REGION_HEADING; + } + } else if (Ttk_BoxContains(tv->tree.treeArea,x,y)) { + TreeItem *item = IdentifyItem(tv, y); + if (item && colno > 0) { + return REGION_CELL; + } else if (item) { + return REGION_TREE; + } + } + return REGION_NOTHING; +} + /*------------------------------------------------------------------------ * +++ Display routines. */ @@ -1560,34 +1702,16 @@ static void DrawHeadings(Treeview *tv, Drawable d, Ttk_Box b) } /* + PrepareItem -- - * Fill in a displayItem record from tag settings. + * Fill in a displayItem record. */ -static void PrepareItem(Treeview *tv, TreeItem *item, DisplayItem *displayItem) +static void PrepareItem( + Treeview *tv, TreeItem *item, DisplayItem *displayItem) { - const int nOptions = sizeof(*displayItem)/sizeof(Tcl_Obj*); - Tcl_Obj **dest = (Tcl_Obj**)displayItem; - Tcl_Obj **objv = NULL; - int objc = 0; - - memset(displayItem, 0, sizeof(*displayItem)); + Ttk_Style style = Ttk_LayoutStyle(tv->core.layout); + Ttk_State state = ItemState(tv, item); - if ( item->tagsObj - && Tcl_ListObjGetElements(NULL, item->tagsObj, &objc, &objv) == TCL_OK) - { - int i, j; - for (i=0; itree.tagTable, objv[i]); - Tcl_Obj **tagRecord = Ttk_TagRecord(tag); - - if (tagRecord) { - for (j=0; jtree.tagTable, item->tagset, displayItem); + Ttk_TagSetApplyStyle(tv->tree.tagTable, style, state, displayItem); } /* + DrawCells -- @@ -1620,7 +1744,7 @@ static void DrawCells( Ttk_MakeBox(b.x+x, b.y+y, column->width, rowHeight), cellPadding); displayItem->textObj = column->data; - displayItem->anchorObj = column->anchorObj; + displayItem->anchorObj = column->anchorObj; /* <> */ DisplayLayout(layout, displayItem, state, parcel, d); x += column->width; @@ -1655,9 +1779,9 @@ static void DrawItem( if (tv->tree.showFlags & SHOW_TREE) { int colwidth = tv->tree.column0.width; Ttk_Box parcel = Ttk_MakeBox(b.x + x, b.y + y, colwidth - x, rowHeight); - displayItem.textObj = item->textObj; - displayItem.imageObj = item->imageObj; - displayItem.anchorObj = 0; + if (item->textObj) { displayItem.textObj = item->textObj; } + if (item->imageObj) { displayItem.imageObj = item->imageObj; } + /* ??? displayItem.anchorObj = 0; <> */ DisplayLayout(tv->tree.itemLayout, &displayItem, state, parcel, d); x = colwidth; } else { @@ -1802,51 +1926,6 @@ static TreeItem *DeleteItems(TreeItem *item, TreeItem *delq) return delq; } -/* + RowNumber -- - * Calculate which row the specified item appears on; - * returns -1 if the item is not viewable. - * Xref: DrawForest, IdentifyItem. - */ -static int RowNumber(Treeview *tv, TreeItem *item) -{ - TreeItem *p = tv->tree.root->children; - int n = 0; - - while (p) { - if (p == item) - return n; - - ++n; - - /* Find next viewable item in preorder traversal order - */ - if (p->children && (p->state & TTK_STATE_OPEN)) { - p = p->children; - } else { - while (!p->next && p && p->parent) - p = p->parent; - if (p) - p = p->next; - } - } - - return -1; -} - -/* + ItemDepth -- return the depth of a tree item. - * The depth of an item is equal to the number of proper ancestors, - * not counting the root node. - */ -static int ItemDepth(TreeItem *item) -{ - int depth = 0; - while (item->parent) { - ++depth; - item = item->parent; - } - return depth-1; -} - /*------------------------------------------------------------------------ * +++ Widget commands -- item inquiry. */ @@ -2065,7 +2144,6 @@ static int TreeviewBBoxCommand( Treeview *tv = recordPtr; TreeItem *item = 0; TreeColumn *column = 0; - int row; Ttk_Box bbox; if (objc < 3 || objc > 4) { @@ -2081,47 +2159,10 @@ static int TreeviewBBoxCommand( return TCL_ERROR; } - /* Compute bounding box of item: - */ - row = ItemRow(tv, item); - if (row < tv->tree.yscroll.first || row > tv->tree.yscroll.last) { - /* not viewable, or off-screen */ - return TCL_OK; - } - - bbox = tv->tree.treeArea; - bbox.y += (row - tv->tree.yscroll.first) * tv->tree.rowHeight; - bbox.height = tv->tree.rowHeight; - - /* If column has been specified, compute bounding box of cell - */ - if (column) { - int xpos = 0, i = FirstColumn(tv); - while (i < tv->tree.nDisplayColumns) { - if (tv->tree.displayColumns[i] == column) { - break; - } - xpos += tv->tree.displayColumns[i]->width; - ++i; - } - if (i == tv->tree.nDisplayColumns) { /* specified column unviewable */ - return TCL_OK; - } - bbox.x += xpos; - bbox.width = column->width; - - /* Special case for tree column -- account for indentation: - * (@@@ NOTE: doesn't account for tree indicator or image; - * @@@ this may or may not be the right thing.) - */ - if (column == &tv->tree.column0) { - int indent = tv->tree.indent * ItemDepth(item); - bbox.x += indent; - bbox.width -= indent; - } + if (BoundingBox(tv, item, column, &bbox)) { + Tcl_SetObjResult(interp, Ttk_NewBoxObj(bbox)); } - Tcl_SetObjResult(interp, Ttk_NewBoxObj(bbox)); return TCL_OK; } @@ -2166,16 +2207,17 @@ static int TreeviewHorribleIdentify( } detail = dcolbuf; } else if (Ttk_BoxContains(tv->tree.treeArea,x,y)) { - Ttk_Box itemBox; - item = IdentifyItem(tv, y, &itemBox); + item = IdentifyItem(tv, y); if (item && dColumnNumber > 0) { what = "cell"; detail = dcolbuf; } else if (item) { Ttk_Layout layout = tv->tree.itemLayout; + Ttk_Box itemBox; DisplayItem displayItem; Ttk_LayoutNode *element; + BoundingBox(tv, item, NULL, &itemBox); PrepareItem(tv, item, &displayItem); /*@@@ FIX: -text, etc*/ Ttk_RebindSublayout(layout, &displayItem); Ttk_PlaceLayout(layout, ItemState(tv,item), itemBox); @@ -2209,51 +2251,97 @@ done: static int TreeviewIdentifyCommand( Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { - static const char *componentStrings[] = - { "row", "column", NULL }; - enum { I_ROW, I_COLUMN }; + static const char *submethodStrings[] = + { "region", "item", "column", "row", "element", NULL }; + enum { I_REGION, I_ITEM, I_COLUMN, I_ROW, I_ELEMENT }; Treeview *tv = recordPtr; - int component, x, y; + int submethod; + int x, y; + + TreeRegion region; + Ttk_Box bbox; + TreeItem *item; + TreeColumn *column = 0; + int colno, x1; if (objc == 4) { /* Old form */ return TreeviewHorribleIdentify(interp, objc, objv, tv); } else if (objc != 5) { - Tcl_WrongNumArgs(interp, 2, objv, "component x y"); + Tcl_WrongNumArgs(interp, 2, objv, "command x y"); return TCL_ERROR; } if ( Tcl_GetIndexFromObj(interp, objv[2], - componentStrings, "component", TCL_EXACT, &component) != TCL_OK + submethodStrings, "command", TCL_EXACT, &submethod) != TCL_OK || Tcl_GetIntFromObj(interp, objv[3], &x) != TCL_OK || Tcl_GetIntFromObj(interp, objv[4], &y) != TCL_OK ) { return TCL_ERROR; } - switch (component) + region = IdentifyRegion(tv, x, y); + item = IdentifyItem(tv, y); + colno = IdentifyDisplayColumn(tv, x, &x1); + column = (colno >= 0) ? tv->tree.displayColumns[colno] : NULL; + + switch (submethod) { + case I_REGION : + Tcl_SetObjResult(interp,Tcl_NewStringObj(regionStrings[region],-1)); + break; + + case I_ITEM : case I_ROW : - { - Ttk_Box itemBox; - TreeItem *item = IdentifyItem(tv, y, &itemBox); if (item) { Tcl_SetObjResult(interp, ItemID(tv, item)); } break; - } case I_COLUMN : - { - int x1; - int column = IdentifyDisplayColumn(tv, x, &x1); - - if (column >= 0) { + if (colno >= 0) { char dcolbuf[16]; - sprintf(dcolbuf, "#%d", column); + sprintf(dcolbuf, "#%d", colno); Tcl_SetObjResult(interp, Tcl_NewStringObj(dcolbuf, -1)); } break; + + case I_ELEMENT : + { + Ttk_Layout layout = 0; + DisplayItem displayItem; + Ttk_LayoutNode *element; + + switch (region) { + case REGION_NOTHING: + layout = tv->core.layout; + return TCL_OK; /* @@@ NYI */ + case REGION_HEADING: + case REGION_SEPARATOR: + layout = tv->tree.headingLayout; + return TCL_OK; /* @@@ NYI */ + case REGION_TREE: + layout = tv->tree.itemLayout; + break; + case REGION_CELL: + layout = tv->tree.cellLayout; + break; + } + + if (!BoundingBox(tv, item, column, &bbox)) { + return TCL_OK; + } + + PrepareItem(tv, item, &displayItem); /*@@@ FIX: fill in -text,etc */ + Ttk_RebindSublayout(layout, &displayItem); + Ttk_PlaceLayout(layout, ItemState(tv,item), bbox); + element = Ttk_LayoutIdentify(layout, x, y); + + if (element) { + const char *elementName = Ttk_LayoutNodeName(element); + Tcl_SetObjResult(interp, Tcl_NewStringObj(elementName, -1)); + } + break; } } return TCL_OK; @@ -2501,6 +2589,7 @@ static int TreeviewInsertCommand( newItem = NewItem(); Tk_InitOptions( interp, (ClientData)newItem, tv->tree.itemOptionTable, tv->core.tkwin); + newItem->tagset = Ttk_GetTagSetFromObj(NULL, tv->tree.tagTable, NULL); if (ConfigureItem(interp, tv, newItem, objc, objv) != TCL_OK) { Tcl_DeleteHashEntry(entryPtr); FreeItem(newItem); @@ -2651,7 +2740,7 @@ static int TreeviewMoveCommand( if (p != item) { --index; } /* else -- moving node forward, count index+1 nodes */ - sibling = p; + sibling = p; } } @@ -2942,7 +3031,7 @@ static int TreeviewTagConfigureCommand( Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) { Treeview *tv = recordPtr; - void *tagRecord; + Ttk_TagTable tagTable = tv->tree.tagTable; Ttk_Tag tag; if (objc < 4) { @@ -2950,22 +3039,57 @@ static int TreeviewTagConfigureCommand( return TCL_ERROR; } - tag = Ttk_GetTagFromObj(tv->tree.tagTable, objv[3]); - tagRecord = Ttk_TagRecord(tag); + tag = Ttk_GetTagFromObj(tagTable, objv[3]); if (objc == 4) { - return TtkEnumerateOptions(interp, tagRecord, TagOptionSpecs, - tv->tree.tagOptionTable, tv->core.tkwin); + return Ttk_EnumerateTagOptions(interp, tagTable, tag); } else if (objc == 5) { - return TtkGetOptionValue(interp, tagRecord, objv[4], - tv->tree.tagOptionTable, tv->core.tkwin); + Tcl_Obj *result = Ttk_TagOptionValue(interp, tagTable, tag, objv[4]); + if (result) { + Tcl_SetObjResult(interp, result); + return TCL_OK; + } /* else */ + return TCL_ERROR; } /* else */ TtkRedisplayWidget(&tv->core); - return Tk_SetOptions( - interp, tagRecord, tv->tree.tagOptionTable, - objc - 4, objv + 4, tv->core.tkwin, - NULL/*savedOptions*/, NULL/*mask*/); + return Ttk_ConfigureTag(interp, tagTable, tag, objc - 4, objv + 4); +} + +/* + $tv tag has $tag ?$item? + */ +static int TreeviewTagHasCommand( + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], void *recordPtr) +{ + Treeview *tv = recordPtr; + + if (objc == 4) { /* Return list of all items with tag */ + Ttk_Tag tag = Ttk_GetTagFromObj(tv->tree.tagTable, objv[3]); + TreeItem *item = tv->tree.root; + Tcl_Obj *result = Tcl_NewListObj(0,0); + + while (item) { + if (Ttk_TagSetContains(item->tagset, tag)) { + Tcl_ListObjAppendElement(NULL, result, ItemID(tv, item)); + } + item = NextPreorder(item); + } + + Tcl_SetObjResult(interp, result); + return TCL_OK; + } else if (objc == 5) { /* Test if item has specified tag */ + Ttk_Tag tag = Ttk_GetTagFromObj(tv->tree.tagTable, objv[3]); + TreeItem *item = FindItem(interp, tv, objv[4]); + if (!item) { + return TCL_ERROR; + } + Tcl_SetObjResult(interp, + Tcl_NewBooleanObj(Ttk_TagSetContains(item->tagset, tag))); + return TCL_OK; + } else { + Tcl_WrongNumArgs(interp, 3, objv, "tagName ?item?"); + return TCL_ERROR; + } } /* + $tv tag option args... @@ -2976,6 +3100,7 @@ static int TreeviewTagCommand( static WidgetCommandSpec TreeviewTagCommands[] = { { "bind", TreeviewTagBindCommand }, { "configure", TreeviewTagConfigureCommand }, + { "has", TreeviewTagHasCommand }, {0,0} }; return TtkWidgetEnsembleCommand( @@ -2985,8 +3110,7 @@ static int TreeviewTagCommand( /*------------------------------------------------------------------------ * +++ Widget commands record. */ -static WidgetCommandSpec TreeviewCommands[] = -{ +static WidgetCommandSpec TreeviewCommands[] = { { "bbox", TreeviewBBoxCommand }, { "children", TreeviewChildrenCommand }, { "cget", TtkWidgetCgetCommand }, @@ -3021,8 +3145,7 @@ static WidgetCommandSpec TreeviewCommands[] = * +++ Widget definition. */ -static WidgetSpec TreeviewWidgetSpec = -{ +static WidgetSpec TreeviewWidgetSpec = { "Treeview", /* className */ sizeof(Treeview), /* recordSize */ TreeviewOptionSpecs, /* optionSpecs */ @@ -3075,15 +3198,13 @@ TTK_END_LAYOUT_TABLE * +++ Tree indicator element. */ -typedef struct -{ +typedef struct { Tcl_Obj *colorObj; Tcl_Obj *sizeObj; Tcl_Obj *marginsObj; } TreeitemIndicator; -static Ttk_ElementOptionSpec TreeitemIndicatorOptions[] = -{ +static Ttk_ElementOptionSpec TreeitemIndicatorOptions[] = { { "-foreground", TK_OPTION_COLOR, Tk_Offset(TreeitemIndicator,colorObj), DEFAULT_FOREGROUND }, { "-indicatorsize", TK_OPTION_PIXELS, @@ -3135,8 +3256,7 @@ static void TreeitemIndicatorDraw( Tk_FreeGC(Tk_Display(tkwin), gc); } -static Ttk_ElementSpec TreeitemIndicatorElementSpec = -{ +static Ttk_ElementSpec TreeitemIndicatorElementSpec = { TK_STYLE_VERSION_2, sizeof(TreeitemIndicator), TreeitemIndicatorOptions, @@ -3148,14 +3268,12 @@ static Ttk_ElementSpec TreeitemIndicatorElementSpec = * +++ Row element. */ -typedef struct -{ +typedef struct { Tcl_Obj *backgroundObj; Tcl_Obj *rowNumberObj; } RowElement; -static Ttk_ElementOptionSpec RowElementOptions[] = -{ +static Ttk_ElementOptionSpec RowElementOptions[] = { { "-background", TK_OPTION_COLOR, Tk_Offset(RowElement,backgroundObj), DEFAULT_BACKGROUND }, { "-rownumber", TK_OPTION_INT, @@ -3174,8 +3292,7 @@ static void RowElementDraw( b.x, b.y, b.width, b.height); } -static Ttk_ElementSpec RowElementSpec = -{ +static Ttk_ElementSpec RowElementSpec = { TK_STYLE_VERSION_2, sizeof(RowElement), RowElementOptions, diff --git a/generic/ttk/ttkWidget.h b/generic/ttk/ttkWidget.h index 21cb1b3..c74711d 100644 --- a/generic/ttk/ttkWidget.h +++ b/generic/ttk/ttkWidget.h @@ -1,4 +1,4 @@ -/* $Id: ttkWidget.h,v 1.9 2008/01/06 22:33:14 jenglish Exp $ +/* $Id: ttkWidget.h,v 1.10 2008/05/23 20:20:05 jenglish Exp $ * Copyright (c) 2003, Joe English * Helper routines for widget implementations. */ @@ -211,20 +211,39 @@ MODULE_SCOPE void TtkScrollbarUpdateRequired(ScrollHandle); typedef struct TtkTag *Ttk_Tag; typedef struct TtkTagTable *Ttk_TagTable; +typedef struct TtkTagSet { /* TODO: make opaque */ + Ttk_Tag *tags; + int nTags; +} *Ttk_TagSet; -MODULE_SCOPE Ttk_TagTable Ttk_CreateTagTable(Tk_OptionTable, int tagRecSize); +MODULE_SCOPE Ttk_TagTable Ttk_CreateTagTable( + Tcl_Interp *, Tk_Window tkwin, Tk_OptionSpec[], int recordSize); MODULE_SCOPE void Ttk_DeleteTagTable(Ttk_TagTable); MODULE_SCOPE Ttk_Tag Ttk_GetTag(Ttk_TagTable, const char *tagName); MODULE_SCOPE Ttk_Tag Ttk_GetTagFromObj(Ttk_TagTable, Tcl_Obj *); -MODULE_SCOPE Tcl_Obj **Ttk_TagRecord(Ttk_Tag); +MODULE_SCOPE Tcl_Obj *Ttk_TagOptionValue( + Tcl_Interp *, Ttk_TagTable, Ttk_Tag, Tcl_Obj *optionName); -MODULE_SCOPE int Ttk_GetTagListFromObj( - Tcl_Interp *interp, Ttk_TagTable, Tcl_Obj *objPtr, - int *nTags_rtn, void **taglist_rtn); +MODULE_SCOPE int Ttk_EnumerateTagOptions( + Tcl_Interp *, Ttk_TagTable, Ttk_Tag); -MODULE_SCOPE void Ttk_FreeTagList(void **taglist); +MODULE_SCOPE int Ttk_ConfigureTag( + Tcl_Interp *interp, Ttk_TagTable tagTable, Ttk_Tag tag, + int objc, Tcl_Obj *const objv[]); + +MODULE_SCOPE Ttk_TagSet Ttk_GetTagSetFromObj( + Tcl_Interp *interp, Ttk_TagTable, Tcl_Obj *objPtr); + +MODULE_SCOPE void Ttk_FreeTagSet(Ttk_TagSet); + +MODULE_SCOPE int Ttk_TagSetContains(Ttk_TagSet, Ttk_Tag tag); +MODULE_SCOPE void Ttk_TagSetAdd(Ttk_TagSet, Ttk_Tag tag); +MODULE_SCOPE void Ttk_TagSetRemove(Ttk_TagSet, Ttk_Tag tag); + +MODULE_SCOPE void Ttk_TagSetValues(Ttk_TagTable, Ttk_TagSet, void *record); +MODULE_SCOPE void Ttk_TagSetApplyStyle(Ttk_TagTable,Ttk_Style,Ttk_State,void*); /* * Useful widget base classes: diff --git a/library/ttk/altTheme.tcl b/library/ttk/altTheme.tcl index c92e3d5..e604373 100644 --- a/library/ttk/altTheme.tcl +++ b/library/ttk/altTheme.tcl @@ -1,5 +1,5 @@ # -# $Id: altTheme.tcl,v 1.6 2007/12/13 15:27:07 dgp Exp $ +# $Id: altTheme.tcl,v 1.7 2008/05/23 20:20:05 jenglish Exp $ # # Ttk widget set: Alternate theme # @@ -80,15 +80,8 @@ namespace eval ttk::theme::alt { # Treeview: ttk::style configure Heading -font TkHeadingFont -relief raised - ttk::style configure Row -background $colors(-window) - ttk::style configure Cell -background $colors(-window) - ttk::style map Row \ - -background [list selected $colors(-selectbg)] \ - -foreground [list selected $colors(-selectfg)] ; - ttk::style map Cell \ - -background [list selected $colors(-selectbg)] \ - -foreground [list selected $colors(-selectfg)] ; - ttk::style map Item \ + ttk::style configure Treeview -background $colors(-window) + ttk::style map Treeview \ -background [list selected $colors(-selectbg)] \ -foreground [list selected $colors(-selectfg)] ; diff --git a/library/ttk/aquaTheme.tcl b/library/ttk/aquaTheme.tcl index bc6d4e9..ccb8bd3 100644 --- a/library/ttk/aquaTheme.tcl +++ b/library/ttk/aquaTheme.tcl @@ -1,5 +1,5 @@ # -# $Id: aquaTheme.tcl,v 1.11 2007/12/13 15:27:08 dgp Exp $ +# $Id: aquaTheme.tcl,v 1.12 2008/05/23 20:20:06 jenglish Exp $ # # Aqua theme (OSX native look and feel) # @@ -38,14 +38,10 @@ namespace eval ttk::theme::aqua { ttk::style configure TCombobox -postoffset {5 -2 -10 0} # Treeview: - ttk::style configure Treeview -rowheight 18 ttk::style configure Heading -font TkHeadingFont - ttk::style map Row -background [list \ + ttk::style configure Treeview -rowheight 18 -background White + ttk::style map Treeview -background [list \ {selected background} "#c3c3c3" selected SystemHighlight] ; - ttk::style map Cell -foreground [list \ - {selected background} "#000000" selected SystemHighlightText] ; - ttk::style map Item -foreground [list \ - {selected background} "#000000" selected SystemHighlightText] ; # Enable animation for ttk::progressbar widget: ttk::style configure TProgressbar -period 100 -maxphase 255 diff --git a/library/ttk/clamTheme.tcl b/library/ttk/clamTheme.tcl index c4c8184..799b6ae 100644 --- a/library/ttk/clamTheme.tcl +++ b/library/ttk/clamTheme.tcl @@ -1,5 +1,5 @@ # -# $Id: clamTheme.tcl,v 1.6 2007/12/13 15:27:08 dgp Exp $ +# $Id: clamTheme.tcl,v 1.7 2008/05/23 20:20:06 jenglish Exp $ # # "Clam" theme. # @@ -116,15 +116,8 @@ namespace eval ttk::theme::clam { # Treeview: ttk::style configure Heading \ -font TkHeadingFont -relief raised -padding {3} - ttk::style configure Row -background $colors(-window) - ttk::style configure Cell -background $colors(-window) - ttk::style map Row \ - -background [list selected $colors(-selectbg)] \ - -foreground [list selected $colors(-selectfg)] ; - ttk::style map Cell \ - -background [list selected $colors(-selectbg)] \ - -foreground [list selected $colors(-selectfg)] ; - ttk::style map Item \ + ttk::style configure Treeview -background $colors(-window) + ttk::style map Treeview \ -background [list selected $colors(-selectbg)] \ -foreground [list selected $colors(-selectfg)] ; diff --git a/library/ttk/classicTheme.tcl b/library/ttk/classicTheme.tcl index c96d7ff..48c3df8 100644 --- a/library/ttk/classicTheme.tcl +++ b/library/ttk/classicTheme.tcl @@ -1,5 +1,5 @@ # -# $Id: classicTheme.tcl,v 1.6 2007/12/13 15:27:08 dgp Exp $ +# $Id: classicTheme.tcl,v 1.7 2008/05/23 20:20:06 jenglish Exp $ # # "classic" Tk theme. # @@ -87,12 +87,8 @@ namespace eval ttk::theme::classic { # Treeview: ttk::style configure Heading -font TkHeadingFont -relief raised - ttk::style configure Row -background $colors(-window) - ttk::style configure Cell -background $colors(-window) - ttk::style map Row \ - -background [list selected $colors(-selectbg)] \ - -foreground [list selected $colors(-selectfg)] ; - ttk::style map Cell \ + ttk::style configure Treeview -background $colors(-window) + ttk::style map Treeview \ -background [list selected $colors(-selectbg)] \ -foreground [list selected $colors(-selectfg)] ; diff --git a/library/ttk/defaults.tcl b/library/ttk/defaults.tcl index 500562d..dfb6654 100644 --- a/library/ttk/defaults.tcl +++ b/library/ttk/defaults.tcl @@ -1,5 +1,5 @@ # -# $Id: defaults.tcl,v 1.6 2007/12/13 15:27:08 dgp Exp $ +# $Id: defaults.tcl,v 1.7 2008/05/23 20:20:06 jenglish Exp $ # # Settings for default theme. # @@ -8,7 +8,9 @@ namespace eval ttk::theme::default { variable colors array set colors { -frame "#d9d9d9" + -foreground "#000000" -window "#ffffff" + -text "#000000" -activebg "#ececec" -selectbg "#4a6984" -selectfg "#ffffff" @@ -22,7 +24,7 @@ namespace eval ttk::theme::default { ttk::style configure "." \ -borderwidth 1 \ -background $colors(-frame) \ - -foreground black \ + -foreground $colors(-foreground) \ -troughcolor $colors(-darker) \ -font TkDefaultFont \ -selectborderwidth 1 \ @@ -85,15 +87,10 @@ namespace eval ttk::theme::default { # Treeview. # ttk::style configure Heading -font TkHeadingFont -relief raised - ttk::style configure Row -background $colors(-window) - ttk::style configure Cell -background $colors(-window) - ttk::style map Row \ - -background [list selected $colors(-selectbg)] \ - -foreground [list selected $colors(-selectfg)] ; - ttk::style map Cell \ - -background [list selected $colors(-selectbg)] \ - -foreground [list selected $colors(-selectfg)] ; - ttk::style map Item \ + ttk::style configure Treeview \ + -background $colors(-window) \ + -foreground $colors(-text) ; + ttk::style map Treeview \ -background [list selected $colors(-selectbg)] \ -foreground [list selected $colors(-selectfg)] ; diff --git a/library/ttk/treeview.tcl b/library/ttk/treeview.tcl index d2a1015..608cdf2 100644 --- a/library/ttk/treeview.tcl +++ b/library/ttk/treeview.tcl @@ -1,4 +1,4 @@ -# $Id: treeview.tcl,v 1.5 2008/04/25 19:08:32 jenglish Exp $ +# $Id: treeview.tcl,v 1.6 2008/05/23 20:20:06 jenglish Exp $ # # ttk::treeview widget bindings and utilities. # @@ -21,15 +21,6 @@ namespace eval ttk::treeview { # For pressmode == "heading" set State(heading) {} - - # Provide [lassign] if not already present - # (@@@ TODO: check if this is still needed after horrible-identify purge) - # - if {![llength [info commands lassign]]} { - proc lassign {vals args} { - uplevel 1 [list foreach $args $vals break] - } - } } ### Widget bindings. @@ -118,10 +109,9 @@ proc ttk::treeview::Motion {w x y} { set cursor {} set activeHeading {} - lassign [$w identify $x $y] what where detail - switch -- $what { + switch -- [$w identify region $x $y] { separator { set cursor $Cursors(hresize) } - heading { set activeHeading $where } + heading { set activeHeading [$w identify column $x $y] } } if {[$w cget -cursor] ne $cursor} { @@ -170,19 +160,20 @@ proc ttk::treeview::DoubleClick {w x y} { ## Press -- ButtonPress binding. # proc ttk::treeview::Press {w x y} { - lassign [$w identify $x $y] what where detail - focus $w ;# or: ClickToFocus? - - switch -- $what { + focus $w + switch -- [$w identify region $x $y] { nothing { } - heading { heading.press $w $where } - separator { resize.press $w $x $where } - cell - - row - - item { SelectOp $w $where choose } - } - if {$what eq "item" && [string match *indicator $detail]} { - Toggle $w $where + heading { heading.press $w $x $y } + separator { resize.press $w $x $y } + tree - + cell { + set item [$w identify item $x $y] + SelectOp $w $item choose + switch -glob -- [$w identify element $x $y] { + *indicator - + *disclosure { Toggle $w $item } + } + } } } @@ -208,10 +199,10 @@ proc ttk::treeview::Release {w x y} { ### Interactive column resizing. # -proc ttk::treeview::resize.press {w x column} { +proc ttk::treeview::resize.press {w x y} { variable State set State(pressMode) "resize" - set State(resizeColumn) $column + set State(resizeColumn) [$w identify column $x $y] } proc ttk::treeview::resize.drag {w x} { @@ -226,8 +217,9 @@ proc ttk::treeview::resize.release {w x} { ### Heading activation. # -proc ttk::treeview::heading.press {w column} { +proc ttk::treeview::heading.press {w x y} { variable State + set column [$w identify column $x $y] set State(pressMode) "heading" set State(heading) $column $w heading $column state pressed @@ -235,8 +227,9 @@ proc ttk::treeview::heading.press {w column} { proc ttk::treeview::heading.drag {w x y} { variable State - lassign [$w identify $x $y] what where detail - if {$what eq "heading" && $where eq $State(heading)} { + if { [$w identify region $x $y] eq "heading" + && [$w identify column $x $y] eq $State(heading) + } { $w heading $State(heading) state pressed } else { $w heading $State(heading) state !pressed diff --git a/library/ttk/winTheme.tcl b/library/ttk/winTheme.tcl index 20f45de..03ca6d2 100644 --- a/library/ttk/winTheme.tcl +++ b/library/ttk/winTheme.tcl @@ -1,5 +1,5 @@ # -# $Id: winTheme.tcl,v 1.6 2007/12/13 15:27:08 dgp Exp $ +# $Id: winTheme.tcl,v 1.7 2008/05/23 20:20:06 jenglish Exp $ # # Settings for 'winnative' theme. # @@ -59,15 +59,8 @@ namespace eval ttk::theme::winnative { # Treeview: ttk::style configure Heading -font TkHeadingFont -relief raised - ttk::style configure Row -background SystemWindow - ttk::style configure Cell -background SystemWindow - ttk::style map Row \ - -background [list selected SystemHighlight] \ - -foreground [list selected SystemHighlightText] ; - ttk::style map Cell \ - -background [list selected SystemHighlight] \ - -foreground [list selected SystemHighlightText] ; - ttk::style map Item \ + ttk::style configure Treeview -background SystemWindow + ttk::style map Treeview \ -background [list selected SystemHighlight] \ -foreground [list selected SystemHighlightText] ; diff --git a/library/ttk/xpTheme.tcl b/library/ttk/xpTheme.tcl index d85d415..691dcea 100644 --- a/library/ttk/xpTheme.tcl +++ b/library/ttk/xpTheme.tcl @@ -1,5 +1,5 @@ # -# $Id: xpTheme.tcl,v 1.8 2008/05/15 23:41:08 patthoyts Exp $ +# $Id: xpTheme.tcl,v 1.9 2008/05/23 20:20:06 jenglish Exp $ # # Settings for 'xpnative' theme # @@ -31,15 +31,8 @@ namespace eval ttk::theme::xpnative { # Treeview: ttk::style configure Heading -font TkHeadingFont - ttk::style configure Row -background SystemWindow - ttk::style configure Cell -background SystemWindow - ttk::style map Row \ - -background [list selected SystemHighlight] \ - -foreground [list selected SystemHighlightText] ; - ttk::style map Cell \ - -background [list selected SystemHighlight] \ - -foreground [list selected SystemHighlightText] ; - ttk::style map Item \ + ttk::style configure Treeview -background SystemWindow + ttk::style map Treeview \ -background [list selected SystemHighlight] \ -foreground [list selected SystemHighlightText] ; diff --git a/tests/ttk/treeview.test b/tests/ttk/treeview.test index d2b33a9..2a58444 100644 --- a/tests/ttk/treeview.test +++ b/tests/ttk/treeview.test @@ -1,5 +1,5 @@ # -# $Id: treeview.test,v 1.3 2008/01/06 19:16:12 jenglish Exp $ +# $Id: treeview.test,v 1.4 2008/05/23 20:20:07 jenglish Exp $ # # [7Jun2005] TO CHECK: [$tv see {}] -- shouldn't work (at least, shouldn't do # what it currently does) @@ -245,7 +245,7 @@ test treeview-3.15 "Consecutive duplicate entries in children list" -body { } -result [list x1 x2 x3] test treeview-3.16 "Insert child after self" -body { - .tv move x2 newfirstone 1 + .tv move x2 newfirstone 1 consistencyCheck .tv .tv children newfirstone } -result [list x1 x2 x3] @@ -262,7 +262,6 @@ test treeview-3.18 "Insert last child after end" -body { .tv children newfirstone } -result [list x1 x2 x3] - test treeview-4.1 "opened - initial state" -body { .tv item newnode -open } -result 0 @@ -290,12 +289,12 @@ test treeview-5.3 "Heading" -body { test treeview-5.4 "get cell" -body { set l [list a b c] .tv item newnode -values $l - .tv set newnode 1 + .tv set newnode 1 } -result b test treeview-5.5 "set cell" -body { .tv set newnode 1 XXX - .tv item newnode -values + .tv item newnode -values } -result [list a XXX c] test treeview-5.6 "set illegal cell" -body { @@ -408,11 +407,11 @@ test treeview-7.1 "move" -body { test treeview-7.2 "illegal move" -body { .tv move d d2 end -} -returnCodes 1 -result "Cannot insert d as a descendant of d2" +} -returnCodes 1 -result "Cannot insert d as a descendant of d2" test treeview-7.3 "illegal move has no effect" -body { consistencyCheck .tv - .tv children d + .tv children d } -result [list d3 d1 d2] test treeview-7.4 "Replace children" -body { @@ -474,8 +473,109 @@ test treeview-9.0 "scroll callback - empty tree" -body { set ::scrolldata } -result [list 0 1] -### NEED: tests for focus item, selection +### identify tests: +# +proc identify* {tv comps args} { + foreach {x y} $args { + foreach comp $comps { + lappend result [$tv identify $comp $x $y] + } + } + return $result +} +# get list of column IDs from list of display column ids. +# +proc columnids {tv dcols} { + set result [list] + foreach dcol $dcols { + if {[catch { + lappend result [$tv column $dcol -id] + }]} { + lappend result ERROR + } + } + return $result +} + +test treeview-identify-setup "identify series - setup" -body { + destroy .tv + ttk::setTheme default + ttk::treeview .tv -columns [list A B C] + .tv insert {} end -id branch -text branch -open true + .tv insert branch end -id item1 -text item1 + .tv insert branch end -id item2 -text item2 + .tv insert branch end -id item3 -text item3 + + .tv column #0 -width 50 ;# 0-50 + .tv column A -width 50 ;# 50-100 + .tv column B -width 50 ;# 100-150 + .tv column C -width 50 ;# 150-200 (plus slop for margins) + + wm geometry . {} ; pack .tv ; update +} + +test treeview-identify-1 "identify heading" -body { + .tv configure -show {headings tree} + update idletasks + identify* .tv {region column} 10 10 +} -result [list heading #0] + +test treeview-identify-2 "identify columns" -body { + .tv configure -displaycolumns #all + update idletasks + columnids .tv [identify* .tv column 25 10 75 10 125 10 175 10] +} -result [list {} A B C] + +test treeview-identify-3 "reordered columns" -body { + .tv configure -displaycolumns {B A C} + update idletasks + columnids .tv [identify* .tv column 25 10 75 10 125 10 175 10] +} -result [list {} B A C] + +test treeview-identify-4 "no tree column" -body { + .tv configure -displaycolumns #all -show {headings} + update idletasks + identify* .tv {region column} 25 10 75 10 125 10 175 10 +} -result [list heading #1 heading #2 heading #3 nothing {}] + +# Item height in default theme is 20px +test treeview-identify-5 "vertical scan - no headings" -body { + .tv configure -displaycolumns #all -show {tree} + update idletasks + identify* .tv {region item} 25 10 25 30 25 50 25 70 25 90 +} -result [list tree branch tree item1 tree item2 tree item3 nothing {}] + +test treeview-identify-6 "vertical scan - with headings" -body { + .tv configure -displaycolumns #all -show {tree headings} + update idletasks + identify* .tv {region item} 25 10 25 30 25 50 25 70 25 90 +} -result [list heading {} tree branch tree item1 tree item2 tree item3] + +test treeview-identify-7 "vertical scan - headings, no tree" -body { + .tv configure -displaycolumns #all -show {headings} + update idletasks + identify* .tv {region item} 25 10 25 30 25 50 25 70 25 90 +} -result [list heading {} cell branch cell item1 cell item2 cell item3] + +# In default theme, -indent and -itemheight both 20px +# Disclosure element name is "Treeitem.indicator" +set disclosure "*.indicator" +test treeview-identify-8 "identify element" -body { + .tv configure -show {tree} + .tv insert branch 0 -id branch2 -open true + .tv insert branch2 0 -id branch3 -open true + .tv insert branch3 0 -id leaf3 + update idletasks; + identify* .tv {item element} 10 10 30 30 50 50 +} -match glob -result [list \ + branch $disclosure branch2 $disclosure branch3 $disclosure] + +test treeview-identify-cleanup "identify - cleanup" -body { + destroy .tv +} + +### NEED: tests for focus item, selection ### Misc. tests: -- cgit v0.12 From 52acde6cd7b9c4bf080adb98afcc37c7dcf2baa7 Mon Sep 17 00:00:00 2001 From: das Date: Fri, 23 May 2008 22:18:27 +0000 Subject: fix warning --- generic/ttk/ttkTreeview.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index ffe1351..adf1559 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -1,4 +1,4 @@ -/* $Id: ttkTreeview.c,v 1.25 2008/05/23 20:20:05 jenglish Exp $ +/* $Id: ttkTreeview.c,v 1.26 2008/05/23 22:18:27 das Exp $ * Copyright (c) 2004, Joe English * * ttk::treeview widget implementation. @@ -1137,7 +1137,8 @@ static int ConfigureItem( Ttk_TagSet newTagSet = NULL; if (Tk_SetOptions(interp, (ClientData)item, tv->tree.itemOptionTable, - objc, objv, tv->core.tkwin,&savedOptions,&mask) != TCL_OK) + objc, objv, tv->core.tkwin, &savedOptions, (int*) &mask) + != TCL_OK) { return TCL_ERROR; } -- cgit v0.12 From 24503ec516039a59c4368bdbaff909db6451514c Mon Sep 17 00:00:00 2001 From: patthoyts Date: Tue, 27 May 2008 20:47:15 +0000 Subject: [ttk::style theme use] without an argument now returns the current theme --- ChangeLog | 5 +++++ doc/ttk_style.n | 8 +++++--- generic/ttk/ttkTheme.c | 43 ++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 50 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index d8aefff..6d4c09d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-05-27 Pat Thoyts + + * generic/ttk/ttkTheme.c: [ttk::style theme use] without + * doc/ttk_style.n: an argument now returns the current theme + 2008-05-23 Joe English * doc/ttk_treeview.n, generic/ttk/ttkTreeview.c, diff --git a/doc/ttk_style.n b/doc/ttk_style.n index 0fc1e92..77d1385 100644 --- a/doc/ttk_style.n +++ b/doc/ttk_style.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_style.n,v 1.14 2008/04/09 09:28:05 patthoyts Exp $ +'\" RCS: @(#) $Id: ttk_style.n,v 1.15 2008/05/27 20:47:16 patthoyts Exp $ '\" .so man.macros .TH ttk::style n 8.5 Tk "Tk Themed Widget" @@ -86,8 +86,10 @@ though arbitrary Tcl code may appear. \fBttk::style theme names\fR Returns a list of all known themes. .TP -\fBttk::style theme use\fR \fIthemeName\fR -Sets the current theme to \fIthemeName\fR, and refreshes all widgets. +\fBttk::style theme use\fR ?\fIthemeName\fR? +Without an argument the result is the name of the current theme. +Otherwise this command sets the current theme to \fIthemeName\fR, +and refreshes all widgets. .SH LAYOUTS A \fIlayout\fR specifies a list of elements, each followed by one or more options specifying how to arrange the element. diff --git a/generic/ttk/ttkTheme.c b/generic/ttk/ttkTheme.c index 45049b6..252c082 100644 --- a/generic/ttk/ttkTheme.c +++ b/generic/ttk/ttkTheme.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * $Id: ttkTheme.c,v 1.13 2008/05/23 20:20:05 jenglish Exp $ + * $Id: ttkTheme.c,v 1.14 2008/05/27 20:47:20 patthoyts Exp $ */ #include @@ -1334,6 +1334,39 @@ static int StyleLookupCmd( return TCL_OK; } +static int StyleThemeCurrentCmd( + ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj * const objv[]) +{ + StylePackageData *pkgPtr = (StylePackageData *)clientData; + Tcl_HashSearch search; + Tcl_HashEntry *entryPtr = NULL; + const char *name = NULL; + + if (objc != 3) { + Tcl_WrongNumArgs(interp, 3, objv, ""); + return TCL_ERROR; + } + + entryPtr = Tcl_FirstHashEntry(&pkgPtr->themeTable, &search); + while (entryPtr != NULL) { + Theme *ptr = (Theme *)Tcl_GetHashValue(entryPtr); + if (ptr == pkgPtr->currentTheme) { + name = Tcl_GetHashKey(&pkgPtr->themeTable, entryPtr); + break; + } + entryPtr = Tcl_NextHashEntry(&search); + } + + if (name == NULL) { + Tcl_SetObjResult(interp, + Tcl_NewStringObj("error: failed to get theme name", -1)); + return TCL_ERROR; + } + + Tcl_SetObjResult(interp, Tcl_NewStringObj(name, -1)); + return TCL_OK; +} + /* + style theme create name ?-parent $theme? ?-settings { script }? */ static int StyleThemeCreateCmd( @@ -1572,11 +1605,15 @@ StyleThemeUseCmd( StylePackageData *pkgPtr = clientData; Ttk_Theme theme; - if (objc != 4) { - Tcl_WrongNumArgs(interp, 3, objv, "theme"); + if (objc < 3 || objc > 4) { + Tcl_WrongNumArgs(interp, 3, objv, "?theme?"); return TCL_ERROR; } + if (objc == 3) { + return StyleThemeCurrentCmd(clientData, interp, objc, objv); + } + theme = LookupTheme(interp, pkgPtr, Tcl_GetString(objv[3])); if (!theme) { return TCL_ERROR; -- cgit v0.12 From 7db7ff0842cd86cc40928749f0d878d815104a82 Mon Sep 17 00:00:00 2001 From: das Date: Sun, 1 Jun 2008 00:29:28 +0000 Subject: * macosx/Wish.xcodeproj/project.pbxproj: add new tclOO files; add debug * macosx/README: targets with gcov; update to Xcode 3.1. --- ChangeLog | 6 ++ macosx/README | 4 +- macosx/Wish.xcodeproj/project.pbxproj | 134 ++++++++++++++++++++++++++++++++-- 3 files changed, 135 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6d4c09d..d66ce7a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-06-01 Daniel Steffen + + * macosx/Wish.xcodeproj/project.pbxproj: add new tclOO files; add debug + * macosx/README: targets with gcov; update to + Xcode 3.1. + 2008-05-27 Pat Thoyts * generic/ttk/ttkTheme.c: [ttk::style theme use] without diff --git a/macosx/README b/macosx/README index f695e6c..2f6cd3c 100644 --- a/macosx/README +++ b/macosx/README @@ -1,7 +1,7 @@ Tcl/Tk Mac OS X README ---------------------- -RCS: @(#) $Id: README,v 1.27 2007/12/13 15:27:08 dgp Exp $ +RCS: @(#) $Id: README,v 1.28 2008/06/01 00:29:29 das Exp $ This is the README file for the Mac OS X/Darwin version of Tcl/Tk. @@ -188,7 +188,7 @@ take care to only use the project matching your DevTools and OS version: 'ReleasePPC10.2.8SDK': builds for PowerPC with gcc-3.3 against the 10.2.8 SDK, useful to verify on Tiger that building on Jaguar would succeed. - * Wish.xcodeproj for Xcode 3.0 on 10.5 and later, which has the following + * Wish.xcodeproj for Xcode 3.1 on 10.5 and later, which has the following additional build configuration: 'ReleaseUniversal10.5SDK': same as 'ReleaseUniversal' but builds against the 10.5 SDK on Leopard (with 10.5 deployment target). diff --git a/macosx/Wish.xcodeproj/project.pbxproj b/macosx/Wish.xcodeproj/project.pbxproj index cf60902..9e3a990 100644 --- a/macosx/Wish.xcodeproj/project.pbxproj +++ b/macosx/Wish.xcodeproj/project.pbxproj @@ -3,11 +3,19 @@ archiveVersion = 1; classes = { }; - objectVersion = 42; + objectVersion = 45; objects = { /* Begin PBXBuildFile section */ F9067BCD0BFBA2900074F726 /* tkOldTest.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAFE08F27A39005CB29B /* tkOldTest.c */; }; + F93599B30DF1F75400E04F67 /* tclOO.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B20DF1F75400E04F67 /* tclOO.c */; }; + F93599B70DF1F76100E04F67 /* tclOOBasic.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B60DF1F76100E04F67 /* tclOOBasic.c */; }; + F93599B90DF1F76600E04F67 /* tclOOCall.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B80DF1F76600E04F67 /* tclOOCall.c */; }; + F93599BC0DF1F77000E04F67 /* tclOODefineCmds.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599BB0DF1F77000E04F67 /* tclOODefineCmds.c */; }; + F93599BE0DF1F77400E04F67 /* tclOOInfo.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599BD0DF1F77400E04F67 /* tclOOInfo.c */; }; + F93599C20DF1F78300E04F67 /* tclOOMethod.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C10DF1F78300E04F67 /* tclOOMethod.c */; }; + F93599C40DF1F78800E04F67 /* tclOOStubInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C30DF1F78800E04F67 /* tclOOStubInit.c */; }; + F93599C60DF1F78D00E04F67 /* tclOOStubLib.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C50DF1F78D00E04F67 /* tclOOStubLib.c */; }; F966BDCF08F27A3F005CB29B /* tk3d.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAAC08F27A39005CB29B /* tk3d.c */; }; F966BDD108F27A3F005CB29B /* tkArgv.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAAE08F27A39005CB29B /* tkArgv.c */; }; F966BDD208F27A3F005CB29B /* tkAtom.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAAF08F27A39005CB29B /* tkAtom.c */; }; @@ -601,6 +609,31 @@ F9099B8B0CC67D3E005A9580 /* ttkbut.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ttkbut.tcl; sourceTree = ""; }; F91E62260C1AE686006C9D96 /* Tclsh-Info.plist.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "Tclsh-Info.plist.in"; sourceTree = ""; }; F92240290D7C620F005EC715 /* knightstour.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = knightstour.tcl; sourceTree = ""; }; + F92D7F100DE777240033A13A /* tsdPerf.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tsdPerf.tcl; sourceTree = ""; }; + F92D7F140DE777670033A13A /* tsdPerf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tsdPerf.c; sourceTree = ""; }; + F93599B20DF1F75400E04F67 /* tclOO.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOO.c; sourceTree = ""; }; + F93599B40DF1F75900E04F67 /* tclOO.decls */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tclOO.decls; sourceTree = ""; }; + F93599B50DF1F75D00E04F67 /* tclOO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclOO.h; sourceTree = ""; }; + F93599B60DF1F76100E04F67 /* tclOOBasic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOBasic.c; sourceTree = ""; }; + F93599B80DF1F76600E04F67 /* tclOOCall.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOCall.c; sourceTree = ""; }; + F93599BA0DF1F76A00E04F67 /* tclOODecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclOODecls.h; sourceTree = ""; }; + F93599BB0DF1F77000E04F67 /* tclOODefineCmds.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOODefineCmds.c; sourceTree = ""; }; + F93599BD0DF1F77400E04F67 /* tclOOInfo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOInfo.c; sourceTree = ""; }; + F93599BF0DF1F77900E04F67 /* tclOOInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclOOInt.h; sourceTree = ""; }; + F93599C00DF1F77D00E04F67 /* tclOOIntDecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclOOIntDecls.h; sourceTree = ""; }; + F93599C10DF1F78300E04F67 /* tclOOMethod.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOMethod.c; sourceTree = ""; }; + F93599C30DF1F78800E04F67 /* tclOOStubInit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOStubInit.c; sourceTree = ""; }; + F93599C50DF1F78D00E04F67 /* tclOOStubLib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOStubLib.c; sourceTree = ""; }; + F93599C80DF1F81900E04F67 /* oo.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = oo.test; sourceTree = ""; }; + F93599CF0DF1F87F00E04F67 /* Class.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Class.3; sourceTree = ""; }; + F93599D00DF1F89E00E04F67 /* class.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = class.n; sourceTree = ""; }; + F93599D20DF1F8DF00E04F67 /* copy.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = copy.n; sourceTree = ""; }; + F93599D30DF1F8F500E04F67 /* define.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = define.n; sourceTree = ""; }; + F93599D40DF1F91900E04F67 /* Method.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Method.3; sourceTree = ""; }; + F93599D50DF1F93700E04F67 /* my.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = my.n; sourceTree = ""; }; + F93599D60DF1F95000E04F67 /* next.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = next.n; sourceTree = ""; }; + F93599D70DF1F96800E04F67 /* object.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = object.n; sourceTree = ""; }; + F93599D80DF1F98300E04F67 /* self.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = self.n; sourceTree = ""; }; F936FCD70CCD984500716967 /* ttkprogress.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ttkprogress.tcl; sourceTree = ""; }; F936FCD80CCD984600716967 /* tree.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tree.tcl; sourceTree = ""; }; F936FCD90CCD984600716967 /* toolbar.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = toolbar.tcl; sourceTree = ""; }; @@ -2097,7 +2130,7 @@ F966C06F08F281DC005CB29B /* Frameworks */, 1AB674ADFE9D54B511CA2CBB /* Products */, ); - comments = "Copyright (c) 2004-2008 Daniel A. Steffen \n\nSee the file \"license.terms\" for information on usage and redistribution of\nthis file, and for a DISCLAIMER OF ALL WARRANTIES.\n\nRCS: @(#) $Id: project.pbxproj,v 1.39 2008/04/25 21:28:41 das Exp $\n"; + comments = "Copyright (c) 2004-2008 Daniel A. Steffen \n\nSee the file \"license.terms\" for information on usage and redistribution of\nthis file, and for a DISCLAIMER OF ALL WARRANTIES.\n\nRCS: @(#) $Id: project.pbxproj,v 1.40 2008/06/01 00:29:29 das Exp $\n"; name = Wish; path = .; sourceTree = SOURCE_ROOT; @@ -3024,12 +3057,15 @@ F96D3E1108F272A5004A47F5 /* cd.n */, F96D3E1208F272A5004A47F5 /* chan.n */, F96D3E1308F272A5004A47F5 /* ChnlStack.3 */, + F93599CF0DF1F87F00E04F67 /* Class.3 */, + F93599D00DF1F89E00E04F67 /* class.n */, F96D3E1408F272A5004A47F5 /* clock.n */, F96D3E1508F272A5004A47F5 /* close.n */, F96D3E1608F272A5004A47F5 /* CmdCmplt.3 */, F96D3E1708F272A5004A47F5 /* Concat.3 */, F96D3E1808F272A5004A47F5 /* concat.n */, F96D3E1908F272A5004A47F5 /* continue.n */, + F93599D20DF1F8DF00E04F67 /* copy.n */, F96D3E1A08F272A5004A47F5 /* CrtChannel.3 */, F96D3E1B08F272A5004A47F5 /* CrtChnlHdlr.3 */, F96D3E1C08F272A5004A47F5 /* CrtCloseHdlr.3 */, @@ -3042,6 +3078,7 @@ F96D3E2308F272A5004A47F5 /* CrtTimerHdlr.3 */, F96D3E2408F272A5004A47F5 /* CrtTrace.3 */, F96D3E2508F272A5004A47F5 /* dde.n */, + F93599D30DF1F8F500E04F67 /* define.n */, F96D3E2608F272A5004A47F5 /* DetachPids.3 */, F96D3E2708F272A5004A47F5 /* dict.n */, F96D3E2808F272A5004A47F5 /* DictObj.3 */, @@ -3119,11 +3156,15 @@ F96D3E7008F272A6004A47F5 /* man.macros */, F96D3E7108F272A6004A47F5 /* mathfunc.n */, F96D3E7208F272A6004A47F5 /* memory.n */, + F93599D40DF1F91900E04F67 /* Method.3 */, F96D3E7308F272A6004A47F5 /* msgcat.n */, + F93599D50DF1F93700E04F67 /* my.n */, F96D3E7408F272A6004A47F5 /* Namespace.3 */, F96D3E7508F272A6004A47F5 /* namespace.n */, + F93599D60DF1F95000E04F67 /* next.n */, F96D3E7608F272A6004A47F5 /* Notifier.3 */, F96D3E7708F272A6004A47F5 /* Object.3 */, + F93599D70DF1F96800E04F67 /* object.n */, F96D3E7808F272A6004A47F5 /* ObjectType.3 */, F96D3E7908F272A6004A47F5 /* open.n */, F96D3E7A08F272A6004A47F5 /* OpenFileChnl.3 */, @@ -3157,6 +3198,7 @@ F96D3E9408F272A6004A47F5 /* SaveResult.3 */, F96D3E9508F272A6004A47F5 /* scan.n */, F96D3E9608F272A6004A47F5 /* seek.n */, + F93599D80DF1F98300E04F67 /* self.n */, F96D3E9708F272A6004A47F5 /* set.n */, F96D3E9808F272A6004A47F5 /* SetChanErr.3 */, F96D3E9908F272A6004A47F5 /* SetErrno.3 */, @@ -3283,6 +3325,19 @@ F96D3F0B08F272A7004A47F5 /* tclNamesp.c */, F96D3F0C08F272A7004A47F5 /* tclNotify.c */, F96D3F0D08F272A7004A47F5 /* tclObj.c */, + F93599B20DF1F75400E04F67 /* tclOO.c */, + F93599B40DF1F75900E04F67 /* tclOO.decls */, + F93599B50DF1F75D00E04F67 /* tclOO.h */, + F93599B60DF1F76100E04F67 /* tclOOBasic.c */, + F93599B80DF1F76600E04F67 /* tclOOCall.c */, + F93599BA0DF1F76A00E04F67 /* tclOODecls.h */, + F93599BB0DF1F77000E04F67 /* tclOODefineCmds.c */, + F93599BD0DF1F77400E04F67 /* tclOOInfo.c */, + F93599BF0DF1F77900E04F67 /* tclOOInt.h */, + F93599C00DF1F77D00E04F67 /* tclOOIntDecls.h */, + F93599C10DF1F78300E04F67 /* tclOOMethod.c */, + F93599C30DF1F78800E04F67 /* tclOOStubInit.c */, + F93599C50DF1F78D00E04F67 /* tclOOStubLib.c */, F96D3F0E08F272A7004A47F5 /* tclPanic.c */, F96D3F0F08F272A7004A47F5 /* tclParse.c */, F96D3F1108F272A7004A47F5 /* tclPathObj.c */, @@ -3645,6 +3700,7 @@ F96D439208F272B7004A47F5 /* namespace.test */, F96D439308F272B7004A47F5 /* notify.test */, F96D439408F272B7004A47F5 /* obj.test */, + F93599C80DF1F81900E04F67 /* oo.test */, F96D439508F272B7004A47F5 /* opt.test */, F96D439608F272B7004A47F5 /* package.test */, F96D439708F272B7004A47F5 /* parse.test */, @@ -3736,6 +3792,8 @@ F96D443708F272B9004A47F5 /* tclmin.wse */, F96D443908F272B9004A47F5 /* tcltk-man2html.tcl */, F96D443A08F272B9004A47F5 /* tclZIC.tcl */, + F92D7F140DE777670033A13A /* tsdPerf.c */, + F92D7F100DE777240033A13A /* tsdPerf.tcl */, F96D443B08F272B9004A47F5 /* uniClass.tcl */, F96D443C08F272B9004A47F5 /* uniParse.tcl */, ); @@ -3925,7 +3983,7 @@ BuildIndependentTargetsInParallel = NO; }; buildConfigurationList = F95CC8B509158F3100EA5ACE /* Build configuration list for PBXProject "Wish" */; - compatibilityVersion = "Xcode 2.4"; + compatibilityVersion = "Xcode 3.1"; hasScannedForEncodings = 1; mainGroup = 08FB7794FE84155DC02AAC07 /* Wish */; projectDirPath = ""; @@ -4121,6 +4179,14 @@ F96D45AA08F272BC004A47F5 /* tclNamesp.c in Sources */, F96D45AB08F272BC004A47F5 /* tclNotify.c in Sources */, F96D45AC08F272BC004A47F5 /* tclObj.c in Sources */, + F93599B30DF1F75400E04F67 /* tclOO.c in Sources */, + F93599B70DF1F76100E04F67 /* tclOOBasic.c in Sources */, + F93599B90DF1F76600E04F67 /* tclOOCall.c in Sources */, + F93599BC0DF1F77000E04F67 /* tclOODefineCmds.c in Sources */, + F93599BE0DF1F77400E04F67 /* tclOOInfo.c in Sources */, + F93599C20DF1F78300E04F67 /* tclOOMethod.c in Sources */, + F93599C40DF1F78800E04F67 /* tclOOStubInit.c in Sources */, + F93599C60DF1F78D00E04F67 /* tclOOStubLib.c in Sources */, F96D45AD08F272BC004A47F5 /* tclPanic.c in Sources */, F96D45AE08F272BC004A47F5 /* tclParse.c in Sources */, F96D45B008F272BC004A47F5 /* tclPathObj.c in Sources */, @@ -4724,6 +4790,56 @@ }; name = DebugMemCompile; }; + F9359B250DF212DA00E04F67 /* DebugGCov */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Wish-Debug.xcconfig */; + buildSettings = { + GCC_GENERATE_TEST_COVERAGE_FILES = YES; + GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES; + MACOSX_DEPLOYMENT_TARGET = 10.5; + OTHER_LDFLAGS = ( + "$(OTHER_LDFLAGS)", + "-lgcov", + ); + PREBINDING = NO; + }; + name = DebugGCov; + }; + F9359B260DF212DA00E04F67 /* DebugGCov */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = Wish; + SKIP_INSTALL = NO; + }; + name = DebugGCov; + }; + F9359B270DF212DA00E04F67 /* DebugGCov */ = { + isa = XCBuildConfiguration; + buildSettings = { + OTHER_LDFLAGS = ( + "$(OTHER_LDFLAGS_AQUA)", + "$(OTHER_LDFLAGS)", + ); + PRODUCT_NAME = tktest; + }; + name = DebugGCov; + }; + F9359C120DF21B7800E04F67 /* DebugGCov */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + /usr/X11R6/include, + /usr/X11R6/include/freetype2, + "$(HEADER_SEARCH_PATHS)", + ); + LIBRARY_SEARCH_PATHS = ( + /usr/X11R6/lib, + "$(LIBRARY_SEARCH_PATHS)", + ); + PRODUCT_NAME = "tktest-X11"; + }; + name = DebugGCov; + }; F95CC8AC09158F3100EA5ACE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -5148,7 +5264,7 @@ CPPFLAGS = "-isysroot $(SDKROOT) $(CPPFLAGS)"; MACOSX_DEPLOYMENT_TARGET = 10.4; PREBINDING = NO; - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + SDKROOT = macosx10.4; }; name = ReleaseUniversal10.4uSDK; }; @@ -5181,7 +5297,7 @@ CPPFLAGS = "-arch ppc -isysroot $(SDKROOT) $(CPPFLAGS)"; MACOSX_DEPLOYMENT_TARGET = 10.3; PREBINDING = YES; - SDKROOT = /Developer/SDKs/MacOSX10.3.9.sdk; + SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.3.9.sdk"; }; name = ReleasePPC10.3.9SDK; }; @@ -5217,7 +5333,7 @@ LDFLAGS = "-L$(SDKROOT)/usr/lib/gcc/darwin/$(GCC_VERSION) -Wl,-syslibroot,$(SDKROOT)"; MACOSX_DEPLOYMENT_TARGET = 10.2; PREBINDING = YES; - SDKROOT = /Developer/SDKs/MacOSX10.2.8.sdk; + SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.2.8.sdk"; WARNING_CFLAGS = ( "$(WARNING_CFLAGS_GCC3)", "-Wno-long-double", @@ -5256,7 +5372,7 @@ CPPFLAGS = "-isysroot $(SDKROOT) $(CPPFLAGS)"; MACOSX_DEPLOYMENT_TARGET = 10.5; PREBINDING = NO; - SDKROOT = /Developer/SDKs/MacOSX10.5.sdk; + SDKROOT = macosx10.5; }; name = ReleaseUniversal10.5SDK; }; @@ -5472,6 +5588,7 @@ F99EE73B0BE835310060D4AF /* DebugUnthreaded */, F93084370BB93D2800CD0B9E /* DebugMemCompile */, F99EE73C0BE835310060D4AF /* DebugLeaks */, + F9359B260DF212DA00E04F67 /* DebugGCov */, F95CC8AD09158F3100EA5ACE /* Release */, F91BCC4F093152310042A6BF /* ReleaseUniversal */, F9988BB20D81586D00B6B03B /* ReleaseUniversal gcc42 */, @@ -5494,6 +5611,7 @@ F99EE73D0BE835310060D4AF /* DebugUnthreaded */, F93084380BB93D2800CD0B9E /* DebugMemCompile */, F99EE73E0BE835310060D4AF /* DebugLeaks */, + F9359B270DF212DA00E04F67 /* DebugGCov */, F95CC8B209158F3100EA5ACE /* Release */, F91BCC50093152310042A6BF /* ReleaseUniversal */, F9988BB30D81586D00B6B03B /* ReleaseUniversal gcc42 */, @@ -5516,6 +5634,7 @@ F99EE7410BE835310060D4AF /* DebugUnthreaded */, F930843A0BB93D2800CD0B9E /* DebugMemCompile */, F99EE7420BE835310060D4AF /* DebugLeaks */, + F9359B250DF212DA00E04F67 /* DebugGCov */, F95CC8B709158F3100EA5ACE /* Release */, F91BCC51093152310042A6BF /* ReleaseUniversal */, F9988BB10D81586D00B6B03B /* ReleaseUniversal gcc42 */, @@ -5538,6 +5657,7 @@ F9FD31EB0CC1AD070073837D /* DebugUnthreaded */, F9FD31EC0CC1AD070073837D /* DebugMemCompile */, F9FD31ED0CC1AD070073837D /* DebugLeaks */, + F9359C120DF21B7800E04F67 /* DebugGCov */, F9FD31EE0CC1AD070073837D /* Release */, F9FD31EF0CC1AD070073837D /* ReleaseUniversal */, F98A2A2B0D85F1E7002A40A7 /* ReleaseUniversal gcc42 */, -- cgit v0.12 From f6de8ee60675113f57b79c13d986ade81c0693ad Mon Sep 17 00:00:00 2001 From: jenglish Date: Sun, 1 Jun 2008 08:28:18 +0000 Subject: NSC --- generic/ttk/ttkTreeview.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index adf1559..00280cf 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -1,4 +1,4 @@ -/* $Id: ttkTreeview.c,v 1.26 2008/05/23 22:18:27 das Exp $ +/* $Id: ttkTreeview.c,v 1.27 2008/06/01 08:28:18 jenglish Exp $ * Copyright (c) 2004, Joe English * * ttk::treeview widget implementation. @@ -1132,12 +1132,12 @@ static int ConfigureItem( int objc, Tcl_Obj *const objv[]) { Tk_SavedOptions savedOptions; - unsigned mask; + int mask; Ttk_ImageSpec *newImageSpec = NULL; Ttk_TagSet newTagSet = NULL; if (Tk_SetOptions(interp, (ClientData)item, tv->tree.itemOptionTable, - objc, objv, tv->core.tkwin, &savedOptions, (int*) &mask) + objc, objv, tv->core.tkwin, &savedOptions, &mask) != TCL_OK) { return TCL_ERROR; -- cgit v0.12 From 98f358e1fe6ead680a224cd89f9a51bfb9474c16 Mon Sep 17 00:00:00 2001 From: jenglish Date: Wed, 11 Jun 2008 00:41:43 +0000 Subject: Use Xutf8LookupString where available [Patch #1986818]. This should fix problems (like #1908443) where Xlib's idea of the system encoding does not match Tcl's. --- ChangeLog | 6 ++++ unix/tkUnixKey.c | 103 +++++++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 95 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index d66ce7a..ae0e15e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-06-10 Joe English + + * unix/tkUnixKey.c: tkUnixKey.c: Use Xutf8LookupString if available + [Patch #1986818]. This should fix problems (like #1908443) where + Xlib's idea of the system encoding does not match Tcl's. + 2008-06-01 Daniel Steffen * macosx/Wish.xcodeproj/project.pbxproj: add new tclOO files; add debug diff --git a/unix/tkUnixKey.c b/unix/tkUnixKey.c index 4d422cf..a800d73 100644 --- a/unix/tkUnixKey.c +++ b/unix/tkUnixKey.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixKey.c,v 1.13 2008/03/26 19:04:10 jenglish Exp $ + * RCS: @(#) $Id: tkUnixKey.c,v 1.14 2008/06/11 00:41:43 jenglish Exp $ */ #include "tkInt.h" @@ -78,6 +78,48 @@ Tk_SetCaretPos( /* *---------------------------------------------------------------------- * + * TkpGetChar -- + * + * Convert a keyboard event to a UTF-8 string using XLookupString. + * + * This is used as a fallback instead of Xutf8LookupString + * or XmbLookupString if input methods are turned off + * and for KeyRelease events. + * + * Notes: + * XLookupString() normally returns a single ISO Latin 1 + * or ASCII control character. + * + *---------------------------------------------------------------------- + */ +static char * +TkpGetChar( + XEvent *eventPtr, /* KeyPress or KeyRelease event */ + Tcl_DString *dsPtr) /* Initialized, empty string to hold result. */ +{ + int len; + char buf[TCL_DSTRING_STATIC_SIZE]; + + len = XLookupString(&eventPtr->xkey, buf, TCL_DSTRING_STATIC_SIZE, 0, 0); + buf[len] = '\0'; + + if (len == 1) { + len = Tcl_UniCharToUtf((unsigned char)buf[0], Tcl_DStringValue(dsPtr)); + Tcl_DStringSetLength(dsPtr, len); + } else { + /* + * len > 1 should only happen if someone has called XRebindKeysym(). + * Assume UTF-8. + */ + Tcl_DStringSetLength(dsPtr, len); + strncpy(Tcl_DStringValue(dsPtr), buf, len); + } + return Tcl_DStringValue(dsPtr); +} + +/* + *---------------------------------------------------------------------- + * * TkpGetString -- * * Retrieve the UTF string associated with a keyboard event. @@ -95,11 +137,42 @@ Tk_SetCaretPos( char * TkpGetString( - TkWindow *winPtr, /* Window where event occurred: needed to get - * input context. */ + TkWindow *winPtr, /* Window where event occurred */ XEvent *eventPtr, /* X keyboard event. */ - Tcl_DString *dsPtr) /* Uninitialized or empty string to hold - * result. */ + Tcl_DString *dsPtr) /* Initialized, empty string to hold result. */ +#ifdef TK_USE_INPUT_METHODS +#if X_HAVE_UTF8_STRING +{ + if ((winPtr->dispPtr->flags & TK_DISPLAY_USE_IM) + && (winPtr->inputContext != NULL) + && (eventPtr->type == KeyPress)) + { + int len; + Status status; + + Tcl_DStringSetLength(dsPtr, TCL_DSTRING_STATIC_SIZE-1); + len = Xutf8LookupString(winPtr->inputContext, &eventPtr->xkey, + Tcl_DStringValue(dsPtr), Tcl_DStringLength(dsPtr), + NULL, &status); + + if (status == XBufferOverflow) { /* Expand buffer and try again */ + Tcl_DStringSetLength(dsPtr, len); + len = Xutf8LookupString(winPtr->inputContext, &eventPtr->xkey, + Tcl_DStringValue(dsPtr), Tcl_DStringLength(dsPtr), + NULL, &status); + } + if ((status != XLookupChars) && (status != XLookupBoth)) { + Tcl_DStringSetLength(dsPtr, 0); + len = 0; + } + Tcl_DStringSetLength(dsPtr, len); + + return Tcl_DStringValue(dsPtr); + } else { + return TkpGetChar(eventPtr, dsPtr); + } +} +#else /* !X_HAVE_UTF8_STRING */ { int len; Tcl_DString buf; @@ -112,7 +185,6 @@ TkpGetString( Tcl_DStringInit(&buf); Tcl_DStringSetLength(&buf, TCL_DSTRING_STATIC_SIZE-1); -#ifdef TK_USE_INPUT_METHODS if ((winPtr->dispPtr->flags & TK_DISPLAY_USE_IM) && (winPtr->inputContext != NULL) && (eventPtr->type == KeyPress)) { @@ -120,6 +192,7 @@ TkpGetString( len = XmbLookupString(winPtr->inputContext, &eventPtr->xkey, Tcl_DStringValue(&buf), Tcl_DStringLength(&buf), NULL, &status); + /* * If the buffer wasn't big enough, grow the buffer and try again. */ @@ -132,22 +205,24 @@ TkpGetString( if ((status != XLookupChars) && (status != XLookupBoth)) { len = 0; } - } else { - len = XLookupString(&eventPtr->xkey, Tcl_DStringValue(&buf), - Tcl_DStringLength(&buf), NULL, NULL); + return TkpGetChar(eventPtr, dsPtr); } -#else /* TK_USE_INPUT_METHODS */ - len = XLookupString(&eventPtr->xkey, Tcl_DStringValue(&buf), - Tcl_DStringLength(&buf), NULL, NULL); -#endif /* TK_USE_INPUT_METHODS */ - Tcl_DStringSetLength(&buf, len); + Tcl_DStringSetLength(&buf, len); Tcl_ExternalToUtfDString(NULL, Tcl_DStringValue(&buf), len, dsPtr); Tcl_DStringFree(&buf); return Tcl_DStringValue(dsPtr); } + +#endif /* X_HAVE_UTF8_STRING */ +#else /* !TK_USE_INPUT_METHODS */ +{ + return TkpGetChar(eventPtr, dsPtr); +} +#endif + /* * When mapping from a keysym to a keycode, need information about the -- cgit v0.12 From b67427f70538c6e0ecff16796635b93df88bde64 Mon Sep 17 00:00:00 2001 From: das Date: Thu, 12 Jun 2008 06:30:22 +0000 Subject: * generic/ttk/ttkTreeview.c: fix warning. --- generic/ttk/ttkTreeview.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index 00280cf..e9ac22a 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -1,4 +1,4 @@ -/* $Id: ttkTreeview.c,v 1.27 2008/06/01 08:28:18 jenglish Exp $ +/* $Id: ttkTreeview.c,v 1.28 2008/06/12 06:30:22 das Exp $ * Copyright (c) 2004, Joe English * * ttk::treeview widget implementation. @@ -1510,8 +1510,9 @@ static const char *regionStrings[] = { static TreeRegion IdentifyRegion(Treeview *tv, int x, int y) { - int x1, colno = IdentifyDisplayColumn(tv, x, &x1); - + int x1 = 0, colno; + + colno = IdentifyDisplayColumn(tv, x, &x1); if (Ttk_BoxContains(tv->tree.headingArea, x, y)) { if (colno < 0) { return REGION_NOTHING; -- cgit v0.12 From b17d28a84cdeb21ba9166f0fe62174e3b62d1667 Mon Sep 17 00:00:00 2001 From: das Date: Thu, 12 Jun 2008 06:31:10 +0000 Subject: * macosx/Wish.xcodeproj/project.pbxproj: add tclIORTrans.c; add tclOO * macosx/Wish.xcodeproj/default.pbxuser: files to tktest-X11 target; add debug targets for 64bit and with corefoundation disabled; updates and cleanup for Xcode 3.1 and for Leopard; sync with Tcl.xcodeproj. * macosx/Wish.xcode/project.pbxproj: sync Wish.xcodeproj changes. * macosx/Wish.xcode/default.pbxuser: * macosx/README: document new build configs. --- macosx/README | 30 +- macosx/Wish.xcode/default.pbxuser | 2 +- macosx/Wish.xcode/project.pbxproj | 648 ++++++++++++++++++++---------- macosx/Wish.xcodeproj/default.pbxuser | 2 +- macosx/Wish.xcodeproj/project.pbxproj | 726 ++++++++++++++++++++-------------- 5 files changed, 905 insertions(+), 503 deletions(-) diff --git a/macosx/README b/macosx/README index 2f6cd3c..7d27b56 100644 --- a/macosx/README +++ b/macosx/README @@ -1,7 +1,7 @@ Tcl/Tk Mac OS X README ---------------------- -RCS: @(#) $Id: README,v 1.28 2008/06/01 00:29:29 das Exp $ +RCS: @(#) $Id: README,v 1.29 2008/06/12 06:31:10 das Exp $ This is the README file for the Mac OS X/Darwin version of Tcl/Tk. @@ -170,14 +170,19 @@ take care to only use the project matching your DevTools and OS version: 'Tk' target that simply calls through to the tcl/macosx/GNUMakefile. It requires a build of the 'Tcl' target of tcl/macosx/Tcl.pbproj. * Wish.xcode Xcode 2.4 on 10.4 and Xcode 2.5 on 10.4 and later, which - additionally has a native 'tktest' target useful for debugging, this - target's 'Debug' build configuration has ZeroLink and Fix&Continue - enabled, use the 'DebugNoFixZL' build configuration if you need a debug - build without these features. The following additional build - configurations are available for the 'Tk' and 'tktest' targets: + additionally has native 'tktest' and 'tktest-X11' targets for + debugging, these targets' 'Debug' build configuration has ZeroLink and + Fix&Continue enabled, use the 'DebugNoFixZL' build configuration if you + need a debug build without these features. The following build + configurations are available: 'DebugUnthreaded': debug build with threading turned off. + 'DebugNoCF': debug build with corefoundation turned off + (for 'tktest-X11' only). + 'DebugNoCFUnthreaded': debug build with corefoundation turned off + (for 'tktest-X11' only) and with threading turned off. 'DebugMemCompile': debug build with memory and bytecode debugging on. 'DebugLeaks': debug build with PURIFY defined. + 'DebugGCov': debug build with generation of gcov data files enabled. 'ReleaseUniversal': builds the targets as universal binaries for the ppc and i386 architectures. 'ReleaseUniversal10.4uSDK': same as 'ReleaseUniversal' but builds @@ -189,9 +194,20 @@ take care to only use the project matching your DevTools and OS version: 10.2.8 SDK, useful to verify on Tiger that building on Jaguar would succeed. * Wish.xcodeproj for Xcode 3.1 on 10.5 and later, which has the following - additional build configuration: + additional build configurations: 'ReleaseUniversal10.5SDK': same as 'ReleaseUniversal' but builds against the 10.5 SDK on Leopard (with 10.5 deployment target). + 'Debug gcc42': same as 'Debug' but builds with gcc 4.2. + 'Debug llvmgcc42': same as 'Debug' but builds with llvm-gcc 4.2. + 'ReleaseUniversal gcc42': same as 'ReleaseUniversal' but builds with + gcc 4.2. + 'ReleaseUniversal llvmgcc42': same as 'ReleaseUniversal' but builds + with llvm-gcc 4.2. + 'Debug64bit': builds the 'tktest-X11' target as 64bit with debugging + enabled (requires a 64bit capable processor). + Note that all non-SDK configurations have 10.5 deployment target and + that all Universal configurations build the 'tktest-X11' target + also for the ppc64 and x86_64 architectures. Notes about the native targets of the Xcode projects: * the Xcode projects refer to the toplevel tcl and tk source dirs through diff --git a/macosx/Wish.xcode/default.pbxuser b/macosx/Wish.xcode/default.pbxuser index 2972778..c832f6b 100644 --- a/macosx/Wish.xcode/default.pbxuser +++ b/macosx/Wish.xcode/default.pbxuser @@ -214,7 +214,7 @@ sourceDirectories = ( ); }; - F9FD30B30CC1AD070073837D /* tktest-X11 */ = { + F97258A50A86873C00096C78 /* tktest-X11 */ = { activeExec = 0; executables = ( F9FD31F50CC1AD070073837D /* tktest-X11 */, diff --git a/macosx/Wish.xcode/project.pbxproj b/macosx/Wish.xcode/project.pbxproj index 71045b7..d3001f5 100644 --- a/macosx/Wish.xcode/project.pbxproj +++ b/macosx/Wish.xcode/project.pbxproj @@ -8,6 +8,15 @@ /* Begin PBXBuildFile section */ F9067BCD0BFBA2900074F726 /* tkOldTest.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAFE08F27A39005CB29B /* tkOldTest.c */; }; + F93599B30DF1F75400E04F67 /* tclOO.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B20DF1F75400E04F67 /* tclOO.c */; }; + F93599B70DF1F76100E04F67 /* tclOOBasic.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B60DF1F76100E04F67 /* tclOOBasic.c */; }; + F93599B90DF1F76600E04F67 /* tclOOCall.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B80DF1F76600E04F67 /* tclOOCall.c */; }; + F93599BC0DF1F77000E04F67 /* tclOODefineCmds.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599BB0DF1F77000E04F67 /* tclOODefineCmds.c */; }; + F93599BE0DF1F77400E04F67 /* tclOOInfo.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599BD0DF1F77400E04F67 /* tclOOInfo.c */; }; + F93599C20DF1F78300E04F67 /* tclOOMethod.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C10DF1F78300E04F67 /* tclOOMethod.c */; }; + F93599C40DF1F78800E04F67 /* tclOOStubInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C30DF1F78800E04F67 /* tclOOStubInit.c */; }; + F93599C60DF1F78D00E04F67 /* tclOOStubLib.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C50DF1F78D00E04F67 /* tclOOStubLib.c */; }; + F95D77EA0DFD820D00A8BF6F /* tclIORTrans.c in Sources */ = {isa = PBXBuildFile; fileRef = F95D77E90DFD820D00A8BF6F /* tclIORTrans.c */; }; F966BDCF08F27A3F005CB29B /* tk3d.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAAC08F27A39005CB29B /* tk3d.c */; }; F966BDD108F27A3F005CB29B /* tkArgv.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAAE08F27A39005CB29B /* tkArgv.c */; }; F966BDD208F27A3F005CB29B /* tkAtom.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAAF08F27A39005CB29B /* tkAtom.c */; }; @@ -591,6 +600,15 @@ F9FD349B0CC1BB0D0073837D /* libfreetype.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F9FD34990CC1BB0D0073837D /* libfreetype.dylib */; }; F9FD349C0CC1BB0D0073837D /* libXft.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F9FD349A0CC1BB0D0073837D /* libXft.dylib */; }; F9FD34C40CC1BBD70073837D /* libfontconfig.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F9FD34C30CC1BBD70073837D /* libfontconfig.dylib */; }; + F9FFAF1D0DFDDB26007F8A6A /* tclIORTrans.c in Sources */ = {isa = PBXBuildFile; fileRef = F95D77E90DFD820D00A8BF6F /* tclIORTrans.c */; }; + F9FFAF1F0DFDDB2F007F8A6A /* tclOO.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B20DF1F75400E04F67 /* tclOO.c */; }; + F9FFAF200DFDDB32007F8A6A /* tclOOBasic.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B60DF1F76100E04F67 /* tclOOBasic.c */; }; + F9FFAF210DFDDB32007F8A6A /* tclOOCall.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B80DF1F76600E04F67 /* tclOOCall.c */; }; + F9FFAF220DFDDB34007F8A6A /* tclOODefineCmds.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599BB0DF1F77000E04F67 /* tclOODefineCmds.c */; }; + F9FFAF230DFDDB35007F8A6A /* tclOOInfo.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599BD0DF1F77400E04F67 /* tclOOInfo.c */; }; + F9FFAF240DFDDB36007F8A6A /* tclOOMethod.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C10DF1F78300E04F67 /* tclOOMethod.c */; }; + F9FFAF250DFDDB37007F8A6A /* tclOOStubInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C30DF1F78800E04F67 /* tclOOStubInit.c */; }; + F9FFAF260DFDDB38007F8A6A /* tclOOStubLib.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C50DF1F78D00E04F67 /* tclOOStubLib.c */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -599,12 +617,38 @@ F9099B8B0CC67D3E005A9580 /* ttkbut.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ttkbut.tcl; sourceTree = ""; }; F91E62260C1AE686006C9D96 /* Tclsh-Info.plist.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "Tclsh-Info.plist.in"; sourceTree = ""; }; F92240290D7C620F005EC715 /* knightstour.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = knightstour.tcl; sourceTree = ""; }; + F92D7F100DE777240033A13A /* tsdPerf.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tsdPerf.tcl; sourceTree = ""; }; + F92D7F140DE777670033A13A /* tsdPerf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tsdPerf.c; sourceTree = ""; }; + F93599B20DF1F75400E04F67 /* tclOO.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOO.c; sourceTree = ""; }; + F93599B40DF1F75900E04F67 /* tclOO.decls */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tclOO.decls; sourceTree = ""; }; + F93599B50DF1F75D00E04F67 /* tclOO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclOO.h; sourceTree = ""; }; + F93599B60DF1F76100E04F67 /* tclOOBasic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOBasic.c; sourceTree = ""; }; + F93599B80DF1F76600E04F67 /* tclOOCall.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOCall.c; sourceTree = ""; }; + F93599BA0DF1F76A00E04F67 /* tclOODecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclOODecls.h; sourceTree = ""; }; + F93599BB0DF1F77000E04F67 /* tclOODefineCmds.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOODefineCmds.c; sourceTree = ""; }; + F93599BD0DF1F77400E04F67 /* tclOOInfo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOInfo.c; sourceTree = ""; }; + F93599BF0DF1F77900E04F67 /* tclOOInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclOOInt.h; sourceTree = ""; }; + F93599C00DF1F77D00E04F67 /* tclOOIntDecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclOOIntDecls.h; sourceTree = ""; }; + F93599C10DF1F78300E04F67 /* tclOOMethod.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOMethod.c; sourceTree = ""; }; + F93599C30DF1F78800E04F67 /* tclOOStubInit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOStubInit.c; sourceTree = ""; }; + F93599C50DF1F78D00E04F67 /* tclOOStubLib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclOOStubLib.c; sourceTree = ""; }; + F93599C80DF1F81900E04F67 /* oo.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = oo.test; sourceTree = ""; }; + F93599CF0DF1F87F00E04F67 /* Class.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Class.3; sourceTree = ""; }; + F93599D00DF1F89E00E04F67 /* class.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = class.n; sourceTree = ""; }; + F93599D20DF1F8DF00E04F67 /* copy.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = copy.n; sourceTree = ""; }; + F93599D30DF1F8F500E04F67 /* define.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = define.n; sourceTree = ""; }; + F93599D40DF1F91900E04F67 /* Method.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = Method.3; sourceTree = ""; }; + F93599D50DF1F93700E04F67 /* my.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = my.n; sourceTree = ""; }; + F93599D60DF1F95000E04F67 /* next.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = next.n; sourceTree = ""; }; + F93599D70DF1F96800E04F67 /* object.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = object.n; sourceTree = ""; }; + F93599D80DF1F98300E04F67 /* self.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = self.n; sourceTree = ""; }; F936FCD70CCD984500716967 /* ttkprogress.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ttkprogress.tcl; sourceTree = ""; }; F936FCD80CCD984600716967 /* tree.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = tree.tcl; sourceTree = ""; }; F936FCD90CCD984600716967 /* toolbar.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = toolbar.tcl; sourceTree = ""; }; F936FCDA0CCD984600716967 /* ttknote.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ttknote.tcl; sourceTree = ""; }; F936FCDB0CCD984600716967 /* combo.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = combo.tcl; sourceTree = ""; }; F93E5EFD09CF8711008FA367 /* tkMacOSXFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSXFont.h; sourceTree = ""; }; + F95D77E90DFD820D00A8BF6F /* tclIORTrans.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclIORTrans.c; sourceTree = ""; }; F95FAFF90B34F1130072E431 /* macOSXLoad.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = macOSXLoad.test; sourceTree = ""; }; F962F7C60DADC26200648DB8 /* vsapi.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = vsapi.test; sourceTree = ""; }; F966BA0408F27A37005CB29B /* error.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = error.xbm; sourceTree = ""; }; @@ -1837,7 +1881,6 @@ F96D437B08F272B6004A47F5 /* io.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = io.test; sourceTree = ""; }; F96D437C08F272B6004A47F5 /* ioCmd.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ioCmd.test; sourceTree = ""; }; F96D437D08F272B6004A47F5 /* iogt.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = iogt.test; sourceTree = ""; }; - F96D437E08F272B6004A47F5 /* ioUtil.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ioUtil.test; sourceTree = ""; }; F96D437F08F272B6004A47F5 /* join.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = join.test; sourceTree = ""; }; F96D438008F272B6004A47F5 /* lindex.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = lindex.test; sourceTree = ""; }; F96D438108F272B6004A47F5 /* link.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = link.test; sourceTree = ""; }; @@ -2095,7 +2138,7 @@ F966C06F08F281DC005CB29B /* Frameworks */, 1AB674ADFE9D54B511CA2CBB /* Products */, ); - comments = "Copyright (c) 2004-2007 Daniel A. Steffen \n\nSee the file \"license.terms\" for information on usage and redistribution of\nthis file, and for a DISCLAIMER OF ALL WARRANTIES.\n\nRCS: @(#) $Id: project.pbxproj,v 1.24 2008/04/15 10:55:49 das Exp $\n"; + comments = "Copyright (c) 2004-2008 Daniel A. Steffen \n\nSee the file \"license.terms\" for information on usage and redistribution of\nthis file, and for a DISCLAIMER OF ALL WARRANTIES.\n\nRCS: @(#) $Id: project.pbxproj,v 1.25 2008/06/12 06:31:10 das Exp $\n"; name = Wish; path = .; sourceTree = SOURCE_ROOT; @@ -3022,12 +3065,15 @@ F96D3E1108F272A5004A47F5 /* cd.n */, F96D3E1208F272A5004A47F5 /* chan.n */, F96D3E1308F272A5004A47F5 /* ChnlStack.3 */, + F93599CF0DF1F87F00E04F67 /* Class.3 */, + F93599D00DF1F89E00E04F67 /* class.n */, F96D3E1408F272A5004A47F5 /* clock.n */, F96D3E1508F272A5004A47F5 /* close.n */, F96D3E1608F272A5004A47F5 /* CmdCmplt.3 */, F96D3E1708F272A5004A47F5 /* Concat.3 */, F96D3E1808F272A5004A47F5 /* concat.n */, F96D3E1908F272A5004A47F5 /* continue.n */, + F93599D20DF1F8DF00E04F67 /* copy.n */, F96D3E1A08F272A5004A47F5 /* CrtChannel.3 */, F96D3E1B08F272A5004A47F5 /* CrtChnlHdlr.3 */, F96D3E1C08F272A5004A47F5 /* CrtCloseHdlr.3 */, @@ -3040,6 +3086,7 @@ F96D3E2308F272A5004A47F5 /* CrtTimerHdlr.3 */, F96D3E2408F272A5004A47F5 /* CrtTrace.3 */, F96D3E2508F272A5004A47F5 /* dde.n */, + F93599D30DF1F8F500E04F67 /* define.n */, F96D3E2608F272A5004A47F5 /* DetachPids.3 */, F96D3E2708F272A5004A47F5 /* dict.n */, F96D3E2808F272A5004A47F5 /* DictObj.3 */, @@ -3117,11 +3164,15 @@ F96D3E7008F272A6004A47F5 /* man.macros */, F96D3E7108F272A6004A47F5 /* mathfunc.n */, F96D3E7208F272A6004A47F5 /* memory.n */, + F93599D40DF1F91900E04F67 /* Method.3 */, F96D3E7308F272A6004A47F5 /* msgcat.n */, + F93599D50DF1F93700E04F67 /* my.n */, F96D3E7408F272A6004A47F5 /* Namespace.3 */, F96D3E7508F272A6004A47F5 /* namespace.n */, + F93599D60DF1F95000E04F67 /* next.n */, F96D3E7608F272A6004A47F5 /* Notifier.3 */, F96D3E7708F272A6004A47F5 /* Object.3 */, + F93599D70DF1F96800E04F67 /* object.n */, F96D3E7808F272A6004A47F5 /* ObjectType.3 */, F96D3E7908F272A6004A47F5 /* open.n */, F96D3E7A08F272A6004A47F5 /* OpenFileChnl.3 */, @@ -3155,6 +3206,7 @@ F96D3E9408F272A6004A47F5 /* SaveResult.3 */, F96D3E9508F272A6004A47F5 /* scan.n */, F96D3E9608F272A6004A47F5 /* seek.n */, + F93599D80DF1F98300E04F67 /* self.n */, F96D3E9708F272A6004A47F5 /* set.n */, F96D3E9808F272A6004A47F5 /* SetChanErr.3 */, F96D3E9908F272A6004A47F5 /* SetErrno.3 */, @@ -3269,6 +3321,7 @@ F96D3F0008F272A7004A47F5 /* tclIOCmd.c */, F96D3F0108F272A7004A47F5 /* tclIOGT.c */, F96D3F0208F272A7004A47F5 /* tclIORChan.c */, + F95D77E90DFD820D00A8BF6F /* tclIORTrans.c */, F96D3F0308F272A7004A47F5 /* tclIOSock.c */, F96D3F0408F272A7004A47F5 /* tclIOUtil.c */, F96D3F0508F272A7004A47F5 /* tclLink.c */, @@ -3280,6 +3333,19 @@ F96D3F0B08F272A7004A47F5 /* tclNamesp.c */, F96D3F0C08F272A7004A47F5 /* tclNotify.c */, F96D3F0D08F272A7004A47F5 /* tclObj.c */, + F93599B20DF1F75400E04F67 /* tclOO.c */, + F93599B40DF1F75900E04F67 /* tclOO.decls */, + F93599B50DF1F75D00E04F67 /* tclOO.h */, + F93599B60DF1F76100E04F67 /* tclOOBasic.c */, + F93599B80DF1F76600E04F67 /* tclOOCall.c */, + F93599BA0DF1F76A00E04F67 /* tclOODecls.h */, + F93599BB0DF1F77000E04F67 /* tclOODefineCmds.c */, + F93599BD0DF1F77400E04F67 /* tclOOInfo.c */, + F93599BF0DF1F77900E04F67 /* tclOOInt.h */, + F93599C00DF1F77D00E04F67 /* tclOOIntDecls.h */, + F93599C10DF1F78300E04F67 /* tclOOMethod.c */, + F93599C30DF1F78800E04F67 /* tclOOStubInit.c */, + F93599C50DF1F78D00E04F67 /* tclOOStubLib.c */, F96D3F0E08F272A7004A47F5 /* tclPanic.c */, F96D3F0F08F272A7004A47F5 /* tclParse.c */, F96D3F1108F272A7004A47F5 /* tclPathObj.c */, @@ -3618,7 +3684,6 @@ F96D437B08F272B6004A47F5 /* io.test */, F96D437C08F272B6004A47F5 /* ioCmd.test */, F96D437D08F272B6004A47F5 /* iogt.test */, - F96D437E08F272B6004A47F5 /* ioUtil.test */, F96D437F08F272B6004A47F5 /* join.test */, F96D438008F272B6004A47F5 /* lindex.test */, F96D438108F272B6004A47F5 /* link.test */, @@ -3643,6 +3708,7 @@ F96D439208F272B7004A47F5 /* namespace.test */, F96D439308F272B7004A47F5 /* notify.test */, F96D439408F272B7004A47F5 /* obj.test */, + F93599C80DF1F81900E04F67 /* oo.test */, F96D439508F272B7004A47F5 /* opt.test */, F96D439608F272B7004A47F5 /* package.test */, F96D439708F272B7004A47F5 /* parse.test */, @@ -3734,6 +3800,8 @@ F96D443708F272B9004A47F5 /* tclmin.wse */, F96D443908F272B9004A47F5 /* tcltk-man2html.tcl */, F96D443A08F272B9004A47F5 /* tclZIC.tcl */, + F92D7F140DE777670033A13A /* tsdPerf.c */, + F92D7F100DE777240033A13A /* tsdPerf.tcl */, F96D443B08F272B9004A47F5 /* uniClass.tcl */, F96D443C08F272B9004A47F5 /* uniParse.tcl */, ); @@ -3868,7 +3936,7 @@ F9EA4ADE08FA3B7F00B1F5F0 /* Rez */, 8DD76FAB0486AB0100D96B5E /* Sources */, 8DD76FAD0486AB0100D96B5E /* Frameworks */, - F975AC0108F824170068008A /* ShellScript */, + F95FA74C0B32CE190072E431 /* ShellScript */, ); buildRules = ( ); @@ -3880,24 +3948,9 @@ productReference = 8DD76FB20486AB0100D96B5E /* tktest */; productType = "com.apple.product-type.tool"; }; - F9E61D16090A3E94002B3151 /* Tk */ = { - isa = PBXNativeTarget; - buildConfigurationList = F95CC8AB09158F3100EA5ACE /* Build configuration list for PBXNativeTarget "Tk" */; - buildPhases = ( - F97AF02F0B665DA900310EA2 /* ShellScript */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Tk; - productName = Wish; - productReference = F9A3084B08F2D4CE00BAE1AB /* Wish.app */; - productType = "com.apple.product-type.application"; - }; - F9FD30B30CC1AD070073837D /* tktest-X11 */ = { + F97258A50A86873C00096C78 /* tktest-X11 */ = { isa = PBXNativeTarget; - buildConfigurationList = F9FD31E80CC1AD070073837D /* Build configuration list for PBXNativeTarget "tktest-X11" */; + buildConfigurationList = F97258A80A86873D00096C78 /* Build configuration list for PBXNativeTarget "tktest-X11" */; buildPhases = ( F9FD30B40CC1AD070073837D /* ShellScript */, F9FD30B50CC1AD070073837D /* ShellScript */, @@ -3914,6 +3967,21 @@ productReference = F9FD31F40CC1AD070073837D /* tktest-X11 */; productType = "com.apple.product-type.tool"; }; + F9E61D16090A3E94002B3151 /* Tk */ = { + isa = PBXNativeTarget; + buildConfigurationList = F95CC8AB09158F3100EA5ACE /* Build configuration list for PBXNativeTarget "Tk" */; + buildPhases = ( + F97AF02F0B665DA900310EA2 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Tk; + productName = Wish; + productReference = F9A3084B08F2D4CE00BAE1AB /* Wish.app */; + productType = "com.apple.product-type.application"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -3927,7 +3995,7 @@ targets = ( F9E61D16090A3E94002B3151 /* Tk */, 8DD76FA90486AB0100D96B5E /* tktest */, - F9FD30B30CC1AD070073837D /* tktest-X11 */, + F97258A50A86873C00096C78 /* tktest-X11 */, ); }; /* End PBXProject section */ @@ -3947,7 +4015,7 @@ /* End PBXRezBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - F975AC0108F824170068008A /* ShellScript */ = { + F95FA74C0B32CE190072E431 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -4099,6 +4167,7 @@ F96D459F08F272BC004A47F5 /* tclIOCmd.c in Sources */, F96D45A008F272BC004A47F5 /* tclIOGT.c in Sources */, F96D45A108F272BC004A47F5 /* tclIORChan.c in Sources */, + F95D77EA0DFD820D00A8BF6F /* tclIORTrans.c in Sources */, F96D45A208F272BC004A47F5 /* tclIOSock.c in Sources */, F96D45A308F272BC004A47F5 /* tclIOUtil.c in Sources */, F96D45A408F272BC004A47F5 /* tclLink.c in Sources */, @@ -4109,6 +4178,14 @@ F96D45AA08F272BC004A47F5 /* tclNamesp.c in Sources */, F96D45AB08F272BC004A47F5 /* tclNotify.c in Sources */, F96D45AC08F272BC004A47F5 /* tclObj.c in Sources */, + F93599B30DF1F75400E04F67 /* tclOO.c in Sources */, + F93599B70DF1F76100E04F67 /* tclOOBasic.c in Sources */, + F93599B90DF1F76600E04F67 /* tclOOCall.c in Sources */, + F93599BC0DF1F77000E04F67 /* tclOODefineCmds.c in Sources */, + F93599BE0DF1F77400E04F67 /* tclOOInfo.c in Sources */, + F93599C20DF1F78300E04F67 /* tclOOMethod.c in Sources */, + F93599C40DF1F78800E04F67 /* tclOOStubInit.c in Sources */, + F93599C60DF1F78D00E04F67 /* tclOOStubLib.c in Sources */, F96D45AD08F272BC004A47F5 /* tclPanic.c in Sources */, F96D45AE08F272BC004A47F5 /* tclParse.c in Sources */, F96D45B008F272BC004A47F5 /* tclPathObj.c in Sources */, @@ -4400,6 +4477,7 @@ F9FD30DB0CC1AD070073837D /* tclIOCmd.c in Sources */, F9FD30DC0CC1AD070073837D /* tclIOGT.c in Sources */, F9FD30DD0CC1AD070073837D /* tclIORChan.c in Sources */, + F9FFAF1D0DFDDB26007F8A6A /* tclIORTrans.c in Sources */, F9FD30DE0CC1AD070073837D /* tclIOSock.c in Sources */, F9FD30DF0CC1AD070073837D /* tclIOUtil.c in Sources */, F9FD30E00CC1AD070073837D /* tclLink.c in Sources */, @@ -4410,6 +4488,14 @@ F9FD30E50CC1AD070073837D /* tclNamesp.c in Sources */, F9FD30E60CC1AD070073837D /* tclNotify.c in Sources */, F9FD30E70CC1AD070073837D /* tclObj.c in Sources */, + F9FFAF1F0DFDDB2F007F8A6A /* tclOO.c in Sources */, + F9FFAF200DFDDB32007F8A6A /* tclOOBasic.c in Sources */, + F9FFAF210DFDDB32007F8A6A /* tclOOCall.c in Sources */, + F9FFAF220DFDDB34007F8A6A /* tclOODefineCmds.c in Sources */, + F9FFAF230DFDDB35007F8A6A /* tclOOInfo.c in Sources */, + F9FFAF240DFDDB36007F8A6A /* tclOOMethod.c in Sources */, + F9FFAF250DFDDB37007F8A6A /* tclOOStubInit.c in Sources */, + F9FFAF260DFDDB38007F8A6A /* tclOOStubLib.c in Sources */, F9FD30E80CC1AD070073837D /* tclPanic.c in Sources */, F9FD30E90CC1AD070073837D /* tclParse.c in Sources */, F9FD30EA0CC1AD070073837D /* tclPathObj.c in Sources */, @@ -4700,6 +4786,22 @@ }; name = DebugMemCompile; }; + F93084390BB93D2800CD0B9E /* DebugMemCompile */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + /usr/X11R6/include, + /usr/X11R6/include/freetype2, + "$(HEADER_SEARCH_PATHS)", + ); + LIBRARY_SEARCH_PATHS = ( + /usr/X11R6/lib, + "$(LIBRARY_SEARCH_PATHS)", + ); + PRODUCT_NAME = "tktest-X11"; + }; + name = DebugMemCompile; + }; F930843A0BB93D2800CD0B9E /* DebugMemCompile */ = { isa = XCBuildConfiguration; baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Wish-Debug.xcconfig */; @@ -4710,6 +4812,56 @@ }; name = DebugMemCompile; }; + F9359B250DF212DA00E04F67 /* DebugGCov */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Wish-Debug.xcconfig */; + buildSettings = { + GCC_GENERATE_TEST_COVERAGE_FILES = YES; + GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES; + MACOSX_DEPLOYMENT_TARGET = 10.2; + OTHER_LDFLAGS = ( + "$(OTHER_LDFLAGS)", + "-lgcov", + ); + PREBINDING = NO; + }; + name = DebugGCov; + }; + F9359B260DF212DA00E04F67 /* DebugGCov */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = Wish; + SKIP_INSTALL = NO; + }; + name = DebugGCov; + }; + F9359B270DF212DA00E04F67 /* DebugGCov */ = { + isa = XCBuildConfiguration; + buildSettings = { + OTHER_LDFLAGS = ( + "$(OTHER_LDFLAGS_AQUA)", + "$(OTHER_LDFLAGS)", + ); + PRODUCT_NAME = tktest; + }; + name = DebugGCov; + }; + F9359B280DF212DA00E04F67 /* DebugGCov */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + /usr/X11R6/include, + /usr/X11R6/include/freetype2, + "$(HEADER_SEARCH_PATHS)", + ); + LIBRARY_SEARCH_PATHS = ( + /usr/X11R6/lib, + "$(LIBRARY_SEARCH_PATHS)", + ); + PRODUCT_NAME = "tktest-X11"; + }; + name = DebugGCov; + }; F95CC8AC09158F3100EA5ACE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -4803,6 +4955,221 @@ }; name = DebugNoFixZL; }; + F97258A90A86873D00096C78 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONFIGURE_ARGS = "tcl_cv_cc_visibility_hidden=no $(CONFIGURE_ARGS)"; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "__private_extern__=extern", + "$(GCC_PREPROCESSOR_DEFINITIONS)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + HEADER_SEARCH_PATHS = ( + /usr/X11R6/include, + /usr/X11R6/include/freetype2, + "$(HEADER_SEARCH_PATHS)", + ); + LIBRARY_SEARCH_PATHS = ( + /usr/X11R6/lib, + "$(LIBRARY_SEARCH_PATHS)", + ); + PRODUCT_NAME = "tktest-X11"; + ZERO_LINK = YES; + }; + name = Debug; + }; + F97258AA0A86873D00096C78 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + /usr/X11R6/include, + /usr/X11R6/include/freetype2, + "$(HEADER_SEARCH_PATHS)", + ); + LIBRARY_SEARCH_PATHS = ( + /usr/X11R6/lib, + "$(LIBRARY_SEARCH_PATHS)", + ); + PRODUCT_NAME = "tktest-X11"; + }; + name = Release; + }; + F97258AB0A86873D00096C78 /* DebugNoFixZL */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + /usr/X11R6/include, + /usr/X11R6/include/freetype2, + "$(HEADER_SEARCH_PATHS)", + ); + LIBRARY_SEARCH_PATHS = ( + /usr/X11R6/lib, + "$(LIBRARY_SEARCH_PATHS)", + ); + PRODUCT_NAME = "tktest-X11"; + }; + name = DebugNoFixZL; + }; + F97258AC0A86873D00096C78 /* ReleaseUniversal */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + /usr/X11R6/include, + /usr/X11R6/include/freetype2, + "$(HEADER_SEARCH_PATHS)", + ); + LIBRARY_SEARCH_PATHS = ( + /usr/X11R6/lib, + "$(LIBRARY_SEARCH_PATHS)", + ); + PRODUCT_NAME = "tktest-X11"; + }; + name = ReleaseUniversal; + }; + F97AED080B660A6C00310EA2 /* ReleaseUniversal10.4uSDK */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + /usr/X11R6/include, + /usr/X11R6/include/freetype2, + "$(HEADER_SEARCH_PATHS)", + ); + LIBRARY_SEARCH_PATHS = ( + /usr/X11R6/lib, + "$(LIBRARY_SEARCH_PATHS)", + ); + PRODUCT_NAME = "tktest-X11"; + }; + name = ReleaseUniversal10.4uSDK; + }; + F97AED0F0B660AA300310EA2 /* ReleasePPC10.3.9SDK */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + /usr/X11R6/include, + /usr/X11R6/include/freetype2, + "$(HEADER_SEARCH_PATHS)", + ); + LIBRARY_SEARCH_PATHS = ( + /usr/X11R6/lib, + "$(LIBRARY_SEARCH_PATHS)", + ); + PRODUCT_NAME = "tktest-X11"; + }; + name = ReleasePPC10.3.9SDK; + }; + F97AED160B660AF100310EA2 /* ReleasePPC10.2.8SDK */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + /usr/X11R6/include, + /usr/X11R6/include/freetype2, + "$(HEADER_SEARCH_PATHS)", + ); + LIBRARY_SEARCH_PATHS = ( + /usr/X11R6/lib, + "$(LIBRARY_SEARCH_PATHS)", + ); + PRODUCT_NAME = "tktest-X11"; + }; + name = ReleasePPC10.2.8SDK; + }; + F987512F0DE7B57E00B1C9EC /* DebugNoCF */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Wish-Debug.xcconfig */; + buildSettings = { + CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --disable-corefoundation"; + MACOSX_DEPLOYMENT_TARGET = 10.2; + PREBINDING = NO; + }; + name = DebugNoCF; + }; + F98751300DE7B57E00B1C9EC /* DebugNoCF */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --enable-corefoundation"; + PRODUCT_NAME = Wish; + SKIP_INSTALL = NO; + }; + name = DebugNoCF; + }; + F98751310DE7B57E00B1C9EC /* DebugNoCF */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --enable-corefoundation"; + OTHER_LDFLAGS = ( + "$(OTHER_LDFLAGS_AQUA)", + "$(OTHER_LDFLAGS)", + ); + PRODUCT_NAME = tktest; + }; + name = DebugNoCF; + }; + F98751320DE7B57E00B1C9EC /* DebugNoCF */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + /usr/X11R6/include, + /usr/X11R6/include/freetype2, + "$(HEADER_SEARCH_PATHS)", + ); + LIBRARY_SEARCH_PATHS = ( + /usr/X11R6/lib, + "$(LIBRARY_SEARCH_PATHS)", + ); + PRODUCT_NAME = "tktest-X11"; + }; + name = DebugNoCF; + }; + F98751330DE7B5A200B1C9EC /* DebugNoCFUnthreaded */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Wish-Debug.xcconfig */; + buildSettings = { + CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --disable-threads --disable-corefoundation"; + MACOSX_DEPLOYMENT_TARGET = 10.2; + PREBINDING = NO; + }; + name = DebugNoCFUnthreaded; + }; + F98751340DE7B5A200B1C9EC /* DebugNoCFUnthreaded */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --enable-corefoundation"; + PRODUCT_NAME = Wish; + SKIP_INSTALL = NO; + }; + name = DebugNoCFUnthreaded; + }; + F98751350DE7B5A200B1C9EC /* DebugNoCFUnthreaded */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --enable-corefoundation"; + OTHER_LDFLAGS = ( + "$(OTHER_LDFLAGS_AQUA)", + "$(OTHER_LDFLAGS)", + ); + PRODUCT_NAME = tktest; + }; + name = DebugNoCFUnthreaded; + }; + F98751360DE7B5A200B1C9EC /* DebugNoCFUnthreaded */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + /usr/X11R6/include, + /usr/X11R6/include/freetype2, + "$(HEADER_SEARCH_PATHS)", + ); + LIBRARY_SEARCH_PATHS = ( + /usr/X11R6/lib, + "$(LIBRARY_SEARCH_PATHS)", + ); + PRODUCT_NAME = "tktest-X11"; + }; + name = DebugNoCFUnthreaded; + }; F99EE73B0BE835310060D4AF /* DebugUnthreaded */ = { isa = XCBuildConfiguration; buildSettings = { @@ -4841,6 +5208,38 @@ }; name = DebugLeaks; }; + F99EE73F0BE835310060D4AF /* DebugUnthreaded */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + /usr/X11R6/include, + /usr/X11R6/include/freetype2, + "$(HEADER_SEARCH_PATHS)", + ); + LIBRARY_SEARCH_PATHS = ( + /usr/X11R6/lib, + "$(LIBRARY_SEARCH_PATHS)", + ); + PRODUCT_NAME = "tktest-X11"; + }; + name = DebugUnthreaded; + }; + F99EE7400BE835310060D4AF /* DebugLeaks */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + /usr/X11R6/include, + /usr/X11R6/include/freetype2, + "$(HEADER_SEARCH_PATHS)", + ); + LIBRARY_SEARCH_PATHS = ( + /usr/X11R6/lib, + "$(LIBRARY_SEARCH_PATHS)", + ); + PRODUCT_NAME = "tktest-X11"; + }; + name = DebugLeaks; + }; F99EE7410BE835310060D4AF /* DebugUnthreaded */ = { isa = XCBuildConfiguration; baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Wish-Debug.xcconfig */; @@ -4972,175 +5371,6 @@ }; name = ReleasePPC10.2.8SDK; }; - F9FD31E90CC1AD070073837D /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CONFIGURE_ARGS = "tcl_cv_cc_visibility_hidden=no $(CONFIGURE_ARGS)"; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_PREPROCESSOR_DEFINITIONS = ( - "__private_extern__=extern", - "$(GCC_PREPROCESSOR_DEFINITIONS)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - HEADER_SEARCH_PATHS = ( - /usr/X11R6/include, - /usr/X11R6/include/freetype2, - "$(HEADER_SEARCH_PATHS)", - ); - LIBRARY_SEARCH_PATHS = ( - /usr/X11R6/lib, - "$(LIBRARY_SEARCH_PATHS)", - ); - PRODUCT_NAME = "tktest-X11"; - ZERO_LINK = YES; - }; - name = Debug; - }; - F9FD31EA0CC1AD070073837D /* DebugNoFixZL */ = { - isa = XCBuildConfiguration; - buildSettings = { - HEADER_SEARCH_PATHS = ( - /usr/X11R6/include, - /usr/X11R6/include/freetype2, - "$(HEADER_SEARCH_PATHS)", - ); - LIBRARY_SEARCH_PATHS = ( - /usr/X11R6/lib, - "$(LIBRARY_SEARCH_PATHS)", - ); - PRODUCT_NAME = "tktest-X11"; - }; - name = DebugNoFixZL; - }; - F9FD31EB0CC1AD070073837D /* DebugUnthreaded */ = { - isa = XCBuildConfiguration; - buildSettings = { - HEADER_SEARCH_PATHS = ( - /usr/X11R6/include, - /usr/X11R6/include/freetype2, - "$(HEADER_SEARCH_PATHS)", - ); - LIBRARY_SEARCH_PATHS = ( - /usr/X11R6/lib, - "$(LIBRARY_SEARCH_PATHS)", - ); - PRODUCT_NAME = "tktest-X11"; - }; - name = DebugUnthreaded; - }; - F9FD31EC0CC1AD070073837D /* DebugMemCompile */ = { - isa = XCBuildConfiguration; - buildSettings = { - HEADER_SEARCH_PATHS = ( - /usr/X11R6/include, - /usr/X11R6/include/freetype2, - "$(HEADER_SEARCH_PATHS)", - ); - LIBRARY_SEARCH_PATHS = ( - /usr/X11R6/lib, - "$(LIBRARY_SEARCH_PATHS)", - ); - PRODUCT_NAME = "tktest-X11"; - }; - name = DebugMemCompile; - }; - F9FD31ED0CC1AD070073837D /* DebugLeaks */ = { - isa = XCBuildConfiguration; - buildSettings = { - HEADER_SEARCH_PATHS = ( - /usr/X11R6/include, - /usr/X11R6/include/freetype2, - "$(HEADER_SEARCH_PATHS)", - ); - LIBRARY_SEARCH_PATHS = ( - /usr/X11R6/lib, - "$(LIBRARY_SEARCH_PATHS)", - ); - PRODUCT_NAME = "tktest-X11"; - }; - name = DebugLeaks; - }; - F9FD31EE0CC1AD070073837D /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - HEADER_SEARCH_PATHS = ( - /usr/X11R6/include, - /usr/X11R6/include/freetype2, - "$(HEADER_SEARCH_PATHS)", - ); - LIBRARY_SEARCH_PATHS = ( - /usr/X11R6/lib, - "$(LIBRARY_SEARCH_PATHS)", - ); - PRODUCT_NAME = "tktest-X11"; - }; - name = Release; - }; - F9FD31EF0CC1AD070073837D /* ReleaseUniversal */ = { - isa = XCBuildConfiguration; - buildSettings = { - HEADER_SEARCH_PATHS = ( - /usr/X11R6/include, - /usr/X11R6/include/freetype2, - "$(HEADER_SEARCH_PATHS)", - ); - LIBRARY_SEARCH_PATHS = ( - /usr/X11R6/lib, - "$(LIBRARY_SEARCH_PATHS)", - ); - PRODUCT_NAME = "tktest-X11"; - }; - name = ReleaseUniversal; - }; - F9FD31F10CC1AD070073837D /* ReleaseUniversal10.4uSDK */ = { - isa = XCBuildConfiguration; - buildSettings = { - HEADER_SEARCH_PATHS = ( - /usr/X11R6/include, - /usr/X11R6/include/freetype2, - "$(HEADER_SEARCH_PATHS)", - ); - LIBRARY_SEARCH_PATHS = ( - /usr/X11R6/lib, - "$(LIBRARY_SEARCH_PATHS)", - ); - PRODUCT_NAME = "tktest-X11"; - }; - name = ReleaseUniversal10.4uSDK; - }; - F9FD31F20CC1AD070073837D /* ReleasePPC10.3.9SDK */ = { - isa = XCBuildConfiguration; - buildSettings = { - HEADER_SEARCH_PATHS = ( - /usr/X11R6/include, - /usr/X11R6/include/freetype2, - "$(HEADER_SEARCH_PATHS)", - ); - LIBRARY_SEARCH_PATHS = ( - /usr/X11R6/lib, - "$(LIBRARY_SEARCH_PATHS)", - ); - PRODUCT_NAME = "tktest-X11"; - }; - name = ReleasePPC10.3.9SDK; - }; - F9FD31F30CC1AD070073837D /* ReleasePPC10.2.8SDK */ = { - isa = XCBuildConfiguration; - buildSettings = { - HEADER_SEARCH_PATHS = ( - /usr/X11R6/include, - /usr/X11R6/include/freetype2, - "$(HEADER_SEARCH_PATHS)", - ); - LIBRARY_SEARCH_PATHS = ( - /usr/X11R6/lib, - "$(LIBRARY_SEARCH_PATHS)", - ); - PRODUCT_NAME = "tktest-X11"; - }; - name = ReleasePPC10.2.8SDK; - }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -5150,8 +5380,11 @@ F95CC8AC09158F3100EA5ACE /* Debug */, F95CC8AE09158F3100EA5ACE /* DebugNoFixZL */, F99EE73B0BE835310060D4AF /* DebugUnthreaded */, + F98751300DE7B57E00B1C9EC /* DebugNoCF */, + F98751340DE7B5A200B1C9EC /* DebugNoCFUnthreaded */, F93084370BB93D2800CD0B9E /* DebugMemCompile */, F99EE73C0BE835310060D4AF /* DebugLeaks */, + F9359B260DF212DA00E04F67 /* DebugGCov */, F95CC8AD09158F3100EA5ACE /* Release */, F91BCC4F093152310042A6BF /* ReleaseUniversal */, F9DB62080B65ADA800A370FB /* ReleaseUniversal10.4uSDK */, @@ -5167,8 +5400,11 @@ F95CC8B109158F3100EA5ACE /* Debug */, F95CC8B309158F3100EA5ACE /* DebugNoFixZL */, F99EE73D0BE835310060D4AF /* DebugUnthreaded */, + F98751310DE7B57E00B1C9EC /* DebugNoCF */, + F98751350DE7B5A200B1C9EC /* DebugNoCFUnthreaded */, F93084380BB93D2800CD0B9E /* DebugMemCompile */, F99EE73E0BE835310060D4AF /* DebugLeaks */, + F9359B270DF212DA00E04F67 /* DebugGCov */, F95CC8B209158F3100EA5ACE /* Release */, F91BCC50093152310042A6BF /* ReleaseUniversal */, F9DB62090B65ADA800A370FB /* ReleaseUniversal10.4uSDK */, @@ -5184,8 +5420,11 @@ F95CC8B609158F3100EA5ACE /* Debug */, F95CC8B809158F3100EA5ACE /* DebugNoFixZL */, F99EE7410BE835310060D4AF /* DebugUnthreaded */, + F987512F0DE7B57E00B1C9EC /* DebugNoCF */, + F98751330DE7B5A200B1C9EC /* DebugNoCFUnthreaded */, F930843A0BB93D2800CD0B9E /* DebugMemCompile */, F99EE7420BE835310060D4AF /* DebugLeaks */, + F9359B250DF212DA00E04F67 /* DebugGCov */, F95CC8B709158F3100EA5ACE /* Release */, F91BCC51093152310042A6BF /* ReleaseUniversal */, F9DB620A0B65ADA800A370FB /* ReleaseUniversal10.4uSDK */, @@ -5195,19 +5434,22 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; - F9FD31E80CC1AD070073837D /* Build configuration list for PBXNativeTarget "tktest-X11" */ = { + F97258A80A86873D00096C78 /* Build configuration list for PBXNativeTarget "tktest-X11" */ = { isa = XCConfigurationList; buildConfigurations = ( - F9FD31E90CC1AD070073837D /* Debug */, - F9FD31EA0CC1AD070073837D /* DebugNoFixZL */, - F9FD31EB0CC1AD070073837D /* DebugUnthreaded */, - F9FD31EC0CC1AD070073837D /* DebugMemCompile */, - F9FD31ED0CC1AD070073837D /* DebugLeaks */, - F9FD31EE0CC1AD070073837D /* Release */, - F9FD31EF0CC1AD070073837D /* ReleaseUniversal */, - F9FD31F10CC1AD070073837D /* ReleaseUniversal10.4uSDK */, - F9FD31F20CC1AD070073837D /* ReleasePPC10.3.9SDK */, - F9FD31F30CC1AD070073837D /* ReleasePPC10.2.8SDK */, + F97258A90A86873D00096C78 /* Debug */, + F97258AB0A86873D00096C78 /* DebugNoFixZL */, + F99EE73F0BE835310060D4AF /* DebugUnthreaded */, + F98751320DE7B57E00B1C9EC /* DebugNoCF */, + F98751360DE7B5A200B1C9EC /* DebugNoCFUnthreaded */, + F93084390BB93D2800CD0B9E /* DebugMemCompile */, + F99EE7400BE835310060D4AF /* DebugLeaks */, + F9359B280DF212DA00E04F67 /* DebugGCov */, + F97258AA0A86873D00096C78 /* Release */, + F97258AC0A86873D00096C78 /* ReleaseUniversal */, + F97AED080B660A6C00310EA2 /* ReleaseUniversal10.4uSDK */, + F97AED0F0B660AA300310EA2 /* ReleasePPC10.3.9SDK */, + F97AED160B660AF100310EA2 /* ReleasePPC10.2.8SDK */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; diff --git a/macosx/Wish.xcodeproj/default.pbxuser b/macosx/Wish.xcodeproj/default.pbxuser index 0495782..cd9a9a6 100644 --- a/macosx/Wish.xcodeproj/default.pbxuser +++ b/macosx/Wish.xcodeproj/default.pbxuser @@ -216,7 +216,7 @@ sourceDirectories = ( ); }; - F9FD30B30CC1AD070073837D /* tktest-X11 */ = { + F97258A50A86873C00096C78 /* tktest-X11 */ = { activeExec = 0; executables = ( F9FD31F50CC1AD070073837D /* tktest-X11 */, diff --git a/macosx/Wish.xcodeproj/project.pbxproj b/macosx/Wish.xcodeproj/project.pbxproj index 9e3a990..6ecdd4c 100644 --- a/macosx/Wish.xcodeproj/project.pbxproj +++ b/macosx/Wish.xcodeproj/project.pbxproj @@ -16,6 +16,7 @@ F93599C20DF1F78300E04F67 /* tclOOMethod.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C10DF1F78300E04F67 /* tclOOMethod.c */; }; F93599C40DF1F78800E04F67 /* tclOOStubInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C30DF1F78800E04F67 /* tclOOStubInit.c */; }; F93599C60DF1F78D00E04F67 /* tclOOStubLib.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C50DF1F78D00E04F67 /* tclOOStubLib.c */; }; + F95D77EA0DFD820D00A8BF6F /* tclIORTrans.c in Sources */ = {isa = PBXBuildFile; fileRef = F95D77E90DFD820D00A8BF6F /* tclIORTrans.c */; }; F966BDCF08F27A3F005CB29B /* tk3d.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAAC08F27A39005CB29B /* tk3d.c */; }; F966BDD108F27A3F005CB29B /* tkArgv.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAAE08F27A39005CB29B /* tkArgv.c */; }; F966BDD208F27A3F005CB29B /* tkAtom.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAAF08F27A39005CB29B /* tkAtom.c */; }; @@ -601,6 +602,15 @@ F9FD349B0CC1BB0D0073837D /* libfreetype.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F9FD34990CC1BB0D0073837D /* libfreetype.dylib */; }; F9FD349C0CC1BB0D0073837D /* libXft.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F9FD349A0CC1BB0D0073837D /* libXft.dylib */; }; F9FD34C40CC1BBD70073837D /* libfontconfig.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F9FD34C30CC1BBD70073837D /* libfontconfig.dylib */; }; + F9FFAF1D0DFDDB26007F8A6A /* tclIORTrans.c in Sources */ = {isa = PBXBuildFile; fileRef = F95D77E90DFD820D00A8BF6F /* tclIORTrans.c */; }; + F9FFAF1F0DFDDB2F007F8A6A /* tclOO.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B20DF1F75400E04F67 /* tclOO.c */; }; + F9FFAF200DFDDB32007F8A6A /* tclOOBasic.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B60DF1F76100E04F67 /* tclOOBasic.c */; }; + F9FFAF210DFDDB32007F8A6A /* tclOOCall.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599B80DF1F76600E04F67 /* tclOOCall.c */; }; + F9FFAF220DFDDB34007F8A6A /* tclOODefineCmds.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599BB0DF1F77000E04F67 /* tclOODefineCmds.c */; }; + F9FFAF230DFDDB35007F8A6A /* tclOOInfo.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599BD0DF1F77400E04F67 /* tclOOInfo.c */; }; + F9FFAF240DFDDB36007F8A6A /* tclOOMethod.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C10DF1F78300E04F67 /* tclOOMethod.c */; }; + F9FFAF250DFDDB37007F8A6A /* tclOOStubInit.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C30DF1F78800E04F67 /* tclOOStubInit.c */; }; + F9FFAF260DFDDB38007F8A6A /* tclOOStubLib.c in Sources */ = {isa = PBXBuildFile; fileRef = F93599C50DF1F78D00E04F67 /* tclOOStubLib.c */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -640,6 +650,7 @@ F936FCDA0CCD984600716967 /* ttknote.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = ttknote.tcl; sourceTree = ""; }; F936FCDB0CCD984600716967 /* combo.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = combo.tcl; sourceTree = ""; }; F93E5EFD09CF8711008FA367 /* tkMacOSXFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkMacOSXFont.h; sourceTree = ""; }; + F95D77E90DFD820D00A8BF6F /* tclIORTrans.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclIORTrans.c; sourceTree = ""; }; F95FAFF90B34F1130072E431 /* macOSXLoad.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = macOSXLoad.test; sourceTree = ""; }; F962F7C60DADC26200648DB8 /* vsapi.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = vsapi.test; sourceTree = ""; }; F966BA0408F27A37005CB29B /* error.xbm */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = error.xbm; sourceTree = ""; }; @@ -2130,7 +2141,7 @@ F966C06F08F281DC005CB29B /* Frameworks */, 1AB674ADFE9D54B511CA2CBB /* Products */, ); - comments = "Copyright (c) 2004-2008 Daniel A. Steffen \n\nSee the file \"license.terms\" for information on usage and redistribution of\nthis file, and for a DISCLAIMER OF ALL WARRANTIES.\n\nRCS: @(#) $Id: project.pbxproj,v 1.40 2008/06/01 00:29:29 das Exp $\n"; + comments = "Copyright (c) 2004-2008 Daniel A. Steffen \n\nSee the file \"license.terms\" for information on usage and redistribution of\nthis file, and for a DISCLAIMER OF ALL WARRANTIES.\n\nRCS: @(#) $Id: project.pbxproj,v 1.41 2008/06/12 06:31:11 das Exp $\n"; name = Wish; path = .; sourceTree = SOURCE_ROOT; @@ -3314,6 +3325,7 @@ F96D3F0008F272A7004A47F5 /* tclIOCmd.c */, F96D3F0108F272A7004A47F5 /* tclIOGT.c */, F96D3F0208F272A7004A47F5 /* tclIORChan.c */, + F95D77E90DFD820D00A8BF6F /* tclIORTrans.c */, F96D3F0308F272A7004A47F5 /* tclIOSock.c */, F96D3F0408F272A7004A47F5 /* tclIOUtil.c */, F96D3F0508F272A7004A47F5 /* tclLink.c */, @@ -3928,7 +3940,7 @@ F9EA4ADE08FA3B7F00B1F5F0 /* Rez */, 8DD76FAB0486AB0100D96B5E /* Sources */, 8DD76FAD0486AB0100D96B5E /* Frameworks */, - F975AC0108F824170068008A /* ShellScript */, + F95FA74C0B32CE190072E431 /* ShellScript */, ); buildRules = ( ); @@ -3940,24 +3952,9 @@ productReference = 8DD76FB20486AB0100D96B5E /* tktest */; productType = "com.apple.product-type.tool"; }; - F9E61D16090A3E94002B3151 /* Tk */ = { - isa = PBXNativeTarget; - buildConfigurationList = F95CC8AB09158F3100EA5ACE /* Build configuration list for PBXNativeTarget "Tk" */; - buildPhases = ( - F97AF02F0B665DA900310EA2 /* ShellScript */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Tk; - productName = Wish; - productReference = F9A3084B08F2D4CE00BAE1AB /* Wish.app */; - productType = "com.apple.product-type.application"; - }; - F9FD30B30CC1AD070073837D /* tktest-X11 */ = { + F97258A50A86873C00096C78 /* tktest-X11 */ = { isa = PBXNativeTarget; - buildConfigurationList = F9FD31E80CC1AD070073837D /* Build configuration list for PBXNativeTarget "tktest-X11" */; + buildConfigurationList = F97258A80A86873D00096C78 /* Build configuration list for PBXNativeTarget "tktest-X11" */; buildPhases = ( F9FD30B40CC1AD070073837D /* ShellScript */, F9FD30B50CC1AD070073837D /* ShellScript */, @@ -3974,13 +3971,28 @@ productReference = F9FD31F40CC1AD070073837D /* tktest-X11 */; productType = "com.apple.product-type.tool"; }; + F9E61D16090A3E94002B3151 /* Tk */ = { + isa = PBXNativeTarget; + buildConfigurationList = F95CC8AB09158F3100EA5ACE /* Build configuration list for PBXNativeTarget "Tk" */; + buildPhases = ( + F97AF02F0B665DA900310EA2 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Tk; + productName = Wish; + productReference = F9A3084B08F2D4CE00BAE1AB /* Wish.app */; + productType = "com.apple.product-type.application"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 08FB7793FE84155DC02AAC07 /* Project object */ = { isa = PBXProject; attributes = { - BuildIndependentTargetsInParallel = NO; + BuildIndependentTargetsInParallel = YES; }; buildConfigurationList = F95CC8B509158F3100EA5ACE /* Build configuration list for PBXProject "Wish" */; compatibilityVersion = "Xcode 3.1"; @@ -3991,7 +4003,7 @@ targets = ( F9E61D16090A3E94002B3151 /* Tk */, 8DD76FA90486AB0100D96B5E /* tktest */, - F9FD30B30CC1AD070073837D /* tktest-X11 */, + F97258A50A86873C00096C78 /* tktest-X11 */, ); }; /* End PBXProject section */ @@ -4011,7 +4023,7 @@ /* End PBXRezBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - F975AC0108F824170068008A /* ShellScript */ = { + F95FA74C0B32CE190072E431 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -4025,7 +4037,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/bash; - shellScript = "touch -t $(date -r $(expr $(date '+%s') + 5) '+%Y%m%d%H%M.%S') \"${TARGET_TEMP_DIR}/stamp\"\n\n## Xcode bug workaround: Rezzing does not take place for commandline tool targets\n## even when a ResourceManager Resources phase is present, but this script phase's\n## input dependency on the final merged resource file forces the Rezzing.\n\nif [ \"${ZERO_LINK}\" = \"YES\" ]; then\n ## ZeroLinking ignores OTHER_LDFLAGS, so our resource file doesn't get linked into the executable.\n ## workaround: copy resource data into resource fork of zerolink launcher (will only work on HFS+).\n cp -f \"${SCRIPT_INPUT_FILE_1}\" \"${SCRIPT_INPUT_FILE_0}/..namedfork/rsrc\"\nfi\n"; + shellScript = "touch -t $(date -r $(expr $(date '+%s') + 5) '+%Y%m%d%H%M.%S') \"${TARGET_TEMP_DIR}/stamp\"\n\n## Xcode bug workaround: Rezzing does not take place for commandline tool targets\n## even when a ResourceManager Resources phase is present, but this script phase's\n## input dependency on the final merged resource file forces the Rezzing.\n"; showEnvVarsInLog = 0; }; F97AF02F0B665DA900310EA2 /* ShellScript */ = { @@ -4169,6 +4181,7 @@ F96D459F08F272BC004A47F5 /* tclIOCmd.c in Sources */, F96D45A008F272BC004A47F5 /* tclIOGT.c in Sources */, F96D45A108F272BC004A47F5 /* tclIORChan.c in Sources */, + F95D77EA0DFD820D00A8BF6F /* tclIORTrans.c in Sources */, F96D45A208F272BC004A47F5 /* tclIOSock.c in Sources */, F96D45A308F272BC004A47F5 /* tclIOUtil.c in Sources */, F96D45A408F272BC004A47F5 /* tclLink.c in Sources */, @@ -4290,6 +4303,7 @@ F96D4AD208F272CA004A47F5 /* tclUnixSock.c in Sources */, F96D4AD408F272CA004A47F5 /* tclUnixThrd.c in Sources */, F96D4AD608F272CA004A47F5 /* tclUnixTime.c in Sources */, + F9F4415E0C8BAE6F00BCCD67 /* tclDTrace.d in Sources */, F966BDCF08F27A3F005CB29B /* tk3d.c in Sources */, F966BDD108F27A3F005CB29B /* tkArgv.c in Sources */, F966BDD208F27A3F005CB29B /* tkAtom.c in Sources */, @@ -4437,7 +4451,6 @@ F966C02C08F27A42005CB29B /* xgc.c in Sources */, F966C02D08F27A42005CB29B /* ximage.c in Sources */, F966C02E08F27A42005CB29B /* xutil.c in Sources */, - F9F4415E0C8BAE6F00BCCD67 /* tclDTrace.d in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4479,6 +4492,7 @@ F9FD30DB0CC1AD070073837D /* tclIOCmd.c in Sources */, F9FD30DC0CC1AD070073837D /* tclIOGT.c in Sources */, F9FD30DD0CC1AD070073837D /* tclIORChan.c in Sources */, + F9FFAF1D0DFDDB26007F8A6A /* tclIORTrans.c in Sources */, F9FD30DE0CC1AD070073837D /* tclIOSock.c in Sources */, F9FD30DF0CC1AD070073837D /* tclIOUtil.c in Sources */, F9FD30E00CC1AD070073837D /* tclLink.c in Sources */, @@ -4489,6 +4503,14 @@ F9FD30E50CC1AD070073837D /* tclNamesp.c in Sources */, F9FD30E60CC1AD070073837D /* tclNotify.c in Sources */, F9FD30E70CC1AD070073837D /* tclObj.c in Sources */, + F9FFAF1F0DFDDB2F007F8A6A /* tclOO.c in Sources */, + F9FFAF200DFDDB32007F8A6A /* tclOOBasic.c in Sources */, + F9FFAF210DFDDB32007F8A6A /* tclOOCall.c in Sources */, + F9FFAF220DFDDB34007F8A6A /* tclOODefineCmds.c in Sources */, + F9FFAF230DFDDB35007F8A6A /* tclOOInfo.c in Sources */, + F9FFAF240DFDDB36007F8A6A /* tclOOMethod.c in Sources */, + F9FFAF250DFDDB37007F8A6A /* tclOOStubInit.c in Sources */, + F9FFAF260DFDDB38007F8A6A /* tclOOStubLib.c in Sources */, F9FD30E80CC1AD070073837D /* tclPanic.c in Sources */, F9FD30E90CC1AD070073837D /* tclParse.c in Sources */, F9FD30EA0CC1AD070073837D /* tclPathObj.c in Sources */, @@ -4592,6 +4614,7 @@ F9FD314C0CC1AD070073837D /* tclUnixSock.c in Sources */, F9FD314D0CC1AD070073837D /* tclUnixThrd.c in Sources */, F9FD314E0CC1AD070073837D /* tclUnixTime.c in Sources */, + F9FD31E20CC1AD070073837D /* tclDTrace.d in Sources */, F9FD314F0CC1AD070073837D /* tk3d.c in Sources */, F9FD31500CC1AD070073837D /* tkArgv.c in Sources */, F9FD31510CC1AD070073837D /* tkAtom.c in Sources */, @@ -4721,7 +4744,6 @@ F9FD31FE0CC1ADB70073837D /* tkUnixSend.c in Sources */, F9FD32000CC1ADB70073837D /* tkUnixWm.c in Sources */, F9FD31FB0CC1ADB70073837D /* tkUnixXId.c in Sources */, - F9FD31E20CC1AD070073837D /* tclDTrace.d in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4751,11 +4773,8 @@ isa = XCBuildConfiguration; baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Wish-Release.xcconfig */; buildSettings = { - ARCHS = ( - ppc, - i386, - ); - CFLAGS = "-arch ppc -arch i386 $(CFLAGS)"; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CFLAGS = "-arch i386 -arch ppc $(CFLAGS)"; MACOSX_DEPLOYMENT_TARGET = 10.5; PREBINDING = NO; }; @@ -4780,6 +4799,22 @@ }; name = DebugMemCompile; }; + F93084390BB93D2800CD0B9E /* DebugMemCompile */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + /usr/X11R6/include, + /usr/X11R6/include/freetype2, + "$(HEADER_SEARCH_PATHS)", + ); + LIBRARY_SEARCH_PATHS = ( + /usr/X11R6/lib, + "$(LIBRARY_SEARCH_PATHS)", + ); + PRODUCT_NAME = "tktest-X11"; + }; + name = DebugMemCompile; + }; F930843A0BB93D2800CD0B9E /* DebugMemCompile */ = { isa = XCBuildConfiguration; baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Wish-Debug.xcconfig */; @@ -4824,7 +4859,7 @@ }; name = DebugGCov; }; - F9359C120DF21B7800E04F67 /* DebugGCov */ = { + F9359B280DF212DA00E04F67 /* DebugGCov */ = { isa = XCBuildConfiguration; buildSettings = { HEADER_SEARCH_PATHS = ( @@ -4880,7 +4915,6 @@ "$(OTHER_LDFLAGS)", ); PRODUCT_NAME = tktest; - ZERO_LINK = YES; }; name = Debug; }; @@ -4920,7 +4954,7 @@ baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Wish-Release.xcconfig */; buildSettings = { MACOSX_DEPLOYMENT_TARGET = 10.5; - PREBINDING = YES; + PREBINDING = NO; }; name = Release; }; @@ -4933,7 +4967,7 @@ }; name = DebugNoFixZL; }; - F98A2A230D85F1CB002A40A7 /* Debug gcc42 */ = { + F97258A90A86873D00096C78 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { CONFIGURE_ARGS = "tcl_cv_cc_visibility_hidden=no $(CONFIGURE_ARGS)"; @@ -4954,21 +4988,28 @@ "$(LIBRARY_SEARCH_PATHS)", ); PRODUCT_NAME = "tktest-X11"; - ZERO_LINK = YES; }; - name = "Debug gcc42"; + name = Debug; }; - F98A2A270D85F1DB002A40A7 /* Debug llvmgcc42 */ = { + F97258AA0A86873D00096C78 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CONFIGURE_ARGS = "tcl_cv_cc_visibility_hidden=no $(CONFIGURE_ARGS)"; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_PREPROCESSOR_DEFINITIONS = ( - "__private_extern__=extern", - "$(GCC_PREPROCESSOR_DEFINITIONS)", + HEADER_SEARCH_PATHS = ( + /usr/X11R6/include, + /usr/X11R6/include/freetype2, + "$(HEADER_SEARCH_PATHS)", ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; + LIBRARY_SEARCH_PATHS = ( + /usr/X11R6/lib, + "$(LIBRARY_SEARCH_PATHS)", + ); + PRODUCT_NAME = "tktest-X11"; + }; + name = Release; + }; + F97258AB0A86873D00096C78 /* DebugNoFixZL */ = { + isa = XCBuildConfiguration; + buildSettings = { HEADER_SEARCH_PATHS = ( /usr/X11R6/include, /usr/X11R6/include/freetype2, @@ -4979,20 +5020,30 @@ "$(LIBRARY_SEARCH_PATHS)", ); PRODUCT_NAME = "tktest-X11"; - ZERO_LINK = YES; }; - name = "Debug llvmgcc42"; + name = DebugNoFixZL; }; - F98A2A2B0D85F1E7002A40A7 /* ReleaseUniversal gcc42 */ = { + F97258AC0A86873D00096C78 /* ReleaseUniversal */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = ( - ppc, - ppc64, - i386, - x86_64, + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CFLAGS = "-arch i386 -arch x86_64 -arch ppc -arch ppc64 $(CFLAGS)"; + HEADER_SEARCH_PATHS = ( + /usr/X11R6/include, + /usr/X11R6/include/freetype2, + "$(HEADER_SEARCH_PATHS)", + ); + LIBRARY_SEARCH_PATHS = ( + /usr/X11R6/lib, + "$(LIBRARY_SEARCH_PATHS)", ); - CFLAGS = "-arch ppc -arch ppc64 -arch i386 -arch x86_64 $(CFLAGS)"; + PRODUCT_NAME = "tktest-X11"; + }; + name = ReleaseUniversal; + }; + F97AED080B660A6C00310EA2 /* ReleaseUniversal10.4uSDK */ = { + isa = XCBuildConfiguration; + buildSettings = { HEADER_SEARCH_PATHS = ( /usr/X11R6/include, /usr/X11R6/include/freetype2, @@ -5004,9 +5055,9 @@ ); PRODUCT_NAME = "tktest-X11"; }; - name = "ReleaseUniversal gcc42"; + name = ReleaseUniversal10.4uSDK; }; - F98A2A2F0D85F1EC002A40A7 /* ReleaseUniversal llvmgcc42 */ = { + F97AED0F0B660AA300310EA2 /* ReleasePPC10.3.9SDK */ = { isa = XCBuildConfiguration; buildSettings = { HEADER_SEARCH_PATHS = ( @@ -5020,7 +5071,164 @@ ); PRODUCT_NAME = "tktest-X11"; }; - name = "ReleaseUniversal llvmgcc42"; + name = ReleasePPC10.3.9SDK; + }; + F97AED160B660AF100310EA2 /* ReleasePPC10.2.8SDK */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + /usr/X11R6/include, + /usr/X11R6/include/freetype2, + "$(HEADER_SEARCH_PATHS)", + ); + LIBRARY_SEARCH_PATHS = ( + /usr/X11R6/lib, + "$(LIBRARY_SEARCH_PATHS)", + ); + PRODUCT_NAME = "tktest-X11"; + }; + name = ReleasePPC10.2.8SDK; + }; + F97AED1B0B660B2100310EA2 /* Debug64bit */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = Wish; + SKIP_INSTALL = NO; + }; + name = Debug64bit; + }; + F97AED1C0B660B2100310EA2 /* Debug64bit */ = { + isa = XCBuildConfiguration; + buildSettings = { + OTHER_LDFLAGS = ( + "$(OTHER_LDFLAGS_AQUA)", + "$(OTHER_LDFLAGS)", + ); + PRODUCT_NAME = tktest; + }; + name = Debug64bit; + }; + F97AED1D0B660B2100310EA2 /* Debug64bit */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + /usr/X11R6/include, + /usr/X11R6/include/freetype2, + "$(HEADER_SEARCH_PATHS)", + ); + LIBRARY_SEARCH_PATHS = ( + /usr/X11R6/lib, + "$(LIBRARY_SEARCH_PATHS)", + ); + PRODUCT_NAME = "tktest-X11"; + }; + name = Debug64bit; + }; + F97AED1E0B660B2100310EA2 /* Debug64bit */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Wish-Debug.xcconfig */; + buildSettings = { + ARCHS = "$(NATIVE_ARCH_64_BIT)"; + CONFIGURE_ARGS = "--enable-64bit $(CONFIGURE_ARGS)"; + CPPFLAGS = "-arch $(NATIVE_ARCH_64_BIT) $(CPPFLAGS)"; + MACOSX_DEPLOYMENT_TARGET = 10.5; + PREBINDING = NO; + }; + name = Debug64bit; + }; + F987512F0DE7B57E00B1C9EC /* DebugNoCF */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Wish-Debug.xcconfig */; + buildSettings = { + CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --disable-corefoundation"; + MACOSX_DEPLOYMENT_TARGET = 10.5; + PREBINDING = NO; + }; + name = DebugNoCF; + }; + F98751300DE7B57E00B1C9EC /* DebugNoCF */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --enable-corefoundation"; + PRODUCT_NAME = Wish; + SKIP_INSTALL = NO; + }; + name = DebugNoCF; + }; + F98751310DE7B57E00B1C9EC /* DebugNoCF */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --enable-corefoundation"; + OTHER_LDFLAGS = ( + "$(OTHER_LDFLAGS_AQUA)", + "$(OTHER_LDFLAGS)", + ); + PRODUCT_NAME = tktest; + }; + name = DebugNoCF; + }; + F98751320DE7B57E00B1C9EC /* DebugNoCF */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + /usr/X11R6/include, + /usr/X11R6/include/freetype2, + "$(HEADER_SEARCH_PATHS)", + ); + LIBRARY_SEARCH_PATHS = ( + /usr/X11R6/lib, + "$(LIBRARY_SEARCH_PATHS)", + ); + PRODUCT_NAME = "tktest-X11"; + }; + name = DebugNoCF; + }; + F98751330DE7B5A200B1C9EC /* DebugNoCFUnthreaded */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Wish-Debug.xcconfig */; + buildSettings = { + CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --disable-threads --disable-corefoundation"; + MACOSX_DEPLOYMENT_TARGET = 10.5; + PREBINDING = NO; + }; + name = DebugNoCFUnthreaded; + }; + F98751340DE7B5A200B1C9EC /* DebugNoCFUnthreaded */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --enable-corefoundation"; + PRODUCT_NAME = Wish; + SKIP_INSTALL = NO; + }; + name = DebugNoCFUnthreaded; + }; + F98751350DE7B5A200B1C9EC /* DebugNoCFUnthreaded */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONFIGURE_ARGS = "$(CONFIGURE_ARGS) --enable-corefoundation"; + OTHER_LDFLAGS = ( + "$(OTHER_LDFLAGS_AQUA)", + "$(OTHER_LDFLAGS)", + ); + PRODUCT_NAME = tktest; + }; + name = DebugNoCFUnthreaded; + }; + F98751360DE7B5A200B1C9EC /* DebugNoCFUnthreaded */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + /usr/X11R6/include, + /usr/X11R6/include/freetype2, + "$(HEADER_SEARCH_PATHS)", + ); + LIBRARY_SEARCH_PATHS = ( + /usr/X11R6/lib, + "$(LIBRARY_SEARCH_PATHS)", + ); + PRODUCT_NAME = "tktest-X11"; + }; + name = DebugNoCFUnthreaded; }; F9988AB10D814C6500B6B03B /* Debug gcc42 */ = { isa = XCBuildConfiguration; @@ -5056,7 +5264,30 @@ "$(OTHER_LDFLAGS)", ); PRODUCT_NAME = tktest; - ZERO_LINK = YES; + }; + name = "Debug gcc42"; + }; + F9988AB40D814C6500B6B03B /* Debug gcc42 */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONFIGURE_ARGS = "tcl_cv_cc_visibility_hidden=no $(CONFIGURE_ARGS)"; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "__private_extern__=extern", + "$(GCC_PREPROCESSOR_DEFINITIONS)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + HEADER_SEARCH_PATHS = ( + /usr/X11R6/include, + /usr/X11R6/include/freetype2, + "$(HEADER_SEARCH_PATHS)", + ); + LIBRARY_SEARCH_PATHS = ( + /usr/X11R6/lib, + "$(LIBRARY_SEARCH_PATHS)", + ); + PRODUCT_NAME = "tktest-X11"; }; name = "Debug gcc42"; }; @@ -5064,8 +5295,8 @@ isa = XCBuildConfiguration; baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Wish-Debug.xcconfig */; buildSettings = { - GCC = "$(DEVELOPER_DIR)/usr/bin/llvm-gcc"; - GCC_VERSION = 4.2; + CC = "$(DEVELOPER_DIR)/usr/bin/llvm-gcc-4.2"; + GCC_VERSION = com.apple.compilers.llvmgcc42; MACOSX_DEPLOYMENT_TARGET = 10.5; PREBINDING = NO; }; @@ -5095,7 +5326,30 @@ "$(OTHER_LDFLAGS)", ); PRODUCT_NAME = tktest; - ZERO_LINK = YES; + }; + name = "Debug llvmgcc42"; + }; + F9988AB80D814C7500B6B03B /* Debug llvmgcc42 */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONFIGURE_ARGS = "tcl_cv_cc_visibility_hidden=no $(CONFIGURE_ARGS)"; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "__private_extern__=extern", + "$(GCC_PREPROCESSOR_DEFINITIONS)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + HEADER_SEARCH_PATHS = ( + /usr/X11R6/include, + /usr/X11R6/include/freetype2, + "$(HEADER_SEARCH_PATHS)", + ); + LIBRARY_SEARCH_PATHS = ( + /usr/X11R6/lib, + "$(LIBRARY_SEARCH_PATHS)", + ); + PRODUCT_NAME = "tktest-X11"; }; name = "Debug llvmgcc42"; }; @@ -5103,11 +5357,8 @@ isa = XCBuildConfiguration; baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Wish-Release.xcconfig */; buildSettings = { - ARCHS = ( - ppc, - i386, - ); - CFLAGS = "-arch ppc -arch i386 $(CFLAGS)"; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CFLAGS = "-arch i386 -arch ppc $(CFLAGS)"; GCC_VERSION = 4.2; MACOSX_DEPLOYMENT_TARGET = 10.5; PREBINDING = NO; @@ -5133,21 +5384,39 @@ }; name = "ReleaseUniversal gcc42"; }; + F9988BB40D81586D00B6B03B /* ReleaseUniversal gcc42 */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CFLAGS = "-arch i386 -arch x86_64 -arch ppc -arch ppc64 $(CFLAGS)"; + HEADER_SEARCH_PATHS = ( + /usr/X11R6/include, + /usr/X11R6/include/freetype2, + "$(HEADER_SEARCH_PATHS)", + ); + LIBRARY_SEARCH_PATHS = ( + /usr/X11R6/lib, + "$(LIBRARY_SEARCH_PATHS)", + ); + PRODUCT_NAME = "tktest-X11"; + }; + name = "ReleaseUniversal gcc42"; + }; F9988BB50D81587400B6B03B /* ReleaseUniversal llvmgcc42 */ = { isa = XCBuildConfiguration; baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Wish-Release.xcconfig */; buildSettings = { - ARCHS = ( - ppc, - i386, - ); - CFLAGS = "-arch ppc -arch i386 $(CFLAGS)"; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CC = "$(DEVELOPER_DIR)/usr/bin/llvm-gcc-4.2"; + CFLAGS = "-arch i386 -arch ppc $(CFLAGS)"; DEBUG_INFORMATION_FORMAT = dwarf; - GCC = "$(DEVELOPER_DIR)/usr/bin/llvm-gcc"; GCC_OPTIMIZATION_LEVEL = 4; - GCC_VERSION = 4.2; + GCC_VERSION = com.apple.compilers.llvmgcc42; MACOSX_DEPLOYMENT_TARGET = 10.5; - OTHER_CFLAGS = "-emit-llvm"; + OTHER_CFLAGS = ( + "$(OTHER_CFLAGS)", + "-emit-llvm", + ); PREBINDING = NO; TCL_CONFIGURE_ARGS = "$(TCL_CONFIGURE_ARGS) --disable-dtrace"; }; @@ -5172,6 +5441,24 @@ }; name = "ReleaseUniversal llvmgcc42"; }; + F9988BB80D81587400B6B03B /* ReleaseUniversal llvmgcc42 */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CFLAGS = "-arch i386 -arch x86_64 -arch ppc -arch ppc64 $(CFLAGS)"; + HEADER_SEARCH_PATHS = ( + /usr/X11R6/include, + /usr/X11R6/include/freetype2, + "$(HEADER_SEARCH_PATHS)", + ); + LIBRARY_SEARCH_PATHS = ( + /usr/X11R6/lib, + "$(LIBRARY_SEARCH_PATHS)", + ); + PRODUCT_NAME = "tktest-X11"; + }; + name = "ReleaseUniversal llvmgcc42"; + }; F99EE73B0BE835310060D4AF /* DebugUnthreaded */ = { isa = XCBuildConfiguration; buildSettings = { @@ -5210,6 +5497,38 @@ }; name = DebugLeaks; }; + F99EE73F0BE835310060D4AF /* DebugUnthreaded */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + /usr/X11R6/include, + /usr/X11R6/include/freetype2, + "$(HEADER_SEARCH_PATHS)", + ); + LIBRARY_SEARCH_PATHS = ( + /usr/X11R6/lib, + "$(LIBRARY_SEARCH_PATHS)", + ); + PRODUCT_NAME = "tktest-X11"; + }; + name = DebugUnthreaded; + }; + F99EE7400BE835310060D4AF /* DebugLeaks */ = { + isa = XCBuildConfiguration; + buildSettings = { + HEADER_SEARCH_PATHS = ( + /usr/X11R6/include, + /usr/X11R6/include/freetype2, + "$(HEADER_SEARCH_PATHS)", + ); + LIBRARY_SEARCH_PATHS = ( + /usr/X11R6/lib, + "$(LIBRARY_SEARCH_PATHS)", + ); + PRODUCT_NAME = "tktest-X11"; + }; + name = DebugLeaks; + }; F99EE7410BE835310060D4AF /* DebugUnthreaded */ = { isa = XCBuildConfiguration; baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Wish-Debug.xcconfig */; @@ -5256,11 +5575,8 @@ isa = XCBuildConfiguration; baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Wish-Release.xcconfig */; buildSettings = { - ARCHS = ( - ppc, - i386, - ); - CFLAGS = "-arch ppc -arch i386 $(CFLAGS)"; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CFLAGS = "-arch i386 -arch ppc $(CFLAGS)"; CPPFLAGS = "-isysroot $(SDKROOT) $(CPPFLAGS)"; MACOSX_DEPLOYMENT_TARGET = 10.4; PREBINDING = NO; @@ -5360,160 +5676,11 @@ }; name = ReleaseUniversal10.5SDK; }; - F9EEED990C2FEFD300396116 /* ReleaseUniversal10.5SDK */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Wish-Release.xcconfig */; - buildSettings = { - ARCHS = ( - ppc, - i386, - ); - CFLAGS = "-arch ppc -arch i386 $(CFLAGS)"; - CPPFLAGS = "-isysroot $(SDKROOT) $(CPPFLAGS)"; - MACOSX_DEPLOYMENT_TARGET = 10.5; - PREBINDING = NO; - SDKROOT = macosx10.5; - }; - name = ReleaseUniversal10.5SDK; - }; - F9FD31E90CC1AD070073837D /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CONFIGURE_ARGS = "tcl_cv_cc_visibility_hidden=no $(CONFIGURE_ARGS)"; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_PREPROCESSOR_DEFINITIONS = ( - "__private_extern__=extern", - "$(GCC_PREPROCESSOR_DEFINITIONS)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - HEADER_SEARCH_PATHS = ( - /usr/X11R6/include, - /usr/X11R6/include/freetype2, - "$(HEADER_SEARCH_PATHS)", - ); - LIBRARY_SEARCH_PATHS = ( - /usr/X11R6/lib, - "$(LIBRARY_SEARCH_PATHS)", - ); - PRODUCT_NAME = "tktest-X11"; - ZERO_LINK = YES; - }; - name = Debug; - }; - F9FD31EA0CC1AD070073837D /* DebugNoFixZL */ = { - isa = XCBuildConfiguration; - buildSettings = { - HEADER_SEARCH_PATHS = ( - /usr/X11R6/include, - /usr/X11R6/include/freetype2, - "$(HEADER_SEARCH_PATHS)", - ); - LIBRARY_SEARCH_PATHS = ( - /usr/X11R6/lib, - "$(LIBRARY_SEARCH_PATHS)", - ); - PRODUCT_NAME = "tktest-X11"; - }; - name = DebugNoFixZL; - }; - F9FD31EB0CC1AD070073837D /* DebugUnthreaded */ = { - isa = XCBuildConfiguration; - buildSettings = { - HEADER_SEARCH_PATHS = ( - /usr/X11R6/include, - /usr/X11R6/include/freetype2, - "$(HEADER_SEARCH_PATHS)", - ); - LIBRARY_SEARCH_PATHS = ( - /usr/X11R6/lib, - "$(LIBRARY_SEARCH_PATHS)", - ); - PRODUCT_NAME = "tktest-X11"; - }; - name = DebugUnthreaded; - }; - F9FD31EC0CC1AD070073837D /* DebugMemCompile */ = { - isa = XCBuildConfiguration; - buildSettings = { - HEADER_SEARCH_PATHS = ( - /usr/X11R6/include, - /usr/X11R6/include/freetype2, - "$(HEADER_SEARCH_PATHS)", - ); - LIBRARY_SEARCH_PATHS = ( - /usr/X11R6/lib, - "$(LIBRARY_SEARCH_PATHS)", - ); - PRODUCT_NAME = "tktest-X11"; - }; - name = DebugMemCompile; - }; - F9FD31ED0CC1AD070073837D /* DebugLeaks */ = { - isa = XCBuildConfiguration; - buildSettings = { - HEADER_SEARCH_PATHS = ( - /usr/X11R6/include, - /usr/X11R6/include/freetype2, - "$(HEADER_SEARCH_PATHS)", - ); - LIBRARY_SEARCH_PATHS = ( - /usr/X11R6/lib, - "$(LIBRARY_SEARCH_PATHS)", - ); - PRODUCT_NAME = "tktest-X11"; - }; - name = DebugLeaks; - }; - F9FD31EE0CC1AD070073837D /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - HEADER_SEARCH_PATHS = ( - /usr/X11R6/include, - /usr/X11R6/include/freetype2, - "$(HEADER_SEARCH_PATHS)", - ); - LIBRARY_SEARCH_PATHS = ( - /usr/X11R6/lib, - "$(LIBRARY_SEARCH_PATHS)", - ); - PRODUCT_NAME = "tktest-X11"; - }; - name = Release; - }; - F9FD31EF0CC1AD070073837D /* ReleaseUniversal */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ( - ppc, - ppc64, - i386, - x86_64, - ); - CFLAGS = "-arch ppc -arch ppc64 -arch i386 -arch x86_64 $(CFLAGS)"; - HEADER_SEARCH_PATHS = ( - /usr/X11R6/include, - /usr/X11R6/include/freetype2, - "$(HEADER_SEARCH_PATHS)", - ); - LIBRARY_SEARCH_PATHS = ( - /usr/X11R6/lib, - "$(LIBRARY_SEARCH_PATHS)", - ); - PRODUCT_NAME = "tktest-X11"; - }; - name = ReleaseUniversal; - }; - F9FD31F00CC1AD070073837D /* ReleaseUniversal10.5SDK */ = { + F9EEED980C2FEFD300396116 /* ReleaseUniversal10.5SDK */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = ( - ppc, - ppc64, - i386, - x86_64, - ); - CFLAGS = "-arch ppc -arch ppc64 -arch i386 -arch x86_64 $(CFLAGS)"; + ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; + CFLAGS = "-arch i386 -arch x86_64 -arch ppc -arch ppc64 $(CFLAGS)"; HEADER_SEARCH_PATHS = ( /usr/X11R6/include, /usr/X11R6/include/freetype2, @@ -5527,53 +5694,18 @@ }; name = ReleaseUniversal10.5SDK; }; - F9FD31F10CC1AD070073837D /* ReleaseUniversal10.4uSDK */ = { - isa = XCBuildConfiguration; - buildSettings = { - HEADER_SEARCH_PATHS = ( - /usr/X11R6/include, - /usr/X11R6/include/freetype2, - "$(HEADER_SEARCH_PATHS)", - ); - LIBRARY_SEARCH_PATHS = ( - /usr/X11R6/lib, - "$(LIBRARY_SEARCH_PATHS)", - ); - PRODUCT_NAME = "tktest-X11"; - }; - name = ReleaseUniversal10.4uSDK; - }; - F9FD31F20CC1AD070073837D /* ReleasePPC10.3.9SDK */ = { - isa = XCBuildConfiguration; - buildSettings = { - HEADER_SEARCH_PATHS = ( - /usr/X11R6/include, - /usr/X11R6/include/freetype2, - "$(HEADER_SEARCH_PATHS)", - ); - LIBRARY_SEARCH_PATHS = ( - /usr/X11R6/lib, - "$(LIBRARY_SEARCH_PATHS)", - ); - PRODUCT_NAME = "tktest-X11"; - }; - name = ReleasePPC10.3.9SDK; - }; - F9FD31F30CC1AD070073837D /* ReleasePPC10.2.8SDK */ = { + F9EEED990C2FEFD300396116 /* ReleaseUniversal10.5SDK */ = { isa = XCBuildConfiguration; + baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Wish-Release.xcconfig */; buildSettings = { - HEADER_SEARCH_PATHS = ( - /usr/X11R6/include, - /usr/X11R6/include/freetype2, - "$(HEADER_SEARCH_PATHS)", - ); - LIBRARY_SEARCH_PATHS = ( - /usr/X11R6/lib, - "$(LIBRARY_SEARCH_PATHS)", - ); - PRODUCT_NAME = "tktest-X11"; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CFLAGS = "-arch i386 -arch ppc $(CFLAGS)"; + CPPFLAGS = "-isysroot $(SDKROOT) $(CPPFLAGS)"; + MACOSX_DEPLOYMENT_TARGET = 10.5; + PREBINDING = NO; + SDKROOT = macosx10.5; }; - name = ReleasePPC10.2.8SDK; + name = ReleaseUniversal10.5SDK; }; /* End XCBuildConfiguration section */ @@ -5586,9 +5718,12 @@ F9988AB60D814C7500B6B03B /* Debug llvmgcc42 */, F95CC8AE09158F3100EA5ACE /* DebugNoFixZL */, F99EE73B0BE835310060D4AF /* DebugUnthreaded */, + F98751300DE7B57E00B1C9EC /* DebugNoCF */, + F98751340DE7B5A200B1C9EC /* DebugNoCFUnthreaded */, F93084370BB93D2800CD0B9E /* DebugMemCompile */, F99EE73C0BE835310060D4AF /* DebugLeaks */, F9359B260DF212DA00E04F67 /* DebugGCov */, + F97AED1B0B660B2100310EA2 /* Debug64bit */, F95CC8AD09158F3100EA5ACE /* Release */, F91BCC4F093152310042A6BF /* ReleaseUniversal */, F9988BB20D81586D00B6B03B /* ReleaseUniversal gcc42 */, @@ -5609,9 +5744,12 @@ F9988AB70D814C7500B6B03B /* Debug llvmgcc42 */, F95CC8B309158F3100EA5ACE /* DebugNoFixZL */, F99EE73D0BE835310060D4AF /* DebugUnthreaded */, + F98751310DE7B57E00B1C9EC /* DebugNoCF */, + F98751350DE7B5A200B1C9EC /* DebugNoCFUnthreaded */, F93084380BB93D2800CD0B9E /* DebugMemCompile */, F99EE73E0BE835310060D4AF /* DebugLeaks */, F9359B270DF212DA00E04F67 /* DebugGCov */, + F97AED1C0B660B2100310EA2 /* Debug64bit */, F95CC8B209158F3100EA5ACE /* Release */, F91BCC50093152310042A6BF /* ReleaseUniversal */, F9988BB30D81586D00B6B03B /* ReleaseUniversal gcc42 */, @@ -5632,9 +5770,12 @@ F9988AB50D814C7500B6B03B /* Debug llvmgcc42 */, F95CC8B809158F3100EA5ACE /* DebugNoFixZL */, F99EE7410BE835310060D4AF /* DebugUnthreaded */, + F987512F0DE7B57E00B1C9EC /* DebugNoCF */, + F98751330DE7B5A200B1C9EC /* DebugNoCFUnthreaded */, F930843A0BB93D2800CD0B9E /* DebugMemCompile */, F99EE7420BE835310060D4AF /* DebugLeaks */, F9359B250DF212DA00E04F67 /* DebugGCov */, + F97AED1E0B660B2100310EA2 /* Debug64bit */, F95CC8B709158F3100EA5ACE /* Release */, F91BCC51093152310042A6BF /* ReleaseUniversal */, F9988BB10D81586D00B6B03B /* ReleaseUniversal gcc42 */, @@ -5647,25 +5788,28 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; - F9FD31E80CC1AD070073837D /* Build configuration list for PBXNativeTarget "tktest-X11" */ = { + F97258A80A86873D00096C78 /* Build configuration list for PBXNativeTarget "tktest-X11" */ = { isa = XCConfigurationList; buildConfigurations = ( - F9FD31E90CC1AD070073837D /* Debug */, - F98A2A230D85F1CB002A40A7 /* Debug gcc42 */, - F98A2A270D85F1DB002A40A7 /* Debug llvmgcc42 */, - F9FD31EA0CC1AD070073837D /* DebugNoFixZL */, - F9FD31EB0CC1AD070073837D /* DebugUnthreaded */, - F9FD31EC0CC1AD070073837D /* DebugMemCompile */, - F9FD31ED0CC1AD070073837D /* DebugLeaks */, - F9359C120DF21B7800E04F67 /* DebugGCov */, - F9FD31EE0CC1AD070073837D /* Release */, - F9FD31EF0CC1AD070073837D /* ReleaseUniversal */, - F98A2A2B0D85F1E7002A40A7 /* ReleaseUniversal gcc42 */, - F98A2A2F0D85F1EC002A40A7 /* ReleaseUniversal llvmgcc42 */, - F9FD31F00CC1AD070073837D /* ReleaseUniversal10.5SDK */, - F9FD31F10CC1AD070073837D /* ReleaseUniversal10.4uSDK */, - F9FD31F20CC1AD070073837D /* ReleasePPC10.3.9SDK */, - F9FD31F30CC1AD070073837D /* ReleasePPC10.2.8SDK */, + F97258A90A86873D00096C78 /* Debug */, + F9988AB40D814C6500B6B03B /* Debug gcc42 */, + F9988AB80D814C7500B6B03B /* Debug llvmgcc42 */, + F97258AB0A86873D00096C78 /* DebugNoFixZL */, + F99EE73F0BE835310060D4AF /* DebugUnthreaded */, + F98751320DE7B57E00B1C9EC /* DebugNoCF */, + F98751360DE7B5A200B1C9EC /* DebugNoCFUnthreaded */, + F93084390BB93D2800CD0B9E /* DebugMemCompile */, + F99EE7400BE835310060D4AF /* DebugLeaks */, + F9359B280DF212DA00E04F67 /* DebugGCov */, + F97AED1D0B660B2100310EA2 /* Debug64bit */, + F97258AA0A86873D00096C78 /* Release */, + F97258AC0A86873D00096C78 /* ReleaseUniversal */, + F9988BB40D81586D00B6B03B /* ReleaseUniversal gcc42 */, + F9988BB80D81587400B6B03B /* ReleaseUniversal llvmgcc42 */, + F9EEED980C2FEFD300396116 /* ReleaseUniversal10.5SDK */, + F97AED080B660A6C00310EA2 /* ReleaseUniversal10.4uSDK */, + F97AED0F0B660AA300310EA2 /* ReleasePPC10.3.9SDK */, + F97AED160B660AF100310EA2 /* ReleasePPC10.2.8SDK */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; -- cgit v0.12 From ad2d76384a25830d6f6801c262abd066cae7a033 Mon Sep 17 00:00:00 2001 From: das Date: Thu, 12 Jun 2008 06:31:32 +0000 Subject: * unix/tcl.m4 (SunOS-5.11): fix 64bit amd64 support with gcc & Sun cc. --- unix/tcl.m4 | 61 +++++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 39 insertions(+), 22 deletions(-) diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 6b09a17..1659a12 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1918,33 +1918,46 @@ dnl AC_CHECK_TOOL(AR, ar) ]) ], [AS_IF([test "$arch" = "amd64 i386"], [ AS_IF([test "$GCC" = yes], [ - AC_MSG_WARN([64bit mode not supported with GCC on $system]) + case $system in + SunOS-5.1[[1-9]]*|SunOS-5.[[2-9]][[0-9]]*) + do64bit_ok=yes + CFLAGS="$CFLAGS -m64" + LDFLAGS="$LDFLAGS -m64";; + *) + AC_MSG_WARN([64bit mode not supported with GCC on $system]);; + esac ], [ do64bit_ok=yes - CFLAGS="$CFLAGS -xarch=amd64" - LDFLAGS="$LDFLAGS -xarch=amd64" + case $system in + SunOS-5.1[[1-9]]*|SunOS-5.[[2-9]][[0-9]]*) + CFLAGS="$CFLAGS -m64" + LDFLAGS="$LDFLAGS -m64";; + *) + CFLAGS="$CFLAGS -xarch=amd64" + LDFLAGS="$LDFLAGS -xarch=amd64";; + esac ]) ], [AC_MSG_WARN([64bit mode not supported for $arch])])]) ]) - + #-------------------------------------------------------------------- # On Solaris 5.x i386 with the sunpro compiler we need to link - # with sunmath to get floating point rounding control - #-------------------------------------------------------------------- - AS_IF([test "$GCC" = yes],[use_sunmath=no],[ + # with sunmath to get floating point rounding control + #-------------------------------------------------------------------- + AS_IF([test "$GCC" = yes],[use_sunmath=no],[ arch=`isainfo` - AC_MSG_CHECKING([whether to use -lsunmath for fp rounding control]) + AC_MSG_CHECKING([whether to use -lsunmath for fp rounding control]) AS_IF([test "$arch" = "amd64 i386"], [ - AC_MSG_RESULT([yes]) + AC_MSG_RESULT([yes]) MATH_LIBS="-lsunmath $MATH_LIBS" - AC_CHECK_HEADER(sunmath.h) + AC_CHECK_HEADER(sunmath.h) use_sunmath=yes - ], [ + ], [ AC_MSG_RESULT([no]) use_sunmath=no - ]) - ]) - + ]) + ]) + # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. @@ -1957,16 +1970,20 @@ dnl AC_CHECK_TOOL(AR, ar) CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} AS_IF([test "$do64bit_ok" = yes], [ - # We need to specify -static-libgcc or we need to - # add the path to the sparv9 libgcc. - SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" - # for finding sparcv9 libgcc, get the regular libgcc - # path, remove so name and append 'sparcv9' - #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." - #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" + AS_IF([test "$arch" = "sparcv9 sparc"], [ + # We need to specify -static-libgcc or we need to + # add the path to the sparv9 libgcc. + SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" + # for finding sparcv9 libgcc, get the regular libgcc + # path, remove so name and append 'sparcv9' + #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." + #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" + ], [AS_IF([test "$arch" = "amd64 i386"], [ + SHLIB_LD="$SHLIB_LD -m64 -static-libgcc" + ])]) ]) ], [ - AS_IF([test "$use_sunmath" = yes], [textmode=textoff],[textmode=text]) + AS_IF([test "$use_sunmath" = yes], [textmode=textoff],[textmode=text]) case $system in SunOS-5.[[1-9]][[0-9]]*) SHLIB_LD="\${CC} -G -z $textmode \${LDFLAGS}";; -- cgit v0.12 From d638864d099f5c37dbaeeda18fa2d13e9afc240b Mon Sep 17 00:00:00 2001 From: das Date: Thu, 12 Jun 2008 06:31:53 +0000 Subject: * unix/configure: autoconf-2.59 --- unix/configure | 61 +++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 43 insertions(+), 18 deletions(-) diff --git a/unix/configure b/unix/configure index 77c6f4d..73e86a7 100755 --- a/unix/configure +++ b/unix/configure @@ -6615,14 +6615,27 @@ else if test "$GCC" = yes; then - { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 -echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} + case $system in + SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*) + do64bit_ok=yes + CFLAGS="$CFLAGS -m64" + LDFLAGS="$LDFLAGS -m64";; + *) + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 +echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;};; + esac else do64bit_ok=yes - CFLAGS="$CFLAGS -xarch=amd64" - LDFLAGS="$LDFLAGS -xarch=amd64" + case $system in + SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*) + CFLAGS="$CFLAGS -m64" + LDFLAGS="$LDFLAGS -m64";; + *) + CFLAGS="$CFLAGS -xarch=amd64" + LDFLAGS="$LDFLAGS -xarch=amd64";; + esac fi @@ -6640,21 +6653,21 @@ fi #-------------------------------------------------------------------- # On Solaris 5.x i386 with the sunpro compiler we need to link - # with sunmath to get floating point rounding control - #-------------------------------------------------------------------- - if test "$GCC" = yes; then + # with sunmath to get floating point rounding control + #-------------------------------------------------------------------- + if test "$GCC" = yes; then use_sunmath=no else arch=`isainfo` - echo "$as_me:$LINENO: checking whether to use -lsunmath for fp rounding control" >&5 + echo "$as_me:$LINENO: checking whether to use -lsunmath for fp rounding control" >&5 echo $ECHO_N "checking whether to use -lsunmath for fp rounding control... $ECHO_C" >&6 if test "$arch" = "amd64 i386"; then - echo "$as_me:$LINENO: result: yes" >&5 + echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 MATH_LIBS="-lsunmath $MATH_LIBS" - if test "${ac_cv_header_sunmath_h+set}" = set; then + if test "${ac_cv_header_sunmath_h+set}" = set; then echo "$as_me:$LINENO: checking for sunmath.h" >&5 echo $ECHO_N "checking for sunmath.h... $ECHO_C" >&6 if test "${ac_cv_header_sunmath_h+set}" = set; then @@ -6821,20 +6834,32 @@ fi LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} if test "$do64bit_ok" = yes; then - # We need to specify -static-libgcc or we need to - # add the path to the sparv9 libgcc. - SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" - # for finding sparcv9 libgcc, get the regular libgcc - # path, remove so name and append 'sparcv9' - #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." - #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" + if test "$arch" = "sparcv9 sparc"; then + + # We need to specify -static-libgcc or we need to + # add the path to the sparv9 libgcc. + SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" + # for finding sparcv9 libgcc, get the regular libgcc + # path, remove so name and append 'sparcv9' + #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." + #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" + +else + if test "$arch" = "amd64 i386"; then + + SHLIB_LD="$SHLIB_LD -m64 -static-libgcc" + +fi + +fi + fi else - if test "$use_sunmath" = yes; then + if test "$use_sunmath" = yes; then textmode=textoff else textmode=text -- cgit v0.12 From 441499b8ad2e4ecf4c08e3fc7dbe06553b0d9265 Mon Sep 17 00:00:00 2001 From: das Date: Thu, 12 Jun 2008 06:32:09 +0000 Subject: * macosx/tkMacOSXXStubs.c (Tk_ResetUserInactiveTime): use UsrActivity instead of OverallAct (which may be ignored in some circumstances). --- ChangeLog | 20 +++++++++++++++++++- macosx/tkMacOSXXStubs.c | 4 ++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ae0e15e..f8694a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2008-06-12 Daniel Steffen + + * generic/ttk/ttkTreeview.c: fix warning. + + * unix/tcl.m4 (SunOS-5.11): fix 64bit amd64 support with gcc & Sun cc. + * unix/configure: autoconf-2.59 + + * macosx/tkMacOSXXStubs.c (Tk_ResetUserInactiveTime): use UsrActivity + instead of OverallAct (which may be ignored in some circumstances). + + * macosx/Wish.xcodeproj/project.pbxproj: add tclIORTrans.c; add tclOO + * macosx/Wish.xcodeproj/default.pbxuser: files to tktest-X11 target; + add debug targets for 64bit and with corefoundation disabled; updates + and cleanup for Xcode 3.1 and for Leopard; sync with Tcl.xcodeproj. + * macosx/Wish.xcode/project.pbxproj: sync Wish.xcodeproj changes. + * macosx/Wish.xcode/default.pbxuser: + * macosx/README: document new build configs. + 2008-06-10 Joe English * unix/tkUnixKey.c: tkUnixKey.c: Use Xutf8LookupString if available @@ -7,7 +25,7 @@ 2008-06-01 Daniel Steffen * macosx/Wish.xcodeproj/project.pbxproj: add new tclOO files; add debug - * macosx/README: targets with gcov; update to + * macosx/README: configs with gcov; update to Xcode 3.1. 2008-05-27 Pat Thoyts diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c index 3f9c038..706c175 100644 --- a/macosx/tkMacOSXXStubs.c +++ b/macosx/tkMacOSXXStubs.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXXStubs.c,v 1.27 2008/05/03 21:12:55 das Exp $ + * RCS: @(#) $Id: tkMacOSXXStubs.c,v 1.28 2008/06/12 06:32:11 das Exp $ */ #include "tkMacOSXPrivate.h" @@ -1306,5 +1306,5 @@ void Tk_ResetUserInactiveTime( Display *dpy) { - UpdateSystemActivity(OverallAct); + UpdateSystemActivity(UsrActivity); } -- cgit v0.12 From 69c551e2161854eacae84b96ebaee955178bad80 Mon Sep 17 00:00:00 2001 From: das Date: Thu, 12 Jun 2008 06:49:14 +0000 Subject: s/target/config/ --- ChangeLog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f8694a8..c1733f8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,7 +10,7 @@ * macosx/Wish.xcodeproj/project.pbxproj: add tclIORTrans.c; add tclOO * macosx/Wish.xcodeproj/default.pbxuser: files to tktest-X11 target; - add debug targets for 64bit and with corefoundation disabled; updates + add debug configs for 64bit and with corefoundation disabled; updates and cleanup for Xcode 3.1 and for Leopard; sync with Tcl.xcodeproj. * macosx/Wish.xcode/project.pbxproj: sync Wish.xcodeproj changes. * macosx/Wish.xcode/default.pbxuser: @@ -339,7 +339,7 @@ * library/demos/widget: * macosx/Wish.xcodeproj/project.pbxproj: Add support for Xcode 3.1 and - * macosx/Wish.xcodeproj/default.pbxuser: targets for building with + * macosx/Wish.xcodeproj/default.pbxuser: configs for building with * macosx/Wish-Common.xcconfig: gcc-4.2 and llvm-gcc-4.2. * generic/tkCanvUtil.c: Fix gcc-4.2 warnings. -- cgit v0.12 From f12c70da2d6208293f2afb3d2181b40adb47ec67 Mon Sep 17 00:00:00 2001 From: das Date: Thu, 12 Jun 2008 17:08:59 +0000 Subject: * generic/tkPointer.c (Tk_UpdatePointer): fix failure to restore a global grab capture and to release the restrict window capture when releasing a button grab. Fixes segfault due to dangling reference to restrict window inside TkpSetCapture() implementation. [Bug 1991932] --- ChangeLog | 5 +++++ generic/tkPointer.c | 10 ++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index c1733f8..309884e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2008-06-12 Daniel Steffen + * generic/tkPointer.c (Tk_UpdatePointer): fix failure to restore a + global grab capture and to release the restrict window capture when + releasing a button grab. Fixes segfault due to dangling reference to + restrict window inside TkpSetCapture() implementation. [Bug 1991932] + * generic/ttk/ttkTreeview.c: fix warning. * unix/tcl.m4 (SunOS-5.11): fix 64bit amd64 support with gcc & Sun cc. diff --git a/generic/tkPointer.c b/generic/tkPointer.c index 3b38cbe..99b61b7 100644 --- a/generic/tkPointer.c +++ b/generic/tkPointer.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkPointer.c,v 1.10 2005/11/15 15:18:22 dkf Exp $ + * RCS: @(#) $Id: tkPointer.c,v 1.11 2008/06/12 17:08:59 das Exp $ */ #include "tkInt.h" @@ -309,14 +309,12 @@ Tk_UpdatePointer( /* * ButtonRelease - Release the mouse capture and clear the - * restrict window when the last button is released and we - * aren't in a global grab. + * restrict window when the last button is released. If we + * are in a global grab, restore the grab window capture. */ if ((tsdPtr->lastState & ALL_BUTTONS) == mask) { - if (!tsdPtr->grabWinPtr) { - TkpSetCapture(NULL); - } + TkpSetCapture(tsdPtr->grabWinPtr); } /* -- cgit v0.12 From ee10365fe5ddffde317320b6ac35d36b86b21dc4 Mon Sep 17 00:00:00 2001 From: Joe Mistachkin Date: Fri, 13 Jun 2008 05:46:08 +0000 Subject: TIP 285 Implementation --- ChangeLog | 9 ++++++++ generic/tkCmds.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++-------- win/makefile.vc | 8 ++++++- win/rules.vc | 8 ++++++- 4 files changed, 81 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 309884e..406e74d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-06-13 Joe Mistachkin + + TIP #285 IMPLEMENTATION + + * generic/tkCmds.c: During [tkwait] and [update], always cooperatively + check for script cancellation. + * win/makefile.vc: Added 'pdbs' option for Windows build rules to allow + * win/rules.vc: for non-debug builds with full symbols. + 2008-06-12 Daniel Steffen * generic/tkPointer.c (Tk_UpdatePointer): fix failure to restore a diff --git a/generic/tkCmds.c b/generic/tkCmds.c index 63d329c..8852ee8 100644 --- a/generic/tkCmds.c +++ b/generic/tkCmds.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCmds.c,v 1.41 2007/12/13 15:24:13 dgp Exp $ + * RCS: @(#) $Id: tkCmds.c,v 1.42 2008/06/13 05:46:09 mistachkin Exp $ */ #include "tkInt.h" @@ -915,6 +915,7 @@ Tk_TkwaitObjCmd( { Tk_Window tkwin = (Tk_Window) clientData; int done, index; + int code = TCL_OK; static const char *optionStrings[] = { "variable", "visibility", "window", NULL }; @@ -941,6 +942,10 @@ Tk_TkwaitObjCmd( } done = 0; while (!done) { + if (Tcl_Canceled(interp, TCL_LEAVE_ERR_MSG) == TCL_ERROR) { + code = TCL_ERROR; + break; + } Tcl_DoOneEvent(0); } Tcl_UntraceVar(interp, Tcl_GetString(objv[2]), @@ -960,9 +965,13 @@ Tk_TkwaitObjCmd( WaitVisibilityProc, (ClientData) &done); done = 0; while (!done) { + if (Tcl_Canceled(interp, TCL_LEAVE_ERR_MSG) == TCL_ERROR) { + code = TCL_ERROR; + break; + } Tcl_DoOneEvent(0); } - if (done != 1) { + if ((done != 0) && (done != 1)) { /* * Note that we do not delete the event handler because it was * deleted automatically when the window was destroyed. @@ -990,25 +999,38 @@ Tk_TkwaitObjCmd( WaitWindowProc, (ClientData) &done); done = 0; while (!done) { + if (Tcl_Canceled(interp, TCL_LEAVE_ERR_MSG) == TCL_ERROR) { + code = TCL_ERROR; + break; + } Tcl_DoOneEvent(0); } /* - * Note: there's no need to delete the event handler. It was deleted - * automatically when the window was destroyed. + * Note: normally there's no need to delete the event handler. It was deleted + * automatically when the window was destroyed; however, if the wait operation + * was canceled, we need to delete it. */ + if (done == 0) { + Tk_DeleteEventHandler(window, + StructureNotifyMask, + WaitWindowProc, (ClientData) &done); + } break; } } /* * Clear out the interpreter's result, since it may have been set by event - * handlers. + * handlers. This is skipped if an error occurred above, such as the wait + * operation being canceled. */ + if (code == TCL_OK) Tcl_ResetResult(interp); - return TCL_OK; + + return code; } /* ARGSUSED */ @@ -1082,6 +1104,7 @@ Tk_UpdateObjCmd( static const char *updateOptions[] = {"idletasks", NULL}; int flags, index; TkDisplay *dispPtr; + int code = TCL_OK; if (objc == 1) { flags = TCL_DONT_WAIT; @@ -1106,12 +1129,35 @@ Tk_UpdateObjCmd( while (1) { while (Tcl_DoOneEvent(flags) != 0) { - /* Empty loop body */ + if (Tcl_Canceled(interp, TCL_LEAVE_ERR_MSG) == TCL_ERROR) { + code = TCL_ERROR; + break; + } } + + /* + * If event processing was canceled proceed no further. + */ + + if (code == TCL_ERROR) + break; + for (dispPtr = TkGetDisplayList(); dispPtr != NULL; dispPtr = dispPtr->nextPtr) { XSync(dispPtr->display, False); } + + /* + * Check again if event processing has been canceled because the inner + * loop (above) may not have checked (i.e. no events were processed and + * the loop body was skipped). + */ + + if (Tcl_Canceled(interp, TCL_LEAVE_ERR_MSG) == TCL_ERROR) { + code = TCL_ERROR; + break; + } + if (Tcl_DoOneEvent(flags) == 0) { break; } @@ -1119,11 +1165,14 @@ Tk_UpdateObjCmd( /* * Must clear the interpreter's result because event handlers could have - * executed commands. + * executed commands. This is skipped if an error occurred above, such as + * the wait operation being canceled. */ + if (code == TCL_OK) Tcl_ResetResult(interp); - return TCL_OK; + + return code; } /* diff --git a/win/makefile.vc b/win/makefile.vc index b8a790e..9c1509e 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -13,7 +13,7 @@ # Copyright (c) 2003-2008 Pat Thoyts. # #------------------------------------------------------------------------------ -# RCS: @(#) $Id: makefile.vc,v 1.122 2008/05/15 00:06:19 patthoyts Exp $ +# RCS: @(#) $Id: makefile.vc,v 1.123 2008/06/13 05:46:09 mistachkin Exp $ #------------------------------------------------------------------------------ # Check to see we are configured to build with MSVC (MSDEVDIR or MSVCDIR) @@ -437,6 +437,9 @@ cdebug = $(OPTIMIZATIONS) !else cdebug = !endif +!if $(SYMBOLS) +cdebug = $(cdebug) -Zi +!endif !else if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64" ### Warnings are too many, can't support warnings into errors. cdebug = -Zi -Od $(DEBUGFLAGS) @@ -480,6 +483,9 @@ TK_CFLAGS = $(TK_CFLAGS) -DUSE_TCL_STUBS ldebug = -debug:full -debugtype:cv !else ldebug = -release -opt:ref -opt:icf,3 +!if $(SYMBOLS) +ldebug = $(ldebug) -debug:full -debugtype:cv +!endif !endif ### Declarations common to all linker options diff --git a/win/rules.vc b/win/rules.vc index 73215e8..4626bc1 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -11,7 +11,7 @@ # Copyright (c) 2003-2007 Patrick Thoyts # #------------------------------------------------------------------------------ -# RCS: @(#) $Id: rules.vc,v 1.22 2008/05/15 00:06:19 patthoyts Exp $ +# RCS: @(#) $Id: rules.vc,v 1.23 2008/06/13 05:46:09 mistachkin Exp $ #------------------------------------------------------------------------------ !ifndef _RULES_VC @@ -252,6 +252,12 @@ DEBUG = 1 !else DEBUG = 0 !endif +!if [nmakehlp -f $(OPTS) "pdbs"] +!message *** Doing pdbs +SYMBOLS = 1 +!else +SYMBOLS = 0 +!endif !if [nmakehlp -f $(OPTS) "profile"] !message *** Doing profile PROFILE = 1 -- cgit v0.12 From b1da42131f7821e1ee4d120f092c3a2f51f8a6d7 Mon Sep 17 00:00:00 2001 From: hobbs Date: Fri, 13 Jun 2008 21:49:31 +0000 Subject: * win/configure, win/configure.in (TK_WIN_VERSION): fix handling of interim a/b versioning for manifest usage. --- ChangeLog | 5 +++++ win/configure | 12 ++++++------ win/configure.in | 14 +++++++------- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 406e74d..0863da4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-06-13 Jeff Hobbs + + * win/configure, win/configure.in (TK_WIN_VERSION): fix handling + of interim a/b versioning for manifest usage. + 2008-06-13 Joe Mistachkin TIP #285 IMPLEMENTATION diff --git a/win/configure b/win/configure index 4172c39..67a501c 100755 --- a/win/configure +++ b/win/configure @@ -4068,14 +4068,14 @@ else fi # The wish.exe.manifest requires these -# TK_WIN_VERSION is the 4 dotted pair Windows version format -# Make sure the patch level doesn't contain extra dotted pairs (interim rel) -AB_PATCH_LEVEL="`echo $TK_PATCH_LEVEL | sed -e 's/\..*//'`" +# TK_WIN_VERSION is the 4 dotted pair Windows version format which needs +# the release level, and must account for interim release versioning case "$TK_PATCH_LEVEL" in - a*) TK_WIN_VERSION="$TK_VERSION.0.`echo $AB_PATCH_LEVEL | tr -d a`" ;; - b*) TK_WIN_VERSION="$TK_VERSION.1.`echo $AB_PATCH_LEVEL | tr -d b`" ;; - .*) TK_WIN_VERSION="$TK_VERSION.2$TK_PATCH_LEVEL" ;; + *a*) TK_RELEASE_LEVEL=0 ;; + *b*) TK_RELEASE_LEVEL=1 ;; + *) TK_RELEASE_LEVEL=2 ;; esac +TK_WIN_VERSION="$TK_VERSION.$TK_RELEASE_LEVEL.`echo $TK_PATCH_LEVEL | tr -d ab.`" # X86|AMD64|IA64 for manifest diff --git a/win/configure.in b/win/configure.in index 48ee9ed..f8d71a8 100644 --- a/win/configure.in +++ b/win/configure.in @@ -3,7 +3,7 @@ # generate the file "configure", which is run during Tk installation # to configure the system for the local environment. # -# RCS: @(#) $Id: configure.in,v 1.78 2008/04/01 16:30:56 dgp Exp $ +# RCS: @(#) $Id: configure.in,v 1.79 2008/06/13 21:49:31 hobbs Exp $ AC_INIT(../generic/tk.h) AC_PREREQ(2.59) @@ -230,14 +230,14 @@ else fi # The wish.exe.manifest requires these -# TK_WIN_VERSION is the 4 dotted pair Windows version format -# Make sure the patch level doesn't contain extra dotted pairs (interim rel) -AB_PATCH_LEVEL="`echo $TK_PATCH_LEVEL | sed -e 's/\..*//'`" +# TK_WIN_VERSION is the 4 dotted pair Windows version format which needs +# the release level, and must account for interim release versioning case "$TK_PATCH_LEVEL" in - a*) TK_WIN_VERSION="$TK_VERSION.0.`echo $AB_PATCH_LEVEL | tr -d a`" ;; - b*) TK_WIN_VERSION="$TK_VERSION.1.`echo $AB_PATCH_LEVEL | tr -d b`" ;; - .*) TK_WIN_VERSION="$TK_VERSION.2$TK_PATCH_LEVEL" ;; + *a*) TK_RELEASE_LEVEL=0 ;; + *b*) TK_RELEASE_LEVEL=1 ;; + *) TK_RELEASE_LEVEL=2 ;; esac +TK_WIN_VERSION="$TK_VERSION.$TK_RELEASE_LEVEL.`echo $TK_PATCH_LEVEL | tr -d ab.`" AC_SUBST(TK_WIN_VERSION) # X86|AMD64|IA64 for manifest AC_SUBST(MACHINE) -- cgit v0.12 From 9b1cfd8f9b483db1dbab08b0e0b881052e0392ef Mon Sep 17 00:00:00 2001 From: das Date: Thu, 19 Jun 2008 00:10:24 +0000 Subject: * macosx/tkMacOSXFont.c (TkpGetFontFromAttributes, InitFont): fix incorrect conversion to points of font sizes already in points; factor out retrieval of font family name from font family ID. --- macosx/tkMacOSXFont.c | 99 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 65 insertions(+), 34 deletions(-) diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c index 00d1976..c225e8f 100644 --- a/macosx/tkMacOSXFont.c +++ b/macosx/tkMacOSXFont.c @@ -5,7 +5,7 @@ * font package interface. This version uses ATSU instead of Quickdraw. * * Copyright 2002-2004 Benjamin Riefenstahl, Benjamin.Riefenstahl@epost.de - * Copyright (c) 2006-2007 Daniel A. Steffen + * Copyright (c) 2006-2008 Daniel A. Steffen * * Some functions were originally copied verbatim from the QuickDraw version * of tkMacOSXFont.c, which had these copyright notices: @@ -35,7 +35,7 @@ * that such fonts can not be used for controls, because controls * definitely require a family id (this assertion needs testing). * - * RCS: @(#) $Id: tkMacOSXFont.c,v 1.37 2007/12/13 15:27:09 dgp Exp $ + * RCS: @(#) $Id: tkMacOSXFont.c,v 1.38 2008/06/19 00:10:24 das Exp $ */ #include "tkMacOSXPrivate.h" @@ -213,8 +213,9 @@ static const Tcl_UniChar *UpdateLineBuffer(const MacFont *fontPtr, * Initialization and setup of a font data structure. */ -static void InitFont(Tk_Window tkwin, FMFontFamily familyId, - const char *familyName, int size, int qdStyle, MacFont *fontPtr); +static const char *FamilyNameForFamilyID(FMFontFamily familyId); +static void InitFont(FMFontFamily familyId, const char *familyName, + int size, int qdStyle, MacFont *fontPtr); static void InitATSUObjects(FMFontFamily familyId, short qdsize, short qdStyle, ATSUFontID *fontIdPtr, ATSUTextLayout *layoutPtr, ATSUStyle *stylePtr); static void InitATSUStyle(ATSUFontID fontId, short ptSize, short qdStyle, @@ -470,7 +471,7 @@ TkpGetNativeFont( CopyPascalStringToC(fontName, (char*)fontName); fontPtr = (MacFont *) ckalloc(sizeof(MacFont)); - InitFont(tkwin, fontFamily, (char*)fontName, fontSize, fontStyle, fontPtr); + InitFont(fontFamily, (char*)fontName, fontSize, fontStyle, fontPtr); return (TkFont *) fontPtr; } @@ -549,7 +550,8 @@ TkpGetFontFromAttributes( fontPtr = (MacFont *) tkFontPtr; ReleaseFont(fontPtr); } - InitFont(tkwin, familyId, name, faPtr->size, qdStyle, fontPtr); + InitFont(familyId, name, TkFontGetPoints(tkwin, faPtr->size), + qdStyle, fontPtr); return (TkFont *) fontPtr; } @@ -1372,6 +1374,48 @@ UpdateLineBuffer( /* *--------------------------------------------------------------------------- * + * FamilyNameForFamilyID -- + * + * Helper for InitFont() and TkMacOSXFontDescriptionForFMFontInfo(). + * Retrieves font family names for a given font family ID. + * + * Results: + * Font family name or NULL. + * + * Side effects: + * None. + * + *--------------------------------------------------------------------------- + */ + +static const char * +FamilyNameForFamilyID( + FMFontFamily familyId) +{ + OSStatus err; + char name[256] = ""; + const MacFontFamily * familyPtr = NULL; + + err = ChkErr(GetFontFamilyName, familyId, name, sizeof(name)); + if (err == noErr) { + /* + * We find the canonical font name, so we can avoid unnecessary + * memory management. + */ + + familyPtr = FindFontFamily(name); +#ifdef TK_MAC_DEBUG_FONTS + if (!familyPtr) { + TkMacOSXDbgMsg("Font family '%s' not found", name); + } +#endif + } + return familyPtr ? familyPtr->name : NULL; +} + +/* + *--------------------------------------------------------------------------- + * * InitFont -- * * Helper for TkpGetNativeFont() and TkpGetFontFromAttributes(). @@ -1393,7 +1437,6 @@ UpdateLineBuffer( static void InitFont( - Tk_Window tkwin, /* For display where font will be used. */ FMFontFamily familyId, /* The font family to initialize for. */ const char * familyName, /* The font family name, if known. Otherwise * this can be NULL. */ @@ -1402,45 +1445,24 @@ InitFont( MacFont * fontPtr) /* Filled with information constructed from the * above arguments. */ { - OSStatus err; FontInfo fi; TkFontAttributes * faPtr; TkFontMetrics * fmPtr; - short points; int periodWidth, wWidth; if (size == 0) { size = GetDefFontSize(); } - points = (short) TkFontGetPoints(tkwin, size); - ChkErr(FetchFontInfo, familyId, points, qdStyle, &fi); - if (familyName == NULL) { - char name[256] = ""; - const MacFontFamily * familyPtr; - - err = ChkErr(GetFontFamilyName, familyId, name, sizeof(name)); - if (err == noErr) { - /* - * We find the canonical font name, so we can avoid unnecessary - * memory management. - */ - - familyPtr = FindFontFamily(name); - if (familyPtr != NULL) { - familyName = familyPtr->name; - } else { -#ifdef TK_MAC_DEBUG_FONTS - TkMacOSXDbgMsg("Font family '%s' not found", name); -#endif - } - } + ChkErr(FetchFontInfo, familyId, size, qdStyle, &fi); + if (!familyName) { + familyName = FamilyNameForFamilyID(familyId); } fontPtr->font.fid = (Font) fontPtr; faPtr = &fontPtr->font.fa; faPtr->family = familyName; - faPtr->size = points; + faPtr->size = size; faPtr->weight = (qdStyle & bold) ? TK_FW_BOLD : TK_FW_NORMAL; faPtr->slant = (qdStyle & italic) ? TK_FS_ITALIC : TK_FS_ROMAN; faPtr->underline = ((qdStyle & underline) != 0); @@ -1461,10 +1483,10 @@ InitFont( fmPtr->maxWidth = fi.widMax; fontPtr->qdFont = familyId; - fontPtr->qdSize = points; + fontPtr->qdSize = size; fontPtr->qdStyle = (short) qdStyle; - InitATSUObjects(familyId, points, qdStyle, &fontPtr->atsuFontId, + InitATSUObjects(familyId, size, qdStyle, &fontPtr->atsuFontId, &fontPtr->atsuLayout, &fontPtr->atsuStyle); Tk_MeasureChars((Tk_Font)fontPtr, ".", 1, -1, 0, &periodWidth); @@ -2462,3 +2484,12 @@ TkMacOSXUseAntialiasedText( antialiasedTextEnabled = enable; return TCL_OK; } + +/* + * Local Variables: + * mode: c + * c-basic-offset: 4 + * fill-column: 79 + * coding: utf-8 + * End: + */ -- cgit v0.12 From c9ac8cc1f25a1f3f10e348c7853718015667861b Mon Sep 17 00:00:00 2001 From: das Date: Thu, 19 Jun 2008 00:11:08 +0000 Subject: * macosx/tkMacOSXWindowEvent.c (TkMacOSXProcessWindowEvent): fix return value. --- macosx/tkMacOSXWindowEvent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index 46b547d..57bd33b 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -54,7 +54,7 @@ * software in accordance with the terms specified in this * license. * - * RCS: @(#) $Id: tkMacOSXWindowEvent.c,v 1.31 2007/12/13 15:27:10 dgp Exp $ + * RCS: @(#) $Id: tkMacOSXWindowEvent.c,v 1.32 2008/06/19 00:11:08 das Exp $ */ #include "tkMacOSXPrivate.h" @@ -418,7 +418,7 @@ TkMacOSXProcessWindowEvent( break; } - return 0; + return eventFound; } /* -- cgit v0.12 From 1e07811e2963b860590eb147690cf1eb101e0111 Mon Sep 17 00:00:00 2001 From: das Date: Thu, 19 Jun 2008 00:13:02 +0000 Subject: * macosx/tkMacOSXInit.c: add helper to efficiently convert from * macosx/tkMacOSXPrivate.h: CFString to Tcl_Obj. --- macosx/tkMacOSXInit.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++-- macosx/tkMacOSXPrivate.h | 3 ++- 2 files changed, 53 insertions(+), 3 deletions(-) diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c index fdaf9aa..7e2a996 100644 --- a/macosx/tkMacOSXInit.c +++ b/macosx/tkMacOSXInit.c @@ -6,12 +6,12 @@ * * Copyright (c) 1995-1997 Sun Microsystems, Inc. * Copyright 2001, Apple Computer, Inc. - * Copyright (c) 2005-2007 Daniel A. Steffen + * Copyright (c) 2005-2008 Daniel A. Steffen * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXInit.c,v 1.35 2008/04/27 22:39:12 dkf Exp $ + * RCS: @(#) $Id: tkMacOSXInit.c,v 1.36 2008/06/19 00:13:02 das Exp $ */ #include "tkMacOSXPrivate.h" @@ -553,3 +553,52 @@ TkMacOSXGetNamedSymbol( } return NSAddressOfSymbol(nsSymbol); } + +/* + *---------------------------------------------------------------------- + * + * TkMacOSXGetStringObjFromCFString -- + * + * Get a string object from a CFString as efficiently as possible. + * + * Results: + * New string object or NULL if conversion failed. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +MODULE_SCOPE Tcl_Obj* +TkMacOSXGetStringObjFromCFString( + CFStringRef str) +{ + Tcl_Obj *obj = NULL; + const char *c = CFStringGetCStringPtr(str, kCFStringEncodingUTF8); + + if (c) { + obj = Tcl_NewStringObj(c, -1); + } else { + CFRange all = CFRangeMake(0, CFStringGetLength(str)); + CFIndex len; + + if (CFStringGetBytes(str, all, kCFStringEncodingUTF8, 0, false, NULL, + 0, &len) > 0) { + obj = Tcl_NewObj(); + Tcl_SetObjLength(obj, len); + CFStringGetBytes(str, all, kCFStringEncodingUTF8, 0, false, + (UInt8*) obj->bytes, len, NULL); + } + } + return obj; +} + +/* + * Local Variables: + * mode: c + * c-basic-offset: 4 + * fill-column: 79 + * coding: utf-8 + * End: + */ diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h index b1ca8c4..e7414fd 100644 --- a/macosx/tkMacOSXPrivate.h +++ b/macosx/tkMacOSXPrivate.h @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXPrivate.h,v 1.6 2007/12/15 15:55:38 das Exp $ + * RCS: @(#) $Id: tkMacOSXPrivate.h,v 1.7 2008/06/19 00:13:03 das Exp $ */ #ifndef _TKMACPRIV @@ -335,5 +335,6 @@ MODULE_SCOPE void TkMacOSXBringWindowForward(WindowRef wRef); MODULE_SCOPE WindowRef TkMacOSXDrawableWindow(Drawable drawable); MODULE_SCOPE void TkMacOSXWinCGBounds(TkWindow *winPtr, CGRect *bounds); MODULE_SCOPE HIShapeRef TkMacOSXGetClipRgn(Drawable drawable); +MODULE_SCOPE Tcl_Obj* TkMacOSXGetStringObjFromCFString(CFStringRef str); #endif /* _TKMACPRIV */ -- cgit v0.12 From f5d537eea87cc6e9a91436cd00a8a1e3447db700 Mon Sep 17 00:00:00 2001 From: das Date: Thu, 19 Jun 2008 00:14:10 +0000 Subject: * macosx/tkMacOSXEmbed.c (TkpMakeWindow): fix bug with missing * macosx/tkMacOSXSubwindows.c (XMapWindow): focus on first map by only sending VisibilityNotify events once windows are mapped (rather than when they are created). --- macosx/tkMacOSXEmbed.c | 19 ++------------- macosx/tkMacOSXSubwindows.c | 59 +++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 59 insertions(+), 19 deletions(-) diff --git a/macosx/tkMacOSXEmbed.c b/macosx/tkMacOSXEmbed.c index 47a9ed7..aeb5f4b 100644 --- a/macosx/tkMacOSXEmbed.c +++ b/macosx/tkMacOSXEmbed.c @@ -9,12 +9,12 @@ * * Copyright (c) 1996-1997 Sun Microsystems, Inc. * Copyright 2001, Apple Computer, Inc. - * Copyright (c) 2006-2007 Daniel A. Steffen + * Copyright (c) 2006-2008 Daniel A. Steffen * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXEmbed.c,v 1.17 2008/04/27 22:39:12 dkf Exp $ + * RCS: @(#) $Id: tkMacOSXEmbed.c,v 1.18 2008/06/19 00:14:10 das Exp $ */ #include "tkMacOSXInt.h" @@ -123,7 +123,6 @@ TkpMakeWindow( Window parent) { MacDrawable *macWin; - XEvent event; /* * If this window is marked as embedded then the window structure should @@ -171,20 +170,6 @@ TkpMakeWindow( } macWin->toplevel->referenceCount++; } - - /* - * TODO: need general solution for visibility events. - */ - - event.xany.serial = Tk_Display(winPtr)->request; - event.xany.send_event = False; - event.xany.display = Tk_Display(winPtr); - - event.xvisibility.type = VisibilityNotify; - event.xvisibility.window = (Window) macWin; - event.xvisibility.state = VisibilityUnobscured; - Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL); - return (Window) macWin; } diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index b7a02f8..5aa4a8a 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -5,12 +5,12 @@ * * Copyright (c) 1995-1997 Sun Microsystems, Inc. * Copyright 2001, Apple Computer, Inc. - * Copyright (c) 2006-2007 Daniel A. Steffen + * Copyright (c) 2006-2008 Daniel A. Steffen * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXSubwindows.c,v 1.27 2007/12/13 15:27:10 dgp Exp $ + * RCS: @(#) $Id: tkMacOSXSubwindows.c,v 1.28 2008/06/19 00:14:10 das Exp $ */ #include "tkMacOSXPrivate.h" @@ -30,6 +30,7 @@ static void MoveResizeWindow(MacDrawable *macWin); static void GenerateConfigureNotify(TkWindow *winPtr, int includeWin); static void UpdateOffsets(TkWindow *winPtr, int deltaX, int deltaY); +static void NotifyVisibility(TkWindow *winPtr, XEvent *eventPtr); /* @@ -252,6 +253,7 @@ XMapWindow( * We only need to send the MapNotify event * for toplevel windows. */ + event.xany.serial = display->request; event.xany.send_event = False; event.xany.display = display; @@ -269,6 +271,50 @@ XMapWindow( TkMacOSXInvalClipRgns((Tk_Window) macWin->winPtr->parentPtr); TkMacOSXInvalidateWindow(macWin, TK_PARENT_WINDOW); } + + /* + * Generate VisibilityNotify events for window and all mapped children. + */ + + event.xany.send_event = False; + event.xany.display = display; + event.xvisibility.type = VisibilityNotify; + event.xvisibility.state = VisibilityUnobscured; + NotifyVisibility(macWin->winPtr, &event); +} + +/* + *---------------------------------------------------------------------- + * + * NotifyVisibility -- + * + * Recursively called helper proc for XMapWindow(). + + * Results: + * None. + * + * Side effects: + * VisibilityNotify events are queued. + * + *---------------------------------------------------------------------- + */ + +static void +NotifyVisibility( + TkWindow *winPtr, + XEvent *eventPtr) +{ + if (winPtr->atts.event_mask & VisibilityChangeMask) { + eventPtr->xany.serial = LastKnownRequestProcessed(winPtr->display); + eventPtr->xvisibility.window = winPtr->window; + Tk_QueueWindowEvent(eventPtr, TCL_QUEUE_TAIL); + } + for (winPtr = winPtr->childList; winPtr != NULL; + winPtr = winPtr->nextPtr) { + if (winPtr->flags & TK_MAPPED) { + NotifyVisibility(winPtr, eventPtr); + } + } } /* @@ -1397,3 +1443,12 @@ Tk_FreePixmap( } ckfree((char *) macPix); } + +/* + * Local Variables: + * mode: c + * c-basic-offset: 4 + * fill-column: 79 + * coding: utf-8 + * End: + */ -- cgit v0.12 From 5286e8878dc30776fcb769e9533d2e936daf6af0 Mon Sep 17 00:00:00 2001 From: das Date: Thu, 19 Jun 2008 00:14:56 +0000 Subject: * macosx/tkMacOSXDebug.c: revert 2007-11-09 commit making * macosx/tkMacOSXDebug.h: TkMacOSXInitNamedDebugSymbol() available outside of debug builds. --- macosx/tkMacOSXDebug.c | 5 +++-- macosx/tkMacOSXDebug.h | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/macosx/tkMacOSXDebug.c b/macosx/tkMacOSXDebug.c index 4d4e695..740922b 100644 --- a/macosx/tkMacOSXDebug.c +++ b/macosx/tkMacOSXDebug.c @@ -54,7 +54,7 @@ * software in accordance with the terms specified in this * license. * - * RCS: @(#) $Id: tkMacOSXDebug.c,v 1.19 2007/12/13 15:27:08 dgp Exp $ + * RCS: @(#) $Id: tkMacOSXDebug.c,v 1.20 2008/06/19 00:14:56 das Exp $ */ #include "tkMacOSXPrivate.h" @@ -478,7 +478,6 @@ TkMacOSXDebugFlashRegion( } } } -#endif /* TK_MAC_DEBUG */ #include #include @@ -616,3 +615,5 @@ TkMacOSXGetNamedDebugSymbol( #endif /* __LP64__ */ return addr; } + +#endif /* TK_MAC_DEBUG */ diff --git a/macosx/tkMacOSXDebug.h b/macosx/tkMacOSXDebug.h index e5935f0..da964f9 100644 --- a/macosx/tkMacOSXDebug.h +++ b/macosx/tkMacOSXDebug.h @@ -54,7 +54,7 @@ * software in accordance with the terms specified in this * license. * - * RCS: @(#) $Id: tkMacOSXDebug.h,v 1.15 2007/12/13 15:27:08 dgp Exp $ + * RCS: @(#) $Id: tkMacOSXDebug.h,v 1.16 2008/06/19 00:14:56 das Exp $ */ #ifndef _TKMACDEBUG @@ -84,8 +84,6 @@ MODULE_SCOPE char* TkMacOSXMouseTrackingResultToAscii(MouseTrackingResult r, cha MODULE_SCOPE void TkMacOSXDebugFlashRegion(Drawable d, HIShapeRef rgn); -#endif /* TK_MAC_DEBUG */ - MODULE_SCOPE void* TkMacOSXGetNamedDebugSymbol(const char* module, const char* symbol); /* Macro to abstract common use of TkMacOSXGetNamedDebugSymbol to initialize named symbols */ @@ -95,4 +93,6 @@ MODULE_SCOPE void* TkMacOSXGetNamedDebugSymbol(const char* module, const char* s symbol = TkMacOSXGetNamedDebugSymbol(STRINGIFY(module), STRINGIFY(_##symbol));\ } +#endif /* TK_MAC_DEBUG */ + #endif -- cgit v0.12 From d9752b097b67d456f9dcd309e07d6ba17b21d45c Mon Sep 17 00:00:00 2001 From: das Date: Thu, 19 Jun 2008 00:16:10 +0000 Subject: * macosx/tkMacOSXCarbonEvents.c: fix debug carbon event tracing; (InstallStandardApplicationEventHandler): replace needless use of TkMacOSXInitNamedDebugSymbol() by standard TkMacOSXInitNamedSymbol(). --- ChangeLog | 25 ++++++++++++ macosx/tkMacOSXCarbonEvents.c | 90 ++++++++++++++++++++++--------------------- 2 files changed, 71 insertions(+), 44 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0863da4..a1e5be8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,28 @@ +2008-06-18 Daniel Steffen + + * macosx/tkMacOSXCarbonEvents.c: fix debug carbon event tracing; + (InstallStandardApplicationEventHandler): replace needless use of + TkMacOSXInitNamedDebugSymbol() by standard TkMacOSXInitNamedSymbol(). + + * macosx/tkMacOSXDebug.c: revert 2007-11-09 commit making + * macosx/tkMacOSXDebug.h: TkMacOSXInitNamedDebugSymbol() + available outside of debug builds. + + * macosx/tkMacOSXEmbed.c (TkpMakeWindow): fix bug with missing + * macosx/tkMacOSXSubwindows.c (XMapWindow): focus on first map by + only sending VisibilityNotify events once windows are mapped (rather + than when they are created). + + * macosx/tkMacOSXWindowEvent.c (TkMacOSXProcessWindowEvent): fix + return value. + + * macosx/tkMacOSXInit.c: add helper to efficiently convert from + * macosx/tkMacOSXPrivate.h: CFString to Tcl_Obj. + + * macosx/tkMacOSXFont.c (TkpGetFontFromAttributes, InitFont): fix + incorrect conversion to points of font sizes already in points; factor + out retrieval of font family name from font family ID. + 2008-06-13 Jeff Hobbs * win/configure, win/configure.in (TK_WIN_VERSION): fix handling diff --git a/macosx/tkMacOSXCarbonEvents.c b/macosx/tkMacOSXCarbonEvents.c index 0d66d64..32ddaab 100644 --- a/macosx/tkMacOSXCarbonEvents.c +++ b/macosx/tkMacOSXCarbonEvents.c @@ -11,7 +11,7 @@ * application event target. * * Copyright 2001, Apple Computer, Inc. - * Copyright (c) 2005-2007 Daniel A. Steffen + * Copyright (c) 2005-2008 Daniel A. Steffen * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -60,7 +60,7 @@ * software in accordance with the terms specified in this * license. * - * RCS: @(#) $Id: tkMacOSXCarbonEvents.c,v 1.19 2007/12/13 15:27:08 dgp Exp $ + * RCS: @(#) $Id: tkMacOSXCarbonEvents.c,v 1.20 2008/06/19 00:16:11 das Exp $ */ #include "tkMacOSXPrivate.h" @@ -224,46 +224,21 @@ TkMacOSXInitCarbonEvents( applicationEventTypes, (void *) carbonEventInterp, NULL); #ifdef TK_MAC_DEBUG_CARBON_EVENTS - TkMacOSXInitNamedDebugSymbol(HIToolbox, void, _TraceEventByName, - CFStringRef); - if (_TraceEventByName) { - /* Carbon-internal event debugging (c.f. Technote 2124) */ - _TraceEventByName(CFSTR("kEventRawKeyDown")); - _TraceEventByName(CFSTR("kEventRawKeyRepeat")); - _TraceEventByName(CFSTR("kEventRawKeyUp")); - _TraceEventByName(CFSTR("kEventRawKeyModifiersChanged")); - _TraceEventByName(CFSTR("kEventRawKeyRepeat")); - _TraceEventByName(CFSTR("kEventMenuBeginTracking")); - _TraceEventByName(CFSTR("kEventMenuEndTracking")); - _TraceEventByName(CFSTR("kEventMenuOpening")); - _TraceEventByName(CFSTR("kEventMenuTargetItem")); - _TraceEventByName(CFSTR("kEventCommandProcess")); - _TraceEventByName(CFSTR("kEventCommandUpdateStatus")); - _TraceEventByName(CFSTR("kEventAppActivated")); - _TraceEventByName(CFSTR("kEventAppDeactivated")); - _TraceEventByName(CFSTR("kEventAppQuit")); - _TraceEventByName(CFSTR("kEventAppHidden")); - _TraceEventByName(CFSTR("kEventAppShown")); - _TraceEventByName(CFSTR("kEventAppAvailableWindowBoundsChanged")); - _TraceEventByName(CFSTR("kEventAppearanceScrollBarVariantChanged")); - _TraceEventByName(CFSTR("kEventMouseDown")); - _TraceEventByName(CFSTR("kEventMouseUp")); -#if 0 - _TraceEventByName(CFSTR("kEventMouseMoved")); - _TraceEventByName(CFSTR("kEventMouseDragged")); -#endif - _TraceEventByName(CFSTR("kEventMouseWheelMoved")); - _TraceEventByName(CFSTR("kEventMouseScroll")); - _TraceEventByName(CFSTR("kEventWindowActivated")); - _TraceEventByName(CFSTR("kEventWindowDeactivated")); - _TraceEventByName(CFSTR("kEventWindowUpdate")); - _TraceEventByName(CFSTR("kEventWindowExpanding")); - _TraceEventByName(CFSTR("kEventWindowBoundsChanged")); - _TraceEventByName(CFSTR("kEventWindowDragStarted")); - _TraceEventByName(CFSTR("kEventWindowDragCompleted")); - _TraceEventByName(CFSTR("kEventWindowConstrain")); - _TraceEventByName(CFSTR("kEventWindowGetRegion")); - _TraceEventByName(CFSTR("kEventWindowDrawContent")); + TkMacOSXInitNamedSymbol(HIToolbox, void, DebugTraceEvent, OSType, UInt32, + Boolean); + if (DebugTraceEvent) { + unsigned int i; + const EventTypeSpec *e; + + for (i = 0, e = dispatcherEventTypes; + i < GetEventTypeCount(dispatcherEventTypes); i++, e++) { + DebugTraceEvent(e->eventClass, e->eventKind, 1); + } + for (i = 0, e = applicationEventTypes; + i < GetEventTypeCount(applicationEventTypes); i++, e++) { + DebugTraceEvent(e->eventClass, e->eventKind, 1); + } + DebugTraceEvent = NULL; /* Only enable tracing once. */ } #endif /* TK_MAC_DEBUG_CARBON_EVENTS */ } @@ -310,6 +285,24 @@ TkMacOSXInstallWindowCarbonEventHandler( carbonEventHandlerUPP, GetEventTypeCount(windowEventTypes), windowEventTypes, (void *) (interp ? interp : carbonEventInterp), NULL); + +#ifdef TK_MAC_DEBUG_CARBON_EVENTS + TkMacOSXInitNamedSymbol(HIToolbox, void, DebugTraceEvent, OSType, UInt32, + Boolean); + if (DebugTraceEvent) { + unsigned int i; + const EventTypeSpec *e; + + for (i = 0, e = windowEventTypes; + i < GetEventTypeCount(windowEventTypes); i++, e++) { + if (!(e->eventClass == kEventClassMouse && ( + e->eventKind == kEventMouseMoved || + e->eventKind == kEventMouseDragged))) { + DebugTraceEvent(e->eventClass, e->eventKind, 1); + } + } + } +#endif /* TK_MAC_DEBUG_CARBON_EVENTS */ } /* @@ -344,11 +337,11 @@ InstallStandardApplicationEventHandler(void) * to be installed. Unfortunately there appears to be no public API to * obtain the menubar event target. As a workaround, for now we resort * to calling the HIToolbox-internal GetMenuBarEventTarget() directly - * (symbol acquired via TkMacOSXInitNamedDebugSymbol() from HIToolbox + * (symbol acquired via TkMacOSXInitNamedSymbol() from HIToolbox * version 343, may not exist in later versions). */ err = ChkErr(InstallStandardEventHandler, GetApplicationEventTarget()); - TkMacOSXInitNamedDebugSymbol(HIToolbox, EventTargetRef, + TkMacOSXInitNamedSymbol(HIToolbox, EventTargetRef, GetMenuBarEventTarget, void); if (GetMenuBarEventTarget) { ChkErr(InstallStandardEventHandler, GetMenuBarEventTarget()); @@ -688,3 +681,12 @@ TkMacOSXReceiveAndDispatchEvent(void) } return err; } + +/* + * Local Variables: + * mode: c + * c-basic-offset: 4 + * fill-column: 79 + * coding: utf-8 + * End: + */ -- cgit v0.12 From d0dc88b51a52449287daaa05e732e49d8b466dc9 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 19 Jun 2008 19:37:58 +0000 Subject: * README: Bump version number to 8.6a1 * generic/tk.h: * library/tk.tcl: * unix/configure.in: * unix/tk.spec: * win/configure.in: * unix/configure: autoconf-2.59 * win/configure: --- ChangeLog | 12 ++++++++++++ README | 4 ++-- generic/tk.h | 6 +++--- library/tk.tcl | 4 ++-- unix/configure | 14 +++++++------- unix/configure.in | 4 ++-- unix/tk.spec | 4 ++-- win/configure | 2 +- win/configure.in | 4 ++-- 9 files changed, 33 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index a1e5be8..45665f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-06-19 Don Porter + + * README: Bump version number to 8.6a1 + * generic/tk.h: + * library/tk.tcl: + * unix/configure.in: + * unix/tk.spec: + * win/configure.in: + + * unix/configure: autoconf-2.59 + * win/configure: + 2008-06-18 Daniel Steffen * macosx/tkMacOSXCarbonEvents.c: fix debug carbon event tracing; diff --git a/README b/README index aaf9008..3b3b6f4 100644 --- a/README +++ b/README @@ -1,11 +1,11 @@ README: Tk - This is the Tk 8.6a0 source distribution. + This is the Tk 8.6a1 source distribution. Tcl/Tk is also available through NetCVS: http://tcl.sourceforge.net/ You can get any source release of Tcl from the file distributions link at the above URL. -RCS: @(#) $Id: README,v 1.54 2008/04/01 16:30:52 dgp Exp $ +RCS: @(#) $Id: README,v 1.55 2008/06/19 19:37:58 dgp Exp $ 1. Introduction --------------- diff --git a/generic/tk.h b/generic/tk.h index ad89478..161139e 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tk.h,v 1.110 2008/04/01 16:30:52 dgp Exp $ + * RCS: @(#) $Id: tk.h,v 1.111 2008/06/19 19:37:58 dgp Exp $ */ #ifndef _TK @@ -53,10 +53,10 @@ extern "C" { #define TK_MAJOR_VERSION 8 #define TK_MINOR_VERSION 6 #define TK_RELEASE_LEVEL TCL_ALPHA_RELEASE -#define TK_RELEASE_SERIAL 0 +#define TK_RELEASE_SERIAL 1 #define TK_VERSION "8.6" -#define TK_PATCH_LEVEL "8.6a0" +#define TK_PATCH_LEVEL "8.6a1" /* * A special definition used to allow this header file to be included from diff --git a/library/tk.tcl b/library/tk.tcl index 69afb5c..935b555 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -3,7 +3,7 @@ # Initialization script normally executed in the interpreter for each # Tk-based application. Arranges class bindings for widgets. # -# RCS: @(#) $Id: tk.tcl,v 1.75 2008/05/11 00:47:22 patthoyts Exp $ +# RCS: @(#) $Id: tk.tcl,v 1.76 2008/06/19 19:37:59 dgp Exp $ # # Copyright (c) 1992-1994 The Regents of the University of California. # Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -17,7 +17,7 @@ package require Tcl 8.5 ;# Guard against [source] in an 8.4- interp # Insist on running with compatible version of Tcl package require Tcl 8.5.0 # Verify that we have Tk binary and script components from the same release -package require -exact Tk 8.6a0 +package require -exact Tk 8.6a1 # Create a ::tk namespace namespace eval ::tk { diff --git a/unix/configure b/unix/configure index 73e86a7..6975228 100755 --- a/unix/configure +++ b/unix/configure @@ -1337,7 +1337,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu TK_VERSION=8.6 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=6 -TK_PATCH_LEVEL="a0" +TK_PATCH_LEVEL="a1" VERSION=${TK_VERSION} LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv" @@ -9588,7 +9588,7 @@ ac_x_header_dirs=' /usr/openwin/share/include' if test "$ac_x_includes" = no; then - # Guess where to find include files, by looking for Intrinsic.h. + # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -9596,7 +9596,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 @@ -9623,7 +9623,7 @@ else sed 's/^/| /' conftest.$ac_ext >&5 for ac_dir in $ac_x_header_dirs; do - if test -r "$ac_dir/X11/Intrinsic.h"; then + if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi @@ -9637,18 +9637,18 @@ if test "$ac_x_libraries" = no; then # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS - LIBS="-lXt $LIBS" + LIBS="-lX11 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include int main () { -XtMalloc (0) +XrmInitialize () ; return 0; } diff --git a/unix/configure.in b/unix/configure.in index 914ee08..60a83c3 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -3,7 +3,7 @@ dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tk installation dnl to configure the system for the local environment. # -# RCS: @(#) $Id: configure.in,v 1.155 2008/04/02 21:32:56 das Exp $ +# RCS: @(#) $Id: configure.in,v 1.156 2008/06/19 19:38:00 dgp Exp $ AC_INIT([tk],[8.6]) AC_PREREQ(2.59) @@ -27,7 +27,7 @@ m4_ifdef([SC_USE_CONFIG_HEADERS], [ TK_VERSION=8.6 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=6 -TK_PATCH_LEVEL="a0" +TK_PATCH_LEVEL="a1" VERSION=${TK_VERSION} LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv" diff --git a/unix/tk.spec b/unix/tk.spec index 977b37e..271ea6b 100644 --- a/unix/tk.spec +++ b/unix/tk.spec @@ -1,11 +1,11 @@ -# $Id: tk.spec,v 1.35 2008/04/01 16:30:56 dgp Exp $ +# $Id: tk.spec,v 1.36 2008/06/19 19:38:00 dgp Exp $ # This file is the basis for a binary Tk Linux RPM. %{!?directory:%define directory /usr/local} Name: tk Summary: Tk graphical toolkit for the Tcl scripting language. -Version: 8.6a0 +Version: 8.6a1 Release: 2 License: BSD Group: Development/Languages diff --git a/win/configure b/win/configure index 67a501c..8091058 100755 --- a/win/configure +++ b/win/configure @@ -1309,7 +1309,7 @@ SHELL=/bin/sh TK_VERSION=8.6 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=6 -TK_PATCH_LEVEL="a0" +TK_PATCH_LEVEL="a1" VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION #------------------------------------------------------------------------ diff --git a/win/configure.in b/win/configure.in index f8d71a8..af12f06 100644 --- a/win/configure.in +++ b/win/configure.in @@ -3,7 +3,7 @@ # generate the file "configure", which is run during Tk installation # to configure the system for the local environment. # -# RCS: @(#) $Id: configure.in,v 1.79 2008/06/13 21:49:31 hobbs Exp $ +# RCS: @(#) $Id: configure.in,v 1.80 2008/06/19 19:38:01 dgp Exp $ AC_INIT(../generic/tk.h) AC_PREREQ(2.59) @@ -16,7 +16,7 @@ SHELL=/bin/sh TK_VERSION=8.6 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=6 -TK_PATCH_LEVEL="a0" +TK_PATCH_LEVEL="a1" VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION #------------------------------------------------------------------------ -- cgit v0.12 From 6e922c5172262862308c81acded32fc06f05709d Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 19 Jun 2008 19:48:26 +0000 Subject: * generic/tk.h: TIP 285 additions make Tk 8.6 call the new * library/tk.tcl: Tcl_Canceled() routine, available only in Tcl 8.6, so bump our Tcl dependencies to version 8.6. Tk 8.6a1 will no longer [load] into a Tcl 8.5 interp. --- ChangeLog | 5 +++++ generic/tk.h | 6 +++--- library/tk.tcl | 6 ++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 45665f1..b5e077b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2008-06-19 Don Porter + * generic/tk.h: TIP 285 additions make Tk 8.6 call the new + * library/tk.tcl: Tcl_Canceled() routine, available only in + Tcl 8.6, so bump our Tcl dependencies to version 8.6. Tk 8.6a1 will + no longer [load] into a Tcl 8.5 interp. + * README: Bump version number to 8.6a1 * generic/tk.h: * library/tk.tcl: diff --git a/generic/tk.h b/generic/tk.h index 161139e..a4e8ca7 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -12,15 +12,15 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tk.h,v 1.111 2008/06/19 19:37:58 dgp Exp $ + * RCS: @(#) $Id: tk.h,v 1.112 2008/06/19 19:48:26 dgp Exp $ */ #ifndef _TK #define _TK #include -#if (TCL_MAJOR_VERSION != 8) || (TCL_MINOR_VERSION < 5) -# error Tk 8.6 must be compiled with tcl.h from Tcl 8.5 or better +#if (TCL_MAJOR_VERSION != 8) || (TCL_MINOR_VERSION < 6) +# error Tk 8.6 must be compiled with tcl.h from Tcl 8.6 or better #endif /* diff --git a/library/tk.tcl b/library/tk.tcl index 935b555..7ecf22e 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -3,7 +3,7 @@ # Initialization script normally executed in the interpreter for each # Tk-based application. Arranges class bindings for widgets. # -# RCS: @(#) $Id: tk.tcl,v 1.76 2008/06/19 19:37:59 dgp Exp $ +# RCS: @(#) $Id: tk.tcl,v 1.77 2008/06/19 19:48:26 dgp Exp $ # # Copyright (c) 1992-1994 The Regents of the University of California. # Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -12,10 +12,8 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. -package require Tcl 8.5 ;# Guard against [source] in an 8.4- interp - ;# before using 8.5 [package] features. # Insist on running with compatible version of Tcl -package require Tcl 8.5.0 +package require Tcl 8.6 # Verify that we have Tk binary and script components from the same release package require -exact Tk 8.6a1 -- cgit v0.12 From 1cf5697a23d5da0bd37b32042fc9a7f98d0e8e31 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 19 Jun 2008 20:45:06 +0000 Subject: Tk 8.6a1 will no longer support [load] into, or compile against Tcl 8.5. --- unix/tk.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/unix/tk.spec b/unix/tk.spec index 271ea6b..306d27a 100644 --- a/unix/tk.spec +++ b/unix/tk.spec @@ -1,4 +1,4 @@ -# $Id: tk.spec,v 1.36 2008/06/19 19:38:00 dgp Exp $ +# $Id: tk.spec,v 1.37 2008/06/19 20:45:06 dgp Exp $ # This file is the basis for a binary Tk Linux RPM. %{!?directory:%define directory /usr/local} @@ -12,8 +12,8 @@ Group: Development/Languages Source: http://prdownloads.sourceforge.net/tcl/tk%{version}-src.tar.gz URL: http://www.tcl.tk/ Buildroot: /var/tmp/%{name}%{version} -Buildrequires: XFree86-devel tcl >= 8.5 -Requires: tcl >= 8.5 +Buildrequires: XFree86-devel tcl >= %version +Requires: tcl >= %version %description The Tcl (Tool Command Language) provides a powerful platform for -- cgit v0.12 From efc92a642f24f7d9c466c128ab3d66691d83745a Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 19 Jun 2008 21:17:54 +0000 Subject: * changes: Updates for 8.6a1 release. --- ChangeLog | 2 ++ changes | 30 +++++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b5e077b..3a1e500 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2008-06-19 Don Porter + * changes: Updates for 8.6a1 release. + * generic/tk.h: TIP 285 additions make Tk 8.6 call the new * library/tk.tcl: Tcl_Canceled() routine, available only in Tcl 8.6, so bump our Tcl dependencies to version 8.6. Tk 8.6a1 will diff --git a/changes b/changes index 85bcc2d..971ff99 100644 --- a/changes +++ b/changes @@ -2,7 +2,7 @@ This file summarizes all changes made to Tk since version 1.0 was released on March 13, 1991. Changes that aren't backward compatible are marked specially. -RCS: @(#) $Id: changes,v 1.130 2008/03/28 17:50:50 dgp Exp $ +RCS: @(#) $Id: changes,v 1.131 2008/06/19 21:17:54 dgp Exp $ 3/16/91 (bug fix) Modified tkWindow.c to remove Tk's Tcl commands from the interpreter when the main window is deleted (otherwise there will @@ -6501,3 +6501,31 @@ Several documentation and release notes improvements 2008-03-27 (bug fix) restored [::safe::loadTk] (hobbs) --- Released 8.5.2, March 28, 2008 --- See ChangeLog for details --- + +2008-04-01 (interface)[1819422] tkStubsPtr no longer in libtk (porter) + *** POTENTIAL INCOMPATIBILITY *** + +2008-04-07 (bug fix)[1937135] Tk_ParseArgv() double free crash (hobbs) + +2008-04-07 (bug fix)[1936238] wish -h mem explosion (bachmann,kenny) + +2008-04-08 (new feature) Win: visual-styles API element engine (thoyts) + +2008-04-09 (enhancement) real LZW compression in GIF writer (nijtmans) + +2008-04-14 (bug fix)[1941740] [tk_chooseColor -title] (thoyts) + +2008-04-16 (interface)[1938497] make stubs tables 'static const' (steffen) + +2008-04-17 (bug fix)[1327482] canvas item events (wangnick) + +2008-05-23 (bug fix)[1967576] ttk::label height or width 0 panic (lawlor) + +2008-06-10 (enhancement)[1986818] Use Xutf8LookupString when possible (english) + +2008-06-12 (bug fix)[1991932] global grab segfault (steffen) + +2008-06-13 (new feature)[TIP 285] [tkwait] and [update] are now +[interp cancel]able (mistachkin) + +--- Released 8.6a1, June ??, 2008 --- See ChangeLog for details --- -- cgit v0.12 From 659bdeb01de6c5fdc987a657362f7cc25d6d8c1c Mon Sep 17 00:00:00 2001 From: das Date: Fri, 20 Jun 2008 13:51:43 +0000 Subject: Aqua, Solaris, stubs changes for 8.6a1 --- changes | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/changes b/changes index 971ff99..bdeaa74 100644 --- a/changes +++ b/changes @@ -2,7 +2,7 @@ This file summarizes all changes made to Tk since version 1.0 was released on March 13, 1991. Changes that aren't backward compatible are marked specially. -RCS: @(#) $Id: changes,v 1.131 2008/06/19 21:17:54 dgp Exp $ +RCS: @(#) $Id: changes,v 1.132 2008/06/20 13:51:43 das Exp $ 3/16/91 (bug fix) Modified tkWindow.c to remove Tk's Tcl commands from the interpreter when the main window is deleted (otherwise there will @@ -6505,6 +6505,8 @@ Several documentation and release notes improvements 2008-04-01 (interface)[1819422] tkStubsPtr no longer in libtk (porter) *** POTENTIAL INCOMPATIBILITY *** +2008-04-02 (interface)[1819422] libtkstub symbols MODULE_SCOPE (steffen) + 2008-04-07 (bug fix)[1937135] Tk_ParseArgv() double free crash (hobbs) 2008-04-07 (bug fix)[1936238] wish -h mem explosion (bachmann,kenny) @@ -6525,7 +6527,11 @@ Several documentation and release notes improvements 2008-06-12 (bug fix)[1991932] global grab segfault (steffen) +2008-06-12 (platform support) Solaris/amd64 gcc 64bit support (steffen) + 2008-06-13 (new feature)[TIP 285] [tkwait] and [update] are now [interp cancel]able (mistachkin) +2008-06-18 (bug fix) Aqua: missing focus on first map (steffen) + --- Released 8.6a1, June ??, 2008 --- See ChangeLog for details --- -- cgit v0.12 From 1c522063702f7be647b0c23ff52131c118fe3f51 Mon Sep 17 00:00:00 2001 From: patthoyts Date: Tue, 24 Jun 2008 10:54:53 +0000 Subject: bug #1997293 - fix documentation of text tag options. --- ChangeLog | 4 ++++ doc/text.n | 19 +++++++------------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3a1e500..ee31d80 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-06-24 Pat Thoyts + + * doc/text.n: bug #1997293 - fix documentation of text tag options. + 2008-06-19 Don Porter * changes: Updates for 8.6a1 release. diff --git a/doc/text.n b/doc/text.n index 926f896..1a776e1 100644 --- a/doc/text.n +++ b/doc/text.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: text.n,v 1.54 2008/04/17 15:27:12 dkf Exp $ +'\" RCS: @(#) $Id: text.n,v 1.55 2008/06/24 10:54:53 patthoyts Exp $ '\" .so man.macros .TH text n 8.5 Tk "Tk Built-In Commands" @@ -492,13 +492,10 @@ as an empty string, then a solid fill will be used for the background. .TP \fB\-borderwidth \fIpixels\fR -\fIPixels\fR specifies the width of a 3-D border to draw around -the background. -It may have any of the forms accepted by \fBTk_GetPixels\fR. -This option is used in conjunction with the \fB\-relief\fR -option to give a 3-D appearance to the background for characters; -it is ignored unless the \fB\-background\fR option -has been set for the tag. +\fIPixels\fR specifies the width of a border to draw around +the tag using any of the forms accepted by \fBTk_GetPixels\fR. +This option should be used in conjuction with the +\fB\-relief\fR option to provide the desired border. .TP \fB\-elide \fIboolean\fR \fIElide\fR specifies whether the data should @@ -568,12 +565,10 @@ the middle of characters. \fIBoolean\fR may have any of the forms accepted by \fBTcl_GetBoolean\fR. .TP \fB\-relief \fIrelief\fR -\fIRelief\fR specifies the 3-D relief to use for drawing backgrounds, +\fIRelief\fR specifies the relief style to use for drawing the border, in any of the forms accepted by \fBTk_GetRelief\fR. This option is used in conjunction with the \fB\-borderwidth\fR -option to give a 3-D appearance to the background for characters; -it is ignored unless the \fB\-borderwidth\fR option -has been set for the tag. +option to enable to the desired border appearance. .TP \fB\-rmargin \fIpixels\fR If the first non-elided character of a display line has a tag for which this -- cgit v0.12 From b7d36d610814188bb5c669e60f0a6adf1f4452be Mon Sep 17 00:00:00 2001 From: patthoyts Date: Tue, 24 Jun 2008 13:37:26 +0000 Subject: Work around missing timezones (eg: tclkit or some unixes) --- ChangeLog | 1 + library/demos/ttkpane.tcl | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ee31d80..b1b89c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 2008-06-24 Pat Thoyts + * library/demos/ttkpane.tcl: Work around missing timezones * doc/text.n: bug #1997293 - fix documentation of text tag options. 2008-06-19 Don Porter diff --git a/library/demos/ttkpane.tcl b/library/demos/ttkpane.tcl index 549ef3f..a99a845 100644 --- a/library/demos/ttkpane.tcl +++ b/library/demos/ttkpane.tcl @@ -2,7 +2,7 @@ # # This demonstration script creates a Ttk pane with some content. # -# RCS: @(#) $Id: ttkpane.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp $ +# RCS: @(#) $Id: ttkpane.tcl,v 1.4 2008/06/24 13:37:32 patthoyts Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." @@ -53,7 +53,7 @@ proc every {delay script} { uplevel #0 $script after $delay [list every $delay $script] } -set zones { +set testzones { :Europe/Berlin :America/Argentina/Buenos_Aires :Africa/Johannesburg @@ -67,7 +67,13 @@ set zones { } # Force a pre-load of all the timezones needed; otherwise can end up # poor-looking synch problems! -foreach zone $zones {clock format 0 -timezone $zone} +set zones {} +foreach zone $testzones { + if {![catch {clock format 0 -timezone $zone}]} { + lappend zones $zone + } +} +if {[llength $zones] < 2} { lappend zones -0200 :GMT :UTC +0200 } foreach zone $zones { set city [string map {_ " "} [regexp -inline {[^/]+$} $zone]] if {$i} { -- cgit v0.12 From 9b494bfe10bf3504dc575cd7255000677ab4bdc6 Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 25 Jun 2008 14:56:40 +0000 Subject: * changes: Updates for 8.6a1 release. --- ChangeLog | 4 ++++ changes | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b1b89c8..ac99a9d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-06-25 Don Porter + + * changes: Updates for 8.6a1 release. + 2008-06-24 Pat Thoyts * library/demos/ttkpane.tcl: Work around missing timezones diff --git a/changes b/changes index bdeaa74..746e012 100644 --- a/changes +++ b/changes @@ -2,7 +2,7 @@ This file summarizes all changes made to Tk since version 1.0 was released on March 13, 1991. Changes that aren't backward compatible are marked specially. -RCS: @(#) $Id: changes,v 1.132 2008/06/20 13:51:43 das Exp $ +RCS: @(#) $Id: changes,v 1.133 2008/06/25 14:56:48 dgp Exp $ 3/16/91 (bug fix) Modified tkWindow.c to remove Tk's Tcl commands from the interpreter when the main window is deleted (otherwise there will @@ -6534,4 +6534,4 @@ Several documentation and release notes improvements 2008-06-18 (bug fix) Aqua: missing focus on first map (steffen) ---- Released 8.6a1, June ??, 2008 --- See ChangeLog for details --- +--- Released 8.6a1, June 25, 2008 --- See ChangeLog for details --- -- cgit v0.12 From 8ab3b0fffbe37701d924b4da873e6f231a843e5f Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 25 Jun 2008 17:28:00 +0000 Subject: release tag 8.6a1 --- ChangeLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index ac99a9d..b2e6dde 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2008-06-25 Don Porter + *** 8.6a1 TAGGED FOR RELEASE *** + * changes: Updates for 8.6a1 release. 2008-06-24 Pat Thoyts -- cgit v0.12 From d6e7f6b3743e98803d7e8c7debc709c072c6e6a5 Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 30 Jun 2008 22:57:00 +0000 Subject: Minor doc updates (removing out of date changebars, improving typedef formatting, etc.) --- ChangeLog | 259 ++--- doc/3DBorder.3 | 4 +- doc/AddOption.3 | 4 +- doc/BindTable.3 | 4 +- doc/CanvPsY.3 | 242 ++-- doc/CanvTkwin.3 | 4 +- doc/CanvTxtInfo.3 | 6 +- doc/Clipboard.3 | 158 ++- doc/ClrSelect.3 | 82 +- doc/ConfigWidg.3 | 46 +- doc/CoordToWin.3 | 100 +- doc/CrtCmHdlr.3 | 11 +- doc/CrtErrHdlr.3 | 9 +- doc/CrtGenHdlr.3 | 167 ++- doc/CrtImgType.3 | 85 +- doc/CrtItemType.3 | 176 +-- doc/CrtPhImgFmt.3 | 114 +- doc/CrtSelHdlr.3 | 13 +- doc/CrtWindow.3 | 3 +- doc/DeleteImg.3 | 4 +- doc/DrawFocHlt.3 | 78 +- doc/EventHndlr.3 | 156 ++- doc/FindPhoto.3 | 24 +- doc/FontId.3 | 5 +- doc/GeomReq.3 | 192 ++- doc/GetBitmap.3 | 6 +- doc/GetCapStyl.3 | 4 +- doc/GetColor.3 | 3 +- doc/GetCursor.3 | 6 +- doc/GetDash.3 | 4 +- doc/GetFont.3 | 4 +- doc/GetGC.3 | 146 ++- doc/GetHINSTANCE.3 | 4 +- doc/GetHWND.3 | 79 +- doc/GetImage.3 | 21 +- doc/GetJoinStl.3 | 4 +- doc/GetJustify.3 | 3 +- doc/GetOption.3 | 4 +- doc/GetPixels.3 | 4 +- doc/GetPixmap.3 | 110 +- doc/GetScroll.3 | 4 +- doc/GetSelect.3 | 14 +- doc/GetUid.3 | 4 +- doc/GetVRoot.3 | 4 +- doc/Grab.3 | 125 +- doc/HWNDToWindow.3 | 58 +- doc/HandleEvent.3 | 96 +- doc/IdToWindow.3 | 70 +- doc/ImgChanged.3 | 135 ++- doc/Inactive.3 | 4 +- doc/InternAtom.3 | 4 +- doc/MainLoop.3 | 62 +- doc/MainWin.3 | 89 +- doc/MaintGeom.3 | 3 +- doc/ManageGeom.3 | 17 +- doc/MapWindow.3 | 4 +- doc/MoveToplev.3 | 4 +- doc/Name.3 | 4 +- doc/NameOfImg.3 | 4 +- doc/OwnSelect.3 | 103 +- doc/ParseArgv.3 | 6 +- doc/QWinEvent.3 | 104 +- doc/Restack.3 | 96 +- doc/RestrictEv.3 | 9 +- doc/SetAppName.3 | 4 +- doc/SetCaret.3 | 78 +- doc/SetClass.3 | 120 +- doc/SetClassProcs.3 | 180 ++- doc/SetGrid.3 | 132 ++- doc/SetOptions.3 | 60 +- doc/SetVisual.3 | 4 +- doc/StrictMotif.3 | 4 +- doc/TextLayout.3 | 5 +- doc/TkInitStubs.3 | 3 +- doc/Tk_Init.3 | 4 +- doc/Tk_Main.3 | 7 +- doc/WindowId.3 | 4 +- doc/bell.n | 69 +- doc/bind.n | 13 +- doc/bindtags.n | 7 +- doc/bitmap.n | 225 ++-- doc/button.n | 8 +- doc/canvas.n | 9 +- doc/checkbutton.n | 22 +- doc/chooseColor.n | 6 +- doc/chooseDirectory.n | 5 +- doc/clipboard.n | 7 +- doc/colors.n | 3 +- doc/console.n | 4 +- doc/cursors.n | 3 +- doc/destroy.n | 5 +- doc/dialog.n | 7 +- doc/entry.n | 3 +- doc/event.n | 8 +- doc/focus.n | 6 +- doc/focusNext.n | 5 +- doc/font.n | 11 +- doc/frame.n | 3 +- doc/getOpenFile.n | 4 +- doc/grab.n | 7 +- doc/grid.n | 44 +- doc/image.n | 6 +- doc/keysyms.n | 1858 +++++++++++++++-------------- doc/label.n | 4 +- doc/labelframe.n | 4 +- doc/listbox.n | 5 +- doc/loadTk.n | 6 +- doc/lower.n | 74 +- doc/menu.n | 5 +- doc/menubar.n | 78 +- doc/menubutton.n | 3 +- doc/message.n | 3 +- doc/messageBox.n | 12 +- doc/option.n | 6 +- doc/optionMenu.n | 4 +- doc/options.n | 7 +- doc/pack-old.n | 5 +- doc/pack.n | 7 +- doc/palette.n | 5 +- doc/panedwindow.n | 12 +- doc/photo.n | 7 +- doc/place.n | 15 +- doc/popup.n | 99 +- doc/radiobutton.n | 17 +- doc/raise.n | 7 +- doc/scale.n | 5 +- doc/scrollbar.n | 5 +- doc/selection.n | 5 +- doc/send.n | 8 +- doc/spinbox.n | 5 +- doc/text.n | 3081 +++++++++++++++++++++++-------------------------- doc/tk.n | 4 +- doc/tkerror.n | 75 +- doc/tkvars.n | 5 +- doc/tkwait.n | 101 +- doc/toplevel.n | 8 +- doc/ttk_Geometry.3 | 45 +- doc/ttk_Theme.3 | 4 +- doc/ttk_button.n | 4 +- doc/ttk_checkbutton.n | 5 +- doc/ttk_combobox.n | 5 +- doc/ttk_entry.n | 10 +- doc/ttk_frame.n | 6 +- doc/ttk_image.n | 7 +- doc/ttk_intro.n | 9 +- doc/ttk_label.n | 5 +- doc/ttk_labelframe.n | 5 +- doc/ttk_menubutton.n | 5 +- doc/ttk_notebook.n | 10 +- doc/ttk_panedwindow.n | 6 +- doc/ttk_progressbar.n | 5 +- doc/ttk_radiobutton.n | 6 +- doc/ttk_scale.n | 5 +- doc/ttk_scrollbar.n | 9 +- doc/ttk_separator.n | 5 +- doc/ttk_sizegrip.n | 7 +- doc/ttk_style.n | 7 +- doc/ttk_treeview.n | 9 +- doc/ttk_vsapi.n | 6 +- doc/ttk_widget.n | 10 +- doc/winfo.n | 6 +- doc/wish.1 | 4 +- doc/wm.n | 75 +- 163 files changed, 4984 insertions(+), 5307 deletions(-) diff --git a/ChangeLog b/ChangeLog index b2e6dde..afe1096 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-06-30 Donal K. Fellows + + * doc/*.1, doc/*.3, doc/*.n: Remove out of date changebars, make + formatting of typedefs consistent, other small changes. + 2008-06-25 Don Porter *** 8.6a1 TAGGED FOR RELEASE *** @@ -7,16 +12,16 @@ 2008-06-24 Pat Thoyts * library/demos/ttkpane.tcl: Work around missing timezones - * doc/text.n: bug #1997293 - fix documentation of text tag options. + * doc/text.n: Fix documentation of text tag options. [Bug 1997293] 2008-06-19 Don Porter * changes: Updates for 8.6a1 release. * generic/tk.h: TIP 285 additions make Tk 8.6 call the new - * library/tk.tcl: Tcl_Canceled() routine, available only in - Tcl 8.6, so bump our Tcl dependencies to version 8.6. Tk 8.6a1 will - no longer [load] into a Tcl 8.5 interp. + * library/tk.tcl: Tcl_Canceled() routine, available only in Tcl + 8.6, so bump our Tcl dependencies to version 8.6. Tk 8.6a1 will no + longer [load] into a Tcl 8.5 interp. * README: Bump version number to 8.6a1 * generic/tk.h: @@ -30,33 +35,33 @@ 2008-06-18 Daniel Steffen - * macosx/tkMacOSXCarbonEvents.c: fix debug carbon event tracing; - (InstallStandardApplicationEventHandler): replace needless use of + * macosx/tkMacOSXCarbonEvents.c: Fix debug carbon event tracing. + (InstallStandardApplicationEventHandler): Replace needless use of TkMacOSXInitNamedDebugSymbol() by standard TkMacOSXInitNamedSymbol(). - * macosx/tkMacOSXDebug.c: revert 2007-11-09 commit making + * macosx/tkMacOSXDebug.c: Revert 2007-11-09 commit making * macosx/tkMacOSXDebug.h: TkMacOSXInitNamedDebugSymbol() available outside of debug builds. - * macosx/tkMacOSXEmbed.c (TkpMakeWindow): fix bug with missing + * macosx/tkMacOSXEmbed.c (TkpMakeWindow): Fix bug with missing * macosx/tkMacOSXSubwindows.c (XMapWindow): focus on first map by only sending VisibilityNotify events once windows are mapped (rather than when they are created). - * macosx/tkMacOSXWindowEvent.c (TkMacOSXProcessWindowEvent): fix + * macosx/tkMacOSXWindowEvent.c (TkMacOSXProcessWindowEvent): Fix return value. - * macosx/tkMacOSXInit.c: add helper to efficiently convert from + * macosx/tkMacOSXInit.c: Add helper to efficiently convert from * macosx/tkMacOSXPrivate.h: CFString to Tcl_Obj. - * macosx/tkMacOSXFont.c (TkpGetFontFromAttributes, InitFont): fix + * macosx/tkMacOSXFont.c (TkpGetFontFromAttributes, InitFont): Fix incorrect conversion to points of font sizes already in points; factor out retrieval of font family name from font family ID. 2008-06-13 Jeff Hobbs - * win/configure, win/configure.in (TK_WIN_VERSION): fix handling - of interim a/b versioning for manifest usage. + * win/configure, win/configure.in (TK_WIN_VERSION): Fix handling of + interim a/b versioning for manifest usage. 2008-06-13 Joe Mistachkin @@ -64,8 +69,8 @@ * generic/tkCmds.c: During [tkwait] and [update], always cooperatively check for script cancellation. - * win/makefile.vc: Added 'pdbs' option for Windows build rules to allow - * win/rules.vc: for non-debug builds with full symbols. + * win/makefile.vc: Added 'pdbs' option for Windows build rules to + * win/rules.vc: allow for non-debug builds with full symbols. 2008-06-12 Daniel Steffen @@ -92,48 +97,43 @@ 2008-06-10 Joe English - * unix/tkUnixKey.c: tkUnixKey.c: Use Xutf8LookupString if available - [Patch #1986818]. This should fix problems (like #1908443) where - Xlib's idea of the system encoding does not match Tcl's. + * unix/tkUnixKey.c: Use Xutf8LookupString if available. This should + fix problems (like [Bug 1908443]) where Xlib's idea of the system + encoding does not match Tcl's. [Patch 1986818] 2008-06-01 Daniel Steffen - * macosx/Wish.xcodeproj/project.pbxproj: add new tclOO files; add debug - * macosx/README: configs with gcov; update to - Xcode 3.1. + * macosx/Wish.xcodeproj/project.pbxproj: Add new tclOO files; add + * macosx/README: debug configs with gcov; + update to Xcode 3.1. 2008-05-27 Pat Thoyts - * generic/ttk/ttkTheme.c: [ttk::style theme use] without - * doc/ttk_style.n: an argument now returns the current theme + * generic/ttk/ttkTheme.c: [ttk::style theme use] without an argument + * doc/ttk_style.n: now returns the current theme. 2008-05-23 Joe English * doc/ttk_treeview.n, generic/ttk/ttkTreeview.c, - generic/ttk/ttkTagSet.c, generic/ttk/ttkLayout.c, - generic/ttk/ttkTheme.c, generic/ttk/ttkTheme.h, - generic/ttk/ttkThemeInt.h, generic/ttk/ttkWidget.h: - - Added [$tv identify region], [$tv identify element], - and [$tv identify item] subcommands. Simplified - bindings. Added [$tv tag has] subcommand. Tag-related - display improvements; setting a tag -background or -foreground - no longer overrides selection feedback. - + * generic/ttk/ttkTagSet.c, generic/ttk/ttkLayout.c, + * generic/ttk/ttkTheme.c, generic/ttk/ttkTheme.h, + * generic/ttk/ttkThemeInt.h, generic/ttk/ttkWidget.h: + Added [$tv identify region], [$tv identify element], and [$tv identify + item] subcommands. Simplified bindings. Added [$tv tag has] + subcommand. Tag-related display improvements; setting a tag + -background or -foreground no longer overrides selection feedback. * library/ttk/altTheme.tcl, library/ttk/aquaTheme.tcl, - library/ttk/clamTheme.tcl, library/ttk/classicTheme.tcl, - library/ttk/defaults.tcl, library/ttk/treeview.tcl, - library/ttk/winTheme.tcl, library/ttk/xpTheme.tcl: - - Don't need separate 'Item', 'Cell', and 'Row' style - settings anymore, only the base "Treeview" style is used. - + * library/ttk/clamTheme.tcl, library/ttk/classicTheme.tcl, + * library/ttk/defaults.tcl, library/ttk/treeview.tcl, + * library/ttk/winTheme.tcl, library/ttk/xpTheme.tcl: + Don't need separate 'Item', 'Cell', and 'Row' style settings anymore, + only the base "Treeview" style is used. 2008-05-23 Joe English - * generic/ttk/ttkLabel.c: Avoid passing width or height <= 0 to - Tk_RedrawImage, as this leads to a panic on Windows [Bug 1967576] + * generic/ttk/ttkLabel.c: Avoid passing width or height <= 0 to + Tk_RedrawImage, as this leads to a panic on Windows. [Bug 1967576] 2008-05-16 Pat Thoyts @@ -159,7 +159,7 @@ 2008-05-11 Pat Thoyts * library/tk.tcl: Support for ttk widgets in AmpWidget - * doc/button.n: Note negative widths for button [Patch #1883418] + * doc/button.n: Note negative widths for button. [Patch 1883418] 2008-05-09 Pat Thoyts @@ -167,8 +167,8 @@ 2008-05-04 Joe English - * macosx/ttkMacOSAquaTheme.c: "default" and "focus" adornments - should not be disjoint [Bug 1942785] + * macosx/ttkMacOSAquaTheme.c: "default" and "focus" adornments should + not be disjoint [Bug 1942785] 2008-04-27 Donal K. Fellows @@ -180,14 +180,14 @@ 2008-04-25 Joe English - * library/ttk/treeview.tcl: BUGFIX: [$tv selection] takes - a list of items, not a single item [Bug 1951733]. + * library/ttk/treeview.tcl: BUGFIX: [$tv selection] takes a list of + items, not a single item. [Bug 1951733] 2008-04-20 Pat Thoyts - * win/makefile.vc: Include ws2_32 in the link list [Bug 1900872] - * doc/menu.n: Minor change regarding the system menu [Bug 1887169] - * doc/button.n: Minor clarification of button flash [Bug 1926223] + * win/makefile.vc: Include ws2_32 in the link list. [Bug 1900872] + * doc/menu.n: Minor change regarding the system menu. [Bug 1887169] + * doc/button.n: Minor clarification of button flash. [Bug 1926223] 2008-04-17 Donal K. Fellows @@ -196,12 +196,12 @@ 2008-04-17 Don Porter - * generic/tkCanvas.c: Fix logic that determines when canvas item - event should fire. Thanks to Sebastian Wangnick. [Bug 1327482] + * generic/tkCanvas.c: Fix logic that determines when canvas item + event should fire. Thanks to Sebastian Wangnick. [Bug 1327482] 2008-04-16 Daniel Steffen - * generic/tkStubInit.c: make stubs tables static const + * generic/tkStubInit.c: Make stubs tables static const * generic/tkWindow.c (Initialize): and export only a module-scope pointer to to the main stubs table (for package init). [Patch 1938497] @@ -236,10 +236,10 @@ * tkWinSend.c: Added conditional compilation to silence several compiler warnings. - + 2008-04-07 Jeff Hobbs - * generic/tkWindow.c (Initialize): fix double-free on Tk_ParseArgv + * generic/tkWindow.c (Initialize): Fix double-free on Tk_ParseArgv * tests/main.test (main-3.*): error. [Bug 1937135] * generic/tkArgv.c: fix -help mem explosion. [Bug 1936238] (kenny) @@ -256,16 +256,16 @@ 2008-04-02 Daniel Steffen - * generic/tk.decls: remove 'export' declarations of symbols now + * generic/tk.decls: Remove 'export' declarations of symbols now only in libtkstub and no longer in libtk. - * generic/tkStubLib.c: make symbols in libtkstub.a MODULE_SCOPE to + * generic/tkStubLib.c: Make symbols in libtkstub.a MODULE_SCOPE to avoid exporting them from libraries that link with -ltkstub; constify tk*StubsPtr and stub table hook pointers. [Bug 1819422] - * generic/tkStubLib.c: undef USE_TCL_STUBS before defining it - * generic/ttk/ttkStubLib.c: unconditionally; remove needless #ifdef + * generic/tkStubLib.c: Undef USE_TCL_STUBS before defining it + * generic/ttk/ttkStubLib.c: unconditionally; remove needless #ifdef * generic/tkDecls.h: make genstubs * generic/tkIntDecls.h: @@ -274,22 +274,22 @@ * generic/tkPlatDecls.h: * generic/tkStubInit.c: - * unix/configure.in (Darwin): remove now unnecessary unexporting - of libtclstub symbols from libtk. + * unix/configure.in (Darwin): Remove now unnecessary unexporting of + libtclstub symbols from libtk. * unix/configure: autoconf-2.59 2008-04-01 Don Porter - * generic/tkStubLib.c (Tk_InitStubs): Added missing error message and - * generic/tkWindow.c (Tk_PkgInitStubsCheck): removed needless #ifdef - complexity. + * generic/tkStubLib.c (Tk_InitStubs): Added missing error + * generic/tkWindow.c (Tk_PkgInitStubsCheck): message and removed + needless #ifdef complexity. - * generic/tkWindow.c: Revised package initialization so that + * generic/tkWindow.c: Revised package initialization so that * unix/Makefile.in: "tkStubsPtr" is not present in libtk.so, but * win/Makefile.in: is present only in libtkstub.a. This tightens - * win/makefile.bc: up the rules for users of the stubs interfaces. - * win/makefile.vc: [Tcl Bug 1819422]. + * win/makefile.bc: up the rules for users of the stubs interfaces + * win/makefile.vc: [Tcl Bug 1819422] * README: Bump version number to 8.6a0 * generic/tk.h: @@ -332,8 +332,8 @@ 2008-03-27 Jeff Hobbs - * library/safetk.tcl (::safe::tkInterpInit): make sure tk_library - and its subdirs (eg, ttk) are on the "safe" access path. + * library/safetk.tcl (::safe::tkInterpInit): make sure tk_library and + its subdirs (eg, ttk) are on the "safe" access path. 2008-03-27 Daniel Steffen @@ -343,9 +343,9 @@ 2008-03-27 Daniel Steffen - * generic/ttk/ttkStubLib.c: ensure tcl stubs are used in libtkstub + * generic/ttk/ttkStubLib.c: Ensure tcl stubs are used in libtkstub even in a static build of Tk. - * generic/ttk/ttkDecls.h: fix incorrect number of arguments in + * generic/ttk/ttkDecls.h: Fix incorrect number of arguments in Ttk_InitStubs macro definition. 2008-03-26 Don Porter @@ -353,18 +353,18 @@ * changes: Updates for 8.5.2 release. * unix/tkUnixCursor.c: Stop crash in [. configure -cursor] on X11. - Thanks to emiliano gavilán. [Bug 1922466] + Thanks to emiliano gavilán. [Bug 1922466] 2008-03-26 Joe English - * generic/tkInt.h, generic/tkEvent.c, unix/tkUnixEvent.c, - unix/tkUnixKey.c: XIM reorganization and cleanup; see + * generic/tkInt.h, generic/tkEvent.c, unix/tkUnixEvent.c, + * unix/tkUnixKey.c: XIM reorganization and cleanup; see [Patch 1919791] for details. 2008-03-21 Joe English - * generic/tk.decls, generic/ttk/ttkStubLib.c, unix/Makefile.in: - Keep ttkStubLib.o in libtkstub instead of libtk. [Bug 1920030] + * generic/tk.decls, generic/ttk/ttkStubLib.c, unix/Makefile.in: Keep + ttkStubLib.o in libtkstub instead of libtk. [Bug 1920030] 2008-03-20 Donal K. Fellows @@ -512,8 +512,8 @@ 2008-01-31 Jeff Hobbs - * library/msgbox.tcl (::tk::MessageBox): don't use ttk::label in - low depth/aqua fallback, as it doesn't support -bitmap. + * library/msgbox.tcl (::tk::MessageBox): don't use ttk::label in low + depth/aqua fallback, as it doesn't support -bitmap. * win/tkWinDialog.c (Tk_MessageBoxObjCmd): pass "" instead of NULL when -title isn't set. [Bug 1881892] @@ -637,8 +637,8 @@ 2007-12-12 Jeff Hobbs - * generic/tkText.c (DeleteIndexRange, TextEditCmd, UpdateDirtyFlag): - * tests/text.test (text-25.10.1,25.11.[12]): + * generic/tkText.c (DeleteIndexRange, TextEditCmd, UpdateDirtyFlag): + * tests/text.test (text-25.10.1,25.11.[12]): Don't require [update idle] to trigger Modified event [Bug 1809538] Modified virtual event should only fire on state change [Bug 1799782] Make sure we delete chars before triggering <> [Bug 1737288] @@ -651,11 +651,12 @@ * macosx/tkMacOSXWm.c (ApplyMasterOverrideChanges): Implement more * macosx/tkMacOSXMouseEvent.c (BringWindowForward): X11-like transient - * macosx/tkMacOSXSubwindows.c (XDestroyWindow): behaviour by adding - transient windows to a window group owned by the master window, this - ensures transients always remain in front of and are collapsed with the - master; bring master to front when selecting transient windows; restore - default window group of transients if master destroyed. [Bug 1845899] + * macosx/tkMacOSXSubwindows.c (XDestroyWindow): behaviour by + adding transient windows to a window group owned by the master window, + this ensures transients always remain in front of and are collapsed + with the master; bring master to front when selecting transient + windows; restore default window group of transients if master + destroyed. [Bug 1845899] 2007-12-12 Joe English @@ -668,9 +669,8 @@ 2007-12-11 Joe English - * generic/ttk/ttkTheme.c(StyleElementOptionsCmd): - Use Ttk_GetElement() to find element instead of direct - hash table access. + * generic/ttk/ttkTheme.c (StyleElementOptionsCmd): Use + Ttk_GetElement() to find element instead of direct hash table access. 2007-12-11 Donal K. Fellows @@ -1002,20 +1002,20 @@ 2007-11-07 Joe English - * generic/ttk/ttkTheme.c (Ttk_ElementSize): Fixed longstanding, - subtle bug that caused element padding to sometimes be counted - twice in size computations. + * generic/ttk/ttkTheme.c (Ttk_ElementSize): Fixed longstanding, subtle + bug that caused element padding to sometimes be counted twice in size + computations. * generic/ttk/ttkElements.c, generic/ttk/ttkClamTheme.c, - generic/ttk/ttkDefaultTheme.c, generic/ttk/ttkTreeview.c, - generic/ttk/ttkImage.c, macosx/ttkMacOSXTheme.c, - win/ttkWinTheme.c, win/ttkWinXPTheme.c: Fix ElementSizeProcs affected - by previous change. + * generic/ttk/ttkDefaultTheme.c, generic/ttk/ttkTreeview.c, + * generic/ttk/ttkImage.c, macosx/ttkMacOSXTheme.c, + * win/ttkWinTheme.c, win/ttkWinXPTheme.c: + Fix ElementSizeProcs affected by previous change. 2007-11-06 Andreas Kupries * doc/CrtConsoleChan.3: Fixed markup typo and extended see also - section per suggestions by Donal. + section per suggestions by Donal. 2007-11-05 Joe English @@ -1024,8 +1024,8 @@ 2007-11-05 Andreas Kupries - * doc/CrtConsoleChan.3: New file providing minimal documentation - of 'Tk_InitConsoleChannels()'. [Bug 432435] + * doc/CrtConsoleChan.3: New file providing minimal documentation of + 'Tk_InitConsoleChannels()'. [Bug 432435] 2007-11-05 Joe English @@ -1034,13 +1034,12 @@ 2007-11-04 Joe English - * generic/ttk/ttkTreeview.c: Use null "treearea" element for - treeview owner-draw area instead of "client", to avoid - nameclash with Notebook.client element (this was causing - sizing anomalies in XP theme, and introduced extraneous - padding). - * generic/ttk/ttkDefaultTheme.c: Treeitem.indicator element - needs left margin now. + * generic/ttk/ttkTreeview.c: Use null "treearea" element for treeview + owner-draw area instead of "client", to avoid nameclash with + Notebook.client element (this was causing sizing anomalies in XP + theme, and introduced extraneous padding). + * generic/ttk/ttkDefaultTheme.c: Treeitem.indicator element needs left + margin now. 2007-11-04 Daniel Steffen @@ -1063,8 +1062,9 @@ * doc/getOpenFile.n: information. * doc/menu.n: - * macosx/tkMacOSXEvent.c (TkMacOSXProcessCommandEvent): fix boolean arg - + * macosx/tkMacOSXEvent.c (TkMacOSXProcessCommandEvent): fix boolean + arg + * macosx/Wish.xcodeproj/project.pbxproj: add new demo file. * macosx/Wish.xcode/project.pbxproj: @@ -1123,9 +1123,9 @@ people better understand what is being validated, following suggestion from Don Porter. - * library/demos/image2.tcl (loadImage): Mark non-loadable images - as such instead of throwing a nasty dialog, following suggestion - from Don Porter. + * library/demos/image2.tcl (loadImage): Mark non-loadable images as + such instead of throwing a nasty dialog, following suggestion from Don + Porter. * generic/tkImgPhoto.c (Tk_PhotoPutBlock): More optimization, derived from [Patch 224066]. @@ -1283,9 +1283,9 @@ 2007-10-24 Joe English * generic/ttk/*.c, win/{ttkWinMonitor,ttkWinTheme,ttkWinXPTheme}.c, - * macosx/ttkMacOSXTheme.c: Move widget layout registration - from TtkElements_Init() to widget *_Init() routines. - Renaming/consistency: s/...ElementGeometry()/...ElementSize()/ + * macosx/ttkMacOSXTheme.c: Move widget layout registration from + TtkElements_Init() to widget *_Init() routines. Renaming/consistency: + s/...ElementGeometry()/...ElementSize()/ 2007-10-24 Donal K. Fellows @@ -1436,7 +1436,7 @@ * generic/tkFocus.c, generic/tkFrame.c, generic/tkInt.h: * macosx/tkMacOSXButton.c, macosx/tkMacOSXMenubutton.c: * macosx/tkMacOSXWm.c, unix/tkUnixWm.c, win/tkWinWm.c: - * doc/wm.n, tests/wm.test: TIP #125 implementation [Bug 998125] + * doc/wm.n, tests/wm.test: TIP #125 implementation. [Bug 998125] Adds [wm manage|forget] for dockable frames. Finished X11 and Windows code, needs OS X completion. @@ -1505,9 +1505,10 @@ * macosx/tkMacOSXMenu.c: HIShapeRefs visRgn & aboveVisRgn and * macosx/tkMacOSXSubwindows.c: CGRect drawRect. - * macosx/tkMacOSXWindowEvent.c: remove use of QD port vis rgn in window - * macosx/tkMacOSXSubwindows.c: update rgn calculation, manually excise - * macosx/tkMacOSXWm.c: growbox from toplevel clip rgn instead. + * macosx/tkMacOSXWindowEvent.c: remove use of QD port vis rgn in + * macosx/tkMacOSXSubwindows.c: window update rgn calculation, + * macosx/tkMacOSXWm.c: manually excise growbox from toplevel + clip rgn instead. * macosx/tkMacOSXDraw.c: replace use of QD port clip rgn by new * macosx/tkMacOSXPrivate.h: clipRgn fld in TkMacOSXDrawingContext; @@ -1516,8 +1517,8 @@ cleanup/speedup CGContext setup in TkMacOSXSetupDrawingContext(). - * macosx/tkMacOSXDraw.c: change TkMacOSXSetupDrawingContext() to - * macosx/tkMacOSXEntry.c: return boolean indicating whether + * macosx/tkMacOSXDraw.c: change TkMacOSXSetupDrawingContext() + * macosx/tkMacOSXEntry.c: to return boolean indicating whether * macosx/tkMacOSXFont.c: drawing is allowed (and was setup) or * macosx/tkMacOSXMenu.c: not (e.g. when clipRgn is empty). * macosx/ttkMacOSXTheme.c: @@ -1528,10 +1529,10 @@ * macosx/tkMacOSXRegion.c: add wrappers for missing/buggy HIShape * macosx/tkMacOSXPrivate.h: API, and private helpers to operate on - HIShapeRefs & convert to/from TkRegion. + HIShapeRefs & convert to/from TkRegion - * macosx/tkMacOSXRegion.c: add Tkp{Retain,Release}Region() API for - * macosx/tkMacOSXInt.h: TkRegion. + * macosx/tkMacOSXRegion.c: add Tkp{Retain,Release}Region() API + * macosx/tkMacOSXInt.h: for TkRegion. * xlib/xgc.c: factor out alloc/free of GC clip_mask; * macosx/tkMacOSXXStubs.c: manage clip rgn lifetime with new @@ -1543,10 +1544,10 @@ 2007-10-11 David Gravereaux - * win/winMain.c: Replaced incorrect comments in main() to descibe - why the console widget does not need to be created for this - application entry point (if used). Must have been a bad copy/paste - of WinMain() from 10 years back. + * win/winMain.c: Replaced incorrect comments in main() to descibe why + the console widget does not need to be created for this application + entry point (if used). Must have been a bad copy/paste of WinMain() + from 10 years back. 2007-10-11 Daniel Steffen @@ -1556,9 +1557,9 @@ 2007-10-09 Pat Thoyts - * generic/tkImage.c: Make Ttk_GetImage safe if called with NULL - * tests/ttk/image.test: interp. Added some tests that crash - on Windows without this fix. + * generic/tkImage.c: Make Ttk_GetImage safe if called with NULL + * tests/ttk/image.test: interp. Added some tests that crash on Windows + without this fix. 2007-10-02 Don Porter diff --git a/doc/3DBorder.3 b/doc/3DBorder.3 index cc8cb8b..204f908 100644 --- a/doc/3DBorder.3 +++ b/doc/3DBorder.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: 3DBorder.3,v 1.11 2007/12/13 15:23:42 dgp Exp $ +'\" RCS: @(#) $Id: 3DBorder.3,v 1.12 2008/06/30 22:57:00 dkf Exp $ '\" .so man.macros .TH Tk_Alloc3DBorderFromObj 3 8.1 Tk "Tk Library Procedures" @@ -136,7 +136,6 @@ it forms the bottom side. Specifies which of the border's graphics contexts is desired. Must be \fBTK_3D_FLAT_GC\fR, \fBTK_3D_LIGHT_GC\fR, or \fBTK_3D_DARK_GC\fR. .BE - .SH DESCRIPTION .PP These procedures provide facilities for drawing window borders in a @@ -292,6 +291,5 @@ with the Tk_3DBorder token for the border. There should be exactly one call to \fBTk_Free3DBorderFromObj\fR or \fBTk_Free3DBorder\fR for each call to \fBTk_Alloc3DBorderFromObj\fR or \fBTk_Get3DBorder\fR. - .SH KEYWORDS 3D, background, border, color, depressed, illumination, object, polygon, raised, shadow, three-dimensional effect diff --git a/doc/AddOption.3 b/doc/AddOption.3 index 4359c20..882d23b 100644 --- a/doc/AddOption.3 +++ b/doc/AddOption.3 @@ -2,7 +2,7 @@ '\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" All rights reserved. '\" -'\" RCS: @(#) $Id: AddOption.3,v 1.6 2007/12/13 15:23:42 dgp Exp $ +'\" RCS: @(#) $Id: AddOption.3,v 1.7 2008/06/30 22:57:00 dkf Exp $ '\" '\" .so man.macros @@ -26,7 +26,6 @@ Value of option. .AP int priority in Overall priority level to use for option. .BE - .SH DESCRIPTION .PP This procedure is invoked to add an option to the database @@ -50,6 +49,5 @@ user-specific startup files. .IP 80 Used for options specified interactively after the application starts running. - .SH KEYWORDS class, name, option, add diff --git a/doc/BindTable.3 b/doc/BindTable.3 index 688fa7f..32d6184 100644 --- a/doc/BindTable.3 +++ b/doc/BindTable.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: BindTable.3,v 1.5 2007/01/05 00:00:49 nijtmans Exp $ +'\" RCS: @(#) $Id: BindTable.3,v 1.6 2008/06/30 22:57:00 dkf Exp $ '\" .so man.macros .TH Tk_CreateBindingTable 3 4.0 Tk "Tk Library Procedures" @@ -63,7 +63,6 @@ Number of object identifiers pointed to by \fIobjectPtr\fR. Points to an array of object identifiers: bindings will be considered for each of these objects in order from first to last. .BE - .SH DESCRIPTION .PP These procedures provide a general-purpose mechanism for creating @@ -152,6 +151,5 @@ the object is skipped. \fBTk_BindEvent\fR continues through all of the objects, handling exceptions such as errors, \fBbreak\fR, and \fBcontinue\fR as described in the documentation for \fBbind\fR. - .SH KEYWORDS binding, event, object, script diff --git a/doc/CanvPsY.3 b/doc/CanvPsY.3 index 36e3264..05b214e 100644 --- a/doc/CanvPsY.3 +++ b/doc/CanvPsY.3 @@ -1,122 +1,120 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: CanvPsY.3,v 1.6 2004/09/19 16:05:36 dkf Exp $ -'\" -.so man.macros -.TH Tk_CanvasPs 3 4.0 Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_CanvasPsY, Tk_CanvasPsBitmap, Tk_CanvasPsColor, Tk_CanvasPsFont, Tk_CanvasPsPath, Tk_CanvasPsStipple \- utility procedures for generating Postscript for canvases -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -double -\fBTk_CanvasPsY\fR(\fIcanvas, canvasY\fR) -.sp -int -\fBTk_CanvasPsBitmap\fR(\fIinterp, canvas, bitmap, x, y, width, height\fR) -.sp -int -\fBTk_CanvasPsColor\fR(\fIinterp, canvas, colorPtr\fR) -.sp -int -\fBTk_CanvasPsFont\fR(\fIinterp, canvas, tkFont\fR) -.sp -\fBTk_CanvasPsPath\fR(\fIinterp, canvas, coordPtr, numPoints\fR) -.sp -int -\fBTk_CanvasPsStipple\fR(\fIinterp, canvas, bitmap\fR) -.SH ARGUMENTS -.AS "unsigned int" "numPoints" -.AP Tk_Canvas canvas in -A token that identifies a canvas widget for which Postscript is -being generated. -.AP double canvasY in -Y-coordinate in the space of the canvas. -.AP Tcl_Interp *interp in/out -A Tcl interpreter; Postscript is appended to its result, or the -result may be replaced with an error message. -.AP Pixmap bitmap in -Bitmap to use for generating Postscript. -.AP int x in -X-coordinate within \fIbitmap\fR of left edge of region to output. -.AP int y in -Y-coordinate within \fIbitmap\fR of top edge of region to output. -.AP "int" width in -Width of region of bitmap to output, in pixels. -.AP "int" height in -Height of region of bitmap to output, in pixels. -.AP XColor *colorPtr in -Information about color value to set in Postscript. -.AP Tk_Font tkFont in -Font for which Postscript is to be generated. -.AP double *coordPtr in -Pointer to an array of coordinates for one or more -points specified in canvas coordinates. -The order of values in \fIcoordPtr\fR is x1, y1, x2, y2, x3, y3, -and so on. -.AP int numPoints in -Number of points at \fIcoordPtr\fR. -.BE - -.SH DESCRIPTION -.PP -These procedures are called by canvas type managers to carry out -common functions related to generating Postscript. -Most of the procedures take a \fIcanvas\fR argument, which -refers to a canvas widget for which Postscript is being -generated. -.PP -\fBTk_CanvasPsY\fR takes as argument a y-coordinate in the space of -a canvas and returns the value that should be used for that point -in the Postscript currently being generated for \fIcanvas\fR. -Y coordinates require transformation because Postscript uses an -origin at the lower-left corner whereas X uses an origin at the -upper-left corner. -Canvas x coordinates can be used directly in Postscript without -transformation. -.PP -\fBTk_CanvasPsBitmap\fR generates Postscript to describe a region -of a bitmap. -The Postscript is generated in proper image data format for Postscript, -i.e., as data between angle brackets, one bit per pixel. -The Postscript is appended to \fIinterp->result\fR and \fBTCL_OK\fR is returned -unless an error occurs, in which case \fBTCL_ERROR\fR is returned and -\fIinterp->result\fR is overwritten with an error message. -.PP -\fBTk_CanvasPsColor\fR generates Postscript to set the current color -to correspond to its \fIcolorPtr\fR argument, taking into account any -color map specified in the \fBpostscript\fR command. -It appends the Postscript to \fIinterp->result\fR and returns -\fBTCL_OK\fR unless an error occurs, in which case \fBTCL_ERROR\fR is returned and -\fIinterp->result\fR is overwritten with an error message. -.PP -\fBTk_CanvasPsFont\fR generates Postscript that sets the current font -to match \fItkFont\fR as closely as possible. -\fBTk_CanvasPsFont\fR takes into account any font map specified -in the \fBpostscript\fR command, and it does -the best it can at mapping X fonts to Postscript fonts. -It appends the Postscript to \fIinterp->result\fR and returns \fBTCL_OK\fR -unless an error occurs, in which case \fBTCL_ERROR\fR is returned and -\fIinterp->result\fR is overwritten with an error message. -.PP -\fBTk_CanvasPsPath\fR generates Postscript to set the current path -to the set of points given by \fIcoordPtr\fR and \fInumPoints\fR. -It appends the resulting Postscript to \fIinterp->result\fR. -.PP -\fBTk_CanvasPsStipple\fR generates Postscript that will fill the -current path in stippled fashion. -It uses \fIbitmap\fR as the stipple pattern and the current Postscript -color; ones in the stipple bitmap are drawn in the current color, and -zeroes are not drawn at all. -The Postscript is appended to \fIinterp->result\fR and \fBTCL_OK\fR is -returned, unless an error occurs, in which case \fBTCL_ERROR\fR is returned and -\fIinterp->result\fR is overwritten with an error message. - -.SH KEYWORDS -bitmap, canvas, color, font, path, Postscript, stipple +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: CanvPsY.3,v 1.7 2008/06/30 22:57:00 dkf Exp $ +'\" +.so man.macros +.TH Tk_CanvasPs 3 4.0 Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_CanvasPsY, Tk_CanvasPsBitmap, Tk_CanvasPsColor, Tk_CanvasPsFont, Tk_CanvasPsPath, Tk_CanvasPsStipple \- utility procedures for generating Postscript for canvases +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +double +\fBTk_CanvasPsY\fR(\fIcanvas, canvasY\fR) +.sp +int +\fBTk_CanvasPsBitmap\fR(\fIinterp, canvas, bitmap, x, y, width, height\fR) +.sp +int +\fBTk_CanvasPsColor\fR(\fIinterp, canvas, colorPtr\fR) +.sp +int +\fBTk_CanvasPsFont\fR(\fIinterp, canvas, tkFont\fR) +.sp +\fBTk_CanvasPsPath\fR(\fIinterp, canvas, coordPtr, numPoints\fR) +.sp +int +\fBTk_CanvasPsStipple\fR(\fIinterp, canvas, bitmap\fR) +.SH ARGUMENTS +.AS "unsigned int" "numPoints" +.AP Tk_Canvas canvas in +A token that identifies a canvas widget for which Postscript is +being generated. +.AP double canvasY in +Y-coordinate in the space of the canvas. +.AP Tcl_Interp *interp in/out +A Tcl interpreter; Postscript is appended to its result, or the +result may be replaced with an error message. +.AP Pixmap bitmap in +Bitmap to use for generating Postscript. +.AP int x in +X-coordinate within \fIbitmap\fR of left edge of region to output. +.AP int y in +Y-coordinate within \fIbitmap\fR of top edge of region to output. +.AP "int" width in +Width of region of bitmap to output, in pixels. +.AP "int" height in +Height of region of bitmap to output, in pixels. +.AP XColor *colorPtr in +Information about color value to set in Postscript. +.AP Tk_Font tkFont in +Font for which Postscript is to be generated. +.AP double *coordPtr in +Pointer to an array of coordinates for one or more +points specified in canvas coordinates. +The order of values in \fIcoordPtr\fR is x1, y1, x2, y2, x3, y3, +and so on. +.AP int numPoints in +Number of points at \fIcoordPtr\fR. +.BE +.SH DESCRIPTION +.PP +These procedures are called by canvas type managers to carry out +common functions related to generating Postscript. +Most of the procedures take a \fIcanvas\fR argument, which +refers to a canvas widget for which Postscript is being +generated. +.PP +\fBTk_CanvasPsY\fR takes as argument a y-coordinate in the space of +a canvas and returns the value that should be used for that point +in the Postscript currently being generated for \fIcanvas\fR. +Y coordinates require transformation because Postscript uses an +origin at the lower-left corner whereas X uses an origin at the +upper-left corner. +Canvas x coordinates can be used directly in Postscript without +transformation. +.PP +\fBTk_CanvasPsBitmap\fR generates Postscript to describe a region +of a bitmap. +The Postscript is generated in proper image data format for Postscript, +i.e., as data between angle brackets, one bit per pixel. +The Postscript is appended to \fIinterp->result\fR and \fBTCL_OK\fR is returned +unless an error occurs, in which case \fBTCL_ERROR\fR is returned and +\fIinterp->result\fR is overwritten with an error message. +.PP +\fBTk_CanvasPsColor\fR generates Postscript to set the current color +to correspond to its \fIcolorPtr\fR argument, taking into account any +color map specified in the \fBpostscript\fR command. +It appends the Postscript to \fIinterp->result\fR and returns +\fBTCL_OK\fR unless an error occurs, in which case \fBTCL_ERROR\fR is returned and +\fIinterp->result\fR is overwritten with an error message. +.PP +\fBTk_CanvasPsFont\fR generates Postscript that sets the current font +to match \fItkFont\fR as closely as possible. +\fBTk_CanvasPsFont\fR takes into account any font map specified +in the \fBpostscript\fR command, and it does +the best it can at mapping X fonts to Postscript fonts. +It appends the Postscript to \fIinterp->result\fR and returns \fBTCL_OK\fR +unless an error occurs, in which case \fBTCL_ERROR\fR is returned and +\fIinterp->result\fR is overwritten with an error message. +.PP +\fBTk_CanvasPsPath\fR generates Postscript to set the current path +to the set of points given by \fIcoordPtr\fR and \fInumPoints\fR. +It appends the resulting Postscript to \fIinterp->result\fR. +.PP +\fBTk_CanvasPsStipple\fR generates Postscript that will fill the +current path in stippled fashion. +It uses \fIbitmap\fR as the stipple pattern and the current Postscript +color; ones in the stipple bitmap are drawn in the current color, and +zeroes are not drawn at all. +The Postscript is appended to \fIinterp->result\fR and \fBTCL_OK\fR is +returned, unless an error occurs, in which case \fBTCL_ERROR\fR is returned and +\fIinterp->result\fR is overwritten with an error message. +.SH KEYWORDS +bitmap, canvas, color, font, path, Postscript, stipple diff --git a/doc/CanvTkwin.3 b/doc/CanvTkwin.3 index 3283f37..0f1c7c4 100644 --- a/doc/CanvTkwin.3 +++ b/doc/CanvTkwin.3 @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: CanvTkwin.3,v 1.7 2007/12/13 15:23:42 dgp Exp $ +'\" RCS: @(#) $Id: CanvTkwin.3,v 1.8 2008/06/30 22:57:00 dkf Exp $ '\" .so man.macros .TH Tk_CanvasTkwin 3 4.1 Tk "Tk Library Procedures" @@ -73,7 +73,6 @@ the left of this coordinate need to be redisplayed. Bottom edge of the region that needs redisplay. Only pixels above this coordinate need to be redisplayed. .BE - .SH DESCRIPTION .PP These procedures are called by canvas type managers to perform various @@ -156,6 +155,5 @@ static Tk_ConfigSpec configSpecs[] = { ... }; .CE - .SH KEYWORDS canvas, focus, item type, redisplay, selection, type manager diff --git a/doc/CanvTxtInfo.3 b/doc/CanvTxtInfo.3 index c3eb487..81080dd 100644 --- a/doc/CanvTxtInfo.3 +++ b/doc/CanvTxtInfo.3 @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: CanvTxtInfo.3,v 1.5 2007/12/13 15:23:42 dgp Exp $ +'\" RCS: @(#) $Id: CanvTxtInfo.3,v 1.6 2008/06/30 22:57:00 dkf Exp $ '\" .so man.macros .TH Tk_CanvasTextInfo 3 4.0 Tk "Tk Library Procedures" @@ -22,7 +22,6 @@ Tk_CanvasTextInfo * .AP Tk_Canvas canvas in A token that identifies a particular canvas widget. .BE - .SH DESCRIPTION .PP Textual canvas items are somewhat more complicated to manage than @@ -49,7 +48,7 @@ typedef struct Tk_CanvasTextInfo { Tk_Item *\fIfocusItemPtr\fR; int \fIgotFocus\fR; int \fIcursorOn\fR; -} Tk_CanvasTextInfo; +} \fBTk_CanvasTextInfo\fR; .CE The \fBselBorder\fR field identifies a Tk_3DBorder that should be used for drawing the background under selected text. @@ -99,6 +98,5 @@ anchor, as determined by \fIselItemPtr\fR or \fIanchorItemPtr\fR). If all of the selected text in the item is deleted, the item should set \fIselItemPtr\fR to NULL to indicate that there is no longer a selection. - .SH KEYWORDS canvas, focus, insertion cursor, selection, selection anchor, text diff --git a/doc/Clipboard.3 b/doc/Clipboard.3 index 4cf58d8..d0646ea 100644 --- a/doc/Clipboard.3 +++ b/doc/Clipboard.3 @@ -1,80 +1,78 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: Clipboard.3,v 1.3 2004/09/19 16:05:36 dkf Exp $ -'\" -.so man.macros -.TH Tk_ClipboardClear 3 4.0 Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_ClipboardClear, Tk_ClipboardAppend \- Manage the clipboard -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -int -\fBTk_ClipboardClear\fR(\fIinterp, tkwin\fR) -.sp -int -\fBTk_ClipboardAppend\fR(\fIinterp, tkwin, target, format, buffer\fR) -.SH ARGUMENTS -.AS Tk_ClipboardClear tkwin -.AP Tcl_Interp *interp in -Interpreter to use for reporting errors. -.AP Tk_Window tkwin in -Window that determines which display's clipboard to manipulate. -.AP Atom target in -Conversion type for this clipboard item; has same meaning as -\fItarget\fR argument to \fBTk_CreateSelHandler\fR. -.AP Atom format in -Representation to use when data is retrieved; has same meaning as -\fIformat\fR argument to \fBTk_CreateSelHandler\fR. -.AP char *buffer in -Null terminated string containing the data to be appended to the clipboard. -.BE - -.SH DESCRIPTION -.PP -These two procedures manage the clipboard for Tk. -The clipboard is typically managed by calling \fBTk_ClipboardClear\fR -once, then calling \fBTk_ClipboardAppend\fR to add data for any -number of targets. -.PP -\fBTk_ClipboardClear\fR claims the CLIPBOARD selection and frees any -data items previously stored on the clipboard in this application. -It normally returns \fBTCL_OK\fR, but if an error occurs it returns -\fBTCL_ERROR\fR and leaves an error message in \fIinterp->result\fR. -\fBTk_ClipboardClear\fR must be called before a sequence of -\fBTk_ClipboardAppend\fR calls can be issued. -.PP -\fBTk_ClipboardAppend\fR appends a buffer of data to the clipboard. -The first buffer for a given \fItarget\fR determines the \fIformat\fR -for that \fItarget\fR. -Any successive appends for that \fItarget\fR must have -the same format or an error will be returned. -\fBTk_ClipboardAppend\fR returns \fBTCL_OK\fR if the buffer is -successfully copied onto the clipboard. If the clipboard is not -currently owned by the application, either -because \fBTk_ClipboardClear\fR has not been called or because -ownership of the clipboard has changed since the last call to -\fBTk_ClipboardClear\fR, -\fBTk_ClipboardAppend\fR returns \fBTCL_ERROR\fR and leaves an error message in -\fIinterp->result\fR. -.PP -In order to guarantee atomicity, no event handling should occur -between \fBTk_ClipboardClear\fR and the following -\fBTk_ClipboardAppend\fR calls (otherwise someone could retrieve -a partially completed clipboard or claim ownership away from -this application). -.PP -\fBTk_ClipboardClear\fR may invoke callbacks, including arbitrary -Tcl scripts, as a result of losing the CLIPBOARD selection, so -any calling function should take care to be reentrant at the point -\fBTk_ClipboardClear\fR is invoked. - -.SH KEYWORDS -append, clipboard, clear, format, type +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: Clipboard.3,v 1.4 2008/06/30 22:57:00 dkf Exp $ +'\" +.so man.macros +.TH Tk_ClipboardClear 3 4.0 Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_ClipboardClear, Tk_ClipboardAppend \- Manage the clipboard +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +int +\fBTk_ClipboardClear\fR(\fIinterp, tkwin\fR) +.sp +int +\fBTk_ClipboardAppend\fR(\fIinterp, tkwin, target, format, buffer\fR) +.SH ARGUMENTS +.AS Tk_ClipboardClear tkwin +.AP Tcl_Interp *interp in +Interpreter to use for reporting errors. +.AP Tk_Window tkwin in +Window that determines which display's clipboard to manipulate. +.AP Atom target in +Conversion type for this clipboard item; has same meaning as +\fItarget\fR argument to \fBTk_CreateSelHandler\fR. +.AP Atom format in +Representation to use when data is retrieved; has same meaning as +\fIformat\fR argument to \fBTk_CreateSelHandler\fR. +.AP char *buffer in +Null terminated string containing the data to be appended to the clipboard. +.BE +.SH DESCRIPTION +.PP +These two procedures manage the clipboard for Tk. +The clipboard is typically managed by calling \fBTk_ClipboardClear\fR +once, then calling \fBTk_ClipboardAppend\fR to add data for any +number of targets. +.PP +\fBTk_ClipboardClear\fR claims the CLIPBOARD selection and frees any +data items previously stored on the clipboard in this application. +It normally returns \fBTCL_OK\fR, but if an error occurs it returns +\fBTCL_ERROR\fR and leaves an error message in \fIinterp->result\fR. +\fBTk_ClipboardClear\fR must be called before a sequence of +\fBTk_ClipboardAppend\fR calls can be issued. +.PP +\fBTk_ClipboardAppend\fR appends a buffer of data to the clipboard. +The first buffer for a given \fItarget\fR determines the \fIformat\fR +for that \fItarget\fR. +Any successive appends for that \fItarget\fR must have +the same format or an error will be returned. +\fBTk_ClipboardAppend\fR returns \fBTCL_OK\fR if the buffer is +successfully copied onto the clipboard. If the clipboard is not +currently owned by the application, either +because \fBTk_ClipboardClear\fR has not been called or because +ownership of the clipboard has changed since the last call to +\fBTk_ClipboardClear\fR, +\fBTk_ClipboardAppend\fR returns \fBTCL_ERROR\fR and leaves an error message in +\fIinterp->result\fR. +.PP +In order to guarantee atomicity, no event handling should occur +between \fBTk_ClipboardClear\fR and the following +\fBTk_ClipboardAppend\fR calls (otherwise someone could retrieve +a partially completed clipboard or claim ownership away from +this application). +.PP +\fBTk_ClipboardClear\fR may invoke callbacks, including arbitrary +Tcl scripts, as a result of losing the CLIPBOARD selection, so +any calling function should take care to be reentrant at the point +\fBTk_ClipboardClear\fR is invoked. +.SH KEYWORDS +append, clipboard, clear, format, type diff --git a/doc/ClrSelect.3 b/doc/ClrSelect.3 index 1736848..d00d51b 100644 --- a/doc/ClrSelect.3 +++ b/doc/ClrSelect.3 @@ -1,42 +1,40 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: ClrSelect.3,v 1.2 1998/09/14 18:22:46 stanton Exp $ -'\" -.so man.macros -.TH Tk_ClearSelection 3 4.0 Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_ClearSelection \- Deselect a selection -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTk_ClearSelection\fR(\fItkwin, selection\fR) -.SH ARGUMENTS -.AS Tk_Window tkwin -.AP Tk_Window tkwin in -The selection will be cleared from the display containing this -window. -.AP Atom selection in -The name of selection to be cleared. -.BE - -.SH DESCRIPTION -.PP -\fBTk_ClearSelection\fR cancels the selection specified by the atom -\fIselection\fR for the display containing \fItkwin\fR. -The selection need not be in \fItkwin\fR itself or even in -\fItkwin\fR's application. -If there is a window anywhere on \fItkwin\fR's display that -owns \fIselection\fR, the window will be notified and the -selection will be cleared. -If there is no owner for \fIselection\fR on the display, then the -procedure has no effect. - -.SH KEYWORDS -clear, selection +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: ClrSelect.3,v 1.3 2008/06/30 22:57:00 dkf Exp $ +'\" +.so man.macros +.TH Tk_ClearSelection 3 4.0 Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_ClearSelection \- Deselect a selection +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +\fBTk_ClearSelection\fR(\fItkwin, selection\fR) +.SH ARGUMENTS +.AS Tk_Window tkwin +.AP Tk_Window tkwin in +The selection will be cleared from the display containing this +window. +.AP Atom selection in +The name of selection to be cleared. +.BE +.SH DESCRIPTION +.PP +\fBTk_ClearSelection\fR cancels the selection specified by the atom +\fIselection\fR for the display containing \fItkwin\fR. +The selection need not be in \fItkwin\fR itself or even in +\fItkwin\fR's application. +If there is a window anywhere on \fItkwin\fR's display that +owns \fIselection\fR, the window will be notified and the +selection will be cleared. +If there is no owner for \fIselection\fR on the display, then the +procedure has no effect. +.SH KEYWORDS +clear, selection diff --git a/doc/ConfigWidg.3 b/doc/ConfigWidg.3 index 1fd230e..d26878a 100644 --- a/doc/ConfigWidg.3 +++ b/doc/ConfigWidg.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ConfigWidg.3,v 1.20 2007/12/13 15:23:42 dgp Exp $ +'\" RCS: @(#) $Id: ConfigWidg.3,v 1.21 2008/06/30 22:57:00 dkf Exp $ '\" .so man.macros .TH Tk_ConfigureWidget 3 4.1 Tk "Tk Library Procedures" @@ -63,7 +63,7 @@ Display containing widget whose record is being freed; needed in order to free up resources. .BE .SH DESCRIPTION -.PP +.PP Note: \fBTk_ConfigureWidget\fR should be replaced with the new \fBTcl_Obj\fR based API \fBTk_SetOptions\fR. The old interface is retained for backward compatibility. @@ -112,7 +112,7 @@ typedef struct { int \fIoffset\fR; int \fIspecFlags\fR; Tk_CustomOption *\fIcustomPtr\fR; -} Tk_ConfigSpec; +} \fBTk_ConfigSpec\fR; .CE The \fItype\fR field indicates what type of configuration option this is (e.g. \fBTK_CONFIG_COLOR\fR for a color value, or \fBTK_CONFIG_INT\fR for @@ -358,7 +358,6 @@ is an empty string then the target will be set to NULL. \fBTK_CONFIG_WINDOW\fR The value must be a window path name. It is translated to a \fBTk_Window\fR token and the token is stored in the target. - .SH "GROUPED ENTRIES" .PP In some cases it is useful to generate multiple resources from @@ -376,7 +375,6 @@ Each of the entries after the first must have a NULL value in its \fIargvName\fR field; this indicates that the entry is to be grouped with the entry that precedes it. Only the \fItype\fR and \fIoffset\fR fields are used from these follow-on entries. - .SH "FLAGS" .PP The \fIflags\fR argument passed to \fBTk_ConfigureWidget\fR is used @@ -436,13 +434,11 @@ once, save the value, and provide it before calling .TP \fBTK_CONFIG_OPTION_SPECIFIED\fR This bit is -.VS 8.5 deprecated. It used to be set and cleared by \fBTk_ConfigureWidget\fR so that callers could detect what entries were specified in \fIargv\fR, but it was removed because it was inherently thread-unsafe. Code that wishes to detect what options were specified should use \fBTk_SetOptions\fR instead. -.VE 8.5 .PP The \fBTK_CONFIG_MONO_ONLY\fR and \fBTK_CONFIG_COLOR_ONLY\fR flags are typically used to specify different default values for @@ -475,7 +471,6 @@ for which this entry is valid. When calling \fBTk_ConfigureWidget\fR, \fIflags\fR will have a single one of these bits set to select the entries for the desired widget type. For a working example of this feature, see the code in tkButton.c. - .SH TK_OFFSET .PP The \fBTk_Offset\fR macro is provided as a safe way of generating @@ -483,7 +478,6 @@ the \fIoffset\fR values for entries in Tk_ConfigSpec structures. It takes two arguments: the name of a type of record, and the name of a field in that record. It returns the byte offset of the named field in records of the given type. - .SH TK_CONFIGUREINFO .PP The \fBTk_ConfigureInfo\fR procedure may be used to obtain @@ -519,7 +513,6 @@ if \fIargvName\fR had been NULL. .PP The \fIflags\fR argument to \fBTk_ConfigureInfo\fR is used to restrict the \fIspecs\fR entries to consider, just as for \fBTk_ConfigureWidget\fR. - .SH TK_CONFIGUREVALUE .PP \fBTk_ConfigureValue\fR takes arguments similar to \fBTk_ConfigureInfo\fR; @@ -532,7 +525,6 @@ not a valid option name), \fBTCL_ERROR\fR is returned and an error message is left in \fIinterp->result\fR. This procedure is typically called to implement \fBcget\fR widget commands. - .SH TK_FREEOPTIONS .PP The \fBTk_FreeOptions\fR procedure may be invoked during widget cleanup @@ -545,7 +537,6 @@ it contains a null pointer) then no resource is freed for that entry. After freeing a resource, \fBTk_FreeOptions\fR sets the corresponding field of the widget record to null. - .SH "CUSTOM OPTION TYPES" .PP Applications can extend the built-in configuration types with additional @@ -556,22 +547,22 @@ typedef struct Tk_CustomOption { Tk_OptionParseProc *\fIparseProc\fR; Tk_OptionPrintProc *\fIprintProc\fR; ClientData \fIclientData\fR; -} Tk_CustomOption; +} \fBTk_CustomOption\fR; -typedef int Tk_OptionParseProc( - ClientData \fIclientData\fR, - Tcl_Interp *\fIinterp\fR, - Tk_Window \fItkwin\fR, - char *\fIvalue\fR, - char *\fIwidgRec\fR, - int \fIoffset\fR); +typedef int \fBTk_OptionParseProc\fR( + ClientData \fIclientData\fR, + Tcl_Interp *\fIinterp\fR, + Tk_Window \fItkwin\fR, + char *\fIvalue\fR, + char *\fIwidgRec\fR, + int \fIoffset\fR); -typedef char *Tk_OptionPrintProc( - ClientData \fIclientData\fR, - Tk_Window \fItkwin\fR, - char *\fIwidgRec\fR, - int \fIoffset\fR, - Tcl_FreeProc **\fIfreeProcPtr\fR); +typedef char *\fBTk_OptionPrintProc\fR( + ClientData \fIclientData\fR, + Tk_Window \fItkwin\fR, + char *\fIwidgRec\fR, + int \fIoffset\fR, + Tcl_FreeProc **\fIfreeProcPtr\fR); .CE The Tk_CustomOption structure contains three fields, which are pointers to the two procedures and a \fIclientData\fR value to be passed to those @@ -624,7 +615,6 @@ Tk_CustomOption structure has been created for them, options of this new type may be manipulated with Tk_ConfigSpec entries whose \fItype\fR fields are \fBTK_CONFIG_CUSTOM\fR and whose \fIcustomPtr\fR fields point to the Tk_CustomOption structure. - .SH EXAMPLES .PP Although the explanation of \fBTk_ConfigureWidget\fR is fairly @@ -635,10 +625,8 @@ The library implementation of frames (tkFrame.c) has a simple configuration table, and the library implementation of buttons (tkButton.c) has a much more complex table that uses many of the fancy \fIspecFlags\fR mechanisms. - .SH "SEE ALSO" Tk_SetOptions(3) - .SH KEYWORDS anchor, bitmap, boolean, border, cap style, color, configuration options, cursor, custom, double, font, integer, join style, justify, millimeters, diff --git a/doc/CoordToWin.3 b/doc/CoordToWin.3 index 93f81ee..9eb8427 100644 --- a/doc/CoordToWin.3 +++ b/doc/CoordToWin.3 @@ -1,51 +1,49 @@ -'\" -'\" Copyright (c) 1990-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. -'\" -'\" RCS: @(#) $Id: CoordToWin.3,v 1.2 1998/09/14 18:22:46 stanton Exp $ -'\" -.so man.macros -.TH Tk_CoordsToWindow 3 "" Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_CoordsToWindow \- Find window containing a point -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -Tk_Window -\fBTk_CoordsToWindow\fR(\fIrootX, rootY, tkwin\fR) -.SH ARGUMENTS -.AS Tk_Window tkwin -.AP int rootX in -X-coordinate (in root window coordinates). -.AP int rootY in -Y-coordinate (in root window coordinates). -.AP Tk_Window tkwin in -Token for window that identifies application. -.BE - -.SH DESCRIPTION -.PP -\fBTk_CoordsToWindow\fR locates the window that contains a given point. -The point is specified in root coordinates with \fIrootX\fR and -\fIrootY\fR (if a virtual-root window manager is in use then -\fIrootX\fR and \fIrootY\fR are in the coordinate system of the -virtual root window). -The return value from the procedure is a token for the window that -contains the given point. -If the point is not in any window, or if the containing window -is not in the same application as \fItkwin\fR, then NULL is -returned. -.PP -The containing window is decided using the same rules that determine -which window contains the mouse cursor: if a parent and a child both -contain the point then the child gets preference, and if two siblings -both contain the point then the highest one in the stacking order -(i.e. the one that's visible on the screen) gets preference. - -.SH KEYWORDS -containing, coordinates, root window +'\" +'\" Copyright (c) 1990-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. +'\" +'\" RCS: @(#) $Id: CoordToWin.3,v 1.3 2008/06/30 22:57:00 dkf Exp $ +'\" +.so man.macros +.TH Tk_CoordsToWindow 3 "" Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_CoordsToWindow \- Find window containing a point +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +Tk_Window +\fBTk_CoordsToWindow\fR(\fIrootX, rootY, tkwin\fR) +.SH ARGUMENTS +.AS Tk_Window tkwin +.AP int rootX in +X-coordinate (in root window coordinates). +.AP int rootY in +Y-coordinate (in root window coordinates). +.AP Tk_Window tkwin in +Token for window that identifies application. +.BE +.SH DESCRIPTION +.PP +\fBTk_CoordsToWindow\fR locates the window that contains a given point. +The point is specified in root coordinates with \fIrootX\fR and +\fIrootY\fR (if a virtual-root window manager is in use then +\fIrootX\fR and \fIrootY\fR are in the coordinate system of the +virtual root window). +The return value from the procedure is a token for the window that +contains the given point. +If the point is not in any window, or if the containing window +is not in the same application as \fItkwin\fR, then NULL is +returned. +.PP +The containing window is decided using the same rules that determine +which window contains the mouse cursor: if a parent and a child both +contain the point then the child gets preference, and if two siblings +both contain the point then the highest one in the stacking order +(i.e. the one that's visible on the screen) gets preference. +.SH KEYWORDS +containing, coordinates, root window diff --git a/doc/CrtCmHdlr.3 b/doc/CrtCmHdlr.3 index dd22530..fbe6a95 100644 --- a/doc/CrtCmHdlr.3 +++ b/doc/CrtCmHdlr.3 @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: CrtCmHdlr.3,v 1.4 2007/12/13 15:23:42 dgp Exp $ +'\" RCS: @(#) $Id: CrtCmHdlr.3,v 1.5 2008/06/30 22:57:00 dkf Exp $ '\" .so man.macros .TH Tk_CreateClientMessageHandler 3 "8.4" Tk "Tk Library Procedures" @@ -22,10 +22,8 @@ Tk_CreateClientMessageHandler, Tk_DeleteClientMessageHandler \- associate proced .AP Tk_ClientMessageProc *proc in Procedure to invoke whenever a ClientMessage X event occurs on any display. .BE - .SH DESCRIPTION .PP - \fBTk_CreateClientMessageHandler\fR arranges for \fIproc\fR to be invoked in the future whenever a ClientMessage X event occurs that is not handled by \fBWM_PROTOCOL\fR. \fBTk_CreateClientMessageHandler\fR is intended for use @@ -41,9 +39,9 @@ call \fBTk_HandleEvent\fR, such as \fBTk_DoOneEvent\fR or \fIProc\fR should have arguments and result that match the type \fBTk_ClientMessageProc\fR: .CS -typedef int Tk_ClientMessageProc( - Tk_Window \fItkwin\fR, - XEvent *\fIeventPtr\fR); +typedef int \fBTk_ClientMessageProc\fR( + Tk_Window \fItkwin\fR, + XEvent *\fIeventPtr\fR); .CE The \fItkwin\fR parameter to \fIproc\fR is the Tk window which is associated with this event. \fIEventPtr\fR is a pointer to the X event. @@ -64,6 +62,5 @@ finds that matches the \fIproc\fR argument. If no such handler exists, then \fBTk_DeleteClientMessageHandler\fR returns without doing anything. Although Tk supports it, it's probably a bad idea to have more than one callback with the same \fIproc\fR argument. - .SH KEYWORDS bind, callback, event, handler diff --git a/doc/CrtErrHdlr.3 b/doc/CrtErrHdlr.3 index a42332e..8f5ff62 100644 --- a/doc/CrtErrHdlr.3 +++ b/doc/CrtErrHdlr.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: CrtErrHdlr.3,v 1.7 2007/12/13 15:23:42 dgp Exp $ +'\" RCS: @(#) $Id: CrtErrHdlr.3,v 1.8 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_CreateErrorHandler 3 "" Tk "Tk Library Procedures" @@ -74,9 +74,9 @@ made when the handler was active (see below for more information). \fIProc\fR should have arguments and result that match the following type: .CS -typedef int Tk_ErrorProc( - ClientData \fIclientData\fR, - XErrorEvent *\fIerrEventPtr\fR); +typedef int \fBTk_ErrorProc\fR( + ClientData \fIclientData\fR, + XErrorEvent *\fIerrEventPtr\fR); .CE The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR argument given to \fBTcl_CreateErrorHandler\fR when the callback @@ -138,6 +138,5 @@ handlers deleted before the \fBXSync\fR call. For the Tk error handling mechanism to work properly, it is essential that application code never calls \fBXSetErrorHandler\fR directly; applications should use only \fBTk_CreateErrorHandler\fR. - .SH KEYWORDS callback, error, event, handler diff --git a/doc/CrtGenHdlr.3 b/doc/CrtGenHdlr.3 index d31f463..095361f 100644 --- a/doc/CrtGenHdlr.3 +++ b/doc/CrtGenHdlr.3 @@ -1,84 +1,83 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: CrtGenHdlr.3,v 1.3 2004/09/19 16:05:36 dkf Exp $ -'\" -.so man.macros -.TH Tk_CreateGenericHandler 3 "" Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_CreateGenericHandler, Tk_DeleteGenericHandler \- associate procedure callback with all X events -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTk_CreateGenericHandler\fR(\fIproc, clientData\fR) -.sp -\fBTk_DeleteGenericHandler\fR(\fIproc, clientData\fR) -.SH ARGUMENTS -.AS "Tk_GenericProc" clientData -.AP Tk_GenericProc *proc in -Procedure to invoke whenever any X event occurs on any display. -.AP ClientData clientData in -Arbitrary one-word value to pass to \fIproc\fR. -.BE - -.SH DESCRIPTION -.PP -\fBTk_CreateGenericHandler\fR arranges for \fIproc\fR to be -invoked in the future whenever any X event occurs. This mechanism is -\fInot\fR intended for dispatching X events on windows managed by Tk -(you should use \fBTk_CreateEventHandler\fR for this purpose). -\fBTk_CreateGenericHandler\fR is intended for other purposes, such -as tracing X events, monitoring events on windows not owned by Tk, -accessing X-related libraries that were not originally designed for -use with Tk, and so on. -.PP -The callback to \fIproc\fR will be made by \fBTk_HandleEvent\fR; -this mechanism only works in programs that dispatch events -through \fBTk_HandleEvent\fR (or through other Tk procedures that -call \fBTk_HandleEvent\fR, such as \fBTk_DoOneEvent\fR or -\fBTk_MainLoop\fR). -.PP -\fIProc\fR should have arguments and result that match the -type \fBTk_GenericProc\fR: -.CS -typedef int Tk_GenericProc( - ClientData \fIclientData\fR, - XEvent *\fIeventPtr\fR); -.CE -The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR -argument given to \fBTk_CreateGenericHandler\fR when the callback -was created. Typically, \fIclientData\fR points to a data -structure containing application-specific information about -how to handle events. -\fIEventPtr\fR is a pointer to the X event. -.PP -Whenever an X event is processed by \fBTk_HandleEvent\fR, \fIproc\fR -is called. The return value from \fIproc\fR is normally 0. -A non-zero return value indicates that the event is not to be handled -further; that is, \fIproc\fR has done all processing that is to be -allowed for the event. -.PP -If there are multiple generic event handlers, each one is called -for each event, in the order in which they were established. -.PP -\fBTk_DeleteGenericHandler\fR may be called to delete a -previously-created generic event handler: it deletes each handler -it finds that matches the \fIproc\fR and \fIclientData\fR arguments. If -no such handler exists, then \fBTk_DeleteGenericHandler\fR returns -without doing anything. Although Tk supports it, it's probably -a bad idea to have more than one callback with the same -\fIproc\fR and \fIclientData\fR arguments. -.PP -Establishing a generic event handler does nothing to ensure that the -process will actually receive the X events that the handler wants to -process. -For example, it is the caller's responsibility to invoke -\fBXSelectInput\fR to select the desired events, if that is necessary. -.SH KEYWORDS -bind, callback, event, handler +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: CrtGenHdlr.3,v 1.4 2008/06/30 22:57:01 dkf Exp $ +'\" +.so man.macros +.TH Tk_CreateGenericHandler 3 "" Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_CreateGenericHandler, Tk_DeleteGenericHandler \- associate procedure callback with all X events +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +\fBTk_CreateGenericHandler\fR(\fIproc, clientData\fR) +.sp +\fBTk_DeleteGenericHandler\fR(\fIproc, clientData\fR) +.SH ARGUMENTS +.AS "Tk_GenericProc" clientData +.AP Tk_GenericProc *proc in +Procedure to invoke whenever any X event occurs on any display. +.AP ClientData clientData in +Arbitrary one-word value to pass to \fIproc\fR. +.BE +.SH DESCRIPTION +.PP +\fBTk_CreateGenericHandler\fR arranges for \fIproc\fR to be +invoked in the future whenever any X event occurs. This mechanism is +\fInot\fR intended for dispatching X events on windows managed by Tk +(you should use \fBTk_CreateEventHandler\fR for this purpose). +\fBTk_CreateGenericHandler\fR is intended for other purposes, such +as tracing X events, monitoring events on windows not owned by Tk, +accessing X-related libraries that were not originally designed for +use with Tk, and so on. +.PP +The callback to \fIproc\fR will be made by \fBTk_HandleEvent\fR; +this mechanism only works in programs that dispatch events +through \fBTk_HandleEvent\fR (or through other Tk procedures that +call \fBTk_HandleEvent\fR, such as \fBTk_DoOneEvent\fR or +\fBTk_MainLoop\fR). +.PP +\fIProc\fR should have arguments and result that match the +type \fBTk_GenericProc\fR: +.CS +typedef int \fBTk_GenericProc\fR( + ClientData \fIclientData\fR, + XEvent *\fIeventPtr\fR); +.CE +The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR +argument given to \fBTk_CreateGenericHandler\fR when the callback +was created. Typically, \fIclientData\fR points to a data +structure containing application-specific information about +how to handle events. +\fIEventPtr\fR is a pointer to the X event. +.PP +Whenever an X event is processed by \fBTk_HandleEvent\fR, \fIproc\fR +is called. The return value from \fIproc\fR is normally 0. +A non-zero return value indicates that the event is not to be handled +further; that is, \fIproc\fR has done all processing that is to be +allowed for the event. +.PP +If there are multiple generic event handlers, each one is called +for each event, in the order in which they were established. +.PP +\fBTk_DeleteGenericHandler\fR may be called to delete a +previously-created generic event handler: it deletes each handler +it finds that matches the \fIproc\fR and \fIclientData\fR arguments. If +no such handler exists, then \fBTk_DeleteGenericHandler\fR returns +without doing anything. Although Tk supports it, it's probably +a bad idea to have more than one callback with the same +\fIproc\fR and \fIclientData\fR arguments. +.PP +Establishing a generic event handler does nothing to ensure that the +process will actually receive the X events that the handler wants to +process. +For example, it is the caller's responsibility to invoke +\fBXSelectInput\fR to select the desired events, if that is necessary. +.SH KEYWORDS +bind, callback, event, handler diff --git a/doc/CrtImgType.3 b/doc/CrtImgType.3 index 2ff52cd..805eb1c 100644 --- a/doc/CrtImgType.3 +++ b/doc/CrtImgType.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: CrtImgType.3,v 1.13 2007/12/13 15:23:42 dgp Exp $ +'\" RCS: @(#) $Id: CrtImgType.3,v 1.14 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_CreateImageType 3 8.5 Tk "Tk Library Procedures" @@ -40,7 +40,6 @@ Number of arguments .AP char ***argvPtr in/out Pointer to argument list .BE - .SH DESCRIPTION .PP \fBTk_CreateImageType\fR is invoked to define a new kind of image. @@ -67,7 +66,7 @@ typedef struct Tk_ImageType { Tk_ImageDisplayProc *\fIdisplayProc\fR; Tk_ImageFreeProc *\fIfreeProc\fR; Tk_ImageDeleteProc *\fIdeleteProc\fR; -} Tk_ImageType; +} \fBTk_ImageType\fR; .CE The fields of this structure will be described in later subsections of this entry. @@ -94,7 +93,6 @@ option specified for a widget or canvas item. .PP The following subsections describe the fields of a Tk_ImageType in more detail. - .SS NAME .PP \fItypePtr->name\fR provides a name for the image type. @@ -103,21 +101,21 @@ in \fBimage create\fR commands to create images of the new type. If there already existed an image type by this name then the new image type replaces the old one. - .SS CREATEPROC +.PP \fItypePtr->createProc\fR provides the address of a procedure for Tk to call whenever \fBimage create\fR is invoked to create an image of the new type. \fItypePtr->createProc\fR must match the following prototype: .CS -typedef int Tk_ImageCreateProc( - Tcl_Interp *\fIinterp\fR, - char *\fIname\fR, - int \fIobjc\fR, - Tcl_Obj *const \fIobjv\fR[], - Tk_ImageType *\fItypePtr\fR, - Tk_ImageMaster \fImaster\fR, - ClientData *\fImasterDataPtr\fR); +typedef int \fBTk_ImageCreateProc\fR( + Tcl_Interp *\fIinterp\fR, + char *\fIname\fR, + int \fIobjc\fR, + Tcl_Obj *const \fIobjv\fR[], + Tk_ImageType *\fItypePtr\fR, + Tk_ImageMaster \fImaster\fR, + ClientData *\fImasterDataPtr\fR); .CE The \fIinterp\fR argument is the interpreter in which the \fBimage\fR command was invoked, and \fIname\fR is the name for the new image, @@ -143,16 +141,15 @@ it should return \fBTCL_OK\fR. .PP \fIcreateProc\fR should call \fBTk_ImageChanged\fR in order to set the size of the image and request an initial redisplay. - .SS GETPROC .PP \fItypePtr->getProc\fR is invoked by Tk whenever a widget calls \fBTk_GetImage\fR to use a particular image. This procedure must match the following prototype: .CS -typedef ClientData Tk_ImageGetProc( - Tk_Window \fItkwin\fR, - ClientData \fImasterData\fR); +typedef ClientData \fBTk_ImageGetProc\fR( + Tk_Window \fItkwin\fR, + ClientData \fImasterData\fR); .CE The \fItkwin\fR argument identifies the window in which the image will be used and \fImasterData\fR is the value @@ -164,23 +161,22 @@ display the image in the given window. is typically the address of the instance data structure. Tk will pass this value back to the image manager when invoking its \fIdisplayProc\fR and \fIfreeProc\fR procedures. - .SS DISPLAYPROC .PP \fItypePtr->displayProc\fR is invoked by Tk whenever an image needs to be displayed (i.e., whenever a widget calls \fBTk_RedrawImage\fR). \fIdisplayProc\fR must match the following prototype: .CS -typedef void Tk_ImageDisplayProc( - ClientData \fIinstanceData\fR, - Display *\fIdisplay\fR, - Drawable \fIdrawable\fR, - int \fIimageX\fR, - int \fIimageY\fR, - int \fIwidth\fR, - int \fIheight\fR, - int \fIdrawableX\fR, - int \fIdrawableY\fR); +typedef void \fBTk_ImageDisplayProc\fR( + ClientData \fIinstanceData\fR, + Display *\fIdisplay\fR, + Drawable \fIdrawable\fR, + int \fIimageX\fR, + int \fIimageY\fR, + int \fIwidth\fR, + int \fIheight\fR, + int \fIdrawableX\fR, + int \fIdrawableY\fR); .CE The \fIinstanceData\fR will be the same as the value returned by \fIgetProc\fR when the instance was created. @@ -197,7 +193,6 @@ as specified in the most recent call to \fBTk_ImageChanged\fR. the image should be displayed; \fIdisplayProc\fR should display the given region of the image so that point (\fIimageX\fR, \fIimageY\fR) in the image appears at (\fIdrawableX\fR, \fIdrawableY\fR) in \fIdrawable\fR. - .SS FREEPROC .PP \fItypePtr->freeProc\fR contains the address of a procedure that @@ -208,16 +203,15 @@ in a canvas is deleted, or when the image displayed in a widget or canvas item is changed. \fIfreeProc\fR must match the following prototype: .CS -typedef void Tk_ImageFreeProc( - ClientData \fIinstanceData\fR, - Display *\fIdisplay\fR); +typedef void \fBTk_ImageFreeProc\fR( + ClientData \fIinstanceData\fR, + Display *\fIdisplay\fR); .CE The \fIinstanceData\fR will be the same as the value returned by \fIgetProc\fR when the instance was created, and \fIdisplay\fR is the display containing the window for the instance. \fIfreeProc\fR should release any resources associated with the image instance, since the instance will never be used again. - .SS DELETEPROC .PP \fItypePtr->deleteProc\fR is a procedure that Tk invokes when an @@ -227,15 +221,14 @@ Before invoking \fIdeleteProc\fR Tk will invoke \fIfreeProc\fR for each of the image's instances. \fIdeleteProc\fR must match the following prototype: .CS -typedef void Tk_ImageDeleteProc( - ClientData \fImasterData\fR); +typedef void \fBTk_ImageDeleteProc\fR( + ClientData \fImasterData\fR); .CE The \fImasterData\fR argument will be the same as the value stored in \fI*masterDataPtr\fR by \fIcreateProc\fR when the image was created. \fIdeleteProc\fR should release any resources associated with the image. - .SH TK_GETIMAGEMASTERDATA .PP The procedure \fBTk_GetImageMasterData\fR may be invoked to retrieve @@ -249,19 +242,19 @@ and the return value is the ClientData value returned by the \fIcreateProc\fR when the image was created (this is typically a pointer to the image master data structure). If no such image exists then NULL is returned and NULL is stored at \fI*typePtrPtr\fR. - .SH "LEGACY INTERFACE SUPPORT" +.PP In Tk 8.2 and earlier, the definition of \fBTk_ImageCreateProc\fR was incompatibly different, with the following prototype: .CS -typedef int Tk_ImageCreateProc( - Tcl_Interp *\fIinterp\fR, - char *\fIname\fR, - int \fIargc\fR, - char **\fIargv\fR, - Tk_ImageType *\fItypePtr\fR, - Tk_ImageMaster \fImaster\fR, - ClientData *\fImasterDataPtr\fR); +typedef int \fBTk_ImageCreateProc\fR( + Tcl_Interp *\fIinterp\fR, + char *\fIname\fR, + int \fIargc\fR, + char **\fIargv\fR, + Tk_ImageType *\fItypePtr\fR, + Tk_ImageMaster \fImaster\fR, + ClientData *\fImasterDataPtr\fR); .CE Legacy programs and libraries dating from those days may still contain code that defines extended Tk image types using the old @@ -285,9 +278,7 @@ use Tk 8.4 headers and stub libraries to do so. .PP Any new code written today should not make use of the legacy interfaces. Expect their support to go away in Tk 9. - .SH "SEE ALSO" Tk_ImageChanged, Tk_GetImage, Tk_FreeImage, Tk_RedrawImage, Tk_SizeOfImage - .SH KEYWORDS image manager, image type, instance, master diff --git a/doc/CrtItemType.3 b/doc/CrtItemType.3 index 08b82e5..057013d 100644 --- a/doc/CrtItemType.3 +++ b/doc/CrtItemType.3 @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: CrtItemType.3,v 1.12 2007/12/13 15:23:42 dgp Exp $ +'\" RCS: @(#) $Id: CrtItemType.3,v 1.13 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_CreateItemType 3 4.0 Tk "Tk Library Procedures" @@ -84,7 +84,7 @@ typedef struct Tk_ItemType { Tk_ItemInsertProc *\fIinsertProc\fR; Tk_ItemDCharsProc *\fIdCharsProc\fR; Tk_ItemType *\fInextPtr\fR; -} Tk_ItemType; +} \fBTk_ItemType\fR; .CE .PP The fields of a Tk_ItemType structure are described in more detail @@ -118,7 +118,7 @@ typedef struct BitmapItem { XColor *\fIfgColor\fR; XColor *\fIbgColor\fR; GC \fIgc\fR; -} BitmapItem; +} \fBBitmapItem\fR; .CE The \fIheader\fR substructure contains information used by Tk to manage the item, such as its identifier, its tags, its type, @@ -163,6 +163,7 @@ type. If there already existed an item type by this name then the new item type replaces the old one. .SS ITEMSIZE +.PP \fItypePtr->itemSize\fR gives the size in bytes of item records of this type, including the Tk_Item header. Tk uses this size to allocate memory space for items of the type. @@ -176,12 +177,12 @@ object of variable length and keep a pointer to it in the item record. Tk to call whenever a new item of this type is created. \fItypePtr->createProc\fR must match the following prototype: .CS -typedef int Tk_ItemCreateProc( - Tcl_Interp *\fIinterp\fR, - Tk_Canvas \fIcanvas\fR, - Tk_Item *\fIitemPtr\fR, - int \fIobjc\fR, - Tcl_Obj* const \fIobjv\fR[]); +typedef int \fBTk_ItemCreateProc\fR( + Tcl_Interp *\fIinterp\fR, + Tk_Canvas \fIcanvas\fR, + Tk_Item *\fIitemPtr\fR, + int \fIobjc\fR, + Tcl_Obj* const \fIobjv\fR[]); .CE The \fIinterp\fR argument is the interpreter in which the canvas's \fBcreate\fR widget command was invoked, and \fIcanvas\fR is a @@ -230,13 +231,13 @@ manager for an example of how to use it in \fIconfigSpecs\fR. configuration options for a canvas item. This procedure must match the following prototype: .CS -typedef int Tk_ItemConfigureProc( - Tcl_Interp *\fIinterp\fR, - Tk_Canvas \fIcanvas\fR, - Tk_Item *\fIitemPtr\fR, - int \fIobjc\fR, - Tcl_Obj* const \fIobjv\fR[], - int \fIflags\fR); +typedef int \fBTk_ItemConfigureProc\fR( + Tcl_Interp *\fIinterp\fR, + Tk_Canvas \fIcanvas\fR, + Tk_Item *\fIitemPtr\fR, + int \fIobjc\fR, + Tcl_Obj* const \fIobjv\fR[], + int \fIflags\fR); .CE The \fIinterp\fR objument identifies the interpreter in which the widget command was invoked, \fIcanvas\fR is a handle for the canvas @@ -264,12 +265,12 @@ options. widget command for an item. It must match the following prototype: .CS -typedef int Tk_ItemCoordProc( - Tcl_Interp *\fIinterp\fR, - Tk_Canvas \fIcanvas\fR, - Tk_Item *\fIitemPtr\fR, - int \fIobjc\fR, - Tcl_Obj* const \fIobjv\fR[]); +typedef int \fBTk_ItemCoordProc\fR( + Tcl_Interp *\fIinterp\fR, + Tk_Canvas \fIcanvas\fR, + Tk_Item *\fIitemPtr\fR, + int \fIobjc\fR, + Tcl_Obj* const \fIobjv\fR[]); .CE The arguments \fIinterp\fR, \fIcanvas\fR, and \fIitemPtr\fR all have the standard meanings, and \fIobjc\fR and \fIobjv\fR @@ -293,10 +294,10 @@ If an error occurs, \fIcoordProc\fR must leave an error message in and free any resources allocated to it. It must match the following prototype: .CS -typedef void Tk_ItemDeleteProc( - Tk_Canvas \fIcanvas\fR, - Tk_Item *\fIitemPtr\fR, - Display *\fIdisplay\fR); +typedef void \fBTk_ItemDeleteProc\fR( + Tk_Canvas \fIcanvas\fR, + Tk_Item *\fIitemPtr\fR, + Display *\fIdisplay\fR); .CE The \fIcanvas\fR and \fIitemPtr\fR arguments have the usual interpretations, and \fIdisplay\fR identifies the X display containing @@ -311,15 +312,15 @@ be done by Tk when \fIdeleteProc\fR returns. on the screen. It must match the following prototype: .CS -typedef void Tk_ItemDisplayProc( - Tk_Canvas \fIcanvas\fR, - Tk_Item *\fIitemPtr\fR, - Display *\fIdisplay\fR, - Drawable \fIdst\fR, - int \fIx\fR, - int \fIy\fR, - int \fIwidth\fR, - int \fIheight\fR); +typedef void \fBTk_ItemDisplayProc\fR( + Tk_Canvas \fIcanvas\fR, + Tk_Item *\fIitemPtr\fR, + Display *\fIdisplay\fR, + Drawable \fIdst\fR, + int \fIx\fR, + int \fIy\fR, + int \fIwidth\fR, + int \fIheight\fR); .CE The \fIcanvas\fR and \fIitemPtr\fR arguments have the usual meaning. \fIdisplay\fR identifies the display containing the canvas, and @@ -356,10 +357,10 @@ Tk uses this procedure for purposes such as locating the item under the mouse or finding the closest item to a given point. The procedure must match the following prototype: .CS -typedef double Tk_ItemPointProc( - Tk_Canvas \fIcanvas\fR, - Tk_Item *\fIitemPtr\fR, - double *\fIpointPtr\fR); +typedef double \fBTk_ItemPointProc\fR( + Tk_Canvas \fIcanvas\fR, + Tk_Item *\fIitemPtr\fR, + double *\fIpointPtr\fR); .CE \fIcanvas\fR and \fIitemPtr\fR have the usual meaning. \fIpointPtr\fR points to an array of two numbers giving @@ -373,10 +374,10 @@ the item. between an item and a rectangular area. It must match the following prototype: .CS -typedef int Tk_ItemAreaProc( - Tk_Canvas \fIcanvas\fR, - Tk_Item *\fIitemPtr\fR, - double *\fIrectPtr\fR); +typedef int \fBTk_ItemAreaProc\fR( + Tk_Canvas \fIcanvas\fR, + Tk_Item *\fIitemPtr\fR, + double *\fIrectPtr\fR); .CE \fIcanvas\fR and \fIitemPtr\fR have the usual meaning. \fIrectPtr\fR points to an array of four real numbers; @@ -394,11 +395,11 @@ If the type manager is not capable of generating Postscript then \fItypePtr->postscriptProc\fR should be NULL. The procedure must match the following prototype: .CS -typedef int Tk_ItemPostscriptProc( - Tcl_Interp *\fIinterp\fR, - Tk_Canvas \fIcanvas\fR, - Tk_Item *\fIitemPtr\fR, - int \fIprepass\fR); +typedef int \fBTk_ItemPostscriptProc\fR( + Tcl_Interp *\fIinterp\fR, + Tk_Canvas \fIcanvas\fR, + Tk_Item *\fIitemPtr\fR, + int \fIprepass\fR); .CE The \fIinterp\fR, \fIcanvas\fR, and \fIitemPtr\fR arguments all have standard meanings; \fIprepass\fR will be described below. @@ -437,17 +438,18 @@ all Postscript generation except for calls to \fBTk_CanvasPsFont\fR. During the second pass \fIprepass\fR will be 0, so the type manager must generate complete Postscript. .SS SCALEPROC +.PP \fItypePtr->scaleProc\fR is invoked by Tk to rescale a canvas item during the \fBscale\fR widget command. The procedure must match the following prototype: .CS -typedef void Tk_ItemScaleProc( - Tk_Canvas \fIcanvas\fR, - Tk_Item *\fIitemPtr\fR, - double \fIoriginX\fR, - double \fIoriginY\fR, - double \fIscaleX\fR, - double \fIscaleY\fR); +typedef void \fBTk_ItemScaleProc\fR( + Tk_Canvas \fIcanvas\fR, + Tk_Item *\fIitemPtr\fR, + double \fIoriginX\fR, + double \fIoriginY\fR, + double \fIscaleX\fR, + double \fIscaleY\fR); .CE The \fIcanvas\fR and \fIitemPtr\fR arguments have the usual meaning. \fIoriginX\fR and \fIoriginY\fR specify an origin relative to which @@ -463,15 +465,16 @@ y\(fm = originY + scaleY*(y-originY)\fR \fIscaleProc\fR must also update the bounding box in the item's header. .SS TRANSLATEPROC +.PP \fItypePtr->translateProc\fR is invoked by Tk to translate a canvas item during the \fBmove\fR widget command. The procedure must match the following prototype: .CS -typedef void Tk_ItemTranslateProc( - Tk_Canvas \fIcanvas\fR, - Tk_Item *\fIitemPtr\fR, - double \fIdeltaX\fR, - double \fIdeltaY\fR); +typedef void \fBTk_ItemTranslateProc\fR( + Tk_Canvas \fIcanvas\fR, + Tk_Item *\fIitemPtr\fR, + double \fIdeltaX\fR, + double \fIdeltaY\fR); .CE The \fIcanvas\fR and \fIitemPtr\fR arguments have the usual meaning, and \fIdeltaX\fR and \fIdeltaY\fR give the amounts that should be @@ -479,6 +482,7 @@ added to each x and y coordinate within the item. The type manager should adjust the item's coordinates and update the bounding box in the item's header. .SS INDEXPROC +.PP \fItypePtr->indexProc\fR is invoked by Tk to translate a string index specification into a numerical index, for example during the \fBindex\fR widget command. @@ -487,12 +491,12 @@ It is only relevant for item types that support indexable text; item types. The procedure must match the following prototype: .CS -typedef int Tk_ItemIndexProc( - Tcl_Interp *\fIinterp\fR, - Tk_Canvas \fIcanvas\fR, - Tk_Item *\fIitemPtr\fR, - char \fIindexString\fR, - int *\fIindexPtr\fR); +typedef int \fBTk_ItemIndexProc\fR( + Tcl_Interp *\fIinterp\fR, + Tk_Canvas \fIcanvas\fR, + Tk_Item *\fIitemPtr\fR, + char \fIindexString\fR, + int *\fIindexPtr\fR); .CE The \fIinterp\fR, \fIcanvas\fR, and \fIitemPtr\fR arguments all have the usual meaning. @@ -514,10 +518,10 @@ It is only relevant for item types that support an insertion cursor; that do not support an insertion cursor. The procedure must match the following prototype: .CS -typedef void Tk_ItemCursorProc( - Tk_Canvas \fIcanvas\fR, - Tk_Item *\fIitemPtr\fR, - int \fIindex\fR); +typedef void \fBTk_ItemCursorProc\fR( + Tk_Canvas \fIcanvas\fR, + Tk_Item *\fIitemPtr\fR, + int \fIindex\fR); .CE \fIcanvas\fR and \fIitemPtr\fR have the usual meanings, and \fIindex\fR is an index into the item's text, as returned by a @@ -536,12 +540,12 @@ It is only relevant for item types that support text; item types. The procedure must match the following prototype: .CS -typedef int Tk_ItemSelectionProc( - Tk_Canvas \fIcanvas\fR, - Tk_Item *\fIitemPtr\fR, - int \fIoffset\fR, - char *\fIbuffer\fR, - int \fImaxBytes\fR); +typedef int \fBTk_ItemSelectionProc\fR( + Tk_Canvas \fIcanvas\fR, + Tk_Item *\fIitemPtr\fR, + int \fIoffset\fR, + char *\fIbuffer\fR, + int \fImaxBytes\fR); .CE \fIcanvas\fR and \fIitemPtr\fR have the usual meanings. \fIoffset\fR is an offset in bytes into the selection where 0 refers @@ -565,11 +569,11 @@ It is only relevant for item types that support text; item types. The procedure must match the following prototype: .CS -typedef void Tk_ItemInsertProc( - Tk_Canvas \fIcanvas\fR, - Tk_Item *\fIitemPtr\fR, - int \fIindex\fR, - char *\fIstring\fR); +typedef void \fBTk_ItemInsertProc\fR( + Tk_Canvas \fIcanvas\fR, + Tk_Item *\fIitemPtr\fR, + int \fIindex\fR, + char *\fIstring\fR); .CE \fIcanvas\fR and \fIitemPtr\fR have the usual meanings. \fIindex\fR is an index into the item's text, as returned by a @@ -587,11 +591,11 @@ It is only relevant for item types that support text; item types. The procedure must match the following prototype: .CS -typedef void Tk_ItemDCharsProc( - Tk_Canvas \fIcanvas\fR, - Tk_Item *\fIitemPtr\fR, - int \fIfirst\fR, - int \fIlast\fR); +typedef void \fBTk_ItemDCharsProc\fR( + Tk_Canvas \fIcanvas\fR, + Tk_Item *\fIitemPtr\fR, + int \fIfirst\fR, + int \fIlast\fR); .CE \fIcanvas\fR and \fIitemPtr\fR have the usual meanings. \fIfirst\fR and \fIlast\fR give the indices of the first and last bytes diff --git a/doc/CrtPhImgFmt.3 b/doc/CrtPhImgFmt.3 index 04ebf9c..cd2fc85 100644 --- a/doc/CrtPhImgFmt.3 +++ b/doc/CrtPhImgFmt.3 @@ -9,7 +9,7 @@ '\" Department of Computer Science, '\" Australian National University. '\" -'\" RCS: @(#) $Id: CrtPhImgFmt.3,v 1.10 2007/12/13 15:23:42 dgp Exp $ +'\" RCS: @(#) $Id: CrtPhImgFmt.3,v 1.11 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_CreatePhotoImageFormat 3 8.5 Tk "Tk Library Procedures" @@ -26,7 +26,6 @@ Tk_CreatePhotoImageFormat \- define new file format for photo images .AP Tk_PhotoImageFormat *formatPtr in Structure that defines the new file format. .BE - .SH DESCRIPTION .PP \fBTk_CreatePhotoImageFormat\fR is invoked to define a new file format @@ -55,7 +54,7 @@ typedef struct Tk_PhotoImageFormat { Tk_ImageStringReadProc *\fIstringReadProc\fR; Tk_ImageFileWriteProc *\fIfileWriteProc\fR; Tk_ImageStringWriteProc *\fIstringWriteProc\fR; -} Tk_PhotoImageFormat; +} \fBTk_PhotoImageFormat\fR; .CE .PP The handler need not provide implementations of all six procedures. @@ -67,8 +66,7 @@ structure should be set to NULL. The handler must provide the \fIfileMatchProc\fR procedure if it provides the \fIfileReadProc\fR procedure, and the \fIstringMatchProc\fR procedure if it provides the \fIstringReadProc\fR procedure. - -.SH NAME +.SS NAME .PP \fIformatPtr->name\fR provides a name for the image type. Once \fBTk_CreatePhotoImageFormat\fR returns, this name may be used @@ -79,20 +77,20 @@ the \fB\-format\fR option. The first character of \fIformatPtr->name\fR must not be an uppercase character from the ASCII character set (that is, one of the characters \fBA\fR-\fBZ\fR). Such names are used only for legacy interface support (see below). - -.SH FILEMATCHPROC +.SS FILEMATCHPROC +.PP \fIformatPtr->fileMatchProc\fR provides the address of a procedure for Tk to call when it is searching for an image file format handler suitable for reading data in a given file. \fIformatPtr->fileMatchProc\fR must match the following prototype: .CS -typedef int Tk_ImageFileMatchProc( - Tcl_Channel \fIchan\fR, - const char *\fIfileName\fR, - Tcl_Obj *\fIformat\fR, - int *\fIwidthPtr\fR, - int *\fIheightPtr\fR, - Tcl_Interp *\fIinterp\fR); +typedef int \fBTk_ImageFileMatchProc\fR( + Tcl_Channel \fIchan\fR, + const char *\fIfileName\fR, + Tcl_Obj *\fIformat\fR, + int *\fIwidthPtr\fR, + int *\fIheightPtr\fR, + Tcl_Interp *\fIinterp\fR); .CE The \fIfileName\fR argument is the name of the file containing the image data, which is open for reading as \fIchan\fR. The @@ -102,19 +100,19 @@ If the data in the file appears to be in the format supported by this handler, the \fIformatPtr->fileMatchProc\fR procedure should store the width and height of the image in *\fIwidthPtr\fR and *\fIheightPtr\fR respectively, and return 1. Otherwise it should return 0. - -.SH STRINGMATCHPROC +.SS STRINGMATCHPROC +.PP \fIformatPtr->stringMatchProc\fR provides the address of a procedure for Tk to call when it is searching for an image file format handler for suitable for reading data from a given string. \fIformatPtr->stringMatchProc\fR must match the following prototype: .CS -typedef int Tk_ImageStringMatchProc( - Tcl_Obj *\fIdata\fR, - Tcl_Obj *\fIformat\fR, - int *\fIwidthPtr\fR, - int *\fIheightPtr\fR, - Tcl_Interp *\fIinterp\fR); +typedef int \fBTk_ImageStringMatchProc\fR( + Tcl_Obj *\fIdata\fR, + Tcl_Obj *\fIformat\fR, + int *\fIwidthPtr\fR, + int *\fIheightPtr\fR, + Tcl_Interp *\fIinterp\fR); .CE The \fIdata\fR argument points to the object containing the image data. The \fIformat\fR argument contains the value given for @@ -124,21 +122,21 @@ this handler, the \fIformatPtr->stringMatchProc\fR procedure should store the width and height of the image in *\fIwidthPtr\fR and *\fIheightPtr\fR respectively, and return 1. Otherwise it should return 0. - -.SH FILEREADPROC +.SS FILEREADPROC +.PP \fIformatPtr->fileReadProc\fR provides the address of a procedure for Tk to call to read data from an image file into a photo image. \fIformatPtr->fileReadProc\fR must match the following prototype: .CS -typedef int Tk_ImageFileReadProc( - Tcl_Interp *\fIinterp\fR, - Tcl_Channel \fIchan\fR, - const char *\fIfileName\fR, - Tcl_Obj *\fIformat\fR, - PhotoHandle \fIimageHandle\fR, - int \fIdestX\fR, int \fIdestY\fR, - int \fIwidth\fR, int \fIheight\fR, - int \fIsrcX\fR, int \fIsrcY\fR); +typedef int \fBTk_ImageFileReadProc\fR( + Tcl_Interp *\fIinterp\fR, + Tcl_Channel \fIchan\fR, + const char *\fIfileName\fR, + Tcl_Obj *\fIformat\fR, + PhotoHandle \fIimageHandle\fR, + int \fIdestX\fR, int \fIdestY\fR, + int \fIwidth\fR, int \fIheight\fR, + int \fIsrcX\fR, int \fIsrcY\fR); .CE The \fIinterp\fR argument is the interpreter in which the command was invoked to read the image; it should be used for reporting errors. @@ -153,20 +151,20 @@ coordinates (\fIsrcX\fR,\fIsrcY\fR). It is to be stored in the photo image with its top-left corner at coordinates (\fIdestX\fR,\fIdestY\fR) using the \fBTk_PhotoPutBlock\fR procedure. The return value is a standard Tcl return value. - -.SH STRINGREADPROC +.SS STRINGREADPROC +.PP \fIformatPtr->stringReadProc\fR provides the address of a procedure for Tk to call to read data from a string into a photo image. \fIformatPtr->stringReadProc\fR must match the following prototype: .CS -typedef int Tk_ImageStringReadProc( - Tcl_Interp *\fIinterp\fR, - Tcl_Obj *\fIdata\fR, - Tcl_Obj *\fIformat\fR, - PhotoHandle \fIimageHandle\fR, - int \fIdestX\fR, int \fIdestY\fR, - int \fIwidth\fR, int \fIheight\fR, - int \fIsrcX\fR, int \fIsrcY\fR); +typedef int \fBTk_ImageStringReadProc\fR( + Tcl_Interp *\fIinterp\fR, + Tcl_Obj *\fIdata\fR, + Tcl_Obj *\fIformat\fR, + PhotoHandle \fIimageHandle\fR, + int \fIdestX\fR, int \fIdestY\fR, + int \fIwidth\fR, int \fIheight\fR, + int \fIsrcX\fR, int \fIsrcY\fR); .CE The \fIinterp\fR argument is the interpreter in which the command was invoked to read the image; it should be used for reporting errors. @@ -181,17 +179,17 @@ coordinates (\fIsrcX\fR,\fIsrcY\fR). It is to be stored in the photo image with its top-left corner at coordinates (\fIdestX\fR,\fIdestY\fR) using the \fBTk_PhotoPutBlock\fR procedure. The return value is a standard Tcl return value. - -.SH FILEWRITEPROC +.SS FILEWRITEPROC +.PP \fIformatPtr->fileWriteProc\fR provides the address of a procedure for Tk to call to write data from a photo image to a file. \fIformatPtr->fileWriteProc\fR must match the following prototype: .CS -typedef int Tk_ImageFileWriteProc( - Tcl_Interp *\fIinterp\fR, - const char *\fIfileName\fR, - Tcl_Obj *\fIformat\fR, - Tk_PhotoImageBlock *\fIblockPtr\fR); +typedef int \fBTk_ImageFileWriteProc\fR( + Tcl_Interp *\fIinterp\fR, + const char *\fIfileName\fR, + Tcl_Obj *\fIformat\fR, + Tk_PhotoImageBlock *\fIblockPtr\fR); .CE The \fIinterp\fR argument is the interpreter in which the command was invoked to write the image; it should be used for reporting errors. @@ -206,16 +204,16 @@ after the name of the format. If appropriate, the \fIformatPtr->fileWriteProc\fR procedure may interpret these characters to specify further details about the image file. The return value is a standard Tcl return value. - -.SH STRINGWRITEPROC +.SS STRINGWRITEPROC +.PP \fIformatPtr->stringWriteProc\fR provides the address of a procedure for Tk to call to translate image data from a photo image into a string. \fIformatPtr->stringWriteProc\fR must match the following prototype: .CS -typedef int Tk_ImageStringWriteProc( - Tcl_Interp *\fIinterp\fR, - Tcl_Obj *\fIformat\fR, - Tk_PhotoImageBlock *\fIblockPtr\fR); +typedef int \fBTk_ImageStringWriteProc\fR( + Tcl_Interp *\fIinterp\fR, + Tcl_Obj *\fIformat\fR, + Tk_PhotoImageBlock *\fIblockPtr\fR); .CE The \fIinterp\fR argument is the interpreter in which the command was invoked to convert the image; it should be used for reporting errors. @@ -230,8 +228,8 @@ after the name of the format. If appropriate, the \fIformatPtr->stringWriteProc\fR procedure may interpret these characters to specify further details about the image file. The return value is a standard Tcl return value. - .SH "LEGACY INTERFACE SUPPORT" +.PP In Tk 8.2 and earlier, the definition of all the function pointer types stored in fields of a \fBTk_PhotoImageFormat\fR struct were incompatibly different. Legacy programs and libraries dating from @@ -268,9 +266,7 @@ use Tk 8.4 headers and stub libraries to do so. .PP Any new code written today should not make use of the legacy interfaces. Expect their support to go away in Tk 9. - .SH "SEE ALSO" Tk_FindPhoto, Tk_PhotoPutBlock - .SH KEYWORDS photo image, image file diff --git a/doc/CrtSelHdlr.3 b/doc/CrtSelHdlr.3 index 8500bbf..9b0a466 100644 --- a/doc/CrtSelHdlr.3 +++ b/doc/CrtSelHdlr.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: CrtSelHdlr.3,v 1.5 2007/12/13 15:23:42 dgp Exp $ +'\" RCS: @(#) $Id: CrtSelHdlr.3,v 1.6 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_CreateSelHandler 3 4.0 Tk "Tk Library Procedures" @@ -56,11 +56,11 @@ the selection. The most common form is STRING. \fIProc\fR should have arguments and result that match the type \fBTk_SelectionProc\fR: .CS -typedef int Tk_SelectionProc( - ClientData \fIclientData\fR, - int \fIoffset\fR, - char *\fIbuffer\fR, - int \fImaxBytes\fR); +typedef int \fBTk_SelectionProc\fR( + ClientData \fIclientData\fR, + int \fIoffset\fR, + char *\fIbuffer\fR, + int \fImaxBytes\fR); .CE The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR argument given to \fBTk_CreateSelHandler\fR. @@ -114,6 +114,5 @@ existing handler is replaced with a new one. \fBTk_DeleteSelHandler\fR removes the handler given by \fItkwin\fR, \fIselection\fR, and \fItarget\fR, if such a handler exists. If there is no such handler then it has no effect. - .SH KEYWORDS format, handler, selection, target diff --git a/doc/CrtWindow.3 b/doc/CrtWindow.3 index ce5958b..b48696a 100644 --- a/doc/CrtWindow.3 +++ b/doc/CrtWindow.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: CrtWindow.3,v 1.12 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: CrtWindow.3,v 1.13 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_CreateWindow 3 4.2 Tk "Tk Library Procedures" @@ -143,7 +143,6 @@ but has not been mapped, so no X window exists, it is possible to force the creation of the X window by calling \fBTk_MakeWindowExist\fR. This procedure issues the X commands to instantiate the window given by \fItkwin\fR. - .SH KEYWORDS create, deferred creation, destroy, display, internal window, screen, top-level window, window diff --git a/doc/DeleteImg.3 b/doc/DeleteImg.3 index 2dcf2ed..4e40926 100644 --- a/doc/DeleteImg.3 +++ b/doc/DeleteImg.3 @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: DeleteImg.3,v 1.4 2007/01/05 00:00:49 nijtmans Exp $ +'\" RCS: @(#) $Id: DeleteImg.3,v 1.5 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_DeleteImage 3 4.0 Tk "Tk Library Procedures" @@ -23,13 +23,11 @@ Interpreter for which the image was created. .AP "const char" *name in Name of the image. .BE - .SH DESCRIPTION .PP \fBTk_DeleteImage\fR deletes the image given by \fIinterp\fR and \fIname\fR, if there is one. All instances of that image will redisplay as empty regions. If the given image does not exist then the procedure has no effect. - .SH KEYWORDS delete image, image manager diff --git a/doc/DrawFocHlt.3 b/doc/DrawFocHlt.3 index 9b6f6a0..a66d347 100644 --- a/doc/DrawFocHlt.3 +++ b/doc/DrawFocHlt.3 @@ -1,40 +1,38 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: DrawFocHlt.3,v 1.3 2000/03/31 09:23:48 hobbs Exp $ -'\" -.so man.macros -.TH Tk_DrawFocusHighlight 3 4.0 Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_DrawFocusHighlight \- draw the traversal highlight ring for a widget -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTk_DrawFocusHighlight(\fItkwin, gc, width, drawable\fB)\fR -.SH ARGUMENTS -.AS "Tcl_Interp" *joinPtr -.AP Tk_Window tkwin in -Window for which the highlight is being drawn. Used to retrieve -the window's dimensions, among other things. -.AP GC gc in -Graphics context to use for drawing the highlight. -.AP int width in -Width of the highlight ring, in pixels. -.AP Drawable drawable in -Drawable in which to draw the highlight; usually an offscreen -pixmap for double buffering. -.BE - -.SH DESCRIPTION -.PP -\fBTk_DrawFocusHighlight\fR is a utility procedure that draws the -traversal highlight ring for a widget. -It is typically invoked by widgets during redisplay. - -.SH KEYWORDS -focus, traversal highlight +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: DrawFocHlt.3,v 1.4 2008/06/30 22:57:01 dkf Exp $ +'\" +.so man.macros +.TH Tk_DrawFocusHighlight 3 4.0 Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_DrawFocusHighlight \- draw the traversal highlight ring for a widget +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +\fBTk_DrawFocusHighlight(\fItkwin, gc, width, drawable\fB)\fR +.SH ARGUMENTS +.AS "Tcl_Interp" *joinPtr +.AP Tk_Window tkwin in +Window for which the highlight is being drawn. Used to retrieve +the window's dimensions, among other things. +.AP GC gc in +Graphics context to use for drawing the highlight. +.AP int width in +Width of the highlight ring, in pixels. +.AP Drawable drawable in +Drawable in which to draw the highlight; usually an offscreen +pixmap for double buffering. +.BE +.SH DESCRIPTION +.PP +\fBTk_DrawFocusHighlight\fR is a utility procedure that draws the +traversal highlight ring for a widget. +It is typically invoked by widgets during redisplay. +.SH KEYWORDS +focus, traversal highlight diff --git a/doc/EventHndlr.3 b/doc/EventHndlr.3 index a553293..3096c38 100644 --- a/doc/EventHndlr.3 +++ b/doc/EventHndlr.3 @@ -1,79 +1,77 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: EventHndlr.3,v 1.5 2004/09/19 16:05:36 dkf Exp $ -'\" -.so man.macros -.TH Tk_CreateEventHandler 3 "" Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_CreateEventHandler, Tk_DeleteEventHandler \- associate procedure callback with an X event -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTk_CreateEventHandler\fR(\fItkwin, mask, proc, clientData\fR) -.sp -\fBTk_DeleteEventHandler\fR(\fItkwin, mask, proc, clientData\fR) -.SH ARGUMENTS -.AS "unsigned long" clientData -.AP Tk_Window tkwin in -Token for window in which events may occur. -.AP "unsigned long" mask in -Bit-mask of events (such as \fBButtonPressMask\fR) -for which \fIproc\fR should be called. -.AP Tk_EventProc *proc in -Procedure to invoke whenever an event in \fImask\fR occurs -in the window given by \fItkwin\fR. -.AP ClientData clientData in -Arbitrary one-word value to pass to \fIproc\fR. -.BE - -.SH DESCRIPTION -.PP -\fBTk_CreateEventHandler\fR arranges for \fIproc\fR to be -invoked in the future whenever one of the event types specified -by \fImask\fR occurs in the window specified by \fItkwin\fR. -The callback to \fIproc\fR will be made by \fBTk_HandleEvent\fR; -this mechanism only works in programs that dispatch events -through \fBTk_HandleEvent\fR (or through other Tk procedures that -call \fBTk_HandleEvent\fR, such as \fBTk_DoOneEvent\fR or -\fBTk_MainLoop\fR). -.PP -\fIProc\fR should have arguments and result that match the -type \fBTk_EventProc\fR: -.CS -typedef void Tk_EventProc( - ClientData \fIclientData\fR, - XEvent *\fIeventPtr\fR); -.CE -The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR -argument given to \fBTk_CreateEventHandler\fR when the callback -was created. Typically, \fIclientData\fR points to a data -structure containing application-specific information about -the window in which the event occurred. \fIEventPtr\fR is -a pointer to the X event, which will be one of the ones -specified in the \fImask\fR argument to \fBTk_CreateEventHandler\fR. -.PP -\fBTk_DeleteEventHandler\fR may be called to delete a -previously-created event handler: it deletes the first handler -it finds that is associated with \fItkwin\fR and matches the -\fImask\fR, \fIproc\fR, and \fIclientData\fR arguments. If -no such handler exists, then \fBTk_HandleEvent\fR returns -without doing anything. Although Tk supports it, it's probably -a bad idea to have more than one callback with the same \fImask\fR, -\fIproc\fR, and \fIclientData\fR arguments. -When a window is deleted all of its handlers will be deleted -automatically; in this case there is no need to call -\fBTk_DeleteEventHandler\fR. -.PP -If multiple handlers are declared for the same type of X event -on the same window, then the handlers will be invoked in the -order they were created. - -.SH KEYWORDS -bind, callback, event, handler +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: EventHndlr.3,v 1.6 2008/06/30 22:57:01 dkf Exp $ +'\" +.so man.macros +.TH Tk_CreateEventHandler 3 "" Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_CreateEventHandler, Tk_DeleteEventHandler \- associate procedure callback with an X event +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +\fBTk_CreateEventHandler\fR(\fItkwin, mask, proc, clientData\fR) +.sp +\fBTk_DeleteEventHandler\fR(\fItkwin, mask, proc, clientData\fR) +.SH ARGUMENTS +.AS "unsigned long" clientData +.AP Tk_Window tkwin in +Token for window in which events may occur. +.AP "unsigned long" mask in +Bit-mask of events (such as \fBButtonPressMask\fR) +for which \fIproc\fR should be called. +.AP Tk_EventProc *proc in +Procedure to invoke whenever an event in \fImask\fR occurs +in the window given by \fItkwin\fR. +.AP ClientData clientData in +Arbitrary one-word value to pass to \fIproc\fR. +.BE +.SH DESCRIPTION +.PP +\fBTk_CreateEventHandler\fR arranges for \fIproc\fR to be +invoked in the future whenever one of the event types specified +by \fImask\fR occurs in the window specified by \fItkwin\fR. +The callback to \fIproc\fR will be made by \fBTk_HandleEvent\fR; +this mechanism only works in programs that dispatch events +through \fBTk_HandleEvent\fR (or through other Tk procedures that +call \fBTk_HandleEvent\fR, such as \fBTk_DoOneEvent\fR or +\fBTk_MainLoop\fR). +.PP +\fIProc\fR should have arguments and result that match the +type \fBTk_EventProc\fR: +.CS +typedef void \fBTk_EventProc\fR( + ClientData \fIclientData\fR, + XEvent *\fIeventPtr\fR); +.CE +The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR +argument given to \fBTk_CreateEventHandler\fR when the callback +was created. Typically, \fIclientData\fR points to a data +structure containing application-specific information about +the window in which the event occurred. \fIEventPtr\fR is +a pointer to the X event, which will be one of the ones +specified in the \fImask\fR argument to \fBTk_CreateEventHandler\fR. +.PP +\fBTk_DeleteEventHandler\fR may be called to delete a +previously-created event handler: it deletes the first handler +it finds that is associated with \fItkwin\fR and matches the +\fImask\fR, \fIproc\fR, and \fIclientData\fR arguments. If +no such handler exists, then \fBTk_HandleEvent\fR returns +without doing anything. Although Tk supports it, it's probably +a bad idea to have more than one callback with the same \fImask\fR, +\fIproc\fR, and \fIclientData\fR arguments. +When a window is deleted all of its handlers will be deleted +automatically; in this case there is no need to call +\fBTk_DeleteEventHandler\fR. +.PP +If multiple handlers are declared for the same type of X event +on the same window, then the handlers will be invoked in the +order they were created. +.SH KEYWORDS +bind, callback, event, handler diff --git a/doc/FindPhoto.3 b/doc/FindPhoto.3 index 8e1b683..8d5932f 100644 --- a/doc/FindPhoto.3 +++ b/doc/FindPhoto.3 @@ -9,7 +9,7 @@ '\" Department of Computer Science, '\" Australian National University. '\" -'\" RCS: @(#) $Id: FindPhoto.3,v 1.10 2007/01/05 00:00:48 nijtmans Exp $ +'\" RCS: @(#) $Id: FindPhoto.3,v 1.11 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_FindPhoto 3 8.0 Tk "Tk Library Procedures" @@ -23,7 +23,6 @@ Tk_FindPhoto, Tk_PhotoPutBlock, Tk_PhotoPutZoomedBlock, Tk_PhotoGetImage, Tk_Pho Tk_PhotoHandle \fBTk_FindPhoto\fR(\fIinterp, imageName\fR) .sp -.VS 8.5 int \fBTk_PhotoPutBlock\fR(\fIinterp, handle, blockPtr, x, y, width, height,\ compRule\fR) @@ -31,7 +30,6 @@ compRule\fR) int \fBTk_PhotoPutZoomedBlock\fR(\fIinterp, handle, blockPtr, x, y, width, height,\ zoomX, zoomY, subsampleX, subsampleY, compRule\fR) -.VE 8.5 .sp int \fBTk_PhotoGetImage\fR(\fIhandle, blockPtr\fR) @@ -39,18 +37,14 @@ int void \fBTk_PhotoBlank\fR(\fIhandle\fR) .sp -.VS 8.5 int \fBTk_PhotoExpand\fR(\fIinterp, handle, width, height\fR) -.VE 8.5 .sp void \fBTk_PhotoGetSize\fR(\fIhandle, widthPtr, heightPtr\fR) .sp -.VS 8.5 int \fBTk_PhotoSetSize\fR(\fIinterp. handle, width, height\fR) -.VE 8.5 .SH ARGUMENTS .AS Tk_PhotoImageBlock window_path .AP Tcl_Interp *interp in @@ -101,7 +95,6 @@ being written to the photo image. Specifies the zoom factor to be applied in the Y direction to pixels being written to the photo image. .BE - .SH DESCRIPTION .PP \fBTk_FindPhoto\fR returns an opaque handle that is used to identify a @@ -130,8 +123,8 @@ typedef struct { int \fIheight\fR; int \fIpitch\fR; int \fIpixelSize\fR; - int \fIoffset[4]\fR; -} Tk_PhotoImageBlock; + int \fIoffset\fR[4]; +} \fBTk_PhotoImageBlock\fR; .CE The \fIpixelPtr\fR field points to the first pixel, that is, the top-left pixel in the block. @@ -163,12 +156,10 @@ given are replicated (in a tiled fashion) to fill the specified area. These rules operate independently in the horizontal and vertical directions. .PP -.VS 8.5 \fBTk_PhotoPutBlock\fR normally returns \fBTCL_OK\fR, though if it cannot allocate sufficient memory to hold the resulting image, \fBTCL_ERROR\fR is returned instead and, if the \fIinterp\fR argument is non-NULL, an error message is placed in the interpreter's result. -.VE 8.5 .PP \fBTk_PhotoPutZoomedBlock\fR works like \fBTk_PhotoPutBlock\fR except that the image can be reduced or enlarged for display. The @@ -209,12 +200,10 @@ are being supplied in many small blocks, it is more efficient to use allowing the image to expand in many small increments as image blocks are supplied. .PP -.VS 8.5 \fBTk_PhotoExpand\fR normally returns \fBTCL_OK\fR, though if it cannot allocate sufficient memory to hold the resulting image, \fBTCL_ERROR\fR is returned instead and, if the \fIinterp\fR argument is non-NULL, an error message is placed in the interpreter's result. -.VE 8.5 .PP \fBTk_PhotoSetSize\fR specifies the size of the image, as if the user had specified the given \fIwidth\fR and \fIheight\fR values to the @@ -224,16 +213,13 @@ or height, but allows the width or height to be changed by subsequent calls to \fBTk_PhotoPutBlock\fR, \fBTk_PhotoPutZoomedBlock\fR or \fBTk_PhotoExpand\fR. .PP -.VS 8.5 \fBTk_PhotoSetSize\fR normally returns \fBTCL_OK\fR, though if it cannot allocate sufficient memory to hold the resulting image, \fBTCL_ERROR\fR is returned instead and, if the \fIinterp\fR argument is non-NULL, an error message is placed in the interpreter's result. -.VE 8.5 .PP \fBTk_PhotoGetSize\fR returns the dimensions of the image in *\fIwidthPtr\fR and *\fIheightPtr\fR. - .SH PORTABILITY .PP In Tk 8.3 and earlier, \fBTk_PhotoPutBlock\fR and @@ -243,7 +229,6 @@ your code, compile it with the flag -DUSE_COMPOSITELESS_PHOTO_PUT_BLOCK. Code linked using Stubs against older versions of Tk will continue to work. .PP -.VS 8.5 In Tk 8.4, \fBTk_PhotoPutBlock\fR, \fBTk_PhotoPutZoomedBlock\fR, \fBTk_PhotoExpand\fR and \fBTk_PhotoSetSize\fR did not take an \fIinterp\fR argument or return any result code. If insufficient @@ -251,12 +236,9 @@ memory was available for an image, Tk would panic. This behaviour is still supported if you compile your extension with the additional flag -DUSE_PANIC_ON_PHOTO_ALLOC_FAILURE. Code linked using Stubs against older versions of Tk will continue to work. -.VE 8.5 - .SH CREDITS .PP The code for the photo image type was developed by Paul Mackerras, based on his earlier photo widget code. - .SH KEYWORDS photo, image diff --git a/doc/FontId.3 b/doc/FontId.3 index c052a7c..8375cb4 100644 --- a/doc/FontId.3 +++ b/doc/FontId.3 @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: FontId.3,v 1.11 2008/02/04 09:53:23 dkf Exp $ +'\" RCS: @(#) $Id: FontId.3,v 1.12 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_FontId 3 8.0 Tk "Tk Library Procedures" @@ -67,6 +67,7 @@ following screen font families should print correctly: Any other font families may not print correctly because the computed Postscript font name may be incorrect or not exist on the printer. .SH "DATA STRUCTURES" +.PP The \fBTk_FontMetrics\fR data structure is used by \fBTk_GetFontMetrics\fR to return information about a font and is defined as follows: .CS @@ -74,7 +75,7 @@ typedef struct Tk_FontMetrics { int \fIascent\fR; int \fIdescent\fR; int \fIlinespace\fR; -} Tk_FontMetrics; +} \fBTk_FontMetrics\fR; .CE .PP The \fIascent\fR field is the amount in pixels that the tallest diff --git a/doc/GeomReq.3 b/doc/GeomReq.3 index 4390d18..72ccc5a 100644 --- a/doc/GeomReq.3 +++ b/doc/GeomReq.3 @@ -1,97 +1,95 @@ -'\" -'\" 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. -'\" -'\" -'\" RCS: @(#) $Id: GeomReq.3,v 1.3 2001/09/26 20:25:17 pspjuth Exp $ -'\" -.so man.macros -.TH Tk_GeometryRequest 3 "8.4" Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_GeometryRequest, Tk_SetMinimumRequestSize, Tk_SetInternalBorder, Tk_SetInternalBorderEx \- specify desired geometry or internal border for a window -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTk_GeometryRequest\fR(\fItkwin, reqWidth, reqHeight\fR) -.sp -\fBTk_SetMinimumRequestSize\fR(\fItkwin, minWidth, minHeight\fR) -.sp -\fBTk_SetInternalBorder\fR(\fItkwin, width\fR) -.sp -\fBTk_SetInternalBorderEx\fR(\fItkwin, left, right, top, bottom\fR) -.SH ARGUMENTS -.AS baseHeight clientData -.AP Tk_Window tkwin in -Window for which geometry is being requested. -.AP int reqWidth in -Desired width for \fItkwin\fR, in pixel units. -.AP int reqHeight in -Desired height for \fItkwin\fR, in pixel units. -.AP int minWidth in -Desired minimum requested width for \fItkwin\fR, in pixel units. -.AP int minHeight in -Desired minimum requested height for \fItkwin\fR, in pixel units. -.AP int width in -Space to leave for internal border for \fItkwin\fR, in pixel units. -.AP int left in -Space to leave for left side of internal border for \fItkwin\fR, in pixel units. -.AP int right in -Space to leave for right side of internal border for \fItkwin\fR, in pixel units. -.AP int top in -Space to leave for top side of internal border for \fItkwin\fR, in pixel units. -.AP int bottom in -Space to leave for bottom side of internal border for \fItkwin\fR, in pixel units. -.BE - -.SH DESCRIPTION -.PP -\fBTk_GeometryRequest\fR is called by widget code to indicate its -preference for the dimensions of a particular window. The arguments -to \fBTk_GeometryRequest\fR are made available to the geometry -manager for the window, which then decides on the actual geometry -for the window. Although geometry managers generally try to satisfy -requests made to \fBTk_GeometryRequest\fR, there is no guarantee that -this will always be possible. Widget code should not assume that -a geometry request will be satisfied until it receives a -\fBConfigureNotify\fR event indicating that the geometry change has -occurred. Widget code should never call procedures like -\fBTk_ResizeWindow\fR directly. Instead, it should invoke -\fBTk_GeometryRequest\fR and leave the final geometry decisions to -the geometry manager. -.PP -If \fItkwin\fR is a top-level window, then the geometry information -will be passed to the window manager using the standard ICCCM protocol. -.PP -\fBTk_SetInternalBorder\fR is called by widget code to indicate that -the widget has an internal border. This means that the widget draws -a decorative border inside the window instead of using the standard -X borders, which are external to the window's area. For example, -internal borders are used to draw 3-D effects. \fIWidth\fR -specifies the width of the border in pixels. Geometry managers will -use this information to avoid placing any children of \fItkwin\fR -overlapping the outermost \fIwidth\fR pixels of \fItkwin\fR's area. -.PP -\fBTk_SetInternalBorderEx\fR works like \fBTk_SetInternalBorder\fR -but lets you specify different widths for different sides of the window. -.PP -\fBTk_SetMinimumRequestSize\fR is called by widget code to indicate -that a geometry manager should request at least this size for the -widget. This allows a widget to have some control over its size when -a propagating geometry manager is used inside it. -.PP -The information specified in calls to \fBTk_GeometryRequest\fR, -\fBTk_SetMinimumRequestSize\fR, \fBTk_SetInternalBorder\fR and -\fBTk_SetInternalBorderEx\fR can be retrieved using the macros -\fBTk_ReqWidth\fR, \fBTk_ReqHeight\fR, \fBTk_MinReqWidth\fR, -\fBTk_MinReqHeight\fR, \fBTk_MinReqWidth\fR, \fBTk_InternalBorderLeft\fR, -\fBTk_InternalBorderRight\fR, \fBTk_InternalBorderTop\fR and -\fBTk_InternalBorderBottom\fR. -See the \fBTk_WindowId\fR manual entry for details. - -.SH KEYWORDS -geometry, request +'\" +'\" 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. +'\" +'\" +'\" RCS: @(#) $Id: GeomReq.3,v 1.4 2008/06/30 22:57:01 dkf Exp $ +'\" +.so man.macros +.TH Tk_GeometryRequest 3 "8.4" Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_GeometryRequest, Tk_SetMinimumRequestSize, Tk_SetInternalBorder, Tk_SetInternalBorderEx \- specify desired geometry or internal border for a window +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +\fBTk_GeometryRequest\fR(\fItkwin, reqWidth, reqHeight\fR) +.sp +\fBTk_SetMinimumRequestSize\fR(\fItkwin, minWidth, minHeight\fR) +.sp +\fBTk_SetInternalBorder\fR(\fItkwin, width\fR) +.sp +\fBTk_SetInternalBorderEx\fR(\fItkwin, left, right, top, bottom\fR) +.SH ARGUMENTS +.AS baseHeight clientData +.AP Tk_Window tkwin in +Window for which geometry is being requested. +.AP int reqWidth in +Desired width for \fItkwin\fR, in pixel units. +.AP int reqHeight in +Desired height for \fItkwin\fR, in pixel units. +.AP int minWidth in +Desired minimum requested width for \fItkwin\fR, in pixel units. +.AP int minHeight in +Desired minimum requested height for \fItkwin\fR, in pixel units. +.AP int width in +Space to leave for internal border for \fItkwin\fR, in pixel units. +.AP int left in +Space to leave for left side of internal border for \fItkwin\fR, in pixel units. +.AP int right in +Space to leave for right side of internal border for \fItkwin\fR, in pixel units. +.AP int top in +Space to leave for top side of internal border for \fItkwin\fR, in pixel units. +.AP int bottom in +Space to leave for bottom side of internal border for \fItkwin\fR, in pixel units. +.BE +.SH DESCRIPTION +.PP +\fBTk_GeometryRequest\fR is called by widget code to indicate its +preference for the dimensions of a particular window. The arguments +to \fBTk_GeometryRequest\fR are made available to the geometry +manager for the window, which then decides on the actual geometry +for the window. Although geometry managers generally try to satisfy +requests made to \fBTk_GeometryRequest\fR, there is no guarantee that +this will always be possible. Widget code should not assume that +a geometry request will be satisfied until it receives a +\fBConfigureNotify\fR event indicating that the geometry change has +occurred. Widget code should never call procedures like +\fBTk_ResizeWindow\fR directly. Instead, it should invoke +\fBTk_GeometryRequest\fR and leave the final geometry decisions to +the geometry manager. +.PP +If \fItkwin\fR is a top-level window, then the geometry information +will be passed to the window manager using the standard ICCCM protocol. +.PP +\fBTk_SetInternalBorder\fR is called by widget code to indicate that +the widget has an internal border. This means that the widget draws +a decorative border inside the window instead of using the standard +X borders, which are external to the window's area. For example, +internal borders are used to draw 3-D effects. \fIWidth\fR +specifies the width of the border in pixels. Geometry managers will +use this information to avoid placing any children of \fItkwin\fR +overlapping the outermost \fIwidth\fR pixels of \fItkwin\fR's area. +.PP +\fBTk_SetInternalBorderEx\fR works like \fBTk_SetInternalBorder\fR +but lets you specify different widths for different sides of the window. +.PP +\fBTk_SetMinimumRequestSize\fR is called by widget code to indicate +that a geometry manager should request at least this size for the +widget. This allows a widget to have some control over its size when +a propagating geometry manager is used inside it. +.PP +The information specified in calls to \fBTk_GeometryRequest\fR, +\fBTk_SetMinimumRequestSize\fR, \fBTk_SetInternalBorder\fR and +\fBTk_SetInternalBorderEx\fR can be retrieved using the macros +\fBTk_ReqWidth\fR, \fBTk_ReqHeight\fR, \fBTk_MinReqWidth\fR, +\fBTk_MinReqHeight\fR, \fBTk_MinReqWidth\fR, \fBTk_InternalBorderLeft\fR, +\fBTk_InternalBorderRight\fR, \fBTk_InternalBorderTop\fR and +\fBTk_InternalBorderBottom\fR. +See the \fBTk_WindowId\fR manual entry for details. +.SH KEYWORDS +geometry, request diff --git a/doc/GetBitmap.3 b/doc/GetBitmap.3 index 542d5ef..9042313 100644 --- a/doc/GetBitmap.3 +++ b/doc/GetBitmap.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetBitmap.3,v 1.14 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: GetBitmap.3,v 1.15 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_AllocBitmapFromObj 3 8.1 Tk "Tk Library Procedures" @@ -68,7 +68,6 @@ Display for which \fIbitmap\fR was allocated. Identifier for a bitmap allocated by \fBTk_AllocBitmapFromObj\fR or \fBTk_GetBitmap\fR. .BE - .SH DESCRIPTION .PP These procedures manage a collection of bitmaps (one-plane pixmaps) @@ -284,8 +283,8 @@ with its Pixmap token. There should be exactly one call to \fBTk_FreeBitmapFromObj\fR or \fBTk_FreeBitmap\fR for each call to \fBTk_AllocBitmapFromObj\fR or \fBTk_GetBitmap\fR. - .SH BUGS +.PP In determining whether an existing bitmap can be used to satisfy a new request, \fBTk_AllocBitmapFromObj\fR and \fBTk_GetBitmap\fR consider only the immediate value of the string description. For @@ -295,6 +294,5 @@ bitmap created from the same file name: it will not check to see whether the file itself has changed, or whether the current directory has changed, thereby causing the name to refer to a different file. - .SH KEYWORDS bitmap, pixmap diff --git a/doc/GetCapStyl.3 b/doc/GetCapStyl.3 index 2dd426f..38217c3 100644 --- a/doc/GetCapStyl.3 +++ b/doc/GetCapStyl.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetCapStyl.3,v 1.8 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: GetCapStyl.3,v 1.9 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_GetCapStyle 3 "" Tk "Tk Library Procedures" @@ -37,7 +37,6 @@ Pointer to location in which to store X cap style corresponding to .AP int cap in Cap style: one of \fBCapButt\fR, \fBCapProjecting\fR, or \fBCapRound\fR. .BE - .SH DESCRIPTION .PP \fBTk_GetCapStyle\fR places in \fI*capPtr\fR the X cap style @@ -62,6 +61,5 @@ statically-allocated string corresponding to \fIcap\fR. If \fIcap\fR is not a legal cap style, then .QW "unknown cap style" is returned. - .SH KEYWORDS butt, cap style, projecting, round diff --git a/doc/GetColor.3 b/doc/GetColor.3 index ebad886..33c8420 100644 --- a/doc/GetColor.3 +++ b/doc/GetColor.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetColor.3,v 1.8 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: GetColor.3,v 1.9 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_AllocColorFromObj 3 8.1 Tk "Tk Library Procedures" @@ -60,7 +60,6 @@ call to \fBTk_AllocColorFromObj\fR, \fBTk_GetColor\fR or Drawable in which the result graphics context will be used. Must have same screen and depth as the window for which the color was allocated. .BE - .SH DESCRIPTION .PP These procedures manage the colors being used by a Tk application. diff --git a/doc/GetCursor.3 b/doc/GetCursor.3 index 7bf0da7..ae3fb4e 100644 --- a/doc/GetCursor.3 +++ b/doc/GetCursor.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetCursor.3,v 1.13 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: GetCursor.3,v 1.14 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_AllocCursorFromObj 3 8.1 Tk "Tk Library Procedures" @@ -69,7 +69,6 @@ Opaque Tk identifier for cursor. If passed to \fBTk_FreeCursor\fR, must have been returned by some previous call to \fBTk_GetCursor\fR or \fBTk_GetCursorFromData\fR. .BE - .SH DESCRIPTION .PP These procedures manage a collection of cursors @@ -215,8 +214,8 @@ with its Tk_Cursor token. There should be exactly one call to \fBTk_FreeCursor\fR for each call to \fBTk_AllocCursorFromObj\fR, \fBTk_GetCursor\fR, or \fBTk_GetCursorFromData\fR. - .SH BUGS +.PP In determining whether an existing cursor can be used to satisfy a new request, \fBTk_AllocCursorFromObj\fR, \fBTk_GetCursor\fR, and \fBTk_GetCursorFromData\fR @@ -230,6 +229,5 @@ a different file. Similarly, \fBTk_GetCursorFromData\fR assumes that if the same \fIsource\fR pointer is used in two different calls, then the pointers refer to the same data; it does not check to see if the actual data values have changed. - .SH KEYWORDS cursor diff --git a/doc/GetDash.3 b/doc/GetDash.3 index fed5b3f..d93c622 100644 --- a/doc/GetDash.3 +++ b/doc/GetDash.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetDash.3,v 1.7 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: GetDash.3,v 1.8 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_GetDash 3 8.3 Tk "Tk Library Procedures" @@ -28,7 +28,6 @@ Textual value to be converted. Points to place to store the dash pattern value converted from \fIstring\fR. .BE - .SH DESCRIPTION .PP These procedure parses the string and fills in the result in the @@ -75,6 +74,5 @@ pattern will be displayed as the most close dash pattern that is available. For example, on Windows only the first 4 of the above examples are available. The last 2 examples will be displayed identically as the first one. - .SH KEYWORDS dash, conversion diff --git a/doc/GetFont.3 b/doc/GetFont.3 index f404686..741ad93 100644 --- a/doc/GetFont.3 +++ b/doc/GetFont.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetFont.3,v 1.11 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: GetFont.3,v 1.12 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_AllocFontFromObj 3 8.1 Tk "Tk Library Procedures" @@ -33,7 +33,6 @@ Tk_Font .sp void \fBTk_FreeFont(\fItkfont\fB)\fR - .SH ARGUMENTS .AS "const char" *tkfont .AP "Tcl_Interp" *interp in @@ -107,7 +106,6 @@ with the same information used to create it; for with its Tk_Font token. There should be exactly one call to \fBTk_FreeFontFromObj\fR or \fBTk_FreeFont\fR for each call to \fBTk_AllocFontFromObj\fR or \fBTk_GetFont\fR. - .SH "SEE ALSO" Tk_FontId(3) .SH KEYWORDS diff --git a/doc/GetGC.3 b/doc/GetGC.3 index 471bdfc..97ac503 100644 --- a/doc/GetGC.3 +++ b/doc/GetGC.3 @@ -1,74 +1,72 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: GetGC.3,v 1.2 1998/09/14 18:22:49 stanton Exp $ -'\" -.so man.macros -.TH Tk_GetGC 3 "" Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_GetGC, Tk_FreeGC \- maintain database of read-only graphics contexts -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -GC -\fBTk_GetGC\fR(\fItkwin, valueMask, valuePtr\fR) -.sp -\fBTk_FreeGC(\fIdisplay, gc\fR) -.SH ARGUMENTS -.AS "unsigned long" valueMask -.AP Tk_Window tkwin in -Token for window in which the graphics context will be used. -.AP "unsigned long" valueMask in -Mask of bits (such as \fBGCForeground\fR or \fBGCStipple\fR) -indicating which fields of \fI*valuePtr\fR are valid. -.AP XGCValues *valuePtr in -Pointer to structure describing the desired values for the -graphics context. -.AP Display *display in -Display for which \fIgc\fR was allocated. -.AP GC gc in -X identifier for graphics context that is no longer needed. -Must have been allocated by \fBTk_GetGC\fR. -.BE - -.SH DESCRIPTION -.PP -\fBTk_GetGC\fR and \fBTk_FreeGC\fR manage a collection of graphics contexts -being used by an application. The procedures allow graphics contexts to be -shared, thereby avoiding the server overhead that would be incurred -if a separate GC were created for each use. \fBTk_GetGC\fR takes arguments -describing the desired graphics context and returns an X identifier -for a GC that fits the description. The graphics context that is returned -will have default values in all of the fields not specified explicitly -by \fIvalueMask\fR and \fIvaluePtr\fR. -.PP -\fBTk_GetGC\fR maintains a -database of all the graphics contexts it has created. Whenever possible, -a call to \fBTk_GetGC\fR will -return an existing graphics context rather than creating a new one. This -approach can substantially reduce server overhead, so \fBTk_GetGC\fR -should generally be used in preference to the Xlib procedure -\fBXCreateGC\fR, which creates a new graphics context on each call. -.PP -Since the return values of \fBTk_GetGC\fR -are shared, callers should never modify the graphics contexts -returned by \fBTk_GetGC\fR. -If a graphics context must be modified dynamically, then it should be -created by calling \fBXCreateGC\fR instead of \fBTk_GetGC\fR. -.PP -When a graphics context -is no longer needed, \fBTk_FreeGC\fR should be called to release it. -There should be exactly one call to \fBTk_FreeGC\fR for -each call to \fBTk_GetGC\fR. -When a graphics context is no longer in use anywhere (i.e. it has -been freed as many times as it has been gotten) \fBTk_FreeGC\fR -will release it to the X server and delete it from the database. - -.SH KEYWORDS -graphics context +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: GetGC.3,v 1.3 2008/06/30 22:57:01 dkf Exp $ +'\" +.so man.macros +.TH Tk_GetGC 3 "" Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_GetGC, Tk_FreeGC \- maintain database of read-only graphics contexts +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +GC +\fBTk_GetGC\fR(\fItkwin, valueMask, valuePtr\fR) +.sp +\fBTk_FreeGC(\fIdisplay, gc\fR) +.SH ARGUMENTS +.AS "unsigned long" valueMask +.AP Tk_Window tkwin in +Token for window in which the graphics context will be used. +.AP "unsigned long" valueMask in +Mask of bits (such as \fBGCForeground\fR or \fBGCStipple\fR) +indicating which fields of \fI*valuePtr\fR are valid. +.AP XGCValues *valuePtr in +Pointer to structure describing the desired values for the +graphics context. +.AP Display *display in +Display for which \fIgc\fR was allocated. +.AP GC gc in +X identifier for graphics context that is no longer needed. +Must have been allocated by \fBTk_GetGC\fR. +.BE +.SH DESCRIPTION +.PP +\fBTk_GetGC\fR and \fBTk_FreeGC\fR manage a collection of graphics contexts +being used by an application. The procedures allow graphics contexts to be +shared, thereby avoiding the server overhead that would be incurred +if a separate GC were created for each use. \fBTk_GetGC\fR takes arguments +describing the desired graphics context and returns an X identifier +for a GC that fits the description. The graphics context that is returned +will have default values in all of the fields not specified explicitly +by \fIvalueMask\fR and \fIvaluePtr\fR. +.PP +\fBTk_GetGC\fR maintains a +database of all the graphics contexts it has created. Whenever possible, +a call to \fBTk_GetGC\fR will +return an existing graphics context rather than creating a new one. This +approach can substantially reduce server overhead, so \fBTk_GetGC\fR +should generally be used in preference to the Xlib procedure +\fBXCreateGC\fR, which creates a new graphics context on each call. +.PP +Since the return values of \fBTk_GetGC\fR +are shared, callers should never modify the graphics contexts +returned by \fBTk_GetGC\fR. +If a graphics context must be modified dynamically, then it should be +created by calling \fBXCreateGC\fR instead of \fBTk_GetGC\fR. +.PP +When a graphics context +is no longer needed, \fBTk_FreeGC\fR should be called to release it. +There should be exactly one call to \fBTk_FreeGC\fR for +each call to \fBTk_GetGC\fR. +When a graphics context is no longer in use anywhere (i.e. it has +been freed as many times as it has been gotten) \fBTk_FreeGC\fR +will release it to the X server and delete it from the database. +.SH KEYWORDS +graphics context diff --git a/doc/GetHINSTANCE.3 b/doc/GetHINSTANCE.3 index 8942105..2e89475 100644 --- a/doc/GetHINSTANCE.3 +++ b/doc/GetHINSTANCE.3 @@ -2,7 +2,7 @@ '\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" All rights reserved. '\" -'\" RCS: @(#) $Id: GetHINSTANCE.3,v 1.2 2002/11/15 15:35:55 dkf Exp $ +'\" RCS: @(#) $Id: GetHINSTANCE.3,v 1.3 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_GetHISTANCE 3 "" Tk "Tk Library Procedures" @@ -16,11 +16,9 @@ Tk_GetHINSTANCE \- retrieve the global application instance handle HINSTANCE \fBTk_GetHINSTANCE\fR() .BE - .SH DESCRIPTION .PP \fBTk_GetHINSTANCE\fR returns the Windows application instance handle for the Tk application. This function is only available on Windows platforms. - .SH KEYWORDS identifier, instance diff --git a/doc/GetHWND.3 b/doc/GetHWND.3 index 5aa3cab..664277c 100644 --- a/doc/GetHWND.3 +++ b/doc/GetHWND.3 @@ -1,40 +1,39 @@ -'\" -'\" Copyright (c) 1998-2000 by Scriptics Corporation. -'\" All rights reserved. -'\" -'\" RCS: @(#) $Id: GetHWND.3,v 1.4 2004/08/22 15:43:20 dkf Exp $ -'\" -'\" -.so man.macros -.TH HWND 3 8.0 Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_GetHWND, Tk_AttachHWND \- manage interactions between the Windows handle and an X window -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -HWND -\fBTk_GetHWND\fR(\fIwindow\fR) -.sp -Window -\fBTk_AttachHWND\fR(\fItkwin, hwnd\fR) -.SH ARGUMENTS -.AP Window window in -X token for window. -.AP Tk_Window tkwin in -Tk window for window. -.AP HWND hwnd in -Windows HWND for window. -.BE -.SH DESCRIPTION -.PP -\fBTk_GetHWND\fR returns the Windows HWND identifier for X Windows -window given by \fIwindow\fR. -.PP -\fBTk_AttachHWND\fR binds the Windows HWND identifier to the -specified Tk_Window given by \fItkwin\fR. It returns an X Windows -window that encapsulates the HWND. - -.SH KEYWORDS -identifier, window +'\" +'\" Copyright (c) 1998-2000 by Scriptics Corporation. +'\" All rights reserved. +'\" +'\" RCS: @(#) $Id: GetHWND.3,v 1.5 2008/06/30 22:57:01 dkf Exp $ +'\" +'\" +.so man.macros +.TH HWND 3 8.0 Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_GetHWND, Tk_AttachHWND \- manage interactions between the Windows handle and an X window +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +HWND +\fBTk_GetHWND\fR(\fIwindow\fR) +.sp +Window +\fBTk_AttachHWND\fR(\fItkwin, hwnd\fR) +.SH ARGUMENTS +.AP Window window in +X token for window. +.AP Tk_Window tkwin in +Tk window for window. +.AP HWND hwnd in +Windows HWND for window. +.BE +.SH DESCRIPTION +.PP +\fBTk_GetHWND\fR returns the Windows HWND identifier for X Windows +window given by \fIwindow\fR. +.PP +\fBTk_AttachHWND\fR binds the Windows HWND identifier to the +specified Tk_Window given by \fItkwin\fR. It returns an X Windows +window that encapsulates the HWND. +.SH KEYWORDS +identifier, window diff --git a/doc/GetImage.3 b/doc/GetImage.3 index a1f8bb1..6b137f3 100644 --- a/doc/GetImage.3 +++ b/doc/GetImage.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetImage.3,v 1.9 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: GetImage.3,v 1.10 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_GetImage 3 4.0 Tk "Tk Library Procedures" @@ -65,7 +65,6 @@ Store width of \fIimage\fR (in pixels) here. .AP "int" heightPtr out Store height of \fIimage\fR (in pixels) here. .BE - .SH DESCRIPTION .PP These procedures are invoked by widgets that wish to display images. @@ -108,14 +107,14 @@ The \fIchangeProc\fR and \fIclientData\fR arguments to \fIchangeProc\fR will be called by Tk whenever a change occurs in the image; it must match the following prototype: .CS -typedef void Tk_ImageChangedProc( - ClientData \fIclientData\fR, - int \fIx\fR, - int \fIy\fR, - int \fIwidth\fR, - int \fIheight\fR, - int \fIimageWidth\fR, - int \fIimageHeight\fR); +typedef void \fBTk_ImageChangedProc\fR( + ClientData \fIclientData\fR, + int \fIx\fR, + int \fIy\fR, + int \fIwidth\fR, + int \fIheight\fR, + int \fIimageWidth\fR, + int \fIimageHeight\fR); .CE The \fIclientData\fR argument to \fIchangeProc\fR is the same as the \fIclientData\fR argument to \fBTk_GetImage\fR. @@ -127,9 +126,7 @@ they are specified in pixels measured from the upper-left corner of the image. The arguments \fIimageWidth\fR and \fIimageHeight\fR give the image's (new) size. - .SH "SEE ALSO" Tk_CreateImageType - .SH KEYWORDS images, redisplay diff --git a/doc/GetJoinStl.3 b/doc/GetJoinStl.3 index 576e992..980d9e0 100644 --- a/doc/GetJoinStl.3 +++ b/doc/GetJoinStl.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetJoinStl.3,v 1.8 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: GetJoinStl.3,v 1.9 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_GetJoinStyle 3 "" Tk "Tk Library Procedures" @@ -37,7 +37,6 @@ Pointer to location in which to store X join style corresponding to .AP int join in Join style: one of \fBJoinBevel\fR, \fBJoinMiter\fR, \fBJoinRound\fR. .BE - .SH DESCRIPTION .PP \fBTk_GetJoinStyle\fR places in \fI*joinPtr\fR the X join style @@ -61,6 +60,5 @@ statically-allocated string corresponding to \fIjoin\fR. If \fIjoin\fR is not a legal join style, then .QW "unknown join style" is returned. - .SH KEYWORDS bevel, join style, miter, round diff --git a/doc/GetJustify.3 b/doc/GetJustify.3 index 9bbcd42..d5b392b 100644 --- a/doc/GetJustify.3 +++ b/doc/GetJustify.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetJustify.3,v 1.10 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: GetJustify.3,v 1.11 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_GetJustifyFromObj 3 8.1 Tk "Tk Library Procedures" @@ -84,6 +84,5 @@ corresponding to \fIjustify\fR. If \fIjustify\fR is not a legal justify value, then .QW "unknown justification style" is returned. - .SH KEYWORDS center, fill, justification, string diff --git a/doc/GetOption.3 b/doc/GetOption.3 index c321680..3ccd8b3 100644 --- a/doc/GetOption.3 +++ b/doc/GetOption.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetOption.3,v 1.4 2007/01/05 00:00:48 nijtmans Exp $ +'\" RCS: @(#) $Id: GetOption.3,v 1.5 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_GetOption 3 "" Tk "Tk Library Procedures" @@ -28,7 +28,6 @@ Name of desired option. Class of desired option. Null means there is no class for this option; do lookup based on name only. .BE - .SH DESCRIPTION .PP This procedure is invoked to retrieve an option from the database @@ -41,6 +40,5 @@ is returned. If no option matches, then NULL is returned. \fBTk_GetOption\fR caches options related to \fItkwin\fR so that successive calls for the same \fItkwin\fR will execute much more quickly than successive calls for different windows. - .SH KEYWORDS class, name, option, retrieve diff --git a/doc/GetPixels.3 b/doc/GetPixels.3 index bc4774e..a3e7cb0 100644 --- a/doc/GetPixels.3 +++ b/doc/GetPixels.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetPixels.3,v 1.8 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: GetPixels.3,v 1.9 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_GetPixelsFromObj 3 8.1 Tk "Tk Library Procedures" @@ -45,7 +45,6 @@ Pointer to location in which to store converted distance in pixels. .AP double *doublePtr out Pointer to location in which to store converted distance in millimeters. .BE - .SH DESCRIPTION .PP These procedures take as argument a specification of distance on @@ -94,6 +93,5 @@ return value, so \fBTk_GetAnchor\fR is less efficient than \fBTk_GetPixelsFromObj\fR and \fBTk_GetPixels\fR (respectively) except that they convert the screen distance to millimeters and store a double-precision floating-point result at \fI*doublePtr\fR. - .SH KEYWORDS centimeters, convert, inches, millimeters, pixels, points, screen units diff --git a/doc/GetPixmap.3 b/doc/GetPixmap.3 index a8cb5e1..d851387 100644 --- a/doc/GetPixmap.3 +++ b/doc/GetPixmap.3 @@ -1,56 +1,54 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: GetPixmap.3,v 1.2 1998/09/14 18:22:50 stanton Exp $ -'\" -.so man.macros -.TH Tk_GetPixmap 3 4.0 Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_GetPixmap, Tk_FreePixmap \- allocate and free pixmaps -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -Pixmap -\fBTk_GetPixmap(\fIdisplay, d, width, height, depth\fB)\fR -.sp -\fBTk_FreePixmap(\fIdisplay, pixmap\fB)\fR -.SH ARGUMENTS -.AS "Drawable" *pixelPtr -.AP Display *display in -X display for the pixmap. -.AP Drawable d in -Pixmap or window where the new pixmap will be used for drawing. -.AP "int" width in -Width of pixmap. -.AP "int" height in -Height of pixmap. -.AP "int" depth in -Number of bits per pixel in pixmap. -.AP Pixmap pixmap in -Pixmap to destroy. -.BE - -.SH DESCRIPTION -.PP -These procedures are identical to the Xlib procedures \fBXCreatePixmap\fR -and \fBXFreePixmap\fR, except that they have extra code to manage X -resource identifiers so that identifiers for deleted pixmaps can be -reused in the future. -It is important for Tk applications to use these procedures rather -than \fBXCreatePixmap\fR and \fBXFreePixmap\fR; otherwise long-running -applications may run out of resource identifiers. -.PP -\fBTk_GetPixmap\fR creates a pixmap suitable for drawing in \fId\fR, -with dimensions given by \fIwidth\fR, \fIheight\fR, and \fIdepth\fR, -and returns its identifier. -\fBTk_FreePixmap\fR destroys the pixmap given by \fIpixmap\fR and makes -its resource identifier available for reuse. - -.SH KEYWORDS -pixmap, resource identifier +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: GetPixmap.3,v 1.3 2008/06/30 22:57:01 dkf Exp $ +'\" +.so man.macros +.TH Tk_GetPixmap 3 4.0 Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_GetPixmap, Tk_FreePixmap \- allocate and free pixmaps +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +Pixmap +\fBTk_GetPixmap(\fIdisplay, d, width, height, depth\fB)\fR +.sp +\fBTk_FreePixmap(\fIdisplay, pixmap\fB)\fR +.SH ARGUMENTS +.AS "Drawable" *pixelPtr +.AP Display *display in +X display for the pixmap. +.AP Drawable d in +Pixmap or window where the new pixmap will be used for drawing. +.AP "int" width in +Width of pixmap. +.AP "int" height in +Height of pixmap. +.AP "int" depth in +Number of bits per pixel in pixmap. +.AP Pixmap pixmap in +Pixmap to destroy. +.BE +.SH DESCRIPTION +.PP +These procedures are identical to the Xlib procedures \fBXCreatePixmap\fR +and \fBXFreePixmap\fR, except that they have extra code to manage X +resource identifiers so that identifiers for deleted pixmaps can be +reused in the future. +It is important for Tk applications to use these procedures rather +than \fBXCreatePixmap\fR and \fBXFreePixmap\fR; otherwise long-running +applications may run out of resource identifiers. +.PP +\fBTk_GetPixmap\fR creates a pixmap suitable for drawing in \fId\fR, +with dimensions given by \fIwidth\fR, \fIheight\fR, and \fIdepth\fR, +and returns its identifier. +\fBTk_FreePixmap\fR destroys the pixmap given by \fIpixmap\fR and makes +its resource identifier available for reuse. +.SH KEYWORDS +pixmap, resource identifier diff --git a/doc/GetScroll.3 b/doc/GetScroll.3 index f9090ef..dd8b7c6 100644 --- a/doc/GetScroll.3 +++ b/doc/GetScroll.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetScroll.3,v 1.6 2007/01/05 00:00:49 nijtmans Exp $ +'\" RCS: @(#) $Id: GetScroll.3,v 1.7 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_GetScrollInfo 3 8.0 Tk "Tk Library Procedures" @@ -43,7 +43,6 @@ Filled in with fraction from \fBmoveto\fR option, if any. Filled in with line or page count from \fBscroll\fR option, if any. The value may be negative. .BE - .SH DESCRIPTION .PP \fBTk_GetScrollInfo\fR parses the arguments expected by widget @@ -73,6 +72,5 @@ is returned and an error message is left in \fIinterp->result\fR. \fBTk_GetScrollInfo\fR. However, \fBTk_GetScrollInfoObj\fR accepts Tcl_Obj style arguments, making it more appropriate for use with new development. - .SH KEYWORDS parse, scrollbar, scrolling command, xview, yview diff --git a/doc/GetSelect.3 b/doc/GetSelect.3 index a252ec1..7345cf1 100644 --- a/doc/GetSelect.3 +++ b/doc/GetSelect.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetSelect.3,v 1.5 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: GetSelect.3,v 1.6 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_GetSelection 3 4.0 Tk "Tk Library Procedures" @@ -35,7 +35,6 @@ are retrieved. .AP ClientData clientData in Arbitrary one-word value to pass to \fIproc\fR. .BE - .SH DESCRIPTION .PP \fBTk_GetSelection\fR retrieves the selection specified by the atom @@ -45,12 +44,12 @@ is retrieved, \fIproc\fR is called to process the piece. \fIProc\fR should have arguments and result that match the type \fBTk_GetSelProc\fR: .CS -typedef int Tk_GetSelProc( - ClientData \fIclientData\fR, - Tcl_Interp *\fIinterp\fR, - char *\fIportion\fR); +typedef int \fBTk_GetSelProc\fR( + ClientData \fIclientData\fR, + Tcl_Interp *\fIinterp\fR, + char *\fIportion\fR); .CE -The \fIclientData\fR and \fIinterp\fR parameters to \fIproc\fR +The \fIclientData\fR and \fIinterp\fR parameters to \fIproc\fR will be copies of the corresponding arguments to \fBTk_GetSelection\fR. \fIPortion\fR will be a pointer to a string containing part or all of the selection. For large @@ -74,6 +73,5 @@ in \fIinterp->result\fR. \fIProc\fR should also return either \fBTCL_OK\fR or \fBTCL_ERROR\fR. If \fIproc\fR encounters an error in dealing with the selection, it should leave an error message in \fIinterp->result\fR and return \fBTCL_ERROR\fR; this will abort the selection retrieval. - .SH KEYWORDS format, get, selection retrieval diff --git a/doc/GetUid.3 b/doc/GetUid.3 index d3d5eb4..08a6f03 100644 --- a/doc/GetUid.3 +++ b/doc/GetUid.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetUid.3,v 1.8 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: GetUid.3,v 1.9 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_GetUid 3 "" Tk "Tk Library Procedures" @@ -23,7 +23,6 @@ Tk_Uid String for which the corresponding unique identifier is desired. .BE - .SH DESCRIPTION .PP \fBTk_GetUid\fR returns the unique identifier corresponding @@ -44,6 +43,5 @@ Tk_Uid may be compared directly (x == y) without having to call \fBstrcmp\fR. In addition, the return value from \fBTk_GetUid\fR will have the same string value as its argument (strcmp(Tk_GetUid(a), a) == 0). - .SH KEYWORDS atom, unique identifier diff --git a/doc/GetVRoot.3 b/doc/GetVRoot.3 index be55fbb..672d949 100644 --- a/doc/GetVRoot.3 +++ b/doc/GetVRoot.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetVRoot.3,v 1.7 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: GetVRoot.3,v 1.8 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_GetVRootGeometry 3 4.0 Tk "Tk Library Procedures" @@ -30,7 +30,6 @@ Points to word in which to store width of virtual root. .AP "int" heightPtr out Points to word in which to store height of virtual root. .BE - .SH DESCRIPTION .PP \fBTk_GetVRootGeometry\fR returns geometry information about the virtual @@ -45,6 +44,5 @@ If \fItkwin\fR is not associated with a virtual root (e.g. because the window manager does not use virtual roots) then *\fIxPtr\fR and *\fIyPtr\fR will be set to 0 and *\fIwidthPtr\fR and *\fIheightPtr\fR will be set to the dimensions of the screen containing \fItkwin\fR. - .SH KEYWORDS geometry, height, location, virtual root, width, window manager diff --git a/doc/Grab.3 b/doc/Grab.3 index dafb12b..0db62c0 100644 --- a/doc/Grab.3 +++ b/doc/Grab.3 @@ -1,65 +1,60 @@ -'\" -'\" Copyright (c) 1998-2000 by Scriptics Corporation. -'\" All rights reserved. -'\" -'\" RCS: @(#) $Id: Grab.3,v 1.2 2004/09/19 16:05:36 dkf Exp $ -'\" -.so man.macros -.TH Tk_Grab 3 "" Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_Grab, Tk_Ungrab \- manipulate grab state in an application -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -int -\fBTk_Grab\fR(\fIinterp, tkwin, grabGlobal\fR) -.sp -void -\fBTk_Ungrab\fR(\fItkwin\fR) - -.SH ARGUMENTS -.AP Tcl_Interp *interp in -Interpreter to use for error reporting -.AP Tk_Window tkwin in -Window on whose behalf the pointer is to be grabbed or released -.AP int grabGlobal in -Boolean indicating whether the grab is global or application local -.BE - -.SH DESCRIPTION -.PP -These functions are used to set or release a global or -application local grab. When a grab is set on a particular window -in a Tk application, mouse and keyboard events can only be received by -that window and its descendants. Mouse and keyboard events for -windows outside the tree rooted at \fItkwin\fR will be redirected to -\fItkwin\fR. If the grab is global, then all mouse and keyboard -events for windows outside the tree rooted at \fItkwin\fR (even those -intended for windows in other applications) will be redirected to -\fItkwin\fR. If the grab is application local, only mouse and -keyboard events intended for a windows within the same application -(but outside the tree rooted at \fItkwin\fR) will be redirected. - -.PP -\fBTk_Grab\fR sets a grab on a particular window. \fITkwin\fR -specifies the window on whose behalf the pointer is to be grabbed. -\fIGrabGlobal\fR indicates whether the grab should be global or -application local; if it is non-zero, it means the grab should be -global. Normally, \fBTk_Grab\fR returns \fBTCL_OK\fR; if an error occurs -and the grab cannot be set, \fBTCL_ERROR\fR is returned and an error message -is left if \fIinterp\fR's result. Once this call completes -successfully, no window outside the tree rooted at \fItkwin\fR will -receive pointer- or keyboard-related events until the next call to -Tk_Ungrab. If a previous grab was in effect within the application, -then it is replaced with a new one. - -.PP -\fBTcl_Ungrab\fR releases a grab on the mouse pointer and keyboard, if -there is one set on the window given by \fItkwin\fR. Once a grab is -released, pointer and keyboard events will start being delivered to -other windows again. - -.SH KEYWORDS -grab, window +'\" +'\" Copyright (c) 1998-2000 by Scriptics Corporation. +'\" All rights reserved. +'\" +'\" RCS: @(#) $Id: Grab.3,v 1.3 2008/06/30 22:57:01 dkf Exp $ +'\" +.so man.macros +.TH Tk_Grab 3 "" Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_Grab, Tk_Ungrab \- manipulate grab state in an application +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +int +\fBTk_Grab\fR(\fIinterp, tkwin, grabGlobal\fR) +.sp +void +\fBTk_Ungrab\fR(\fItkwin\fR) +.SH ARGUMENTS +.AP Tcl_Interp *interp in +Interpreter to use for error reporting +.AP Tk_Window tkwin in +Window on whose behalf the pointer is to be grabbed or released +.AP int grabGlobal in +Boolean indicating whether the grab is global or application local +.BE +.SH DESCRIPTION +.PP +These functions are used to set or release a global or +application local grab. When a grab is set on a particular window +in a Tk application, mouse and keyboard events can only be received by +that window and its descendants. Mouse and keyboard events for +windows outside the tree rooted at \fItkwin\fR will be redirected to +\fItkwin\fR. If the grab is global, then all mouse and keyboard +events for windows outside the tree rooted at \fItkwin\fR (even those +intended for windows in other applications) will be redirected to +\fItkwin\fR. If the grab is application local, only mouse and +keyboard events intended for a windows within the same application +(but outside the tree rooted at \fItkwin\fR) will be redirected. +.PP +\fBTk_Grab\fR sets a grab on a particular window. \fITkwin\fR +specifies the window on whose behalf the pointer is to be grabbed. +\fIGrabGlobal\fR indicates whether the grab should be global or +application local; if it is non-zero, it means the grab should be +global. Normally, \fBTk_Grab\fR returns \fBTCL_OK\fR; if an error occurs +and the grab cannot be set, \fBTCL_ERROR\fR is returned and an error message +is left if \fIinterp\fR's result. Once this call completes +successfully, no window outside the tree rooted at \fItkwin\fR will +receive pointer- or keyboard-related events until the next call to +Tk_Ungrab. If a previous grab was in effect within the application, +then it is replaced with a new one. +.PP +\fBTcl_Ungrab\fR releases a grab on the mouse pointer and keyboard, if +there is one set on the window given by \fItkwin\fR. Once a grab is +released, pointer and keyboard events will start being delivered to +other windows again. +.SH KEYWORDS +grab, window diff --git a/doc/HWNDToWindow.3 b/doc/HWNDToWindow.3 index 0aab1ed..9e60bab 100644 --- a/doc/HWNDToWindow.3 +++ b/doc/HWNDToWindow.3 @@ -1,30 +1,28 @@ -'\" -'\" Copyright (c) 1998-2000 by Scriptics Corporation. -'\" All rights reserved. -'\" -'\" RCS: @(#) $Id: HWNDToWindow.3,v 1.2 2000/09/07 00:28:38 ericm Exp $ -'\" -.so man.macros -.TH Tk_HWNDToWindow 3 "" Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_HWNDToWindow \- Find Tk's window information for a Windows window -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -Tk_Window -\fBTk_HWNDToWindow\fR(\fIhwnd\fR) -.SH ARGUMENTS -.AP HWND hwnd in -Windows handle for the window. -.BE - -.SH DESCRIPTION -.PP -Given a Windows HWND window identifier, this procedure returns the -corresponding Tk_Window handle. If there is no Tk_Window corresponding -to \fIhwnd\fR then NULL is returned. - -.SH KEYWORDS -Windows window id +'\" +'\" Copyright (c) 1998-2000 by Scriptics Corporation. +'\" All rights reserved. +'\" +'\" RCS: @(#) $Id: HWNDToWindow.3,v 1.3 2008/06/30 22:57:01 dkf Exp $ +'\" +.so man.macros +.TH Tk_HWNDToWindow 3 "" Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_HWNDToWindow \- Find Tk's window information for a Windows window +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +Tk_Window +\fBTk_HWNDToWindow\fR(\fIhwnd\fR) +.SH ARGUMENTS +.AP HWND hwnd in +Windows handle for the window. +.BE +.SH DESCRIPTION +.PP +Given a Windows HWND window identifier, this procedure returns the +corresponding Tk_Window handle. If there is no Tk_Window corresponding +to \fIhwnd\fR then NULL is returned. +.SH KEYWORDS +Windows window id diff --git a/doc/HandleEvent.3 b/doc/HandleEvent.3 index ea461d5..69ed289 100644 --- a/doc/HandleEvent.3 +++ b/doc/HandleEvent.3 @@ -1,49 +1,47 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: HandleEvent.3,v 1.4 1999/04/21 21:53:22 rjohnson Exp $ -'\" -.so man.macros -.TH Tk_HandleEvent 3 "" Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_HandleEvent \- invoke event handlers for window system events -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTk_HandleEvent\fR(\fIeventPtr\fR) -.SH ARGUMENTS -.AS XEvent *eventPtr -.AP XEvent *eventPtr in -Pointer to X event to dispatch to relevant handler(s). -.BE - -.SH DESCRIPTION -.PP -\fBTk_HandleEvent\fR is a lower-level procedure that deals with window -events. It is called by \fBTcl_ServiceEvent\fR (and indirectly by -\fBTk_DoOneEvent\fR), and in a few other cases within Tk. -It makes callbacks to any window event -handlers (created by calls to \fBTk_CreateEventHandler\fR) -that match \fIeventPtr\fR and then returns. In some cases -it may be useful for an application to bypass the Tk event -queue and call \fBTk_HandleEvent\fR directly instead of -calling \fBTcl_QueueEvent\fR followed by -\fBTcl_ServiceEvent\fR. -.PP -This procedure may be invoked recursively. For example, -it is possible to invoke \fBTk_HandleEvent\fR recursively -from a handler called by \fBTk_HandleEvent\fR. This sort -of operation is useful in some modal situations, such -as when a -notifier has been popped up and an application wishes to -wait for the user to click a button in the notifier before -doing anything else. - -.SH KEYWORDS -callback, event, handler, window +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: HandleEvent.3,v 1.5 2008/06/30 22:57:01 dkf Exp $ +'\" +.so man.macros +.TH Tk_HandleEvent 3 "" Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_HandleEvent \- invoke event handlers for window system events +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +\fBTk_HandleEvent\fR(\fIeventPtr\fR) +.SH ARGUMENTS +.AS XEvent *eventPtr +.AP XEvent *eventPtr in +Pointer to X event to dispatch to relevant handler(s). +.BE +.SH DESCRIPTION +.PP +\fBTk_HandleEvent\fR is a lower-level procedure that deals with window +events. It is called by \fBTcl_ServiceEvent\fR (and indirectly by +\fBTk_DoOneEvent\fR), and in a few other cases within Tk. +It makes callbacks to any window event +handlers (created by calls to \fBTk_CreateEventHandler\fR) +that match \fIeventPtr\fR and then returns. In some cases +it may be useful for an application to bypass the Tk event +queue and call \fBTk_HandleEvent\fR directly instead of +calling \fBTcl_QueueEvent\fR followed by +\fBTcl_ServiceEvent\fR. +.PP +This procedure may be invoked recursively. For example, +it is possible to invoke \fBTk_HandleEvent\fR recursively +from a handler called by \fBTk_HandleEvent\fR. This sort +of operation is useful in some modal situations, such +as when a +notifier has been popped up and an application wishes to +wait for the user to click a button in the notifier before +doing anything else. +.SH KEYWORDS +callback, event, handler, window diff --git a/doc/IdToWindow.3 b/doc/IdToWindow.3 index 61146c8..b1cb5c3 100644 --- a/doc/IdToWindow.3 +++ b/doc/IdToWindow.3 @@ -1,36 +1,34 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: IdToWindow.3,v 1.2 1998/09/14 18:22:52 stanton Exp $ -'\" -.so man.macros -.TH Tk_IdToWindow 3 4.0 Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_IdToWindow \- Find Tk's window information for an X window -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -Tk_Window -\fBTk_IdToWindow\fR(\fIdisplay, window\fR) -.SH ARGUMENTS -.AS Tk_Window display -.AP Display *display in -X display containing the window. -.AP Window window in -X id for window. -.BE - -.SH DESCRIPTION -.PP -Given an X window identifier and the X display it corresponds to, -this procedure returns the corresponding Tk_Window handle. -If there is no Tk_Window corresponding to \fIwindow\fR then -NULL is returned. - -.SH KEYWORDS -X window id +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: IdToWindow.3,v 1.3 2008/06/30 22:57:01 dkf Exp $ +'\" +.so man.macros +.TH Tk_IdToWindow 3 4.0 Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_IdToWindow \- Find Tk's window information for an X window +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +Tk_Window +\fBTk_IdToWindow\fR(\fIdisplay, window\fR) +.SH ARGUMENTS +.AS Tk_Window display +.AP Display *display in +X display containing the window. +.AP Window window in +X id for window. +.BE +.SH DESCRIPTION +.PP +Given an X window identifier and the X display it corresponds to, +this procedure returns the corresponding Tk_Window handle. +If there is no Tk_Window corresponding to \fIwindow\fR then +NULL is returned. +.SH KEYWORDS +X window id diff --git a/doc/ImgChanged.3 b/doc/ImgChanged.3 index bc4f9a4..99f24fd 100644 --- a/doc/ImgChanged.3 +++ b/doc/ImgChanged.3 @@ -1,69 +1,66 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: ImgChanged.3,v 1.2 1998/09/14 18:22:52 stanton Exp $ -'\" -.so man.macros -.TH Tk_ImageChanged 3 4.0 Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_ImageChanged \- notify widgets that image needs to be redrawn -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTk_ImageChanged\fR(\fIimageMaster, x, y, width, height, imageWidth, imageHeight\fR) -.SH ARGUMENTS -.AS Tk_ImageMaster imageHeight -.AP Tk_ImageMaster imageMaster in -Token for image, which was passed to image's \fIcreateProc\fR when -the image was created. -.AP int x in -X-coordinate of upper-left corner of region that needs redisplay (measured -from upper-left corner of image). -.AP int y in -Y-coordinate of upper-left corner of region that needs redisplay (measured -from upper-left corner of image). -.AP "int" width in -Width of region that needs to be redrawn, in pixels. -.AP "int" height in -Height of region that needs to be redrawn, in pixels. -.AP "int" imageWidth in -Current width of image, in pixels. -.AP "int" imageHeight in -Current height of image, in pixels. -.BE - -.SH DESCRIPTION -.PP -An image manager calls \fBTk_ImageChanged\fR for an image -whenever anything happens that requires the image to be redrawn. -As a result of calling \fBTk_ImageChanged\fR, any widgets using -the image are notified so that they can redisplay themselves -appropriately. -The \fIimageMaster\fR argument identifies the image, and -\fIx\fR, \fIy\fR, \fIwidth\fR, and \fIheight\fR -specify a rectangular region within the image that needs to -be redrawn. -\fIimageWidth\fR and \fIimageHeight\fR specify the image's (new) size. -.PP -An image manager should call \fBTk_ImageChanged\fR during -its \fIcreateProc\fR to specify the image's initial size and to -force redisplay if there are existing instances for the image. -If any of the pixel values in the image should change later on, -\fBTk_ImageChanged\fR should be called again with \fIx\fR, \fIy\fR, -\fIwidth\fR, and \fIheight\fR values that cover all the pixels -that changed. -If the size of the image should change, then \fBTk_ImageChanged\fR -must be called to indicate the new size, even if no pixels -need to be redisplayed. - -.SH "SEE ALSO" -Tk_CreateImageType - -.SH KEYWORDS -images, redisplay, image size changes +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: ImgChanged.3,v 1.3 2008/06/30 22:57:01 dkf Exp $ +'\" +.so man.macros +.TH Tk_ImageChanged 3 4.0 Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_ImageChanged \- notify widgets that image needs to be redrawn +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +\fBTk_ImageChanged\fR(\fIimageMaster, x, y, width, height, imageWidth, imageHeight\fR) +.SH ARGUMENTS +.AS Tk_ImageMaster imageHeight +.AP Tk_ImageMaster imageMaster in +Token for image, which was passed to image's \fIcreateProc\fR when +the image was created. +.AP int x in +X-coordinate of upper-left corner of region that needs redisplay (measured +from upper-left corner of image). +.AP int y in +Y-coordinate of upper-left corner of region that needs redisplay (measured +from upper-left corner of image). +.AP "int" width in +Width of region that needs to be redrawn, in pixels. +.AP "int" height in +Height of region that needs to be redrawn, in pixels. +.AP "int" imageWidth in +Current width of image, in pixels. +.AP "int" imageHeight in +Current height of image, in pixels. +.BE +.SH DESCRIPTION +.PP +An image manager calls \fBTk_ImageChanged\fR for an image +whenever anything happens that requires the image to be redrawn. +As a result of calling \fBTk_ImageChanged\fR, any widgets using +the image are notified so that they can redisplay themselves +appropriately. +The \fIimageMaster\fR argument identifies the image, and +\fIx\fR, \fIy\fR, \fIwidth\fR, and \fIheight\fR +specify a rectangular region within the image that needs to +be redrawn. +\fIimageWidth\fR and \fIimageHeight\fR specify the image's (new) size. +.PP +An image manager should call \fBTk_ImageChanged\fR during +its \fIcreateProc\fR to specify the image's initial size and to +force redisplay if there are existing instances for the image. +If any of the pixel values in the image should change later on, +\fBTk_ImageChanged\fR should be called again with \fIx\fR, \fIy\fR, +\fIwidth\fR, and \fIheight\fR values that cover all the pixels +that changed. +If the size of the image should change, then \fBTk_ImageChanged\fR +must be called to indicate the new size, even if no pixels +need to be redisplayed. +.SH "SEE ALSO" +Tk_CreateImageType +.SH KEYWORDS +images, redisplay, image size changes diff --git a/doc/Inactive.3 b/doc/Inactive.3 index f20d3f5..ff92175 100644 --- a/doc/Inactive.3 +++ b/doc/Inactive.3 @@ -2,7 +2,7 @@ '\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" All rights reserved. '\" -'\" RCS: @(#) $Id: Inactive.3,v 1.3 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: Inactive.3,v 1.4 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_GetUserInactiveTime 3 8.5 Tk "Tk Library Procedures" @@ -23,7 +23,6 @@ long The display on which the user inactivity timer is to be queried or reset. .BE - .SH DESCRIPTION .PP \fBTk_GetUserInactiveTime\fR returns the number of milliseconds that @@ -33,6 +32,5 @@ support querying the user inactiviy time, \fB\-1\fR is returned. \fBTk_GetUserInactiveTime\fR resets the user inactivity timer of the given display to zero. On windowing systems that do not support multiple displays \fIdisplay\fR can be passed as \fBNULL\fR. - .SH KEYWORDS idle, inactive diff --git a/doc/InternAtom.3 b/doc/InternAtom.3 index 5d2ff0b..5800ff0 100644 --- a/doc/InternAtom.3 +++ b/doc/InternAtom.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: InternAtom.3,v 1.9 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: InternAtom.3,v 1.10 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_InternAtom 3 "" Tk "Tk Library Procedures" @@ -30,7 +30,6 @@ String name for which atom is desired. .AP Atom atom in Atom for which corresponding string name is desired. .BE - .SH DESCRIPTION .PP These procedures are similar to the Xlib procedures @@ -54,6 +53,5 @@ for the same information can be serviced from the cache without contacting the server. Thus \fBTk_InternAtom\fR and \fBTk_GetAtomName\fR are generally much faster than their Xlib counterparts, and they should be used in place of the Xlib procedures. - .SH KEYWORDS atom, cache, display diff --git a/doc/MainLoop.3 b/doc/MainLoop.3 index de6dbe5..0b7f39d 100644 --- a/doc/MainLoop.3 +++ b/doc/MainLoop.3 @@ -1,32 +1,30 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: MainLoop.3,v 1.2 1998/09/14 18:22:52 stanton Exp $ -'\" -.so man.macros -.TH Tk_MainLoop 3 "" Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_MainLoop \- loop for events until all windows are deleted -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTk_MainLoop\fR() -.BE - -.SH DESCRIPTION -.PP -\fBTk_MainLoop\fR is a procedure that loops repeatedly calling -\fBTcl_DoOneEvent\fR. It returns only when there are no applications -left in this process (i.e. no main windows exist anymore). Most -windowing applications will call \fBTk_MainLoop\fR after -initialization; the main execution of the application will consist -entirely of callbacks invoked via \fBTcl_DoOneEvent\fR. - -.SH KEYWORDS -application, event, main loop +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: MainLoop.3,v 1.3 2008/06/30 22:57:01 dkf Exp $ +'\" +.so man.macros +.TH Tk_MainLoop 3 "" Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_MainLoop \- loop for events until all windows are deleted +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +\fBTk_MainLoop\fR() +.BE +.SH DESCRIPTION +.PP +\fBTk_MainLoop\fR is a procedure that loops repeatedly calling +\fBTcl_DoOneEvent\fR. It returns only when there are no applications +left in this process (i.e. no main windows exist anymore). Most +windowing applications will call \fBTk_MainLoop\fR after +initialization; the main execution of the application will consist +entirely of callbacks invoked via \fBTcl_DoOneEvent\fR. +.SH KEYWORDS +application, event, main loop diff --git a/doc/MainWin.3 b/doc/MainWin.3 index b878cb0..93f0190 100644 --- a/doc/MainWin.3 +++ b/doc/MainWin.3 @@ -1,46 +1,43 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: MainWin.3,v 1.3 2000/04/25 01:42:18 ericm Exp $ -'\" -.so man.macros -.TH Tk_MainWindow 3 7.0 Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_MainWindow, Tk_GetNumMainWindows \- functions for querying main -window information -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -Tk_Window -\fBTk_MainWindow\fR(\fIinterp\fR) -.sp -int -\fBTk_GetNumMainWindows\fR() - -.SH ARGUMENTS -.AS Tcl_Interp *pathName -.AP Tcl_Interp *interp in/out -Interpreter associated with the application. -.BE - -.SH DESCRIPTION -.PP -A main window is a special kind of toplevel window used as the -outermost window in an application. -.PP -If \fIinterp\fR is associated with a Tk application then \fBTk_MainWindow\fR -returns the application's main window. If there is no Tk application -associated with \fIinterp\fR then \fBTk_MainWindow\fR returns NULL and -leaves an error message in \fIinterp->result\fR. -.PP -\fBTk_GetNumMainWindows\fR returns a count of the number of main -windows currently open in the process. - -.SH KEYWORDS -application, main window +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: MainWin.3,v 1.4 2008/06/30 22:57:01 dkf Exp $ +'\" +.so man.macros +.TH Tk_MainWindow 3 7.0 Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_MainWindow, Tk_GetNumMainWindows \- functions for querying main +window information +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +Tk_Window +\fBTk_MainWindow\fR(\fIinterp\fR) +.sp +int +\fBTk_GetNumMainWindows\fR() +.SH ARGUMENTS +.AS Tcl_Interp *pathName +.AP Tcl_Interp *interp in/out +Interpreter associated with the application. +.BE +.SH DESCRIPTION +.PP +A main window is a special kind of toplevel window used as the +outermost window in an application. +.PP +If \fIinterp\fR is associated with a Tk application then \fBTk_MainWindow\fR +returns the application's main window. If there is no Tk application +associated with \fIinterp\fR then \fBTk_MainWindow\fR returns NULL and +leaves an error message in \fIinterp->result\fR. +.PP +\fBTk_GetNumMainWindows\fR returns a count of the number of main +windows currently open in the process. +.SH KEYWORDS +application, main window diff --git a/doc/MaintGeom.3 b/doc/MaintGeom.3 index d6c32e9..0027064 100644 --- a/doc/MaintGeom.3 +++ b/doc/MaintGeom.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: MaintGeom.3,v 1.5 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: MaintGeom.3,v 1.6 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_MaintainGeometry 3 4.0 Tk "Tk Library Procedures" @@ -38,7 +38,6 @@ Desired width for \fIslave\fR, in pixels. .AP int height in Desired height for \fIslave\fR, in pixels. .BE - .SH DESCRIPTION .PP \fBTk_MaintainGeometry\fR and \fBTk_UnmaintainGeometry\fR make it diff --git a/doc/ManageGeom.3 b/doc/ManageGeom.3 index 55e2333..272a220 100644 --- a/doc/ManageGeom.3 +++ b/doc/ManageGeom.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ManageGeom.3,v 1.6 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: ManageGeom.3,v 1.7 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_ManageGeometry 3 4.0 Tk "Tk Library Procedures" @@ -47,7 +47,7 @@ typedef struct { const char *\fIname\fR; Tk_GeomRequestProc *\fIrequestProc\fR; Tk_GeomLostSlaveProc *\fIlostSlaveProc\fR; -} Tk_GeomMgr; +} \fBTk_GeomMgr\fR; .CE The \fIname\fR field is the textual name for the geometry manager, such as \fBpack\fR or \fBplace\fR; this value will be returned @@ -59,9 +59,9 @@ slave to change its desired geometry. \fIrequestProc\fR should have arguments and results that match the type \fBTk_GeomRequestProc\fR: .CS -typedef void Tk_GeomRequestProc( - ClientData \fIclientData\fR, - Tk_Window \fItkwin\fR); +typedef void \fBTk_GeomRequestProc\fR( + ClientData \fIclientData\fR, + Tk_Window \fItkwin\fR); .CE The parameters to \fIrequestProc\fR will be identical to the corresponding parameters passed to \fBTk_ManageGeometry\fR. @@ -82,12 +82,11 @@ is the same as the window's current geometry manager. \fIlostSlaveProc\fR should have arguments and results that match the following prototype: .CS -typedef void Tk_GeomLostSlaveProc( - ClientData \fIclientData\fR, - Tk_Window \fItkwin\fR); +typedef void \fBTk_GeomLostSlaveProc\fR( + ClientData \fIclientData\fR, + Tk_Window \fItkwin\fR); .CE The parameters to \fIlostSlaveProc\fR will be identical to the corresponding parameters passed to \fBTk_ManageGeometry\fR. - .SH KEYWORDS callback, geometry, managed, request, unmanaged diff --git a/doc/MapWindow.3 b/doc/MapWindow.3 index dbebe7c..a0094ae 100644 --- a/doc/MapWindow.3 +++ b/doc/MapWindow.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: MapWindow.3,v 1.6 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: MapWindow.3,v 1.7 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_MapWindow 3 "" Tk "Tk Library Procedures" @@ -25,7 +25,6 @@ Tk_Window .AP Tk_Window tkwin in Token for window. .BE - .SH DESCRIPTION .PP These procedures may be used to map and unmap windows @@ -48,6 +47,5 @@ These procedures should be used in place of the X procedures Tk's local data structure for \fItkwin\fR. Applications using Tk should not invoke \fBXMapWindow\fR and \fBXUnmapWindow\fR directly. - .SH KEYWORDS map, unmap, window diff --git a/doc/MoveToplev.3 b/doc/MoveToplev.3 index a7ae554..50d5aa7 100644 --- a/doc/MoveToplev.3 +++ b/doc/MoveToplev.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: MoveToplev.3,v 1.4 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: MoveToplev.3,v 1.5 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_MoveToplevelWindow 3 "" Tk "Tk Library Procedures" @@ -30,7 +30,6 @@ New y-coordinate for the top-left pixel of \fItkwin\fR's border, or the top-left pixel of the decorative border supplied for \fItkwin\fR by the window manager, if there is one. .BE - .SH DESCRIPTION .PP In general, a window should never set its own position; this should be @@ -50,6 +49,5 @@ When \fBTk_MoveToplevelWindow\fR is called it does not immediately pass on the new desired location to the window manager; it defers this action until all other outstanding work has been completed, using the \fBTk_DoWhenIdle\fR mechanism. - .SH KEYWORDS position, top-level window, window manager diff --git a/doc/Name.3 b/doc/Name.3 index f642b17..16f03a8 100644 --- a/doc/Name.3 +++ b/doc/Name.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: Name.3,v 1.9 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: Name.3,v 1.10 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_Name 3 "" Tk "Tk Library Procedures" @@ -33,7 +33,6 @@ Interpreter to use for error reporting. .AP "const char" *pathName in Character string containing path name of window. .BE - .SH DESCRIPTION .PP Each window managed by Tk has two names, a short name that identifies @@ -85,6 +84,5 @@ two main windows, each will have a separate naming hierarchy and the same path name might appear in each of the hierarchies. Normally \fItkwin\fR is the main window of the desired hierarchy, but this need not be the case: any window in the desired hierarchy may be used. - .SH KEYWORDS name, path name, token, window diff --git a/doc/NameOfImg.3 b/doc/NameOfImg.3 index 9553318..cc35f68 100644 --- a/doc/NameOfImg.3 +++ b/doc/NameOfImg.3 @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: NameOfImg.3,v 1.4 2007/01/05 00:00:49 nijtmans Exp $ +'\" RCS: @(#) $Id: NameOfImg.3,v 1.5 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_NameOfImage 3 4.0 Tk "Tk Library Procedures" @@ -23,12 +23,10 @@ const char * Token for image, which was passed to image manager's \fIcreateProc\fR when the image was created. .BE - .SH DESCRIPTION .PP This procedure is invoked by image managers to find out the name of an image. Given the token for the image, it returns the string name for the image. - .SH KEYWORDS image manager, image name diff --git a/doc/OwnSelect.3 b/doc/OwnSelect.3 index 0cd541c..98d9fb5 100644 --- a/doc/OwnSelect.3 +++ b/doc/OwnSelect.3 @@ -1,52 +1,51 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: OwnSelect.3,v 1.2 1998/09/14 18:22:53 stanton Exp $ -'\" -.so man.macros -.TH Tk_OwnSelection 3 4.0 Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_OwnSelection \- make a window the owner of the primary selection -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTk_OwnSelection\fR(\fItkwin, selection, proc, clientData\fR) -.SH ARGUMENTS -.AS Tk_LostSelProc clientData -.AP Tk_Window tkwin in -Window that is to become new selection owner. -.AP Atom selection in -The name of the selection to be owned, such as XA_PRIMARY. -.AP Tk_LostSelProc *proc in -Procedure to invoke when \fItkwin\fR loses selection ownership later. -.AP ClientData clientData in -Arbitrary one-word value to pass to \fIproc\fR. -.BE - -.SH DESCRIPTION -.PP -\fBTk_OwnSelection\fR arranges for \fItkwin\fR to become the -new owner of the selection specified by the atom -\fIselection\fR. After this call completes, future requests -for the selection will be directed to handlers created for -\fItkwin\fR using \fBTk_CreateSelHandler\fR. When \fItkwin\fR -eventually loses the selection ownership, \fIproc\fR will be -invoked so that the window can clean itself up (e.g. by -unhighlighting the selection). \fIProc\fR should have arguments and -result that match the type \fBTk_LostSelProc\fR: -.CS -typedef void Tk_LostSelProc(ClientData \fIclientData\fR); -.CE -The \fIclientData\fR parameter to \fIproc\fR is a copy of the -\fIclientData\fR argument given to \fBTk_OwnSelection\fR, and is -usually a pointer to a data structure containing application-specific -information about \fItkwin\fR. - -.SH KEYWORDS -own, selection owner +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: OwnSelect.3,v 1.3 2008/06/30 22:57:01 dkf Exp $ +'\" +.so man.macros +.TH Tk_OwnSelection 3 4.0 Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_OwnSelection \- make a window the owner of the primary selection +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +\fBTk_OwnSelection\fR(\fItkwin, selection, proc, clientData\fR) +.SH ARGUMENTS +.AS Tk_LostSelProc clientData +.AP Tk_Window tkwin in +Window that is to become new selection owner. +.AP Atom selection in +The name of the selection to be owned, such as XA_PRIMARY. +.AP Tk_LostSelProc *proc in +Procedure to invoke when \fItkwin\fR loses selection ownership later. +.AP ClientData clientData in +Arbitrary one-word value to pass to \fIproc\fR. +.BE +.SH DESCRIPTION +.PP +\fBTk_OwnSelection\fR arranges for \fItkwin\fR to become the +new owner of the selection specified by the atom +\fIselection\fR. After this call completes, future requests +for the selection will be directed to handlers created for +\fItkwin\fR using \fBTk_CreateSelHandler\fR. When \fItkwin\fR +eventually loses the selection ownership, \fIproc\fR will be +invoked so that the window can clean itself up (e.g. by +unhighlighting the selection). \fIProc\fR should have arguments and +result that match the type \fBTk_LostSelProc\fR: +.CS +typedef void \fBTk_LostSelProc\fR( + ClientData \fIclientData\fR); +.CE +The \fIclientData\fR parameter to \fIproc\fR is a copy of the +\fIclientData\fR argument given to \fBTk_OwnSelection\fR, and is +usually a pointer to a data structure containing application-specific +information about \fItkwin\fR. +.SH KEYWORDS +own, selection owner diff --git a/doc/ParseArgv.3 b/doc/ParseArgv.3 index 7b81477..b5db646 100644 --- a/doc/ParseArgv.3 +++ b/doc/ParseArgv.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ParseArgv.3,v 1.10 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: ParseArgv.3,v 1.11 2008/06/30 22:57:01 dkf Exp $ '\" .so man.macros .TH Tk_ParseArgv 3 "" Tk "Tk Library Procedures" @@ -77,7 +77,7 @@ typedef struct { char *\fIsrc\fR; char *\fIdst\fR; char *\fIhelp\fR; -} Tk_ArgvInfo; +} \fBTk_ArgvInfo\fR; .CE The \fIkey\fR field is a string such as .QW \-display @@ -265,7 +265,7 @@ an error then it should leave an error message in \fIinterp->result\fR, in the usual Tcl fashion, and return \-1; when this happens \fBTk_ParseArgv\fR will abort its processing and return \fBTCL_ERROR\fR. .RE -.SH "FLAGS" +.SS "FLAGS" .TP \fBTK_ARGV_DONT_SKIP_FIRST_ARG\fR \fBTk_ParseArgv\fR normally treats \fIargv[0]\fR as a program diff --git a/doc/QWinEvent.3 b/doc/QWinEvent.3 index 15492dc..1117b86 100644 --- a/doc/QWinEvent.3 +++ b/doc/QWinEvent.3 @@ -1,53 +1,51 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: QWinEvent.3,v 1.3 2002/06/15 00:21:42 hobbs Exp $ -'\" -.so man.macros -.TH Tk_QueueWindowEvent 3 7.5 Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_CollapseMotionEvents, Tk_QueueWindowEvent \- Add a window event to the Tcl event queue -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -int -\fBTk_CollapseMotionEvents\fR(\fIdisplay, collapse\fR) -.sp -\fBTk_QueueWindowEvent\fR(\fIeventPtr, position\fR) -.SH ARGUMENTS -.AS Tcl_QueuePosition position -.AP Display *display in -Display for which to control motion event collapsing. -.AP int collapse in -Indicates whether motion events should be collapsed or not. -.AP XEvent *eventPtr in -An event to add to the event queue. -.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. -.BE - -.SH DESCRIPTION -.PP -\fBTk_QueueWindowEvent\fR places a window event on Tcl's internal event -queue for eventual servicing. It creates a Tcl_Event structure, copies the -event into that structure, and calls \fBTcl_QueueEvent\fR to add the event -to the queue. When the event is eventually removed from the queue it is -processed just like all window events. -.PP -When multiple motion events are received for the same window in rapid -succession, they are collapsed by default. This behavior can be controlled -with \fBTk_CollapseMotionEvents\fR. \fBTk_CollapseMotionEvents\fR always -returns the previous value for collapse behavior on the \fIdisplay\fR. -.PP -The \fIposition\fR argument to \fBTk_QueueWindowEvent\fR has -the same significance as for \fBTcl_QueueEvent\fR; see the -documentation for \fBTcl_QueueEvent\fR for details. - -.SH KEYWORDS -callback, clock, handler, modal timeout, events +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: QWinEvent.3,v 1.4 2008/06/30 22:57:01 dkf Exp $ +'\" +.so man.macros +.TH Tk_QueueWindowEvent 3 7.5 Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_CollapseMotionEvents, Tk_QueueWindowEvent \- Add a window event to the Tcl event queue +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +int +\fBTk_CollapseMotionEvents\fR(\fIdisplay, collapse\fR) +.sp +\fBTk_QueueWindowEvent\fR(\fIeventPtr, position\fR) +.SH ARGUMENTS +.AS Tcl_QueuePosition position +.AP Display *display in +Display for which to control motion event collapsing. +.AP int collapse in +Indicates whether motion events should be collapsed or not. +.AP XEvent *eventPtr in +An event to add to the event queue. +.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. +.BE +.SH DESCRIPTION +.PP +\fBTk_QueueWindowEvent\fR places a window event on Tcl's internal event +queue for eventual servicing. It creates a Tcl_Event structure, copies the +event into that structure, and calls \fBTcl_QueueEvent\fR to add the event +to the queue. When the event is eventually removed from the queue it is +processed just like all window events. +.PP +When multiple motion events are received for the same window in rapid +succession, they are collapsed by default. This behavior can be controlled +with \fBTk_CollapseMotionEvents\fR. \fBTk_CollapseMotionEvents\fR always +returns the previous value for collapse behavior on the \fIdisplay\fR. +.PP +The \fIposition\fR argument to \fBTk_QueueWindowEvent\fR has +the same significance as for \fBTcl_QueueEvent\fR; see the +documentation for \fBTcl_QueueEvent\fR for details. +.SH KEYWORDS +callback, clock, handler, modal timeout, events diff --git a/doc/Restack.3 b/doc/Restack.3 index 6f8024e..a0a6350 100644 --- a/doc/Restack.3 +++ b/doc/Restack.3 @@ -1,49 +1,47 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: Restack.3,v 1.2 1998/09/14 18:22:53 stanton Exp $ -'\" -.so man.macros -.TH Tk_RestackWindow 3 "" Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_RestackWindow \- Change a window's position in the stacking order -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -int -\fBTk_RestackWindow\fR(\fItkwin, aboveBelow, other\fR) -.SH ARGUMENTS -.AS Tk_Window aboveBelow -.AP Tk_Window tkwin in -Token for window to restack. -.AP int aboveBelow in -Indicates new position of \fItkwin\fR relative to \fIother\fR; -must be \fBAbove\fR or \fBBelow\fR. -.AP Tk_Window other in -\fITkwin\fR will be repositioned just above or below this window. -Must be a sibling of \fItkwin\fR or a descendant of a sibling. -If NULL then \fItkwin\fR is restacked above or below all siblings. -.BE - -.SH DESCRIPTION -.PP -\fBTk_RestackWindow\fR changes the stacking order of \fIwindow\fR relative -to its siblings. -If \fIother\fR is specified as NULL then \fIwindow\fR is repositioned -at the top or bottom of its stacking order, depending on whether -\fIaboveBelow\fR is \fBAbove\fR or \fBBelow\fR. -If \fIother\fR has a non-NULL value then \fIwindow\fR is repositioned -just above or below \fIother\fR. -.PP -The \fIaboveBelow\fR argument must have one of the symbolic values -\fBAbove\fR or \fBBelow\fR. -Both of these values are defined by the include file . - -.SH KEYWORDS -above, below, obscure, stacking order +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: Restack.3,v 1.3 2008/06/30 22:57:02 dkf Exp $ +'\" +.so man.macros +.TH Tk_RestackWindow 3 "" Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_RestackWindow \- Change a window's position in the stacking order +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +int +\fBTk_RestackWindow\fR(\fItkwin, aboveBelow, other\fR) +.SH ARGUMENTS +.AS Tk_Window aboveBelow +.AP Tk_Window tkwin in +Token for window to restack. +.AP int aboveBelow in +Indicates new position of \fItkwin\fR relative to \fIother\fR; +must be \fBAbove\fR or \fBBelow\fR. +.AP Tk_Window other in +\fITkwin\fR will be repositioned just above or below this window. +Must be a sibling of \fItkwin\fR or a descendant of a sibling. +If NULL then \fItkwin\fR is restacked above or below all siblings. +.BE +.SH DESCRIPTION +.PP +\fBTk_RestackWindow\fR changes the stacking order of \fIwindow\fR relative +to its siblings. +If \fIother\fR is specified as NULL then \fIwindow\fR is repositioned +at the top or bottom of its stacking order, depending on whether +\fIaboveBelow\fR is \fBAbove\fR or \fBBelow\fR. +If \fIother\fR has a non-NULL value then \fIwindow\fR is repositioned +just above or below \fIother\fR. +.PP +The \fIaboveBelow\fR argument must have one of the symbolic values +\fBAbove\fR or \fBBelow\fR. +Both of these values are defined by the include file . +.SH KEYWORDS +above, below, obscure, stacking order diff --git a/doc/RestrictEv.3 b/doc/RestrictEv.3 index 6d2abbb..03907a6 100644 --- a/doc/RestrictEv.3 +++ b/doc/RestrictEv.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: RestrictEv.3,v 1.7 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: RestrictEv.3,v 1.8 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH Tk_RestrictEvents 3 "" Tk "Tk Library Procedures" @@ -28,7 +28,6 @@ Arbitrary argument to pass to \fIproc\fR. .AP ClientData *prevClientDataPtr out Pointer to place to save argument to previous restrict procedure. .BE - .SH DESCRIPTION .PP This procedure is useful in certain situations where applications @@ -42,9 +41,9 @@ later time (e.g. when the event restriction is lifted), or discarded. is a procedure with arguments and result that match the type \fBTk_RestrictProc\fR: .CS -typedef Tk_RestrictAction Tk_RestrictProc( - ClientData \fIclientData\fR, - XEvent *\fIeventPtr\fR); +typedef Tk_RestrictAction \fBTk_RestrictProc\fR( + ClientData \fIclientData\fR, + XEvent *\fIeventPtr\fR); .CE The \fIclientData\fR argument is a copy of the \fIclientData\fR passed to \fBTk_RestrictEvents\fR; it may be used to provide \fIproc\fR with diff --git a/doc/SetAppName.3 b/doc/SetAppName.3 index 441a391..4182ed0 100644 --- a/doc/SetAppName.3 +++ b/doc/SetAppName.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: SetAppName.3,v 1.8 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: SetAppName.3,v 1.9 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH Tk_SetAppName 3 4.0 Tk "Tk Library Procedures" @@ -26,7 +26,6 @@ application. .AP "const char" *name in Name under which to register the application. .BE - .SH DESCRIPTION .PP \fBTk_SetAppName\fR associates a name with a given application and @@ -61,6 +60,5 @@ so applications do not normally need to call it explicitly. .PP The command \fBtk appname\fR provides Tcl-level access to the functionality of \fBTk_SetAppName\fR. - .SH KEYWORDS application, name, register, send command diff --git a/doc/SetCaret.3 b/doc/SetCaret.3 index b5bd901..298387b 100644 --- a/doc/SetCaret.3 +++ b/doc/SetCaret.3 @@ -1,40 +1,38 @@ -'\" -'\" Copyright (c) 2002 ActiveState Corporation. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: SetCaret.3,v 1.1 2002/06/17 20:09:01 hobbs Exp $ -'\" -.so man.macros -.TH Tk_SetCaretPos 3 8.4 Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_SetCaretPos \- set the display caret location -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -int -\fBTk_SetCaretPos\fR(\fItkwin, x, y, height\fR) -.SH ARGUMENTS -.AP Tk_Window tkwin in -Token for window. -.AP int x in -Window-relative x coordinate. -.AP int y in -Window-relative y coordinate. -.AP int h in -Height of the caret in the window. -.BE - -.SH DESCRIPTION -.PP -\fBTk_SetCaretPos\fR sets the caret location for the display of the -specified Tk_Window \fItkwin\fR. The caret is the per-display cursor -location used for indicating global focus (e.g. to comply with Microsoft -Accessibility guidelines), as well as for location of the over-the-spot XIM -(X Input Methods) or Windows IME windows. - -.SH KEYWORDS -caret, cursor +'\" +'\" Copyright (c) 2002 ActiveState Corporation. +'\" +'\" See the file "license.terms" for information on usage and redistribution +'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. +'\" +'\" RCS: @(#) $Id: SetCaret.3,v 1.2 2008/06/30 22:57:02 dkf Exp $ +'\" +.so man.macros +.TH Tk_SetCaretPos 3 8.4 Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_SetCaretPos \- set the display caret location +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +int +\fBTk_SetCaretPos\fR(\fItkwin, x, y, height\fR) +.SH ARGUMENTS +.AP Tk_Window tkwin in +Token for window. +.AP int x in +Window-relative x coordinate. +.AP int y in +Window-relative y coordinate. +.AP int h in +Height of the caret in the window. +.BE +.SH DESCRIPTION +.PP +\fBTk_SetCaretPos\fR sets the caret location for the display of the +specified Tk_Window \fItkwin\fR. The caret is the per-display cursor +location used for indicating global focus (e.g. to comply with Microsoft +Accessibility guidelines), as well as for location of the over-the-spot XIM +(X Input Methods) or Windows IME windows. +.SH KEYWORDS +caret, cursor diff --git a/doc/SetClass.3 b/doc/SetClass.3 index 68a21a1..ad3d4ce 100644 --- a/doc/SetClass.3 +++ b/doc/SetClass.3 @@ -1,61 +1,59 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: SetClass.3,v 1.2 1998/09/14 18:22:53 stanton Exp $ -'\" -.so man.macros -.TH Tk_SetClass 3 "" Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_SetClass, Tk_Class \- set or retrieve a window's class -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTk_SetClass\fR(\fItkwin, class\fR) -.sp -Tk_Uid -\fBTk_Class\fR(\fItkwin\fR) -.SH ARGUMENTS -.AS Tk_Window parent -.AP Tk_Window tkwin in -Token for window. -.AP char *class in -New class name for window. -.BE - -.SH DESCRIPTION -.PP -\fBTk_SetClass\fR is called to associate a class with a particular -window. The \fIclass\fR string identifies the type of the -window; all windows with the same general class of behavior -(button, menu, etc.) should have the same class. By -convention all class names start with a capital letter, and -there exists a Tcl command with the same name as -each class (except all in lower-case) which can be used to -create and manipulate windows of that class. -A window's class string is initialized to NULL -when the window is created. -.PP -For main windows, Tk automatically propagates the name and class -to the WM_CLASS property used by window managers. This happens -either when a main window is actually created (e.g. in -\fBTk_MakeWindowExist\fR), or when \fBTk_SetClass\fR -is called, whichever occurs later. If a main window has not been -assigned a class then Tk will not set the WM_CLASS property for -the window. -.PP -\fBTk_Class\fR is a macro that returns the -current value of \fItkwin\fR's class. The value is returned -as a Tk_Uid, which may be used just like a string pointer but also has -the properties of a unique identifier (see the manual entry for -\fBTk_GetUid\fR for details). -If \fItkwin\fR has not yet been given a class, then -\fBTk_Class\fR will return NULL. - -.SH KEYWORDS -class, unique identifier, window, window manager +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: SetClass.3,v 1.3 2008/06/30 22:57:02 dkf Exp $ +'\" +.so man.macros +.TH Tk_SetClass 3 "" Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_SetClass, Tk_Class \- set or retrieve a window's class +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +\fBTk_SetClass\fR(\fItkwin, class\fR) +.sp +Tk_Uid +\fBTk_Class\fR(\fItkwin\fR) +.SH ARGUMENTS +.AS Tk_Window parent +.AP Tk_Window tkwin in +Token for window. +.AP char *class in +New class name for window. +.BE +.SH DESCRIPTION +.PP +\fBTk_SetClass\fR is called to associate a class with a particular +window. The \fIclass\fR string identifies the type of the +window; all windows with the same general class of behavior +(button, menu, etc.) should have the same class. By +convention all class names start with a capital letter, and +there exists a Tcl command with the same name as +each class (except all in lower-case) which can be used to +create and manipulate windows of that class. +A window's class string is initialized to NULL +when the window is created. +.PP +For main windows, Tk automatically propagates the name and class +to the WM_CLASS property used by window managers. This happens +either when a main window is actually created (e.g. in +\fBTk_MakeWindowExist\fR), or when \fBTk_SetClass\fR +is called, whichever occurs later. If a main window has not been +assigned a class then Tk will not set the WM_CLASS property for +the window. +.PP +\fBTk_Class\fR is a macro that returns the +current value of \fItkwin\fR's class. The value is returned +as a Tk_Uid, which may be used just like a string pointer but also has +the properties of a unique identifier (see the manual entry for +\fBTk_GetUid\fR for details). +If \fItkwin\fR has not yet been given a class, then +\fBTk_Class\fR will return NULL. +.SH KEYWORDS +class, unique identifier, window, window manager diff --git a/doc/SetClassProcs.3 b/doc/SetClassProcs.3 index a9edef3..85a98d8 100644 --- a/doc/SetClassProcs.3 +++ b/doc/SetClassProcs.3 @@ -1,91 +1,89 @@ -'\" -'\" Copyright (c) 2000 Ajuba Solutions. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: SetClassProcs.3,v 1.3 2004/09/19 16:05:36 dkf Exp $ -'\" -.so man.macros -.TH Tk_SetClassProcs 3 8.4 Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_SetClassProcs \- register widget specific procedures -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTk_SetClassProcs\fR(\fItkwin, procs, instanceData\fR) -.SH ARGUMENTS -.AS Tk_ClassProc instanceData -.AP Tk_Window tkwin in -Token for window to modify. -.AP Tk_ClassProcs *procs in -Pointer to data structure containing widget specific procedures. -The data structure pointed to by \fIprocs\fR must be static: -Tk keeps a reference to it as long as the window exists. -.AP ClientData instanceData in -Arbitrary one-word value to pass to widget callbacks. -.BE - -.SH DESCRIPTION -.PP -\fBTk_SetClassProcs\fR is called to register a set of procedures that -are used as callbacks in different places. -.PP -The structure pointed to by \fIprocs\fR contains the following: -.CS -typedef struct Tk_ClassProcs { - unsigned int \fIsize\fR; - Tk_ClassWorldChangedProc *\fIworldChangedProc\fR; - Tk_ClassCreateProc *\fIcreateProc\fR; - Tk_ClassModalProc *\fImodalProc\fR; -} Tk_ClassProcs; -.CE -The \fIsize\fR field is used to simplify future expansion of the -structure. It should always be set to (literally) \fBsizeof(Tk_ClassProcs)\fR. -.PP -\fIworldChangedProc\fR is invoked when the system has altered -in some way that requires some reaction from the widget. For example, -when a font alias (see the \fBfont\fR manual entry) is reconfigured, -widgets configured to use that font alias must update their display -accordingly. \fIworldChangedProc\fR should have arguments and results -that match the type \fBTk_ClassWorldChangedProc\fR: -.CS -typedef void Tk_ClassWorldChangedProc( - ClientData \fIinstanceData\fR); -.CE -The \fIinstanceData\fR parameter passed to the \fIworldChangedProc\fR -will be identical to the \fIinstanceData\fR parameter passed to -\fBTk_SetClassProcs\fR. -.PP -\fIcreateProc\fR is used to create platform-dependant windows. It is -invoked by \fBTk_MakeWindowExist\fR. \fIcreateProc\fR should have -arguments and results that match the type \fBTk_ClassCreateProc\fR: -.CS -typedef Window Tk_ClassCreateProc( - Tk_Window \fItkwin\fR, - Window \fIparent\fR, - ClientData \fIinstanceData\fR); -.CE -The \fItkwin\fR and \fIinstanceData\fR parameters will be identical to -the \fItkwin\fR and \fIinstanceData\fR parameters passed to -\fBTk_SetClassProcs\fR. The \fIparent\fR parameter will be the parent -of the window to be created. The \fIcreateProc\fR should return the -created window. -.PP -\fImodalProc\fR is invoked after all bindings on a widget have been -triggered in order to handle a modal loop. \fImodalProc\fR should -have arguments and results that match the type \fBTk_ClassModalProc\fR: -.CS -typedef void Tk_ClassModalProc( - Tk_Window \fItkwin\fR, - XEvent *\fIeventPtr\fR); -.CE -The \fItkwin\fR parameter to \fImodalProc\fR will be identical to the -\fItkwin\fR parameter passed to \fBTk_SetClassProcs\fR. The -\fIeventPtr\fR parameter will be a pointer to an XEvent structure -describing the event being processed. - -.SH KEYWORDS -callback, class +'\" +'\" Copyright (c) 2000 Ajuba Solutions. +'\" +'\" See the file "license.terms" for information on usage and redistribution +'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. +'\" +'\" RCS: @(#) $Id: SetClassProcs.3,v 1.4 2008/06/30 22:57:02 dkf Exp $ +'\" +.so man.macros +.TH Tk_SetClassProcs 3 8.4 Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_SetClassProcs \- register widget specific procedures +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +\fBTk_SetClassProcs\fR(\fItkwin, procs, instanceData\fR) +.SH ARGUMENTS +.AS Tk_ClassProc instanceData +.AP Tk_Window tkwin in +Token for window to modify. +.AP Tk_ClassProcs *procs in +Pointer to data structure containing widget specific procedures. +The data structure pointed to by \fIprocs\fR must be static: +Tk keeps a reference to it as long as the window exists. +.AP ClientData instanceData in +Arbitrary one-word value to pass to widget callbacks. +.BE +.SH DESCRIPTION +.PP +\fBTk_SetClassProcs\fR is called to register a set of procedures that +are used as callbacks in different places. +.PP +The structure pointed to by \fIprocs\fR contains the following: +.CS +typedef struct Tk_ClassProcs { + unsigned int \fIsize\fR; + Tk_ClassWorldChangedProc *\fIworldChangedProc\fR; + Tk_ClassCreateProc *\fIcreateProc\fR; + Tk_ClassModalProc *\fImodalProc\fR; +} \fBTk_ClassProcs\fR; +.CE +The \fIsize\fR field is used to simplify future expansion of the +structure. It should always be set to (literally) \fBsizeof(Tk_ClassProcs)\fR. +.PP +\fIworldChangedProc\fR is invoked when the system has altered +in some way that requires some reaction from the widget. For example, +when a font alias (see the \fBfont\fR manual entry) is reconfigured, +widgets configured to use that font alias must update their display +accordingly. \fIworldChangedProc\fR should have arguments and results +that match the type \fBTk_ClassWorldChangedProc\fR: +.CS +typedef void \fBTk_ClassWorldChangedProc\fR( + ClientData \fIinstanceData\fR); +.CE +The \fIinstanceData\fR parameter passed to the \fIworldChangedProc\fR +will be identical to the \fIinstanceData\fR parameter passed to +\fBTk_SetClassProcs\fR. +.PP +\fIcreateProc\fR is used to create platform-dependant windows. It is +invoked by \fBTk_MakeWindowExist\fR. \fIcreateProc\fR should have +arguments and results that match the type \fBTk_ClassCreateProc\fR: +.CS +typedef Window \fBTk_ClassCreateProc\fR( + Tk_Window \fItkwin\fR, + Window \fIparent\fR, + ClientData \fIinstanceData\fR); +.CE +The \fItkwin\fR and \fIinstanceData\fR parameters will be identical to +the \fItkwin\fR and \fIinstanceData\fR parameters passed to +\fBTk_SetClassProcs\fR. The \fIparent\fR parameter will be the parent +of the window to be created. The \fIcreateProc\fR should return the +created window. +.PP +\fImodalProc\fR is invoked after all bindings on a widget have been +triggered in order to handle a modal loop. \fImodalProc\fR should +have arguments and results that match the type \fBTk_ClassModalProc\fR: +.CS +typedef void \fBTk_ClassModalProc\fR( + Tk_Window \fItkwin\fR, + XEvent *\fIeventPtr\fR); +.CE +The \fItkwin\fR parameter to \fImodalProc\fR will be identical to the +\fItkwin\fR parameter passed to \fBTk_SetClassProcs\fR. The +\fIeventPtr\fR parameter will be a pointer to an XEvent structure +describing the event being processed. +.SH KEYWORDS +callback, class diff --git a/doc/SetGrid.3 b/doc/SetGrid.3 index 965864c..ee8a231 100644 --- a/doc/SetGrid.3 +++ b/doc/SetGrid.3 @@ -1,67 +1,65 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: SetGrid.3,v 1.2 1998/09/14 18:22:53 stanton Exp $ -'\" -.so man.macros -.TH Tk_SetGrid 3 4.0 Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_SetGrid, Tk_UnsetGrid \- control the grid for interactive resizing -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTk_SetGrid\fR(\fItkwin, reqWidth, reqHeight, widthInc, heightInc\fR) -.sp -\fBTk_UnsetGrid\fR(\fItkwin\fR) -.SH ARGUMENTS -.AS Tk_Window heightInc -.AP Tk_Window tkwin in -Token for window. -.AP int reqWidth in -Width in grid units that corresponds to the pixel dimension \fItkwin\fR -has requested via \fBTk_GeometryRequest\fR. -.AP int reqHeight in -Height in grid units that corresponds to the pixel dimension \fItkwin\fR -has requested via \fBTk_GeometryRequest\fR. -.AP int widthInc in -Width of one grid unit, in pixels. -.AP int heightInc in -Height of one grid unit, in pixels. -.BE - -.SH DESCRIPTION -.PP -\fBTk_SetGrid\fR turns on gridded geometry management for \fItkwin\fR's -toplevel window and specifies the geometry of the grid. -\fBTk_SetGrid\fR is typically invoked by a widget when its \fBsetGrid\fR -option is true. -It restricts interactive resizing of \fItkwin\fR's toplevel window so -that the space allocated to the toplevel is equal to its requested -size plus or minus even multiples of \fIwidthInc\fR and \fIheightInc\fR. -Furthermore, the \fIreqWidth\fR and \fIreqHeight\fR values are -passed to the window manager so that it can report the window's -size in grid units during interactive resizes. -If \fItkwin\fR's configuration changes (e.g., the size of a grid unit -changes) then the widget should invoke \fBTk_SetGrid\fR again with the new -information. -.PP -\fBTk_UnsetGrid\fR cancels gridded geometry management for -\fItkwin\fR's toplevel window. -.PP -For each toplevel window there can be at most one internal window -with gridding enabled. -If \fBTk_SetGrid\fR or \fBTk_UnsetGrid\fR is invoked when some -other window is already controlling gridding for \fItkwin\fR's -toplevel, the calls for the new window have no effect. -.PP -See the \fBwm\fR manual entry for additional information on gridded geometry -management. - -.SH KEYWORDS -grid, window, window manager +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: SetGrid.3,v 1.3 2008/06/30 22:57:02 dkf Exp $ +'\" +.so man.macros +.TH Tk_SetGrid 3 4.0 Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_SetGrid, Tk_UnsetGrid \- control the grid for interactive resizing +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +\fBTk_SetGrid\fR(\fItkwin, reqWidth, reqHeight, widthInc, heightInc\fR) +.sp +\fBTk_UnsetGrid\fR(\fItkwin\fR) +.SH ARGUMENTS +.AS Tk_Window heightInc +.AP Tk_Window tkwin in +Token for window. +.AP int reqWidth in +Width in grid units that corresponds to the pixel dimension \fItkwin\fR +has requested via \fBTk_GeometryRequest\fR. +.AP int reqHeight in +Height in grid units that corresponds to the pixel dimension \fItkwin\fR +has requested via \fBTk_GeometryRequest\fR. +.AP int widthInc in +Width of one grid unit, in pixels. +.AP int heightInc in +Height of one grid unit, in pixels. +.BE +.SH DESCRIPTION +.PP +\fBTk_SetGrid\fR turns on gridded geometry management for \fItkwin\fR's +toplevel window and specifies the geometry of the grid. +\fBTk_SetGrid\fR is typically invoked by a widget when its \fBsetGrid\fR +option is true. +It restricts interactive resizing of \fItkwin\fR's toplevel window so +that the space allocated to the toplevel is equal to its requested +size plus or minus even multiples of \fIwidthInc\fR and \fIheightInc\fR. +Furthermore, the \fIreqWidth\fR and \fIreqHeight\fR values are +passed to the window manager so that it can report the window's +size in grid units during interactive resizes. +If \fItkwin\fR's configuration changes (e.g., the size of a grid unit +changes) then the widget should invoke \fBTk_SetGrid\fR again with the new +information. +.PP +\fBTk_UnsetGrid\fR cancels gridded geometry management for +\fItkwin\fR's toplevel window. +.PP +For each toplevel window there can be at most one internal window +with gridding enabled. +If \fBTk_SetGrid\fR or \fBTk_UnsetGrid\fR is invoked when some +other window is already controlling gridding for \fItkwin\fR's +toplevel, the calls for the new window have no effect. +.PP +See the \fBwm\fR manual entry for additional information on gridded geometry +management. +.SH KEYWORDS +grid, window, window manager diff --git a/doc/SetOptions.3 b/doc/SetOptions.3 index 8acfa25..20098cc 100644 --- a/doc/SetOptions.3 +++ b/doc/SetOptions.3 @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: SetOptions.3,v 1.17 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: SetOptions.3,v 1.18 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH Tk_SetOptions 3 8.1 Tk "Tk Library Procedures" @@ -245,7 +245,6 @@ The \fBTk_Offset\fR macro is provided as a safe way of generating the Tk_OptionSpec structures. It takes two arguments: the name of a type of record, and the name of a field in that record. It returns the byte offset of the named field in records of the given type. - .SH "TEMPLATES" .PP The array of Tk_OptionSpec structures passed to \fBTk_CreateOptionTable\fR @@ -264,7 +263,7 @@ typedef struct { int \fIflags\fR; ClientData \fIclientData\fR; int \fItypeMask\fR; -} Tk_OptionSpec; +} \fBTk_OptionSpec\fR; .CE The \fItype\fR field indicates what kind of configuration option this is (e.g. \fBTK_OPTION_COLOR\fR for a color value, or \fBTK_OPTION_INT\fR for @@ -436,7 +435,7 @@ suitable for passing to \fBTcl_GetIndexFromObj\fR. The value must be one of the strings in the table, or a unique abbreviation of one of the strings. The internal form is an integer giving the index into the table of the matching string, like the return value -from \fBTcl_GetStringFromObj\fR. +from \fBTcl_GetStringFromObj\fR. .TP \fBTK_OPTION_SYNONYM\fR This type is used to provide alternative names for an option (for @@ -452,7 +451,6 @@ The value must be a window path name. The internal form is a This option type requires \fItkwin\fR to be supplied to procedures such as \fBTk_SetOptions\fR (in order to identify the application), and it supports the \fBTK_OPTION_NULL_OK\fR flag. - .SH "STORAGE MANAGEMENT ISSUES" .PP If a field of a widget record has its offset stored in the \fIobjOffset\fR @@ -476,7 +474,6 @@ However, the widget code is responsible for storing NULL or \fBNone\fR in all pointer and token fields before invoking \fBTk_InitOptions\fR. This is needed to allow proper cleanup in the rare case where an error occurs in \fBTk_InitOptions\fR. - .SH "OBJOFFSET VS. INTERNALOFFSET" .PP In most cases it is simplest to use the \fIinternalOffset\fR field of @@ -507,7 +504,6 @@ To implement a new type of option, you can use \fBTK_OPTION_STRING\fR as the type in the Tk_OptionSpec structure and set the \fIobjOffset\fR field but not the \fIinternalOffset\fR field. Then, after calling \fBTk_SetOptions\fR, convert the object to internal form yourself. - .SH "CUSTOM OPTION TYPES" .PP Applications can extend the built-in configuration types with @@ -522,34 +518,34 @@ typedef struct Tk_ObjCustomOption { Tk_CustomOptionRestoreProc *\fIrestoreProc\fR; Tk_CustomOptionFreeProc *\fIfreeProc\fR; ClientData \fIclientData\fR; -} Tk_ObjCustomOption; +} \fBTk_ObjCustomOption\fR; -typedef int Tk_CustomOptionSetProc( - ClientData \fIclientData\fR, - Tcl_Interp *\fIinterp\fR, - Tk_Window \fItkwin\fR, - Tcl_Obj **\fIvaluePtr\fR, - char *\fIrecordPtr\fR, - int \fIinternalOffset\fR, - char *\fIsaveInternalPtr\fR, - int \fIflags\fR); +typedef int \fBTk_CustomOptionSetProc\fR( + ClientData \fIclientData\fR, + Tcl_Interp *\fIinterp\fR, + Tk_Window \fItkwin\fR, + Tcl_Obj **\fIvaluePtr\fR, + char *\fIrecordPtr\fR, + int \fIinternalOffset\fR, + char *\fIsaveInternalPtr\fR, + int \fIflags\fR); -typedef Tcl_Obj *Tk_CustomOptionGetProc( - ClientData \fIclientData\fR, - Tk_Window \fItkwin\fR, - char *\fIrecordPtr\fR, - int \fIinternalOffset\fR); +typedef Tcl_Obj *\fBTk_CustomOptionGetProc\fR( + ClientData \fIclientData\fR, + Tk_Window \fItkwin\fR, + char *\fIrecordPtr\fR, + int \fIinternalOffset\fR); -typedef void Tk_CustomOptionRestoreProc( - ClientData \fIclientData\fR, - Tk_Window \fItkwin\fR, - char *\fIinternalPtr\fR, - char *\fIsaveInternalPtr\fR); +typedef void \fBTk_CustomOptionRestoreProc\fR( + ClientData \fIclientData\fR, + Tk_Window \fItkwin\fR, + char *\fIinternalPtr\fR, + char *\fIsaveInternalPtr\fR); -typedef void Tk_CustomOptionFreeProc( - ClientData \fIclientData\fR, - Tk_Window \fItkwin\fR, - char *\fIinternalPtr\fR); +typedef void \fBTk_CustomOptionFreeProc\fR( + ClientData \fIclientData\fR, + Tk_Window \fItkwin\fR, + char *\fIinternalPtr\fR); .CE .PP The Tk_ObjCustomOption structure contains six fields: a name @@ -647,8 +643,6 @@ structure. \fITkwin\fR is a copy of the \fItkwin\fR argument to is a pointer to the location where the internal representation of the option value is stored. The \fIfreeProc\fR must free any storage associated with the option. \fIFreeProc\fR has no return value. - - .SH KEYWORDS anchor, bitmap, boolean, border, color, configuration option, cursor, double, font, integer, justify, diff --git a/doc/SetVisual.3 b/doc/SetVisual.3 index 28a3b03..5698bad 100644 --- a/doc/SetVisual.3 +++ b/doc/SetVisual.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: SetVisual.3,v 1.4 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: SetVisual.3,v 1.5 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH Tk_SetWindowVisual 3 4.0 Tk "Tk Library Procedures" @@ -30,7 +30,6 @@ Number of bits per pixel desired for \fItkwin\fR. New colormap for \fItkwin\fR, which must be compatible with \fIvisual\fR and \fIdepth\fR. .BE - .SH DESCRIPTION .PP When Tk creates a new window it assigns it the default visual @@ -49,6 +48,5 @@ completed successfully. Note: \fBTk_SetWindowVisual\fR should not be called if you just want to change a window's colormap without changing its visual or depth; call \fBTk_SetWindowColormap\fR instead. - .SH KEYWORDS colormap, depth, visual diff --git a/doc/StrictMotif.3 b/doc/StrictMotif.3 index 2883559..0623467 100644 --- a/doc/StrictMotif.3 +++ b/doc/StrictMotif.3 @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: StrictMotif.3,v 1.6 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: StrictMotif.3,v 1.7 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH Tk_StrictMotif 3 4.0 Tk "Tk Library Procedures" @@ -22,7 +22,6 @@ int .AP Tk_Window tkwin in Token for window. .BE - .SH DESCRIPTION .PP This procedure returns the current value of the \fBtk_strictMotif\fR @@ -37,6 +36,5 @@ is good enough, and extra features are welcome. This procedure uses a link to the Tcl variable to provide much faster access to the variable's value than could be had by calling \fBTcl_GetVar\fR. - .SH KEYWORDS Motif compliance, tk_strictMotif variable diff --git a/doc/TextLayout.3 b/doc/TextLayout.3 index 75b7c3e..3356737 100644 --- a/doc/TextLayout.3 +++ b/doc/TextLayout.3 @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: TextLayout.3,v 1.10 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: TextLayout.3,v 1.11 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH Tk_ComputeTextLayout 3 8.1 Tk "Tk Library Procedures" @@ -41,7 +41,6 @@ int .sp void \fBTk_TextLayoutToPostscript(\fIinterp, layout\fB)\fR - .SH ARGUMENTS .AS Tk_TextLayout "*xPtr, *yPtr" .AP Tk_Font tkfont in @@ -128,7 +127,6 @@ compare for intersection against the text layout. Postscript code that will print the text layout is appended to \fIinterp->result\fR. .BE - .SH DESCRIPTION .PP These routines are for measuring and displaying single-font, multi-line, @@ -235,6 +233,7 @@ strings and add some Postscript function operate on the array to render each of the lines. The code that represents the Postscript array of strings is appended to \fIinterp->result\fR. .SH "DISPLAY MODEL" +.PP When measuring a text layout, space characters that occur at the end of a line are ignored. The space characters still exist and the insertion point can be positioned amongst them, but their additional width is ignored when diff --git a/doc/TkInitStubs.3 b/doc/TkInitStubs.3 index 89e8323..fab5cf3 100644 --- a/doc/TkInitStubs.3 +++ b/doc/TkInitStubs.3 @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: TkInitStubs.3,v 1.8 2008/03/26 09:59:56 dkf Exp $ +'\" RCS: @(#) $Id: TkInitStubs.3,v 1.9 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH Tk_InitStubs 3 8.4 Tk "Tk Library Procedures" @@ -59,6 +59,7 @@ names are \fIlibtclstub8.4.a\fR and \fIlibtkstub8.4.a\fR; on Windows platforms, the library names are \fItclstub84.lib\fR and \fItkstub84.lib\fR (adjust names with appropriate version number). .SH DESCRIPTION +.PP \fBTk_InitStubs\fR attempts to initialize the Tk stub table pointers and ensure that the correct version of Tk is loaded. In addition to an interpreter handle, it accepts as arguments a version number diff --git a/doc/Tk_Init.3 b/doc/Tk_Init.3 index 8ea9c2e..6dbad09 100644 --- a/doc/Tk_Init.3 +++ b/doc/Tk_Init.3 @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: Tk_Init.3,v 1.6 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: Tk_Init.3,v 1.7 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH Tk_Init 3 8.0 Tk "Tk Library Procedures" @@ -25,7 +25,6 @@ int Interpreter in which to load Tk. Tk should not already be loaded in this interpreter. .BE - .SH DESCRIPTION .PP \fBTk_Init\fR is the package initialization procedure for Tk. @@ -84,6 +83,5 @@ from the user. \fBwm\fR If toplevels are ever allowed, wm can be used to remove decorations, move windows around, etc. - .SH KEYWORDS safe, application, initialization, load, main window diff --git a/doc/Tk_Main.3 b/doc/Tk_Main.3 index c40ea51..31e3723 100644 --- a/doc/Tk_Main.3 +++ b/doc/Tk_Main.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: Tk_Main.3,v 1.6 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: Tk_Main.3,v 1.7 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH Tk_Main 3 4.0 Tk "Tk Library Procedures" @@ -27,7 +27,6 @@ Array of strings containing command-line arguments. Address of an application-specific initialization procedure. The value for this argument is usually \fBTcl_AppInit\fR. .BE - .SH DESCRIPTION .PP \fBTk_Main\fR acts as the main program for most Tk-based applications. @@ -52,11 +51,11 @@ for the application to perform its own initialization, such as defining application-specific commands. The procedure must have an interface that matches the type \fBTcl_AppInitProc\fR: .CS -typedef int Tcl_AppInitProc(Tcl_Interp *\fIinterp\fR); +typedef int \fBTcl_AppInitProc\fR( + Tcl_Interp *\fIinterp\fR); .CE \fIAppInitProc\fR is almost always a pointer to \fBTcl_AppInit\fR; for more details on this procedure, see the documentation for \fBTcl_AppInit\fR. - .SH KEYWORDS application-specific initialization, command-line arguments, main program diff --git a/doc/WindowId.3 b/doc/WindowId.3 index 660ad05..61a1a04 100644 --- a/doc/WindowId.3 +++ b/doc/WindowId.3 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: WindowId.3,v 1.13 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: WindowId.3,v 1.14 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH Tk_WindowId 3 "8.4" Tk "Tk Library Procedures" @@ -104,7 +104,6 @@ Tcl_Interp * .AP Tk_Window tkwin in Token for window. .BE - .SH DESCRIPTION .PP \fBTk_WindowId\fR and the other names listed above are @@ -185,7 +184,6 @@ and \fBTk_Colormap\fR returns the current colormap for the window. The visual characteristics are normally set from the defaults for the window's screen, but they may be overridden by calling \fBTk_SetWindowVisual\fR. - .SH KEYWORDS attributes, colormap, depth, display, height, geometry manager, identifier, mapped, requested size, screen, top-level, diff --git a/doc/bell.n b/doc/bell.n index 23d81ec..a7eaa9f 100644 --- a/doc/bell.n +++ b/doc/bell.n @@ -1,35 +1,34 @@ -'\" -'\" Copyright (c) 1994 The Regents of the University of California. -'\" Copyright (c) 1994-1996 Sun Microsystems, Inc. -'\" Copyright (c) 2000 Ajuba Solutions. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: bell.n,v 1.4 2000/09/07 17:38:16 hobbs Exp $ -'\" -.so man.macros -.TH bell n 8.4 Tk "Tk Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -bell \- Ring a display's bell -.SH SYNOPSIS -\fBbell \fR?\fB\-displayof \fIwindow\fR? ?\fB\-nice\fR? -.BE - -.SH DESCRIPTION -.PP -This command rings the bell on the display for \fIwindow\fR and -returns an empty string. -If the \fB\-displayof\fR option is omitted, the display of the -application's main window is used by default. -The command uses the current bell-related settings for the display, which -may be modified with programs such as \fBxset\fR. -.PP -If \fB\-nice\fR is not specified, this command also resets the screen saver -for the screen. Some screen savers will ignore this, but others will reset -so that the screen becomes visible again. - -.SH KEYWORDS -beep, bell, ring +'\" -*- nroff -*- +'\" +'\" Copyright (c) 1994 The Regents of the University of California. +'\" Copyright (c) 1994-1996 Sun Microsystems, Inc. +'\" Copyright (c) 2000 Ajuba Solutions. +'\" +'\" See the file "license.terms" for information on usage and redistribution +'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. +'\" +'\" RCS: @(#) $Id: bell.n,v 1.5 2008/06/30 22:57:02 dkf Exp $ +'\" +.so man.macros +.TH bell n 8.4 Tk "Tk Built-In Commands" +.BS +'\" Note: do not modify the .SH NAME line immediately below! +.SH NAME +bell \- Ring a display's bell +.SH SYNOPSIS +\fBbell \fR?\fB\-displayof \fIwindow\fR? ?\fB\-nice\fR? +.BE +.SH DESCRIPTION +.PP +This command rings the bell on the display for \fIwindow\fR and +returns an empty string. +If the \fB\-displayof\fR option is omitted, the display of the +application's main window is used by default. +The command uses the current bell-related settings for the display, which +may be modified with programs such as \fBxset\fR. +.PP +If \fB\-nice\fR is not specified, this command also resets the screen saver +for the screen. Some screen savers will ignore this, but others will reset +so that the screen becomes visible again. +.SH KEYWORDS +beep, bell, ring diff --git a/doc/bind.n b/doc/bind.n index 58e9598..cae0c88 100644 --- a/doc/bind.n +++ b/doc/bind.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1990 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -6,7 +7,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: bind.n,v 1.29 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: bind.n,v 1.30 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH bind n 8.0 Tk "Tk Built-In Commands" @@ -153,7 +154,6 @@ requirement. The \fBCommand\fR and \fBOption\fR modifiers are equivalents of \fBMod1\fR resp. \fBMod2\fR, they correspond to Macintosh-specific modifier keys. .PP -.VS 8.5 The \fBExtended\fR modifier is, at present, specific to Windows. It appears on events that are associated with the keys on the .QW "extended keyboard" . @@ -162,7 +162,6 @@ and \fBControl\fR keys at the right of the keyboard, the cursor keys in the cluster to the left of the numeric pad, the \fBNumLock\fR key, the \fBBreak\fR key, the \fBPrintScreen\fR key, and the \fB/\fR and \fBEnter\fR keys in the numeric keypad. -.VE 8.5 .SS "EVENT TYPES" .PP The \fItype\fR field may be any of the standard X event types, with a @@ -431,10 +430,7 @@ The \fIcount\fR field from the event. Valid only for \fBExpose\fR events. Indicates that there are \fIcount\fR pending \fBExpose\fR events which have not yet been delivered to the window. .IP \fB%d\fR 5 -The \fIdetail\fR -.VS 8.5 -or \fIuser_data\fR -.VE 8.5 +The \fIdetail\fR or \fIuser_data\fR field from the event. The \fB%d\fR is replaced by a string identifying the detail. For \fBEnter\fR, \fBLeave\fR, \fBFocusIn\fR, and \fBFocusOut\fR events, @@ -454,13 +450,11 @@ For \fBConfigureRequest\fR events, the string will be one of: \fBBelow\fR \fBNone\fR \fBBottomIf\fR \fBTopIf\fR .DE -.VS 8.5 For virtual events, the string will be whatever value is stored in the \fIuser_data\fR field when the event was created (typically with \fBevent generate\fR), or the empty string if the field is NULL. Virtual events corresponding to key sequence presses (see \fBevent add\fR for details) set the \fIuser_data\fR to NULL. -.VE 8.5 For events other than these, the substituted string is undefined. .RE .IP \fB%f\fR 5 @@ -704,6 +698,7 @@ If an error occurs in executing the script for a binding then the The \fBbgerror\fR command will be executed at global level (outside the context of any Tcl procedure). .SH "EXAMPLES" +.PP Arrange for a string describing the motion of the mouse to be printed out when the mouse is double-clicked: .CS diff --git a/doc/bindtags.n b/doc/bindtags.n index c95c7a3..041379a 100644 --- a/doc/bindtags.n +++ b/doc/bindtags.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1990 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: bindtags.n,v 1.8 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: bindtags.n,v 1.9 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH bindtags n 4.0 Tk "Tk Built-In Commands" @@ -16,7 +17,6 @@ bindtags \- Determine which bindings apply to a window, and order of evaluation .SH SYNOPSIS \fBbindtags \fIwindow \fR?\fItagList\fR? .BE - .SH DESCRIPTION .PP When a binding is created with the \fBbind\fR command, it is @@ -75,6 +75,7 @@ associated with the \fBButton\fR tag, will no longer apply to \fB.b\fR, but any bindings associated with \fBTrickyButton\fR (perhaps some new button behavior) will apply. .SH EXAMPLE +.PP If you have a set of nested \fBframe\fR widgets and you want events sent to a \fBbutton\fR widget to also be delivered to all the widgets up to the current \fBtoplevel\fR (in contrast to Tk's default @@ -95,9 +96,7 @@ proc setupBindtagsForTreeDelivery {widget} { \fBbindtags\fR $widget $tags } .CE - .SH "SEE ALSO" bind(n) - .SH KEYWORDS binding, event, tag diff --git a/doc/bitmap.n b/doc/bitmap.n index 3eb29e6..065d0ad 100644 --- a/doc/bitmap.n +++ b/doc/bitmap.n @@ -1,114 +1,111 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: bitmap.n,v 1.2 1998/09/14 18:22:54 stanton Exp $ -'\" -.so man.macros -.TH bitmap n 4.0 Tk "Tk Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -bitmap \- Images that display two colors -.SH SYNOPSIS -\fBimage create bitmap \fR?\fIname\fR? ?\fIoptions\fR? -.BE - -.SH DESCRIPTION -.PP -A bitmap is an image whose pixels can display either of two colors -or be transparent. -A bitmap image is defined by four things: a background color, -a foreground color, and two bitmaps, called the \fIsource\fR -and the \fImask\fR. -Each of the bitmaps specifies 0/1 values for a rectangular -array of pixels, and the two bitmaps must have the same -dimensions. -For pixels where the mask is zero, the image displays nothing, -producing a transparent effect. -For other pixels, the image displays the foreground color if -the source data is one and the background color if the source -data is zero. - -.SH "CREATING BITMAPS" -.PP -Like all images, bitmaps are created using the \fBimage create\fR -command. -Bitmaps support the following \fIoptions\fR: -.TP -\fB\-background \fIcolor\fR -Specifies a background color for the image in any of the standard -ways accepted by Tk. If this option is set to an empty string -then the background pixels will be transparent. This effect -is achieved by using the source bitmap as the mask bitmap, ignoring -any \fB\-maskdata\fR or \fB\-maskfile\fR options. -.TP -\fB\-data \fIstring\fR -Specifies the contents of the source bitmap as a string. -The string must adhere to X11 bitmap format (e.g., as generated -by the \fBbitmap\fR program). -If both the \fB\-data\fR and \fB\-file\fR options are specified, -the \fB\-data\fR option takes precedence. -.TP -\fB\-file \fIname\fR -\fIname\fR gives the name of a file whose contents define the -source bitmap. -The file must adhere to X11 bitmap format (e.g., as generated -by the \fBbitmap\fR program). -.TP -\fB\-foreground \fIcolor\fR -Specifies a foreground color for the image in any of the standard -ways accepted by Tk. -.TP -\fB\-maskdata \fIstring\fR -Specifies the contents of the mask as a string. -The string must adhere to X11 bitmap format (e.g., as generated -by the \fBbitmap\fR program). -If both the \fB\-maskdata\fR and \fB\-maskfile\fR options are specified, -the \fB\-maskdata\fR option takes precedence. -.TP -\fB\-maskfile \fIname\fR -\fIname\fR gives the name of a file whose contents define the -mask. -The file must adhere to X11 bitmap format (e.g., as generated -by the \fBbitmap\fR program). - -.SH "IMAGE COMMAND" -.PP -When a bitmap image is created, Tk also creates a new command -whose name is the same as the image. -This command may be used to invoke various operations -on the image. -It has the following general form: -.CS -\fIimageName option \fR?\fIarg arg ...\fR? -.CE -\fIOption\fR and the \fIarg\fRs -determine the exact behavior of the command. The following -commands are possible for bitmap images: -.TP -\fIimageName \fBcget\fR \fIoption\fR -Returns the current value of the configuration option given -by \fIoption\fR. -\fIOption\fR may have any of the values accepted by the -\fBimage create bitmap\fR command. -.TP -\fIimageName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? -Query or modify the configuration options for the image. -If no \fIoption\fR is specified, returns a list describing all of -the available options for \fIimageName\fR (see \fBTk_ConfigureInfo\fR for -information on the format of this list). If \fIoption\fR is specified -with no \fIvalue\fR, then the command returns a list describing the -one named option (this list will be identical to the corresponding -sublist of the value returned if no \fIoption\fR is specified). If -one or more \fIoption\-value\fR pairs are specified, then the command -modifies the given option(s) to have the given value(s); in -this case the command returns an empty string. -\fIOption\fR may have any of the values accepted by the -\fBimage create bitmap\fR command. - -.SH KEYWORDS -bitmap, image +'\" -*- nroff -*- +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: bitmap.n,v 1.3 2008/06/30 22:57:02 dkf Exp $ +'\" +.so man.macros +.TH bitmap n 4.0 Tk "Tk Built-In Commands" +.BS +'\" Note: do not modify the .SH NAME line immediately below! +.SH NAME +bitmap \- Images that display two colors +.SH SYNOPSIS +\fBimage create bitmap \fR?\fIname\fR? ?\fIoptions\fR? +.BE +.SH DESCRIPTION +.PP +A bitmap is an image whose pixels can display either of two colors +or be transparent. +A bitmap image is defined by four things: a background color, +a foreground color, and two bitmaps, called the \fIsource\fR +and the \fImask\fR. +Each of the bitmaps specifies 0/1 values for a rectangular +array of pixels, and the two bitmaps must have the same +dimensions. +For pixels where the mask is zero, the image displays nothing, +producing a transparent effect. +For other pixels, the image displays the foreground color if +the source data is one and the background color if the source +data is zero. +.SH "CREATING BITMAPS" +.PP +Like all images, bitmaps are created using the \fBimage create\fR +command. +Bitmaps support the following \fIoptions\fR: +.TP +\fB\-background \fIcolor\fR +Specifies a background color for the image in any of the standard +ways accepted by Tk. If this option is set to an empty string +then the background pixels will be transparent. This effect +is achieved by using the source bitmap as the mask bitmap, ignoring +any \fB\-maskdata\fR or \fB\-maskfile\fR options. +.TP +\fB\-data \fIstring\fR +Specifies the contents of the source bitmap as a string. +The string must adhere to X11 bitmap format (e.g., as generated +by the \fBbitmap\fR program). +If both the \fB\-data\fR and \fB\-file\fR options are specified, +the \fB\-data\fR option takes precedence. +.TP +\fB\-file \fIname\fR +\fIname\fR gives the name of a file whose contents define the +source bitmap. +The file must adhere to X11 bitmap format (e.g., as generated +by the \fBbitmap\fR program). +.TP +\fB\-foreground \fIcolor\fR +Specifies a foreground color for the image in any of the standard +ways accepted by Tk. +.TP +\fB\-maskdata \fIstring\fR +Specifies the contents of the mask as a string. +The string must adhere to X11 bitmap format (e.g., as generated +by the \fBbitmap\fR program). +If both the \fB\-maskdata\fR and \fB\-maskfile\fR options are specified, +the \fB\-maskdata\fR option takes precedence. +.TP +\fB\-maskfile \fIname\fR +\fIname\fR gives the name of a file whose contents define the +mask. +The file must adhere to X11 bitmap format (e.g., as generated +by the \fBbitmap\fR program). +.SH "IMAGE COMMAND" +.PP +When a bitmap image is created, Tk also creates a new command +whose name is the same as the image. +This command may be used to invoke various operations +on the image. +It has the following general form: +.CS +\fIimageName option \fR?\fIarg arg ...\fR? +.CE +\fIOption\fR and the \fIarg\fRs +determine the exact behavior of the command. The following +commands are possible for bitmap images: +.TP +\fIimageName \fBcget\fR \fIoption\fR +Returns the current value of the configuration option given +by \fIoption\fR. +\fIOption\fR may have any of the values accepted by the +\fBimage create bitmap\fR command. +.TP +\fIimageName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? +Query or modify the configuration options for the image. +If no \fIoption\fR is specified, returns a list describing all of +the available options for \fIimageName\fR (see \fBTk_ConfigureInfo\fR for +information on the format of this list). If \fIoption\fR is specified +with no \fIvalue\fR, then the command returns a list describing the +one named option (this list will be identical to the corresponding +sublist of the value returned if no \fIoption\fR is specified). If +one or more \fIoption\-value\fR pairs are specified, then the command +modifies the given option(s) to have the given value(s); in +this case the command returns an empty string. +\fIOption\fR may have any of the values accepted by the +\fBimage create bitmap\fR command. +.SH KEYWORDS +bitmap, image diff --git a/doc/button.n b/doc/button.n index 1a7d2ec..ca12ea2 100644 --- a/doc/button.n +++ b/doc/button.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1990-1994 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: button.n,v 1.17 2008/05/11 00:12:02 patthoyts Exp $ +'\" RCS: @(#) $Id: button.n,v 1.18 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH button n 4.4 Tk "Tk Built-In Commands" @@ -77,7 +78,6 @@ If the width is negative then this specifies a minimum width. If this option is not specified, the button's desired width is computed from the size of the image or bitmap or text being displayed in it. .BE - .SH DESCRIPTION .PP The \fBbutton\fR command creates a new window (given by the @@ -105,7 +105,6 @@ and it can be made to flash. When a user invokes the button (by pressing mouse button 1 with the cursor over the button), then the Tcl command specified in the \fB\-command\fR option is invoked. - .SH "WIDGET COMMAND" .PP The \fBbutton\fR command creates a new Tcl command whose @@ -151,7 +150,6 @@ Invoke the Tcl command associated with the button, if there is one. The return value is the return value from the Tcl command, or an empty string if there is no command associated with the button. This command is ignored if the button's state is \fBdisabled\fR. - .SH "DEFAULT BINDINGS" .PP Tk automatically creates class bindings for buttons that give them @@ -178,8 +176,8 @@ actions occur: the button is completely non-responsive. .PP The behavior of buttons can be changed by defining new bindings for individual widgets or by redefining the class bindings. - .SH EXAMPLES +.PP This is the classic Tk .QW "Hello, World!" demonstration: diff --git a/doc/canvas.n b/doc/canvas.n index 1899914..16f9610 100644 --- a/doc/canvas.n +++ b/doc/canvas.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1992-1994 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -6,7 +7,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: canvas.n,v 1.34 2008/01/30 12:00:38 dkf Exp $ +'\" RCS: @(#) $Id: canvas.n,v 1.35 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH canvas n 8.3 Tk "Tk Built-In Commands" @@ -1449,7 +1450,6 @@ irrelevant. \fB\-smooth \fIsmoothMethod\fR \fIsmoothMethod\fR must have one of the forms accepted by \fBTcl_GetBoolean\fR or a line smoothing method. -.VS 8.5 Only \fBtrue\fR and \fBraw\fR are supported in the core (with \fBbezier\fR being an alias for \fBtrue\fR), but more can be added at runtime. If a boolean false value or empty string is given, no smoothing is applied. A boolean @@ -1468,7 +1468,6 @@ line segments can be generated within a curve by making control points equal to their neighbouring knot points. If the last point is a control point and not a knot point, the point is repeated (one or two times) so that it also becomes a knot point. -.VE 8.5 .TP \fB\-splinesteps \fInumber\fR Specifies the degree of smoothness desired for curves: each spline @@ -1585,7 +1584,6 @@ If this option is not specified then it defaults to \fBround\fR. .TP \fB\-smooth \fIboolean\fR \fIBoolean\fR must have one of the forms accepted by \fBTcl_GetBoolean\fR -.VS 8.5 or a line smoothing method. Only \fBtrue\fR and \fBraw\fR are supported in the core (with \fBbezier\fR being an alias for \fBtrue\fR), but more can be added at runtime. If a boolean false value or empty string is given, no smoothing is applied. A boolean @@ -1605,7 +1603,6 @@ equal to their neighbouring knot points. If the last point is not the second point of a pair of control points, the point is repeated (one or two times) so that it also becomes the second point of a pair of control points (the associated knot point will be the first control point). -.VE 8.5 .TP \fB\-splinesteps \fInumber\fR Specifies the degree of smoothness desired for curves: each spline @@ -1740,7 +1737,6 @@ Newline characters cause line breaks. The characters in the item may also be changed with the \fBinsert\fR and \fBdelete\fR widget commands. This option defaults to an empty string. -.VS 8.5 .TP \fB\-underline \fI\fR Specifies the integer index of a character within the text to be @@ -1748,7 +1744,6 @@ underlined. 0 corresponds to the first character of the text displayed, 1 to the next character, and so on. \-1 means that no underline should be drawn (if the whole text item is to be underlined, the appropriate font should be used instead). -.VE 8.5 .TP \fB\-width \fIlineLength\fR Specifies a maximum line length for the text, in any of the forms diff --git a/doc/checkbutton.n b/doc/checkbutton.n index d204336..2654c7c 100644 --- a/doc/checkbutton.n +++ b/doc/checkbutton.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1990-1994 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: checkbutton.n,v 1.19 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: checkbutton.n,v 1.20 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH checkbutton n 4.4 Tk "Tk Built-In Commands" @@ -97,18 +98,14 @@ the widget and will ignore mouse button presses. In this state the \fBdisabledForeground\fR and \fBbackground\fR options determine how the checkbutton is displayed. .OP \-tristateimage tristateImage TristateImage -.VS 8.5 Specifies an image to display (in place of the \fBimage\fR option) when the checkbutton is in tri-state mode. This option is ignored unless the \fBimage\fR option has been specified. -.VE 8.5 .OP \-tristatevalue tristateValue Value -.VS 8.5 -Specifies the value that causes the checkbutton to display the multi-value +Specifies the value that causes the checkbutton to display the multi-value selection, also known as the tri-state mode. Defaults to .QW "" . -.VE 8.5 .OP \-variable variable Variable Specifies name of global variable to set to indicate whether or not this button is selected. Defaults to the name of the @@ -157,17 +154,16 @@ If a checkbutton is selected then the indicator is normally drawn with a selected appearance, and a Tcl variable associated with the checkbutton is set to a particular value (normally 1). -.VS 8.5 The indicator is drawn with a check mark inside. If the checkbutton is not selected, then the indicator is drawn with a deselected appearance, and the associated variable is set to a different value (typically 0). -The indicator is drawn without a check mark inside. In the special case -where the variable (if specified) has a value that matches the tristatevalue, -the indicator is drawn with a tri-state appearance and is in the tri-state -mode indicating mixed or multiple values. (This is used when the check +The indicator is drawn without a check mark inside. In the special case +where the variable (if specified) has a value that matches the tristatevalue, +the indicator is drawn with a tri-state appearance and is in the tri-state +mode indicating mixed or multiple values. (This is used when the check box represents the state of multiple items.) -The indicator is drawn in a platform dependent manner. Under Unix and +The indicator is drawn in a platform dependent manner. Under Unix and Windows, the background interior of the box is .QW grayed . Under Mac, the indicator is drawn with a dash mark inside. @@ -192,7 +188,6 @@ changes to and from the button's and .QW tristate values. -.VE 8.5 .SH "WIDGET COMMAND" .PP The \fBcheckbutton\fR command creates a new Tcl command whose @@ -280,6 +275,7 @@ actions occur: the checkbutton is completely non-responsive. The behavior of checkbuttons can be changed by defining new bindings for individual widgets or by redefining the class bindings. .SH EXAMPLE +.PP This example shows a group of uncoupled checkbuttons. .PP .CS diff --git a/doc/chooseColor.n b/doc/chooseColor.n index 2354660..74c9898 100644 --- a/doc/chooseColor.n +++ b/doc/chooseColor.n @@ -1,10 +1,11 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 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. '\" -'\" RCS: @(#) $Id: chooseColor.n,v 1.5 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: chooseColor.n,v 1.6 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH tk_chooseColor n 4.2 Tk "Tk Built-In Commands" @@ -15,7 +16,6 @@ tk_chooseColor \- pops up a dialog box for the user to select a color. .SH SYNOPSIS \fBtk_chooseColor \fR?\fIoption value ...\fR? .BE - .SH DESCRIPTION .PP The procedure \fBtk_chooseColor\fR pops up a dialog box for the @@ -40,9 +40,9 @@ name of the color in a form acceptable to \fBTk_GetColor\fR. If the user cancels the operation, both commands will return the empty string. .SH EXAMPLE +.PP .CS button .b \-bg [tk_chooseColor \-initialcolor gray \-title "Choose color"] .CE - .SH KEYWORDS color selection dialog diff --git a/doc/chooseDirectory.n b/doc/chooseDirectory.n index af8b9ba..07ba242 100644 --- a/doc/chooseDirectory.n +++ b/doc/chooseDirectory.n @@ -1,8 +1,9 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" All rights reserved. '\" -'\" RCS: @(#) $Id: chooseDirectory.n,v 1.11 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: chooseDirectory.n,v 1.12 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH tk_chooseDirectory n 8.3 Tk "Tk Built-In Commands" @@ -40,6 +41,7 @@ turns the file dialog into a sheet attached to the parent window. Specifies a string to display as the title of the dialog box. If this option is not specified, then a default title will be displayed. .SH EXAMPLE +.PP .CS set dir [\fBtk_chooseDirectory\fR \e \-initialdir ~ \-title "Choose a directory"] @@ -49,7 +51,6 @@ if {$dir eq ""} { label .l \-text "Selected $dir" } .CE - .SH "SEE ALSO" tk_getOpenFile(n), tk_getSaveFile(n) .SH KEYWORDS diff --git a/doc/clipboard.n b/doc/clipboard.n index d0ea02b..c1317de 100644 --- a/doc/clipboard.n +++ b/doc/clipboard.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1994 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: clipboard.n,v 1.16 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: clipboard.n,v 1.17 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH clipboard n 8.4 Tk "Tk Built-In Commands" @@ -16,7 +17,6 @@ clipboard \- Manipulate Tk clipboard .SH SYNOPSIS \fBclipboard \fIoption\fR ?\fIarg arg ...\fR? .BE - .SH DESCRIPTION .PP This command provides a Tcl interface to the Tk clipboard, @@ -91,6 +91,7 @@ or FILE_NAME. \fIType\fR defaults to STRING. This command is equivalent to .QW "\fBselection get \-selection CLIPBOARD\fR" . .SH EXAMPLES +.PP Get the current contents of the clipboard. .CS if {[catch {\fBclipboard get\fR} contents]} { @@ -143,9 +144,7 @@ bind $c <> { } } .CE - .SH "SEE ALSO" interp(n), selection(n) - .SH KEYWORDS clear, format, clipboard, append, selection, type diff --git a/doc/colors.n b/doc/colors.n index 30a2498..fc7ead5 100644 --- a/doc/colors.n +++ b/doc/colors.n @@ -1,10 +1,11 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" Copyright (c) 2003 ActiveState Corporation. '\" Copyright (c) 2006-2007 Daniel A. Steffen '\" Copyright (c) 2008 Donal K. Fellows '\" -'\" RCS: @(#) $Id: colors.n,v 1.9 2008/03/07 23:33:40 dkf Exp $ +'\" RCS: @(#) $Id: colors.n,v 1.10 2008/06/30 22:57:02 dkf Exp $ '\" '\" .so man.macros diff --git a/doc/console.n b/doc/console.n index 2835d05..2098b1b 100644 --- a/doc/console.n +++ b/doc/console.n @@ -1,10 +1,11 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 2001 Donal K. Fellows '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: console.n,v 1.11 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: console.n,v 1.12 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH console n 8.4 Tk "Tk Built-In Commands" @@ -131,6 +132,7 @@ Most other behaviour is the same as a conventional text widget except for the way that the \fI<>\fR event is handled identically to the \fI<>\fR event. .SH EXAMPLE +.PP Not all platforms have the \fBconsole\fR command, so debugging code often has the following code fragment in it so output produced by \fBputs\fR can be seen while during development: diff --git a/doc/cursors.n b/doc/cursors.n index 8aec46d..d8bbfee 100644 --- a/doc/cursors.n +++ b/doc/cursors.n @@ -1,10 +1,11 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" All rights reserved. '\" '\" Copyright (c) 2006-2007 Daniel A. Steffen '\" -'\" RCS: @(#) $Id: cursors.n,v 1.8 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: cursors.n,v 1.9 2008/06/30 22:57:02 dkf Exp $ '\" '\" .so man.macros diff --git a/doc/destroy.n b/doc/destroy.n index 4c405d5..ff529c5 100644 --- a/doc/destroy.n +++ b/doc/destroy.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1990 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: destroy.n,v 1.7 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: destroy.n,v 1.8 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH destroy n "" Tk "Tk Built-In Commands" @@ -29,6 +30,7 @@ in destroying a window the command aborts without destroying the remaining windows. No error is returned if \fIwindow\fR does not exist. .SH EXAMPLE +.PP Destroy all checkbuttons that are direct children of the given widget: .CS proc killCheckbuttonChildren {parent} { @@ -39,6 +41,5 @@ proc killCheckbuttonChildren {parent} { } } .CE - .SH KEYWORDS application, destroy, window diff --git a/doc/dialog.n b/doc/dialog.n index c5d9a38..452c29c 100644 --- a/doc/dialog.n +++ b/doc/dialog.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1992 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: dialog.n,v 1.7 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: dialog.n,v 1.8 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH tk_dialog n 4.1 Tk "Tk Built-In Commands" @@ -16,7 +17,6 @@ tk_dialog \- Create modal dialog and wait for response .SH SYNOPSIS \fBtk_dialog \fIwindow title text bitmap default string string ...\fR .BE - .SH DESCRIPTION .PP This procedure is part of the Tk script library. @@ -61,13 +61,12 @@ While waiting for the user to respond, \fBtk_dialog\fR sets a local grab. This prevents the user from interacting with the application in any way except to invoke the dialog box. .SH EXAMPLE +.PP .CS set reply [\fBtk_dialog\fR .foo "The Title" "Do you want to say yes?" \e questhead 0 Yes No "I'm not sure"] .CE - .SH "SEE ALSO" tk_messageBox(n) - .SH KEYWORDS bitmap, dialog, modal diff --git a/doc/entry.n b/doc/entry.n index b653b17..8eec11e 100644 --- a/doc/entry.n +++ b/doc/entry.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1990-1994 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -6,7 +7,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: entry.n,v 1.22 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: entry.n,v 1.23 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH entry n 8.3 Tk "Tk Built-In Commands" diff --git a/doc/event.n b/doc/event.n index fd0509f..745d77e 100644 --- a/doc/event.n +++ b/doc/event.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1996 Sun Microsystems, Inc. '\" Copyright (c) 1998-2000 Ajuba Solutions. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: event.n,v 1.19 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: event.n,v 1.20 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH event n 8.3 Tk "Tk Built-In Commands" @@ -110,13 +111,11 @@ Corresponds to the \fB%b\fR substitution for binding scripts. \fINumber\fR must be an integer; it specifies the \fIcount\fR field for the event. Valid for \fBExpose\fR events. Corresponds to the \fB%c\fR substitution for binding scripts. -.VS 8.5 .TP \fB\-data\fI string\fR \fIString\fR may be any value; it specifies the \fIuser_data\fR field for the event. Only valid for virtual events. Corresponds to the \fB%d\fR substitution for virtual events in binding scripts. -.VE 8.5 .TP \fB\-delta\fI number\fR \fINumber\fR must be an integer; it specifies the \fIdelta\fR field @@ -310,6 +309,7 @@ Any options that are not specified when generating an event are filled with the value 0, except for \fIserial\fR, which is filled with the next X event serial number. .SH "PREDEFINED VIRTUAL EVENTS" +.PP Tk defines the following virtual events for the purposes of notification: .TP @@ -434,9 +434,7 @@ the behavior will change such in two ways. First, the shadowed Typing Control-y will no longer invoke the \fB\fR binding, but instead invoke the virtual event \fB<>\fR. Second, pressing the F6 key will now also invoke the \fB<>\fR binding. - .SH "SEE ALSO" bind(n) - .SH KEYWORDS event, binding, define, handle, virtual event diff --git a/doc/focus.n b/doc/focus.n index 10c1581..9310710 100644 --- a/doc/focus.n +++ b/doc/focus.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1990-1994 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: focus.n,v 1.6 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: focus.n,v 1.7 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH focus n 4.0 Tk "Tk Built-In Commands" @@ -20,7 +21,6 @@ focus \- Manage the input focus \fBfocus \fIoption\fR ?\fIarg arg ...\fR? .fi .BE - .SH DESCRIPTION .PP The \fBfocus\fR command is used to manage the Tk input focus. @@ -108,6 +108,7 @@ number of problems that would occur if the X focus were actually moved; the fact that the X focus is on the top-level is invisible unless you use C code to query the X server directly. .SH "EXAMPLE" +.PP To make a window that only participates in the focus traversal ring when a variable is set, add the following bindings to the widgets \fIbefore\fR and \fIafter\fR it in that focus ring: @@ -132,6 +133,5 @@ bind .after { } \fBfocus\fR .before .CE - .SH KEYWORDS events, focus, keyboard, top-level, window manager diff --git a/doc/focusNext.n b/doc/focusNext.n index a59fa3e..85c1ca9 100644 --- a/doc/focusNext.n +++ b/doc/focusNext.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1994 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: focusNext.n,v 1.6 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: focusNext.n,v 1.7 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH tk_focusNext n 4.0 Tk "Tk Built-In Commands" @@ -20,7 +21,6 @@ tk_focusNext, tk_focusPrev, tk_focusFollowsMouse \- Utility procedures for manag .sp \fBtk_focusFollowsMouse\fR .BE - .SH DESCRIPTION .PP \fBtk_focusNext\fR is a utility procedure used for keyboard traversal. @@ -56,6 +56,5 @@ Note: at present there is no built-in support for returning the application to an explicit focus model; to do this you will have to write a script that deletes the bindings created by \fBtk_focusFollowsMouse\fR. - .SH KEYWORDS focus, keyboard traversal, top-level diff --git a/doc/font.n b/doc/font.n index 5d74b97..05b948c 100644 --- a/doc/font.n +++ b/doc/font.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1996 Sun Microsystems, Inc. '\" Copyright (c) 2006-2007 Daniel A. Steffen @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: font.n,v 1.22 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: font.n,v 1.23 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH font n 8.0 Tk "Tk Built-In Commands" @@ -183,7 +184,7 @@ a garbage value); in that case, some system-dependent default font is chosen. If the font description does not match any of the above patterns, an error is generated. .SH "FONT METRICS" -. +.PP The following options are used by the \fBfont metrics\fR command to query font-specific data determined when the font was created. These properties are for the whole font itself and not for individual characters drawn in that @@ -225,6 +226,7 @@ individual characters have different widths. The widths of control characters, tab characters, and other non-printing characters are not included when calculating this value. .SH "FONT OPTIONS" +.PP The following options are supported on all platforms, and are used when constructing a named font or when specifying a font using style [5] as above: @@ -288,7 +290,7 @@ The value is a boolean flag that specifies whether a horizontal line should be drawn through the middle of characters in this font. The default value for overstrike is \fBfalse\fR. .SH "STANDARD FONTS" -.LP +.PP The following named fonts are supported on all systems, and default to values that match appropriate system defaults. .TP @@ -375,6 +377,7 @@ theme fonts: .DE .RE .SH EXAMPLE +.PP Fill a text widget with lots of font demonstrators, one for every font family installed on your system: .CS @@ -392,9 +395,7 @@ foreach family [lsort \-dictionary [\fBfont families\fR]] { } } .CE - .SH "SEE ALSO" options(n) - .SH KEYWORDS font diff --git a/doc/frame.n b/doc/frame.n index e960f10..0b6f31e 100644 --- a/doc/frame.n +++ b/doc/frame.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1990-1994 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: frame.n,v 1.9 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: frame.n,v 1.10 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH frame n 8.4 Tk "Tk Built-In Commands" diff --git a/doc/getOpenFile.n b/doc/getOpenFile.n index fd941cc..49a84fd 100644 --- a/doc/getOpenFile.n +++ b/doc/getOpenFile.n @@ -1,10 +1,11 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 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. '\" -'\" RCS: @(#) $Id: getOpenFile.n,v 1.23 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: getOpenFile.n,v 1.24 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH tk_getOpenFile n 4.2 Tk "Tk Built-In Commands" @@ -159,6 +160,7 @@ Extensions without a full stop character (e.g. .QW ~ ) are allowed but may not work on all platforms. .SH EXAMPLE +.PP .CS set types { {{Text Files} {.txt} } diff --git a/doc/grab.n b/doc/grab.n index b16b933..3a15523 100644 --- a/doc/grab.n +++ b/doc/grab.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1992 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: grab.n,v 1.8 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: grab.n,v 1.9 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH grab n "" Tk "Tk Built-In Commands" @@ -18,7 +19,6 @@ grab \- Confine pointer and keyboard events to a window sub-tree .sp \fBgrab \fIoption \fR?\fIarg arg \fR...? .BE - .SH DESCRIPTION .PP This command implements simple pointer and keyboard grabs for Tk. @@ -104,6 +104,7 @@ Returns \fBnone\fR if no grab is currently set on \fIwindow\fR, \fBlocal\fR if a local grab is set on \fIwindow\fR, and \fBglobal\fR if a global grab is set. .SH WARNING +.PP It is very easy to use global grabs to render a display completely unusable (e.g. by setting a grab on a widget which does not respond to events and not providing any mechanism for releasing the grab). Take @@ -123,6 +124,7 @@ only one of those applications can have a local grab for a given display at any given time. If the applications are in different processes, this restriction does not exist. .SH EXAMPLE +.PP Set a grab so that only one button may be clicked out of a group. The other buttons are unresponsive to the mouse until the middle button is clicked. @@ -132,6 +134,5 @@ pack [button .b2 \-text "Click me! #2" \-command {destroy .b2}] pack [button .b3 \-text "Click me! #3" \-command {destroy .b3}] \fBgrab\fR .b2 .CE - .SH KEYWORDS grab, keyboard events, pointer events, window diff --git a/doc/grid.n b/doc/grid.n index 1ae1ea4..ece0c0a 100644 --- a/doc/grid.n +++ b/doc/grid.n @@ -1,10 +1,11 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 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. '\" -'\" RCS: @(#) $Id: grid.n,v 1.20 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: grid.n,v 1.21 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH grid n 8.5 Tk "Tk Built-In Commands" @@ -26,42 +27,38 @@ on the \fIoption\fR argument: \fBgrid \fIslave \fR?\fIslave ...\fR? ?\fIoptions\fR? If the first argument to \fBgrid\fR is suitable as the first slave argument to \fBgrid configure\fR, either a window name (any value -starting with \fB.\fR) or one of the characters \fBx\fR or \fB^\fR +starting with \fB.\fR) or one of the characters \fBx\fR or \fB^\fR (see the \fBRELATIVE PLACEMENT\fR section below), then the command is processed in the same way as \fBgrid configure\fR. -.VS 8.5 .TP \fBgrid anchor \fImaster\fR ?\fIanchor\fR? The anchor value controls how to place the grid within the master when no row/column has any weight. See \fBTHE GRID ALGORITHM\fR below for further details. The default \fIanchor\fR is \fInw\fR. -.VE 8.5 .TP \fBgrid bbox \fImaster\fR ?\fIcolumn row\fR? ?\fIcolumn2 row2\fR? -With no arguments, +With no arguments, the bounding box (in pixels) of the grid is returned. The return value consists of 4 integers. The first two are the pixel offset from the master window (x then y) of the top-left corner of the grid, and the second two integers are the width and height of the grid, -also in pixels. If a single \fIcolumn\fR and \fIrow\fR is specified on +also in pixels. If a single \fIcolumn\fR and \fIrow\fR is specified on the command line, then the bounding box for that cell is returned, where the top left cell is numbered from zero. If both \fIcolumn\fR and \fIrow\fR arguments are specified, then the bounding box spanning the rows and columns indicated is returned. .TP \fBgrid columnconfigure \fImaster index \fR?\fI\-option value...\fR? -Query or set the column properties of the \fIindex\fR column of the +Query or set the column properties of the \fIindex\fR column of the geometry master, \fImaster\fR. The valid options are \fB\-minsize\fR, \fB\-weight\fR, \fB\-uniform\fR and \fB\-pad\fR. -If one or more options are provided, then \fIindex\fR may be given as +If one or more options are provided, then \fIindex\fR may be given as a list of column indices to which the configuration options will operate on. -.VS 8.5 Indices may be integers, window names or the keyword \fIall\fR. For \fIall\fR the options apply to all columns currently occupied be slave windows. For a window name, that window must be a slave of this master and the options apply to all columns currently occupied be the slave. -.VE 8.5 The \fB\-minsize\fR option sets the minimum size, in screen units, that will be permitted for this column. The \fB\-weight\fR option (an integer value) @@ -91,7 +88,7 @@ pairs. The arguments consist of the names of one or more slave windows followed by pairs of arguments that specify how to manage the slaves. -The characters \fB\-\fR, \fBx\fR and \fB^\fR, +The characters \fB\-\fR, \fBx\fR and \fB^\fR, can be specified instead of a window name to alter the default location of a \fIslave\fR, as described in the \fBRELATIVE PLACEMENT\fR section, below. @@ -201,7 +198,7 @@ The first two elements of the list are where \fImaster\fR is the slave's master. .TP \fBgrid location \fImaster x y\fR -Given \fIx\fR and \fIy\fR values in screen units relative to the master window, +Given \fIx\fR and \fIy\fR values in screen units relative to the master window, the column and row number at that \fIx\fR and \fIy\fR location is returned. For locations that are above or to the left of the grid, \fB\-1\fR is returned. @@ -219,18 +216,16 @@ for \fImaster\fR. Propagation is enabled by default. .TP \fBgrid rowconfigure \fImaster index \fR?\fI\-option value...\fR? -Query or set the row properties of the \fIindex\fR row of the +Query or set the row properties of the \fIindex\fR row of the geometry master, \fImaster\fR. The valid options are \fB\-minsize\fR, \fB\-weight\fR, \fB\-uniform\fR and \fB\-pad\fR. -If one or more options are provided, then \fIindex\fR may be given as +If one or more options are provided, then \fIindex\fR may be given as a list of row indices to which the configuration options will operate on. -.VS 8.5 Indices may be integers, window names or the keyword \fIall\fR. For \fIall\fR the options apply to all rows currently occupied be slave windows. For a window name, that window must be a slave of this master and the options apply to all rows currently occupied be the slave. -.VE 8.5 The \fB\-minsize\fR option sets the minimum size, in screen units, that will be permitted for this row. The \fB\-weight\fR option (an integer value) @@ -268,7 +263,7 @@ values are retained. \fBgrid size \fImaster\fR Returns the size of the grid (in columns then rows) for \fImaster\fR. The size is determined either by the \fIslave\fR occupying the largest -row or column, or the largest column or row with a \fBminsize\fR, +row or column, or the largest column or row with a \fBminsize\fR, \fBweight\fR, or \fBpad\fR that is non-zero. .TP \fBgrid slaves \fImaster\fR ?\fI\-option value\fR? @@ -280,11 +275,11 @@ to be returned. .SH "RELATIVE PLACEMENT" .PP The \fBgrid\fR command contains a limited set of capabilities that -permit layouts to be created without specifying the row and column -information for each slave. This permits slaves to be rearranged, +permit layouts to be created without specifying the row and column +information for each slave. This permits slaves to be rearranged, added, or removed without the need to explicitly specify row and column information. -When no column or row information is specified for a \fIslave\fR, +When no column or row information is specified for a \fIslave\fR, default values are chosen for \fBcolumn\fR, \fBrow\fR, \fBcolumnspan\fR and \fBrowspan\fR at the time the \fIslave\fR is managed. The values are chosen @@ -339,9 +334,9 @@ allocated to them is always in proportion to their weights. (A weight of zero is considered to be 1.) In other words, a row or column configured with \fB\-weight 1 \-uniform a\fR will have exactly the same size as any other row or column configured with \fB\-weight 1 \-uniform -a\fR. A row or column configured with \fB\-weight 2 \-uniform b\fR will +a\fR. A row or column configured with \fB\-weight 2 \-uniform b\fR will be exactly twice as large as one that is configured with \fB\-weight 1 -\-uniform b\fR. +\-uniform b\fR. .PP More technically, each row or column in the group will have a size equal to \fIk*weight\fR for some constant \fIk\fR. The constant @@ -350,18 +345,16 @@ minimum size. For example, if all rows or columns in a group have the same weight, then each row or column will have the same size as the largest row or column in the group. .PP -.VS 8.5 For masters whose size is larger than the requested layout, the additional space is apportioned according to the row and column weights. If all of the weights are zero, the layout is placed within its master according to the \fIanchor\fR value. For masters whose size is smaller than the requested layout, space is taken -away from columns and rows according to their weights. However, once a +away from columns and rows according to their weights. However, once a column or row shrinks to its minsize, its weight is taken to be zero. If more space needs to be removed from a layout than would be permitted, as when all the rows or columns are at their minimum sizes, the layout is placed and clipped according to the \fIanchor\fR value. -.VE 8.5 .SH "GEOMETRY PROPAGATION" .PP The grid geometry manager normally computes how large a master must be to @@ -399,6 +392,7 @@ The \fBgrid\fR command is based on ideas taken from the \fIGridBag\fR geometry manager written by Doug. Stein, and the \fBblt_table\fR geometry manager, written by George Howlett. .SH EXAMPLES +.PP A toplevel window containing a text widget and two scrollbars: .CS # Make the widgets diff --git a/doc/image.n b/doc/image.n index 5792367..2bfae3c 100644 --- a/doc/image.n +++ b/doc/image.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1994 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: image.n,v 1.9 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: image.n,v 1.10 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH image n 4.0 Tk "Tk Built-In Commands" @@ -16,7 +17,6 @@ image \- Create and manipulate images .SH SYNOPSIS \fBimage\fR \fIoption \fR?\fIarg arg ...\fR? .BE - .SH DESCRIPTION .PP The \fBimage\fR command is used to create, delete, and query images. @@ -96,9 +96,7 @@ See the \fBbitmap\fR manual entry for more information. Displays a variety of full-color images, using dithering to approximate colors on displays with limited color capabilities. See the \fBphoto\fR manual entry for more information. - .SH "SEE ALSO" bitmap(n), options(n), photo(n) - .SH KEYWORDS height, image, types of images, width diff --git a/doc/keysyms.n b/doc/keysyms.n index 5ccc4ea..fdd2a5d 100644 --- a/doc/keysyms.n +++ b/doc/keysyms.n @@ -1,930 +1,928 @@ -'\" -'\" Copyright (c) 1998-2000 by Scriptics Corporation. -'\" All rights reserved. -'\" -'\" RCS: @(#) $Id: keysyms.n,v 1.4 2004/08/20 14:15:29 dkf Exp $ -'\" -'\" -.so man.macros -.TH keysyms n 8.3 Tk "Tk Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -keysyms \- keysyms recognized by Tk -.BE - -.SH DESCRIPTION -.PP -Tk recognizes many keysyms when specifying key bindings (e.g. -\fBbind . \fR). The following list enumerates the -keysyms that will be recognized by Tk. Note that not all keysyms will -be valid on all platforms. For example, on Unix systems, the presence -of a particular keysym is dependant on the configuration of the -keyboard modifier map. This list shows keysyms along with their -decimal and hexadecimal values. -.PP -.CS -space 32 0x0020 -exclam 33 0x0021 -quotedbl 34 0x0022 -numbersign 35 0x0023 -dollar 36 0x0024 -percent 37 0x0025 -ampersand 38 0x0026 -quoteright 39 0x0027 -parenleft 40 0x0028 -parenright 41 0x0029 -asterisk 42 0x002a -plus 43 0x002b -comma 44 0x002c -minus 45 0x002d -period 46 0x002e -slash 47 0x002f -0 48 0x0030 -1 49 0x0031 -2 50 0x0032 -3 51 0x0033 -4 52 0x0034 -5 53 0x0035 -6 54 0x0036 -7 55 0x0037 -8 56 0x0038 -9 57 0x0039 -colon 58 0x003a -semicolon 59 0x003b -less 60 0x003c -equal 61 0x003d -greater 62 0x003e -question 63 0x003f -at 64 0x0040 -A 65 0x0041 -B 66 0x0042 -C 67 0x0043 -D 68 0x0044 -E 69 0x0045 -F 70 0x0046 -G 71 0x0047 -H 72 0x0048 -I 73 0x0049 -J 74 0x004a -K 75 0x004b -L 76 0x004c -M 77 0x004d -N 78 0x004e -O 79 0x004f -P 80 0x0050 -Q 81 0x0051 -R 82 0x0052 -S 83 0x0053 -T 84 0x0054 -U 85 0x0055 -V 86 0x0056 -W 87 0x0057 -X 88 0x0058 -Y 89 0x0059 -Z 90 0x005a -bracketleft 91 0x005b -backslash 92 0x005c -bracketright 93 0x005d -asciicircum 94 0x005e -underscore 95 0x005f -quoteleft 96 0x0060 -a 97 0x0061 -b 98 0x0062 -c 99 0x0063 -d 100 0x0064 -e 101 0x0065 -f 102 0x0066 -g 103 0x0067 -h 104 0x0068 -i 105 0x0069 -j 106 0x006a -k 107 0x006b -l 108 0x006c -m 109 0x006d -n 110 0x006e -o 111 0x006f -p 112 0x0070 -q 113 0x0071 -r 114 0x0072 -s 115 0x0073 -t 116 0x0074 -u 117 0x0075 -v 118 0x0076 -w 119 0x0077 -x 120 0x0078 -y 121 0x0079 -z 122 0x007a -braceleft 123 0x007b -bar 124 0x007c -braceright 125 0x007d -asciitilde 126 0x007e -nobreakspace 160 0x00a0 -exclamdown 161 0x00a1 -cent 162 0x00a2 -sterling 163 0x00a3 -currency 164 0x00a4 -yen 165 0x00a5 -brokenbar 166 0x00a6 -section 167 0x00a7 -diaeresis 168 0x00a8 -copyright 169 0x00a9 -ordfeminine 170 0x00aa -guillemotleft 171 0x00ab -notsign 172 0x00ac -hyphen 173 0x00ad -registered 174 0x00ae -macron 175 0x00af -degree 176 0x00b0 -plusminus 177 0x00b1 -twosuperior 178 0x00b2 -threesuperior 179 0x00b3 -acute 180 0x00b4 -mu 181 0x00b5 -paragraph 182 0x00b6 -periodcentered 183 0x00b7 -cedilla 184 0x00b8 -onesuperior 185 0x00b9 -masculine 186 0x00ba -guillemotright 187 0x00bb -onequarter 188 0x00bc -onehalf 189 0x00bd -threequarters 190 0x00be -questiondown 191 0x00bf -Agrave 192 0x00c0 -Aacute 193 0x00c1 -Acircumflex 194 0x00c2 -Atilde 195 0x00c3 -Adiaeresis 196 0x00c4 -Aring 197 0x00c5 -AE 198 0x00c6 -Ccedilla 199 0x00c7 -Egrave 200 0x00c8 -Eacute 201 0x00c9 -Ecircumflex 202 0x00ca -Ediaeresis 203 0x00cb -Igrave 204 0x00cc -Iacute 205 0x00cd -Icircumflex 206 0x00ce -Idiaeresis 207 0x00cf -Eth 208 0x00d0 -Ntilde 209 0x00d1 -Ograve 210 0x00d2 -Oacute 211 0x00d3 -Ocircumflex 212 0x00d4 -Otilde 213 0x00d5 -Odiaeresis 214 0x00d6 -multiply 215 0x00d7 -Ooblique 216 0x00d8 -Ugrave 217 0x00d9 -Uacute 218 0x00da -Ucircumflex 219 0x00db -Udiaeresis 220 0x00dc -Yacute 221 0x00dd -Thorn 222 0x00de -ssharp 223 0x00df -agrave 224 0x00e0 -aacute 225 0x00e1 -acircumflex 226 0x00e2 -atilde 227 0x00e3 -adiaeresis 228 0x00e4 -aring 229 0x00e5 -ae 230 0x00e6 -ccedilla 231 0x00e7 -egrave 232 0x00e8 -eacute 233 0x00e9 -ecircumflex 234 0x00ea -ediaeresis 235 0x00eb -igrave 236 0x00ec -iacute 237 0x00ed -icircumflex 238 0x00ee -idiaeresis 239 0x00ef -eth 240 0x00f0 -ntilde 241 0x00f1 -ograve 242 0x00f2 -oacute 243 0x00f3 -ocircumflex 244 0x00f4 -otilde 245 0x00f5 -odiaeresis 246 0x00f6 -division 247 0x00f7 -oslash 248 0x00f8 -ugrave 249 0x00f9 -uacute 250 0x00fa -ucircumflex 251 0x00fb -udiaeresis 252 0x00fc -yacute 253 0x00fd -thorn 254 0x00fe -ydiaeresis 255 0x00ff -Aogonek 417 0x01a1 -breve 418 0x01a2 -Lstroke 419 0x01a3 -Lcaron 421 0x01a5 -Sacute 422 0x01a6 -Scaron 425 0x01a9 -Scedilla 426 0x01aa -Tcaron 427 0x01ab -Zacute 428 0x01ac -.CE -.CS -Zcaron 430 0x01ae -Zabovedot 431 0x01af -aogonek 433 0x01b1 -ogonek 434 0x01b2 -lstroke 435 0x01b3 -lcaron 437 0x01b5 -sacute 438 0x01b6 -caron 439 0x01b7 -scaron 441 0x01b9 -scedilla 442 0x01ba -tcaron 443 0x01bb -zacute 444 0x01bc -doubleacute 445 0x01bd -zcaron 446 0x01be -zabovedot 447 0x01bf -Racute 448 0x01c0 -Abreve 451 0x01c3 -Cacute 454 0x01c6 -Ccaron 456 0x01c8 -Eogonek 458 0x01ca -Ecaron 460 0x01cc -Dcaron 463 0x01cf -Nacute 465 0x01d1 -Ncaron 466 0x01d2 -Odoubleacute 469 0x01d5 -Rcaron 472 0x01d8 -Uring 473 0x01d9 -Udoubleacute 475 0x01db -Tcedilla 478 0x01de -racute 480 0x01e0 -abreve 483 0x01e3 -cacute 486 0x01e6 -ccaron 488 0x01e8 -eogonek 490 0x01ea -ecaron 492 0x01ec -dcaron 495 0x01ef -nacute 497 0x01f1 -ncaron 498 0x01f2 -odoubleacute 501 0x01f5 -rcaron 504 0x01f8 -uring 505 0x01f9 -udoubleacute 507 0x01fb -tcedilla 510 0x01fe -abovedot 511 0x01ff -Hstroke 673 0x02a1 -Hcircumflex 678 0x02a6 -Iabovedot 681 0x02a9 -Gbreve 683 0x02ab -Jcircumflex 684 0x02ac -hstroke 689 0x02b1 -hcircumflex 694 0x02b6 -idotless 697 0x02b9 -gbreve 699 0x02bb -jcircumflex 700 0x02bc -Cabovedot 709 0x02c5 -Ccircumflex 710 0x02c6 -Gabovedot 725 0x02d5 -Gcircumflex 728 0x02d8 -Ubreve 733 0x02dd -Scircumflex 734 0x02de -cabovedot 741 0x02e5 -ccircumflex 742 0x02e6 -gabovedot 757 0x02f5 -gcircumflex 760 0x02f8 -ubreve 765 0x02fd -scircumflex 766 0x02fe -kappa 930 0x03a2 -Rcedilla 931 0x03a3 -Itilde 933 0x03a5 -Lcedilla 934 0x03a6 -Emacron 938 0x03aa -Gcedilla 939 0x03ab -Tslash 940 0x03ac -rcedilla 947 0x03b3 -itilde 949 0x03b5 -lcedilla 950 0x03b6 -emacron 954 0x03ba -gacute 955 0x03bb -tslash 956 0x03bc -ENG 957 0x03bd -eng 959 0x03bf -Amacron 960 0x03c0 -Iogonek 967 0x03c7 -Eabovedot 972 0x03cc -Imacron 975 0x03cf -Ncedilla 977 0x03d1 -Omacron 978 0x03d2 -Kcedilla 979 0x03d3 -Uogonek 985 0x03d9 -Utilde 989 0x03dd -Umacron 990 0x03de -amacron 992 0x03e0 -iogonek 999 0x03e7 -eabovedot 1004 0x03ec -imacron 1007 0x03ef -ncedilla 1009 0x03f1 -omacron 1010 0x03f2 -kcedilla 1011 0x03f3 -uogonek 1017 0x03f9 -utilde 1021 0x03fd -umacron 1022 0x03fe -overline 1150 0x047e -kana_fullstop 1185 0x04a1 -kana_openingbracket 1186 0x04a2 -kana_closingbracket 1187 0x04a3 -kana_comma 1188 0x04a4 -kana_middledot 1189 0x04a5 -kana_WO 1190 0x04a6 -kana_a 1191 0x04a7 -kana_i 1192 0x04a8 -kana_u 1193 0x04a9 -kana_e 1194 0x04aa -kana_o 1195 0x04ab -kana_ya 1196 0x04ac -kana_yu 1197 0x04ad -kana_yo 1198 0x04ae -kana_tu 1199 0x04af -prolongedsound 1200 0x04b0 -kana_A 1201 0x04b1 -kana_I 1202 0x04b2 -kana_U 1203 0x04b3 -kana_E 1204 0x04b4 -kana_O 1205 0x04b5 -kana_KA 1206 0x04b6 -kana_KI 1207 0x04b7 -kana_KU 1208 0x04b8 -kana_KE 1209 0x04b9 -kana_KO 1210 0x04ba -kana_SA 1211 0x04bb -kana_SHI 1212 0x04bc -kana_SU 1213 0x04bd -kana_SE 1214 0x04be -kana_SO 1215 0x04bf -kana_TA 1216 0x04c0 -kana_TI 1217 0x04c1 -kana_TU 1218 0x04c2 -kana_TE 1219 0x04c3 -kana_TO 1220 0x04c4 -kana_NA 1221 0x04c5 -kana_NI 1222 0x04c6 -kana_NU 1223 0x04c7 -kana_NE 1224 0x04c8 -kana_NO 1225 0x04c9 -kana_HA 1226 0x04ca -kana_HI 1227 0x04cb -kana_HU 1228 0x04cc -kana_HE 1229 0x04cd -kana_HO 1230 0x04ce -kana_MA 1231 0x04cf -kana_MI 1232 0x04d0 -kana_MU 1233 0x04d1 -kana_ME 1234 0x04d2 -kana_MO 1235 0x04d3 -kana_YA 1236 0x04d4 -kana_YU 1237 0x04d5 -kana_YO 1238 0x04d6 -kana_RA 1239 0x04d7 -kana_RI 1240 0x04d8 -kana_RU 1241 0x04d9 -kana_RE 1242 0x04da -kana_RO 1243 0x04db -kana_WA 1244 0x04dc -kana_N 1245 0x04dd -voicedsound 1246 0x04de -semivoicedsound 1247 0x04df -Arabic_comma 1452 0x05ac -Arabic_semicolon 1467 0x05bb -Arabic_question_mark 1471 0x05bf -Arabic_hamza 1473 0x05c1 -Arabic_maddaonalef 1474 0x05c2 -Arabic_hamzaonalef 1475 0x05c3 -Arabic_hamzaonwaw 1476 0x05c4 -Arabic_hamzaunderalef 1477 0x05c5 -Arabic_hamzaonyeh 1478 0x05c6 -Arabic_alef 1479 0x05c7 -Arabic_beh 1480 0x05c8 -Arabic_tehmarbuta 1481 0x05c9 -Arabic_teh 1482 0x05ca -Arabic_theh 1483 0x05cb -Arabic_jeem 1484 0x05cc -Arabic_hah 1485 0x05cd -Arabic_khah 1486 0x05ce -Arabic_dal 1487 0x05cf -Arabic_thal 1488 0x05d0 -Arabic_ra 1489 0x05d1 -Arabic_zain 1490 0x05d2 -Arabic_seen 1491 0x05d3 -Arabic_sheen 1492 0x05d4 -Arabic_sad 1493 0x05d5 -Arabic_dad 1494 0x05d6 -Arabic_tah 1495 0x05d7 -Arabic_zah 1496 0x05d8 -Arabic_ain 1497 0x05d9 -Arabic_ghain 1498 0x05da -Arabic_tatweel 1504 0x05e0 -Arabic_feh 1505 0x05e1 -Arabic_qaf 1506 0x05e2 -Arabic_kaf 1507 0x05e3 -Arabic_lam 1508 0x05e4 -Arabic_meem 1509 0x05e5 -.CE -.CS -Arabic_noon 1510 0x05e6 -Arabic_heh 1511 0x05e7 -Arabic_waw 1512 0x05e8 -Arabic_alefmaksura 1513 0x05e9 -Arabic_yeh 1514 0x05ea -Arabic_fathatan 1515 0x05eb -Arabic_dammatan 1516 0x05ec -Arabic_kasratan 1517 0x05ed -Arabic_fatha 1518 0x05ee -Arabic_damma 1519 0x05ef -Arabic_kasra 1520 0x05f0 -Arabic_shadda 1521 0x05f1 -Arabic_sukun 1522 0x05f2 -Serbian_dje 1697 0x06a1 -Macedonia_gje 1698 0x06a2 -Cyrillic_io 1699 0x06a3 -Ukranian_je 1700 0x06a4 -Macedonia_dse 1701 0x06a5 -Ukranian_i 1702 0x06a6 -Ukranian_yi 1703 0x06a7 -Serbian_je 1704 0x06a8 -Serbian_lje 1705 0x06a9 -Serbian_nje 1706 0x06aa -Serbian_tshe 1707 0x06ab -Macedonia_kje 1708 0x06ac -Byelorussian_shortu 1710 0x06ae -Serbian_dze 1711 0x06af -numerosign 1712 0x06b0 -Serbian_DJE 1713 0x06b1 -Macedonia_GJE 1714 0x06b2 -Cyrillic_IO 1715 0x06b3 -Ukranian_JE 1716 0x06b4 -Macedonia_DSE 1717 0x06b5 -Ukranian_I 1718 0x06b6 -Ukranian_YI 1719 0x06b7 -Serbian_JE 1720 0x06b8 -Serbian_LJE 1721 0x06b9 -Serbian_NJE 1722 0x06ba -Serbian_TSHE 1723 0x06bb -Macedonia_KJE 1724 0x06bc -Byelorussian_SHORTU 1726 0x06be -Serbian_DZE 1727 0x06bf -Cyrillic_yu 1728 0x06c0 -Cyrillic_a 1729 0x06c1 -Cyrillic_be 1730 0x06c2 -Cyrillic_tse 1731 0x06c3 -Cyrillic_de 1732 0x06c4 -Cyrillic_ie 1733 0x06c5 -Cyrillic_ef 1734 0x06c6 -Cyrillic_ghe 1735 0x06c7 -Cyrillic_ha 1736 0x06c8 -Cyrillic_i 1737 0x06c9 -Cyrillic_shorti 1738 0x06ca -Cyrillic_ka 1739 0x06cb -Cyrillic_el 1740 0x06cc -Cyrillic_em 1741 0x06cd -Cyrillic_en 1742 0x06ce -Cyrillic_o 1743 0x06cf -Cyrillic_pe 1744 0x06d0 -Cyrillic_ya 1745 0x06d1 -Cyrillic_er 1746 0x06d2 -Cyrillic_es 1747 0x06d3 -Cyrillic_te 1748 0x06d4 -Cyrillic_u 1749 0x06d5 -Cyrillic_zhe 1750 0x06d6 -Cyrillic_ve 1751 0x06d7 -Cyrillic_softsign 1752 0x06d8 -Cyrillic_yeru 1753 0x06d9 -Cyrillic_ze 1754 0x06da -Cyrillic_sha 1755 0x06db -Cyrillic_e 1756 0x06dc -Cyrillic_shcha 1757 0x06dd -Cyrillic_che 1758 0x06de -Cyrillic_hardsign 1759 0x06df -Cyrillic_YU 1760 0x06e0 -Cyrillic_A 1761 0x06e1 -Cyrillic_BE 1762 0x06e2 -Cyrillic_TSE 1763 0x06e3 -Cyrillic_DE 1764 0x06e4 -Cyrillic_IE 1765 0x06e5 -Cyrillic_EF 1766 0x06e6 -Cyrillic_GHE 1767 0x06e7 -Cyrillic_HA 1768 0x06e8 -Cyrillic_I 1769 0x06e9 -Cyrillic_SHORTI 1770 0x06ea -Cyrillic_KA 1771 0x06eb -Cyrillic_EL 1772 0x06ec -Cyrillic_EM 1773 0x06ed -Cyrillic_EN 1774 0x06ee -Cyrillic_O 1775 0x06ef -Cyrillic_PE 1776 0x06f0 -Cyrillic_YA 1777 0x06f1 -Cyrillic_ER 1778 0x06f2 -Cyrillic_ES 1779 0x06f3 -Cyrillic_TE 1780 0x06f4 -Cyrillic_U 1781 0x06f5 -Cyrillic_ZHE 1782 0x06f6 -Cyrillic_VE 1783 0x06f7 -Cyrillic_SOFTSIGN 1784 0x06f8 -Cyrillic_YERU 1785 0x06f9 -Cyrillic_ZE 1786 0x06fa -Cyrillic_SHA 1787 0x06fb -Cyrillic_E 1788 0x06fc -Cyrillic_SHCHA 1789 0x06fd -Cyrillic_CHE 1790 0x06fe -Cyrillic_HARDSIGN 1791 0x06ff -Greek_ALPHAaccent 1953 0x07a1 -Greek_EPSILONaccent 1954 0x07a2 -Greek_ETAaccent 1955 0x07a3 -Greek_IOTAaccent 1956 0x07a4 -Greek_IOTAdiaeresis 1957 0x07a5 -Greek_IOTAaccentdiaeresis 1958 0x07a6 -Greek_OMICRONaccent 1959 0x07a7 -Greek_UPSILONaccent 1960 0x07a8 -Greek_UPSILONdieresis 1961 0x07a9 -Greek_UPSILONaccentdieresis 1962 0x07aa -Greek_OMEGAaccent 1963 0x07ab -Greek_alphaaccent 1969 0x07b1 -Greek_epsilonaccent 1970 0x07b2 -Greek_etaaccent 1971 0x07b3 -Greek_iotaaccent 1972 0x07b4 -Greek_iotadieresis 1973 0x07b5 -Greek_iotaaccentdieresis 1974 0x07b6 -Greek_omicronaccent 1975 0x07b7 -Greek_upsilonaccent 1976 0x07b8 -Greek_upsilondieresis 1977 0x07b9 -Greek_upsilonaccentdieresis 1978 0x07ba -Greek_omegaaccent 1979 0x07bb -Greek_ALPHA 1985 0x07c1 -Greek_BETA 1986 0x07c2 -Greek_GAMMA 1987 0x07c3 -Greek_DELTA 1988 0x07c4 -Greek_EPSILON 1989 0x07c5 -Greek_ZETA 1990 0x07c6 -Greek_ETA 1991 0x07c7 -Greek_THETA 1992 0x07c8 -Greek_IOTA 1993 0x07c9 -Greek_KAPPA 1994 0x07ca -Greek_LAMBDA 1995 0x07cb -Greek_MU 1996 0x07cc -Greek_NU 1997 0x07cd -Greek_XI 1998 0x07ce -Greek_OMICRON 1999 0x07cf -Greek_PI 2000 0x07d0 -Greek_RHO 2001 0x07d1 -Greek_SIGMA 2002 0x07d2 -Greek_TAU 2004 0x07d4 -Greek_UPSILON 2005 0x07d5 -Greek_PHI 2006 0x07d6 -Greek_CHI 2007 0x07d7 -Greek_PSI 2008 0x07d8 -Greek_OMEGA 2009 0x07d9 -Greek_alpha 2017 0x07e1 -Greek_beta 2018 0x07e2 -Greek_gamma 2019 0x07e3 -Greek_delta 2020 0x07e4 -Greek_epsilon 2021 0x07e5 -Greek_zeta 2022 0x07e6 -Greek_eta 2023 0x07e7 -Greek_theta 2024 0x07e8 -Greek_iota 2025 0x07e9 -Greek_kappa 2026 0x07ea -Greek_lambda 2027 0x07eb -Greek_mu 2028 0x07ec -Greek_nu 2029 0x07ed -Greek_xi 2030 0x07ee -Greek_omicron 2031 0x07ef -Greek_pi 2032 0x07f0 -Greek_rho 2033 0x07f1 -Greek_sigma 2034 0x07f2 -Greek_finalsmallsigma 2035 0x07f3 -Greek_tau 2036 0x07f4 -Greek_upsilon 2037 0x07f5 -Greek_phi 2038 0x07f6 -Greek_chi 2039 0x07f7 -Greek_psi 2040 0x07f8 -Greek_omega 2041 0x07f9 -leftradical 2209 0x08a1 -topleftradical 2210 0x08a2 -horizconnector 2211 0x08a3 -topintegral 2212 0x08a4 -botintegral 2213 0x08a5 -vertconnector 2214 0x08a6 -topleftsqbracket 2215 0x08a7 -botleftsqbracket 2216 0x08a8 -toprightsqbracket 2217 0x08a9 -botrightsqbracket 2218 0x08aa -topleftparens 2219 0x08ab -botleftparens 2220 0x08ac -toprightparens 2221 0x08ad -botrightparens 2222 0x08ae -leftmiddlecurlybrace 2223 0x08af -rightmiddlecurlybrace 2224 0x08b0 -topleftsummation 2225 0x08b1 -botleftsummation 2226 0x08b2 -topvertsummationconnector 2227 0x08b3 -botvertsummationconnector 2228 0x08b4 -toprightsummation 2229 0x08b5 -botrightsummation 2230 0x08b6 -rightmiddlesummation 2231 0x08b7 -.CE -.CS -lessthanequal 2236 0x08bc -notequal 2237 0x08bd -greaterthanequal 2238 0x08be -integral 2239 0x08bf -therefore 2240 0x08c0 -variation 2241 0x08c1 -infinity 2242 0x08c2 -nabla 2245 0x08c5 -approximate 2248 0x08c8 -similarequal 2249 0x08c9 -ifonlyif 2253 0x08cd -implies 2254 0x08ce -identical 2255 0x08cf -radical 2262 0x08d6 -includedin 2266 0x08da -includes 2267 0x08db -intersection 2268 0x08dc -union 2269 0x08dd -logicaland 2270 0x08de -logicalor 2271 0x08df -partialderivative 2287 0x08ef -function 2294 0x08f6 -leftarrow 2299 0x08fb -uparrow 2300 0x08fc -rightarrow 2301 0x08fd -downarrow 2302 0x08fe -blank 2527 0x09df -soliddiamond 2528 0x09e0 -checkerboard 2529 0x09e1 -ht 2530 0x09e2 -ff 2531 0x09e3 -cr 2532 0x09e4 -lf 2533 0x09e5 -nl 2536 0x09e8 -vt 2537 0x09e9 -lowrightcorner 2538 0x09ea -uprightcorner 2539 0x09eb -upleftcorner 2540 0x09ec -lowleftcorner 2541 0x09ed -crossinglines 2542 0x09ee -horizlinescan1 2543 0x09ef -horizlinescan3 2544 0x09f0 -horizlinescan5 2545 0x09f1 -horizlinescan7 2546 0x09f2 -horizlinescan9 2547 0x09f3 -leftt 2548 0x09f4 -rightt 2549 0x09f5 -bott 2550 0x09f6 -topt 2551 0x09f7 -vertbar 2552 0x09f8 -emspace 2721 0x0aa1 -enspace 2722 0x0aa2 -em3space 2723 0x0aa3 -em4space 2724 0x0aa4 -digitspace 2725 0x0aa5 -punctspace 2726 0x0aa6 -thinspace 2727 0x0aa7 -hairspace 2728 0x0aa8 -emdash 2729 0x0aa9 -endash 2730 0x0aaa -signifblank 2732 0x0aac -ellipsis 2734 0x0aae -doubbaselinedot 2735 0x0aaf -onethird 2736 0x0ab0 -twothirds 2737 0x0ab1 -onefifth 2738 0x0ab2 -twofifths 2739 0x0ab3 -threefifths 2740 0x0ab4 -fourfifths 2741 0x0ab5 -onesixth 2742 0x0ab6 -fivesixths 2743 0x0ab7 -careof 2744 0x0ab8 -figdash 2747 0x0abb -leftanglebracket 2748 0x0abc -decimalpoint 2749 0x0abd -rightanglebracket 2750 0x0abe -marker 2751 0x0abf -oneeighth 2755 0x0ac3 -threeeighths 2756 0x0ac4 -fiveeighths 2757 0x0ac5 -seveneighths 2758 0x0ac6 -trademark 2761 0x0ac9 -signaturemark 2762 0x0aca -trademarkincircle 2763 0x0acb -leftopentriangle 2764 0x0acc -rightopentriangle 2765 0x0acd -emopencircle 2766 0x0ace -emopenrectangle 2767 0x0acf -leftsinglequotemark 2768 0x0ad0 -rightsinglequotemark 2769 0x0ad1 -leftdoublequotemark 2770 0x0ad2 -rightdoublequotemark 2771 0x0ad3 -prescription 2772 0x0ad4 -minutes 2774 0x0ad6 -seconds 2775 0x0ad7 -latincross 2777 0x0ad9 -hexagram 2778 0x0ada -filledrectbullet 2779 0x0adb -filledlefttribullet 2780 0x0adc -filledrighttribullet 2781 0x0add -emfilledcircle 2782 0x0ade -emfilledrect 2783 0x0adf -enopencircbullet 2784 0x0ae0 -enopensquarebullet 2785 0x0ae1 -openrectbullet 2786 0x0ae2 -opentribulletup 2787 0x0ae3 -opentribulletdown 2788 0x0ae4 -openstar 2789 0x0ae5 -enfilledcircbullet 2790 0x0ae6 -enfilledsqbullet 2791 0x0ae7 -filledtribulletup 2792 0x0ae8 -filledtribulletdown 2793 0x0ae9 -leftpointer 2794 0x0aea -rightpointer 2795 0x0aeb -club 2796 0x0aec -diamond 2797 0x0aed -heart 2798 0x0aee -maltesecross 2800 0x0af0 -dagger 2801 0x0af1 -doubledagger 2802 0x0af2 -checkmark 2803 0x0af3 -ballotcross 2804 0x0af4 -musicalsharp 2805 0x0af5 -musicalflat 2806 0x0af6 -malesymbol 2807 0x0af7 -femalesymbol 2808 0x0af8 -telephone 2809 0x0af9 -telephonerecorder 2810 0x0afa -phonographcopyright 2811 0x0afb -caret 2812 0x0afc -singlelowquotemark 2813 0x0afd -doublelowquotemark 2814 0x0afe -cursor 2815 0x0aff -leftcaret 2979 0x0ba3 -rightcaret 2982 0x0ba6 -downcaret 2984 0x0ba8 -upcaret 2985 0x0ba9 -overbar 3008 0x0bc0 -downtack 3010 0x0bc2 -upshoe 3011 0x0bc3 -downstile 3012 0x0bc4 -underbar 3014 0x0bc6 -jot 3018 0x0bca -quad 3020 0x0bcc -uptack 3022 0x0bce -circle 3023 0x0bcf -upstile 3027 0x0bd3 -downshoe 3030 0x0bd6 -rightshoe 3032 0x0bd8 -leftshoe 3034 0x0bda -lefttack 3036 0x0bdc -righttack 3068 0x0bfc -hebrew_aleph 3296 0x0ce0 -hebrew_beth 3297 0x0ce1 -hebrew_gimmel 3298 0x0ce2 -hebrew_daleth 3299 0x0ce3 -hebrew_he 3300 0x0ce4 -hebrew_waw 3301 0x0ce5 -hebrew_zayin 3302 0x0ce6 -hebrew_het 3303 0x0ce7 -hebrew_teth 3304 0x0ce8 -hebrew_yod 3305 0x0ce9 -hebrew_finalkaph 3306 0x0cea -hebrew_kaph 3307 0x0ceb -hebrew_lamed 3308 0x0cec -hebrew_finalmem 3309 0x0ced -hebrew_mem 3310 0x0cee -hebrew_finalnun 3311 0x0cef -hebrew_nun 3312 0x0cf0 -hebrew_samekh 3313 0x0cf1 -hebrew_ayin 3314 0x0cf2 -hebrew_finalpe 3315 0x0cf3 -hebrew_pe 3316 0x0cf4 -hebrew_finalzadi 3317 0x0cf5 -hebrew_zadi 3318 0x0cf6 -hebrew_kuf 3319 0x0cf7 -hebrew_resh 3320 0x0cf8 -hebrew_shin 3321 0x0cf9 -hebrew_taf 3322 0x0cfa -BackSpace 65288 0xff08 -Tab 65289 0xff09 -Linefeed 65290 0xff0a -Clear 65291 0xff0b -Return 65293 0xff0d -Pause 65299 0xff13 -Scroll_Lock 65300 0xff14 -Sys_Req 65301 0xff15 -Escape 65307 0xff1b -Multi_key 65312 0xff20 -Kanji 65313 0xff21 -Home 65360 0xff50 -Left 65361 0xff51 -Up 65362 0xff52 -Right 65363 0xff53 -Down 65364 0xff54 -Prior 65365 0xff55 -Next 65366 0xff56 -End 65367 0xff57 -Begin 65368 0xff58 -Win_L 65371 0xff5b -Win_R 65372 0xff5c -.CE -.CS -App 65373 0xff5d -Select 65376 0xff60 -Print 65377 0xff61 -Execute 65378 0xff62 -Insert 65379 0xff63 -Undo 65381 0xff65 -Redo 65382 0xff66 -Menu 65383 0xff67 -Find 65384 0xff68 -Cancel 65385 0xff69 -Help 65386 0xff6a -Break 65387 0xff6b -Hebrew_switch 65406 0xff7e -Num_Lock 65407 0xff7f -KP_Space 65408 0xff80 -KP_Tab 65417 0xff89 -KP_Enter 65421 0xff8d -KP_F1 65425 0xff91 -KP_F2 65426 0xff92 -KP_F3 65427 0xff93 -KP_F4 65428 0xff94 -KP_Multiply 65450 0xffaa -KP_Add 65451 0xffab -KP_Separator 65452 0xffac -KP_Subtract 65453 0xffad -KP_Decimal 65454 0xffae -KP_Divide 65455 0xffaf -KP_0 65456 0xffb0 -KP_1 65457 0xffb1 -KP_2 65458 0xffb2 -KP_3 65459 0xffb3 -KP_4 65460 0xffb4 -KP_5 65461 0xffb5 -KP_6 65462 0xffb6 -KP_7 65463 0xffb7 -KP_8 65464 0xffb8 -KP_9 65465 0xffb9 -KP_Equal 65469 0xffbd -F1 65470 0xffbe -F2 65471 0xffbf -F3 65472 0xffc0 -F4 65473 0xffc1 -F5 65474 0xffc2 -F6 65475 0xffc3 -F7 65476 0xffc4 -F8 65477 0xffc5 -F9 65478 0xffc6 -F10 65479 0xffc7 -L1 65480 0xffc8 -L2 65481 0xffc9 -L3 65482 0xffca -L4 65483 0xffcb -L5 65484 0xffcc -L6 65485 0xffcd -L7 65486 0xffce -L8 65487 0xffcf -L9 65488 0xffd0 -L10 65489 0xffd1 -R1 65490 0xffd2 -R2 65491 0xffd3 -R3 65492 0xffd4 -R4 65493 0xffd5 -R5 65494 0xffd6 -R6 65495 0xffd7 -R7 65496 0xffd8 -R8 65497 0xffd9 -R9 65498 0xffda -R10 65499 0xffdb -R11 65500 0xffdc -R12 65501 0xffdd -F33 65502 0xffde -R14 65503 0xffdf -R15 65504 0xffe0 -Shift_L 65505 0xffe1 -Shift_R 65506 0xffe2 -Control_L 65507 0xffe3 -Control_R 65508 0xffe4 -Caps_Lock 65509 0xffe5 -Shift_Lock 65510 0xffe6 -Meta_L 65511 0xffe7 -Meta_R 65512 0xffe8 -Alt_L 65513 0xffe9 -Alt_R 65514 0xffea -Super_L 65515 0xffeb -Super_R 65516 0xffec -Hyper_L 65517 0xffed -Hyper_R 65518 0xffee -Delete 65535 0xffff -.CE - -.SH "SEE ALSO" -bind - -.SH KEYWORDS -keysym, bind, binding +'\" -*- nroff -*- +'\" +'\" Copyright (c) 1998-2000 by Scriptics Corporation. +'\" All rights reserved. +'\" +'\" RCS: @(#) $Id: keysyms.n,v 1.5 2008/06/30 22:57:02 dkf Exp $ +'\" +'\" +.so man.macros +.TH keysyms n 8.3 Tk "Tk Built-In Commands" +.BS +'\" Note: do not modify the .SH NAME line immediately below! +.SH NAME +keysyms \- keysyms recognized by Tk +.BE +.SH DESCRIPTION +.PP +Tk recognizes many keysyms when specifying key bindings (e.g. +\fBbind . \fR). The following list enumerates the +keysyms that will be recognized by Tk. Note that not all keysyms will +be valid on all platforms. For example, on Unix systems, the presence +of a particular keysym is dependant on the configuration of the +keyboard modifier map. This list shows keysyms along with their +decimal and hexadecimal values. +.PP +.CS +space 32 0x0020 +exclam 33 0x0021 +quotedbl 34 0x0022 +numbersign 35 0x0023 +dollar 36 0x0024 +percent 37 0x0025 +ampersand 38 0x0026 +quoteright 39 0x0027 +parenleft 40 0x0028 +parenright 41 0x0029 +asterisk 42 0x002a +plus 43 0x002b +comma 44 0x002c +minus 45 0x002d +period 46 0x002e +slash 47 0x002f +0 48 0x0030 +1 49 0x0031 +2 50 0x0032 +3 51 0x0033 +4 52 0x0034 +5 53 0x0035 +6 54 0x0036 +7 55 0x0037 +8 56 0x0038 +9 57 0x0039 +colon 58 0x003a +semicolon 59 0x003b +less 60 0x003c +equal 61 0x003d +greater 62 0x003e +question 63 0x003f +at 64 0x0040 +A 65 0x0041 +B 66 0x0042 +C 67 0x0043 +D 68 0x0044 +E 69 0x0045 +F 70 0x0046 +G 71 0x0047 +H 72 0x0048 +I 73 0x0049 +J 74 0x004a +K 75 0x004b +L 76 0x004c +M 77 0x004d +N 78 0x004e +O 79 0x004f +P 80 0x0050 +Q 81 0x0051 +R 82 0x0052 +S 83 0x0053 +T 84 0x0054 +U 85 0x0055 +V 86 0x0056 +W 87 0x0057 +X 88 0x0058 +Y 89 0x0059 +Z 90 0x005a +bracketleft 91 0x005b +backslash 92 0x005c +bracketright 93 0x005d +asciicircum 94 0x005e +underscore 95 0x005f +quoteleft 96 0x0060 +a 97 0x0061 +b 98 0x0062 +c 99 0x0063 +d 100 0x0064 +e 101 0x0065 +f 102 0x0066 +g 103 0x0067 +h 104 0x0068 +i 105 0x0069 +j 106 0x006a +k 107 0x006b +l 108 0x006c +m 109 0x006d +n 110 0x006e +o 111 0x006f +p 112 0x0070 +q 113 0x0071 +r 114 0x0072 +s 115 0x0073 +t 116 0x0074 +u 117 0x0075 +v 118 0x0076 +w 119 0x0077 +x 120 0x0078 +y 121 0x0079 +z 122 0x007a +braceleft 123 0x007b +bar 124 0x007c +braceright 125 0x007d +asciitilde 126 0x007e +nobreakspace 160 0x00a0 +exclamdown 161 0x00a1 +cent 162 0x00a2 +sterling 163 0x00a3 +currency 164 0x00a4 +yen 165 0x00a5 +brokenbar 166 0x00a6 +section 167 0x00a7 +diaeresis 168 0x00a8 +copyright 169 0x00a9 +ordfeminine 170 0x00aa +guillemotleft 171 0x00ab +notsign 172 0x00ac +hyphen 173 0x00ad +registered 174 0x00ae +macron 175 0x00af +degree 176 0x00b0 +plusminus 177 0x00b1 +twosuperior 178 0x00b2 +threesuperior 179 0x00b3 +acute 180 0x00b4 +mu 181 0x00b5 +paragraph 182 0x00b6 +periodcentered 183 0x00b7 +cedilla 184 0x00b8 +onesuperior 185 0x00b9 +masculine 186 0x00ba +guillemotright 187 0x00bb +onequarter 188 0x00bc +onehalf 189 0x00bd +threequarters 190 0x00be +questiondown 191 0x00bf +Agrave 192 0x00c0 +Aacute 193 0x00c1 +Acircumflex 194 0x00c2 +Atilde 195 0x00c3 +Adiaeresis 196 0x00c4 +Aring 197 0x00c5 +AE 198 0x00c6 +Ccedilla 199 0x00c7 +Egrave 200 0x00c8 +Eacute 201 0x00c9 +Ecircumflex 202 0x00ca +Ediaeresis 203 0x00cb +Igrave 204 0x00cc +Iacute 205 0x00cd +Icircumflex 206 0x00ce +Idiaeresis 207 0x00cf +Eth 208 0x00d0 +Ntilde 209 0x00d1 +Ograve 210 0x00d2 +Oacute 211 0x00d3 +Ocircumflex 212 0x00d4 +Otilde 213 0x00d5 +Odiaeresis 214 0x00d6 +multiply 215 0x00d7 +Ooblique 216 0x00d8 +Ugrave 217 0x00d9 +Uacute 218 0x00da +Ucircumflex 219 0x00db +Udiaeresis 220 0x00dc +Yacute 221 0x00dd +Thorn 222 0x00de +ssharp 223 0x00df +agrave 224 0x00e0 +aacute 225 0x00e1 +acircumflex 226 0x00e2 +atilde 227 0x00e3 +adiaeresis 228 0x00e4 +aring 229 0x00e5 +ae 230 0x00e6 +ccedilla 231 0x00e7 +egrave 232 0x00e8 +eacute 233 0x00e9 +ecircumflex 234 0x00ea +ediaeresis 235 0x00eb +igrave 236 0x00ec +iacute 237 0x00ed +icircumflex 238 0x00ee +idiaeresis 239 0x00ef +eth 240 0x00f0 +ntilde 241 0x00f1 +ograve 242 0x00f2 +oacute 243 0x00f3 +ocircumflex 244 0x00f4 +otilde 245 0x00f5 +odiaeresis 246 0x00f6 +division 247 0x00f7 +oslash 248 0x00f8 +ugrave 249 0x00f9 +uacute 250 0x00fa +ucircumflex 251 0x00fb +udiaeresis 252 0x00fc +yacute 253 0x00fd +thorn 254 0x00fe +ydiaeresis 255 0x00ff +Aogonek 417 0x01a1 +breve 418 0x01a2 +Lstroke 419 0x01a3 +Lcaron 421 0x01a5 +Sacute 422 0x01a6 +Scaron 425 0x01a9 +Scedilla 426 0x01aa +Tcaron 427 0x01ab +Zacute 428 0x01ac +.CE +.CS +Zcaron 430 0x01ae +Zabovedot 431 0x01af +aogonek 433 0x01b1 +ogonek 434 0x01b2 +lstroke 435 0x01b3 +lcaron 437 0x01b5 +sacute 438 0x01b6 +caron 439 0x01b7 +scaron 441 0x01b9 +scedilla 442 0x01ba +tcaron 443 0x01bb +zacute 444 0x01bc +doubleacute 445 0x01bd +zcaron 446 0x01be +zabovedot 447 0x01bf +Racute 448 0x01c0 +Abreve 451 0x01c3 +Cacute 454 0x01c6 +Ccaron 456 0x01c8 +Eogonek 458 0x01ca +Ecaron 460 0x01cc +Dcaron 463 0x01cf +Nacute 465 0x01d1 +Ncaron 466 0x01d2 +Odoubleacute 469 0x01d5 +Rcaron 472 0x01d8 +Uring 473 0x01d9 +Udoubleacute 475 0x01db +Tcedilla 478 0x01de +racute 480 0x01e0 +abreve 483 0x01e3 +cacute 486 0x01e6 +ccaron 488 0x01e8 +eogonek 490 0x01ea +ecaron 492 0x01ec +dcaron 495 0x01ef +nacute 497 0x01f1 +ncaron 498 0x01f2 +odoubleacute 501 0x01f5 +rcaron 504 0x01f8 +uring 505 0x01f9 +udoubleacute 507 0x01fb +tcedilla 510 0x01fe +abovedot 511 0x01ff +Hstroke 673 0x02a1 +Hcircumflex 678 0x02a6 +Iabovedot 681 0x02a9 +Gbreve 683 0x02ab +Jcircumflex 684 0x02ac +hstroke 689 0x02b1 +hcircumflex 694 0x02b6 +idotless 697 0x02b9 +gbreve 699 0x02bb +jcircumflex 700 0x02bc +Cabovedot 709 0x02c5 +Ccircumflex 710 0x02c6 +Gabovedot 725 0x02d5 +Gcircumflex 728 0x02d8 +Ubreve 733 0x02dd +Scircumflex 734 0x02de +cabovedot 741 0x02e5 +ccircumflex 742 0x02e6 +gabovedot 757 0x02f5 +gcircumflex 760 0x02f8 +ubreve 765 0x02fd +scircumflex 766 0x02fe +kappa 930 0x03a2 +Rcedilla 931 0x03a3 +Itilde 933 0x03a5 +Lcedilla 934 0x03a6 +Emacron 938 0x03aa +Gcedilla 939 0x03ab +Tslash 940 0x03ac +rcedilla 947 0x03b3 +itilde 949 0x03b5 +lcedilla 950 0x03b6 +emacron 954 0x03ba +gacute 955 0x03bb +tslash 956 0x03bc +ENG 957 0x03bd +eng 959 0x03bf +Amacron 960 0x03c0 +Iogonek 967 0x03c7 +Eabovedot 972 0x03cc +Imacron 975 0x03cf +Ncedilla 977 0x03d1 +Omacron 978 0x03d2 +Kcedilla 979 0x03d3 +Uogonek 985 0x03d9 +Utilde 989 0x03dd +Umacron 990 0x03de +amacron 992 0x03e0 +iogonek 999 0x03e7 +eabovedot 1004 0x03ec +imacron 1007 0x03ef +ncedilla 1009 0x03f1 +omacron 1010 0x03f2 +kcedilla 1011 0x03f3 +uogonek 1017 0x03f9 +utilde 1021 0x03fd +umacron 1022 0x03fe +overline 1150 0x047e +kana_fullstop 1185 0x04a1 +kana_openingbracket 1186 0x04a2 +kana_closingbracket 1187 0x04a3 +kana_comma 1188 0x04a4 +kana_middledot 1189 0x04a5 +kana_WO 1190 0x04a6 +kana_a 1191 0x04a7 +kana_i 1192 0x04a8 +kana_u 1193 0x04a9 +kana_e 1194 0x04aa +kana_o 1195 0x04ab +kana_ya 1196 0x04ac +kana_yu 1197 0x04ad +kana_yo 1198 0x04ae +kana_tu 1199 0x04af +prolongedsound 1200 0x04b0 +kana_A 1201 0x04b1 +kana_I 1202 0x04b2 +kana_U 1203 0x04b3 +kana_E 1204 0x04b4 +kana_O 1205 0x04b5 +kana_KA 1206 0x04b6 +kana_KI 1207 0x04b7 +kana_KU 1208 0x04b8 +kana_KE 1209 0x04b9 +kana_KO 1210 0x04ba +kana_SA 1211 0x04bb +kana_SHI 1212 0x04bc +kana_SU 1213 0x04bd +kana_SE 1214 0x04be +kana_SO 1215 0x04bf +kana_TA 1216 0x04c0 +kana_TI 1217 0x04c1 +kana_TU 1218 0x04c2 +kana_TE 1219 0x04c3 +kana_TO 1220 0x04c4 +kana_NA 1221 0x04c5 +kana_NI 1222 0x04c6 +kana_NU 1223 0x04c7 +kana_NE 1224 0x04c8 +kana_NO 1225 0x04c9 +kana_HA 1226 0x04ca +kana_HI 1227 0x04cb +kana_HU 1228 0x04cc +kana_HE 1229 0x04cd +kana_HO 1230 0x04ce +kana_MA 1231 0x04cf +kana_MI 1232 0x04d0 +kana_MU 1233 0x04d1 +kana_ME 1234 0x04d2 +kana_MO 1235 0x04d3 +kana_YA 1236 0x04d4 +kana_YU 1237 0x04d5 +kana_YO 1238 0x04d6 +kana_RA 1239 0x04d7 +kana_RI 1240 0x04d8 +kana_RU 1241 0x04d9 +kana_RE 1242 0x04da +kana_RO 1243 0x04db +kana_WA 1244 0x04dc +kana_N 1245 0x04dd +voicedsound 1246 0x04de +semivoicedsound 1247 0x04df +Arabic_comma 1452 0x05ac +Arabic_semicolon 1467 0x05bb +Arabic_question_mark 1471 0x05bf +Arabic_hamza 1473 0x05c1 +Arabic_maddaonalef 1474 0x05c2 +Arabic_hamzaonalef 1475 0x05c3 +Arabic_hamzaonwaw 1476 0x05c4 +Arabic_hamzaunderalef 1477 0x05c5 +Arabic_hamzaonyeh 1478 0x05c6 +Arabic_alef 1479 0x05c7 +Arabic_beh 1480 0x05c8 +Arabic_tehmarbuta 1481 0x05c9 +Arabic_teh 1482 0x05ca +Arabic_theh 1483 0x05cb +Arabic_jeem 1484 0x05cc +Arabic_hah 1485 0x05cd +Arabic_khah 1486 0x05ce +Arabic_dal 1487 0x05cf +Arabic_thal 1488 0x05d0 +Arabic_ra 1489 0x05d1 +Arabic_zain 1490 0x05d2 +Arabic_seen 1491 0x05d3 +Arabic_sheen 1492 0x05d4 +Arabic_sad 1493 0x05d5 +Arabic_dad 1494 0x05d6 +Arabic_tah 1495 0x05d7 +Arabic_zah 1496 0x05d8 +Arabic_ain 1497 0x05d9 +Arabic_ghain 1498 0x05da +Arabic_tatweel 1504 0x05e0 +Arabic_feh 1505 0x05e1 +Arabic_qaf 1506 0x05e2 +Arabic_kaf 1507 0x05e3 +Arabic_lam 1508 0x05e4 +Arabic_meem 1509 0x05e5 +.CE +.CS +Arabic_noon 1510 0x05e6 +Arabic_heh 1511 0x05e7 +Arabic_waw 1512 0x05e8 +Arabic_alefmaksura 1513 0x05e9 +Arabic_yeh 1514 0x05ea +Arabic_fathatan 1515 0x05eb +Arabic_dammatan 1516 0x05ec +Arabic_kasratan 1517 0x05ed +Arabic_fatha 1518 0x05ee +Arabic_damma 1519 0x05ef +Arabic_kasra 1520 0x05f0 +Arabic_shadda 1521 0x05f1 +Arabic_sukun 1522 0x05f2 +Serbian_dje 1697 0x06a1 +Macedonia_gje 1698 0x06a2 +Cyrillic_io 1699 0x06a3 +Ukranian_je 1700 0x06a4 +Macedonia_dse 1701 0x06a5 +Ukranian_i 1702 0x06a6 +Ukranian_yi 1703 0x06a7 +Serbian_je 1704 0x06a8 +Serbian_lje 1705 0x06a9 +Serbian_nje 1706 0x06aa +Serbian_tshe 1707 0x06ab +Macedonia_kje 1708 0x06ac +Byelorussian_shortu 1710 0x06ae +Serbian_dze 1711 0x06af +numerosign 1712 0x06b0 +Serbian_DJE 1713 0x06b1 +Macedonia_GJE 1714 0x06b2 +Cyrillic_IO 1715 0x06b3 +Ukranian_JE 1716 0x06b4 +Macedonia_DSE 1717 0x06b5 +Ukranian_I 1718 0x06b6 +Ukranian_YI 1719 0x06b7 +Serbian_JE 1720 0x06b8 +Serbian_LJE 1721 0x06b9 +Serbian_NJE 1722 0x06ba +Serbian_TSHE 1723 0x06bb +Macedonia_KJE 1724 0x06bc +Byelorussian_SHORTU 1726 0x06be +Serbian_DZE 1727 0x06bf +Cyrillic_yu 1728 0x06c0 +Cyrillic_a 1729 0x06c1 +Cyrillic_be 1730 0x06c2 +Cyrillic_tse 1731 0x06c3 +Cyrillic_de 1732 0x06c4 +Cyrillic_ie 1733 0x06c5 +Cyrillic_ef 1734 0x06c6 +Cyrillic_ghe 1735 0x06c7 +Cyrillic_ha 1736 0x06c8 +Cyrillic_i 1737 0x06c9 +Cyrillic_shorti 1738 0x06ca +Cyrillic_ka 1739 0x06cb +Cyrillic_el 1740 0x06cc +Cyrillic_em 1741 0x06cd +Cyrillic_en 1742 0x06ce +Cyrillic_o 1743 0x06cf +Cyrillic_pe 1744 0x06d0 +Cyrillic_ya 1745 0x06d1 +Cyrillic_er 1746 0x06d2 +Cyrillic_es 1747 0x06d3 +Cyrillic_te 1748 0x06d4 +Cyrillic_u 1749 0x06d5 +Cyrillic_zhe 1750 0x06d6 +Cyrillic_ve 1751 0x06d7 +Cyrillic_softsign 1752 0x06d8 +Cyrillic_yeru 1753 0x06d9 +Cyrillic_ze 1754 0x06da +Cyrillic_sha 1755 0x06db +Cyrillic_e 1756 0x06dc +Cyrillic_shcha 1757 0x06dd +Cyrillic_che 1758 0x06de +Cyrillic_hardsign 1759 0x06df +Cyrillic_YU 1760 0x06e0 +Cyrillic_A 1761 0x06e1 +Cyrillic_BE 1762 0x06e2 +Cyrillic_TSE 1763 0x06e3 +Cyrillic_DE 1764 0x06e4 +Cyrillic_IE 1765 0x06e5 +Cyrillic_EF 1766 0x06e6 +Cyrillic_GHE 1767 0x06e7 +Cyrillic_HA 1768 0x06e8 +Cyrillic_I 1769 0x06e9 +Cyrillic_SHORTI 1770 0x06ea +Cyrillic_KA 1771 0x06eb +Cyrillic_EL 1772 0x06ec +Cyrillic_EM 1773 0x06ed +Cyrillic_EN 1774 0x06ee +Cyrillic_O 1775 0x06ef +Cyrillic_PE 1776 0x06f0 +Cyrillic_YA 1777 0x06f1 +Cyrillic_ER 1778 0x06f2 +Cyrillic_ES 1779 0x06f3 +Cyrillic_TE 1780 0x06f4 +Cyrillic_U 1781 0x06f5 +Cyrillic_ZHE 1782 0x06f6 +Cyrillic_VE 1783 0x06f7 +Cyrillic_SOFTSIGN 1784 0x06f8 +Cyrillic_YERU 1785 0x06f9 +Cyrillic_ZE 1786 0x06fa +Cyrillic_SHA 1787 0x06fb +Cyrillic_E 1788 0x06fc +Cyrillic_SHCHA 1789 0x06fd +Cyrillic_CHE 1790 0x06fe +Cyrillic_HARDSIGN 1791 0x06ff +Greek_ALPHAaccent 1953 0x07a1 +Greek_EPSILONaccent 1954 0x07a2 +Greek_ETAaccent 1955 0x07a3 +Greek_IOTAaccent 1956 0x07a4 +Greek_IOTAdiaeresis 1957 0x07a5 +Greek_IOTAaccentdiaeresis 1958 0x07a6 +Greek_OMICRONaccent 1959 0x07a7 +Greek_UPSILONaccent 1960 0x07a8 +Greek_UPSILONdieresis 1961 0x07a9 +Greek_UPSILONaccentdieresis 1962 0x07aa +Greek_OMEGAaccent 1963 0x07ab +Greek_alphaaccent 1969 0x07b1 +Greek_epsilonaccent 1970 0x07b2 +Greek_etaaccent 1971 0x07b3 +Greek_iotaaccent 1972 0x07b4 +Greek_iotadieresis 1973 0x07b5 +Greek_iotaaccentdieresis 1974 0x07b6 +Greek_omicronaccent 1975 0x07b7 +Greek_upsilonaccent 1976 0x07b8 +Greek_upsilondieresis 1977 0x07b9 +Greek_upsilonaccentdieresis 1978 0x07ba +Greek_omegaaccent 1979 0x07bb +Greek_ALPHA 1985 0x07c1 +Greek_BETA 1986 0x07c2 +Greek_GAMMA 1987 0x07c3 +Greek_DELTA 1988 0x07c4 +Greek_EPSILON 1989 0x07c5 +Greek_ZETA 1990 0x07c6 +Greek_ETA 1991 0x07c7 +Greek_THETA 1992 0x07c8 +Greek_IOTA 1993 0x07c9 +Greek_KAPPA 1994 0x07ca +Greek_LAMBDA 1995 0x07cb +Greek_MU 1996 0x07cc +Greek_NU 1997 0x07cd +Greek_XI 1998 0x07ce +Greek_OMICRON 1999 0x07cf +Greek_PI 2000 0x07d0 +Greek_RHO 2001 0x07d1 +Greek_SIGMA 2002 0x07d2 +Greek_TAU 2004 0x07d4 +Greek_UPSILON 2005 0x07d5 +Greek_PHI 2006 0x07d6 +Greek_CHI 2007 0x07d7 +Greek_PSI 2008 0x07d8 +Greek_OMEGA 2009 0x07d9 +Greek_alpha 2017 0x07e1 +Greek_beta 2018 0x07e2 +Greek_gamma 2019 0x07e3 +Greek_delta 2020 0x07e4 +Greek_epsilon 2021 0x07e5 +Greek_zeta 2022 0x07e6 +Greek_eta 2023 0x07e7 +Greek_theta 2024 0x07e8 +Greek_iota 2025 0x07e9 +Greek_kappa 2026 0x07ea +Greek_lambda 2027 0x07eb +Greek_mu 2028 0x07ec +Greek_nu 2029 0x07ed +Greek_xi 2030 0x07ee +Greek_omicron 2031 0x07ef +Greek_pi 2032 0x07f0 +Greek_rho 2033 0x07f1 +Greek_sigma 2034 0x07f2 +Greek_finalsmallsigma 2035 0x07f3 +Greek_tau 2036 0x07f4 +Greek_upsilon 2037 0x07f5 +Greek_phi 2038 0x07f6 +Greek_chi 2039 0x07f7 +Greek_psi 2040 0x07f8 +Greek_omega 2041 0x07f9 +leftradical 2209 0x08a1 +topleftradical 2210 0x08a2 +horizconnector 2211 0x08a3 +topintegral 2212 0x08a4 +botintegral 2213 0x08a5 +vertconnector 2214 0x08a6 +topleftsqbracket 2215 0x08a7 +botleftsqbracket 2216 0x08a8 +toprightsqbracket 2217 0x08a9 +botrightsqbracket 2218 0x08aa +topleftparens 2219 0x08ab +botleftparens 2220 0x08ac +toprightparens 2221 0x08ad +botrightparens 2222 0x08ae +leftmiddlecurlybrace 2223 0x08af +rightmiddlecurlybrace 2224 0x08b0 +topleftsummation 2225 0x08b1 +botleftsummation 2226 0x08b2 +topvertsummationconnector 2227 0x08b3 +botvertsummationconnector 2228 0x08b4 +toprightsummation 2229 0x08b5 +botrightsummation 2230 0x08b6 +rightmiddlesummation 2231 0x08b7 +.CE +.CS +lessthanequal 2236 0x08bc +notequal 2237 0x08bd +greaterthanequal 2238 0x08be +integral 2239 0x08bf +therefore 2240 0x08c0 +variation 2241 0x08c1 +infinity 2242 0x08c2 +nabla 2245 0x08c5 +approximate 2248 0x08c8 +similarequal 2249 0x08c9 +ifonlyif 2253 0x08cd +implies 2254 0x08ce +identical 2255 0x08cf +radical 2262 0x08d6 +includedin 2266 0x08da +includes 2267 0x08db +intersection 2268 0x08dc +union 2269 0x08dd +logicaland 2270 0x08de +logicalor 2271 0x08df +partialderivative 2287 0x08ef +function 2294 0x08f6 +leftarrow 2299 0x08fb +uparrow 2300 0x08fc +rightarrow 2301 0x08fd +downarrow 2302 0x08fe +blank 2527 0x09df +soliddiamond 2528 0x09e0 +checkerboard 2529 0x09e1 +ht 2530 0x09e2 +ff 2531 0x09e3 +cr 2532 0x09e4 +lf 2533 0x09e5 +nl 2536 0x09e8 +vt 2537 0x09e9 +lowrightcorner 2538 0x09ea +uprightcorner 2539 0x09eb +upleftcorner 2540 0x09ec +lowleftcorner 2541 0x09ed +crossinglines 2542 0x09ee +horizlinescan1 2543 0x09ef +horizlinescan3 2544 0x09f0 +horizlinescan5 2545 0x09f1 +horizlinescan7 2546 0x09f2 +horizlinescan9 2547 0x09f3 +leftt 2548 0x09f4 +rightt 2549 0x09f5 +bott 2550 0x09f6 +topt 2551 0x09f7 +vertbar 2552 0x09f8 +emspace 2721 0x0aa1 +enspace 2722 0x0aa2 +em3space 2723 0x0aa3 +em4space 2724 0x0aa4 +digitspace 2725 0x0aa5 +punctspace 2726 0x0aa6 +thinspace 2727 0x0aa7 +hairspace 2728 0x0aa8 +emdash 2729 0x0aa9 +endash 2730 0x0aaa +signifblank 2732 0x0aac +ellipsis 2734 0x0aae +doubbaselinedot 2735 0x0aaf +onethird 2736 0x0ab0 +twothirds 2737 0x0ab1 +onefifth 2738 0x0ab2 +twofifths 2739 0x0ab3 +threefifths 2740 0x0ab4 +fourfifths 2741 0x0ab5 +onesixth 2742 0x0ab6 +fivesixths 2743 0x0ab7 +careof 2744 0x0ab8 +figdash 2747 0x0abb +leftanglebracket 2748 0x0abc +decimalpoint 2749 0x0abd +rightanglebracket 2750 0x0abe +marker 2751 0x0abf +oneeighth 2755 0x0ac3 +threeeighths 2756 0x0ac4 +fiveeighths 2757 0x0ac5 +seveneighths 2758 0x0ac6 +trademark 2761 0x0ac9 +signaturemark 2762 0x0aca +trademarkincircle 2763 0x0acb +leftopentriangle 2764 0x0acc +rightopentriangle 2765 0x0acd +emopencircle 2766 0x0ace +emopenrectangle 2767 0x0acf +leftsinglequotemark 2768 0x0ad0 +rightsinglequotemark 2769 0x0ad1 +leftdoublequotemark 2770 0x0ad2 +rightdoublequotemark 2771 0x0ad3 +prescription 2772 0x0ad4 +minutes 2774 0x0ad6 +seconds 2775 0x0ad7 +latincross 2777 0x0ad9 +hexagram 2778 0x0ada +filledrectbullet 2779 0x0adb +filledlefttribullet 2780 0x0adc +filledrighttribullet 2781 0x0add +emfilledcircle 2782 0x0ade +emfilledrect 2783 0x0adf +enopencircbullet 2784 0x0ae0 +enopensquarebullet 2785 0x0ae1 +openrectbullet 2786 0x0ae2 +opentribulletup 2787 0x0ae3 +opentribulletdown 2788 0x0ae4 +openstar 2789 0x0ae5 +enfilledcircbullet 2790 0x0ae6 +enfilledsqbullet 2791 0x0ae7 +filledtribulletup 2792 0x0ae8 +filledtribulletdown 2793 0x0ae9 +leftpointer 2794 0x0aea +rightpointer 2795 0x0aeb +club 2796 0x0aec +diamond 2797 0x0aed +heart 2798 0x0aee +maltesecross 2800 0x0af0 +dagger 2801 0x0af1 +doubledagger 2802 0x0af2 +checkmark 2803 0x0af3 +ballotcross 2804 0x0af4 +musicalsharp 2805 0x0af5 +musicalflat 2806 0x0af6 +malesymbol 2807 0x0af7 +femalesymbol 2808 0x0af8 +telephone 2809 0x0af9 +telephonerecorder 2810 0x0afa +phonographcopyright 2811 0x0afb +caret 2812 0x0afc +singlelowquotemark 2813 0x0afd +doublelowquotemark 2814 0x0afe +cursor 2815 0x0aff +leftcaret 2979 0x0ba3 +rightcaret 2982 0x0ba6 +downcaret 2984 0x0ba8 +upcaret 2985 0x0ba9 +overbar 3008 0x0bc0 +downtack 3010 0x0bc2 +upshoe 3011 0x0bc3 +downstile 3012 0x0bc4 +underbar 3014 0x0bc6 +jot 3018 0x0bca +quad 3020 0x0bcc +uptack 3022 0x0bce +circle 3023 0x0bcf +upstile 3027 0x0bd3 +downshoe 3030 0x0bd6 +rightshoe 3032 0x0bd8 +leftshoe 3034 0x0bda +lefttack 3036 0x0bdc +righttack 3068 0x0bfc +hebrew_aleph 3296 0x0ce0 +hebrew_beth 3297 0x0ce1 +hebrew_gimmel 3298 0x0ce2 +hebrew_daleth 3299 0x0ce3 +hebrew_he 3300 0x0ce4 +hebrew_waw 3301 0x0ce5 +hebrew_zayin 3302 0x0ce6 +hebrew_het 3303 0x0ce7 +hebrew_teth 3304 0x0ce8 +hebrew_yod 3305 0x0ce9 +hebrew_finalkaph 3306 0x0cea +hebrew_kaph 3307 0x0ceb +hebrew_lamed 3308 0x0cec +hebrew_finalmem 3309 0x0ced +hebrew_mem 3310 0x0cee +hebrew_finalnun 3311 0x0cef +hebrew_nun 3312 0x0cf0 +hebrew_samekh 3313 0x0cf1 +hebrew_ayin 3314 0x0cf2 +hebrew_finalpe 3315 0x0cf3 +hebrew_pe 3316 0x0cf4 +hebrew_finalzadi 3317 0x0cf5 +hebrew_zadi 3318 0x0cf6 +hebrew_kuf 3319 0x0cf7 +hebrew_resh 3320 0x0cf8 +hebrew_shin 3321 0x0cf9 +hebrew_taf 3322 0x0cfa +BackSpace 65288 0xff08 +Tab 65289 0xff09 +Linefeed 65290 0xff0a +Clear 65291 0xff0b +Return 65293 0xff0d +Pause 65299 0xff13 +Scroll_Lock 65300 0xff14 +Sys_Req 65301 0xff15 +Escape 65307 0xff1b +Multi_key 65312 0xff20 +Kanji 65313 0xff21 +Home 65360 0xff50 +Left 65361 0xff51 +Up 65362 0xff52 +Right 65363 0xff53 +Down 65364 0xff54 +Prior 65365 0xff55 +Next 65366 0xff56 +End 65367 0xff57 +Begin 65368 0xff58 +Win_L 65371 0xff5b +Win_R 65372 0xff5c +.CE +.CS +App 65373 0xff5d +Select 65376 0xff60 +Print 65377 0xff61 +Execute 65378 0xff62 +Insert 65379 0xff63 +Undo 65381 0xff65 +Redo 65382 0xff66 +Menu 65383 0xff67 +Find 65384 0xff68 +Cancel 65385 0xff69 +Help 65386 0xff6a +Break 65387 0xff6b +Hebrew_switch 65406 0xff7e +Num_Lock 65407 0xff7f +KP_Space 65408 0xff80 +KP_Tab 65417 0xff89 +KP_Enter 65421 0xff8d +KP_F1 65425 0xff91 +KP_F2 65426 0xff92 +KP_F3 65427 0xff93 +KP_F4 65428 0xff94 +KP_Multiply 65450 0xffaa +KP_Add 65451 0xffab +KP_Separator 65452 0xffac +KP_Subtract 65453 0xffad +KP_Decimal 65454 0xffae +KP_Divide 65455 0xffaf +KP_0 65456 0xffb0 +KP_1 65457 0xffb1 +KP_2 65458 0xffb2 +KP_3 65459 0xffb3 +KP_4 65460 0xffb4 +KP_5 65461 0xffb5 +KP_6 65462 0xffb6 +KP_7 65463 0xffb7 +KP_8 65464 0xffb8 +KP_9 65465 0xffb9 +KP_Equal 65469 0xffbd +F1 65470 0xffbe +F2 65471 0xffbf +F3 65472 0xffc0 +F4 65473 0xffc1 +F5 65474 0xffc2 +F6 65475 0xffc3 +F7 65476 0xffc4 +F8 65477 0xffc5 +F9 65478 0xffc6 +F10 65479 0xffc7 +L1 65480 0xffc8 +L2 65481 0xffc9 +L3 65482 0xffca +L4 65483 0xffcb +L5 65484 0xffcc +L6 65485 0xffcd +L7 65486 0xffce +L8 65487 0xffcf +L9 65488 0xffd0 +L10 65489 0xffd1 +R1 65490 0xffd2 +R2 65491 0xffd3 +R3 65492 0xffd4 +R4 65493 0xffd5 +R5 65494 0xffd6 +R6 65495 0xffd7 +R7 65496 0xffd8 +R8 65497 0xffd9 +R9 65498 0xffda +R10 65499 0xffdb +R11 65500 0xffdc +R12 65501 0xffdd +F33 65502 0xffde +R14 65503 0xffdf +R15 65504 0xffe0 +Shift_L 65505 0xffe1 +Shift_R 65506 0xffe2 +Control_L 65507 0xffe3 +Control_R 65508 0xffe4 +Caps_Lock 65509 0xffe5 +Shift_Lock 65510 0xffe6 +Meta_L 65511 0xffe7 +Meta_R 65512 0xffe8 +Alt_L 65513 0xffe9 +Alt_R 65514 0xffea +Super_L 65515 0xffeb +Super_R 65516 0xffec +Hyper_L 65517 0xffed +Hyper_R 65518 0xffee +Delete 65535 0xffff +.CE +.SH "SEE ALSO" +bind +.SH KEYWORDS +keysym, bind, binding diff --git a/doc/label.n b/doc/label.n index bee90c4..1a94f2b 100644 --- a/doc/label.n +++ b/doc/label.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1990-1994 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: label.n,v 1.12 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: label.n,v 1.13 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH label n 4.0 Tk "Tk Built-In Commands" @@ -107,6 +108,7 @@ command. When a new label is created, it has no default event bindings: labels are not intended to be interactive. .SH EXAMPLE +.PP .CS # Make the widgets \fBlabel\fR .t \-text "This widget is at the top" \-bg red diff --git a/doc/labelframe.n b/doc/labelframe.n index 0bdd460..5b60542 100644 --- a/doc/labelframe.n +++ b/doc/labelframe.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1990-1994 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: labelframe.n,v 1.8 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: labelframe.n,v 1.9 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH labelframe n 8.4 Tk "Tk Built-In Commands" @@ -137,6 +138,7 @@ command. When a new labelframe is created, it has no default event bindings: labelframes are not intended to be interactive. .SH EXAMPLE +.PP This shows how to build part of a GUI for a hamburger vendor. The \fBlabelframe\fR widgets are used to organize the available choices by the kinds of things that the choices are being made over. diff --git a/doc/listbox.n b/doc/listbox.n index 1516014..333489f 100644 --- a/doc/listbox.n +++ b/doc/listbox.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1990 The Regents of the University of California. '\" Copyright (c) 1994-1997 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: listbox.n,v 1.18 2008/01/30 12:00:39 dkf Exp $ +'\" RCS: @(#) $Id: listbox.n,v 1.19 2008/06/30 22:57:02 dkf Exp $ '\" .so man.macros .TH listbox n 8.4 Tk "Tk Built-In Commands" @@ -414,10 +415,8 @@ In both modes, clicking button 1 on an element selects it and deselects any other selected item. In \fBbrowse\fR mode it is also possible to drag the selection with button 1. -.VS 8.5 On button 1, the listbox will also take focus if it has a \fBnormal\fR state and \fB\-takefocus\fR is true. -.VE 8.5 .PP If the selection mode is \fBmultiple\fR or \fBextended\fR, any number of elements may be selected at once, including discontiguous diff --git a/doc/loadTk.n b/doc/loadTk.n index 6b0faae..40fa2d5 100644 --- a/doc/loadTk.n +++ b/doc/loadTk.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: loadTk.n,v 1.12 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: loadTk.n,v 1.13 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH "Safe Tk" n 8.0 Tk "Tk Built-In Commands" @@ -44,7 +44,6 @@ the safe interpreter. On X11 if you want the embedded window to use another display than the default one, specify it with \fB\-display\fR. See the \fBSECURITY ISSUES\fR section below for implementation details. - .SH "SECURITY ISSUES" .PP Please read the \fBsafe\fR manual page for Tcl to learn about the basic @@ -70,14 +69,11 @@ interpreter. .PP On X11, conflicting \fB\-use\fR and \fB\-display\fR are likely to generate a fatal X error. - .SH "SEE ALSO" safe(n), interp(n), library(n), load(n), package(n), source(n), unknown(n) - .SH KEYWORDS alias, auto\-loading, auto_mkindex, load, master interpreter, safe interpreter, slave interpreter, source - '\" Local Variables: '\" mode: nroff '\" End: diff --git a/doc/lower.n b/doc/lower.n index ca08b92..6e77207 100644 --- a/doc/lower.n +++ b/doc/lower.n @@ -1,38 +1,36 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: lower.n,v 1.2 1998/09/14 18:22:57 stanton Exp $ -'\" -.so man.macros -.TH lower n 3.3 Tk "Tk Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -lower \- Change a window's position in the stacking order -.SH SYNOPSIS -\fBlower \fIwindow \fR?\fIbelowThis\fR? -.BE - -.SH DESCRIPTION -.PP -If the \fIbelowThis\fR argument is omitted then the command lowers -\fIwindow\fR so that it is below all of its siblings in the stacking -order (it will be obscured by any siblings that overlap it and -will not obscure any siblings). -If \fIbelowThis\fR is specified then it must be the path name of -a window that is either a sibling of \fIwindow\fR or the descendant -of a sibling of \fIwindow\fR. -In this case the \fBlower\fR command will insert -\fIwindow\fR into the stacking order just below \fIbelowThis\fR -(or the ancestor of \fIbelowThis\fR that is a sibling of \fIwindow\fR); -this could end up either raising or lowering \fIwindow\fR. - -.SH "SEE ALSO" -raise - -.SH KEYWORDS -lower, obscure, stacking order +'\" -*- nroff -*- +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: lower.n,v 1.3 2008/06/30 22:57:03 dkf Exp $ +'\" +.so man.macros +.TH lower n 3.3 Tk "Tk Built-In Commands" +.BS +'\" Note: do not modify the .SH NAME line immediately below! +.SH NAME +lower \- Change a window's position in the stacking order +.SH SYNOPSIS +\fBlower \fIwindow \fR?\fIbelowThis\fR? +.BE +.SH DESCRIPTION +.PP +If the \fIbelowThis\fR argument is omitted then the command lowers +\fIwindow\fR so that it is below all of its siblings in the stacking +order (it will be obscured by any siblings that overlap it and +will not obscure any siblings). +If \fIbelowThis\fR is specified then it must be the path name of +a window that is either a sibling of \fIwindow\fR or the descendant +of a sibling of \fIwindow\fR. +In this case the \fBlower\fR command will insert +\fIwindow\fR into the stacking order just below \fIbelowThis\fR +(or the ancestor of \fIbelowThis\fR that is a sibling of \fIwindow\fR); +this could end up either raising or lowering \fIwindow\fR. +.SH "SEE ALSO" +raise +.SH KEYWORDS +lower, obscure, stacking order diff --git a/doc/menu.n b/doc/menu.n index a00d7ff..3766e28 100644 --- a/doc/menu.n +++ b/doc/menu.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1990-1994 The Regents of the University of California. '\" Copyright (c) 1994-1997 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: menu.n,v 1.24 2008/04/20 19:42:34 patthoyts Exp $ +'\" RCS: @(#) $Id: menu.n,v 1.25 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH menu n 4.1 Tk "Tk Built-In Commands" @@ -625,10 +626,8 @@ empty string. This subcommand does not work on Windows and the Macintosh, as those platforms have their own way of unposting menus. .TP \fIpathName \fBxposition \fIindex\fR -.VS 8.5 Returns a decimal string giving the x-coordinate within the menu window of the leftmost pixel in the entry specified by \fIindex\fR. -.VE 8.5 .TP \fIpathName \fByposition \fIindex\fR Returns a decimal string giving the y-coordinate within the menu diff --git a/doc/menubar.n b/doc/menubar.n index f4b98af..bb7c1a8 100644 --- a/doc/menubar.n +++ b/doc/menubar.n @@ -1,40 +1,38 @@ -'\" -'\" Copyright (c) 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. -'\" -'\" RCS: @(#) $Id: menubar.n,v 1.3 2004/06/21 14:45:52 dkf Exp $ -'\" -.so man.macros -.TH tk_menuBar n "" Tk "Tk Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -tk_menuBar, tk_bindForTraversal \- Obsolete support for menu bars -.SH SYNOPSIS -\fBtk_menuBar \fIframe \fR?\fImenu menu ...\fR? -.sp -\fBtk_bindForTraversal \fIarg arg ... \fR -.BE - -.SH DESCRIPTION -.PP -These procedures were used in Tk 3.6 and earlier releases to help -manage pulldown menus and to implement keyboard traversal of menus. -In Tk 4.0 and later releases they are no -longer needed. Stubs for these procedures have been retained for -backward compatibility, but they have no effect. You should remove -calls to these procedures from your code, since eventually the -procedures will go away. -.PP -From Tk 8.0 onwards, you should instead construct your menubar as a -normal \fBmenu\fR and then attach it to the \fBtoplevel\fR of your -choice using the \fB\-menu\fR option of that widget. - -.SH "SEE ALSO" -menu(n), toplevel(n) - -.SH KEYWORDS -keyboard traversal, menu, menu bar, post +'\" -*- nroff -*- +'\" +'\" Copyright (c) 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. +'\" +'\" RCS: @(#) $Id: menubar.n,v 1.4 2008/06/30 22:57:03 dkf Exp $ +'\" +.so man.macros +.TH tk_menuBar n "" Tk "Tk Built-In Commands" +.BS +'\" Note: do not modify the .SH NAME line immediately below! +.SH NAME +tk_menuBar, tk_bindForTraversal \- Obsolete support for menu bars +.SH SYNOPSIS +\fBtk_menuBar \fIframe \fR?\fImenu menu ...\fR? +.sp +\fBtk_bindForTraversal \fIarg arg ... \fR +.BE +.SH DESCRIPTION +.PP +These procedures were used in Tk 3.6 and earlier releases to help +manage pulldown menus and to implement keyboard traversal of menus. +In Tk 4.0 and later releases they are no +longer needed. Stubs for these procedures have been retained for +backward compatibility, but they have no effect. You should remove +calls to these procedures from your code, since eventually the +procedures will go away. +.PP +From Tk 8.0 onwards, you should instead construct your menubar as a +normal \fBmenu\fR and then attach it to the \fBtoplevel\fR of your +choice using the \fB\-menu\fR option of that widget. +.SH "SEE ALSO" +menu(n), toplevel(n) +.SH KEYWORDS +keyboard traversal, menu, menu bar, post diff --git a/doc/menubutton.n b/doc/menubutton.n index 1385c9c..4848f17 100644 --- a/doc/menubutton.n +++ b/doc/menubutton.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1990-1994 The Regents of the University of California. '\" Copyright (c) 1994-1997 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: menubutton.n,v 1.10 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: menubutton.n,v 1.11 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH menubutton n 4.0 Tk "Tk Built-In Commands" diff --git a/doc/message.n b/doc/message.n index 1342ba1..7204432 100644 --- a/doc/message.n +++ b/doc/message.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1990-1994 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: message.n,v 1.9 2008/01/30 12:00:39 dkf Exp $ +'\" RCS: @(#) $Id: message.n,v 1.10 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH message n 4.0 Tk "Tk Built-In Commands" diff --git a/doc/messageBox.n b/doc/messageBox.n index 8aac4d7..00f1ba8 100644 --- a/doc/messageBox.n +++ b/doc/messageBox.n @@ -1,10 +1,11 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 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. '\" -'\" RCS: @(#) $Id: messageBox.n,v 1.10 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: messageBox.n,v 1.11 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH tk_messageBox n 4.2 Tk "Tk Built-In Commands" @@ -15,7 +16,6 @@ tk_messageBox \- pops up a message window and waits for user response. .SH SYNOPSIS \fBtk_messageBox \fR?\fIoption value ...\fR? .BE - .SH DESCRIPTION .PP This procedure creates and displays a message window with an @@ -24,7 +24,7 @@ the buttons in the message window is identified by a unique symbolic name (see the \fB\-type\fR options). After the message window is popped up, \fBtk_messageBox\fR waits for the user to select one of the buttons. Then it returns the symbolic name of the selected button. - +.PP The following option-value pairs are supported: .TP \fB\-default\fR \fIname\fR @@ -32,17 +32,15 @@ The following option-value pairs are supported: this message window ( .QW ok , .QW cancel , -and so on). See \fB\-type\fR +and so on). See \fB\-type\fR for a list of the symbolic names. If this option is not specified, the first button in the dialog will be made the default. .TP \fB\-detail\fR \fIstring\fR -.VS 8.5 Specifies an auxiliary message to the main message given by the \fB\-message\fR option. Where supported by the underlying OS, the message detail will be presented in a less emphasized font than the main message. -.VE 8.5 .TP \fB\-icon\fR \fIiconImage\fR Specifies an icon to display. \fIIconImage\fR must be one of the @@ -88,6 +86,7 @@ and \fBcancel\fR. .RE .PP .SH EXAMPLE +.PP .CS set answer [\fBtk_messageBox\fR \-message "Really quit?" \e \-icon question \-type yesno \e @@ -98,6 +97,5 @@ switch \-\- $answer { \-type ok} } .CE - .SH KEYWORDS message box diff --git a/doc/option.n b/doc/option.n index be87208..51f712f 100644 --- a/doc/option.n +++ b/doc/option.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1990 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: option.n,v 1.7 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: option.n,v 1.8 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH option n "" Tk "Tk Built-In Commands" @@ -21,7 +22,6 @@ option \- Add/retrieve window options to/from the option database \fBoption readfile \fIfileName \fR?\fIpriority\fR? .fi .BE - .SH DESCRIPTION .PP The \fBoption\fR command allows you to add entries to the Tk option @@ -86,6 +86,7 @@ may be specified numerically using integers between 0 and 100, inclusive. The numeric form is probably a bad idea except for new priority levels other than the ones given above. .SH EXAMPLES +.PP Instruct every button in the application to have red text on it unless explicitly overridden: .CS @@ -100,6 +101,5 @@ entry .e bind .e [\fBoption get\fR .e returnCommand Command] \fBoption add\fR *.e.returnCommand bell widgetDefault .CE - .SH KEYWORDS database, option, priority, retrieve diff --git a/doc/optionMenu.n b/doc/optionMenu.n index 0178d12..6b63e3b 100644 --- a/doc/optionMenu.n +++ b/doc/optionMenu.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1990-1994 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: optionMenu.n,v 1.6 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: optionMenu.n,v 1.7 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH tk_optionMenu n 4.0 Tk "Tk Built-In Commands" @@ -35,6 +36,7 @@ The return value from \fBtk_optionMenu\fR is the name of the menu associated with \fIpathName\fR, so that the caller can change its configuration options or manipulate it in other ways. .SH EXAMPLE +.PP .CS tk_optionMenu .foo myVar Foo Bar Boo Spong Wibble pack .foo diff --git a/doc/options.n b/doc/options.n index 83b5f1f..26f4928 100644 --- a/doc/options.n +++ b/doc/options.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1990-1994 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: options.n,v 1.15 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: options.n,v 1.16 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH options n 4.4 Tk "Tk Built-In Commands" @@ -14,8 +15,8 @@ .SH NAME options \- Standard options supported by widgets .BE - .SH DESCRIPTION +.PP This manual entry describes the common configuration options supported by widgets in the Tk toolkit. Every widget does not necessarily support every option (see the manual entries for individual widgets for a list @@ -350,9 +351,7 @@ scrollbars. This option is treated in the same way as the scrollbars and is provided by widgets that support vertical scrolling. See the description of \fBxScrollCommand\fR for details on how this option is used. - .SH "SEE ALSO" colors, cursors, font - .SH KEYWORDS class, name, standard option, switch diff --git a/doc/pack-old.n b/doc/pack-old.n index 6e724fe..78dcd5f 100644 --- a/doc/pack-old.n +++ b/doc/pack-old.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1990-1994 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: pack-old.n,v 1.5 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: pack-old.n,v 1.6 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH pack-old n 4.0 Tk "Tk Built-In Commands" @@ -22,7 +23,6 @@ pack-old \- Obsolete syntax for packer geometry manager .sp \fBpack unpack \fIwindow\fR .BE - .SH DESCRIPTION .PP \fINote: this manual entry describes the syntax for the \fBpack\fI @@ -191,6 +191,5 @@ The packer makes geometry requests on behalf of the parent windows it manages. For each parent window it requests a size large enough to accommodate all the options specified by all the packed children, such that zero space would be leftover for \fBexpand\fR options. - .SH KEYWORDS geometry manager, location, packer, parcel, size diff --git a/doc/pack.n b/doc/pack.n index 0cc7588..36913ed 100644 --- a/doc/pack.n +++ b/doc/pack.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1990-1994 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: pack.n,v 1.11 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: pack.n,v 1.12 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH pack n 4.0 Tk "Tk Built-In Commands" @@ -16,7 +17,6 @@ pack \- Geometry manager that packs around edges of cavity .SH SYNOPSIS \fBpack \fIoption arg \fR?\fIarg ...\fR? .BE - .SH DESCRIPTION .PP The \fBpack\fR command is used to communicate with the packer, @@ -261,6 +261,7 @@ will be highest in the stacking order. Or, you can use the \fBraise\fR and \fBlower\fR commands to change the stacking order of either the master or the slave. .SH EXAMPLE +.PP .CS # Make the widgets label .t \-text "This widget is at the top" \-bg red @@ -276,9 +277,7 @@ text .mid \fBpack\fR .r \-side right \-fill y \fBpack\fR .mid \-expand 1 \-fill both .CE - .SH "SEE ALSO" grid(n), place(n) - .SH KEYWORDS geometry manager, location, packer, parcel, propagation, size diff --git a/doc/palette.n b/doc/palette.n index 71df926..f7da4d1 100644 --- a/doc/palette.n +++ b/doc/palette.n @@ -1,10 +1,11 @@ +'\" -*- nroff -*- '\" '\" 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. '\" -'\" RCS: @(#) $Id: palette.n,v 1.8 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: palette.n,v 1.9 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH tk_setPalette n 4.0 Tk "Tk Built-In Commands" @@ -19,7 +20,6 @@ tk_setPalette, tk_bisque \- Modify the Tk color palette .sp \fBtk_bisque\fR .BE - .SH DESCRIPTION .PP The \fBtk_setPalette\fR procedure changes the color scheme for Tk. @@ -69,6 +69,5 @@ The procedure \fBtk_bisque\fR is provided for backward compatibility: it restores the application's colors to the light brown .PQ bisque color scheme used in Tk 3.6 and earlier versions. - .SH KEYWORDS bisque, color, palette diff --git a/doc/panedwindow.n b/doc/panedwindow.n index f158866..0673db3 100644 --- a/doc/panedwindow.n +++ b/doc/panedwindow.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1992 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: panedwindow.n,v 1.14 2008/01/31 16:29:34 dkf Exp $ +'\" RCS: @(#) $Id: panedwindow.n,v 1.15 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH panedwindow n 8.4 Tk "Tk Built-In Commands" @@ -197,11 +198,9 @@ height may later be adjusted by the movement of sashes in the panedwindow. \fISize\fR may be any value accepted by \fBTk_GetPixels\fR. .TP \fB\-hide \fIboolean\fR -.VS 8.5 Controls the visibility of a pane. When the \fIboolean\fR is true (according to \fBTcl_GetBoolean\fR) the pane will not be visible, but it will still be maintained in the list of panes. -.VE 8.5 .TP \fB\-minsize \fIn\fR Specifies that the size of the window cannot be made less than @@ -234,7 +233,6 @@ are specified, the window will be stretched to fill the entire height (or width) of its cavity. .TP \fB\-stretch \fIwhen\fR -.VS 8.5 Controls how extra space is allocated to each of the panes. \fIWhen\fR is one of \fBalways\fR, \fBfirst\fR, \fBlast\fR, \fBmiddle\fR, and \fBnever\fR. @@ -249,11 +247,11 @@ definition: This pane will always stretch. .TP \fBfirst\fR -Only if this pane is the first pane (left-most or top-most) will it +Only if this pane is the first pane (left-most or top-most) will it stretch. .TP \fBlast\fR -Only if this pane is the last pane (right-most or bottom-most) will it +Only if this pane is the last pane (right-most or bottom-most) will it stretch. This is the default value. .TP \fBmiddle\fR @@ -262,7 +260,6 @@ Only if this pane is not the first or last pane will it stretch. \fBnever\fR This pane will never stretch. .RE -.VE 8.5 .TP \fB\-width \fIsize\fR Specify a width for the window. The width will be the outer @@ -276,6 +273,7 @@ panedwindow. \fISize\fR may be any value accepted by \fBTk_GetPixels\fR. \fIpathName \fBpanes\fR Returns an ordered list of the widgets managed by \fIpathName\fR. .SH "RESIZING PANES" +.PP A pane is resized by grabbing the sash (or sash handle if present) and dragging with the mouse. This is accomplished via mouse motion bindings on the widget. When a sash is moved, the sizes of the panes diff --git a/doc/photo.n b/doc/photo.n index 16a11bd..8230836 100644 --- a/doc/photo.n +++ b/doc/photo.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1994 The Australian National University '\" Copyright (c) 1994-1997 Sun Microsystems, Inc. @@ -9,7 +10,7 @@ '\" Department of Computer Science, '\" Australian National University. '\" -'\" RCS: @(#) $Id: photo.n,v 1.22 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: photo.n,v 1.23 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH photo n 4.0 Tk "Tk Built-In Commands" @@ -20,7 +21,6 @@ photo \- Full-color images .SH SYNOPSIS \fBimage create photo \fR?\fIname\fR? ?\fIoptions\fR? .BE - .SH DESCRIPTION .PP A photo is an image whose pixels can display any color or be @@ -423,6 +423,7 @@ The photo image type was designed and implemented by Paul Mackerras, based on his earlier photo widget and some suggestions from John Ousterhout. .SH EXAMPLE +.PP Load an image from a file and tile it to the size of a window, which is useful for producing a tiled background: .CS @@ -436,9 +437,7 @@ set width [winfo width .someWidget] set height [winfo height .someWidget] tiled \fBcopy\fR untiled \-to 0 0 $width $height \-shrink .CE - .SH "SEE ALSO" image(n) - .SH KEYWORDS photo, image, color diff --git a/doc/place.n b/doc/place.n index 335e1f7..17d2bf1 100644 --- a/doc/place.n +++ b/doc/place.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1992 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: place.n,v 1.11 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: place.n,v 1.12 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH place n "" Tk "Tk Built-In Commands" @@ -16,7 +17,6 @@ place \- Geometry manager for fixed or rubber-sheet placement .SH SYNOPSIS \fBplace \fIoption arg \fR?\fIarg ...\fR? .BE - .SH DESCRIPTION .PP The placer is a geometry manager for Tk. @@ -50,9 +50,9 @@ sublist of the value returned if no \fIoption\fR is specified). If one or more \fIoption\-value\fR pairs are specified, then the command modifies the given option(s) to have the given value(s); in this case the command returns an empty string. - -The following \fIoption\-value\fR pairs are supported: .RS +.PP +The following \fIoption\-value\fR pairs are supported: .TP \fB\-anchor \fIwhere\fR \fIWhere\fR specifies which point of \fIwindow\fR is to be positioned @@ -75,7 +75,8 @@ an option of \fB\-x 0\fR corresponds to an x-coordinate just inside the border and an option of \fB\-relwidth 1.0\fR means \fIwindow\fR will fill the area inside the master's border. - +.RS +.PP If \fImode\fR is \fBoutside\fR then the placer considers the area of the master to include its border; this mode is typically used when placing \fIwindow\fR @@ -85,6 +86,7 @@ case borders are ignored: the area of the master is considered to be its official X area, which includes any internal border but no external border. A bordermode of \fBignore\fR is probably not very useful. +.RE .TP \fB\-height \fIsize\fR \fISize\fR specifies the height for \fIwindow\fR in screen units @@ -240,15 +242,14 @@ set their requested sizes). To control the sizes of these windows, make them windows like frames and canvases that provide configuration options for this purpose. .SH EXAMPLE +.PP Make the label occupy the middle bit of the toplevel, no matter how it is resized: .CS label .l \-text "In the\enMiddle!" \-bg black \-fg white \fBplace\fR .l \-relwidth .3 \-relx .35 \-relheight .3 \-rely .35 .CE - .SH "SEE ALSO" grid(n), pack(n) - .SH KEYWORDS geometry manager, height, location, master, place, rubber sheet, slave, width diff --git a/doc/popup.n b/doc/popup.n index 40896fd..a44917c 100644 --- a/doc/popup.n +++ b/doc/popup.n @@ -1,50 +1,49 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: popup.n,v 1.4 2004/06/21 20:59:29 dkf Exp $ -'\" -.so man.macros -.TH tk_popup n 4.0 Tk "Tk Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -tk_popup \- Post a popup menu -.SH SYNOPSIS -\fBtk_popup \fImenu x y \fR?\fIentry\fR? -.BE - -.SH DESCRIPTION -.PP -This procedure posts a menu at a given position on the screen and -configures Tk so that the menu and its cascaded children can be -traversed with the mouse or the keyboard. -\fIMenu\fR is the name of a menu widget and \fIx\fR and \fIy\fR -are the root coordinates at which to display the menu. -If \fIentry\fR is omitted or an empty string, the -menu's upper left corner is positioned at the given point. -Otherwise \fIentry\fR gives the index of an entry in \fImenu\fR and -the menu will be positioned so that the entry is positioned over -the given point. -.SH EXAMPLE -How to attach a simple popup menu to a widget. -.CS -# Create a menu -set m [menu .popupMenu] -$m add command \-label "Example 1" \-command bell -$m add command \-label "Example 2" \-command bell - -# Create something to attach it to -pack [label .l \-text "Click me!"] - -# Arrange for the menu to pop up when the label is clicked -bind .l <1> {\fBtk_popup\fR .popupMenu %X %Y} -.CE - -.SH "SEE ALSO" -bind(n), menu(n), tk_optionMenu(n) - -.SH KEYWORDS -menu, popup +'\" -*- nroff -*- +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: popup.n,v 1.5 2008/06/30 22:57:03 dkf Exp $ +'\" +.so man.macros +.TH tk_popup n 4.0 Tk "Tk Built-In Commands" +.BS +'\" Note: do not modify the .SH NAME line immediately below! +.SH NAME +tk_popup \- Post a popup menu +.SH SYNOPSIS +\fBtk_popup \fImenu x y \fR?\fIentry\fR? +.BE +.SH DESCRIPTION +.PP +This procedure posts a menu at a given position on the screen and +configures Tk so that the menu and its cascaded children can be +traversed with the mouse or the keyboard. +\fIMenu\fR is the name of a menu widget and \fIx\fR and \fIy\fR +are the root coordinates at which to display the menu. +If \fIentry\fR is omitted or an empty string, the +menu's upper left corner is positioned at the given point. +Otherwise \fIentry\fR gives the index of an entry in \fImenu\fR and +the menu will be positioned so that the entry is positioned over +the given point. +.SH EXAMPLE +.PP +How to attach a simple popup menu to a widget. +.CS +# Create a menu +set m [menu .popupMenu] +$m add command \-label "Example 1" \-command bell +$m add command \-label "Example 2" \-command bell + +# Create something to attach it to +pack [label .l \-text "Click me!"] + +# Arrange for the menu to pop up when the label is clicked +bind .l <1> {\fBtk_popup\fR .popupMenu %X %Y} +.CE +.SH "SEE ALSO" +bind(n), menu(n), tk_optionMenu(n) +.SH KEYWORDS +menu, popup diff --git a/doc/radiobutton.n b/doc/radiobutton.n index cf06f57..548551b 100644 --- a/doc/radiobutton.n +++ b/doc/radiobutton.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1990-1994 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: radiobutton.n,v 1.16 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: radiobutton.n,v 1.17 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH radiobutton n 4.4 Tk "Tk Built-In Commands" @@ -90,18 +91,14 @@ the widget and will ignore mouse button presses. In this state the \fBdisabledForeground\fR and \fBbackground\fR options determine how the radiobutton is displayed. .OP \-tristateimage tristateImage TristateImage -.VS 8.5 Specifies an image to display (in place of the \fBimage\fR option) when the radiobutton is selected. This option is ignored unless the \fBimage\fR option has been specified. -.VE 8.5 .OP \-tristatevalue tristateValue Value -.VS 8.5 -Specifies the value that causes the radiobutton to display the multi-value +Specifies the value that causes the radiobutton to display the multi-value selection, also known as the tri-state mode. Defaults to .QW "" . -.VE 8.5 .OP \-value value Value Specifies value to store in the button's associated variable whenever this button is selected. @@ -162,12 +159,10 @@ When a radiobutton is selected it sets the value of the variable to indicate that fact; each radiobutton also monitors the value of the variable and automatically selects and deselects itself when the variable's value changes. -.VS 8.5 -If the variable's value matches the \fBtristateValue\fR, then the radiobutton is -drawn using the tri-state mode. This mode is used to indicate mixed or -multiple values. (This is used when the radiobutton represents the state +If the variable's value matches the \fBtristateValue\fR, then the radiobutton +is drawn using the tri-state mode. This mode is used to indicate mixed or +multiple values. (This is used when the radiobutton represents the state of multiple items.) -.VE 8.5 By default the variable \fBselectedButton\fR is used; its contents give the name of the button that is selected, or the empty string if no button associated with that diff --git a/doc/raise.n b/doc/raise.n index 7d427e7..ce3dcfe 100644 --- a/doc/raise.n +++ b/doc/raise.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1990 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: raise.n,v 1.5 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: raise.n,v 1.6 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH raise n 3.3 Tk "Tk Built-In Commands" @@ -16,7 +17,6 @@ raise \- Change a window's position in the stacking order .SH SYNOPSIS \fBraise \fIwindow \fR?\fIaboveThis\fR? .BE - .SH DESCRIPTION .PP If the \fIaboveThis\fR argument is omitted then the command raises @@ -31,6 +31,7 @@ In this case the \fBraise\fR command will insert (or the ancestor of \fIaboveThis\fR that is a sibling of \fIwindow\fR); this could end up either raising or lowering \fIwindow\fR. .SH EXAMPLE +.PP Make a button appear to be in a sibling frame that was created after it. This is is often necessary when building GUIs in the style where you create your activity widgets first before laying them out on the @@ -43,9 +44,7 @@ pack .b \-in .f pack [label .f.l2 \-text "This is below"] \fBraise\fR .b .CE - .SH "SEE ALSO" lower(n) - .SH KEYWORDS obscure, raise, stacking order diff --git a/doc/scale.n b/doc/scale.n index 9c7bb05..284286a 100644 --- a/doc/scale.n +++ b/doc/scale.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1990-1994 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: scale.n,v 1.10 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: scale.n,v 1.11 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH scale n 4.1 Tk "Tk Built-In Commands" @@ -98,7 +99,6 @@ Specifies the desired narrow dimension of the trough in screen units For vertical scales this is the trough's width; for horizontal scales this is the trough's height. .BE - .SH DESCRIPTION .PP The \fBscale\fR command creates a new window (given by the @@ -241,6 +241,5 @@ none of the above bindings have any effect. .PP The behavior of scales can be changed by defining new bindings for individual widgets or by redefining the class bindings. - .SH KEYWORDS scale, slider, trough, widget diff --git a/doc/scrollbar.n b/doc/scrollbar.n index cd8c17d..062c506 100644 --- a/doc/scrollbar.n +++ b/doc/scrollbar.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1990-1994 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: scrollbar.n,v 1.10 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: scrollbar.n,v 1.11 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH scrollbar n 4.1 Tk "Tk Built-In Commands" @@ -264,6 +265,7 @@ If it is given two real arguments then the new syntax will be used in the future, and if it is given four integer arguments then the old syntax will be used. .SH BINDINGS +.PP Tk automatically creates class bindings for scrollbars that give them the following default behavior. If the behavior is different for vertical and horizontal scrollbars, @@ -330,6 +332,7 @@ The Home key adjusts the view to the top (left edge) of the document. .IP [14] The End key adjusts the view to the bottom (right edge) of the document. .SH EXAMPLE +.PP Create a window with a scrollable \fBtext\fR widget: .CS toplevel .tl diff --git a/doc/selection.n b/doc/selection.n index eb9961e..b7c4f4d 100644 --- a/doc/selection.n +++ b/doc/selection.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1990-1994 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: selection.n,v 1.12 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: selection.n,v 1.13 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH selection n 8.1 Tk "Tk Built-In Commands" @@ -16,7 +17,6 @@ selection \- Manipulate the X selection .SH SYNOPSIS \fBselection \fIoption\fR ?\fIarg arg ...\fR? .BE - .SH DESCRIPTION .PP This command provides a Tcl interface to the X selection mechanism and @@ -139,6 +139,7 @@ If \fIcommand\fR is specified, it is a Tcl script to execute when some other window claims ownership of the selection away from \fIwindow\fR. \fISelection\fR defaults to PRIMARY. .SH EXAMPLES +.PP On X11 platforms, one of the standard selections available is the SECONDARY selection. Hardly anything uses it, but here is how to read it using Tk: diff --git a/doc/send.n b/doc/send.n index fabc251..db0c3b9 100644 --- a/doc/send.n +++ b/doc/send.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1990-1994 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: send.n,v 1.9 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: send.n,v 1.10 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH send n 4.0 Tk "Tk Built-In Commands" @@ -16,7 +17,6 @@ send \- Execute a command in a different application .SH SYNOPSIS \fBsend ?\fIoptions\fR? \fIapp cmd \fR?\fIarg arg ...\fR? .BE - .SH DESCRIPTION .PP This command arranges for \fIcmd\fR (and \fIarg\fRs) to be executed in the @@ -52,14 +52,12 @@ Serves no purpose except to terminate the list of options. This option is needed only if \fIapp\fR could contain a leading .QW \- character. - .SH "APPLICATION NAMES" .PP The name of an application is set initially from the name of the program or script that created the application. You can query and change the name of an application with the \fBtk appname\fR command. - .SH "DISABLING SENDS" .PP If the \fBsend\fR command is removed from an application (e.g. @@ -68,7 +66,6 @@ will not respond to incoming send requests anymore, nor will it be able to issue outgoing requests. Communication can be reenabled by invoking the \fBtk appname\fR command. - .SH SECURITY .PP The \fBsend\fR command is potentially a serious security loophole. On Unix, @@ -91,6 +88,7 @@ such as that provide by \fBxauth\fR. Under Windows, \fBsend\fR is currently disabled. Most of the functionality is provided by the \fBdde\fR command instead. .SH EXAMPLE +.PP This script fragment can be used to make an application that only runs once on a particular display. .CS diff --git a/doc/spinbox.n b/doc/spinbox.n index 566900e..f7debdd 100644 --- a/doc/spinbox.n +++ b/doc/spinbox.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 2000 Jeffrey Hobbs. '\" Copyright (c) 2000 Ajuba Solutions. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: spinbox.n,v 1.9 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: spinbox.n,v 1.10 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH spinbox n 8.4 Tk "Tk Built-In Commands" @@ -465,7 +466,6 @@ If \fInumber\fR is negative then characters farther to the left become visible; if it is positive then characters farther to the right become visible. .RE - .SH "DEFAULT BINDINGS" .PP Tk automatically creates class bindings for spinboxes that give them @@ -582,6 +582,5 @@ take place. .PP The behavior of spinboxes can be changed by defining new bindings for individual widgets or by redefining the class bindings. - .SH KEYWORDS spinbox, entry, widget diff --git a/doc/text.n b/doc/text.n index 1a776e1..c1b0da6 100644 --- a/doc/text.n +++ b/doc/text.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1992 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -5,12 +6,12 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: text.n,v 1.55 2008/06/24 10:54:53 patthoyts Exp $ +'\" RCS: @(#) $Id: text.n,v 1.56 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH text n 8.5 Tk "Tk Built-In Commands" .BS -'\" Note: do not modify the .SH NAME line immediately below! +'\" Note: do not modify the .SH NAME line immediately below! .SH NAME text, tk_textCopy, tk_textCut, tk_textPaste \- Create and manipulate text widgets .SH SYNOPSIS @@ -31,1569 +32,1404 @@ text, tk_textCopy, tk_textCut, tk_textPaste \- Create and manipulate text widget .SE .SH "WIDGET-SPECIFIC OPTIONS" .OP \-autoseparators autoSeparators AutoSeparators -Specifies a boolean that says whether separators are automatically -inserted in the undo stack. Only meaningful when the \fB\-undo\fR -option is true. +Specifies a boolean that says whether separators are automatically inserted in +the undo stack. Only meaningful when the \fB\-undo\fR option is true. .OP \-blockcursor blockCursor BlockCursor -.VS 8.5 -Specifies a boolean that says whether the blinking insertion cursor -should be drawn as a character-sized rectangular block. If false -(the default) a thin vertical line is used for the insertion cursor. -.VE 8.5 +Specifies a boolean that says whether the blinking insertion cursor should be +drawn as a character-sized rectangular block. If false (the default) a thin +vertical line is used for the insertion cursor. .OP \-endline endLine EndLine -.VS 8.5 -Specifies an integer line index representing the last line of the -underlying textual data store that should be contained in the widget. -This allows a text widget to reflect only a portion of a larger piece -of text. Instead of an integer, the empty string can be provided to -this configuration option, which will configure the widget to end -at the very last line in the textual data store. -.VE 8.5 +Specifies an integer line index representing the last line of the underlying +textual data store that should be contained in the widget. This allows a text +widget to reflect only a portion of a larger piece of text. Instead of an +integer, the empty string can be provided to this configuration option, which +will configure the widget to end at the very last line in the textual data +store. .OP \-height height Height -Specifies the desired height for the window, in units of characters -in the font given by the \fB\-font\fR option. -Must be at least one. +Specifies the desired height for the window, in units of characters in the +font given by the \fB\-font\fR option. Must be at least one. .OP \-inactiveselectbackground inactiveSelectBackground Foreground -.VS 8.5 -Specifies the colour to use for the selection (the \fBsel\fR tag) when -the window does not have the input focus. If empty, \fB{}\fR, then no -selection is shown when the window does not have the focus. -.VE 8.5 +Specifies the colour to use for the selection (the \fBsel\fR tag) when the +window does not have the input focus. If empty, \fB{}\fR, then no selection is +shown when the window does not have the focus. .OP \-maxundo maxUndo MaxUndo -Specifies the maximum number of compound undo actions on the undo -stack. A zero or a negative value imply an unlimited undo stack. +Specifies the maximum number of compound undo actions on the undo stack. A +zero or a negative value imply an unlimited undo stack. .OP \-spacing1 spacing1 Spacing1 -Requests additional space above each text line in the widget, -using any of the standard forms for screen distances. -If a line wraps, this option only applies to the first line -on the display. -This option may be overridden with \fB\-spacing1\fR options in -tags. +Requests additional space above each text line in the widget, using any of the +standard forms for screen distances. If a line wraps, this option only applies +to the first line on the display. This option may be overridden with +\fB\-spacing1\fR options in tags. .OP \-spacing2 spacing2 Spacing2 -For lines that wrap (so that they cover more than one line on the -display) this option specifies additional space to provide between -the display lines that represent a single line of text. -The value may have any of the standard forms for screen distances. -This option may be overridden with \fB\-spacing2\fR options in -tags. +For lines that wrap (so that they cover more than one line on the display) +this option specifies additional space to provide between the display lines +that represent a single line of text. The value may have any of the standard +forms for screen distances. This option may be overridden with +\fB\-spacing2\fR options in tags. .OP \-spacing3 spacing3 Spacing3 -Requests additional space below each text line in the widget, -using any of the standard forms for screen distances. -If a line wraps, this option only applies to the last line -on the display. -This option may be overridden with \fB\-spacing3\fR options in -tags. +Requests additional space below each text line in the widget, using any of the +standard forms for screen distances. If a line wraps, this option only applies +to the last line on the display. This option may be overridden with +\fB\-spacing3\fR options in tags. .OP \-startline startLine StartLine -.VS 8.5 -Specifies an integer line index representing the first line of the -underlying textual data store that should be contained in the widget. -This allows a text widget to reflect only a portion of a larger piece -of text. Instead of an integer, the empty string can be provided to -this configuration option, which will configure the widget to start -at the very first line in the textual data store. -.VE 8.5 +Specifies an integer line index representing the first line of the underlying +textual data store that should be contained in the widget. This allows a text +widget to reflect only a portion of a larger piece of text. Instead of an +integer, the empty string can be provided to this configuration option, which +will configure the widget to start at the very first line in the textual data +store. .OP \-state state State -Specifies one of two states for the text: \fBnormal\fR or \fBdisabled\fR. -If the text is disabled then characters may not be inserted or deleted -and no insertion cursor will be displayed, even if the input focus is -in the widget. +Specifies one of two states for the text: \fBnormal\fR or \fBdisabled\fR. If +the text is disabled then characters may not be inserted or deleted and no +insertion cursor will be displayed, even if the input focus is in the widget. .OP \-tabs tabs Tabs -Specifies a set of tab stops for the window. The option's value consists -of a list of screen distances giving the positions of the tab stops, -each of which is a distance relative to the left edge of the widget -(excluding borders, padding, etc). Each -position may optionally be followed in the next list element -by one of the keywords \fBleft\fR, \fBright\fR, \fBcenter\fR, -or \fBnumeric\fR, which specifies how to justify -text relative to the tab stop. \fBLeft\fR is the default; it causes -the text following the tab character to be positioned with its left edge -at the tab position. \fBRight\fR means that the right edge of the text -following the tab character is positioned at the tab position, and -\fBcenter\fR means that the text is centered at the tab position. -\fBNumeric\fR means that the decimal point in the text is positioned -at the tab position; if there is no decimal point then the least -significant digit of the number is positioned just to the left of the -tab position; if there is no number in the text then the text is -right-justified at the tab position. -For example, +Specifies a set of tab stops for the window. The option's value consists of a +list of screen distances giving the positions of the tab stops, each of which +is a distance relative to the left edge of the widget (excluding borders, +padding, etc). Each position may optionally be followed in the next list +element by one of the keywords \fBleft\fR, \fBright\fR, \fBcenter\fR, or +\fBnumeric\fR, which specifies how to justify text relative to the tab stop. +\fBLeft\fR is the default; it causes the text following the tab character to +be positioned with its left edge at the tab position. \fBRight\fR means that +the right edge of the text following the tab character is positioned at the +tab position, and \fBcenter\fR means that the text is centered at the tab +position. \fBNumeric\fR means that the decimal point in the text is positioned +at the tab position; if there is no decimal point then the least significant +digit of the number is positioned just to the left of the tab position; if +there is no number in the text then the text is right-justified at the tab +position. For example, .QW "\fB\-tabs {2c left 4c 6c center}\fR" -creates three tab stops at two-centimeter intervals; the first two use left +creates three tab stops at two-centimeter intervals; the first two use left justification and the third uses center justification. .RS .PP -If the list of tab stops does not have enough elements to cover all -of the tabs in a text line, then Tk extrapolates new tab stops using -the spacing and alignment from the last tab stop in the list. Tab -distances must be strictly positive, and must always increase from one -tab stop to the next (if not, an error is thrown). -The value of the \fBtabs\fR option may be overridden by \fB\-tabs\fR -options in tags. +If the list of tab stops does not have enough elements to cover all of the +tabs in a text line, then Tk extrapolates new tab stops using the spacing and +alignment from the last tab stop in the list. Tab distances must be strictly +positive, and must always increase from one tab stop to the next (if not, an +error is thrown). The value of the \fBtabs\fR option may be overridden by +\fB\-tabs\fR options in tags. .PP -If no \fB\-tabs\fR option is specified, or if it is specified as -an empty list, then Tk uses default tabs spaced every eight -(average size) characters. To achieve a different standard spacing, -for example every 4 characters, simply configure the widget with +If no \fB\-tabs\fR option is specified, or if it is specified as an empty +list, then Tk uses default tabs spaced every eight (average size) characters. +To achieve a different standard spacing, for example every 4 characters, +simply configure the widget with .QW "\fB\-tabs \N'34'[expr {4 * [font measure $font 0]}] left\N'34' \-tabstyle wordprocessor\fR" . .RE .OP \-tabstyle tabStyle TabStyle -Specifies how to interpret the relationship between tab stops on a line -and tabs in the text of that line. The value must be \fBtabular\fR (the -default) or \fBwordprocessor\fR. Note that tabs are interpreted as they -are encountered in the text. If the tab style is \fBtabular\fR then the -\fIn\fR'th tab character in the line's text will be associated with -the \fIn\fR'th -tab stop defined for that line. If the tab character's x coordinate -falls to the right of the \fIn\fR'th tab stop, then a gap of a single space -will be inserted as a fallback. If the tab style is \fBwordprocessor\fR -then any tab character being laid out will use (and be defined by) the -first tab stop to the right of the preceding characters already laid out -on that line. The value of the \fBtabstyle\fR option may be overridden -by \fB\-tabstyle\fR options in tags. +Specifies how to interpret the relationship between tab stops on a line and +tabs in the text of that line. The value must be \fBtabular\fR (the default) +or \fBwordprocessor\fR. Note that tabs are interpreted as they are encountered +in the text. If the tab style is \fBtabular\fR then the \fIn\fR'th tab +character in the line's text will be associated with the \fIn\fR'th tab stop +defined for that line. If the tab character's x coordinate falls to the right +of the \fIn\fR'th tab stop, then a gap of a single space will be inserted as a +fallback. If the tab style is \fBwordprocessor\fR then any tab character being +laid out will use (and be defined by) the first tab stop to the right of the +preceding characters already laid out on that line. The value of the +\fBtabstyle\fR option may be overridden by \fB\-tabstyle\fR options in tags. .OP \-undo undo Undo -Specifies a boolean that says whether the undo mechanism is active or -not. +Specifies a boolean that says whether the undo mechanism is active or not. .OP \-width width Width -Specifies the desired width for the window in units of characters -in the font given by the \fB\-font\fR option. -If the font does not have a uniform width then the width of the character +Specifies the desired width for the window in units of characters in the font +given by the \fB\-font\fR option. If the font does not have a uniform width +then the width of the character .QW 0 is used in translating from character units to screen units. .OP \-wrap wrap Wrap -Specifies how to handle lines in the text that are too long to be -displayed in a single line of the text's window. -The value must be \fBnone\fR or \fBchar\fR or \fBword\fR. -A wrap mode of \fBnone\fR means that each line of text appears as -exactly one line on the screen; extra characters that do not fit -on the screen are not displayed. -In the other modes each line of text will be broken up into several -screen lines if necessary to keep all the characters visible. -In \fBchar\fR mode a screen line break may occur after any character; -in \fBword\fR mode a line break will only be made at word boundaries. +Specifies how to handle lines in the text that are too long to be displayed in +a single line of the text's window. The value must be \fBnone\fR or \fBchar\fR +or \fBword\fR. A wrap mode of \fBnone\fR means that each line of text appears +as exactly one line on the screen; extra characters that do not fit on the +screen are not displayed. In the other modes each line of text will be broken +up into several screen lines if necessary to keep all the characters visible. +In \fBchar\fR mode a screen line break may occur after any character; in +\fBword\fR mode a line break will only be made at word boundaries. .BE - .SH DESCRIPTION .PP -The \fBtext\fR command creates a new window (given by the -\fIpathName\fR argument) and makes it into a text widget. -Additional -options, described above, may be specified on the command line -or in the option database -to configure aspects of the text such as its default background color -and relief. The \fBtext\fR command returns the -path name of the new window. +The \fBtext\fR command creates a new window (given by the \fIpathName\fR +argument) and makes it into a text widget. Additional options, described +above, may be specified on the command line or in the option database to +configure aspects of the text such as its default background color and relief. +The \fBtext\fR command returns the path name of the new window. .PP -A text widget displays one or more lines of text and allows that -text to be edited. -Text widgets support four different kinds of annotations on the -text, called tags, marks, embedded windows or embedded images. -Tags allow different portions of the text -to be displayed with different fonts and colors. -In addition, Tcl commands can be associated with tags so -that scripts are invoked when particular actions such as keystrokes -and mouse button presses occur in particular ranges of the text. -See \fBTAGS\fR below for more details. +A text widget displays one or more lines of text and allows that text to be +edited. Text widgets support four different kinds of annotations on the text, +called tags, marks, embedded windows or embedded images. Tags allow different +portions of the text to be displayed with different fonts and colors. In +addition, Tcl commands can be associated with tags so that scripts are invoked +when particular actions such as keystrokes and mouse button presses occur in +particular ranges of the text. See \fBTAGS\fR below for more details. .PP -The second form of annotation consists of floating markers in the text -called +The second form of annotation consists of floating markers in the text called .QW marks . -Marks are used to keep track of various interesting positions in the -text as it is edited. -See \fBMARKS\fR below for more details. +Marks are used to keep track of various interesting positions in the text as +it is edited. See \fBMARKS\fR below for more details. .PP -The third form of annotation allows arbitrary windows to be -embedded in a text widget. -See \fBEMBEDDED WINDOWS\fR below for more details. +The third form of annotation allows arbitrary windows to be embedded in a text +widget. See \fBEMBEDDED WINDOWS\fR below for more details. .PP The fourth form of annotation allows Tk images to be embedded in a text -widget. -See \fBEMBEDDED IMAGES\fR below for more details. +widget. See \fBEMBEDDED IMAGES\fR below for more details. .PP -The text widget also has a built-in undo/redo mechanism. -See \fBTHE UNDO MECHANISM\fR below for more details. +The text widget also has a built-in undo/redo mechanism. See \fBTHE UNDO +MECHANISM\fR below for more details. .PP -.VS 8.5 -The text widget allows for the creation of peer widgets. These are -other text widgets which share the same underlying data (text, marks, -tags, images, etc). See \fBPEER WIDGETS\fR below for more details. -.VE 8.5 +The text widget allows for the creation of peer widgets. These are other text +widgets which share the same underlying data (text, marks, tags, images, etc). +See \fBPEER WIDGETS\fR below for more details. .SH INDICES .PP -Many of the widget commands for texts take one or more indices -as arguments. -An index is a string used to indicate a particular place within -a text, such as a place to insert characters or one endpoint of a -range of characters to delete. -Indices have the syntax +Many of the widget commands for texts take one or more indices as arguments. +An index is a string used to indicate a particular place within a text, such +as a place to insert characters or one endpoint of a range of characters to +delete. Indices have the syntax .CS \fIbase modifier modifier modifier ...\fR .CE -Where \fIbase\fR gives a starting point and the \fImodifier\fRs -adjust the index from the starting point (e.g. move forward or -backward one character). Every index must contain a \fIbase\fR, -but the \fImodifier\fRs are optional. -.VS 8.5 -Most modifiers (as documented below) allow -an optional submodifier. Valid submodifiers are \fBany\fR -and \fBdisplay\fR. If the submodifier is abbreviated, then it must be -followed by whitespace, but otherwise there need be no space between the -submodifier and the following \fImodifier\fR. Typically the \fBdisplay\fR -submodifier adjusts the meaning of the following \fImodifier\fR to make -it refer to visual or non-elided units rather than logical units, but -this is explained for each relevant case below. Lastly, where \fIcount\fR -is used as part of a modifier, it can be positive or negative, so +Where \fIbase\fR gives a starting point and the \fImodifier\fRs adjust the +index from the starting point (e.g. move forward or backward one character). +Every index must contain a \fIbase\fR, but the \fImodifier\fRs are optional. +Most modifiers (as documented below) allow an optional submodifier. Valid +submodifiers are \fBany\fR and \fBdisplay\fR. If the submodifier is +abbreviated, then it must be followed by whitespace, but otherwise there need +be no space between the submodifier and the following \fImodifier\fR. +Typically the \fBdisplay\fR submodifier adjusts the meaning of the following +\fImodifier\fR to make it refer to visual or non-elided units rather than +logical units, but this is explained for each relevant case below. Lastly, +where \fIcount\fR is used as part of a modifier, it can be positive or +negative, so .QW "\fIbase\fR \- \-3 lines" is perfectly valid (and equivalent to .QW "\fIbase\fR +3lines" ). -.VE 8.5 .PP The \fIbase\fR for an index must have one of the following forms: .TP 12 \fIline\fB.\fIchar\fR -Indicates \fIchar\fR'th character on line \fIline\fR. -Lines are numbered from 1 for consistency with other UNIX programs -that use this numbering scheme. -Within a line, characters are numbered from 0. -If \fIchar\fR is \fBend\fR then it refers to the newline character -that ends the line. +. +Indicates \fIchar\fR'th character on line \fIline\fR. Lines are numbered from +1 for consistency with other UNIX programs that use this numbering scheme. +Within a line, characters are numbered from 0. If \fIchar\fR is \fBend\fR then +it refers to the newline character that ends the line. .TP 12 \fB@\fIx\fB,\fIy\fR -Indicates the character that covers the pixel whose x and y coordinates -within the text's window are \fIx\fR and \fIy\fR. +. +Indicates the character that covers the pixel whose x and y coordinates within +the text's window are \fIx\fR and \fIy\fR. .TP 12 \fBend\fR -Indicates the end of the text (the character just after the last -newline). +. +Indicates the end of the text (the character just after the last newline). .TP 12 \fImark\fR +. Indicates the character just after the mark whose name is \fImark\fR. .TP 12 \fItag\fB.first\fR -Indicates the first character in the text that has been tagged with +. +Indicates the first character in the text that has been tagged with \fItag\fR. +This form generates an error if no characters are currently tagged with \fItag\fR. -This form generates an error if no characters are currently tagged -with \fItag\fR. .TP 12 \fItag\fB.last\fR -Indicates the character just after the last one in the text that has -been tagged with \fItag\fR. -This form generates an error if no characters are currently tagged -with \fItag\fR. +. +Indicates the character just after the last one in the text that has been +tagged with \fItag\fR. This form generates an error if no characters are +currently tagged with \fItag\fR. .TP 12 \fIpathName\fR -Indicates the position of the embedded window whose name is -\fIpathName\fR. -This form generates an error if there is no embedded window -by the given name. +. +Indicates the position of the embedded window whose name is \fIpathName\fR. +This form generates an error if there is no embedded window by the given name. .TP 12 \fIimageName\fR -Indicates the position of the embedded image whose name is -\fIimageName\fR. -This form generates an error if there is no embedded image -by the given name. +. +Indicates the position of the embedded image whose name is \fIimageName\fR. +This form generates an error if there is no embedded image by the given name. .PP -If the \fIbase\fR could match more than one of the above forms, such -as a \fImark\fR and \fIimageName\fR both having the same value, then -the form earlier in the above list takes precedence. -If modifiers follow the base index, each one of them must have one -of the forms listed below. Keywords such as \fBchars\fR and \fBwordend\fR -may be abbreviated as long as the abbreviation is unambiguous. +If the \fIbase\fR could match more than one of the above forms, such as a +\fImark\fR and \fIimageName\fR both having the same value, then the form +earlier in the above list takes precedence. If modifiers follow the base +index, each one of them must have one of the forms listed below. Keywords such +as \fBchars\fR and \fBwordend\fR may be abbreviated as long as the +abbreviation is unambiguous. .TP \fB+ \fIcount\fR ?\fIsubmodifier\fR? \fBchars\fR -.VS 8.5 -Adjust the index forward by \fIcount\fR characters, moving to later lines -in the text if necessary. If there are fewer than \fIcount\fR characters -in the text after the current index, then set the index to the last index -in the text. Spaces on either side of \fIcount\fR are optional. If the -\fBdisplay\fR submodifier is given, elided characters are skipped over -without being counted. If \fBany\fR is given, then all characters are -counted. For historical reasons, if neither modifier is given then the -count actually takes place in units of index positions (see \fBindices\fR -for details). This behaviour may be changed in a future major release, -so if you need an index count, you are encouraged to use \fBindices\fR -instead wherever possible. -.VE 8.5 +. +Adjust the index forward by \fIcount\fR characters, moving to later lines in +the text if necessary. If there are fewer than \fIcount\fR characters in the +text after the current index, then set the index to the last index in the +text. Spaces on either side of \fIcount\fR are optional. If the \fBdisplay\fR +submodifier is given, elided characters are skipped over without being +counted. If \fBany\fR is given, then all characters are counted. For +historical reasons, if neither modifier is given then the count actually takes +place in units of index positions (see \fBindices\fR for details). This +behaviour may be changed in a future major release, so if you need an index +count, you are encouraged to use \fBindices\fR instead wherever possible. .TP \fB\- \fIcount\fR ?\fIsubmodifier\fR? \fBchars\fR -Adjust the index backward by \fIcount\fR characters, moving to earlier -lines in the text if necessary. If there are fewer than \fIcount\fR -characters in the text before the current index, then set the index to -.VS 8.5 -the first index in the text (1.0). Spaces on either side of \fIcount\fR -are optional. If the \fBdisplay\fR submodifier is given, elided -characters are skipped over without being counted. If \fBany\fR is -given, then all characters are counted. For historical reasons, if -neither modifier is given then the count actually takes place in units of -index positions (see \fBindices\fR for details). This behaviour may be -changed in a future major release, so if you need an index count, you are -encouraged to use \fBindices\fR instead wherever possible. -.VE 8.5 +. +Adjust the index backward by \fIcount\fR characters, moving to earlier lines +in the text if necessary. If there are fewer than \fIcount\fR characters in +the text before the current index, then set the index to the first index in +the text (1.0). Spaces on either side of \fIcount\fR are optional. If the +\fBdisplay\fR submodifier is given, elided characters are skipped over without +being counted. If \fBany\fR is given, then all characters are counted. For +historical reasons, if neither modifier is given then the count actually takes +place in units of index positions (see \fBindices\fR for details). This +behavior may be changed in a future major release, so if you need an index +count, you are encouraged to use \fBindices\fR instead wherever possible. .TP \fB+ \fIcount\fR ?\fIsubmodifier\fR? \fBindices\fR -.VS 8.5 -Adjust the index forward by \fIcount\fR index positions, moving to later -lines in the text if necessary. If there are fewer than \fIcount\fR -index positions in the text after the current index, then set the index -to the last index position in the text. Spaces on either side of -\fIcount\fR are optional. Note that an index position is either a single -character or a single embedded image or embedded window. If the -\fBdisplay\fR submodifier is given, elided indices are skipped over -without being counted. If \fBany\fR is given, then all indices are -counted; this is also the default behaviour if no modifier is given. -.VE 8.5 +. +Adjust the index forward by \fIcount\fR index positions, moving to later lines +in the text if necessary. If there are fewer than \fIcount\fR index positions +in the text after the current index, then set the index to the last index +position in the text. Spaces on either side of \fIcount\fR are optional. Note +that an index position is either a single character or a single embedded image +or embedded window. If the \fBdisplay\fR submodifier is given, elided indices +are skipped over without being counted. If \fBany\fR is given, then all +indices are counted; this is also the default behaviour if no modifier is +given. .TP \fB\- \fIcount\fR ?\fIsubmodifier\fR? \fBindices\fR -.VS 8.5 -Adjust the index backward by \fIcount\fR index positions, moving to -earlier lines in the text if necessary. If there are fewer than -\fIcount\fR index positions in the text before the current index, then -set the index to the first index position (1.0) in the text. Spaces on -either side of \fIcount\fR are optional. If the \fBdisplay\fR -submodifier is given, elided indices are skipped over without being -counted. If \fBany\fR is given, then all indices are counted; this is -also the default behaviour if no modifier is given. -.VE 8.5 +. +Adjust the index backward by \fIcount\fR index positions, moving to earlier +lines in the text if necessary. If there are fewer than \fIcount\fR index +positions in the text before the current index, then set the index to the +first index position (1.0) in the text. Spaces on either side of \fIcount\fR +are optional. If the \fBdisplay\fR submodifier is given, elided indices are +skipped over without being counted. If \fBany\fR is given, then all indices +are counted; this is also the default behaviour if no modifier is given. .TP \fB+ \fIcount\fR ?\fIsubmodifier\fR? \fBlines\fR -.VS 8.5 -Adjust the index forward by \fIcount\fR lines, retaining the same -character position within the line. If there are fewer than \fIcount\fR -lines after the line containing the current index, then set the index to -refer to the same character position on the last line of the text. Then, -if the line is not long enough to contain a character at the indicated -character position, adjust the character position to refer to the last -character of the line (the newline). Spaces on either side of -\fIcount\fR are optional. If the \fBdisplay\fR submodifier is given, -then each visual display line is counted separately. Otherwise, if -\fBany\fR (or no modifier) is given, then each logical line (no matter -how many times it is visually wrapped) counts just once. If the relevant -lines are not wrapped, then these two methods of counting are equivalent. -.VE 8.5 +. +Adjust the index forward by \fIcount\fR lines, retaining the same character +position within the line. If there are fewer than \fIcount\fR lines after the +line containing the current index, then set the index to refer to the same +character position on the last line of the text. Then, if the line is not long +enough to contain a character at the indicated character position, adjust the +character position to refer to the last character of the line (the newline). +Spaces on either side of \fIcount\fR are optional. If the \fBdisplay\fR +submodifier is given, then each visual display line is counted separately. +Otherwise, if \fBany\fR (or no modifier) is given, then each logical line (no +matter how many times it is visually wrapped) counts just once. If the +relevant lines are not wrapped, then these two methods of counting are +equivalent. .TP \fB\- \fIcount\fR ?\fIsubmodifier\fR? \fBlines\fR -.VS 8.5 -Adjust the index backward by \fIcount\fR logical lines, retaining the -same character position within the line. If there are fewer than -\fIcount\fR lines before the line containing the current index, then set -the index to refer to the same character position on the first line of -the text. Then, if the line is not long enough to contain a character at -the indicated character position, adjust the character position to refer -to the last character of the line (the newline). Spaces on either side -of \fIcount\fR are optional. If the \fBdisplay\fR submodifier is given, -then each visual display line is counted separately. Otherwise, if -\fBany\fR (or no modifier) is given, then each logical line (no matter -how many times it is visually wrapped) counts just once. If the relevant -lines are not wrapped, then these two methods of counting are equivalent. -.VE 8.5 +. +Adjust the index backward by \fIcount\fR logical lines, retaining the same +character position within the line. If there are fewer than \fIcount\fR lines +before the line containing the current index, then set the index to refer to +the same character position on the first line of the text. Then, if the line +is not long enough to contain a character at the indicated character position, +adjust the character position to refer to the last character of the line (the +newline). Spaces on either side of \fIcount\fR are optional. If the +\fBdisplay\fR submodifier is given, then each visual display line is counted +separately. Otherwise, if \fBany\fR (or no modifier) is given, then each +logical line (no matter how many times it is visually wrapped) counts just +once. If the relevant lines are not wrapped, then these two methods of +counting are equivalent. .TP ?\fIsubmodifier\fR? \fBlinestart\fR -.VS 8.5 -Adjust the index to refer to the first index on the line. If the -\fBdisplay\fR submodifier is given, this is the first index on the -display line, otherwise on the logical line. -.VE 8.5 +. +Adjust the index to refer to the first index on the line. If the \fBdisplay\fR +submodifier is given, this is the first index on the display line, otherwise +on the logical line. .TP ?\fIsubmodifier\fR? \fBlineend\fR -.VS 8.5 -Adjust the index to refer to the last index on the line (the -newline). If the \fBdisplay\fR submodifier is given, this is the last -index on the display line, otherwise on the logical line. -.VE 8.5 +. +Adjust the index to refer to the last index on the line (the newline). If the +\fBdisplay\fR submodifier is given, this is the last index on the display +line, otherwise on the logical line. .TP ?\fIsubmodifier\fR? \fBwordstart\fR -.VS 8.5 -Adjust the index to refer to the first character of the word containing -the current index. A word consists of any number of adjacent characters -that are letters, digits, or underscores, or a single character that is -not one of these. If the \fBdisplay\fR submodifier is given, this only -examines non-elided characters, otherwise all characters (elided or not) -are examined. -.VE 8.5 +. +Adjust the index to refer to the first character of the word containing the +current index. A word consists of any number of adjacent characters that are +letters, digits, or underscores, or a single character that is not one of +these. If the \fBdisplay\fR submodifier is given, this only examines +non-elided characters, otherwise all characters (elided or not) are examined. .TP ?\fIsubmodifier\fR? \fBwordend\fR -.VS 8.5 -Adjust the index to refer to the character just after the last one of the -word containing the current index. If the current index refers to the -last character of the text then it is not modified. If the \fBdisplay\fR -submodifier is given, this only examines non-elided characters, otherwise -all characters (elided or not) are examined. +. +Adjust the index to refer to the character just after the last one of the word +containing the current index. If the current index refers to the last +character of the text then it is not modified. If the \fBdisplay\fR +submodifier is given, this only examines non-elided characters, otherwise all +characters (elided or not) are examined. .PP -If more than one modifier is present then they are applied in -left-to-right order. For example, the index +If more than one modifier is present then they are applied in left-to-right +order. For example, the index .QW "\fBend \- 1 chars\fR" refers to the next-to-last character in the text and .QW "\fBinsert wordstart \- 1 c\fR" -refers to the character just before -the first one in the word containing the insertion cursor. Modifiers -are applied one by one in this left to right order, and after each step -the resulting index is constrained to be a valid index in the text -widget. So, for example, the index +refers to the character just before the first one in the word containing the +insertion cursor. Modifiers are applied one by one in this left to right +order, and after each step the resulting index is constrained to be a valid +index in the text widget. So, for example, the index .QW "\fB1.0 \-1c +1c\fR" refers to the index .QW \fB2.0\fR . .PP -Where modifiers result in index changes by display lines, display chars -or display indices, and the \fIbase\fR refers to an index inside an -elided tag, +Where modifiers result in index changes by display lines, display chars or +display indices, and the \fIbase\fR refers to an index inside an elided tag, that base index is considered to be equivalent to the first following non-elided index. -.VE 8.5 .SH TAGS .PP -The first form of annotation in text widgets is a tag. -A tag is a textual string that is associated with some of the characters -in a text. -Tags may contain arbitrary characters, but it is probably best to -avoid using the characters +The first form of annotation in text widgets is a tag. A tag is a textual +string that is associated with some of the characters in a text. Tags may +contain arbitrary characters, but it is probably best to avoid using the +characters .QW " " -(space), \fB+\fR, or \fB\-\fR: -these characters have special meaning in indices, so tags containing -them cannot be used as indices. -There may be any number of tags associated with characters in a -text. -Each tag may refer to a single character, a range of characters, or -several ranges of characters. -An individual character may have any number of tags associated with it. +(space), \fB+\fR, or \fB\-\fR: these characters have special meaning in +indices, so tags containing them cannot be used as indices. There may be any +number of tags associated with characters in a text. Each tag may refer to a +single character, a range of characters, or several ranges of characters. An +individual character may have any number of tags associated with it. .PP -A priority order is defined among tags, and this order is used in -implementing some of the tag-related functions described below. -When a tag is defined (by associating it with characters or setting -its display options or binding commands to it), it is given -a priority higher than any existing tag. -The priority order of tags may be redefined using the +A priority order is defined among tags, and this order is used in implementing +some of the tag-related functions described below. When a tag is defined (by +associating it with characters or setting its display options or binding +commands to it), it is given a priority higher than any existing tag. The +priority order of tags may be redefined using the .QW "\fIpathName \fBtag raise\fR" and .QW "\fIpathName \fBtag lower\fR" widget commands. .PP -Tags serve three purposes in text widgets. -First, they control the way information is displayed on the screen. -By default, characters are displayed as determined by the -\fB\-background\fR, \fB\-font\fR, and \fB\-foreground\fR options for the -text widget. -However, display options may be associated with individual tags -using the +Tags serve three purposes in text widgets. First, they control the way +information is displayed on the screen. By default, characters are displayed +as determined by the \fB\-background\fR, \fB\-font\fR, and \fB\-foreground\fR +options for the text widget. However, display options may be associated with +individual tags using the .QW "\fIpathName \fBtag configure\fR" -widget command. -If a character has been tagged, then the display options associated -with the tag override the default display style. -The following options are currently supported for tags: +widget command. If a character has been tagged, then the display options +associated with the tag override the default display style. The following +options are currently supported for tags: .TP \fB\-background \fIcolor\fR -\fIColor\fR specifies the background color to use for characters -associated with the tag. -It may have any of the forms accepted by \fBTk_GetColor\fR. +. +\fIColor\fR specifies the background color to use for characters associated +with the tag. It may have any of the forms accepted by \fBTk_GetColor\fR. .TP \fB\-bgstipple \fIbitmap\fR -\fIBitmap\fR specifies a bitmap that is used as a stipple pattern -for the background. -It may have any of the forms accepted by \fBTk_GetBitmap\fR. -If \fIbitmap\fR has not been specified, or if it is specified -as an empty string, then a solid fill will be used for the -background. +. +\fIBitmap\fR specifies a bitmap that is used as a stipple pattern for the +background. It may have any of the forms accepted by \fBTk_GetBitmap\fR. If +\fIbitmap\fR has not been specified, or if it is specified as an empty string, +then a solid fill will be used for the background. .TP \fB\-borderwidth \fIpixels\fR -\fIPixels\fR specifies the width of a border to draw around -the tag using any of the forms accepted by \fBTk_GetPixels\fR. -This option should be used in conjuction with the -\fB\-relief\fR option to provide the desired border. +. +\fIPixels\fR specifies the width of a border to draw around the tag using any +of the forms accepted by \fBTk_GetPixels\fR. This option should be used in +conjuction with the \fB\-relief\fR option to provide the desired border. .TP \fB\-elide \fIboolean\fR -\fIElide\fR specifies whether the data should -be elided. Elided data (characters, images, embedded windows, etc) is -not displayed and takes no space on screen, but further on behaves just -as normal data. +. +\fIElide\fR specifies whether the data should be elided. Elided data +(characters, images, embedded windows, etc.) is not displayed and takes no +space on screen, but further on behaves just as normal data. .TP \fB\-fgstipple \fIbitmap\fR -\fIBitmap\fR specifies a bitmap that is used as a stipple pattern -when drawing text and other foreground information such as -underlines. -It may have any of the forms accepted by \fBTk_GetBitmap\fR. -If \fIbitmap\fR has not been specified, or if it is specified -as an empty string, then a solid fill will be used. +. +\fIBitmap\fR specifies a bitmap that is used as a stipple pattern when drawing +text and other foreground information such as underlines. It may have any of +the forms accepted by \fBTk_GetBitmap\fR. If \fIbitmap\fR has not been +specified, or if it is specified as an empty string, then a solid fill will be +used. .TP \fB\-font \fIfontName\fR -\fIFontName\fR is the name of a font to use for drawing characters. -It may have any of the forms accepted by \fBTk_GetFont\fR. +. +\fIFontName\fR is the name of a font to use for drawing characters. It may +have any of the forms accepted by \fBTk_GetFont\fR. .TP \fB\-foreground \fIcolor\fR -\fIColor\fR specifies the color to use when drawing text and other -foreground information such as underlines. -It may have any of the forms accepted by \fBTk_GetColor\fR. +. +\fIColor\fR specifies the color to use when drawing text and other foreground +information such as underlines. It may have any of the forms accepted by +\fBTk_GetColor\fR. .TP \fB\-justify \fIjustify\fR +. If the first non-elided character of a display line has a tag for which this -option has been specified, then \fIjustify\fR determines how to -justify the line. -It must be one of \fBleft\fR, \fBright\fR, or \fBcenter\fR. -If a line wraps, then the justification for each line on the -display is determined by the first non-elided character of that display line. +option has been specified, then \fIjustify\fR determines how to justify the +line. It must be one of \fBleft\fR, \fBright\fR, or \fBcenter\fR. If a line +wraps, then the justification for each line on the display is determined by +the first non-elided character of that display line. .TP \fB\-lmargin1 \fIpixels\fR +. If the first non-elided character of a text line has a tag for which this -option has been specified, then \fIpixels\fR specifies how -much the line should be indented from the left edge of the -window. -\fIPixels\fR may have any of the standard forms for screen -distances. -If a line of text wraps, this option only applies to the -first line on the display; the \fB\-lmargin2\fR option controls -the indentation for subsequent lines. +option has been specified, then \fIpixels\fR specifies how much the line +should be indented from the left edge of the window. \fIPixels\fR may have any +of the standard forms for screen distances. If a line of text wraps, this +option only applies to the first line on the display; the \fB\-lmargin2\fR +option controls the indentation for subsequent lines. .TP \fB\-lmargin2 \fIpixels\fR +. If the first non-elided character of a display line has a tag for which this -option has been specified, and if the display line is not the -first for its text line (i.e., the text line has wrapped), then -\fIpixels\fR specifies how much the line should be indented from -the left edge of the window. -\fIPixels\fR may have any of the standard forms for screen -distances. -This option is only used when wrapping is enabled, and it only -applies to the second and later display lines for a text line. +option has been specified, and if the display line is not the first for its +text line (i.e., the text line has wrapped), then \fIpixels\fR specifies how +much the line should be indented from the left edge of the window. +\fIPixels\fR may have any of the standard forms for screen distances. This +option is only used when wrapping is enabled, and it only applies to the +second and later display lines for a text line. .TP \fB\-offset \fIpixels\fR -\fIPixels\fR specifies an amount by which the text's baseline -should be offset vertically from the baseline of the overall -line, in pixels. -For example, a positive offset can be used for superscripts -and a negative offset can be used for subscripts. -\fIPixels\fR may have any of the standard forms for screen +. +\fIPixels\fR specifies an amount by which the text's baseline should be offset +vertically from the baseline of the overall line, in pixels. For example, a +positive offset can be used for superscripts and a negative offset can be used +for subscripts. \fIPixels\fR may have any of the standard forms for screen distances. .TP \fB\-overstrike \fIboolean\fR -Specifies whether or not to draw a horizontal rule through -the middle of characters. -\fIBoolean\fR may have any of the forms accepted by \fBTcl_GetBoolean\fR. +. +Specifies whether or not to draw a horizontal rule through the middle of +characters. \fIBoolean\fR may have any of the forms accepted by +\fBTcl_GetBoolean\fR. .TP \fB\-relief \fIrelief\fR -\fIRelief\fR specifies the relief style to use for drawing the border, -in any of the forms accepted by \fBTk_GetRelief\fR. -This option is used in conjunction with the \fB\-borderwidth\fR -option to enable to the desired border appearance. +. +\fIRelief\fR specifies the relief style to use for drawing the border, in any +of the forms accepted by \fBTk_GetRelief\fR. This option is used in +conjunction with the \fB\-borderwidth\fR option to enable to the desired +border appearance. .TP \fB\-rmargin \fIpixels\fR +. If the first non-elided character of a display line has a tag for which this -option has been specified, then \fIpixels\fR specifies how wide -a margin to leave between the end of the line and the right -edge of the window. -\fIPixels\fR may have any of the standard forms for screen -distances. -This option is only used when wrapping is enabled. -If a text line wraps, the right margin for each line on the -display is determined by the first non-elided character of that display -line. +option has been specified, then \fIpixels\fR specifies how wide a margin to +leave between the end of the line and the right edge of the window. +\fIPixels\fR may have any of the standard forms for screen distances. This +option is only used when wrapping is enabled. If a text line wraps, the right +margin for each line on the display is determined by the first non-elided +character of that display line. .TP \fB\-spacing1 \fIpixels\fR -\fIPixels\fR specifies how much additional space should be -left above each text line, using any of the standard forms for -screen distances. -If a line wraps, this option only applies to the first -line on the display. +. +\fIPixels\fR specifies how much additional space should be left above each +text line, using any of the standard forms for screen distances. If a line +wraps, this option only applies to the first line on the display. .TP \fB\-spacing2 \fIpixels\fR -For lines that wrap, this option specifies how much additional -space to leave between the display lines for a single text line. -\fIPixels\fR may have any of the standard forms for screen -distances. +. +For lines that wrap, this option specifies how much additional space to leave +between the display lines for a single text line. \fIPixels\fR may have any of +the standard forms for screen distances. .TP \fB\-spacing3 \fIpixels\fR -\fIPixels\fR specifies how much additional space should be -left below each text line, using any of the standard forms for -screen distances. -If a line wraps, this option only applies to the last -line on the display. +. +\fIPixels\fR specifies how much additional space should be left below each +text line, using any of the standard forms for screen distances. If a line +wraps, this option only applies to the last line on the display. .TP \fB\-tabs \fItabList\fR -\fITabList\fR specifies a set of tab stops in the same form -as for the \fB\-tabs\fR option for the text widget. This -option only applies to a display line if it applies to the -first non-elided character on that display line. -If this option is specified as an empty string, it cancels -the option, leaving it unspecified for the tag (the default). -If the option is specified as a non-empty string that is -an empty list, such as \fB\-tags\0{\0}\fR, then it requests -default 8-character tabs as described for the \fB\-tags\fR -widget option. +. +\fITabList\fR specifies a set of tab stops in the same form as for the +\fB\-tabs\fR option for the text widget. This option only applies to a display +line if it applies to the first non-elided character on that display line. If +this option is specified as an empty string, it cancels the option, leaving it +unspecified for the tag (the default). If the option is specified as a +non-empty string that is an empty list, such as \fB\-tags\0{\0}\fR, then it +requests default 8-character tabs as described for the \fB\-tags\fR widget +option. .TP \fB\-tabstyle \fIstyle\fR -\fIStyle\fR specifies either the \fItabular\fR or -\fIwordprocessor\fR style of tabbing to use for the text widget. -This option only applies to a display line if it applies to the -first non-elided character on that display line. -If this option is specified as an empty string, it cancels -the option, leaving it unspecified for the tag (the default). +. +\fIStyle\fR specifies either the \fItabular\fR or \fIwordprocessor\fR style of +tabbing to use for the text widget. This option only applies to a display line +if it applies to the first non-elided character on that display line. If this +option is specified as an empty string, it cancels the option, leaving it +unspecified for the tag (the default). .TP \fB\-underline \fIboolean\fR +. \fIBoolean\fR specifies whether or not to draw an underline underneath -characters. -It may have any of the forms accepted by \fBTcl_GetBoolean\fR. +characters. It may have any of the forms accepted by \fBTcl_GetBoolean\fR. .TP \fB\-wrap \fImode\fR -\fIMode\fR specifies how to handle lines that are wider than the -text's window. -It has the same legal values as the \fB\-wrap\fR option -for the text widget: \fBnone\fR, \fBchar\fR, or \fBword\fR. -If this tag option is specified, it overrides the \fB\-wrap\fR option -for the text widget. +. +\fIMode\fR specifies how to handle lines that are wider than the text's +window. It has the same legal values as the \fB\-wrap\fR option for the text +widget: \fBnone\fR, \fBchar\fR, or \fBword\fR. If this tag option is +specified, it overrides the \fB\-wrap\fR option for the text widget. .PP -If a character has several tags associated with it, and if their -display options conflict, then the options of the highest priority -tag are used. -If a particular display option has not been specified for a -particular tag, or if it is specified as an empty string, then -that option will never be used; the next-highest-priority -tag's option will used instead. -If no tag specifies a particular display option, then the default -style for the widget will be used. +If a character has several tags associated with it, and if their display +options conflict, then the options of the highest priority tag are used. If a +particular display option has not been specified for a particular tag, or if +it is specified as an empty string, then that option will never be used; the +next-highest-priority tag's option will used instead. If no tag specifies a +particular display option, then the default style for the widget will be used. .PP -The second purpose for tags is event bindings. -You can associate bindings with a tag in much the same way you can -associate bindings with a widget class: whenever particular X -events occur on characters with the given tag, a given -Tcl command will be executed. -Tag bindings can be used to give behaviors to ranges of characters; -among other things, this allows hypertext-like -features to be implemented. -For details, see the description of the +The second purpose for tags is event bindings. You can associate bindings with +a tag in much the same way you can associate bindings with a widget class: +whenever particular X events occur on characters with the given tag, a given +Tcl command will be executed. Tag bindings can be used to give behaviors to +ranges of characters; among other things, this allows hypertext-like features +to be implemented. For details, see the description of the .QW "\fIpathName \fBtag bind\fR" -widget command below. -.VS 8.5 -Tag bindings are shared between all peer widgets +widget command below. Tag bindings are shared between all peer widgets (including any bindings for the special \fBsel\fR tag). -.VE 8.5 .PP -The third use for tags is in managing the selection. -See \fBTHE SELECTION\fR below. -.VS 8.5 -With the exception of the special \fBsel\fR -tag, all tags are shared between peer text widgets, and may be -manipulated on an equal basis from any such widget. The \fBsel\fR -tag exists separately and independently in each peer text widget (but -any tag bindings to \fBsel\fR are shared). -.VE 8.5 +The third use for tags is in managing the selection. See \fBTHE SELECTION\fR +below. With the exception of the special \fBsel\fR tag, all tags are shared +between peer text widgets, and may be manipulated on an equal basis from any +such widget. The \fBsel\fR tag exists separately and independently in each +peer text widget (but any tag bindings to \fBsel\fR are shared). .SH MARKS .PP -The second form of annotation in text widgets is a mark. -Marks are used for remembering particular places in a text. -They are something like tags, in that they have names and -they refer to places in the file, but a mark is not associated -with particular characters. -Instead, a mark is associated with the gap between two characters. -Only a single position may be associated with a mark at any given -time. -If the characters around a mark are deleted the mark will still -remain; it will just have new neighbor characters. -In contrast, if the characters containing a tag are deleted then -the tag will no longer have an association with characters in -the file. -Marks may be manipulated with the +The second form of annotation in text widgets is a mark. Marks are used for +remembering particular places in a text. They are something like tags, in that +they have names and they refer to places in the file, but a mark is not +associated with particular characters. Instead, a mark is associated with the +gap between two characters. Only a single position may be associated with a +mark at any given time. If the characters around a mark are deleted the mark +will still remain; it will just have new neighbor characters. In contrast, if +the characters containing a tag are deleted then the tag will no longer have +an association with characters in the file. Marks may be manipulated with the .QW "\fIpathName \fBmark\fR" -widget -command, and their current locations may be determined by using the +widget command, and their current locations may be determined by using the mark name as an index in widget commands. .PP Each mark also has a .QW gravity , -which is either \fBleft\fR or \fBright\fR. -The gravity for a mark specifies what happens to the mark when -text is inserted at the point of the mark. -If a mark has left gravity, then the mark is treated as if it -were attached to the character on its left, so the mark will -remain to the left of any text inserted at the mark position. -If the mark has right gravity, new text inserted at the mark -position will appear to the left of the mark (so that the mark -remains rightmost). The gravity for a mark defaults to \fBright\fR. +which is either \fBleft\fR or \fBright\fR. The gravity for a mark specifies +what happens to the mark when text is inserted at the point of the mark. If a +mark has left gravity, then the mark is treated as if it were attached to the +character on its left, so the mark will remain to the left of any text +inserted at the mark position. If the mark has right gravity, new text +inserted at the mark position will appear to the left of the mark (so that the +mark remains rightmost). The gravity for a mark defaults to \fBright\fR. .PP -The name space for marks is different from that for tags: the -same name may be used for both a mark and a tag, but they will refer -to different things. +The name space for marks is different from that for tags: the same name may be +used for both a mark and a tag, but they will refer to different things. .PP -Two marks have special significance. -First, the mark \fBinsert\fR is associated with the insertion cursor, -as described under \fBTHE INSERTION CURSOR\fR below. -Second, the mark \fBcurrent\fR is associated with the character -closest to the mouse and is adjusted automatically to track the -mouse position and any changes to the text in the widget (one -exception: \fBcurrent\fR is not updated in response to mouse -motions if a mouse button is down; the update will be deferred -until all mouse buttons have been released). -Neither of these special marks may be deleted. -.VS 8.5 -With the exception of -these two special marks, all marks are shared between peer text -widgets, and may be manipulated on an equal basis from any peer. -.VE 8.5 +Two marks have special significance. First, the mark \fBinsert\fR is +associated with the insertion cursor, as described under \fBTHE INSERTION +CURSOR\fR below. Second, the mark \fBcurrent\fR is associated with the +character closest to the mouse and is adjusted automatically to track the +mouse position and any changes to the text in the widget (one exception: +\fBcurrent\fR is not updated in response to mouse motions if a mouse button is +down; the update will be deferred until all mouse buttons have been released). +Neither of these special marks may be deleted. With the exception of these two +special marks, all marks are shared between peer text widgets, and may be +manipulated on an equal basis from any peer. .SH "EMBEDDED WINDOWS" .PP -The third form of annotation in text widgets is an embedded window. -Each embedded window annotation causes a window to be displayed -at a particular point in the text. -There may be any number of embedded windows in a text widget, -and any widget may be used as an embedded window (subject to the -usual rules for geometry management, which require the text window -to be the parent of the embedded window or a descendant of its -parent). -The embedded window's position on the screen will be updated as the -text is modified or scrolled, and it will be mapped and unmapped as -it moves into and out of the visible area of the text widget. -Each embedded window occupies one -.VS 8.5 -unit's -.VE 8.5 -worth of index space -in the text widget, and it may be referred to either by the name -of its embedded window or by its position in the widget's -index space. -If the range of text containing the embedded window is deleted then -the window is destroyed. -.VS 8.5 -Similarly if the text widget as a whole is deleted, then the window is -destroyed. -.VE 8.5 +The third form of annotation in text widgets is an embedded window. Each +embedded window annotation causes a window to be displayed at a particular +point in the text. There may be any number of embedded windows in a text +widget, and any widget may be used as an embedded window (subject to the usual +rules for geometry management, which require the text window to be the parent +of the embedded window or a descendant of its parent). The embedded window's +position on the screen will be updated as the text is modified or scrolled, +and it will be mapped and unmapped as it moves into and out of the visible +area of the text widget. Each embedded window occupies one unit's worth of +index space in the text widget, and it may be referred to either by the name +of its embedded window or by its position in the widget's index space. If the +range of text containing the embedded window is deleted then the window is +destroyed. Similarly if the text widget as a whole is deleted, then the window +is destroyed. .PP -When an embedded window is added to a text widget with the -\fIpathName \fBwindow create\fR widget command, several configuration -options may be associated with it. -These options may be modified later with the \fIpathName \fBwindow configure\fR -widget command. -The following options are currently supported: +When an embedded window is added to a text widget with the \fIpathName +\fBwindow create\fR widget command, several configuration options may be +associated with it. These options may be modified later with the \fIpathName +\fBwindow configure\fR widget command. The following options are currently +supported: .TP \fB\-align \fIwhere\fR -If the window is not as tall as the line in which it is displayed, -this option determines where the window is displayed in the line. -\fIWhere\fR must have one of the values \fBtop\fR (align the top of the window -with the top of the line), \fBcenter\fR (center the window -within the range of the line), \fBbottom\fR (align the bottom of the -window with the bottom of the line's area), -or \fBbaseline\fR (align the bottom of the window with the baseline -of the line). +. +If the window is not as tall as the line in which it is displayed, this option +determines where the window is displayed in the line. \fIWhere\fR must have +one of the values \fBtop\fR (align the top of the window with the top of the +line), \fBcenter\fR (center the window within the range of the line), +\fBbottom\fR (align the bottom of the window with the bottom of the line's +area), or \fBbaseline\fR (align the bottom of the window with the baseline of +the line). .TP \fB\-create \fIscript\fR -Specifies a Tcl script that may be evaluated to create the window -for the annotation. -If no \fB\-window\fR option has been specified for the annotation -this script will be evaluated when the annotation is about to -be displayed on the screen. -\fIScript\fR must create a window for the annotation and return -the name of that window as its result. -.VS 8.5 -Two substitutions will be performed in \fIscript\fR before evaluation. -\fI%W\fR will be substituted by the name of the parent text widget, -and \fI%%\fR will be substituted by a single \fI%\fR. -.VE 8.5 -If the annotation's window should ever be deleted, \fIscript\fR -will be evaluated again the next time the annotation is displayed. +. +Specifies a Tcl script that may be evaluated to create the window for the +annotation. If no \fB\-window\fR option has been specified for the annotation +this script will be evaluated when the annotation is about to be displayed on +the screen. \fIScript\fR must create a window for the annotation and return +the name of that window as its result. Two substitutions will be performed in +\fIscript\fR before evaluation. \fI%W\fR will be substituted by the name of +the parent text widget, and \fI%%\fR will be substituted by a single \fI%\fR. +If the annotation's window should ever be deleted, \fIscript\fR will be +evaluated again the next time the annotation is displayed. .TP \fB\-padx \fIpixels\fR -\fIPixels\fR specifies the amount of extra space to leave on -each side of the embedded window. -It may have any of the usual forms defined for a screen distance. +. +\fIPixels\fR specifies the amount of extra space to leave on each side of the +embedded window. It may have any of the usual forms defined for a screen +distance. .TP \fB\-pady \fIpixels\fR -\fIPixels\fR specifies the amount of extra space to leave on -the top and on the bottom of the embedded window. -It may have any of the usual forms defined for a screen distance. +. +\fIPixels\fR specifies the amount of extra space to leave on the top and on +the bottom of the embedded window. It may have any of the usual forms defined +for a screen distance. .TP \fB\-stretch \fIboolean\fR -If the requested height of the embedded window is less than the -height of the line in which it is displayed, this option can be -used to specify whether the window should be stretched vertically -to fill its line. -If the \fB\-pady\fR option has been specified as well, then the -requested padding will be retained even if the window is -stretched. +. +If the requested height of the embedded window is less than the height of the +line in which it is displayed, this option can be used to specify whether the +window should be stretched vertically to fill its line. If the \fB\-pady\fR +option has been specified as well, then the requested padding will be retained +even if the window is stretched. .TP \fB\-window \fIpathName\fR -Specifies the name of a window to display in the annotation. -.VS 8.5 -Note that if a \fIpathName\fR has been set, then later configuring a -window to the empty string will not delete the widget corresponding to -the old \fIpathName\fR. Rather it will remove the association between -the old \fIpathName\fR and the text widget. If multiple peer widgets -are in use, it is usually simpler to use the \fB\-create\fR option if -embedded windows are desired in each peer. -.VE 8.5 +. +Specifies the name of a window to display in the annotation. Note that if a +\fIpathName\fR has been set, then later configuring a window to the empty +string will not delete the widget corresponding to the old \fIpathName\fR. +Rather it will remove the association between the old \fIpathName\fR and the +text widget. If multiple peer widgets are in use, it is usually simpler to use +the \fB\-create\fR option if embedded windows are desired in each peer. .SH "EMBEDDED IMAGES" .PP -The final form of annotation in text widgets is an embedded image. -Each embedded image annotation causes an image to be displayed -at a particular point in the text. -There may be any number of embedded images in a text widget, -and a particular image may be embedded in multiple places in the same -text widget. -The embedded image's position on the screen will be updated as the -text is modified or scrolled. -Each embedded image occupies one -.VS 8.5 -unit's -.VE 8.5 -worth of index space -in the text widget, and it may be referred to either by -its position in the widget's index space, or the name it is assigned -when the image is inserted into the text widget with \fIpathName \fBimage create\fR. -If the range of text containing the embedded image is deleted then -that copy of the image is removed from the screen. +The final form of annotation in text widgets is an embedded image. Each +embedded image annotation causes an image to be displayed at a particular +point in the text. There may be any number of embedded images in a text +widget, and a particular image may be embedded in multiple places in the same +text widget. The embedded image's position on the screen will be updated as +the text is modified or scrolled. Each embedded image occupies one unit's +worth of index space in the text widget, and it may be referred to either by +its position in the widget's index space, or the name it is assigned when the +image is inserted into the text widget with \fIpathName \fBimage create\fR. If +the range of text containing the embedded image is deleted then that copy of +the image is removed from the screen. .PP When an embedded image is added to a text widget with the \fIpathName \fBimage -create\fR widget command, a name unique to this instance of the image -is returned. This name may then be used to refer to this image -instance. The name is taken to be the value of the \fB\-name\fR option -(described below). If the \fB\-name\fR option is not provided, the -\fB\-image\fR name is used instead. If the \fIimageName\fR is already -in use in the text widget, then \fB#\fInn\fR is added to the end of the -\fIimageName\fR, where \fInn\fR is an arbitrary integer. This insures -the \fIimageName\fR is unique. -Once this name is assigned to this instance of the image, it does not -change, even though the \fB\-image\fR or \fB\-name\fR values can be changed -with \fIpathName \fBimage configure\fR. +create\fR widget command, a name unique to this instance of the image is +returned. This name may then be used to refer to this image instance. The name +is taken to be the value of the \fB\-name\fR option (described below). If the +\fB\-name\fR option is not provided, the \fB\-image\fR name is used instead. +If the \fIimageName\fR is already in use in the text widget, then \fB#\fInn\fR +is added to the end of the \fIimageName\fR, where \fInn\fR is an arbitrary +integer. This insures the \fIimageName\fR is unique. Once this name is +assigned to this instance of the image, it does not change, even though the +\fB\-image\fR or \fB\-name\fR values can be changed with \fIpathName \fBimage +configure\fR. .PP -When an embedded image is added to a text widget with the -\fIpathName \fBimage create\fR widget command, several configuration -options may be associated with it. -These options may be modified later with the \fIpathName \fBimage configure\fR -widget command. -The following options are currently supported: +When an embedded image is added to a text widget with the \fIpathName \fBimage +create\fR widget command, several configuration options may be associated with +it. These options may be modified later with the \fIpathName \fBimage +configure\fR widget command. The following options are currently supported: .TP \fB\-align \fIwhere\fR -If the image is not as tall as the line in which it is displayed, -this option determines where the image is displayed in the line. -\fIWhere\fR must have one of the values \fBtop\fR (align the top of the image -with the top of the line), \fBcenter\fR (center the image -within the range of the line), \fBbottom\fR (align the bottom of the -image with the bottom of the line's area), -or \fBbaseline\fR (align the bottom of the image with the baseline -of the line). +. +If the image is not as tall as the line in which it is displayed, this option +determines where the image is displayed in the line. \fIWhere\fR must have one +of the values \fBtop\fR (align the top of the image with the top of the line), +\fBcenter\fR (center the image within the range of the line), \fBbottom\fR +(align the bottom of the image with the bottom of the line's area), or +\fBbaseline\fR (align the bottom of the image with the baseline of the line). .TP \fB\-image \fIimage\fR -Specifies the name of the Tk image to display in the annotation. -If \fIimage\fR is not a valid Tk image, then an error is returned. +. +Specifies the name of the Tk image to display in the annotation. If +\fIimage\fR is not a valid Tk image, then an error is returned. .TP \fB\-name \fIImageName\fR -Specifies the name by which this image instance may be referenced in -the text widget. If \fIImageName\fR is not supplied, then the -name of the Tk image is used instead. -If the \fIimageName\fR is already in use, \fI#nn\fR is appended to -the end of the name as described above. +. +Specifies the name by which this image instance may be referenced in the text +widget. If \fIImageName\fR is not supplied, then the name of the Tk image is +used instead. If the \fIimageName\fR is already in use, \fI#nn\fR is appended +to the end of the name as described above. .TP \fB\-padx \fIpixels\fR -\fIPixels\fR specifies the amount of extra space to leave on -each side of the embedded image. -It may have any of the usual forms defined for a screen distance. +. +\fIPixels\fR specifies the amount of extra space to leave on each side of the +embedded image. It may have any of the usual forms defined for a screen +distance. .TP \fB\-pady \fIpixels\fR -\fIPixels\fR specifies the amount of extra space to leave on -the top and on the bottom of the embedded image. -It may have any of the usual forms defined for a screen distance. +. +\fIPixels\fR specifies the amount of extra space to leave on the top and on +the bottom of the embedded image. It may have any of the usual forms defined +for a screen distance. .SH "THE SELECTION" .PP -Selection support is implemented via tags. -If the \fBexportSelection\fR option for the text widget is true -then the \fBsel\fR tag will be associated with the selection: +Selection support is implemented via tags. If the \fBexportSelection\fR option +for the text widget is true then the \fBsel\fR tag will be associated with the +selection: .IP [1] -Whenever characters are tagged with \fBsel\fR the text widget -will claim ownership of the selection. +Whenever characters are tagged with \fBsel\fR the text widget will claim +ownership of the selection. .IP [2] -Attempts to retrieve the -selection will be serviced by the text widget, returning all the -characters with the \fBsel\fR tag. +Attempts to retrieve the selection will be serviced by the text widget, +returning all the characters with the \fBsel\fR tag. .IP [3] -If the selection is claimed away by another application or by another -window within this application, then the \fBsel\fR tag will be removed -from all characters in the text. +If the selection is claimed away by another application or by another window +within this application, then the \fBsel\fR tag will be removed from all +characters in the text. .IP [4] -Whenever the \fBsel\fR tag range changes a virtual event -\fB<>\fR is generated. +Whenever the \fBsel\fR tag range changes a virtual event \fB<>\fR +is generated. .PP -The \fBsel\fR tag is automatically defined when a text widget is -created, and it may not be deleted with the +The \fBsel\fR tag is automatically defined when a text widget is created, and +it may not be deleted with the .QW "\fIpathName \fBtag delete\fR" -widget command. Furthermore, the \fBselectBackground\fR, -\fBselectBorderWidth\fR, and \fBselectForeground\fR options for -the text widget are tied to the \fB\-background\fR, -\fB\-borderwidth\fR, and \fB\-foreground\fR options for the \fBsel\fR -tag: changes in either will automatically be reflected in the -other. -.VS 8.5 -Also the -\fB\-inactiveselectbackground\fR option for the text widget is used -instead of \fB\-selectbackground\fR when the text widget does not have -the focus. This allows programmatic control over the visualization of -the \fBsel\fR tag for foreground and background windows, or to have -\fBsel\fR not shown at all (when \fB\-inactiveselectbackground\fR is -empty) for background windows. Each peer text widget has its own -\fBsel\fR tag which can be separately configured and set. -.VE 8.5 +widget command. Furthermore, the \fBselectBackground\fR, +\fBselectBorderWidth\fR, and \fBselectForeground\fR options for the text +widget are tied to the \fB\-background\fR, \fB\-borderwidth\fR, and +\fB\-foreground\fR options for the \fBsel\fR tag: changes in either will +automatically be reflected in the other. Also the +\fB\-inactiveselectbackground\fR option for the text widget is used instead of +\fB\-selectbackground\fR when the text widget does not have the focus. This +allows programmatic control over the visualization of the \fBsel\fR tag for +foreground and background windows, or to have \fBsel\fR not shown at all (when +\fB\-inactiveselectbackground\fR is empty) for background windows. Each peer +text widget has its own \fBsel\fR tag which can be separately configured and +set. .SH "THE INSERTION CURSOR" .PP -The mark named \fBinsert\fR has special significance in text widgets. -It is defined automatically when a text widget is created and it -may not be unset with the +The mark named \fBinsert\fR has special significance in text widgets. It is +defined automatically when a text widget is created and it may not be unset +with the .QW "\fIpathName \fBmark unset\fR" -widget command. -The \fBinsert\fR mark represents the position of the insertion -cursor, and the insertion cursor will automatically be drawn at -this point whenever the text widget has the input focus. +widget command. The \fBinsert\fR mark represents the position of the insertion +cursor, and the insertion cursor will automatically be drawn at this point +whenever the text widget has the input focus. .SH "THE MODIFIED FLAG" -The text widget can keep track of changes to the content of the widget -by means of the modified flag. Inserting or deleting text will set -this flag. The flag can be queried, set and cleared programmatically -as well. Whenever the flag changes state a \fB<>\fR virtual -event is generated. See the \fIpathName \fBedit modified\fR widget command for -more details. +.PP +The text widget can keep track of changes to the content of the widget by +means of the modified flag. Inserting or deleting text will set this flag. The +flag can be queried, set and cleared programmatically as well. Whenever the +flag changes state a \fB<>\fR virtual event is generated. See the +\fIpathName \fBedit modified\fR widget command for more details. .SH "THE UNDO MECHANISM" .PP The text widget has an unlimited undo and redo mechanism (when the -\fB\-undo\fR widget option is true) which records every insert and -delete action on a stack. +\fB\-undo\fR widget option is true) which records every insert and delete +action on a stack. .PP Boundaries (called .QW separators ) -are inserted between edit actions. The -purpose of these separators is to group inserts, deletes and replaces -into one compound edit action. When undoing a change everything between -two separators will be undone. The undone changes are then moved to the -redo stack, so that an undone edit can be redone again. The redo stack -is cleared whenever new edit actions are recorded on the undo stack. The -undo and redo stacks can be cleared to keep their depth under control. +are inserted between edit actions. The purpose of these separators is to group +inserts, deletes and replaces into one compound edit action. When undoing a +change everything between two separators will be undone. The undone changes +are then moved to the redo stack, so that an undone edit can be redone again. +The redo stack is cleared whenever new edit actions are recorded on the undo +stack. The undo and redo stacks can be cleared to keep their depth under +control. .PP -Separators are inserted automatically when the \fB\-autoseparators\fR -widget option is true. You can insert separators programmatically as -well. If a separator is already present at the top of the undo stack -no other will be inserted. That means that two separators on the undo -stack are always separated by at least one insert or delete action. +Separators are inserted automatically when the \fB\-autoseparators\fR widget +option is true. You can insert separators programmatically as well. If a +separator is already present at the top of the undo stack no other will be +inserted. That means that two separators on the undo stack are always +separated by at least one insert or delete action. .PP -The undo mechanism is also linked to the modified flag. This means -that undoing or redoing changes can take a modified text widget back -to the unmodified state or vice versa. The modified flag will be set -automatically to the appropriate state. This automatic coupling -does not work when the modified flag has been set by the user, until -the flag has been reset again. +The undo mechanism is also linked to the modified flag. This means that +undoing or redoing changes can take a modified text widget back to the +unmodified state or vice versa. The modified flag will be set automatically to +the appropriate state. This automatic coupling does not work when the modified +flag has been set by the user, until the flag has been reset again. .PP See below for the \fIpathName \fBedit\fR widget command that controls the undo mechanism. .SH "PEER WIDGETS" .PP -.VS 8.5 -The text widget has a separate store of all its data concerning each -line's textual contents, marks, tags, images and windows, and the undo -stack. +The text widget has a separate store of all its data concerning each line's +textual contents, marks, tags, images and windows, and the undo stack. .PP -While this data store cannot be accessed directly (i.e. without a text -widget as an intermediary), multiple text widgets can be created, each -of which present different views on the same underlying data. Such -text widgets are known as peer text widgets. +While this data store cannot be accessed directly (i.e. without a text widget +as an intermediary), multiple text widgets can be created, each of which +present different views on the same underlying data. Such text widgets are +known as peer text widgets. .PP As text is added, deleted, edited and coloured in any one widget, and as -images, marks, tags are adjusted, all such changes will be reflected in -all peers. +images, marks, tags are adjusted, all such changes will be reflected in all +peers. .PP -All data and markup is shared, except for a few small details. First, -the \fBsel\fR tag may be set and configured (in its display style) -differently for each peer. Second, each peer has its own \fBinsert\fR -and \fBcurrent\fR mark positions (but all other marks are shared). -Third, embedded windows, which are arbitrary other widgets, cannot be -shared between peers. This means the \fB\-window\fR option of embedded -windows is independently set for each peer (it is advisable to use -the \fB\-create\fR script capabilities to allow each peer to create its -own embedded windows as needed). Fourth, all of the configuration -options of each peer (e.g. \fB\-font\fR, etc) can be set independently, -with the exception of \fB\-undo\fR, \fB\-maxUndo\fR, \fB\-autoSeparators\fR -(i.e. all undo, redo and modified state issues are shared). +All data and markup is shared, except for a few small details. First, the +\fBsel\fR tag may be set and configured (in its display style) differently for +each peer. Second, each peer has its own \fBinsert\fR and \fBcurrent\fR mark +positions (but all other marks are shared). Third, embedded windows, which are +arbitrary other widgets, cannot be shared between peers. This means the +\fB\-window\fR option of embedded windows is independently set for each peer +(it is advisable to use the \fB\-create\fR script capabilities to allow each +peer to create its own embedded windows as needed). Fourth, all of the +configuration options of each peer (e.g. \fB\-font\fR, etc) can be set +independently, with the exception of \fB\-undo\fR, \fB\-maxUndo\fR, +\fB\-autoSeparators\fR (i.e. all undo, redo and modified state issues are +shared). .PP -Finally any single peer need not contain all lines from the underlying -data store. When creating a peer, a contiguous range of lines (e.g. -only lines 52 through 125) may be specified. This allows a peer to -contain just a small portion of the overall text. The range of lines -will expand and contract as text is inserted or deleted. The peer will -only ever display complete lines of text (one cannot share just part of -a line). If the peer's contents contracts to nothing (i.e. all complete -lines in the peer widget have been deleted from another widget), then it -is impossible for new lines to be inserted. The peer will simply become -an empty shell on which the background can be configured, but which will -never show any content (without manual reconfiguration of the start and -end lines). Note that a peer which does not contain all of the +Finally any single peer need not contain all lines from the underlying data +store. When creating a peer, a contiguous range of lines (e.g. only lines 52 +through 125) may be specified. This allows a peer to contain just a small +portion of the overall text. The range of lines will expand and contract as +text is inserted or deleted. The peer will only ever display complete lines of +text (one cannot share just part of a line). If the peer's contents contracts +to nothing (i.e. all complete lines in the peer widget have been deleted from +another widget), then it is impossible for new lines to be inserted. The peer +will simply become an empty shell on which the background can be configured, +but which will never show any content (without manual reconfiguration of the +start and end lines). Note that a peer which does not contain all of the underlying data store still has indices numbered from .QW 1.0 to .QW end . -It is simply that those indices reflect a subset of the total data, and -data outside the contained range is not accessible to the peer. This -means that the command \fIpeerName \fBindex end\fR may return quite different -values in different peers. Similarly, commands like \fIpeerName \fBtag -ranges\fR will not return index ranges outside that which is meaningful -to the peer. The configuration options \fB\-startline\fR and -\fB\-endline\fR may be used to control how much of the underlying data is -contained in any given text widget. +It is simply that those indices reflect a subset of the total data, and data +outside the contained range is not accessible to the peer. This means that the +command \fIpeerName \fBindex end\fR may return quite different values in +different peers. Similarly, commands like \fIpeerName \fBtag ranges\fR will +not return index ranges outside that which is meaningful to the peer. The +configuration options \fB\-startline\fR and \fB\-endline\fR may be used to +control how much of the underlying data is contained in any given text widget. .PP -Note that peers are really peers. Deleting the +Note that peers are really peers. Deleting the .QW original text widget will not cause any other peers to be deleted, or otherwise affected. .PP See below for the \fIpathName \fBpeer\fR widget command that controls the creation of peer widgets. -.VE 8.5 .SH "WIDGET COMMAND" .PP -The \fBtext\fR command creates a new Tcl command whose -name is the same as the path name of the text's window. This -command may be used to invoke various -operations on the widget. It has the following general form: +The \fBtext\fR command creates a new Tcl command whose name is the same as the +path name of the text's window. This command may be used to invoke various +operations on the widget. It has the following general form: .CS \fIpathName option \fR?\fIarg arg ...\fR? .CE -\fIPathName\fR is the name of the command, which is the same as -the text widget's path name. \fIOption\fR and the \fIarg\fRs -determine the exact behavior of the command. The following -commands are possible for text widgets: +\fIPathName\fR is the name of the command, which is the same as the text +widget's path name. \fIOption\fR and the \fIarg\fRs determine the exact +behavior of the command. The following commands are possible for text widgets: .TP \fIpathName \fBbbox \fIindex\fR -Returns a list of four elements describing the screen area -of the character given by \fIindex\fR. -The first two elements of the list give the x and y coordinates -of the upper-left corner of the area occupied by the -character, and the last two elements give the width and height -of the area. -If the character is only partially visible on the screen, then -the return value reflects just the visible part. -If the character is not visible on the screen then the return -value is an empty list. +. +Returns a list of four elements describing the screen area of the character +given by \fIindex\fR. The first two elements of the list give the x and y +coordinates of the upper-left corner of the area occupied by the character, +and the last two elements give the width and height of the area. If the +character is only partially visible on the screen, then the return value +reflects just the visible part. If the character is not visible on the screen +then the return value is an empty list. .TP \fIpathName \fBcget\fR \fIoption\fR -Returns the current value of the configuration option given -by \fIoption\fR. -\fIOption\fR may have any of the values accepted by the \fBtext\fR -command. +. +Returns the current value of the configuration option given by \fIoption\fR. +\fIOption\fR may have any of the values accepted by the \fBtext\fR command. .TP \fIpathName \fBcompare\fR \fIindex1 op index2\fR -Compares the indices given by \fIindex1\fR and \fIindex2\fR according -to the relational operator given by \fIop\fR, and returns 1 if -the relationship is satisfied and 0 if it is not. -\fIOp\fR must be one of the operators <, <=, ==, >=, >, or !=. -If \fIop\fR is == then 1 is returned if the two indices refer to -the same character, if \fIop\fR is < then 1 is returned if \fIindex1\fR -refers to an earlier character in the text than \fIindex2\fR, and -so on. +. +Compares the indices given by \fIindex1\fR and \fIindex2\fR according to the +relational operator given by \fIop\fR, and returns 1 if the relationship is +satisfied and 0 if it is not. \fIOp\fR must be one of the operators <, <=, ==, +>=, >, or !=. If \fIop\fR is == then 1 is returned if the two indices refer to +the same character, if \fIop\fR is < then 1 is returned if \fIindex1\fR refers +to an earlier character in the text than \fIindex2\fR, and so on. .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? \fI?value option value ...\fR? -Query or modify the configuration options of the widget. -If no \fIoption\fR is specified, returns a list describing all of -the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for -information on the format of this list). If \fIoption\fR is specified -with no \fIvalue\fR, then the command returns a list describing the -one named option (this list will be identical to the corresponding -sublist of the value returned if no \fIoption\fR is specified). If -one or more \fIoption\-value\fR pairs are specified, then the command -modifies the given widget option(s) to have the given value(s); in -this case the command returns an empty string. -\fIOption\fR may have any of the values accepted by the \fBtext\fR -command. -.VS 8.5 +. +Query or modify the configuration options of the widget. If no \fIoption\fR is +specified, returns a list describing all of the available options for +\fIpathName\fR (see \fBTk_ConfigureInfo\fR for information on the format of +this list). If \fIoption\fR is specified with no \fIvalue\fR, then the command +returns a list describing the one named option (this list will be identical to +the corresponding sublist of the value returned if no \fIoption\fR is +specified). If one or more \fIoption\-value\fR pairs are specified, then the +command modifies the given widget option(s) to have the given value(s); in +this case the command returns an empty string. \fIOption\fR may have any of +the values accepted by the \fBtext\fR command. .TP \fIpathName \fBcount\fR \fI?options\fR? \fIindex1 index2\fR -Counts the number of relevant things between the two indices. -If \fIindex1\fR is after \fIindex2\fR, the result will be a negative number -(and this holds for each of the possible options). -The actual items which are counted depend on the -options given. The result is a list of integers, one for the result of -each counting option given. Valid counting options are \fB\-chars\fR, +. +Counts the number of relevant things between the two indices. If \fIindex1\fR +is after \fIindex2\fR, the result will be a negative number (and this holds +for each of the possible options). The actual items which are counted depend +on the options given. The result is a list of integers, one for the result of +each counting option given. Valid counting options are \fB\-chars\fR, \fB\-displaychars\fR, \fB\-displayindices\fR, \fB\-displaylines\fR, \fB\-indices\fR, \fB\-lines\fR, \fB\-xpixels\fR and \fB\-ypixels\fR. The default value, if no option is specified, is \fB\-indices\fR. There is an -additional possible option \fB\-update\fR which is a modifier. If given, -then all subsequent options ensure that any possible out of date -information is recalculated. This currently only has any effect for the -\fI\-ypixels\fR count (which, if \fB\-update\fR is not given, will use the text -widget's current cached value for each line). The count options are -interpreted as follows: +additional possible option \fB\-update\fR which is a modifier. If given, then +all subsequent options ensure that any possible out of date information is +recalculated. This currently only has any effect for the \fI\-ypixels\fR count +(which, if \fB\-update\fR is not given, will use the text widget's current +cached value for each line). The count options are interpreted as follows: .RS .IP \fB\-chars\fR -count all characters, whether elided or not. Do not count -embedded windows or images. +count all characters, whether elided or not. Do not count embedded windows or +images. .IP \fB\-displaychars\fR count all non-elided characters. .IP \fB\-displayindices\fR count all non-elided characters, windows and images. .IP \fB\-displaylines\fR -count all display lines (i.e. counting one for each -time a line wraps) from the line of the first index up to, but not -including the display line of the second index. Therefore if they are -both on the same display line, zero will be returned. By definition -displaylines are visible and therefore this only counts portions of -actual visible lines. +count all display lines (i.e. counting one for each time a line wraps) from +the line of the first index up to, but not including the display line of the +second index. Therefore if they are both on the same display line, zero will +be returned. By definition displaylines are visible and therefore this only +counts portions of actual visible lines. .IP \fB\-indices\fR -count all characters and embedded windows or images (i.e. -everything which counts in text-widget index space), whether they are -elided or not. +count all characters and embedded windows or images (i.e. everything which +counts in text-widget index space), whether they are elided or not. .IP \fB\-lines\fR -count all logical lines (irrespective of wrapping) from -the line of the first index up to, but not including the line of the -second index. Therefore if they are both on the same line, zero will be -returned. Logical lines are counted whether they are currently visible -(non-elided) or not. +count all logical lines (irrespective of wrapping) from the line of the first +index up to, but not including the line of the second index. Therefore if they +are both on the same line, zero will be returned. Logical lines are counted +whether they are currently visible (non-elided) or not. .IP \fB\-xpixels\fR -count the number of horizontal pixels from the first -pixel of the first index to (but not including) the first pixel of the -second index. To count the total desired width of the text widget -(assuming wrapping is not enabled), first find the longest line and then -use +count the number of horizontal pixels from the first pixel of the first index +to (but not including) the first pixel of the second index. To count the total +desired width of the text widget (assuming wrapping is not enabled), first +find the longest line and then use .QW ".text count \-xpixels \N'34'${line}.0\N'34' \N'34'${line}.0 lineend\N'34'" . .IP \fB\-ypixels\fR -count the number of vertical pixels from the first pixel -of the first index to (but not including) the first pixel of the second -index. If both indices are on the same display line, zero will be -returned. To count the total number of vertical pixels in the text -widget, use +count the number of vertical pixels from the first pixel of the first index to +(but not including) the first pixel of the second index. If both indices are +on the same display line, zero will be returned. To count the total number of +vertical pixels in the text widget, use .QW ".text count \-ypixels 1.0 end" , and to ensure this is up to date, use .QW ".text count \-update \-ypixels 1.0 end" . .PP -The command returns a positive or negative integer corresponding to the -number of items counted between the two indices. One such integer is -returned for each counting option given, so a list is returned if more -than one option was supplied. For example +The command returns a positive or negative integer corresponding to the number +of items counted between the two indices. One such integer is returned for +each counting option given, so a list is returned if more than one option was +supplied. For example .QW ".text count \-xpixels \-ypixels 1.3 4.5" is perfectly valid and will return a list of two elements. .RE -.VE 8.5 .TP \fIpathName \fBdebug \fR?\fIboolean\fR? -If \fIboolean\fR is specified, then it must have one of the true or -false values accepted by Tcl_GetBoolean. -If the value is a true one then internal consistency checks will be -turned on in the B-tree code associated with text widgets. -If \fIboolean\fR has a false value then the debugging checks will -be turned off. -In either case the command returns an empty string. -If \fIboolean\fR is not specified then the command returns \fBon\fR -or \fBoff\fR to indicate whether or not debugging is turned on. -There is a single debugging switch shared by all text widgets: turning -debugging on or off in any widget turns it on or off for all widgets. -For widgets with large amounts of text, the consistency checks may -cause a noticeable slow-down. +. +If \fIboolean\fR is specified, then it must have one of the true or false +values accepted by Tcl_GetBoolean. If the value is a true one then internal +consistency checks will be turned on in the B-tree code associated with text +widgets. If \fIboolean\fR has a false value then the debugging checks will be +turned off. In either case the command returns an empty string. If +\fIboolean\fR is not specified then the command returns \fBon\fR or \fBoff\fR +to indicate whether or not debugging is turned on. There is a single debugging +switch shared by all text widgets: turning debugging on or off in any widget +turns it on or off for all widgets. For widgets with large amounts of text, +the consistency checks may cause a noticeable slow-down. .RS .PP -When debugging is turned on, the drawing routines of the text widget -set the global variables \fBtk_textRedraw\fR and \fBtk_textRelayout\fR -to the lists of indices that are redrawn. The values of these variables -are tested by Tk's test suite. +When debugging is turned on, the drawing routines of the text widget set the +global variables \fBtk_textRedraw\fR and \fBtk_textRelayout\fR to the lists of +indices that are redrawn. The values of these variables are tested by Tk's +test suite. .RE .TP \fIpathName \fBdelete \fIindex1 \fR?\fIindex2 ...\fR? -Delete a range of characters from the text. -If both \fIindex1\fR and \fIindex2\fR are specified, then delete -all the characters starting with the one given by \fIindex1\fR -and stopping just before \fIindex2\fR (i.e. the character at -\fIindex2\fR is not deleted). -If \fIindex2\fR does not specify a position later in the text -than \fIindex1\fR then no characters are deleted. -If \fIindex2\fR is not specified then the single character at -\fIindex1\fR is deleted. -It is not allowable to delete characters in a way that would leave -the text without a newline as the last character. -The command returns an empty string. -If more indices are given, multiple ranges of text will be deleted. -All indices are first checked for validity before any deletions are made. -They are sorted and the text is removed from the last range to the -first range to deleted text does not cause an undesired index shifting -side-effects. If multiple ranges with the same start index are given, -then the longest range is used. If overlapping ranges are given, then -they will be merged into spans that do not cause deletion of text -outside the given ranges due to text shifted during deletion. +. +Delete a range of characters from the text. If both \fIindex1\fR and +\fIindex2\fR are specified, then delete all the characters starting with the +one given by \fIindex1\fR and stopping just before \fIindex2\fR (i.e. the +character at \fIindex2\fR is not deleted). If \fIindex2\fR does not specify a +position later in the text than \fIindex1\fR then no characters are deleted. +If \fIindex2\fR is not specified then the single character at \fIindex1\fR is +deleted. It is not allowable to delete characters in a way that would leave +the text without a newline as the last character. The command returns an empty +string. If more indices are given, multiple ranges of text will be deleted. +All indices are first checked for validity before any deletions are made. They +are sorted and the text is removed from the last range to the first range to +deleted text does not cause an undesired index shifting side-effects. If +multiple ranges with the same start index are given, then the longest range is +used. If overlapping ranges are given, then they will be merged into spans +that do not cause deletion of text outside the given ranges due to text +shifted during deletion. .TP \fIpathName \fBdlineinfo \fIindex\fR -Returns a list with five elements describing the area occupied -by the display line containing \fIindex\fR. -The first two elements of the list give the x and y coordinates -of the upper-left corner of the area occupied by the -line, the third and fourth elements give the width and height -of the area, and the fifth element gives the position of the baseline -for the line, measured down from the top of the area. -All of this information is measured in pixels. -If the current wrap mode is \fBnone\fR and the line extends beyond -the boundaries of the window, -the area returned reflects the entire area of the line, including the -portions that are out of the window. -If the line is shorter than the full width of the window then the -area returned reflects just the portion of the line that is occupied -by characters and embedded windows. -If the display line containing \fIindex\fR is not visible on -the screen then the return value is an empty list. +. +Returns a list with five elements describing the area occupied by the display +line containing \fIindex\fR. The first two elements of the list give the x and +y coordinates of the upper-left corner of the area occupied by the line, the +third and fourth elements give the width and height of the area, and the fifth +element gives the position of the baseline for the line, measured down from +the top of the area. All of this information is measured in pixels. If the +current wrap mode is \fBnone\fR and the line extends beyond the boundaries of +the window, the area returned reflects the entire area of the line, including +the portions that are out of the window. If the line is shorter than the full +width of the window then the area returned reflects just the portion of the +line that is occupied by characters and embedded windows. If the display line +containing \fIindex\fR is not visible on the screen then the return value is +an empty list. .TP \fIpathName \fBdump \fR?\fIswitches\fR? \fIindex1 \fR?\fIindex2\fR? -Return the contents of the text widget from \fIindex1\fR up to, -but not including \fIindex2\fR, -including the text and -information about marks, tags, and embedded windows. -If \fIindex2\fR is not specified, then it defaults to -one character past \fIindex1\fR. The information is returned -in the following format: +. +Return the contents of the text widget from \fIindex1\fR up to, but not +including \fIindex2\fR, including the text and information about marks, tags, +and embedded windows. If \fIindex2\fR is not specified, then it defaults to +one character past \fIindex1\fR. The information is returned in the following +format: .LP .RS \fIkey1 value1 index1 key2 value2 index2\fR ... .LP -The possible \fIkey\fR values are \fBtext\fR, \fBmark\fR, -\fBtagon\fR, \fBtagoff\fR, \fBimage\fR, and \fBwindow\fR. The corresponding -\fIvalue\fR is the text, mark name, tag name, image name, or window name. -The \fIindex\fR information is the index of the -start of the text, mark, tag transition, image or window. -One or more of the following switches (or abbreviations thereof) +The possible \fIkey\fR values are \fBtext\fR, \fBmark\fR, \fBtagon\fR, +\fBtagoff\fR, \fBimage\fR, and \fBwindow\fR. The corresponding \fIvalue\fR is +the text, mark name, tag name, image name, or window name. The \fIindex\fR +information is the index of the start of the text, mark, tag transition, image +or window. One or more of the following switches (or abbreviations thereof) may be specified to control the dump: .TP \fB\-all\fR +. Return information about all elements: text, marks, tags, images and windows. This is the default. .TP \fB\-command \fIcommand\fR +. Instead of returning the information as the result of the dump operation, invoke the \fIcommand\fR on each element of the text widget within the range. -The command has three arguments appended to it before it is evaluated: -the \fIkey\fR, \fIvalue\fR, and \fIindex\fR. +The command has three arguments appended to it before it is evaluated: the +\fIkey\fR, \fIvalue\fR, and \fIindex\fR. .TP \fB\-image\fR +. Include information about images in the dump results. .TP \fB\-mark\fR +. Include information about marks in the dump results. .TP \fB\-tag\fR -Include information about tag transitions in the dump results. Tag -information is returned as \fBtagon\fR and \fBtagoff\fR elements that -indicate the begin and end of each range of each tag, respectively. +. +Include information about tag transitions in the dump results. Tag information +is returned as \fBtagon\fR and \fBtagoff\fR elements that indicate the begin +and end of each range of each tag, respectively. .TP \fB\-text\fR -Include information about text in the dump results. The value is the -text up to the next element or the end of range indicated by \fIindex2\fR. -A text element does not span newlines. A multi-line block of text that -contains no marks or tag transitions will still be dumped as a set -of text segments that each end with a newline. The newline is part -of the value. +. +Include information about text in the dump results. The value is the text up +to the next element or the end of range indicated by \fIindex2\fR. A text +element does not span newlines. A multi-line block of text that contains no +marks or tag transitions will still be dumped as a set of text segments that +each end with a newline. The newline is part of the value. .TP \fB\-window\fR -Include information about embedded windows in the dump results. -The value of a window is its Tk pathname, unless the window -has not been created yet. (It must have a create script.) -In this case an empty string is returned, and you must query the -window by its index position to get more information. +. +Include information about embedded windows in the dump results. The value of a +window is its Tk pathname, unless the window has not been created yet. (It +must have a create script.) In this case an empty string is returned, and you +must query the window by its index position to get more information. .RE .TP \fIpathName \fBedit \fIoption \fR?\fIarg arg ...\fR? -This command controls the undo mechanism and the modified flag. The -exact behavior of the command depends on the \fIoption\fR argument -that follows the \fBedit\fR argument. The following forms of the -command are currently supported: +. +This command controls the undo mechanism and the modified flag. The exact +behavior of the command depends on the \fIoption\fR argument that follows the +\fBedit\fR argument. The following forms of the command are currently +supported: .RS .TP \fIpathName \fBedit modified ?\fIboolean\fR? -If \fIboolean\fR is not specified, returns the modified flag of the -widget. The insert, delete, edit undo and edit redo commands or the -user can set or clear the modified flag. If \fIboolean\fR is -specified, sets the modified flag of the widget to \fIboolean\fR. +. +If \fIboolean\fR is not specified, returns the modified flag of the widget. +The insert, delete, edit undo and edit redo commands or the user can set or +clear the modified flag. If \fIboolean\fR is specified, sets the modified flag +of the widget to \fIboolean\fR. .TP \fIpathName \fBedit redo\fR -When the \fB\-undo\fR option is true, reapplies the last undone edits -provided no other edits were done since then. Generates an error when -the redo stack is empty. Does nothing when the \fB\-undo\fR option is -false. +. +When the \fB\-undo\fR option is true, reapplies the last undone edits provided +no other edits were done since then. Generates an error when the redo stack is +empty. Does nothing when the \fB\-undo\fR option is false. .TP \fIpathName \fBedit reset\fR +. Clears the undo and redo stacks. .TP \fIpathName \fBedit separator\fR -Inserts a separator (boundary) on the undo stack. Does nothing when -the \fB\-undo\fR option is false. +. +Inserts a separator (boundary) on the undo stack. Does nothing when the +\fB\-undo\fR option is false. .TP \fIpathName \fBedit undo\fR -Undoes the last edit action when the \fB\-undo\fR option is true. An -edit action is defined as all the insert and delete commands that are -recorded on the undo stack in between two separators. Generates an -error when the undo stack is empty. Does nothing when the \fB\-undo\fR -option is false. +. +Undoes the last edit action when the \fB\-undo\fR option is true. An edit +action is defined as all the insert and delete commands that are recorded on +the undo stack in between two separators. Generates an error when the undo +stack is empty. Does nothing when the \fB\-undo\fR option is false. .RE .TP \fIpathName \fBget\fR \fI?\-displaychars?\fR \fI\-\- index1\fR ?\fIindex2 ...\fR? -Return a range of characters from the text. -The return value will be all the characters in the text starting -with the one whose index is \fIindex1\fR and ending just before -the one whose index is \fIindex2\fR (the character at \fIindex2\fR -will not be returned). -If \fIindex2\fR is omitted then the single character at \fIindex1\fR -is returned. -If there are no characters in the specified range (e.g. \fIindex1\fR -is past the end of the file or \fIindex2\fR is less than or equal -to \fIindex1\fR) then an empty string is returned. -If the specified range contains embedded windows, no information -about them is included in the returned string. -If multiple index pairs are given, multiple ranges of text will be returned -in a list. Invalid ranges will not be represented with empty strings in -the list. The ranges are returned in the order passed to \fIpathName \fBget\fR. -.VS 8.5 -If the \fB\-displaychars\fR option is given, then, within each range, -only those characters which are not elided will be returned. This may -have the effect that some of the returned ranges are empty strings. -.VE 8.5 +. +Return a range of characters from the text. The return value will be all the +characters in the text starting with the one whose index is \fIindex1\fR and +ending just before the one whose index is \fIindex2\fR (the character at +\fIindex2\fR will not be returned). If \fIindex2\fR is omitted then the single +character at \fIindex1\fR is returned. If there are no characters in the +specified range (e.g. \fIindex1\fR is past the end of the file or \fIindex2\fR +is less than or equal to \fIindex1\fR) then an empty string is returned. If +the specified range contains embedded windows, no information about them is +included in the returned string. If multiple index pairs are given, multiple +ranges of text will be returned in a list. Invalid ranges will not be +represented with empty strings in the list. The ranges are returned in the +order passed to \fIpathName \fBget\fR. If the \fB\-displaychars\fR option is +given, then, within each range, only those characters which are not elided +will be returned. This may have the effect that some of the returned ranges +are empty strings. .TP \fIpathName \fBimage \fIoption \fR?\fIarg arg ...\fR? -This command is used to manipulate embedded images. -The behavior of the command depends on the \fIoption\fR argument -that follows the \fBtag\fR argument. -The following forms of the command are currently supported: +. +This command is used to manipulate embedded images. The behavior of the +command depends on the \fIoption\fR argument that follows the \fBtag\fR +argument. The following forms of the command are currently supported: .RS .TP \fIpathName \fBimage cget\fR \fIindex option\fR -Returns the value of a configuration option for an embedded image. -\fIIndex\fR identifies the embedded image, and \fIoption\fR -specifies a particular configuration option, which must be one of -the ones listed in the section \fBEMBEDDED IMAGES\fR. +. +Returns the value of a configuration option for an embedded image. \fIIndex\fR +identifies the embedded image, and \fIoption\fR specifies a particular +configuration option, which must be one of the ones listed in the section +\fBEMBEDDED IMAGES\fR. .TP \fIpathName \fBimage configure \fIindex\fR ?\fIoption value ...\fR? -Query or modify the configuration options for an embedded image. -If no \fIoption\fR is specified, returns a list describing all of -the available options for the embedded image at \fIindex\fR -(see \fBTk_ConfigureInfo\fR for information on the format of this list). -If \fIoption\fR is specified with no \fIvalue\fR, then the command -returns a list describing the one named option (this list will be -identical to the corresponding sublist of the value returned if no -\fIoption\fR is specified). -If one or more \fIoption\-value\fR pairs are specified, then the command -modifies the given option(s) to have the given value(s); in -this case the command returns an empty string. -See \fBEMBEDDED IMAGES\fR for information on the options that -are supported. +. +Query or modify the configuration options for an embedded image. If no +\fIoption\fR is specified, returns a list describing all of the available +options for the embedded image at \fIindex\fR (see \fBTk_ConfigureInfo\fR for +information on the format of this list). If \fIoption\fR is specified with no +\fIvalue\fR, then the command returns a list describing the one named option +(this list will be identical to the corresponding sublist of the value +returned if no \fIoption\fR is specified). If one or more \fIoption\-value\fR +pairs are specified, then the command modifies the given option(s) to have the +given value(s); in this case the command returns an empty string. See +\fBEMBEDDED IMAGES\fR for information on the options that are supported. .TP \fIpathName \fBimage create \fIindex\fR ?\fIoption value ...\fR? -This command creates a new image annotation, which will appear -in the text at the position given by \fIindex\fR. -Any number of \fIoption\-value\fR pairs may be specified to -configure the annotation. -Returns a unique identifier that may be used as an index to refer to -this image. -See \fBEMBEDDED IMAGES\fR for information on the options that -are supported, and a description of the identifier returned. +. +This command creates a new image annotation, which will appear in the text at +the position given by \fIindex\fR. Any number of \fIoption\-value\fR pairs may +be specified to configure the annotation. Returns a unique identifier that may +be used as an index to refer to this image. See \fBEMBEDDED IMAGES\fR for +information on the options that are supported, and a description of the +identifier returned. .TP \fIpathName \fBimage names\fR +. Returns a list whose elements are the names of all image instances currently embedded in \fIwindow\fR. .RE .TP \fIpathName \fBindex \fIindex\fR -Returns the position corresponding to \fIindex\fR in the form -\fIline.char\fR where \fIline\fR is the line number and \fIchar\fR -is the character number. +. +Returns the position corresponding to \fIindex\fR in the form \fIline.char\fR +where \fIline\fR is the line number and \fIchar\fR is the character number. \fIIndex\fR may have any of the forms described under \fBINDICES\fR above. .TP \fIpathName \fBinsert \fIindex chars \fR?\fItagList chars tagList ...\fR? +. Inserts all of the \fIchars\fR arguments just before the character at -\fIindex\fR. -If \fIindex\fR refers to the end of the text (the character after -the last newline) then the new text is inserted just before the -last newline instead. -If there is a single \fIchars\fR argument and no \fItagList\fR, then -the new text will receive any tags that are present on both the -character before and the character after the insertion point; if a tag -is present on only one of these characters then it will not be -applied to the new text. -If \fItagList\fR is specified then it consists of a list of -tag names; the new characters will receive all of the tags in -this list and no others, regardless of the tags present around -the insertion point. -If multiple \fIchars\fR\-\fItagList\fR argument pairs are present, -they produce the same effect as if a separate \fIpathName \fBinsert\fR widget -command had been issued for each pair, in order. -The last \fItagList\fR argument may be omitted. +\fIindex\fR. If \fIindex\fR refers to the end of the text (the character after +the last newline) then the new text is inserted just before the last newline +instead. If there is a single \fIchars\fR argument and no \fItagList\fR, then +the new text will receive any tags that are present on both the character +before and the character after the insertion point; if a tag is present on +only one of these characters then it will not be applied to the new text. If +\fItagList\fR is specified then it consists of a list of tag names; the new +characters will receive all of the tags in this list and no others, regardless +of the tags present around the insertion point. If multiple +\fIchars\fR\-\fItagList\fR argument pairs are present, they produce the same +effect as if a separate \fIpathName \fBinsert\fR widget command had been +issued for each pair, in order. The last \fItagList\fR argument may be +omitted. .TP \fIpathName \fBmark \fIoption \fR?\fIarg arg ...\fR? -This command is used to manipulate marks. The exact behavior of -the command depends on the \fIoption\fR argument that follows -the \fBmark\fR argument. The following forms of the command -are currently supported: +. +This command is used to manipulate marks. The exact behavior of the command +depends on the \fIoption\fR argument that follows the \fBmark\fR argument. The +following forms of the command are currently supported: .RS .TP \fIpathName \fBmark gravity \fImarkName\fR ?\fIdirection\fR? -If \fIdirection\fR is not specified, returns \fBleft\fR or \fBright\fR -to indicate which of its adjacent characters \fImarkName\fR is attached -to. -If \fIdirection\fR is specified, it must be \fBleft\fR or \fBright\fR; -the gravity of \fImarkName\fR is set to the given value. +. +If \fIdirection\fR is not specified, returns \fBleft\fR or \fBright\fR to +indicate which of its adjacent characters \fImarkName\fR is attached to. If +\fIdirection\fR is specified, it must be \fBleft\fR or \fBright\fR; the +gravity of \fImarkName\fR is set to the given value. .TP \fIpathName \fBmark names\fR -Returns a list whose elements are the names of all the marks that -are currently set. +. +Returns a list whose elements are the names of all the marks that are +currently set. .TP \fIpathName \fBmark next \fIindex\fR -Returns the name of the next mark at or after \fIindex\fR. -If \fIindex\fR is specified in numerical form, then the search for -the next mark begins at that index. -If \fIindex\fR is the name of a mark, then the search for -the next mark begins immediately after that mark. -This can still return a mark at the same position if -there are multiple marks at the same index. -These semantics mean that the \fBmark next\fR operation can be used to -step through all the marks in a text widget in the same order -as the mark information returned by the \fIpathName \fBdump\fR operation. -If a mark has been set to the special \fBend\fR index, -then it appears to be \fIafter\fR \fBend\fR with respect to the \fIpathName \fBmark next\fR operation. -An empty string is returned if there are no marks after \fIindex\fR. +. +Returns the name of the next mark at or after \fIindex\fR. If \fIindex\fR is +specified in numerical form, then the search for the next mark begins at that +index. If \fIindex\fR is the name of a mark, then the search for the next mark +begins immediately after that mark. This can still return a mark at the same +position if there are multiple marks at the same index. These semantics mean +that the \fBmark next\fR operation can be used to step through all the marks +in a text widget in the same order as the mark information returned by the +\fIpathName \fBdump\fR operation. If a mark has been set to the special +\fBend\fR index, then it appears to be \fIafter\fR \fBend\fR with respect to +the \fIpathName \fBmark next\fR operation. An empty string is returned if +there are no marks after \fIindex\fR. .TP \fIpathName \fBmark previous \fIindex\fR -Returns the name of the mark at or before \fIindex\fR. -If \fIindex\fR is specified in numerical form, then the search for -the previous mark begins with the character just before that index. -If \fIindex\fR is the name of a mark, then the search for -the next mark begins immediately before that mark. -This can still return a mark at the same position if -there are multiple marks at the same index. -These semantics mean that the \fIpathName \fBmark previous\fR operation can be used to -step through all the marks in a text widget in the reverse order -as the mark information returned by the \fIpathName \fBdump\fR operation. -An empty string is returned if there are no marks before \fIindex\fR. +. +Returns the name of the mark at or before \fIindex\fR. If \fIindex\fR is +specified in numerical form, then the search for the previous mark begins with +the character just before that index. If \fIindex\fR is the name of a mark, +then the search for the next mark begins immediately before that mark. This +can still return a mark at the same position if there are multiple marks at +the same index. These semantics mean that the \fIpathName \fBmark previous\fR +operation can be used to step through all the marks in a text widget in the +reverse order as the mark information returned by the \fIpathName \fBdump\fR +operation. An empty string is returned if there are no marks before +\fIindex\fR. .TP \fIpathName \fBmark set \fImarkName index\fR -Sets the mark named \fImarkName\fR to a position just before the -character at \fIindex\fR. -If \fImarkName\fR already exists, it is moved from its old position; -if it does not exist, a new mark is created. -This command returns an empty string. +. +Sets the mark named \fImarkName\fR to a position just before the character at +\fIindex\fR. If \fImarkName\fR already exists, it is moved from its old +position; if it does not exist, a new mark is created. This command returns an +empty string. .TP \fIpathName \fBmark unset \fImarkName \fR?\fImarkName markName ...\fR? -Remove the mark corresponding to each of the \fImarkName\fR arguments. -The removed marks will not be usable in indices and will not be -returned by future calls to +. +Remove the mark corresponding to each of the \fImarkName\fR arguments. The +removed marks will not be usable in indices and will not be returned by future +calls to .QW "\fIpathName \fBmark names\fR" . This command returns an empty string. .RE .TP \fIpathName \fBpeer\fR \fIoption args\fR -.VS 8.5 -This command is used to create and query widget peers. It has -two forms, depending on \fIoption\fR: +. +This command is used to create and query widget peers. It has two forms, +depending on \fIoption\fR: .RS .TP \fIpathName \fBpeer create \fInewPathName\fR ?\fIoptions\fR? -Creates a peer text widget with the given \fInewPathName\fR, and any -optional standard configuration options (as for the \fItext\fR command). -By default the peer will have the same start and end line as the -parent widget, but these can be overridden with the standard -configuration options. +. +Creates a peer text widget with the given \fInewPathName\fR, and any optional +standard configuration options (as for the \fItext\fR command). By default the +peer will have the same start and end line as the parent widget, but these can +be overridden with the standard configuration options. .TP \fIpathName \fBpeer names\fR +. Returns a list of peers of this widget (this does not include the widget -itself). The order within this list is undefined. +itself). The order within this list is undefined. .RE .TP \fIpathName \fBreplace\fR \fIindex1 index2 chars\fR ?\fItagList chars tagList ...\fR? -Replaces the range of characters between \fIindex1\fR and \fIindex2\fR -with the given characters and tags. See the section on \fIpathName -\fBinsert\fR for an explanation of the handling of the \fItagList...\fR -arguments, and the section on \fIpathName -\fBdelete\fR for an explanation of the handling of the indices. If -\fIindex2\fR corresponds to an index earlier in the text than +. +Replaces the range of characters between \fIindex1\fR and \fIindex2\fR with +the given characters and tags. See the section on \fIpathName \fBinsert\fR for +an explanation of the handling of the \fItagList...\fR arguments, and the +section on \fIpathName \fBdelete\fR for an explanation of the handling of the +indices. If \fIindex2\fR corresponds to an index earlier in the text than \fIindex1\fR, an error will be generated. .RS .PP -The deletion and insertion are arranged so that no unnecessary -scrolling of the window or movement of insertion cursor occurs. In -addition the undo/redo stack are correctly modified, if undo operations -are active in the text widget. The command returns an empty string. +The deletion and insertion are arranged so that no unnecessary scrolling of +the window or movement of insertion cursor occurs. In addition the undo/redo +stack are correctly modified, if undo operations are active in the text +widget. The command returns an empty string. .RE -.VE 8.5 .TP \fIpathName \fBscan\fR \fIoption args\fR -This command is used to implement scanning on texts. It has -two forms, depending on \fIoption\fR: +. +This command is used to implement scanning on texts. It has two forms, +depending on \fIoption\fR: .RS .TP \fIpathName \fBscan mark \fIx y\fR -Records \fIx\fR and \fIy\fR and the current view in the text window, -for use in conjunction with later \fIpathName \fBscan dragto\fR commands. -Typically this command is associated with a mouse button press in -the widget. It returns an empty string. +. +Records \fIx\fR and \fIy\fR and the current view in the text window, for use +in conjunction with later \fIpathName \fBscan dragto\fR commands. Typically +this command is associated with a mouse button press in the widget. It returns +an empty string. .TP \fIpathName \fBscan dragto \fIx y\fR -This command computes the difference between its \fIx\fR and \fIy\fR -arguments and the \fIx\fR and \fIy\fR arguments to the last -\fIpathName \fBscan mark\fR command for the widget. -It then adjusts the view by 10 times the difference in coordinates. -This command is typically associated -with mouse motion events in the widget, to produce the effect of -dragging the text at high speed through the window. The return -value is an empty string. +. +This command computes the difference between its \fIx\fR and \fIy\fR arguments +and the \fIx\fR and \fIy\fR arguments to the last \fIpathName \fBscan mark\fR +command for the widget. It then adjusts the view by 10 times the difference in +coordinates. This command is typically associated with mouse motion events in +the widget, to produce the effect of dragging the text at high speed through +the window. The return value is an empty string. .RE .TP \fIpathName \fBsearch \fR?\fIswitches\fR? \fIpattern index \fR?\fIstopIndex\fR? -Searches the text in \fIpathName\fR starting at \fIindex\fR for a range -of characters that matches \fIpattern\fR. -If a match is found, the index of the first character in the match is -returned as result; otherwise an empty string is returned. -One or more of the following switches (or abbreviations thereof) +. +Searches the text in \fIpathName\fR starting at \fIindex\fR for a range of +characters that matches \fIpattern\fR. If a match is found, the index of the +first character in the match is returned as result; otherwise an empty string +is returned. One or more of the following switches (or abbreviations thereof) may be specified to control the search: .RS .TP \fB\-forwards\fR -The search will proceed forward through the text, finding the first -matching range starting at or after the position given by \fIindex\fR. -This is the default. +. +The search will proceed forward through the text, finding the first matching +range starting at or after the position given by \fIindex\fR. This is the +default. .TP \fB\-backwards\fR -The search will proceed backward through the text, finding the -matching range closest to \fIindex\fR whose first character -is before \fIindex\fR -.VS 8.5 -(it is not allowed to be at \fIindex\fR). Note that, for a variety of -reasons, backwards searches can be substantially slower than forwards -searches (particularly when using \fB\-regexp\fR), so it is recommended -that performance-critical code use forward searches. -.VE 8.5 +. +The search will proceed backward through the text, finding the matching range +closest to \fIindex\fR whose first character is before \fIindex\fR (it is not +allowed to be at \fIindex\fR). Note that, for a variety of reasons, backwards +searches can be substantially slower than forwards searches (particularly when +using \fB\-regexp\fR), so it is recommended that performance-critical code use +forward searches. .TP \fB\-exact\fR -Use exact matching: the characters in the matching range must be -identical to those in \fIpattern\fR. -This is the default. +. +Use exact matching: the characters in the matching range must be identical to +those in \fIpattern\fR. This is the default. .TP \fB\-regexp\fR -Treat \fIpattern\fR as a regular expression and match it against -the text using the rules for regular expressions (see the \fBregexp\fR -command for details). -.VS 8.5 -The default matching automatically passes -both the \fB\-lineanchor\fR and \fB\-linestop\fR options -to the regexp engine (unless \fB\-nolinestop\fR is used), so that -\fI^$\fR match beginning and end of line, and \fI.\fR, \fI[^\fR -sequences will never match the newline character \fI\en\fR. -.VE 8.5 +. +Treat \fIpattern\fR as a regular expression and match it against the text +using the rules for regular expressions (see the \fBregexp\fR command for +details). The default matching automatically passes both the +\fB\-lineanchor\fR and \fB\-linestop\fR options to the regexp engine (unless +\fB\-nolinestop\fR is used), so that \fI^$\fR match beginning and end of line, +and \fI.\fR, \fI[^\fR sequences will never match the newline character +\fI\en\fR. .TP \fB\-nolinestop\fR -.VS 8.5 -This allows \fI.\fR and \fI[^\fR sequences to match the newline -character \fI\en\fR, which they will otherwise not do (see the \fBregexp\fR -command for details). This option is only meaningful if \fB\-regexp\fR -is also given, and an error will be thrown otherwise. For example, -to match the entire text, use +. +This allows \fI.\fR and \fI[^\fR sequences to match the newline character +\fI\en\fR, which they will otherwise not do (see the \fBregexp\fR command for +details). This option is only meaningful if \fB\-regexp\fR is also given, and +an error will be thrown otherwise. For example, to match the entire text, use .QW "\fIpathName \fBsearch \-nolinestop \-regexp\fR \N'34'.*\N'34' 1.0" . -.VE 8.5 .TP \fB\-nocase\fR +. Ignore case differences between the pattern and the text. .TP \fB\-count\fI varName\fR -The argument following \fB\-count\fR gives the name of a variable; -if a match is found, the number of index positions between beginning and -end of the matching range will be stored in the variable. If there are no -embedded images or windows in the matching range (and there are no -elided characters if \fB\-elide\fR is not given), this is equivalent to the -number of characters matched. In either case, the range \fImatchIdx\fR to -\fImatchIdx + $count chars\fR will return the entire matched text. +. +The argument following \fB\-count\fR gives the name of a variable; if a match +is found, the number of index positions between beginning and end of the +matching range will be stored in the variable. If there are no embedded images +or windows in the matching range (and there are no elided characters if +\fB\-elide\fR is not given), this is equivalent to the number of characters +matched. In either case, the range \fImatchIdx\fR to \fImatchIdx + $count +chars\fR will return the entire matched text. .TP \fB\-all\fR -.VS 8.5 -Find all matches in the given range and return a list of the indices of -the first character of each match. If a \fB\-count\fI varName\fR switch is -given, then \fIvarName\fR is also set to a list containing one element -for each successful match. Note that, even for exact searches, the -elements of this list may be different, if there are embedded images, -windows or hidden text. Searches with \fB\-all\fR behave very -similarly to the Tcl command \fBregexp \-all\fR, in that overlapping -matches are not normally returned. For example, applying an -\fB\-all\fR search of the pattern +. +Find all matches in the given range and return a list of the indices of the +first character of each match. If a \fB\-count\fI varName\fR switch is given, +then \fIvarName\fR is also set to a list containing one element for each +successful match. Note that, even for exact searches, the elements of this +list may be different, if there are embedded images, windows or hidden text. +Searches with \fB\-all\fR behave very similarly to the Tcl command \fBregexp +\-all\fR, in that overlapping matches are not normally returned. For example, +applying an \fB\-all\fR search of the pattern .QW \ew+ against .QW "hello there" @@ -1602,621 +1438,556 @@ will just match twice, once for each word, and matching against .QW ZooZooZoo will just match once. -.VE 8.5 .TP \fB\-overlap\fR -.VS 8.5 -When performing \fB\-all\fR searches, the normal behaviour is that -matches which overlap an already-found match will not be returned. This -switch changes that behaviour so that all matches which are not totally -enclosed within another match are returned. For example, applying an -\fB\-overlap\fR search of the pattern +. +When performing \fB\-all\fR searches, the normal behaviour is that matches +which overlap an already-found match will not be returned. This switch changes +that behaviour so that all matches which are not totally enclosed within +another match are returned. For example, applying an \fB\-overlap\fR search of +the pattern .QW \ew+ against .QW "hello there" -will just match twice (i.e. no different to just \fB\-all\fR), -but matching +will just match twice (i.e. no different to just \fB\-all\fR), but matching .QW Z[a\-z]+Z against .QW ZooZooZoo -will now match twice. -An error will be thrown if this switch is used without \fB\-all\fR. -.VE 8.5 +will now match twice. An error will be thrown if this switch is used without +\fB\-all\fR. .TP \fB\-strictlimits\fR -.VS 8.5 -When performing any search, the normal behaviour is that -the start and stop limits are checked with respect to the -start of the matching text. With the \fB\-strictlimits\fR flag, -the entire matching range must lie inside the start and stop -limits specified for the match to be valid. -.VE 8.5 +. +When performing any search, the normal behaviour is that the start and stop +limits are checked with respect to the start of the matching text. With the +\fB\-strictlimits\fR flag, the entire matching range must lie inside the start +and stop limits specified for the match to be valid. .TP \fB\-elide\fR -Find elided (hidden) text as well. By default only displayed text is -searched. +. +Find elided (hidden) text as well. By default only displayed text is searched. .TP \fB\-\|\-\fR -This switch has no effect except to terminate the list of switches: -the next argument will be treated as \fIpattern\fR even if it starts -with \fB\-\fR. +. +This switch has no effect except to terminate the list of switches: the next +argument will be treated as \fIpattern\fR even if it starts with \fB\-\fR. .PP -.VS 8.5 -The matching range may be within a single line of text, or run across -multiple lines (if parts of the pattern can match a new-line). For -regular expression matching one can use the various newline-matching -features such as \fB$\fR to match the end of a line, \fB^\fR to match -the beginning of a line, and to control -whether \fB.\fR is allowed to match a new-line. -.VE 8.5 -If \fIstopIndex\fR is specified, the search stops at that index: -for forward searches, no match at or after \fIstopIndex\fR will -be considered; for backward searches, no match earlier in the -text than \fIstopIndex\fR will be considered. -If \fIstopIndex\fR is omitted, the entire text will be searched: -when the beginning or end of the text is reached, the search -continues at the other end until the starting location is reached -again; if \fIstopIndex\fR is specified, no wrap-around will occur. -This means that, for example, if the search is \fB\-forwards\fR -but \fIstopIndex\fR is earlier in the text than \fIstartIndex\fR, -nothing will ever be found. See \fBKNOWN BUGS\fR below for a number of -minor limitations of the \fIpathName \fBsearch\fR command. +The matching range may be within a single line of text, or run across multiple +lines (if parts of the pattern can match a new-line). For regular expression +matching one can use the various newline-matching features such as \fB$\fR to +match the end of a line, \fB^\fR to match the beginning of a line, and to +control whether \fB.\fR is allowed to match a new-line. If \fIstopIndex\fR is +specified, the search stops at that index: for forward searches, no match at +or after \fIstopIndex\fR will be considered; for backward searches, no match +earlier in the text than \fIstopIndex\fR will be considered. If +\fIstopIndex\fR is omitted, the entire text will be searched: when the +beginning or end of the text is reached, the search continues at the other end +until the starting location is reached again; if \fIstopIndex\fR is specified, +no wrap-around will occur. This means that, for example, if the search is +\fB\-forwards\fR but \fIstopIndex\fR is earlier in the text than +\fIstartIndex\fR, nothing will ever be found. See \fBKNOWN BUGS\fR below for a +number of minor limitations of the \fIpathName \fBsearch\fR command. .RE .TP \fIpathName \fBsee \fIindex\fR -Adjusts the view in the window so that the character given by \fIindex\fR -is completely visible. -If \fIindex\fR is already visible then the command does nothing. -If \fIindex\fR is a short distance out of view, the command -adjusts the view just enough to make \fIindex\fR visible at the -edge of the window. -If \fIindex\fR is far out of view, then the command centers -\fIindex\fR in the window. +. +Adjusts the view in the window so that the character given by \fIindex\fR is +completely visible. If \fIindex\fR is already visible then the command does +nothing. If \fIindex\fR is a short distance out of view, the command adjusts +the view just enough to make \fIindex\fR visible at the edge of the window. +If \fIindex\fR is far out of view, then the command centers \fIindex\fR in the +window. .TP \fIpathName \fBtag \fIoption \fR?\fIarg arg ...\fR? -This command is used to manipulate tags. The exact behavior of the -command depends on the \fIoption\fR argument that follows the -\fBtag\fR argument. The following forms of the command are currently -supported: +. +This command is used to manipulate tags. The exact behavior of the command +depends on the \fIoption\fR argument that follows the \fBtag\fR argument. The +following forms of the command are currently supported: .RS .TP \fIpathName \fBtag add \fItagName index1 \fR?\fIindex2 index1 index2 ...\fR? -Associate the tag \fItagName\fR with all of the characters starting -with \fIindex1\fR and ending just before -\fIindex2\fR (the character at \fIindex2\fR is not tagged). -A single command may contain any number of \fIindex1\fR\-\fIindex2\fR -pairs. -If the last \fIindex2\fR is omitted then the single character at -\fIindex1\fR is tagged. -If there are no characters in the specified range (e.g. \fIindex1\fR -is past the end of the file or \fIindex2\fR is less than or equal -to \fIindex1\fR) then the command has no effect. +. +Associate the tag \fItagName\fR with all of the characters starting with +\fIindex1\fR and ending just before \fIindex2\fR (the character at +\fIindex2\fR is not tagged). A single command may contain any number of +\fIindex1\fR\-\fIindex2\fR pairs. If the last \fIindex2\fR is omitted then the +single character at \fIindex1\fR is tagged. If there are no characters in the +specified range (e.g. \fIindex1\fR is past the end of the file or \fIindex2\fR +is less than or equal to \fIindex1\fR) then the command has no effect. .TP \fIpathName \fBtag bind \fItagName\fR ?\fIsequence\fR? ?\fIscript\fR? -This command associates \fIscript\fR with the tag given by -\fItagName\fR. -Whenever the event sequence given by \fIsequence\fR occurs for a -character that has been tagged with \fItagName\fR, -the script will be invoked. -This widget command is similar to the \fBbind\fR command except that -it operates on characters in a text rather than entire widgets. -See the \fBbind\fR manual entry for complete details -on the syntax of \fIsequence\fR and the substitutions performed -on \fIscript\fR before invoking it. -If all arguments are specified then a new binding is created, replacing -any existing binding for the same \fIsequence\fR and \fItagName\fR -(if the first character of \fIscript\fR is +. +This command associates \fIscript\fR with the tag given by \fItagName\fR. +Whenever the event sequence given by \fIsequence\fR occurs for a character +that has been tagged with \fItagName\fR, the script will be invoked. This +widget command is similar to the \fBbind\fR command except that it operates on +characters in a text rather than entire widgets. See the \fBbind\fR manual +entry for complete details on the syntax of \fIsequence\fR and the +substitutions performed on \fIscript\fR before invoking it. If all arguments +are specified then a new binding is created, replacing any existing binding +for the same \fIsequence\fR and \fItagName\fR (if the first character of +\fIscript\fR is .QW + -then \fIscript\fR augments an existing binding rather than replacing it). -In this case the return value is an empty string. -If \fIscript\fR is omitted then the command returns the \fIscript\fR -associated with \fItagName\fR and \fIsequence\fR (an error occurs -if there is no such binding). -If both \fIscript\fR and \fIsequence\fR are omitted then the command -returns a list of all the sequences for which bindings have been -defined for \fItagName\fR. +then \fIscript\fR augments an existing binding rather than replacing it). In +this case the return value is an empty string. If \fIscript\fR is omitted then +the command returns the \fIscript\fR associated with \fItagName\fR and +\fIsequence\fR (an error occurs if there is no such binding). If both +\fIscript\fR and \fIsequence\fR are omitted then the command returns a list of +all the sequences for which bindings have been defined for \fItagName\fR. .RS .PP -The only events for which bindings may be specified are those related -to the mouse and keyboard (such as \fBEnter\fR, \fBLeave\fR, -\fBButtonPress\fR, \fBMotion\fR, and \fBKeyPress\fR) or virtual events. -Event bindings for a text widget use the \fBcurrent\fR mark described -under \fBMARKS\fR above. An \fBEnter\fR event triggers for a tag when the tag -first becomes present on the current character, and a \fBLeave\fR event -triggers for a tag when it ceases to be present on the current character. -\fBEnter\fR and \fBLeave\fR events can happen either because the -\fBcurrent\fR mark moved or because the character at that position -changed. Note that these events are different than \fBEnter\fR and -\fBLeave\fR events for windows. Mouse and keyboard events are directed -to the current character. If a virtual event is used in a binding, that -binding can trigger only if the virtual event is defined by an underlying +The only events for which bindings may be specified are those related to the +mouse and keyboard (such as \fBEnter\fR, \fBLeave\fR, \fBButtonPress\fR, +\fBMotion\fR, and \fBKeyPress\fR) or virtual events. Event bindings for a text +widget use the \fBcurrent\fR mark described under \fBMARKS\fR above. An +\fBEnter\fR event triggers for a tag when the tag first becomes present on the +current character, and a \fBLeave\fR event triggers for a tag when it ceases +to be present on the current character. \fBEnter\fR and \fBLeave\fR events can +happen either because the \fBcurrent\fR mark moved or because the character at +that position changed. Note that these events are different than \fBEnter\fR +and \fBLeave\fR events for windows. Mouse and keyboard events are directed to +the current character. If a virtual event is used in a binding, that binding +can trigger only if the virtual event is defined by an underlying mouse-related or keyboard-related event. .PP -It is possible for the current character to have multiple tags, -and for each of them to have a binding for a particular event -sequence. -When this occurs, one binding is invoked for each tag, in order -from lowest-priority to highest priority. -If there are multiple matching bindings for a single tag, then -the most specific binding is chosen (see the manual entry for -the \fBbind\fR command for details). -\fBcontinue\fR and \fBbreak\fR commands within binding scripts -are processed in the same way as for bindings created with -the \fBbind\fR command. +It is possible for the current character to have multiple tags, and for each +of them to have a binding for a particular event sequence. When this occurs, +one binding is invoked for each tag, in order from lowest-priority to highest +priority. If there are multiple matching bindings for a single tag, then the +most specific binding is chosen (see the manual entry for the \fBbind\fR +command for details). \fBcontinue\fR and \fBbreak\fR commands within binding +scripts are processed in the same way as for bindings created with the +\fBbind\fR command. .PP -If bindings are created for the widget as a whole using the -\fBbind\fR command, then those bindings will supplement the -tag bindings. -The tag bindings will be invoked first, followed by bindings -for the window as a whole. +If bindings are created for the widget as a whole using the \fBbind\fR +command, then those bindings will supplement the tag bindings. The tag +bindings will be invoked first, followed by bindings for the window as a +whole. .RE .TP \fIpathName \fBtag cget\fR \fItagName option\fR +. This command returns the current value of the option named \fIoption\fR -associated with the tag given by \fItagName\fR. -\fIOption\fR may have any of the values accepted by the \fIpathName \fBtag -configure\fR widget command. +associated with the tag given by \fItagName\fR. \fIOption\fR may have any of +the values accepted by the \fIpathName \fBtag configure\fR widget command. .TP \fIpathName \fBtag configure \fItagName\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR? -This command is similar to the \fIpathName \fBconfigure\fR widget command except -that it modifies options associated with the tag given by \fItagName\fR -instead of modifying options for the overall text widget. -If no \fIoption\fR is specified, the command returns a list describing -all of the available options for \fItagName\fR (see \fBTk_ConfigureInfo\fR -for information on the format of this list). -If \fIoption\fR is specified with no \fIvalue\fR, then the command returns -a list describing the one named option (this list will be identical to -the corresponding sublist of the value returned if no \fIoption\fR -is specified). -If one or more \fIoption\-value\fR pairs are specified, then the command -modifies the given option(s) to have the given value(s) in \fItagName\fR; -in this case the command returns an empty string. +. +This command is similar to the \fIpathName \fBconfigure\fR widget command +except that it modifies options associated with the tag given by \fItagName\fR +instead of modifying options for the overall text widget. If no \fIoption\fR +is specified, the command returns a list describing all of the available +options for \fItagName\fR (see \fBTk_ConfigureInfo\fR for information on the +format of this list). If \fIoption\fR is specified with no \fIvalue\fR, then +the command returns a list describing the one named option (this list will be +identical to the corresponding sublist of the value returned if no +\fIoption\fR is specified). If one or more \fIoption\-value\fR pairs are +specified, then the command modifies the given option(s) to have the given +value(s) in \fItagName\fR; in this case the command returns an empty string. See \fBTAGS\fR above for details on the options available for tags. .TP \fIpathName \fBtag delete \fItagName \fR?\fItagName ...\fR? -Deletes all tag information for each of the \fItagName\fR -arguments. -The command removes the tags from all characters in the file -and also deletes any other information associated with the tags, -such as bindings and display information. -The command returns an empty string. +. +Deletes all tag information for each of the \fItagName\fR arguments. The +command removes the tags from all characters in the file and also deletes any +other information associated with the tags, such as bindings and display +information. The command returns an empty string. .TP \fIpathName\fB tag lower \fItagName \fR?\fIbelowThis\fR? -Changes the priority of tag \fItagName\fR so that it is just lower -in priority than the tag whose name is \fIbelowThis\fR. -If \fIbelowThis\fR is omitted, then \fItagName\fR's priority -is changed to make it lowest priority of all tags. +. +Changes the priority of tag \fItagName\fR so that it is just lower in priority +than the tag whose name is \fIbelowThis\fR. If \fIbelowThis\fR is omitted, +then \fItagName\fR's priority is changed to make it lowest priority of all +tags. .TP \fIpathName \fBtag names \fR?\fIindex\fR? -Returns a list whose elements are the names of all the tags that -are active at the character position given by \fIindex\fR. -If \fIindex\fR is omitted, then the return value will describe -all of the tags that exist for the text (this includes all tags -that have been named in a +. +Returns a list whose elements are the names of all the tags that are active at +the character position given by \fIindex\fR. If \fIindex\fR is omitted, then +the return value will describe all of the tags that exist for the text (this +includes all tags that have been named in a .QW "\fIpathName \fBtag\fR" widget command but have not been deleted by a .QW "\fIpathName \fBtag delete\fR" -widget command, even if no characters are currently marked with the tag). -The list will be sorted in order from lowest priority to highest -priority. +widget command, even if no characters are currently marked with the tag). The +list will be sorted in order from lowest priority to highest priority. .TP \fIpathName \fBtag nextrange \fItagName index1 \fR?\fIindex2\fR? -This command searches the text for a range of characters tagged -with \fItagName\fR where the first character of the range is -no earlier than the character at \fIindex1\fR and no later than -the character just before \fIindex2\fR (a range starting at -\fIindex2\fR will not be considered). -If several matching ranges exist, the first one is chosen. -The command's return value is a list containing -two elements, which are the index of the first character of the -range and the index of the character just after the last one in -the range. -If no matching range is found then the return value is an -empty string. -If \fIindex2\fR is not given then it defaults to the end of the text. +. +This command searches the text for a range of characters tagged with +\fItagName\fR where the first character of the range is no earlier than the +character at \fIindex1\fR and no later than the character just before +\fIindex2\fR (a range starting at \fIindex2\fR will not be considered). If +several matching ranges exist, the first one is chosen. The command's return +value is a list containing two elements, which are the index of the first +character of the range and the index of the character just after the last one +in the range. If no matching range is found then the return value is an empty +string. If \fIindex2\fR is not given then it defaults to the end of the text. .TP \fIpathName \fBtag prevrange \fItagName index1 \fR?\fIindex2\fR? -This command searches the text for a range of characters tagged -with \fItagName\fR where the first character of the range is -before the character at \fIindex1\fR and no earlier than -the character at \fIindex2\fR (a range starting at -\fIindex2\fR will be considered). -If several matching ranges exist, the one closest to \fIindex1\fR is chosen. -The command's return value is a list containing -two elements, which are the index of the first character of the -range and the index of the character just after the last one in -the range. -If no matching range is found then the return value is an -empty string. +. +This command searches the text for a range of characters tagged with +\fItagName\fR where the first character of the range is before the character +at \fIindex1\fR and no earlier than the character at \fIindex2\fR (a range +starting at \fIindex2\fR will be considered). If several matching ranges +exist, the one closest to \fIindex1\fR is chosen. The command's return value +is a list containing two elements, which are the index of the first character +of the range and the index of the character just after the last one in the +range. If no matching range is found then the return value is an empty string. If \fIindex2\fR is not given then it defaults to the beginning of the text. .TP \fIpathName\fB tag raise \fItagName \fR?\fIaboveThis\fR? -Changes the priority of tag \fItagName\fR so that it is just higher -in priority than the tag whose name is \fIaboveThis\fR. -If \fIaboveThis\fR is omitted, then \fItagName\fR's priority -is changed to make it highest priority of all tags. +. +Changes the priority of tag \fItagName\fR so that it is just higher in +priority than the tag whose name is \fIaboveThis\fR. If \fIaboveThis\fR is +omitted, then \fItagName\fR's priority is changed to make it highest priority +of all tags. .TP \fIpathName \fBtag ranges \fItagName\fR -Returns a list describing all of the ranges of text that have been -tagged with \fItagName\fR. -The first two elements of the list describe the first tagged range -in the text, the next two elements describe the second range, and -so on. -The first element of each pair contains the index of the first -character of the range, and the second element of the pair contains -the index of the character just after the last one in the -range. -If there are no characters tagged with \fItag\fR then an -empty string is returned. +. +Returns a list describing all of the ranges of text that have been tagged with +\fItagName\fR. The first two elements of the list describe the first tagged +range in the text, the next two elements describe the second range, and so on. +The first element of each pair contains the index of the first character of +the range, and the second element of the pair contains the index of the +character just after the last one in the range. If there are no characters +tagged with \fItag\fR then an empty string is returned. .TP \fIpathName \fBtag remove \fItagName index1 \fR?\fIindex2 index1 index2 ...\fR? -Remove the tag \fItagName\fR from all of the characters starting -at \fIindex1\fR and ending just before -\fIindex2\fR (the character at \fIindex2\fR is not affected). -A single command may contain any number of \fIindex1\fR\-\fIindex2\fR -pairs. -If the last \fIindex2\fR is omitted then the tag is removed from the -single character at \fIindex1\fR. -If there are no characters in the specified range (e.g. \fIindex1\fR -is past the end of the file or \fIindex2\fR is less than or equal -to \fIindex1\fR) then the command has no effect. -This command returns an empty string. +. +Remove the tag \fItagName\fR from all of the characters starting at +\fIindex1\fR and ending just before \fIindex2\fR (the character at +\fIindex2\fR is not affected). A single command may contain any number of +\fIindex1\fR\-\fIindex2\fR pairs. If the last \fIindex2\fR is omitted then the +tag is removed from the single character at \fIindex1\fR. If there are no +characters in the specified range (e.g. \fIindex1\fR is past the end of the +file or \fIindex2\fR is less than or equal to \fIindex1\fR) then the command +has no effect. This command returns an empty string. .RE .TP \fIpathName \fBwindow \fIoption \fR?\fIarg arg ...\fR? -This command is used to manipulate embedded windows. -The behavior of the command depends on the \fIoption\fR argument -that follows the \fBtag\fR argument. -The following forms of the command are currently supported: +. +This command is used to manipulate embedded windows. The behavior of the +command depends on the \fIoption\fR argument that follows the \fBtag\fR +argument. The following forms of the command are currently supported: .RS .TP \fIpathName \fBwindow cget\fR \fIindex option\fR +. Returns the value of a configuration option for an embedded window. -\fIIndex\fR identifies the embedded window, and \fIoption\fR -specifies a particular configuration option, which must be one of -the ones listed in the section \fBEMBEDDED WINDOWS\fR. +\fIIndex\fR identifies the embedded window, and \fIoption\fR specifies a +particular configuration option, which must be one of the ones listed in the +section \fBEMBEDDED WINDOWS\fR. .TP \fIpathName \fBwindow configure \fIindex\fR ?\fIoption value ...\fR? -Query or modify the configuration options for an embedded window. -If no \fIoption\fR is specified, returns a list describing all of -the available options for the embedded window at \fIindex\fR -(see \fBTk_ConfigureInfo\fR for information on the format of this list). -If \fIoption\fR is specified with no \fIvalue\fR, then the command -returns a list describing the one named option (this list will be -identical to the corresponding sublist of the value returned if no -\fIoption\fR is specified). -If one or more \fIoption\-value\fR pairs are specified, then the command -modifies the given option(s) to have the given value(s); in -this case the command returns an empty string. -See \fBEMBEDDED WINDOWS\fR for information on the options that -are supported. +. +Query or modify the configuration options for an embedded window. If no +\fIoption\fR is specified, returns a list describing all of the available +options for the embedded window at \fIindex\fR (see \fBTk_ConfigureInfo\fR for +information on the format of this list). If \fIoption\fR is specified with no +\fIvalue\fR, then the command returns a list describing the one named option +(this list will be identical to the corresponding sublist of the value +returned if no \fIoption\fR is specified). If one or more \fIoption\-value\fR +pairs are specified, then the command modifies the given option(s) to have the +given value(s); in this case the command returns an empty string. See +\fBEMBEDDED WINDOWS\fR for information on the options that are supported. .TP \fIpathName \fBwindow create \fIindex\fR ?\fIoption value ...\fR? -This command creates a new window annotation, which will appear -in the text at the position given by \fIindex\fR. -Any number of \fIoption\-value\fR pairs may be specified to -configure the annotation. -See \fBEMBEDDED WINDOWS\fR for information on the options that -are supported. -Returns an empty string. +. +This command creates a new window annotation, which will appear in the text at +the position given by \fIindex\fR. Any number of \fIoption\-value\fR pairs may +be specified to configure the annotation. See \fBEMBEDDED WINDOWS\fR for +information on the options that are supported. Returns an empty string. .TP \fIpathName \fBwindow names\fR -Returns a list whose elements are the names of all windows currently -embedded in \fIwindow\fR. +. +Returns a list whose elements are the names of all windows currently embedded +in \fIwindow\fR. .RE .TP \fIpathName \fBxview \fIoption args\fR -This command is used to query and change the horizontal position of the -text in the widget's window. It can take any of the following -forms: +. +This command is used to query and change the horizontal position of the text +in the widget's window. It can take any of the following forms: .RS .TP \fIpathName \fBxview\fR -Returns a list containing two elements. -Each element is a real fraction between 0 and 1; together they describe -the portion of the document's horizontal span that is visible in -the window. -For example, if the first element is .2 and the second element is .6, -20% of the text is off-screen to the left, the middle 40% is visible -in the window, and 40% of the text is off-screen to the right. -The fractions refer only to the lines that are actually visible in the -window: if the lines in the window are all very short, so that they -are entirely visible, the returned fractions will be 0 and 1, -even if there are other lines in the text that are -much wider than the window. +. +Returns a list containing two elements. Each element is a real fraction +between 0 and 1; together they describe the portion of the document's +horizontal span that is visible in the window. For example, if the first +element is .2 and the second element is .6, 20% of the text is off-screen to +the left, the middle 40% is visible in the window, and 40% of the text is +off-screen to the right. The fractions refer only to the lines that are +actually visible in the window: if the lines in the window are all very short, +so that they are entirely visible, the returned fractions will be 0 and 1, +even if there are other lines in the text that are much wider than the window. These are the same values passed to scrollbars via the \fB\-xscrollcommand\fR option. .TP \fIpathName \fBxview moveto\fI fraction\fR -Adjusts the view in the window so that \fIfraction\fR of the horizontal -span of the text is off-screen to the left. -\fIFraction\fR is a fraction between 0 and 1. +. +Adjusts the view in the window so that \fIfraction\fR of the horizontal span +of the text is off-screen to the left. \fIFraction\fR is a fraction between 0 +and 1. .TP \fIpathName \fBxview scroll \fInumber what\fR +. This command shifts the view in the window left or right according to -\fInumber\fR and \fIwhat\fR. -\fIWhat\fR must be \fBunits\fR, \fBpages\fR or \fBpixels\fR. -.VS 8.5 -If \fIwhat\fR is \fBunits\fR or \fBpages\fR then \fInumber\fR must be an -integer, otherwise number may be specified in any of the forms acceptable -to \fBTk_GetPixels\fR, such as +\fInumber\fR and \fIwhat\fR. \fIWhat\fR must be \fBunits\fR, \fBpages\fR or +\fBpixels\fR. If \fIwhat\fR is \fBunits\fR or \fBpages\fR then \fInumber\fR +must be an integer, otherwise number may be specified in any of the forms +acceptable to \fBTk_GetPixels\fR, such as .QW 2.0c or .QW 1i -(the result is rounded -to the nearest integer value. If no units are given, pixels are -assumed). If \fIwhat\fR is \fBunits\fR, the view adjusts left or right by -\fInumber\fR average-width characters on the display; if it is +(the result is rounded to the nearest integer value. If no units are given, +pixels are assumed). If \fIwhat\fR is \fBunits\fR, the view adjusts left or +right by \fInumber\fR average-width characters on the display; if it is \fBpages\fR then the view adjusts by \fInumber\fR screenfuls; if it is -\fBpixels\fR then the view adjusts by \fInumber\fR pixels. If -.VE 8.5 -\fInumber\fR is negative then characters farther to the left become -visible; if it is positive then characters farther to the right become -visible. +\fBpixels\fR then the view adjusts by \fInumber\fR pixels. If \fInumber\fR is +negative then characters farther to the left become visible; if it is positive +then characters farther to the right become visible. .RE .TP \fIpathName \fByview \fI?args\fR? -This command is used to query and change the vertical position of the -text in the widget's window. -It can take any of the following forms: +. +This command is used to query and change the vertical position of the text in +the widget's window. It can take any of the following forms: .RS .TP \fIpathName \fByview\fR +. Returns a list containing two elements, both of which are real fractions -between 0 and 1. -The first element gives the position of the first visible pixel of the -first character (or image, etc) in the -top line in the window, relative to the text as a whole (0.5 means -it is halfway through the text, for example). -The second element gives the position of the first pixel just after the -last visible one in the bottom line of the window, -relative to the text as a whole. -These are the same values passed to scrollbars via the \fB\-yscrollcommand\fR -option. +between 0 and 1. The first element gives the position of the first visible +pixel of the first character (or image, etc) in the top line in the window, +relative to the text as a whole (0.5 means it is halfway through the text, for +example). The second element gives the position of the first pixel just after +the last visible one in the bottom line of the window, relative to the text as +a whole. These are the same values passed to scrollbars via the +\fB\-yscrollcommand\fR option. .TP \fIpathName \fByview moveto\fI fraction\fR +. Adjusts the view in the window so that the pixel given by \fIfraction\fR -appears at the top of the top line of the window. -\fIFraction\fR is a fraction between 0 and 1; 0 indicates the first -pixel of the first character in the text, 0.33 indicates the pixel that is -one-third the way through the text; and so on. -.VS 8.5 -Values close to 1 will -indicate values close to the last pixel in the text (1 actually refers -to one pixel beyond the last pixel), but in such cases the widget will -never scroll beyond the last pixel, and so a value of 1 will effectively -be rounded back to whatever fraction ensures the last pixel is at the -bottom of the window, and some other pixel is at the top. -.VE 8.5 +appears at the top of the top line of the window. \fIFraction\fR is a fraction +between 0 and 1; 0 indicates the first pixel of the first character in the +text, 0.33 indicates the pixel that is one-third the way through the text; and +so on. Values close to 1 will indicate values close to the last pixel in the +text (1 actually refers to one pixel beyond the last pixel), but in such cases +the widget will never scroll beyond the last pixel, and so a value of 1 will +effectively be rounded back to whatever fraction ensures the last pixel is at +the bottom of the window, and some other pixel is at the top. .TP \fIpathName \fByview scroll \fInumber what\fR +. This command adjust the view in the window up or down according to -\fInumber\fR and \fIwhat\fR. -\fIWhat\fR must be \fBunits\fR, \fBpages\fR or \fBpixels\fR. -.VS 8.5 -If \fIwhat\fR is \fBunits\fR or \fBpages\fR then \fInumber\fR must be an -integer, otherwise number may be specified in any of the forms acceptable -to \fBTk_GetPixels\fR, such as +\fInumber\fR and \fIwhat\fR. \fIWhat\fR must be \fBunits\fR, \fBpages\fR or +\fBpixels\fR. If \fIwhat\fR is \fBunits\fR or \fBpages\fR then \fInumber\fR +must be an integer, otherwise number may be specified in any of the forms +acceptable to \fBTk_GetPixels\fR, such as .QW 2.0c or .QW 1i -(the result is rounded -to the nearest integer value. If no units are given, pixels are -assumed). If \fIwhat\fR is \fBunits\fR, the view adjusts up or down by -\fInumber\fR lines on the display; if it is \fBpages\fR then the view +(the result is rounded to the nearest integer value. If no units are given, +pixels are assumed). If \fIwhat\fR is \fBunits\fR, the view adjusts up or down +by \fInumber\fR lines on the display; if it is \fBpages\fR then the view adjusts by \fInumber\fR screenfuls; if it is \fBpixels\fR then the view -adjusts by \fInumber\fR pixels. -.VE 8.5 -If \fInumber\fR is negative then earlier positions in the text -become visible; if it is positive then later positions in the text -become visible. +adjusts by \fInumber\fR pixels. If \fInumber\fR is negative then earlier +positions in the text become visible; if it is positive then later positions +in the text become visible. .TP \fIpathName \fByview \fR?\fB\-pickplace\fR? \fIindex\fR -Changes the view in the widget's window to make \fIindex\fR visible. -If the \fB\-pickplace\fR option is not specified then \fIindex\fR will -appear at the top of the window. -If \fB\-pickplace\fR is specified then the widget chooses where -\fIindex\fR appears in the window: +. +Changes the view in the widget's window to make \fIindex\fR visible. If the +\fB\-pickplace\fR option is not specified then \fIindex\fR will appear at the +top of the window. If \fB\-pickplace\fR is specified then the widget chooses +where \fIindex\fR appears in the window: .RS .IP [1] -If \fIindex\fR is already visible somewhere in the window then the -command does nothing. +If \fIindex\fR is already visible somewhere in the window then the command +does nothing. .IP [2] -If \fIindex\fR is only a few lines off-screen above the window then -it will be positioned at the top of the window. +If \fIindex\fR is only a few lines off-screen above the window then it will be +positioned at the top of the window. .IP [3] -If \fIindex\fR is only a few lines off-screen below the window then -it will be positioned at the bottom of the window. +If \fIindex\fR is only a few lines off-screen below the window then it will be +positioned at the bottom of the window. .IP [4] Otherwise, \fIindex\fR will be centered in the window. .LP -The \fB\-pickplace\fR option has been obsoleted by the \fIpathName \fBsee\fR widget -command (\fIpathName \fBsee\fR handles both x- and y-motion to make a location -visible, whereas the \fB\-pickplace\fR mode only handles motion in y). +The \fB\-pickplace\fR option has been obsoleted by the \fIpathName \fBsee\fR +widget command (\fIpathName \fBsee\fR handles both x- and y-motion to make a +location visible, whereas the \fB\-pickplace\fR mode only handles motion in +y). .RE .TP \fIpathName \fByview \fInumber\fR -This command makes the first character on the line after -the one given by \fInumber\fR visible at the top of the window. -\fINumber\fR must be an integer. -This command used to be used for scrolling, but now it is obsolete. +. +This command makes the first character on the line after the one given by +\fInumber\fR visible at the top of the window. \fINumber\fR must be an +integer. This command used to be used for scrolling, but now it is obsolete. .RE .SH BINDINGS .PP -Tk automatically creates class bindings for texts that give them -the following default behavior. -In the descriptions below, +Tk automatically creates class bindings for texts that give them the following +default behavior. In the descriptions below, .QW word -is dependent on the value of -the \fBtcl_wordchars\fR variable. See \fBtclvars\fR(n). +is dependent on the value of the \fBtcl_wordchars\fR variable. See +\fBtclvars\fR(n). .IP [1] -Clicking mouse button 1 positions the insertion cursor -just before the character underneath the mouse cursor, sets the -input focus to this widget, and clears any selection in the widget. -Dragging with mouse button 1 strokes out a selection between -the insertion cursor and the character under the mouse. +Clicking mouse button 1 positions the insertion cursor just before the +character underneath the mouse cursor, sets the input focus to this widget, +and clears any selection in the widget. Dragging with mouse button 1 strokes +out a selection between the insertion cursor and the character under the +mouse. .IP [2] -Double-clicking with mouse button 1 selects the word under the mouse -and positions the insertion cursor at the start of the word. -Dragging after a double click will stroke out a selection consisting -of whole words. +Double-clicking with mouse button 1 selects the word under the mouse and +positions the insertion cursor at the start of the word. Dragging after a +double click will stroke out a selection consisting of whole words. .IP [3] -Triple-clicking with mouse button 1 selects the line under the mouse -and positions the insertion cursor at the start of the line. -Dragging after a triple click will stroke out a selection consisting -of whole lines. +Triple-clicking with mouse button 1 selects the line under the mouse and +positions the insertion cursor at the start of the line. Dragging after a +triple click will stroke out a selection consisting of whole lines. .IP [4] -The ends of the selection can be adjusted by dragging with mouse -button 1 while the Shift key is down; this will adjust the end -of the selection that was nearest to the mouse cursor when button -1 was pressed. -If the button is double-clicked before dragging then the selection -will be adjusted in units of whole words; if it is triple-clicked -then the selection will be adjusted in units of whole lines. +The ends of the selection can be adjusted by dragging with mouse button 1 +while the Shift key is down; this will adjust the end of the selection that +was nearest to the mouse cursor when button 1 was pressed. If the button is +double-clicked before dragging then the selection will be adjusted in units of +whole words; if it is triple-clicked then the selection will be adjusted in +units of whole lines. .IP [5] Clicking mouse button 1 with the Control key down will reposition the insertion cursor without affecting the selection. .IP [6] -If any normal printing characters are typed, they are -inserted at the point of the insertion cursor. -.IP [7] -The view in the widget can be adjusted by dragging with mouse button 2. -If mouse button 2 is clicked without moving the mouse, the selection -is copied into the text at the position of the mouse cursor. -The Insert key also inserts the selection, but at the position of +If any normal printing characters are typed, they are inserted at the point of the insertion cursor. +.IP [7] +The view in the widget can be adjusted by dragging with mouse button 2. If +mouse button 2 is clicked without moving the mouse, the selection is copied +into the text at the position of the mouse cursor. The Insert key also inserts +the selection, but at the position of the insertion cursor. .IP [8] -If the mouse is dragged out of the widget -while button 1 is pressed, the entry will automatically scroll to -make more text visible (if there is more text off-screen on the side -where the mouse left the window). +If the mouse is dragged out of the widget while button 1 is pressed, the entry +will automatically scroll to make more text visible (if there is more text +off-screen on the side where the mouse left the window). .IP [9] -The Left and Right keys move the insertion cursor one character to the -left or right; they also clear any selection in the text. -If Left or Right is typed with the Shift key down, then the insertion -cursor moves and the selection is extended to include the new character. -Control-Left and Control-Right move the insertion cursor by words, and -Control-Shift-Left and Control-Shift-Right move the insertion cursor -by words and also extend the selection. -Control-b and Control-f behave the same as Left and Right, respectively. -Meta-b and Meta-f behave the same as Control-Left and Control-Right, -respectively. +The Left and Right keys move the insertion cursor one character to the left or +right; they also clear any selection in the text. If Left or Right is typed +with the Shift key down, then the insertion cursor moves and the selection is +extended to include the new character. Control-Left and Control-Right move the +insertion cursor by words, and Control-Shift-Left and Control-Shift-Right move +the insertion cursor by words and also extend the selection. Control-b and +Control-f behave the same as Left and Right, respectively. Meta-b and Meta-f +behave the same as Control-Left and Control-Right, respectively. .IP [10] -The Up and Down keys move the insertion cursor one line up or -down and clear any selection in the text. -If Up or Right is typed with the Shift key down, then the insertion -cursor moves and the selection is extended to include the new character. -Control-Up and Control-Down move the insertion cursor by paragraphs (groups -of lines separated by blank lines), and -Control-Shift-Up and Control-Shift-Down move the insertion cursor -by paragraphs and also extend the selection. -Control-p and Control-n behave the same as Up and Down, respectively. +The Up and Down keys move the insertion cursor one line up or down and clear +any selection in the text. If Up or Right is typed with the Shift key down, +then the insertion cursor moves and the selection is extended to include the +new character. Control-Up and Control-Down move the insertion cursor by +paragraphs (groups of lines separated by blank lines), and Control-Shift-Up +and Control-Shift-Down move the insertion cursor by paragraphs and also extend +the selection. Control-p and Control-n behave the same as Up and Down, +respectively. .IP [11] -The Next and Prior keys move the insertion cursor forward or backwards -by one screenful and clear any selection in the text. -If the Shift key is held down while Next or Prior is typed, then -the selection is extended to include the new character. +The Next and Prior keys move the insertion cursor forward or backwards by one +screenful and clear any selection in the text. If the Shift key is held down +while Next or Prior is typed, then the selection is extended to include the +new character. .IP [12] Control-Next and Control-Prior scroll the view right or left by one page without moving the insertion cursor or affecting the selection. .IP [13] -Home and Control-a move the insertion cursor to the -beginning of its display line and clear any selection in the widget. -Shift-Home moves the insertion cursor to the beginning of the display line -and also extends the selection to that point. +Home and Control-a move the insertion cursor to the beginning of its display +line and clear any selection in the widget. Shift-Home moves the insertion +cursor to the beginning of the display line and also extends the selection to +that point. .IP [14] -End and Control-e move the insertion cursor to the -end of the display line and clear any selection in the widget. -Shift-End moves the cursor to the end of the display line and extends -the selection to that point. +End and Control-e move the insertion cursor to the end of the display line and +clear any selection in the widget. Shift-End moves the cursor to the end of +the display line and extends the selection to that point. .IP [15] -Control-Home and Meta-< move the insertion cursor to the beginning of -the text and clear any selection in the widget. -Control-Shift-Home moves the insertion cursor to the beginning of the text -and also extends the selection to that point. +Control-Home and Meta-< move the insertion cursor to the beginning of the text +and clear any selection in the widget. Control-Shift-Home moves the insertion +cursor to the beginning of the text and also extends the selection to that +point. .IP [16] -Control-End and Meta-> move the insertion cursor to the end of the -text and clear any selection in the widget. -Control-Shift-End moves the cursor to the end of the text and extends -the selection to that point. +Control-End and Meta-> move the insertion cursor to the end of the text and +clear any selection in the widget. Control-Shift-End moves the cursor to the +end of the text and extends the selection to that point. .IP [17] -The Select key and Control-Space set the selection anchor to the position -of the insertion cursor. They do not affect the current selection. -Shift-Select and Control-Shift-Space adjust the selection to the -current position of the insertion cursor, selecting from the anchor -to the insertion cursor if there was not any selection previously. +The Select key and Control-Space set the selection anchor to the position of +the insertion cursor. They do not affect the current selection. Shift-Select +and Control-Shift-Space adjust the selection to the current position of the +insertion cursor, selecting from the anchor to the insertion cursor if there +was not any selection previously. .IP [18] Control-/ selects the entire contents of the widget. .IP [19] Control-\e clears any selection in the widget. .IP [20] -The F16 key (labelled Copy on many Sun workstations) or Meta-w -copies the selection in the widget to the clipboard, if there is a selection. -This action is carried out by the command \fBtk_textCopy\fR. +The F16 key (labelled Copy on many Sun workstations) or Meta-w copies the +selection in the widget to the clipboard, if there is a selection. This +action is carried out by the command \fBtk_textCopy\fR. .IP [21] -The F20 key (labelled Cut on many Sun workstations) or Control-w -copies the selection in the widget to the clipboard and deletes -the selection. -This action is carried out by the command \fBtk_textCut\fR. -If there is no selection in the widget then these keys have no effect. +The F20 key (labelled Cut on many Sun workstations) or Control-w copies the +selection in the widget to the clipboard and deletes the selection. This +action is carried out by the command \fBtk_textCut\fR. If there is no +selection in the widget then these keys have no effect. .IP [22] -The F18 key (labelled Paste on many Sun workstations) or Control-y -inserts the contents of the clipboard at the position of the -insertion cursor. -This action is carried out by the command \fBtk_textPaste\fR. +The F18 key (labelled Paste on many Sun workstations) or Control-y inserts the +contents of the clipboard at the position of the insertion cursor. This action +is carried out by the command \fBtk_textPaste\fR. .IP [23] -The Delete key deletes the selection, if there is one in the widget. -If there is no selection, it deletes the character to the right of -the insertion cursor. +The Delete key deletes the selection, if there is one in the widget. If there +is no selection, it deletes the character to the right of the insertion +cursor. .IP [24] -Backspace and Control-h delete the selection, if there is one -in the widget. -If there is no selection, they delete the character to the left of -the insertion cursor. +Backspace and Control-h delete the selection, if there is one in the widget. +If there is no selection, they delete the character to the left of the +insertion cursor. .IP [25] Control-d deletes the character to the right of the insertion cursor. .IP [26] Meta-d deletes the word to the right of the insertion cursor. .IP [27] -Control-k deletes from the insertion cursor to the end of its line; -if the insertion cursor is already at the end of a line, then -Control-k deletes the newline character. +Control-k deletes from the insertion cursor to the end of its line; if the +insertion cursor is already at the end of a line, then Control-k deletes the +newline character. .IP [28] -Control-o opens a new line by inserting a newline character in -front of the insertion cursor without moving the insertion cursor. +Control-o opens a new line by inserting a newline character in front of the +insertion cursor without moving the insertion cursor. .IP [29] -Meta-backspace and Meta-Delete delete the word to the left of the -insertion cursor. +Meta-backspace and Meta-Delete delete the word to the left of the insertion +cursor. .IP [30] -Control-x deletes whatever is selected in the text widget -after copying it to the clipboard. +Control-x deletes whatever is selected in the text widget after copying it to +the clipboard. .IP [31] -Control-t reverses the order of the two characters to the right of -the insertion cursor. +Control-t reverses the order of the two characters to the right of the +insertion cursor. .IP [32] -Control-z (and Control-underscore on UNIX when \fBtk_strictMotif\fR is -true) undoes the last edit action if the \fB\-undo\fR option is true. -Does nothing otherwise. +Control-z (and Control-underscore on UNIX when \fBtk_strictMotif\fR is true) +undoes the last edit action if the \fB\-undo\fR option is true. Does nothing +otherwise. .IP [33] -Control-Z (or Control-y on Windows) reapplies the last undone edit -action if the \fB\-undo\fR option is true. Does nothing otherwise. +Control-Z (or Control-y on Windows) reapplies the last undone edit action if +the \fB\-undo\fR option is true. Does nothing otherwise. .PP -If the widget is disabled using the \fB\-state\fR option, then its -view can still be adjusted and text can still be selected, -but no insertion cursor will be displayed and no text modifications will -take place. +If the widget is disabled using the \fB\-state\fR option, then its view can +still be adjusted and text can still be selected, but no insertion cursor will +be displayed and no text modifications will take place. .PP -The behavior of texts can be changed by defining new bindings for -individual widgets or by redefining the class bindings. +The behavior of texts can be changed by defining new bindings for individual +widgets or by redefining the class bindings. .SH "KNOWN ISSUES" .SS "ISSUES CONCERNING CHARS AND INDICES" -.VS 8.5 .PP Before Tk 8.5, the widget used the string .QW chars -to refer to index positions (which included characters, embedded -windows and embedded images). As of Tk 8.5 the text widget deals -separately and correctly with +to refer to index positions (which included characters, embedded windows and +embedded images). As of Tk 8.5 the text widget deals separately and correctly +with .QW chars and .QW indices . @@ -2224,87 +1995,76 @@ For backwards compatibility, however, the index modifiers .QW "+N chars" and .QW "\-N chars" -continue to refer to indices. -One must use any of the full forms +continue to refer to indices. One must use any of the full forms .QW "+N any chars" or .QW "\-N any chars" -etc. to refer to actual character indices. This confusion may be fixed in a +etc. to refer to actual character indices. This confusion may be fixed in a future release by making the widget correctly interpret .QW "+N chars" as a synonym for .QW "+N any chars" . -.VE 8.5 .SS "PERFORMANCE ISSUES" .PP -Text widgets should run efficiently under a variety -of conditions. The text widget uses about 2-3 bytes of -main memory for each byte of text, so texts containing a megabyte -or more should be practical on most workstations. -Text is represented internally with a modified B-tree structure -that makes operations relatively efficient even with large texts. -Tags are included in the B-tree structure in a way that allows -tags to span large ranges or have many disjoint smaller ranges -without loss of efficiency. -Marks are also implemented in a way that allows large numbers of -marks. -In most cases it is fine to have large numbers of unique tags, -or a tag that has many distinct ranges. +Text widgets should run efficiently under a variety of conditions. The text +widget uses about 2-3 bytes of main memory for each byte of text, so texts +containing a megabyte or more should be practical on most workstations. Text +is represented internally with a modified B-tree structure that makes +operations relatively efficient even with large texts. Tags are included in +the B-tree structure in a way that allows tags to span large ranges or have +many disjoint smaller ranges without loss of efficiency. Marks are also +implemented in a way that allows large numbers of marks. In most cases it is +fine to have large numbers of unique tags, or a tag that has many distinct +ranges. .PP -One performance problem can arise if you have hundreds or thousands -of different tags that all have the following characteristics: -the first and last ranges of each tag are near the beginning and -end of the text, respectively, -or a single tag range covers most of the text widget. -The cost of adding and deleting tags like this is proportional -to the number of other tags with the same properties. -In contrast, there is no problem with having thousands of distinct -tags if their overall ranges are localized and spread uniformly throughout -the text. +One performance problem can arise if you have hundreds or thousands of +different tags that all have the following characteristics: the first and last +ranges of each tag are near the beginning and end of the text, respectively, +or a single tag range covers most of the text widget. The cost of adding and +deleting tags like this is proportional to the number of other tags with the +same properties. In contrast, there is no problem with having thousands of +distinct tags if their overall ranges are localized and spread uniformly +throughout the text. .PP -Very long text lines can be expensive, -especially if they have many marks and tags within them. +Very long text lines can be expensive, especially if they have many marks and +tags within them. .PP -The display line with the insert cursor is redrawn each time the -cursor blinks, which causes a steady stream of graphics traffic. -Set the \fBinsertOffTime\fR attribute to 0 avoid this. +The display line with the insert cursor is redrawn each time the cursor +blinks, which causes a steady stream of graphics traffic. Set the +\fBinsertOffTime\fR attribute to 0 avoid this. .SS "KNOWN BUGS" -.VS 8.5 .PP -The \fIpathName \fBsearch \-regexp\fR sub-command attempts to perform sophisticated -regexp matching across multiple lines in an efficient fashion (since Tk -8.5), examining each line individually, and then in small groups of lines, -whether searching forwards or backwards. Under certain conditions the -search result might differ from that obtained by applying the same regexp -to the entire text from the widget in one go. For example, when -searching with a greedy regexp, the widget will continue to attempt to -add extra lines to the match as long as one of two conditions are true: -either Tcl's regexp library returns a code to indicate a longer match is -possible (but there are known bugs in Tcl which mean this code is not -always correctly returned); or if each extra line added results in at -least a partial match with the pattern. This means in the case where the -first extra line added results in no match and Tcl's regexp system -returns the incorrect code and adding a second extra line would actually -match, the text widget will return the wrong result. In practice this is -a rare problem, but it can occur, for example: +The \fIpathName \fBsearch \-regexp\fR sub-command attempts to perform +sophisticated regexp matching across multiple lines in an efficient fashion +(since Tk 8.5), examining each line individually, and then in small groups of +lines, whether searching forwards or backwards. Under certain conditions the +search result might differ from that obtained by applying the same regexp to +the entire text from the widget in one go. For example, when searching with a +greedy regexp, the widget will continue to attempt to add extra lines to the +match as long as one of two conditions are true: either Tcl's regexp library +returns a code to indicate a longer match is possible (but there are known +bugs in Tcl which mean this code is not always correctly returned); or if each +extra line added results in at least a partial match with the pattern. This +means in the case where the first extra line added results in no match and +Tcl's regexp system returns the incorrect code and adding a second extra line +would actually match, the text widget will return the wrong result. In +practice this is a rare problem, but it can occur, for example: .CS pack [text .t] \.t insert 1.0 "aaaa\enbbbb\encccc\enbbbb\enaaaa\en" \.t search \-regexp \-\- {(a+|b+\enc+\enb+)+\ena+} 1.0 .CE -will not find a match when one exists of 19 -characters starting from the first +will not find a match when one exists of 19 characters starting from the first .QW b . .PP -Whenever one possible match is fully enclosed in another, the search -command will attempt to ensure only the larger match is returned. -When performing backwards regexp searches it is possible that Tcl -will not always achieve this, in the case where a match is preceded by -one or more short, non-overlapping matches, all of which are preceded -by a large match which actually encompasses all of them. The search -algorithm used by the widget does not look back arbitrarily far for a -possible match which might cover large portions of the widget. -For example: +Whenever one possible match is fully enclosed in another, the search command +will attempt to ensure only the larger match is returned. When performing +backwards regexp searches it is possible that Tcl will not always achieve +this, in the case where a match is preceded by one or more short, +non-overlapping matches, all of which are preceded by a large match which +actually encompasses all of them. The search algorithm used by the widget does +not look back arbitrarily far for a possible match which might cover large +portions of the widget. For example: .CS pack [text .t] \.t insert 1.0 "aaaa\enbbbb\enbbbb\enbbbb\enbbbb\\n" @@ -2323,7 +2083,6 @@ and when really it should only match at .QW 1.0 since that match encloses all the others. -.VE 8.5 .SH "SEE ALSO" entry(n), scrollbar(n) .SH KEYWORDS diff --git a/doc/tk.n b/doc/tk.n index 2073e3e..66fa643 100644 --- a/doc/tk.n +++ b/doc/tk.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1992 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: tk.n,v 1.17 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: tk.n,v 1.18 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH tk n 8.4 Tk "Tk Built-In Commands" @@ -16,7 +17,6 @@ tk \- Manipulate Tk internal state .SH SYNOPSIS \fBtk\fR \fIoption \fR?\fIarg arg ...\fR? .BE - .SH DESCRIPTION .PP The \fBtk\fR command provides access to miscellaneous diff --git a/doc/tkerror.n b/doc/tkerror.n index 61b8350..d57acc9 100644 --- a/doc/tkerror.n +++ b/doc/tkerror.n @@ -1,38 +1,37 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: tkerror.n,v 1.2 1998/09/14 18:23:00 stanton Exp $ -'\" -.so man.macros -.TH tkerror n 4.1 Tk "Tk Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -tkerror \- Command invoked to process background errors -.SH SYNOPSIS -\fBtkerror \fImessage\fR -.BE - -.SH DESCRIPTION -.PP -Note: as of Tk 4.1 the \fBtkerror\fR command has been renamed to -\fBbgerror\fR because the event loop (which is what usually invokes -it) is now part of Tcl. For backward compatibility -the \fBbgerror\fR provided by the current Tk version still -tries to call \fBtkerror\fR if there is one (or an auto loadable one), -so old script defining that error handler should still work, but you -should anyhow modify your scripts to use \fBbgerror\fR instead -of \fBtkerror\fR because that support for the old name might vanish -in the near future. If that call fails, \fBbgerror\fR -posts a dialog showing the error and offering to see the stack trace -to the user. If you want your own error management you should -directly override \fBbgerror\fR instead of \fBtkerror\fR. -Documentation for \fBbgerror\fR is available as part of Tcl's -documentation. - -.SH KEYWORDS -background error, reporting +'\" -*- nroff -*- +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: tkerror.n,v 1.3 2008/06/30 22:57:03 dkf Exp $ +'\" +.so man.macros +.TH tkerror n 4.1 Tk "Tk Built-In Commands" +.BS +'\" Note: do not modify the .SH NAME line immediately below! +.SH NAME +tkerror \- Command invoked to process background errors +.SH SYNOPSIS +\fBtkerror \fImessage\fR +.BE +.SH DESCRIPTION +.PP +Note: as of Tk 4.1 the \fBtkerror\fR command has been renamed to +\fBbgerror\fR because the event loop (which is what usually invokes +it) is now part of Tcl. For backward compatibility +the \fBbgerror\fR provided by the current Tk version still +tries to call \fBtkerror\fR if there is one (or an auto loadable one), +so old script defining that error handler should still work, but you +should anyhow modify your scripts to use \fBbgerror\fR instead +of \fBtkerror\fR because that support for the old name might vanish +in the near future. If that call fails, \fBbgerror\fR +posts a dialog showing the error and offering to see the stack trace +to the user. If you want your own error management you should +directly override \fBbgerror\fR instead of \fBtkerror\fR. +Documentation for \fBbgerror\fR is available as part of Tcl's +documentation. +.SH KEYWORDS +background error, reporting diff --git a/doc/tkvars.n b/doc/tkvars.n index a4dfc86..fb52710 100644 --- a/doc/tkvars.n +++ b/doc/tkvars.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1990-1994 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: tkvars.n,v 1.5 2007/12/13 15:23:43 dgp Exp $ +'\" RCS: @(#) $Id: tkvars.n,v 1.6 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH tkvars n 4.1 Tk "Tk Built-In Commands" @@ -14,7 +15,6 @@ .SH NAME tkvars \- Variables used or set by Tk .BE - .SH DESCRIPTION .PP The following Tcl variables are either set or used by Tk at various times @@ -75,6 +75,5 @@ any Tk release that includes changes that are not backward compatible work with the new release). The minor version number increases with each new release of Tk, except that it resets to zero whenever the major version number changes. - .SH KEYWORDS variables, version, text diff --git a/doc/tkwait.n b/doc/tkwait.n index b3282c2..33d6426 100644 --- a/doc/tkwait.n +++ b/doc/tkwait.n @@ -1,51 +1,50 @@ -'\" -'\" Copyright (c) 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. -'\" -'\" RCS: @(#) $Id: tkwait.n,v 1.2 1998/09/14 18:23:00 stanton Exp $ -'\" -.so man.macros -.TH tkwait n "" Tk "Tk Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -tkwait \- Wait for variable to change or window to be destroyed -.SH SYNOPSIS -\fBtkwait variable \fIname\fR -.sp -\fBtkwait visibility \fIname\fR -.sp -\fBtkwait window \fIname\fR -.BE - -.SH DESCRIPTION -.PP -The \fBtkwait\fR command waits for one of several things to happen, -then it returns without taking any other actions. -The return value is always an empty string. -If the first argument is \fBvariable\fR (or any abbreviation of -it) then the second argument is the name of a global variable and the -command waits for that variable to be modified. -If the first argument is \fBvisibility\fR (or any abbreviation -of it) then the second argument is the name of a window and the -\fBtkwait\fR command waits for a change in its -visibility state (as indicated by the arrival of a VisibilityNotify -event). This form is typically used to wait for a newly-created -window to appear on the screen before taking some action. -If the first argument is \fBwindow\fR (or any abbreviation -of it) then the second argument is the name of a window and the -\fBtkwait\fR command waits for that window to be destroyed. -This form is typically used to wait for a user to finish interacting -with a dialog box before using the result of that interaction. -.PP -While the \fBtkwait\fR command is waiting it processes events in -the normal fashion, so the application will continue to respond -to user interactions. -If an event handler invokes \fBtkwait\fR again, the nested call -to \fBtkwait\fR must complete before the outer call can complete. - -.SH KEYWORDS -variable, visibility, wait, window +'\" -*- nroff -*- +'\" +'\" Copyright (c) 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. +'\" +'\" RCS: @(#) $Id: tkwait.n,v 1.3 2008/06/30 22:57:03 dkf Exp $ +'\" +.so man.macros +.TH tkwait n "" Tk "Tk Built-In Commands" +.BS +'\" Note: do not modify the .SH NAME line immediately below! +.SH NAME +tkwait \- Wait for variable to change or window to be destroyed +.SH SYNOPSIS +\fBtkwait variable \fIname\fR +.sp +\fBtkwait visibility \fIname\fR +.sp +\fBtkwait window \fIname\fR +.BE +.SH DESCRIPTION +.PP +The \fBtkwait\fR command waits for one of several things to happen, +then it returns without taking any other actions. +The return value is always an empty string. +If the first argument is \fBvariable\fR (or any abbreviation of +it) then the second argument is the name of a global variable and the +command waits for that variable to be modified. +If the first argument is \fBvisibility\fR (or any abbreviation +of it) then the second argument is the name of a window and the +\fBtkwait\fR command waits for a change in its +visibility state (as indicated by the arrival of a VisibilityNotify +event). This form is typically used to wait for a newly-created +window to appear on the screen before taking some action. +If the first argument is \fBwindow\fR (or any abbreviation +of it) then the second argument is the name of a window and the +\fBtkwait\fR command waits for that window to be destroyed. +This form is typically used to wait for a user to finish interacting +with a dialog box before using the result of that interaction. +.PP +While the \fBtkwait\fR command is waiting it processes events in +the normal fashion, so the application will continue to respond +to user interactions. +If an event handler invokes \fBtkwait\fR again, the nested call +to \fBtkwait\fR must complete before the outer call can complete. +.SH KEYWORDS +variable, visibility, wait, window diff --git a/doc/toplevel.n b/doc/toplevel.n index 3a6ce11..f213a21 100644 --- a/doc/toplevel.n +++ b/doc/toplevel.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: toplevel.n,v 1.9 2007/12/13 15:23:44 dgp Exp $ +'\" RCS: @(#) $Id: toplevel.n,v 1.10 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH toplevel n 8.4 Tk "Tk Built-In Commands" @@ -96,7 +96,6 @@ acceptable to \fBTk_GetPixels\fR. If this option is less than or equal to zero then the window will not request any size at all. .BE - .SH DESCRIPTION .PP The \fBtoplevel\fR command creates a new toplevel widget (given @@ -114,7 +113,6 @@ purpose of a toplevel is to serve as a container for dialog boxes and other collections of widgets. The only visible features of a toplevel are its background color and an optional 3-D border to make the toplevel appear raised or sunken. - .SH "WIDGET COMMAND" .PP The \fBtoplevel\fR command creates a new Tcl command whose @@ -148,18 +146,14 @@ modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. \fIOption\fR may have any of the values accepted by the \fBtoplevel\fR command. - .SH BINDINGS .PP When a new toplevel is created, it has no default event bindings: toplevels are not intended to be interactive. - .SH "SEE ALSO" frame(n) - .SH KEYWORDS toplevel, widget - '\" Local Variables: '\" mode: nroff '\" End: diff --git a/doc/ttk_Geometry.3 b/doc/ttk_Geometry.3 index 74e44f4..0923d02 100644 --- a/doc/ttk_Geometry.3 +++ b/doc/ttk_Geometry.3 @@ -1,7 +1,7 @@ '\" '\" Copyright (c) 2004 Joe English '\" -'\" RCS: @(#) $Id: ttk_Geometry.3,v 1.4 2007/12/13 15:23:44 dgp Exp $ +'\" RCS: @(#) $Id: ttk_Geometry.3,v 1.5 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH Geometry 3 8.5 Tk "Tk Themed Widget" @@ -42,7 +42,7 @@ Ttk_Padding Ttk_Padding \fBTtk_AddPadding\fR(Ttk_Padding \fIpadding1\fR, Ttk_Padding \fIpadding2\fR; -Ttk_Padding +Ttk_Padding \fBTtk_RelievePadding\fR(Ttk_Padding \fIpadding\fR, int \fIrelief\fR); int @@ -57,7 +57,6 @@ int int \fBTtk_GetStickyFromObj\fR(Tcl_Interp *\fIinterp\fR, Tcl_Obj *\fIobjPtr\fR, int *\fIsticky_rtn\fR); .fi - .SH ARGUMENTS .AP Tk_Anchor anchor in One of the symbolic constants \fBTK_ANCHOR_N\fR, \fBTK_ANCHOR_NE\fR, @@ -118,16 +117,16 @@ X coordinate of upper-left corner of region. .AP int y in Y coordinate of upper-left corner of region. .BE - .SH "BOXES" -The \fBTtk_Box\fR structure represents a rectangular region of a window: +.PP +The \fBTtk_Box\fR structure represents a rectangular region of a window: .CS -typedef struct { - int x; - int y; - int width; - int height; -} Ttk_Box; +typedef struct { + int \fIx\fR; + int \fIy\fR; + int \fIwidth\fR; + int \fIheight\fR; +} \fBTtk_Box\fR; .CE All coordinates are relative to the window. .PP @@ -136,12 +135,12 @@ a \fBTtk_Box\fR structure representing a region \fIwidth\fR pixels wide, \fIheight\fR pixels tall, at the specified \fIx, y\fR coordinates. .PP \fBTtk_PadBox\fR returns a new box located inside the specified \fIparcel\fR, -shrunken according to the left, top, right, and bottom margins +shrunken according to the left, top, right, and bottom margins specified by \fIpadding\fR. .PP \fBTtk_ExpandBox\fR is the inverse of \fBTtk_PadBox\fR: it returns a new box surrounding the specified \fIparcel\fR, -expanded according to the left, top, right, and bottom margins +expanded according to the left, top, right, and bottom margins specified by \fIpadding\fR. .PP \fBTtk_PackBox\fR allocates a parcel \fIwidth\fR by \fIheight\fR @@ -149,7 +148,7 @@ pixels wide on the specified \fIside\fR of the \fIcavity\fR, and shrinks the \fIcavity\fR accordingly. .PP \fBTtk_StickBox\fR places a box with the requested \fIwidth\fR -and \fIheight\fR inside the \fIparcel\fR according to the +and \fIheight\fR inside the \fIparcel\fR according to the \fIsticky\fR bits. .PP \fBTtk_PlaceBox\fR combines \fBTtk_PackBox\fR and \fBTtk_StickBox\fR: @@ -164,20 +163,21 @@ specified \fIanchor\fR option. \fBTtk_BoxContains\fR tests if the specified \fIx, y\fR coordinate lies within the rectangular region \fIbox\fR. .SH "PADDDING" -The \fBTtk_Padding\fR structure is used to represent +.PP +The \fBTtk_Padding\fR structure is used to represent borders, internal padding, and external margins: .CS typedef struct { - short left; - short top; - short right; - short bottom; -} Ttk_Padding; + short \fIleft\fR; + short \fItop\fR; + short \fIright\fR; + short \fIbottom\fR; +} \fBTtk_Padding\fR; .CE -.PP +.PP \fBTtk_MakePadding\fR is a convenience routine that contsructs a \fBTtk_Padding\fR structure with the specified left, top, right, and bottom -components. +components. .PP \fBTtk_UniformPadding\fR constructs a \fBTtk_Padding\fR structure with all components equal to the specified \fIborder\fR. @@ -200,6 +200,7 @@ This is typically used in element geometry procedures to simulate a .QW pressed-in look for pushbuttons. .SH "CONVERSION ROUTINES" +.PP \fBTtk_GetPaddingFromObj\fR converts the string in \fIobjPtr\fR to a \fBTtk_Padding\fR structure. The string representation is a list of diff --git a/doc/ttk_Theme.3 b/doc/ttk_Theme.3 index fb16978..9340d0f 100644 --- a/doc/ttk_Theme.3 +++ b/doc/ttk_Theme.3 @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_Theme.3,v 1.1 2006/10/31 01:42:25 hobbs Exp $ +'\" RCS: @(#) $Id: ttk_Theme.3,v 1.2 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH Ttk_CreateTheme 3 8.5 Tk "Tk Themed Widget" @@ -28,7 +28,7 @@ inherit elements and layouts. The name of the theme. .BE .SH DESCRIPTION - +.\" TODO - Document these functions better! .SH "SEE ALSO" Ttk_RegisterLayout, Ttk_BuildLayout .\" .SH KEYWORDS diff --git a/doc/ttk_button.n b/doc/ttk_button.n index fca276b..bae5c6c 100644 --- a/doc/ttk_button.n +++ b/doc/ttk_button.n @@ -1,10 +1,11 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 2004 Joe English '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_button.n,v 1.12 2008/05/09 18:35:00 patthoyts Exp $ +'\" RCS: @(#) $Id: ttk_button.n,v 1.13 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH ttk::button n 8.5 Tk "Tk Themed Widget" @@ -56,6 +57,7 @@ in the style. .\" .OP \-padding padding Padding .\" .OP \-relief relief Relief .SH "WIDGET COMMAND" +.PP In addition to the standard \fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR commands, checkbuttons support the following additional diff --git a/doc/ttk_checkbutton.n b/doc/ttk_checkbutton.n index 90d4368..777ece6 100644 --- a/doc/ttk_checkbutton.n +++ b/doc/ttk_checkbutton.n @@ -1,10 +1,11 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 2004 Joe English '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_checkbutton.n,v 1.13 2008/05/09 18:35:00 patthoyts Exp $ +'\" RCS: @(#) $Id: ttk_checkbutton.n,v 1.14 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH ttk::checkbutton n 8.5 Tk "Tk Themed Widget" @@ -37,6 +38,7 @@ when the widget is selected. Defaults to \fB1\fR. The name of a global variable whose value is linked to the widget. Defaults to the widget pathname if not specified. .SH "WIDGET COMMAND" +.PP In addition to the standard \fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR commands, checkbuttons support the following additional @@ -53,6 +55,7 @@ Returns the result of the \fB\-command\fR. .\" Are these useful? They don't invoke the -command .\" Missing: flash. This is definitely not useful. .SH "WIDGET STATES" +.PP The widget does not respond to user input if the \fBdisabled\fR state is set. The widget sets the \fBselected\fR state whenever the linked \fB\-variable\fR is set to the widget's \fB\-onvalue\fR, diff --git a/doc/ttk_combobox.n b/doc/ttk_combobox.n index 1a313c3..bf8e154 100644 --- a/doc/ttk_combobox.n +++ b/doc/ttk_combobox.n @@ -1,10 +1,11 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 2004 Joe English '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_combobox.n,v 1.16 2008/05/09 18:35:00 patthoyts Exp $ +'\" RCS: @(#) $Id: ttk_combobox.n,v 1.17 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH ttk::combobox n 8.5 Tk "Tk Themed Widget" @@ -15,6 +16,7 @@ ttk::combobox \- text field with popdown selection list \fBttk::combobox\fR \fIpathName \fR?\fIoptions\fR? .BE .SH DESCRIPTION +.PP A \fBttk::combobox\fR combines a text field with a pop-down list of values; the user may select the value of the text field from among the values in the list. @@ -97,6 +99,7 @@ widget commands (see \fIttk::entry(n)\fR for details): \fBxview\fR .DE .SH "VIRTUAL EVENTS" +.PP The combobox widget generates a \fB<>\fR virtual event when the user selects an element from the list of values. If the selection action unposts the listbox, diff --git a/doc/ttk_entry.n b/doc/ttk_entry.n index 2be5714..fff2579 100644 --- a/doc/ttk_entry.n +++ b/doc/ttk_entry.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. '\" Copyright (c) 1998-2000 Scriptics Corporation. @@ -7,7 +8,7 @@ '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" '\" SOURCE: entry.n, r1.12 -'\" RCS: @(#) $Id: ttk_entry.n,v 1.11 2008/01/29 15:38:00 dkf Exp $ +'\" RCS: @(#) $Id: ttk_entry.n,v 1.12 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH ttk::entry n 8.5 Tk "Tk Themed Widget" @@ -88,6 +89,7 @@ in average-size characters of the widget's font. .\" Not in ttk: If the value is less than or equal to zero, the widget picks a .\" Not in ttk: size just large enough to hold its current text. .SH NOTES +.PP A portion of the entry may be selected as described below. If an entry is exporting its selection (see the \fBexportSelection\fR option), then it will observe the standard X11 protocols for handling the @@ -105,6 +107,7 @@ the standard \fBxScrollCommand\fR mechanism for interacting with scrollbars (see the description of the \fBxScrollCommand\fR option for details). .SH "INDICES" +.PP Many of the \fBentry\fR widget commands take one or more indices as arguments. An index specifies a particular character in the entry's string, in any of the following ways: @@ -262,9 +265,11 @@ become visible; if it is positive then characters farther to the right become visible. .RE .SH VALIDATION +.PP The \fB\-validate\fR, \fB\-validatecommand\fR, and \fB\-invalidcommand\fR options are used to enable entry widget validation. .SS "VALIDATION MODES" +.PP There are two main validation modes: \fIprevalidation\fR, in which the \fB\-validatecommand\fR is evaluated prior to each edit and the return value is used to determine whether to accept @@ -305,6 +310,7 @@ regardless of the value returned by the \fB\-validatecommand\fR. If \fB\-validatecommand\fR is empty (the default), validation always succeeds. .SS "VALIDATION SCRIPT SUBSTITUTIONS" +.PP It is possible to perform percent substitutions on the \fB\-validatecommand\fR and \fBinvalidCommand\fR, just as in a \fBbind\fR script. @@ -344,6 +350,7 @@ modifying the entry value in a validation script). The standard entry widget invokes validation whenever the linked \fB\-textvariable\fR is modified; the Tk themed entry widget does not. .SH "DEFAULT BINDINGS" +.PP The entry widget's default bindings enable the following behavior. In the descriptions below, .QW word @@ -425,6 +432,7 @@ Control-d deletes the character to the right of the insert cursor. Control-k deletes all the characters to the right of the insertion cursor. .SH "WIDGET STATES" +.PP In the \fBdisabled\fR state, the entry cannot be edited and the text cannot be selected. In the \fBreadonly\fR state, diff --git a/doc/ttk_frame.n b/doc/ttk_frame.n index 370ebff..a352024 100644 --- a/doc/ttk_frame.n +++ b/doc/ttk_frame.n @@ -1,10 +1,11 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 2005 Joe English '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_frame.n,v 1.10 2008/05/09 18:35:00 patthoyts Exp $ +'\" RCS: @(#) $Id: ttk_frame.n,v 1.11 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH ttk::frame n 8.5 Tk "Tk Themed Widget" @@ -15,6 +16,7 @@ ttk::frame \- Simple container widget \fBttk::frame\fR \fIpathName \fR?\fIoptions\fR? .BE .SH DESCRIPTION +.PP A \fBttk::frame\fR widget is a container, used to group other widgets together. .SO ttk_widget @@ -36,10 +38,12 @@ If specified, the widget's requested width in pixels. .OP \-height height Height If specified, the widget's requested height in pixels. .SH "WIDGET COMMAND" +.PP Supports the standard widget commands \fBconfigure\fR, \fBcget\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR; see \fIttk::widget(n)\fR. .SH "NOTES" +.PP Note that if the \fBpack\fR, \fBgrid\fR, or other geometry managers are used to manage the children of the \fBframe\fR, by the GM's requested size will normally take precedence diff --git a/doc/ttk_image.n b/doc/ttk_image.n index 4d9a840..f930b59 100644 --- a/doc/ttk_image.n +++ b/doc/ttk_image.n @@ -1,10 +1,11 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 2004 Joe English '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_image.n,v 1.13 2008/04/09 09:28:05 patthoyts Exp $ +'\" RCS: @(#) $Id: ttk_image.n,v 1.14 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH ttk_image n 8.5 Tk "Tk Themed Widget" @@ -15,6 +16,7 @@ ttk_image \- Define an element based on an image \fBttk::style element create \fIname\fR \fBimage\fR \fIimageSpec\fR ?\fIoptions\fR? .BE .SH DESCRIPTION +.PP The \fIimage\fR element factory creates a new element in the current theme whose visual appearance is determined by Tk images. @@ -24,6 +26,7 @@ The rest of the list is a sequence of \fIstatespec / value\fR pairs specifying other images to use when the element is in a particular state or combination of states. .SH OPTIONS +.PP Valid \fIoptions\fR are: .TP \fB\-border\fR \fIpadding\fR @@ -52,6 +55,7 @@ or Specifies a minimum width for the element. If less than zero, the base image's width is used as a default. .SH "IMAGE STRETCHING" +.PP If the element's allocated parcel is larger than the image, the image will be placed in the parcel based on the \fB\-sticky\fR option. If the image needs to stretch horizontally (i.e., \fB\-sticky ew\fR) @@ -63,6 +67,7 @@ four fixed corners, top and left edges (which may be tiled horizontally), left and right edges (which may be tiled vertically), and the central area (which may be tiled in both directions). .SH "EXAMPLE" +.PP .CS set img1 [image create photo \-file button.png] set img2 [image create photo \-file button-pressed.png] diff --git a/doc/ttk_intro.n b/doc/ttk_intro.n index c85bc83..d3cebc9 100644 --- a/doc/ttk_intro.n +++ b/doc/ttk_intro.n @@ -1,10 +1,11 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 2004 Joe English '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_intro.n,v 1.10 2007/12/13 15:23:44 dgp Exp $ +'\" RCS: @(#) $Id: ttk_intro.n,v 1.11 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH ttk::intro n 8.5 Tk "Tk Themed Widget" @@ -13,6 +14,7 @@ ttk::intro \- Introduction to the Tk theme engine .BE .SH "OVERVIEW" +.PP The Tk themed widget set is based on a revised and enhanced version of TIP #48 (http://tip.tcl.tk/48) specified style engine. The main concepts are described below. @@ -23,6 +25,7 @@ Widget class bindings are primarily responsible for maintaining the widget state and invoking callbacks; all aspects of the widgets appearance is .SH "THEMES" +.PP A \fItheme\fR is a collection of elements and styles that determine the look and feel of the widget set. Themes can be used to: @@ -39,6 +42,7 @@ Blend in with the rest of the desktop (Gnome, KDE, Java) .IP \(bu And, of course: eye candy. .SH "ELEMENTS" +.PP An \fIelement\fR displays an individual part of a widget. For example, a vertical scrollbar widget contains \fBuparrow\fR, \fBdownarrow\fR, \fBtrough\fR and \fBslider\fR elements. @@ -68,6 +72,7 @@ The default setting specified by \fBstyle configure\fR; or .IP \(bu The element's built-in default value for the option. .SH "LAYOUTS" +.PP A \fIlayout\fR specifies which elements make up a widget and how they are arranged. The layout engine uses a simplified version of the \fBpack\fR @@ -90,6 +95,7 @@ By default, the layout for a widget is the same as its class name. Some widgets may override this (for example, the \fBttk::scrollbar\fR widget chooses different layouts based on the \fB\-orient\fR option). .SH "STATES" +.PP In standard Tk, many widgets have a \fB\-state\fR option which (in most cases) is either \fBnormal\fR or \fBdisabled\fR. Some widgets support additional states, such @@ -135,6 +141,7 @@ but not by much). .PP \fINote to self: rewrite that paragraph. It's horrible.\fR .SH "STYLES" +.PP Each widget is associated with a \fIstyle\fR, which specifies values for element options. Style names use a recursive dotted notation like layouts and elements; diff --git a/doc/ttk_label.n b/doc/ttk_label.n index 419d7e4..f7f4329 100644 --- a/doc/ttk_label.n +++ b/doc/ttk_label.n @@ -1,10 +1,11 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 2004 Joe English '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_label.n,v 1.10 2008/05/09 18:35:00 patthoyts Exp $ +'\" RCS: @(#) $Id: ttk_label.n,v 1.11 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH ttk::label n 8.5 Tk "Tk Themed Widget" @@ -15,6 +16,7 @@ ttk::label \- Display a text string and/or image \fBttk::label\fR \fIpathName \fR?\fIoptions\fR? .BE .SH DESCRIPTION +.PP A \fBttk::label\fR widget displays a textual label and/or image. The label may be linked to a Tcl variable to automatically change the displayed text. @@ -68,6 +70,7 @@ then automatic wrapping is not performed; otherwise the text is split into lines such that no line is longer than the specified value. .SH "WIDGET COMMAND" +.PP Supports the standard widget commands \fBconfigure\fR, \fBcget\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR; see \fIttk::widget(n)\fR. diff --git a/doc/ttk_labelframe.n b/doc/ttk_labelframe.n index 243878d..3f4238f 100644 --- a/doc/ttk_labelframe.n +++ b/doc/ttk_labelframe.n @@ -1,10 +1,11 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 2005 Joe English '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_labelframe.n,v 1.10 2008/05/09 18:35:00 patthoyts Exp $ +'\" RCS: @(#) $Id: ttk_labelframe.n,v 1.11 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH ttk::labelframe n 8.5 Tk "Tk Themed Widget" @@ -15,6 +16,7 @@ ttk::labelframe \- Container widget with optional label \fBttk::labelframe\fR \fIpathName \fR?\fIoptions\fR? .BE .SH DESCRIPTION +.PP A \fBttk::labelframe\fR widget is a container used to group other widgets together. It has an optional label, which may be a plain text string or another widget. @@ -64,6 +66,7 @@ If specified, the widget's requested height in pixels. (See \fIttk::frame(n)\fR for further notes on \fB\-width\fR and \fB\-height\fR). .SH "WIDGET COMMAND" +.PP Supports the standard widget commands \fBconfigure\fR, \fBcget\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR; see \fIttk::widget(n)\fR. diff --git a/doc/ttk_menubutton.n b/doc/ttk_menubutton.n index 7a45da4..d405373 100644 --- a/doc/ttk_menubutton.n +++ b/doc/ttk_menubutton.n @@ -1,10 +1,11 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 2004 Joe English '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_menubutton.n,v 1.10 2008/05/09 18:35:00 patthoyts Exp $ +'\" RCS: @(#) $Id: ttk_menubutton.n,v 1.11 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH ttk::menubutton n 8.5 Tk "Tk Themed Widget" @@ -15,6 +16,7 @@ ttk::menubutton \- Widget that pops down a menu when pressed \fBttk::menubutton\fR \fIpathName \fR?\fIoptions\fR? .BE .SH DESCRIPTION +.PP A \fBttk::menubutton\fR widget displays a textual label and/or image, and displays a menu when pressed. .SO ttk_widget @@ -38,6 +40,7 @@ menubutton. .\" .OP \-anchor anchor Anchor .\" .OP \-padding padding Pad .SH "WIDGET COMMAND" +.PP Menubutton widgets support the standard \fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR methods. No other widget methods are used. diff --git a/doc/ttk_notebook.n b/doc/ttk_notebook.n index c407509..44671cf 100644 --- a/doc/ttk_notebook.n +++ b/doc/ttk_notebook.n @@ -1,10 +1,11 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 2004 Joe English '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_notebook.n,v 1.13 2008/05/09 18:35:00 patthoyts Exp $ +'\" RCS: @(#) $Id: ttk_notebook.n,v 1.14 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH ttk::notebook n 8.5 Tk "Tk Themed Widget" @@ -20,6 +21,7 @@ ttk::notebook \- Multi-paned container widget .fi .BE .SH DESCRIPTION +.PP A \fBttk::notebook\fR widget manages a collection of windows and displays a single one at a time. Each slave window is associated with a \fItab\fR, @@ -49,6 +51,7 @@ specifies the desired width of the pane area (not including internal padding). Otherwise, the maximum width of all panes is used. .SH "TAB OPTIONS" +.PP The following options may be specified for individual notebook panes: .OP \-state state State Either \fBnormal\fR, \fBdisabled\fR or \fBhidden\fR. @@ -80,6 +83,7 @@ in the text string. The underlined character is used for mnemonic activation if \fBttk::notebook::enableTraversal\fR is called. .SH "TAB IDENTIFIERS" +.PP The \fItabid\fR argument to the following commands may take any of the following forms: .IP \(bu @@ -101,6 +105,7 @@ which returns the number of tabs (only valid for .QW "\fIpathname \fBindex\fR" ). .SH "WIDGET COMMAND" +.PP .TP \fIpathname \fBadd\fR \fIwindow\fR ?\fIoptions...\fR? Adds a new tab to the notebook. @@ -166,6 +171,7 @@ See \fBTAB OPTIONS\fR for the available options. \fIpathname \fBtabs\fR Returns the list of windows managed by the notebook. .SH "KEYBOARD TRAVERSAL" +.PP To enable keyboard traversal for a toplevel window containing a notebook widget \fI$nb\fR, call: .CS @@ -187,9 +193,11 @@ including nested notebooks. However, notebook traversal only works properly if all panes are direct children of the notebook. .SH "VIRTUAL EVENTS" +.PP The notebook widget generates a \fB<>\fR virtual event after a new tab is selected. .SH "EXAMPLE" +.PP .CS pack [\fBttk::notebook\fR .nb] \.nb add [frame .nb.f1] \-text "First tab" diff --git a/doc/ttk_panedwindow.n b/doc/ttk_panedwindow.n index 18685cc..eda82f0 100644 --- a/doc/ttk_panedwindow.n +++ b/doc/ttk_panedwindow.n @@ -1,10 +1,11 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 2005 Joe English '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_panedwindow.n,v 1.16 2008/05/09 18:35:00 patthoyts Exp $ +'\" RCS: @(#) $Id: ttk_panedwindow.n,v 1.17 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH ttk::panedwindow n 8.5 Tk "Tk Themed Widget" @@ -20,6 +21,7 @@ ttk::panedwindow \- Multi-pane container window .fi .BE .SH DESCRIPTION +.PP A \fBttk::panedwindow\fR widget displays a number of subwindows, stacked either vertically or horizontally. The user may adjust the relative sizes of the subwindows by dragging the sash between panes. @@ -43,12 +45,14 @@ specifies the desired height of the widget in pixels. Otherwise, the requested height is determined by the height of the managed windows. .SH "PANE OPTIONS" +.PP The following options may be specified for each pane: .OP \-weight weight Weight An integer specifying the relative stretchability of the pane. When the paned window is resized, the extra space is added or subtracted to each pane proportionally to its \fB\-weight\fR. .SH "WIDGET COMMAND" +.PP Supports the standard \fBconfigure\fR, \fBcget\fR, \fBstate\fR, and \fBinstate\fR commands; see \fIttk::widget(n)\fR for details. Additional commands: diff --git a/doc/ttk_progressbar.n b/doc/ttk_progressbar.n index a91e098..6d09fd5 100644 --- a/doc/ttk_progressbar.n +++ b/doc/ttk_progressbar.n @@ -1,10 +1,11 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 2005 Joe English '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_progressbar.n,v 1.11 2008/05/09 18:35:00 patthoyts Exp $ +'\" RCS: @(#) $Id: ttk_progressbar.n,v 1.12 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH ttk::progressbar n 8.5 Tk "Tk Themed Widget" @@ -15,6 +16,7 @@ ttk::progressbar \- Provide progress feedback \fBttk::progressbar\fR \fIpathName \fR?\fIoptions\fR? .BE .SH DESCRIPTION +.PP A \fBttk::progressbar\fR widget shows the status of a long-running operation. They can operate in two modes: \fIdeterminate\fR mode shows the amount completed relative to the total amount of work to be done, and @@ -56,6 +58,7 @@ in \fIdeterminate\fR mode, less than \fB\-maximum\fR. This option may be used by the current theme to provide additional animation effects. .SH "WIDGET COMMAND" +.PP .TP \fIpathName \fBcget\fR \fIoption\fR Returns the current value of the specified \fIoption\fR; see \fIttk::widget(n)\fR. diff --git a/doc/ttk_radiobutton.n b/doc/ttk_radiobutton.n index fe93e76..c1f31bb 100644 --- a/doc/ttk_radiobutton.n +++ b/doc/ttk_radiobutton.n @@ -1,10 +1,11 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 2004 Joe English '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_radiobutton.n,v 1.12 2008/05/09 18:35:00 patthoyts Exp $ +'\" RCS: @(#) $Id: ttk_radiobutton.n,v 1.13 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH ttk::radiobutton n 8.5 Tk "Tk Themed Widget" @@ -15,6 +16,7 @@ ttk::radiobutton \- Mutually exclusive option widget \fBttk::radiobutton\fR \fIpathName \fR?\fIoptions\fR? .BE .SH DESCRIPTION +.PP \fBttk::radiobutton\fR widgets are used in groups to show or change a set of mutually-exclusive options. Radiobuttons are linked to a Tcl variable, @@ -36,6 +38,7 @@ when the widget is selected. The name of a global variable whose value is linked to the widget. Default value is \fB::selectedButton\fR. .SH "WIDGET COMMAND" +.PP In addition to the standard \fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR commands, radiobuttons support the following additional @@ -49,6 +52,7 @@ string if no \fB\-command\fR is specified. .\" Missing: select, deselect. Useful? .\" Missing: flash. This is definitely not useful. .SH "WIDGET STATES" +.PP The widget does not respond to user input if the \fBdisabled\fR state is set. The widget sets the \fBselected\fR state whenever the linked \fB\-variable\fR is set to the widget's \fB\-value\fR, diff --git a/doc/ttk_scale.n b/doc/ttk_scale.n index c1a2b43..549e6de 100644 --- a/doc/ttk_scale.n +++ b/doc/ttk_scale.n @@ -4,7 +4,7 @@ .\" See the file "license.terms" for information on usage and redistribution .\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. .\" -.\" CVS: @(#) $Id: ttk_scale.n,v 1.2 2008/05/09 18:35:00 patthoyts Exp $ +.\" CVS: @(#) $Id: ttk_scale.n,v 1.3 2008/06/30 22:57:03 dkf Exp $ .\" .so man.macros .TH ttk::scale n 8.5 Tk "Tk Themed Widget" @@ -15,6 +15,7 @@ ttk::scale \- Create and manipulate a scale widget \fBttk::scale \fIpathName \fR?\fIoptions...\fR? .BE .SH DESCRIPTION +.PP A \fBttk::scale\fR widget is typically used to control the numeric value of a linked variable that varies uniformly over some range. A scale displays a \fIslider\fR that can be moved along over a \fItrough\fR, with the relative @@ -49,6 +50,7 @@ value of the variable changes, the scale will update to reflect this value. Whenever the scale is manipulated interactively, the variable will be modified to reflect the scale's new value. .SH "WIDGET COMMAND" +.PP .TP \fIpathName \fBcget \fIoption\fR . @@ -84,6 +86,7 @@ named in the \fB\-variable\fR option) does not cause such clipping. . Modify or query the widget state; see \fIttk::widget(n)\fR. .SH "INTERNAL COMMANDS" +.PP .TP \fIpathName \fBcoords \fR?\fIvalue\fR? . diff --git a/doc/ttk_scrollbar.n b/doc/ttk_scrollbar.n index 5fa55f9..6874780 100644 --- a/doc/ttk_scrollbar.n +++ b/doc/ttk_scrollbar.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. '\" Copyright (c) 2004 Joe English @@ -6,7 +7,7 @@ '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" '\" SOURCE: tk/doc/scrollbar.n, r1.4 -'\" RCS: @(#) $Id: ttk_scrollbar.n,v 1.13 2008/05/09 18:35:00 patthoyts Exp $ +'\" RCS: @(#) $Id: ttk_scrollbar.n,v 1.14 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH ttk::scrollbar n 8.5 Tk "Tk Themed Widget" @@ -17,6 +18,7 @@ ttk::scrollbar \- Control the viewport of a scrollable widget \fBttk::scrollbar\fR \fIpathName \fR?\fIoptions...\fR? .BE .SH DESCRIPTION +.PP \fBttk::scrollbar\fR widgets are typically linked to an associated window that displays a document of some sort, such as a file being edited or a drawing. @@ -48,6 +50,7 @@ or \fByview\fR (for vertical scrollbars). One of \fBhorizontal\fR or \fBvertical\fR. Specifies the orientation of the scrollbar. .SH "WIDGET COMMAND" +.PP .TP \fIpathName \fBcget\fR \fIoption\fR Returns the current value of the specified \fIoption\fR; see \fIttk::widget(n)\fR. @@ -75,6 +78,7 @@ Specifies the visible range to be displayed. \fIpathName \fBstate\fR ?\fIstateSpec\fR? Modify or query the widget state; see \fIttk::widget(n)\fR. .SH "INTERNAL COMMANDS" +.PP The following widget commands are used internally by the TScrollbar widget class bindings. .TP @@ -99,6 +103,7 @@ widget. If \fIx\fR and \fIy\fR refer to a point outside the trough, the closest point in the trough is used. .SH "SCROLLING COMMANDS" +.PP When the user interacts with the scrollbar, for example by dragging the thumb, the scrollbar notifies the associated widget that it must change its view. @@ -134,12 +139,14 @@ is a slight overlap between the old and new views. become visible, or \-1, which means that the previous page should become visible. .SH "WIDGET STATES" +.PP The scrollbar automatically sets the \fBdisabled\fR state bit. when the entire range is visible (range is 0.0 to 1.0), and clears it otherwise. It also sets the \fBactive\fR and \fBpressed\fR state flags of individual elements, based on the position and state of the mouse pointer. .SH EXAMPLE +.PP .CS set f [frame .f] ttk::scrollbar $f.hsb \-orient horizontal \-command [list $f.t xview] diff --git a/doc/ttk_separator.n b/doc/ttk_separator.n index ddfde59..7876577 100644 --- a/doc/ttk_separator.n +++ b/doc/ttk_separator.n @@ -1,10 +1,11 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 2004 Joe English '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_separator.n,v 1.9 2008/05/09 18:35:00 patthoyts Exp $ +'\" RCS: @(#) $Id: ttk_separator.n,v 1.10 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH ttk::separator n 8.5 Tk "Tk Themed Widget" @@ -15,6 +16,7 @@ ttk::separator \- Separator bar \fBttk::separator\fR \fIpathName \fR?\fIoptions\fR? .BE .SH DESCRIPTION +.PP A \fBttk::separator\fR widget displays a horizontal or vertical separator bar. .SO ttk_widget @@ -26,6 +28,7 @@ bar. One of \fBhorizontal\fR or \fBvertical\fR. Specifies the orientation of the separator. .SH "WIDGET COMMAND" +.PP Separator widgets support the standard \fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR methods. No other widget methods are used. diff --git a/doc/ttk_sizegrip.n b/doc/ttk_sizegrip.n index 308422a..c9f4fc9 100644 --- a/doc/ttk_sizegrip.n +++ b/doc/ttk_sizegrip.n @@ -1,10 +1,11 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 2006 Joe English '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_sizegrip.n,v 1.16 2008/05/09 18:35:00 patthoyts Exp $ +'\" RCS: @(#) $Id: ttk_sizegrip.n,v 1.17 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH ttk::sizegrip n 8.5 Tk "Tk Themed Widget" @@ -15,6 +16,7 @@ ttk::sizegrip \- Bottom-right corner resize widget \fBttk::sizegrip\fR \fIpathName \fR?\fIoptions\fR? .BE .SH DESCRIPTION +.PP A \fBttk::sizegrip\fR widget (also known as a \fIgrow box\fR) allows the user to resize the containing toplevel window by pressing and dragging the grip. @@ -23,10 +25,12 @@ by pressing and dragging the grip. \-style \-takefocus .SE .SH "WIDGET COMMAND" +.PP Sizegrip widgets support the standard \fBcget\fR, \fBconfigure\fR, \fBidentify\fR, \fBinstate\fR, and \fBstate\fR methods. No other widget methods are used. .SH "PLATFORM-SPECIFIC NOTES" +.PP On Mac OSX, toplevel windows automatically include a built-in size grip by default. Adding a \fBttk::sizegrip\fR there is harmless, since @@ -47,6 +51,7 @@ grid [\fBttk::sizegrip\fR $top.statusbar.grip] \e # ... optional: add horizontal scrollbar in $lastRow .CE .SH "BUGS" +.PP If the containing toplevel's position was specified relative to the right or bottom of the screen (e.g., diff --git a/doc/ttk_style.n b/doc/ttk_style.n index 77d1385..158fd1a 100644 --- a/doc/ttk_style.n +++ b/doc/ttk_style.n @@ -1,10 +1,11 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 2004 Joe English '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_style.n,v 1.15 2008/05/27 20:47:16 patthoyts Exp $ +'\" RCS: @(#) $Id: ttk_style.n,v 1.16 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH ttk::style n 8.5 Tk "Tk Themed Widget" @@ -15,9 +16,11 @@ ttk::style \- Manipulate style database \fBttk::style\fR \fIoption\fR ?\fIargs\fR? .BE .SH NOTES +.PP See also the Tcl'2004 conference presentation, available at http://tktable.sourceforge.net/tile/tile-tcl2004.pdf .SH DEFINITIONS +.PP Each widget is assigned a \fIstyle\fR, which specifies the set of elements making up the widget and how they are arranged, along with dynamic and default @@ -28,6 +31,7 @@ this may be overridden by the \fB\-style\fR option. A \fItheme\fR is a collection of elements and styles which controls the overall look and feel of an application. .SH DESCRIPTION +.PP The \fBttk::style\fR command takes the following arguments: .TP \fBttk::style configure \fIstyle\fR ?\fI\-option\fR ?\fIvalue option value...\fR? ? @@ -91,6 +95,7 @@ Without an argument the result is the name of the current theme. Otherwise this command sets the current theme to \fIthemeName\fR, and refreshes all widgets. .SH LAYOUTS +.PP A \fIlayout\fR specifies a list of elements, each followed by one or more options specifying how to arrange the element. The layout mechanism uses a simplified version of the \fBpack\fR diff --git a/doc/ttk_treeview.n b/doc/ttk_treeview.n index e2ecc4c..5053ff0 100644 --- a/doc/ttk_treeview.n +++ b/doc/ttk_treeview.n @@ -1,10 +1,11 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 2004 Joe English '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_treeview.n,v 1.18 2008/05/23 20:20:05 jenglish Exp $ +'\" RCS: @(#) $Id: ttk_treeview.n,v 1.19 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH ttk::treeview n 8.5 Tk "Tk Themed Widget" @@ -15,6 +16,7 @@ ttk::treeview \- hierarchical multicolumn data display widget \fBttk::treeview\fR \fIpathname \fR?\fIoptions\fR? .BE .SH DESCRIPTION +.PP The \fBttk::treeview\fR widget displays a hierarchical collection of items. Each item has a textual label, an optional image, and an optional list of data values. @@ -95,6 +97,7 @@ The default is \fBtree headings\fR, i.e., show all elements. even if \fB\-show tree\fR is not specified. .RE .SH "WIDGET COMMAND" +.PP .TP \fIpathname \fBbbox\fR \fIitem\fR ?\fIcolumn\fR? Returns the bounding box (relative to the treeview widget's window) @@ -383,6 +386,7 @@ Standard command for horizontal scrolling; see \fIwidget(n)\fR. \fIpathName \fByview \fIargs\fR Standard command for vertical scrolling; see \fIttk::widget(n)\fR. .SH "ITEM OPTIONS" +.PP The following item options may be specified for items in the \fBinsert\fR and \fBitem\fR widget commands. .OP \-text text Text @@ -406,6 +410,7 @@ should be displayed (\fB\-open true\fR) or hidden (\fB\-open false\fR). .OP \-tags tags Tags A list of tags associated with this item. .SH "TAG OPTIONS" +.PP The following options may be specified on tags: .IP \fB\-foreground\fR Specifies the text foreground color. @@ -421,6 +426,7 @@ Specifies the item image, in case the item's \fB\-image\fR option is empty. .PP \fI(@@@ TODO: sort out order of precedence for options)\fR .SH "COLUMN IDENTIFIERS" +.PP Column identifiers take any of the following forms: .IP \(bu A symbolic name from the list of \fB\-columns\fR. @@ -445,6 +451,7 @@ If \fB\-displaycolumns\fR is not set, then data column \fIn\fR is displayed in display column \fB#\fIn+1\fR. Again, \fBcolumn #0 always refers to the tree column\fR. .SH "VIRTUAL EVENTS" +.PP The treeview widget generates the following virtual events. .IP <> Generated whenever the selection changes. diff --git a/doc/ttk_vsapi.n b/doc/ttk_vsapi.n index e03f7f8..75771c5 100644 --- a/doc/ttk_vsapi.n +++ b/doc/ttk_vsapi.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_vsapi.n,v 1.2 2008/04/09 09:28:05 patthoyts Exp $ +'\" RCS: @(#) $Id: ttk_vsapi.n,v 1.3 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH ttk_vsapi n 8.5 Tk "Tk Themed Widget" @@ -15,6 +15,7 @@ ttk_vsapi \- Define a Microsoft Visual Styles element \fBttk::style element create \fIname\fR \fBvsapi\fR \fIclassName\fR \fIpartId\fR ?\fIstateMap\fR? ?\fIoptions\fR? .BE .SH DESCRIPTION +.PP The \fIvsapi\fR element factory creates a new element in the current theme whose visual appearance is drawn using the Microsoft Visual Styles API which is reponsible for the themed styles @@ -27,6 +28,7 @@ the Visual Styles class and part as given in the Microsoft documentation. The \fIstateMap\fR may be provided to map ttk states to Visual Styles API states (see \fBSTATE MAP\fR). .SH "OPTIONS" +.PP Valid \fIoptions\fR are: .TP \fB\-padding\fR \fIpadding\fR @@ -51,6 +53,7 @@ be mixed with the \fI-padding\fR or \fI-margins\fR options. \fB\-height\fR \fIheight\fR Specifies the height of the element. See the comments for \fI-width\fR. .SH "STATE MAP" +.PP The \fIstateMap\fR parameter is a list of ttk states and the corresponding Visual Styles API state value. This permits the element appearence to respond to changes in the @@ -66,6 +69,7 @@ versions of the Windows Development Kit this is \fIvssym32.h\fR. If no \fIstateMap\fR parameter is given there is an implicit default map of {{} 1} .SH "EXAMPLE" +.PP Create a correctly themed close button by changing the layout of a \fBttk::button\fR(n). This uses the WINDOW part WP_SMALLCLOSEBUTTON and as documented the states CBS_DISABLED, CBS_HOT, CBS_NORMAL and diff --git a/doc/ttk_widget.n b/doc/ttk_widget.n index 897cfbd..545f3b8 100644 --- a/doc/ttk_widget.n +++ b/doc/ttk_widget.n @@ -1,10 +1,11 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 2004 Joe English '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_widget.n,v 1.14 2008/05/09 18:35:00 patthoyts Exp $ +'\" RCS: @(#) $Id: ttk_widget.n,v 1.15 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH ttk::widget n 8.5 Tk "Tk Themed Widget" @@ -13,6 +14,7 @@ ttk::widget \- Standard options and commands supported by Tk themed widgets .BE .SH DESCRIPTION +.PP This manual describes common widget options and commands. .SH "STANDARD OPTIONS" The following options are supported by all Tk themed widgets: @@ -40,6 +42,7 @@ See \fIoptions(n)\fR in the Tk reference manual for the full description. .OP \-style style Style May be used to specify a custom widget style. .SH "SCROLLABLE WIDGET OPTIONS" +.PP The following options are supported by widgets that are controllable by a scrollbar. See \fIscrollbar(n)\fR for more information @@ -71,6 +74,7 @@ then no command will be executed. A command prefix, used to communicate with vertical scrollbars. See the description of \fB\-xscrollcommand\fR above for details. .SH "LABEL OPTIONS" +.PP The following options are supported by labels, buttons, and other button-like widgets: .OP \-text text Text @@ -123,8 +127,8 @@ This is a write-only option: setting it changes the widget state, but the \fBstate\fR widget command does not affect the \fB\-state\fR option. - .SH COMMANDS +.PP .TP \fIpathName \fBcget\fR \fIoption\fR Returns the current value of the configuration option given @@ -176,6 +180,7 @@ If \fIstateSpec\fR is not specified, returns a list of the currently-enabled state flags. .RE .SH "WIDGET STATES" +.PP The widget state is a bitmap of independent state flags. Widget state flags include: .TP @@ -235,6 +240,7 @@ A \fIstate specification\fR or \fIstateSpec\fR is a list of state names, optionally prefixed with an exclamation point (!) indicating that the bit is off. .SH EXAMPLES +.PP .CS set b [ttk::button .b] diff --git a/doc/winfo.n b/doc/winfo.n index 5eadbf3..41192df 100644 --- a/doc/winfo.n +++ b/doc/winfo.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1990-1994 The Regents of the University of California. '\" Copyright (c) 1994-1997 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: winfo.n,v 1.12 2007/12/13 15:23:44 dgp Exp $ +'\" RCS: @(#) $Id: winfo.n,v 1.13 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH winfo n 4.3 Tk "Tk Built-In Commands" @@ -16,7 +17,6 @@ winfo \- Return window-related information .SH SYNOPSIS \fBwinfo\fR \fIoption \fR?\fIarg arg ...\fR? .BE - .SH DESCRIPTION .PP The \fBwinfo\fR command is used to retrieve information about windows @@ -337,6 +337,7 @@ parent, of the upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it has no border). .SH EXAMPLE +.PP Print where the mouse pointer is and what window it is currently over: .CS lassign [\fBwinfo pointerxy\fR .] x y @@ -348,7 +349,6 @@ if {$win eq ""} { puts "over $win" } .CE - .SH KEYWORDS atom, children, class, geometry, height, identifier, information, interpreters, mapped, parent, path name, screen, virtual root, width, window diff --git a/doc/wish.1 b/doc/wish.1 index 1a3ac8b..96973a8 100644 --- a/doc/wish.1 +++ b/doc/wish.1 @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: wish.1,v 1.10 2007/12/13 15:23:44 dgp Exp $ +'\" RCS: @(#) $Id: wish.1,v 1.11 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH wish 1 8.0 Tk "Tk Applications" @@ -17,10 +17,8 @@ wish \- Simple windowing shell \fBwish\fR ?\fB\-encoding \fIname\fR? ?\fIfileName arg arg ...\fR? .SH OPTIONS .IP "\fB\-encoding \fIname\fR" 20 -.VS 8.5 Specifies the encoding of the text stored in \fIfileName\fR. This option is only recognized prior to the \fIfileName\fR argument. -.VE 8.5 .IP "\fB\-colormap \fInew\fR" 20 Specifies that the window should have a new private colormap instead of using the default colormap for the screen. diff --git a/doc/wm.n b/doc/wm.n index f5ed460..61f4074 100644 --- a/doc/wm.n +++ b/doc/wm.n @@ -1,3 +1,4 @@ +'\" -*- nroff -*- '\" '\" Copyright (c) 1991-1994 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -5,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: wm.n,v 1.38 2007/12/13 15:23:44 dgp Exp $ +'\" RCS: @(#) $Id: wm.n,v 1.39 2008/06/30 22:57:03 dkf Exp $ '\" .so man.macros .TH wm n 8.5 Tk "Tk Built-In Commands" @@ -29,6 +30,7 @@ top-level window. The legal forms for the \fBwm\fR command are: .TP \fBwm aspect \fIwindow\fR ?\fIminNumer minDenom maxNumer maxDenom\fR? +. If \fIminNumer\fR, \fIminDenom\fR, \fImaxNumer\fR, and \fImaxDenom\fR are all specified, then they will be passed to the window manager and the window manager should use them to enforce a range of @@ -49,6 +51,7 @@ returned). \fBwm attributes \fIwindow\fR ?\fBoption\fR? .TP \fBwm attributes \fIwindow\fR ?\fBoption value option value...\fR? +. This subcommand returns or sets platform specific attributes associated with a window. The first form returns a list of the platform specific flags and their values. The second form returns the value for the @@ -60,81 +63,88 @@ All platforms support the following attributes (though X11 users should see the notes below): .TP \fB\-fullscreen\fR +. Places the window in a mode that takes up the entire screen, has no borders, and covers the general use area (i.e. Start menu and taskbar on Windows, dock and menubar on OSX, general window decorations on X11). .TP \fB\-topmost\fR +. Specifies whether this is a topmost window (displays above all other windows). .PP On Windows, the following attributes may be set. .TP \fB\-alpha\fR -.VS 8.5 +. Specifies the alpha transparency level of the toplevel. It accepts a value from \fB0.0\fR (fully transparent) to \fB1.0\fR (opaque). Values outside that range will be constrained. This is supported on Windows 2000/XP+. Where not supported, the \fB\-alpha\fR value remains at \fB1.0\fR. -.VE 8.5 .TP \fB\-disabled\fR +. Specifies whether the window is in a disabled state. .TP \fB\-toolwindow\fR +. Specifies a toolwindow style window (as defined in the MSDN). .TP \fB\-transparentcolor\fR -.VS 8.5 +. Specifies the transparent color index of the toplevel. It takes any color value accepted by \fBTk_GetColor\fR. If the empty string is specified (default), no transparent color is used. This is supported on Windows 2000/XP+. Where not supported, the \fB\-transparentcolor\fR value remains at \fB{}\fR. -.VE 8.5 .PP On Mac OS X, the following attributes may be set. .TP \fB\-alpha\fR +. Specifies the alpha transparency level of the window. It accepts a value from \fB0.0\fR (fully transparent) to \fB1.0\fR (opaque), values outside that range will be constrained. .TP \fB\-modified\fR +. Specifies the modification state of the window (determines whether the window close widget contains the modification indicator and whether the proxy icon is draggable). .TP \fB\-notify\fR +. Specifies process notification state (bouncing of the application dock icon). .TP \fB\-titlepath\fR +. Specifies the path of the file referenced as the window proxy icon (which can be dragged and dropped in lieu of the file's finder icon). .TP \fB\-transparent\fR +. Makes the window content area transparent and turns off the window shadow. For the transparency to be effecive, the toplevel background needs to be set to a color with some alpha, e.g. .QW systemTransparent . .PP -On X11, the following attributes may be set. -These are not supported by all window managers, -and will have no effect under older WMs. +On X11, the following attributes may be set. These are not supported by all +window managers, and will have no effect under older WMs. .\" See http://www.freedesktop.org/Standards/wm-spec .TP \fB\-zoomed\fR -Requests that the window should be maximized. -This is the same as \fBwm state zoomed\fR on Windows and Mac OS X. +. +Requests that the window should be maximized. This is the same as \fBwm state +zoomed\fR on Windows and Mac OS X. .PP -On X11, changes to window attributes are performed asynchronously. -Querying the value of an attribute returns the current state, -which will not be the same as the value most recently set -if the window manager has not yet processed the request -or if it does not support the attribute. +On X11, changes to window attributes are performed asynchronously. Querying +the value of an attribute returns the current state, which will not be the +same as the value most recently set if the window manager has not yet +processed the request or if it does not support the attribute. .RE .TP \fBwm client \fIwindow\fR ?\fIname\fR? +. If \fIname\fR is specified, this command stores \fIname\fR (which should be the name of the host on which the application is executing) in \fIwindow\fR's @@ -147,6 +157,7 @@ If \fIname\fR is specified as an empty string, the command deletes the \fBWM_CLIENT_MACHINE\fR property from \fIwindow\fR. .TP \fBwm colormapwindows \fIwindow\fR ?\fIwindowList\fR? +. This command is used to manipulate the \fBWM_COLORMAP_WINDOWS\fR property, which provides information to the window managers about windows that have private colormaps. @@ -177,6 +188,7 @@ See the ICCCM documentation for more information on the .RE .TP \fBwm command \fIwindow\fR ?\fIvalue\fR? +. If \fIvalue\fR is specified, this command stores \fIvalue\fR in \fIwindow\fR's \fBWM_COMMAND\fR property for use by the window manager or session manager and returns an empty string. @@ -188,6 +200,7 @@ If \fIvalue\fR is specified as an empty string, the command deletes the \fBWM_COMMAND\fR property from \fIwindow\fR. .TP \fBwm deiconify \fIwindow\fR +. Arrange for \fIwindow\fR to be displayed in normal (non-iconified) form. This is done by mapping the window. If the window has never been mapped then this command will not map the window, but it will ensure @@ -197,6 +210,7 @@ raised and be given the focus (made the active window). Returns an empty string. .TP \fBwm focusmodel \fIwindow\fR ?\fBactive\fR|\fBpassive\fR? +. If \fBactive\fR or \fBpassive\fR is supplied as an optional argument to the command, then it specifies the focus model for \fIwindow\fR. In this case the command returns an empty string. If no additional @@ -216,6 +230,7 @@ assumes a passive model of focusing. .RE .TP \fBwm forget \fIwindow\fR +. The \fIwindow\fR will be unmapped from the screen and will no longer be managed by \fBwm\fR. Windows created with the \fBtoplevel\fR command will be treated like \fBframe\fR windows once they are no @@ -223,6 +238,7 @@ longer managed by \fBwm\fR, however, the \fB\-menu\fR configuration will be remembered and the menus will return once the widget is managed again. .TP \fBwm frame \fIwindow\fR +. If \fIwindow\fR has been reparented by the window manager into a decorative frame, the command returns the platform specific window identifier for the outermost frame that contains \fIwindow\fR (the @@ -231,6 +247,7 @@ has not been reparented by the window manager then the command returns the platform specific window identifier for \fIwindow\fR. .TP \fBwm geometry \fIwindow\fR ?\fInewGeometry\fR? +. If \fInewGeometry\fR is specified, then the geometry of \fIwindow\fR is changed and an empty string is returned. Otherwise the current geometry for \fIwindow\fR is returned (this is the most recent @@ -265,6 +282,7 @@ widgets. .RE .TP \fBwm grid \fIwindow\fR ?\fIbaseWidth baseHeight widthInc heightInc\fR? +. This command indicates that \fIwindow\fR is to be managed as a gridded window. It also specifies the relationship between grid units and pixel units. @@ -300,6 +318,7 @@ provide easier access to the same functionality. .RE .TP \fBwm group \fIwindow\fR ?\fIpathName\fR? +. If \fIpathName\fR is specified, it gives the path name for the leader of a group of related windows. The window manager may use this information, for example, to unmap all of the windows in a group when the group's @@ -310,6 +329,7 @@ returns the path name of \fIwindow\fR's current group leader, or an empty string if \fIwindow\fR is not part of any group. .TP \fBwm iconbitmap \fIwindow\fR ?\fIbitmap\fR? +. If \fIbitmap\fR is specified, then it names a bitmap in the standard forms accepted by Tk (see the \fBTk_GetBitmap\fR manual entry for details). This bitmap is passed to the window manager to be displayed in @@ -320,10 +340,11 @@ If \fIbitmap\fR is specified then the command returns an empty string. Otherwise it returns the name of the current icon bitmap associated with \fIwindow\fR, or an empty string if \fIwindow\fR has no icon bitmap. On the Windows operating -system, an additional flag is supported: +system, an additional flag is supported: .RS .TP \fBwm iconbitmap \fIwindow\fR ?\fB\-default\fR? ?\fIimage\fR? +. If the \fB\-default\fR flag is given, the icon is applied to all toplevel windows (existing and future) to which no other specific icon has yet been applied. @@ -337,11 +358,13 @@ a bitmap. .RE .TP \fBwm iconify \fIwindow\fR +. Arrange for \fIwindow\fR to be iconified. It \fIwindow\fR has not yet been mapped for the first time, this command will arrange for it to appear in the iconified state when it is eventually mapped. .TP \fBwm iconmask \fIwindow\fR ?\fIbitmap\fR? +. If \fIbitmap\fR is specified, then it names a bitmap in the standard forms accepted by Tk (see the \fBTk_GetBitmap\fR manual entry for details). This bitmap is passed to the window manager to be used as a mask @@ -356,6 +379,7 @@ returns the name of the current icon mask associated with \fIwindow\fR, or an empty string if no mask is in effect. .TP \fBwm iconname \fIwindow\fR ?\fInewName\fR? +. If \fInewName\fR is specified, then it is passed to the window manager; the window manager should display \fInewName\fR inside the icon associated with \fIwindow\fR. In this case an empty @@ -364,9 +388,9 @@ then the command returns the current icon name for \fIwindow\fR, or an empty string if no icon name has been specified (in this case the window manager will normally display the window's title, as specified with the \fBwm title\fR command). -.VS 8.5 .TP \fBwm iconphoto \fIwindow\fR ?\fB\-default\fR? \fIimage1\fR ?\fIimage2 ...\fR? +. Sets the titlebar icon for \fIwindow\fR based on the named photo images. If \fB\-default\fR is specified, this is applied to all future created toplevels as well. The data in the images is taken as a snapshot at the @@ -386,10 +410,10 @@ simultaneously. It is recommended to use not more than 2 icons, placing the larger icon first. .PP On Macintosh, this currently does nothing. -.VE 8.5 .RE .TP \fBwm iconposition \fIwindow\fR ?\fIx y\fR? +. If \fIx\fR and \fIy\fR are specified, they are passed to the window manager as a hint about where to position the icon for \fIwindow\fR. In this case an empty string is returned. If \fIx\fR and \fIy\fR are @@ -399,6 +423,7 @@ a Tcl list containing two values, which are the current icon position hints (if no hints are in effect then an empty string is returned). .TP \fBwm iconwindow \fIwindow\fR ?\fIpathName\fR? +. If \fIpathName\fR is specified, it is the path name for a window to use as icon for \fIwindow\fR: when \fIwindow\fR is iconified then \fIpathName\fR will be mapped to serve as icon, and when \fIwindow\fR @@ -416,10 +441,12 @@ those events. Note: not all window managers support the notion of an icon window. .TP \fBwm manage \fIwidget\fR +. The \fIwidget\fR specified will become a stand alone top-level window. The window will be decorated with the window managers title bar, etc. .TP \fBwm maxsize \fIwindow\fR ?\fIwidth height\fR? +. If \fIwidth\fR and \fIheight\fR are specified, they give the maximum permissible dimensions for \fIwindow\fR. For gridded windows the dimensions are specified in @@ -434,6 +461,7 @@ The maximum size defaults to the size of the screen. See the sections on geometry management below for more information. .TP \fBwm minsize \fIwindow\fR ?\fIwidth height\fR? +. If \fIwidth\fR and \fIheight\fR are specified, they give the minimum permissible dimensions for \fIwindow\fR. For gridded windows the dimensions are specified in @@ -448,6 +476,7 @@ The minimum size defaults to one pixel in each dimension. See the sections on geometry management below for more information. .TP \fBwm overrideredirect \fIwindow\fR ?\fIboolean\fR? +. If \fIboolean\fR is specified, it must have a proper boolean form and the override-redirect flag for \fIwindow\fR is set to that value. If \fIboolean\fR is not specified then \fB1\fR or \fB0\fR is @@ -460,6 +489,7 @@ decorative frame and the user will not be able to manipulate the window using the normal window manager mechanisms. .TP \fBwm positionfrom \fIwindow\fR ?\fIwho\fR? +. If \fIwho\fR is specified, it must be either \fBprogram\fR or \fBuser\fR, or an abbreviation of one of these two. It indicates whether \fIwindow\fR's current position was requested by the @@ -480,6 +510,7 @@ when a \fBwm geometry\fR command is invoked, unless the source has been set explicitly to \fBprogram\fR. .TP \fBwm protocol \fIwindow\fR ?\fIname\fR? ?\fIcommand\fR? +. This command is used to manage window manager protocols such as \fBWM_DELETE_WINDOW\fR. \fIName\fR is the name of an atom corresponding to a window manager @@ -513,6 +544,7 @@ which it was received. .RE .TP \fBwm resizable \fIwindow\fR ?\fIwidth height\fR? +. This command controls whether or not the user may interactively resize a top-level window. If \fIwidth\fR and \fIheight\fR are specified, they are boolean values that determine whether the @@ -528,6 +560,7 @@ command. If there has been no such operation then the window's natural size will be used. .TP \fBwm sizefrom \fIwindow\fR ?\fIwho\fR? +. If \fIwho\fR is specified, it must be either \fBprogram\fR or \fBuser\fR, or an abbreviation of one of these two. It indicates whether \fIwindow\fR's current size was requested by the @@ -545,6 +578,7 @@ no source has been specified yet. Most window managers interpret as equivalent to \fBprogram\fR. .TP \fBwm stackorder \fIwindow\fR ?\fBisabove\fR|\fBisbelow \fIwindow\fR? +. The \fBstackorder\fR command returns a list of toplevel windows in stacking order, from lowest to highest. When a single toplevel window is passed, the returned list recursively includes all of the @@ -558,6 +592,7 @@ or not the first window is currently above or below the second window in the stacking order. .TP \fBwm state \fIwindow\fR ?newstate? +. If \fInewstate\fR is specified, the window will be set to the new state, otherwise it returns the current state of \fIwindow\fR: either \fBnormal\fR, \fBiconic\fR, \fBwithdrawn\fR, \fBicon\fR, or (Windows and Mac @@ -569,6 +604,7 @@ purpose is to serve as the icon for some other window (via the \fBwm iconwindow\fR command). The \fBicon\fR state cannot be set. .TP \fBwm title \fIwindow\fR ?\fIstring\fR? +. If \fIstring\fR is specified, then it will be passed to the window manager for use as the title for \fIwindow\fR (the window manager should display this string in \fIwindow\fR's title bar). In this @@ -577,6 +613,7 @@ specified then the command returns the current title for the \fIwindow\fR. The title for a window defaults to its name. .TP \fBwm transient \fIwindow\fR ?\fImaster\fR? +. If \fImaster\fR is specified, then the window manager is informed that \fIwindow\fR is a transient window (e.g. pull-down menu) working on behalf of \fImaster\fR (where \fImaster\fR is the @@ -590,6 +627,7 @@ inherit the state of the master when initially mapped. It is an error to attempt to make a window a transient of itself. .TP \fBwm withdraw \fIwindow\fR +. Arranges for \fIwindow\fR to be withdrawn from the screen. This causes the window to be unmapped and forgotten about by the window manager. If the window @@ -682,6 +720,7 @@ operation of the \fBwm\fR command. For example, some changes will not take effect if the window is already active: the window will have to be withdrawn and de-iconified in order to make the change happen. .SH EXAMPLES +.PP A fixed-size window that says that it is fixed-size too: .CS toplevel .fixed -- cgit v0.12 From 2ae7f2cdd395b7ff0ad3bfa144c8d71cc9fbc346 Mon Sep 17 00:00:00 2001 From: dkf Date: Wed, 2 Jul 2008 09:44:49 +0000 Subject: Ensure that errors in callback scripts don't get swept under the carpet. --- ChangeLog | 5 + macosx/tkMacOSXHLEvents.c | 437 ++++++++++++++++++++++++---------------------- 2 files changed, 234 insertions(+), 208 deletions(-) diff --git a/ChangeLog b/ChangeLog index afe1096..6f59eda 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-07-02 Donal K. Fellows + + * macosx/tkMacOSXHLEvents.c: Some tidying up of this file. Make sure + that failing handling callbacks get reported as background errors. + 2008-06-30 Donal K. Fellows * doc/*.1, doc/*.3, doc/*.n: Remove out of date changebars, make diff --git a/macosx/tkMacOSXHLEvents.c b/macosx/tkMacOSXHLEvents.c index f56165d..fb2a111 100644 --- a/macosx/tkMacOSXHLEvents.c +++ b/macosx/tkMacOSXHLEvents.c @@ -1,63 +1,62 @@ /* * tkMacOSXHLEvents.c -- * - * Implements high level event support for the Macintosh. Currently, - * the only event that really does anything is the Quit event. + * Implements high level event support for the Macintosh. Currently, the + * only event that really does anything is the Quit event. * * Copyright (c) 1995-1997 Sun Microsystems, Inc. * Copyright 2001, Apple Computer, Inc. * Copyright (c) 2006 Daniel A. Steffen * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * See the file "license.terms" for information on usage and redistribution of + * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXHLEvents.c,v 1.15 2007/12/13 15:27:09 dgp Exp $ + * RCS: @(#) $Id: tkMacOSXHLEvents.c,v 1.16 2008/07/02 09:44:49 dkf Exp $ */ #include "tkMacOSXPrivate.h" /* - * This is a Tcl_Event structure that the Quit AppleEvent handler - * uses to schedule the ReallyKillMe function. + * This is a Tcl_Event structure that the Quit AppleEvent handler uses to + * schedule the ReallyKillMe function. */ typedef struct KillEvent { - Tcl_Event header; /* Information that is standard for - * all events. */ - Tcl_Interp *interp; /* Interp that was passed to the - * Quit AppleEvent */ + Tcl_Event header; /* Information that is standard for all + * events. */ + Tcl_Interp *interp; /* Interp that was passed to the Quit + * AppleEvent */ } KillEvent; /* * Static functions used only in this file. */ -static OSErr QuitHandler(const AppleEvent * event, AppleEvent * reply, - long handlerRefcon); -static OSErr OappHandler(const AppleEvent * event, AppleEvent * reply, - long handlerRefcon); -static OSErr RappHandler(const AppleEvent * event, AppleEvent * reply, - long handlerRefcon); -static OSErr OdocHandler(const AppleEvent * event, AppleEvent * reply, - long handlerRefcon); -static OSErr PrintHandler(const AppleEvent * event, AppleEvent * reply, - long handlerRefcon); -static OSErr ScriptHandler(const AppleEvent * event, AppleEvent * reply, - long handlerRefcon); -static OSErr PrefsHandler(const AppleEvent * event, AppleEvent * reply, - long handlerRefcon); - -static int MissedAnyParameters(const AppleEvent *theEvent); -static int ReallyKillMe(Tcl_Event *eventPtr, int flags); -static OSStatus FSRefToDString(const FSRef *fsref, Tcl_DString *ds); +static OSErr QuitHandler(const AppleEvent *event, + AppleEvent *reply, long handlerRefcon); +static OSErr OappHandler(const AppleEvent *event, + AppleEvent *reply, long handlerRefcon); +static OSErr RappHandler(const AppleEvent *event, + AppleEvent *reply, long handlerRefcon); +static OSErr OdocHandler(const AppleEvent *event, + AppleEvent *reply, long handlerRefcon); +static OSErr PrintHandler(const AppleEvent *event, + AppleEvent *reply, long handlerRefcon); +static OSErr ScriptHandler(const AppleEvent *event, + AppleEvent *reply, long handlerRefcon); +static OSErr PrefsHandler(const AppleEvent *event, + AppleEvent *reply, long handlerRefcon); +static int MissedAnyParameters(const AppleEvent *theEvent); +static int ReallyKillMe(Tcl_Event *eventPtr, int flags); +static OSStatus FSRefToDString(const FSRef *fsref, Tcl_DString *ds); /* *---------------------------------------------------------------------- * * TkMacOSXInitAppleEvents -- * - * Initilize the Apple Events on the Macintosh. This registers the - * core event handlers. + * Initilize the Apple Events on the Macintosh. This registers the core + * event handlers. * * Results: * None. @@ -70,10 +69,11 @@ static OSStatus FSRefToDString(const FSRef *fsref, Tcl_DString *ds); void TkMacOSXInitAppleEvents( - Tcl_Interp *interp) /* Interp to handle basic events. */ + Tcl_Interp *interp) /* Interp to handle basic events. */ { - AEEventHandlerUPP OappHandlerUPP, RappHandlerUPP, OdocHandlerUPP, - PrintHandlerUPP, QuitHandlerUPP, ScriptHandlerUPP, PrefsHandlerUPP; + AEEventHandlerUPP OappHandlerUPP, RappHandlerUPP, OdocHandlerUPP; + AEEventHandlerUPP PrintHandlerUPP, QuitHandlerUPP, ScriptHandlerUPP; + AEEventHandlerUPP PrefsHandlerUPP; static Boolean initialized = FALSE; if (!initialized) { @@ -82,6 +82,7 @@ TkMacOSXInitAppleEvents( /* * Install event handlers for the core apple events. */ + QuitHandlerUPP = NewAEEventHandlerUPP(QuitHandler); ChkErr(AEInstallEventHandler, kCoreEventClass, kAEQuitApplication, QuitHandlerUPP, (long) interp, false); @@ -109,7 +110,7 @@ TkMacOSXInitAppleEvents( if (interp) { ScriptHandlerUPP = NewAEEventHandlerUPP(ScriptHandler); ChkErr(AEInstallEventHandler, kAEMiscStandards, kAEDoScript, - ScriptHandlerUPP, (long) interp, false); + ScriptHandlerUPP, (long) interp, false); } } } @@ -153,10 +154,10 @@ TkMacOSXDoHLEvent( *---------------------------------------------------------------------- */ -OSErr +static OSErr QuitHandler( - const AppleEvent * event, - AppleEvent * reply, + const AppleEvent *event, + AppleEvent *reply, long handlerRefcon) { Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon; @@ -164,10 +165,11 @@ QuitHandler( if (interp) { /* - * Call the exit command from the event loop, since you are not supposed - * to call ExitToShell in an Apple Event Handler. We put this at the head - * of Tcl's event queue because this message usually comes when the Mac is - * shutting down, and we want to kill the shell as quickly as possible. + * Call the exit command from the event loop, since you are not + * supposed to call ExitToShell in an Apple Event Handler. We put this + * at the head of Tcl's event queue because this message usually comes + * when the Mac is shutting down, and we want to kill the shell as + * quickly as possible. */ eventPtr = (KillEvent *) ckalloc(sizeof(KillEvent)); @@ -195,18 +197,20 @@ QuitHandler( *---------------------------------------------------------------------- */ -OSErr +static OSErr OappHandler( - const AppleEvent * event, - AppleEvent * reply, + const AppleEvent *event, + AppleEvent *reply, long handlerRefcon) { Tcl_CmdInfo dummy; Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon; if (interp && - Tcl_GetCommandInfo(interp, "::tk::mac::OpenApplication", &dummy)) { - Tcl_GlobalEval(interp, "::tk::mac::OpenApplication"); + Tcl_GetCommandInfo(interp, "::tk::mac::OpenApplication", &dummy)){ + if (Tcl_GlobalEval(interp, "::tk::mac::OpenApplication") != TCL_OK) { + Tcl_BackgroundError(interp); + } } return noErr; } @@ -227,10 +231,10 @@ OappHandler( *---------------------------------------------------------------------- */ -OSErr +static OSErr RappHandler( - const AppleEvent * event, - AppleEvent * reply, + const AppleEvent *event, + AppleEvent *reply, long handlerRefcon) { Tcl_CmdInfo dummy; @@ -238,9 +242,11 @@ RappHandler( ProcessSerialNumber thePSN = {0, kCurrentProcess}; OSStatus err = ChkErr(SetFrontProcess, &thePSN); - if (interp && - Tcl_GetCommandInfo(interp, "::tk::mac::ReopenApplication", &dummy)) { - Tcl_GlobalEval(interp, "::tk::mac::ReopenApplication"); + if (interp && Tcl_GetCommandInfo(interp, + "::tk::mac::ReopenApplication", &dummy)) { + if (Tcl_GlobalEval(interp, "::tk::mac::ReopenApplication") != TCL_OK){ + Tcl_BackgroundError(interp); + } } return err; } @@ -250,8 +256,8 @@ RappHandler( * * PrefsHandler -- * - * This is the 'pref' core Apple event handler. - * Called when the user selects 'Preferences...' in MacOS X + * This is the 'pref' core Apple event handler. Called when the user + * selects 'Preferences...' in MacOS X * * Results: * None. @@ -262,18 +268,20 @@ RappHandler( *---------------------------------------------------------------------- */ -OSErr +static OSErr PrefsHandler( - const AppleEvent * event, - AppleEvent * reply, + const AppleEvent *event, + AppleEvent *reply, long handlerRefcon) { Tcl_CmdInfo dummy; Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon; if (interp && - Tcl_GetCommandInfo(interp, "::tk::mac::ShowPreferences", &dummy)) { - Tcl_GlobalEval(interp, "::tk::mac::ShowPreferences"); + Tcl_GetCommandInfo(interp, "::tk::mac::ShowPreferences", &dummy)){ + if (Tcl_GlobalEval(interp, "::tk::mac::ShowPreferences") != TCL_OK) { + Tcl_BackgroundError(interp); + } } return noErr; } @@ -294,75 +302,75 @@ PrefsHandler( *---------------------------------------------------------------------- */ -OSErr +static OSErr OdocHandler( - const AppleEvent * event, - AppleEvent * reply, + const AppleEvent *event, + AppleEvent *reply, long handlerRefcon) { Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon; AEDescList fileSpecList; FSRef file; - OSStatus err; DescType type; Size actual; - long count; + long count, index; AEKeyword keyword; - long index; - Tcl_DString command; - Tcl_DString pathName; + Tcl_DString command, pathName; Tcl_CmdInfo dummy; /* - * Don't bother if we don't have an interp or - * the open document procedure doesn't exist. + * Don't bother if we don't have an interp or the open document procedure + * doesn't exist. */ - if ((interp == NULL) || - (Tcl_GetCommandInfo(interp, "::tk::mac::OpenDocument", &dummy)) == 0) { - return noErr; + if (!interp || + !Tcl_GetCommandInfo(interp, "::tk::mac::OpenDocument", &dummy)) { + return noErr; } /* - * If we get any errors wil retrieving our parameters - * we just return with no error. + * If we get any errors wil retrieving our parameters we just return with + * no error. */ - err = ChkErr(AEGetParamDesc, event, keyDirectObject, typeAEList, - &fileSpecList); - if (err != noErr) { + if (ChkErr(AEGetParamDesc, event, keyDirectObject, typeAEList, + &fileSpecList) != noErr) { return noErr; } - - err = MissedAnyParameters(event); - if (err != noErr) { + if (MissedAnyParameters(event) != noErr) { return noErr; } - - err = ChkErr(AECountItems, &fileSpecList, &count); - if (err != noErr) { + if (ChkErr(AECountItems, &fileSpecList, &count) != noErr) { return noErr; } + /* + * Convert our parameters into a script to evaluate, skipping things that + * we can't handle right. + */ + Tcl_DStringInit(&command); Tcl_DStringAppend(&command, "::tk::mac::OpenDocument", -1); for (index = 1; index <= count; index++) { - err = ChkErr(AEGetNthPtr, &fileSpecList, index, typeFSRef, - &keyword, &type, (Ptr) &file, sizeof(FSRef), &actual); - if ( err != noErr ) { + if (ChkErr(AEGetNthPtr, &fileSpecList, index, typeFSRef, &keyword, + &type, (Ptr) &file, sizeof(FSRef), &actual) != noErr) { continue; } - err = ChkErr(FSRefToDString, &file, &pathName); - if (err == noErr) { + if (ChkErr(FSRefToDString, &file, &pathName) == noErr) { Tcl_DStringAppendElement(&command, Tcl_DStringValue(&pathName)); Tcl_DStringFree(&pathName); } } - Tcl_EvalEx(interp, Tcl_DStringValue(&command), Tcl_DStringLength(&command), - TCL_EVAL_GLOBAL); + /* + * Now handle the event by evaluating a script. + */ + if (Tcl_EvalEx(interp, Tcl_DStringValue(&command), + Tcl_DStringLength(&command), TCL_EVAL_GLOBAL) != TCL_OK) { + Tcl_BackgroundError(interp); + } Tcl_DStringFree(&command); return noErr; } @@ -383,7 +391,7 @@ OdocHandler( *---------------------------------------------------------------------- */ -OSErr +static OSErr PrintHandler( const AppleEvent * event, AppleEvent * reply, @@ -392,66 +400,57 @@ PrintHandler( Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon; AEDescList fileSpecList; FSRef file; - OSStatus err; DescType type; Size actual; - long count; + long count, index; AEKeyword keyword; - long index; - Tcl_DString command; - Tcl_DString pathName; + Tcl_DString command, pathName; Tcl_CmdInfo dummy; /* - * Don't bother if we don't have an interp or - * the print document procedure doesn't exist. + * Don't bother if we don't have an interp or the print document procedure + * doesn't exist. */ - if ((interp == NULL) || - (Tcl_GetCommandInfo(interp, "::tk::mac::PrintDocument", &dummy)) == 0) { - return noErr; + if (!interp || + !Tcl_GetCommandInfo(interp, "::tk::mac::PrintDocument", &dummy)) { + return noErr; } /* - * If we get any errors wil retrieving our parameters - * we just return with no error. + * If we get any errors wil retrieving our parameters we just return with + * no error. */ - err = ChkErr(AEGetParamDesc, event, keyDirectObject, typeAEList, - &fileSpecList); - if (err != noErr) { + if (ChkErr(AEGetParamDesc, event, keyDirectObject, typeAEList, + &fileSpecList) != noErr) { return noErr; } - - err = ChkErr(MissedAnyParameters, event); - if (err != noErr) { + if (ChkErr(MissedAnyParameters, event) != noErr) { return noErr; } - - err = ChkErr(AECountItems, &fileSpecList, &count); - if (err != noErr) { + if (ChkErr(AECountItems, &fileSpecList, &count) != noErr) { return noErr; } Tcl_DStringInit(&command); Tcl_DStringAppend(&command, "::tk::mac::PrintDocument", -1); for (index = 1; index <= count; index++) { - err = ChkErr(AEGetNthPtr, &fileSpecList, index, typeFSRef, &keyword, - &type, (Ptr) &file, sizeof(FSRef), &actual); - if ( err != noErr ) { + if (ChkErr(AEGetNthPtr, &fileSpecList, index, typeFSRef, &keyword, + &type, (Ptr) &file, sizeof(FSRef), &actual) != noErr) { continue; } - err = ChkErr(FSRefToDString, &file, &pathName); - if (err == noErr) { + if (ChkErr(FSRefToDString, &file, &pathName) == noErr) { Tcl_DStringAppendElement(&command, Tcl_DStringValue(&pathName)); Tcl_DStringFree(&pathName); } } - Tcl_EvalEx(interp, Tcl_DStringValue(&command), Tcl_DStringLength(&command), - TCL_EVAL_GLOBAL); - + if (Tcl_EvalEx(interp, Tcl_DStringValue(&command), + Tcl_DStringLength(&command), TCL_EVAL_GLOBAL) != TCL_OK) { + Tcl_BackgroundError(interp); + } Tcl_DStringFree(&command); return noErr; } @@ -472,23 +471,23 @@ PrintHandler( *---------------------------------------------------------------------- */ -OSErr +static OSErr ScriptHandler( - const AppleEvent * event, - AppleEvent * reply, + const AppleEvent *event, + AppleEvent *reply, long handlerRefcon) { OSStatus theErr; AEDescList theDesc; int tclErr = -1; - Tcl_Interp *interp; + Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon; char errString[128]; - interp = (Tcl_Interp *) handlerRefcon; - /* - * The do script event receives one parameter that should be data or a file. + * The do script event receives one parameter that should be data or a + * file. */ + theErr = AEGetParamDesc(event, keyDirectObject, typeWildCard, &theDesc); if (theErr != noErr) { @@ -497,95 +496,100 @@ ScriptHandler( theErr = AEPutParamPtr(reply, keyErrorString, typeChar, errString, strlen(errString)); } else if (MissedAnyParameters(event)) { + /* + * Dude! Where's my parameter? + */ + sprintf(errString, "AEDoScriptHandler: extra parameters"); AEPutParamPtr(reply, keyErrorString, typeChar, errString, strlen(errString)); theErr = -1771; - } else { - if (theDesc.descriptorType == (DescType)typeChar) { - Tcl_DString encodedText; - short i; - Size size; - char * data; + } else if (theDesc.descriptorType == (DescType) typeChar) { + /* + * We've had some data sent to us. Evaluate it. + */ - size = AEGetDescDataSize(&theDesc); + Tcl_DString encodedText; + short i; + Size size = AEGetDescDataSize(&theDesc); + char *data = ckalloc(size + 1); - data = (char *)ckalloc(size + 1); - if ( !data ) { - theErr = -1771; - } - else { - AEGetDescData(&theDesc,data,size); - data [ size ] = 0; - for (i = 0; i < size; i++) - if (data[i] == '\r') - data[i] = '\n'; - AEReplaceDescData(theDesc.descriptorType, data, - size + 1, &theDesc); - } - Tcl_ExternalToUtfDString(NULL, data, size, - &encodedText); - tclErr = Tcl_EvalEx(interp, Tcl_DStringValue(&encodedText), - Tcl_DStringLength(&encodedText), TCL_EVAL_GLOBAL); - Tcl_DStringFree(&encodedText); - } else if (theDesc.descriptorType == (DescType)typeAlias) { - Boolean dummy; - FSRef file; - AliasPtr alias; - Size theSize; - - theSize = AEGetDescDataSize(&theDesc); - alias = (AliasPtr) ckalloc(theSize); - if (alias) { - AEGetDescData (&theDesc, alias, theSize); - - theErr = FSResolveAlias(NULL, &alias, - &file, &dummy); - ckfree((char*)alias); - } else { - theErr = memFullErr; + AEGetDescData(&theDesc, data, size); + data[size] = 0; + for (i = 0; i < size; i++) { + if (data[i] == '\r') { + data[i] = '\n'; } + } + AEReplaceDescData(theDesc.descriptorType, data, size + 1, &theDesc); + Tcl_ExternalToUtfDString(NULL, data, size, &encodedText); + tclErr = Tcl_EvalEx(interp, Tcl_DStringValue(&encodedText), + Tcl_DStringLength(&encodedText), TCL_EVAL_GLOBAL); + Tcl_DStringFree(&encodedText); + } else if (theDesc.descriptorType == (DescType) typeAlias) { + /* + * We've had a file sent to us. Source it. + */ + + Boolean dummy; + FSRef file; + Size theSize = AEGetDescDataSize(&theDesc); + AliasPtr alias = (AliasPtr) ckalloc(theSize); + + if (alias) { + AEGetDescData(&theDesc, alias, theSize); + + theErr = FSResolveAlias(NULL, &alias, &file, &dummy); + ckfree((char*)alias); + } else { + theErr = memFullErr; + } + if (theErr == noErr) { + Tcl_DString scriptName; + + theErr = FSRefToDString(&file, &scriptName); if (theErr == noErr) { - Tcl_DString scriptName; - theErr = FSRefToDString(&file, &scriptName); - if (theErr == noErr) { - Tcl_EvalFile(interp, Tcl_DStringValue(&scriptName)); - Tcl_DStringFree(&scriptName); - } - } else { - sprintf(errString, "AEDoScriptHandler: file not found"); - AEPutParamPtr(reply, keyErrorString, typeChar, - errString, strlen(errString)); + Tcl_EvalFile(interp, Tcl_DStringValue(&scriptName)); + Tcl_DStringFree(&scriptName); } } else { - sprintf(errString, - "AEDoScriptHandler: invalid script type '%-4.4s', must be 'alis' or 'TEXT'", - (char *)(&theDesc.descriptorType)); - AEPutParamPtr(reply, keyErrorString, typeChar, - errString, strlen(errString)); - theErr = -1770; + sprintf(errString, "AEDoScriptHandler: file not found"); + AEPutParamPtr(reply, keyErrorString, typeChar, errString, + strlen(errString)); } + } else { + /* + * Umm, don't recognize what we've got... + */ + + sprintf(errString, "AEDoScriptHandler: invalid script type '%-4.4s'," + " must be 'alis' or 'TEXT'", (char*) &theDesc.descriptorType); + AEPutParamPtr(reply, keyErrorString, typeChar, errString, + strlen(errString)); + theErr = -1770; } /* * If we actually go to run Tcl code - put the result in the reply. */ - if (tclErr >= 0) { - if (tclErr == TCL_OK) { - AEPutParamPtr(reply, keyDirectObject, typeChar, - Tcl_GetStringResult(interp), - strlen(Tcl_GetStringResult(interp))); - } else { - AEPutParamPtr(reply, keyErrorString, typeChar, - Tcl_GetStringResult(interp), - strlen(Tcl_GetStringResult(interp))); - AEPutParamPtr(reply, keyErrorNumber, typeInteger, - (Ptr) &tclErr, sizeof(int)); - } + + if (tclErr == TCL_OK) { + int reslen; + const char *result = + Tcl_GetStringFromObj(Tcl_GetObjResult(interp), &reslen); + + AEPutParamPtr(reply, keyDirectObject, typeChar, result, reslen); + } else if (tclErr >= 0) { + int reslen; + const char *result = + Tcl_GetStringFromObj(Tcl_GetObjResult(interp), &reslen); + + AEPutParamPtr(reply, keyErrorString, typeChar, result, reslen); + AEPutParamPtr(reply, keyErrorNumber, typeInteger, (Ptr) &tclErr, + sizeof(int)); } AEDisposeDesc(&theDesc); - return theErr; } @@ -594,8 +598,8 @@ ScriptHandler( * * ReallyKillMe -- * - * This proc tries to kill the shell by running exit, - * called from an event scheduled by the "Quit" AppleEvent handler. + * This proc tries to kill the shell by running exit, called from an + * event scheduled by the "Quit" AppleEvent handler. * * Results: * Runs the "exit" command which might kill the shell. @@ -613,10 +617,19 @@ ReallyKillMe( { Tcl_Interp *interp = ((KillEvent *) eventPtr)->interp; Tcl_CmdInfo dummy; + int result; + if (Tcl_GetCommandInfo(interp, "::tk::mac::Quit", &dummy)) { - Tcl_GlobalEval(interp, "::tk::mac::Quit"); + result = Tcl_GlobalEval(interp, "::tk::mac::Quit"); } else { - Tcl_GlobalEval(interp, "exit"); + result = Tcl_GlobalEval(interp, "exit"); + } + if (result != TCL_OK) { + /* + * Should be never reached... + */ + + Tcl_BackgroundError(interp); } return 1; } @@ -637,16 +650,16 @@ ReallyKillMe( *---------------------------------------------------------------------- */ -int +static int MissedAnyParameters( const AppleEvent *theEvent) { DescType returnedType; Size actualSize; - OSStatus err; + register OSStatus err; err = ChkErr(AEGetAttributePtr, theEvent, keyMissedKeywordAttr, - typeWildCard, &returnedType, NULL, 0, &actualSize); + typeWildCard, &returnedType, NULL, 0, &actualSize); return (err != errAEDescNotFound); } @@ -667,17 +680,25 @@ MissedAnyParameters( *---------------------------------------------------------------------- */ -OSStatus +static OSStatus FSRefToDString( const FSRef *fsref, Tcl_DString *ds) { UInt8 fileName[PATH_MAX+1]; - OSStatus err; + register OSStatus err; err = ChkErr(FSRefMakePath, fsref, fileName, sizeof(fileName)); if (err == noErr) { - Tcl_ExternalToUtfDString(NULL, (char*) fileName, -1, ds); + Tcl_ExternalToUtfDString(NULL, (char *) fileName, -1, ds); } return err; } + +/* + * Local Variables: + * mode: c + * c-basic-offset: 4 + * fill-column: 78 + * End: + */ -- cgit v0.12 From 71beb13aef5469536491f6d9377e151d077720a5 Mon Sep 17 00:00:00 2001 From: jenglish Date: Fri, 4 Jul 2008 19:05:03 +0000 Subject: Audit: ensure that output arguments to Tk_Get*FromObj() are initialized, in case of erroneous style specifications [#2009213]. --- ChangeLog | 9 +++++++++ generic/ttk/ttkClamTheme.c | 10 +++++----- generic/ttk/ttkClassicTheme.c | 10 ++++------ generic/ttk/ttkDefaultTheme.c | 4 ++-- generic/ttk/ttkElements.c | 8 ++++---- tests/ttk/ttk.test | 9 +++++++++ 6 files changed, 33 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6f59eda..8e7b0ab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-07-04 Joe English + + * generic/ttk/ttkDefaultTheme.c, generic/ttk/ttkClamTheme.c, + generic/ttk/ttkClassicTheme.c, generic/ttk/ttkElements.c: + Audit: ensure that output arguments to Tk_Get*FromObj() + are initialized, in case of erroneous style specifications + [Bug #2009213]. + + 2008-07-02 Donal K. Fellows * macosx/tkMacOSXHLEvents.c: Some tidying up of this file. Make sure diff --git a/generic/ttk/ttkClamTheme.c b/generic/ttk/ttkClamTheme.c index cabdef3..cde8ef7 100644 --- a/generic/ttk/ttkClamTheme.c +++ b/generic/ttk/ttkClamTheme.c @@ -1,5 +1,5 @@ /* - * $Id: ttkClamTheme.c,v 1.9 2007/12/13 15:26:26 dgp Exp $ + * $Id: ttkClamTheme.c,v 1.10 2008/07/04 19:05:04 jenglish Exp $ * * Copyright (C) 2004 Joe English * @@ -487,7 +487,7 @@ static void GripElementSize( { int horizontal = *((Ttk_Orient*)clientData) == TTK_ORIENT_HORIZONTAL; GripElement *grip = elementRecord; - int gripCount; + int gripCount = 0; Tcl_GetIntFromObj(NULL, grip->gripCountObj, &gripCount); if (horizontal) { @@ -506,8 +506,8 @@ static void GripElementDraw( GripElement *grip = elementRecord; GC lightGC = Ttk_GCForColor(tkwin,grip->lightColorObj,d); GC darkGC = Ttk_GCForColor(tkwin,grip->borderColorObj,d); - int gripPad = 1; - int i, gripCount; + int gripPad = 1, gripCount = 0; + int i; Tcl_GetIntFromObj(NULL, grip->gripCountObj, &gripCount); @@ -614,7 +614,7 @@ static void ThumbElementDraw( Drawable d, Ttk_Box b, unsigned state) { ScrollbarElement *sb = elementRecord; - int gripCount = 3, orient = TTK_ORIENT_HORIZONTAL; + int gripCount = 0, orient = TTK_ORIENT_HORIZONTAL; GC lightGC, darkGC; int x1, y1, x2, y2, dx, dy, i; const int w = WIN32_XDRAWLINE_HACK; diff --git a/generic/ttk/ttkClassicTheme.c b/generic/ttk/ttkClassicTheme.c index e2f3651..94178a5 100644 --- a/generic/ttk/ttkClassicTheme.c +++ b/generic/ttk/ttkClassicTheme.c @@ -1,5 +1,5 @@ /* - * $Id: ttkClassicTheme.c,v 1.6 2007/12/13 15:26:26 dgp Exp $ + * $Id: ttkClassicTheme.c,v 1.7 2008/07/04 19:05:04 jenglish Exp $ * * Copyright (c) 2004, Joe English * @@ -228,17 +228,15 @@ static void ArrowElementDraw( { int direction = *(int *)clientData; ArrowElement *arrow = elementRecord; - Tk_3DBorder border; - int borderWidth; + Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, arrow->borderObj); + int borderWidth = 2; int relief = TK_RELIEF_RAISED; - int size; + int size = b.width < b.height ? b.width : b.height; XPoint points[3]; Tk_GetPixelsFromObj(NULL, tkwin, arrow->borderWidthObj, &borderWidth); - border = Tk_Get3DBorderFromObj(tkwin, arrow->borderObj); Tk_GetReliefFromObj(NULL, arrow->reliefObj, &relief); - size = b.width < b.height ? b.width : b.height; /* * @@@ There are off-by-one pixel errors in the way these are drawn; diff --git a/generic/ttk/ttkDefaultTheme.c b/generic/ttk/ttkDefaultTheme.c index bfc3af1..c8558af 100644 --- a/generic/ttk/ttkDefaultTheme.c +++ b/generic/ttk/ttkDefaultTheme.c @@ -1,4 +1,4 @@ -/* $Id: ttkDefaultTheme.c,v 1.11 2007/12/13 15:26:26 dgp Exp $ +/* $Id: ttkDefaultTheme.c,v 1.12 2008/07/04 19:05:04 jenglish Exp $ * * Copyright (c) 2003, Joe English * @@ -826,7 +826,7 @@ static void TroughElementDraw( { TroughElement *troughPtr = elementRecord; Tk_3DBorder border = NULL; - int borderWidth = 2, relief, groove, orient; + int borderWidth = 2, relief = TK_RELIEF_SUNKEN, groove = -1, orient; border = Tk_Get3DBorderFromObj(tkwin, troughPtr->colorObj); Ttk_GetOrientFromObj(NULL, troughPtr->orientObj, &orient); diff --git a/generic/ttk/ttkElements.c b/generic/ttk/ttkElements.c index 78d314d..56bdccb 100644 --- a/generic/ttk/ttkElements.c +++ b/generic/ttk/ttkElements.c @@ -1,4 +1,4 @@ -/* $Id: ttkElements.c,v 1.10 2007/12/13 15:26:26 dgp Exp $ +/* $Id: ttkElements.c,v 1.11 2008/07/04 19:05:04 jenglish Exp $ * * Copyright (c) 2003, Joe English * @@ -957,7 +957,7 @@ static void SliderElementDraw( { SliderElement *slider = elementRecord; Tk_3DBorder border = NULL; - int relief, borderWidth, orient; + int relief = TK_RELIEF_RAISED, borderWidth = 2, orient; border = Tk_Get3DBorderFromObj(tkwin, slider->borderObj); Ttk_GetOrientFromObj(NULL, slider->orientObj, &orient); @@ -1043,7 +1043,7 @@ static void PbarElementSize( int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) { PbarElement *pbar = elementRecord; - int orient, thickness, length, borderWidth; + int orient, thickness = 15, length = 30, borderWidth = 2; Ttk_GetOrientFromObj(NULL, pbar->orientObj, &orient); Tk_GetPixelsFromObj(NULL, tkwin, pbar->thicknessObj, &thickness); @@ -1068,7 +1068,7 @@ static void PbarElementDraw( { PbarElement *pbar = elementRecord; Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, pbar->borderObj); - int relief, borderWidth; + int relief = TK_RELIEF_RAISED, borderWidth = 2; Tk_GetPixelsFromObj(NULL, tkwin, pbar->borderWidthObj, &borderWidth); Tk_GetReliefFromObj(NULL, pbar->reliefObj, &relief); diff --git a/tests/ttk/ttk.test b/tests/ttk/ttk.test index fab6c2c..a1430ff 100644 --- a/tests/ttk/ttk.test +++ b/tests/ttk/ttk.test @@ -191,6 +191,15 @@ test ttk-3.2 "Propagate errors from variable traces" -body { unset ::A ; destroy .cb } -returnCodes error -result {can't set "A": failure} +test ttk-3.4 "SF#2009213" -body { + ttk::style configure TScale -sliderrelief {} + pack [ttk::scale .s] + update +} -cleanup { + ttk::style configure TScale -sliderrelief raised + destroy .s +} + # Test resource allocation # (@@@ "-font" is a compatibility option now, so tests 4.1-4.3 # don't really test anything useful at the moment.) -- cgit v0.12 From ec1aaba502e58fe3b9f25759b6d389dab85bdd46 Mon Sep 17 00:00:00 2001 From: patthoyts Date: Tue, 8 Jul 2008 22:40:48 +0000 Subject: Fixed broken line endings from last doc commit --- ChangeLog | 4 + doc/CanvPsY.3 | 240 +++---- doc/Clipboard.3 | 156 ++--- doc/ClrSelect.3 | 80 +-- doc/CoordToWin.3 | 98 +-- doc/CrtGenHdlr.3 | 166 ++--- doc/DrawFocHlt.3 | 76 +-- doc/EventHndlr.3 | 154 ++--- doc/GeomReq.3 | 190 +++--- doc/GetGC.3 | 144 ++-- doc/GetHWND.3 | 78 +-- doc/GetPixmap.3 | 108 +-- doc/Grab.3 | 120 ++-- doc/HWNDToWindow.3 | 56 +- doc/HandleEvent.3 | 94 +-- doc/IdToWindow.3 | 68 +- doc/ImgChanged.3 | 132 ++-- doc/MainLoop.3 | 60 +- doc/MainWin.3 | 86 +-- doc/OwnSelect.3 | 102 +-- doc/QWinEvent.3 | 102 +-- doc/Restack.3 | 94 +-- doc/SetCaret.3 | 76 +-- doc/SetClass.3 | 118 ++-- doc/SetClassProcs.3 | 178 ++--- doc/SetGrid.3 | 130 ++-- doc/bell.n | 68 +- doc/bitmap.n | 222 +++--- doc/keysyms.n | 1856 +++++++++++++++++++++++++-------------------------- doc/lower.n | 72 +- doc/menubar.n | 76 +-- doc/popup.n | 98 +-- doc/tkerror.n | 74 +- doc/tkwait.n | 100 +-- 34 files changed, 2740 insertions(+), 2736 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8e7b0ab..8361c09 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-07-08 Pat Thoyts + + * doc/*.n: Fixed broken line endings from last doc commit. + 2008-07-04 Joe English * generic/ttk/ttkDefaultTheme.c, generic/ttk/ttkClamTheme.c, diff --git a/doc/CanvPsY.3 b/doc/CanvPsY.3 index 05b214e..7548099 100644 --- a/doc/CanvPsY.3 +++ b/doc/CanvPsY.3 @@ -1,120 +1,120 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: CanvPsY.3,v 1.7 2008/06/30 22:57:00 dkf Exp $ -'\" -.so man.macros -.TH Tk_CanvasPs 3 4.0 Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_CanvasPsY, Tk_CanvasPsBitmap, Tk_CanvasPsColor, Tk_CanvasPsFont, Tk_CanvasPsPath, Tk_CanvasPsStipple \- utility procedures for generating Postscript for canvases -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -double -\fBTk_CanvasPsY\fR(\fIcanvas, canvasY\fR) -.sp -int -\fBTk_CanvasPsBitmap\fR(\fIinterp, canvas, bitmap, x, y, width, height\fR) -.sp -int -\fBTk_CanvasPsColor\fR(\fIinterp, canvas, colorPtr\fR) -.sp -int -\fBTk_CanvasPsFont\fR(\fIinterp, canvas, tkFont\fR) -.sp -\fBTk_CanvasPsPath\fR(\fIinterp, canvas, coordPtr, numPoints\fR) -.sp -int -\fBTk_CanvasPsStipple\fR(\fIinterp, canvas, bitmap\fR) -.SH ARGUMENTS -.AS "unsigned int" "numPoints" -.AP Tk_Canvas canvas in -A token that identifies a canvas widget for which Postscript is -being generated. -.AP double canvasY in -Y-coordinate in the space of the canvas. -.AP Tcl_Interp *interp in/out -A Tcl interpreter; Postscript is appended to its result, or the -result may be replaced with an error message. -.AP Pixmap bitmap in -Bitmap to use for generating Postscript. -.AP int x in -X-coordinate within \fIbitmap\fR of left edge of region to output. -.AP int y in -Y-coordinate within \fIbitmap\fR of top edge of region to output. -.AP "int" width in -Width of region of bitmap to output, in pixels. -.AP "int" height in -Height of region of bitmap to output, in pixels. -.AP XColor *colorPtr in -Information about color value to set in Postscript. -.AP Tk_Font tkFont in -Font for which Postscript is to be generated. -.AP double *coordPtr in -Pointer to an array of coordinates for one or more -points specified in canvas coordinates. -The order of values in \fIcoordPtr\fR is x1, y1, x2, y2, x3, y3, -and so on. -.AP int numPoints in -Number of points at \fIcoordPtr\fR. -.BE -.SH DESCRIPTION -.PP -These procedures are called by canvas type managers to carry out -common functions related to generating Postscript. -Most of the procedures take a \fIcanvas\fR argument, which -refers to a canvas widget for which Postscript is being -generated. -.PP -\fBTk_CanvasPsY\fR takes as argument a y-coordinate in the space of -a canvas and returns the value that should be used for that point -in the Postscript currently being generated for \fIcanvas\fR. -Y coordinates require transformation because Postscript uses an -origin at the lower-left corner whereas X uses an origin at the -upper-left corner. -Canvas x coordinates can be used directly in Postscript without -transformation. -.PP -\fBTk_CanvasPsBitmap\fR generates Postscript to describe a region -of a bitmap. -The Postscript is generated in proper image data format for Postscript, -i.e., as data between angle brackets, one bit per pixel. -The Postscript is appended to \fIinterp->result\fR and \fBTCL_OK\fR is returned -unless an error occurs, in which case \fBTCL_ERROR\fR is returned and -\fIinterp->result\fR is overwritten with an error message. -.PP -\fBTk_CanvasPsColor\fR generates Postscript to set the current color -to correspond to its \fIcolorPtr\fR argument, taking into account any -color map specified in the \fBpostscript\fR command. -It appends the Postscript to \fIinterp->result\fR and returns -\fBTCL_OK\fR unless an error occurs, in which case \fBTCL_ERROR\fR is returned and -\fIinterp->result\fR is overwritten with an error message. -.PP -\fBTk_CanvasPsFont\fR generates Postscript that sets the current font -to match \fItkFont\fR as closely as possible. -\fBTk_CanvasPsFont\fR takes into account any font map specified -in the \fBpostscript\fR command, and it does -the best it can at mapping X fonts to Postscript fonts. -It appends the Postscript to \fIinterp->result\fR and returns \fBTCL_OK\fR -unless an error occurs, in which case \fBTCL_ERROR\fR is returned and -\fIinterp->result\fR is overwritten with an error message. -.PP -\fBTk_CanvasPsPath\fR generates Postscript to set the current path -to the set of points given by \fIcoordPtr\fR and \fInumPoints\fR. -It appends the resulting Postscript to \fIinterp->result\fR. -.PP -\fBTk_CanvasPsStipple\fR generates Postscript that will fill the -current path in stippled fashion. -It uses \fIbitmap\fR as the stipple pattern and the current Postscript -color; ones in the stipple bitmap are drawn in the current color, and -zeroes are not drawn at all. -The Postscript is appended to \fIinterp->result\fR and \fBTCL_OK\fR is -returned, unless an error occurs, in which case \fBTCL_ERROR\fR is returned and -\fIinterp->result\fR is overwritten with an error message. -.SH KEYWORDS -bitmap, canvas, color, font, path, Postscript, stipple +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: CanvPsY.3,v 1.8 2008/07/08 22:40:50 patthoyts Exp $ +'\" +.so man.macros +.TH Tk_CanvasPs 3 4.0 Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_CanvasPsY, Tk_CanvasPsBitmap, Tk_CanvasPsColor, Tk_CanvasPsFont, Tk_CanvasPsPath, Tk_CanvasPsStipple \- utility procedures for generating Postscript for canvases +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +double +\fBTk_CanvasPsY\fR(\fIcanvas, canvasY\fR) +.sp +int +\fBTk_CanvasPsBitmap\fR(\fIinterp, canvas, bitmap, x, y, width, height\fR) +.sp +int +\fBTk_CanvasPsColor\fR(\fIinterp, canvas, colorPtr\fR) +.sp +int +\fBTk_CanvasPsFont\fR(\fIinterp, canvas, tkFont\fR) +.sp +\fBTk_CanvasPsPath\fR(\fIinterp, canvas, coordPtr, numPoints\fR) +.sp +int +\fBTk_CanvasPsStipple\fR(\fIinterp, canvas, bitmap\fR) +.SH ARGUMENTS +.AS "unsigned int" "numPoints" +.AP Tk_Canvas canvas in +A token that identifies a canvas widget for which Postscript is +being generated. +.AP double canvasY in +Y-coordinate in the space of the canvas. +.AP Tcl_Interp *interp in/out +A Tcl interpreter; Postscript is appended to its result, or the +result may be replaced with an error message. +.AP Pixmap bitmap in +Bitmap to use for generating Postscript. +.AP int x in +X-coordinate within \fIbitmap\fR of left edge of region to output. +.AP int y in +Y-coordinate within \fIbitmap\fR of top edge of region to output. +.AP "int" width in +Width of region of bitmap to output, in pixels. +.AP "int" height in +Height of region of bitmap to output, in pixels. +.AP XColor *colorPtr in +Information about color value to set in Postscript. +.AP Tk_Font tkFont in +Font for which Postscript is to be generated. +.AP double *coordPtr in +Pointer to an array of coordinates for one or more +points specified in canvas coordinates. +The order of values in \fIcoordPtr\fR is x1, y1, x2, y2, x3, y3, +and so on. +.AP int numPoints in +Number of points at \fIcoordPtr\fR. +.BE +.SH DESCRIPTION +.PP +These procedures are called by canvas type managers to carry out +common functions related to generating Postscript. +Most of the procedures take a \fIcanvas\fR argument, which +refers to a canvas widget for which Postscript is being +generated. +.PP +\fBTk_CanvasPsY\fR takes as argument a y-coordinate in the space of +a canvas and returns the value that should be used for that point +in the Postscript currently being generated for \fIcanvas\fR. +Y coordinates require transformation because Postscript uses an +origin at the lower-left corner whereas X uses an origin at the +upper-left corner. +Canvas x coordinates can be used directly in Postscript without +transformation. +.PP +\fBTk_CanvasPsBitmap\fR generates Postscript to describe a region +of a bitmap. +The Postscript is generated in proper image data format for Postscript, +i.e., as data between angle brackets, one bit per pixel. +The Postscript is appended to \fIinterp->result\fR and \fBTCL_OK\fR is returned +unless an error occurs, in which case \fBTCL_ERROR\fR is returned and +\fIinterp->result\fR is overwritten with an error message. +.PP +\fBTk_CanvasPsColor\fR generates Postscript to set the current color +to correspond to its \fIcolorPtr\fR argument, taking into account any +color map specified in the \fBpostscript\fR command. +It appends the Postscript to \fIinterp->result\fR and returns +\fBTCL_OK\fR unless an error occurs, in which case \fBTCL_ERROR\fR is returned and +\fIinterp->result\fR is overwritten with an error message. +.PP +\fBTk_CanvasPsFont\fR generates Postscript that sets the current font +to match \fItkFont\fR as closely as possible. +\fBTk_CanvasPsFont\fR takes into account any font map specified +in the \fBpostscript\fR command, and it does +the best it can at mapping X fonts to Postscript fonts. +It appends the Postscript to \fIinterp->result\fR and returns \fBTCL_OK\fR +unless an error occurs, in which case \fBTCL_ERROR\fR is returned and +\fIinterp->result\fR is overwritten with an error message. +.PP +\fBTk_CanvasPsPath\fR generates Postscript to set the current path +to the set of points given by \fIcoordPtr\fR and \fInumPoints\fR. +It appends the resulting Postscript to \fIinterp->result\fR. +.PP +\fBTk_CanvasPsStipple\fR generates Postscript that will fill the +current path in stippled fashion. +It uses \fIbitmap\fR as the stipple pattern and the current Postscript +color; ones in the stipple bitmap are drawn in the current color, and +zeroes are not drawn at all. +The Postscript is appended to \fIinterp->result\fR and \fBTCL_OK\fR is +returned, unless an error occurs, in which case \fBTCL_ERROR\fR is returned and +\fIinterp->result\fR is overwritten with an error message. +.SH KEYWORDS +bitmap, canvas, color, font, path, Postscript, stipple diff --git a/doc/Clipboard.3 b/doc/Clipboard.3 index d0646ea..42fbbb3 100644 --- a/doc/Clipboard.3 +++ b/doc/Clipboard.3 @@ -1,78 +1,78 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: Clipboard.3,v 1.4 2008/06/30 22:57:00 dkf Exp $ -'\" -.so man.macros -.TH Tk_ClipboardClear 3 4.0 Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_ClipboardClear, Tk_ClipboardAppend \- Manage the clipboard -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -int -\fBTk_ClipboardClear\fR(\fIinterp, tkwin\fR) -.sp -int -\fBTk_ClipboardAppend\fR(\fIinterp, tkwin, target, format, buffer\fR) -.SH ARGUMENTS -.AS Tk_ClipboardClear tkwin -.AP Tcl_Interp *interp in -Interpreter to use for reporting errors. -.AP Tk_Window tkwin in -Window that determines which display's clipboard to manipulate. -.AP Atom target in -Conversion type for this clipboard item; has same meaning as -\fItarget\fR argument to \fBTk_CreateSelHandler\fR. -.AP Atom format in -Representation to use when data is retrieved; has same meaning as -\fIformat\fR argument to \fBTk_CreateSelHandler\fR. -.AP char *buffer in -Null terminated string containing the data to be appended to the clipboard. -.BE -.SH DESCRIPTION -.PP -These two procedures manage the clipboard for Tk. -The clipboard is typically managed by calling \fBTk_ClipboardClear\fR -once, then calling \fBTk_ClipboardAppend\fR to add data for any -number of targets. -.PP -\fBTk_ClipboardClear\fR claims the CLIPBOARD selection and frees any -data items previously stored on the clipboard in this application. -It normally returns \fBTCL_OK\fR, but if an error occurs it returns -\fBTCL_ERROR\fR and leaves an error message in \fIinterp->result\fR. -\fBTk_ClipboardClear\fR must be called before a sequence of -\fBTk_ClipboardAppend\fR calls can be issued. -.PP -\fBTk_ClipboardAppend\fR appends a buffer of data to the clipboard. -The first buffer for a given \fItarget\fR determines the \fIformat\fR -for that \fItarget\fR. -Any successive appends for that \fItarget\fR must have -the same format or an error will be returned. -\fBTk_ClipboardAppend\fR returns \fBTCL_OK\fR if the buffer is -successfully copied onto the clipboard. If the clipboard is not -currently owned by the application, either -because \fBTk_ClipboardClear\fR has not been called or because -ownership of the clipboard has changed since the last call to -\fBTk_ClipboardClear\fR, -\fBTk_ClipboardAppend\fR returns \fBTCL_ERROR\fR and leaves an error message in -\fIinterp->result\fR. -.PP -In order to guarantee atomicity, no event handling should occur -between \fBTk_ClipboardClear\fR and the following -\fBTk_ClipboardAppend\fR calls (otherwise someone could retrieve -a partially completed clipboard or claim ownership away from -this application). -.PP -\fBTk_ClipboardClear\fR may invoke callbacks, including arbitrary -Tcl scripts, as a result of losing the CLIPBOARD selection, so -any calling function should take care to be reentrant at the point -\fBTk_ClipboardClear\fR is invoked. -.SH KEYWORDS -append, clipboard, clear, format, type +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: Clipboard.3,v 1.5 2008/07/08 22:40:50 patthoyts Exp $ +'\" +.so man.macros +.TH Tk_ClipboardClear 3 4.0 Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_ClipboardClear, Tk_ClipboardAppend \- Manage the clipboard +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +int +\fBTk_ClipboardClear\fR(\fIinterp, tkwin\fR) +.sp +int +\fBTk_ClipboardAppend\fR(\fIinterp, tkwin, target, format, buffer\fR) +.SH ARGUMENTS +.AS Tk_ClipboardClear tkwin +.AP Tcl_Interp *interp in +Interpreter to use for reporting errors. +.AP Tk_Window tkwin in +Window that determines which display's clipboard to manipulate. +.AP Atom target in +Conversion type for this clipboard item; has same meaning as +\fItarget\fR argument to \fBTk_CreateSelHandler\fR. +.AP Atom format in +Representation to use when data is retrieved; has same meaning as +\fIformat\fR argument to \fBTk_CreateSelHandler\fR. +.AP char *buffer in +Null terminated string containing the data to be appended to the clipboard. +.BE +.SH DESCRIPTION +.PP +These two procedures manage the clipboard for Tk. +The clipboard is typically managed by calling \fBTk_ClipboardClear\fR +once, then calling \fBTk_ClipboardAppend\fR to add data for any +number of targets. +.PP +\fBTk_ClipboardClear\fR claims the CLIPBOARD selection and frees any +data items previously stored on the clipboard in this application. +It normally returns \fBTCL_OK\fR, but if an error occurs it returns +\fBTCL_ERROR\fR and leaves an error message in \fIinterp->result\fR. +\fBTk_ClipboardClear\fR must be called before a sequence of +\fBTk_ClipboardAppend\fR calls can be issued. +.PP +\fBTk_ClipboardAppend\fR appends a buffer of data to the clipboard. +The first buffer for a given \fItarget\fR determines the \fIformat\fR +for that \fItarget\fR. +Any successive appends for that \fItarget\fR must have +the same format or an error will be returned. +\fBTk_ClipboardAppend\fR returns \fBTCL_OK\fR if the buffer is +successfully copied onto the clipboard. If the clipboard is not +currently owned by the application, either +because \fBTk_ClipboardClear\fR has not been called or because +ownership of the clipboard has changed since the last call to +\fBTk_ClipboardClear\fR, +\fBTk_ClipboardAppend\fR returns \fBTCL_ERROR\fR and leaves an error message in +\fIinterp->result\fR. +.PP +In order to guarantee atomicity, no event handling should occur +between \fBTk_ClipboardClear\fR and the following +\fBTk_ClipboardAppend\fR calls (otherwise someone could retrieve +a partially completed clipboard or claim ownership away from +this application). +.PP +\fBTk_ClipboardClear\fR may invoke callbacks, including arbitrary +Tcl scripts, as a result of losing the CLIPBOARD selection, so +any calling function should take care to be reentrant at the point +\fBTk_ClipboardClear\fR is invoked. +.SH KEYWORDS +append, clipboard, clear, format, type diff --git a/doc/ClrSelect.3 b/doc/ClrSelect.3 index d00d51b..a470390 100644 --- a/doc/ClrSelect.3 +++ b/doc/ClrSelect.3 @@ -1,40 +1,40 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: ClrSelect.3,v 1.3 2008/06/30 22:57:00 dkf Exp $ -'\" -.so man.macros -.TH Tk_ClearSelection 3 4.0 Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_ClearSelection \- Deselect a selection -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTk_ClearSelection\fR(\fItkwin, selection\fR) -.SH ARGUMENTS -.AS Tk_Window tkwin -.AP Tk_Window tkwin in -The selection will be cleared from the display containing this -window. -.AP Atom selection in -The name of selection to be cleared. -.BE -.SH DESCRIPTION -.PP -\fBTk_ClearSelection\fR cancels the selection specified by the atom -\fIselection\fR for the display containing \fItkwin\fR. -The selection need not be in \fItkwin\fR itself or even in -\fItkwin\fR's application. -If there is a window anywhere on \fItkwin\fR's display that -owns \fIselection\fR, the window will be notified and the -selection will be cleared. -If there is no owner for \fIselection\fR on the display, then the -procedure has no effect. -.SH KEYWORDS -clear, selection +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: ClrSelect.3,v 1.4 2008/07/08 22:40:50 patthoyts Exp $ +'\" +.so man.macros +.TH Tk_ClearSelection 3 4.0 Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_ClearSelection \- Deselect a selection +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +\fBTk_ClearSelection\fR(\fItkwin, selection\fR) +.SH ARGUMENTS +.AS Tk_Window tkwin +.AP Tk_Window tkwin in +The selection will be cleared from the display containing this +window. +.AP Atom selection in +The name of selection to be cleared. +.BE +.SH DESCRIPTION +.PP +\fBTk_ClearSelection\fR cancels the selection specified by the atom +\fIselection\fR for the display containing \fItkwin\fR. +The selection need not be in \fItkwin\fR itself or even in +\fItkwin\fR's application. +If there is a window anywhere on \fItkwin\fR's display that +owns \fIselection\fR, the window will be notified and the +selection will be cleared. +If there is no owner for \fIselection\fR on the display, then the +procedure has no effect. +.SH KEYWORDS +clear, selection diff --git a/doc/CoordToWin.3 b/doc/CoordToWin.3 index 9eb8427..5e8996c 100644 --- a/doc/CoordToWin.3 +++ b/doc/CoordToWin.3 @@ -1,49 +1,49 @@ -'\" -'\" Copyright (c) 1990-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. -'\" -'\" RCS: @(#) $Id: CoordToWin.3,v 1.3 2008/06/30 22:57:00 dkf Exp $ -'\" -.so man.macros -.TH Tk_CoordsToWindow 3 "" Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_CoordsToWindow \- Find window containing a point -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -Tk_Window -\fBTk_CoordsToWindow\fR(\fIrootX, rootY, tkwin\fR) -.SH ARGUMENTS -.AS Tk_Window tkwin -.AP int rootX in -X-coordinate (in root window coordinates). -.AP int rootY in -Y-coordinate (in root window coordinates). -.AP Tk_Window tkwin in -Token for window that identifies application. -.BE -.SH DESCRIPTION -.PP -\fBTk_CoordsToWindow\fR locates the window that contains a given point. -The point is specified in root coordinates with \fIrootX\fR and -\fIrootY\fR (if a virtual-root window manager is in use then -\fIrootX\fR and \fIrootY\fR are in the coordinate system of the -virtual root window). -The return value from the procedure is a token for the window that -contains the given point. -If the point is not in any window, or if the containing window -is not in the same application as \fItkwin\fR, then NULL is -returned. -.PP -The containing window is decided using the same rules that determine -which window contains the mouse cursor: if a parent and a child both -contain the point then the child gets preference, and if two siblings -both contain the point then the highest one in the stacking order -(i.e. the one that's visible on the screen) gets preference. -.SH KEYWORDS -containing, coordinates, root window +'\" +'\" Copyright (c) 1990-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. +'\" +'\" RCS: @(#) $Id: CoordToWin.3,v 1.4 2008/07/08 22:40:50 patthoyts Exp $ +'\" +.so man.macros +.TH Tk_CoordsToWindow 3 "" Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_CoordsToWindow \- Find window containing a point +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +Tk_Window +\fBTk_CoordsToWindow\fR(\fIrootX, rootY, tkwin\fR) +.SH ARGUMENTS +.AS Tk_Window tkwin +.AP int rootX in +X-coordinate (in root window coordinates). +.AP int rootY in +Y-coordinate (in root window coordinates). +.AP Tk_Window tkwin in +Token for window that identifies application. +.BE +.SH DESCRIPTION +.PP +\fBTk_CoordsToWindow\fR locates the window that contains a given point. +The point is specified in root coordinates with \fIrootX\fR and +\fIrootY\fR (if a virtual-root window manager is in use then +\fIrootX\fR and \fIrootY\fR are in the coordinate system of the +virtual root window). +The return value from the procedure is a token for the window that +contains the given point. +If the point is not in any window, or if the containing window +is not in the same application as \fItkwin\fR, then NULL is +returned. +.PP +The containing window is decided using the same rules that determine +which window contains the mouse cursor: if a parent and a child both +contain the point then the child gets preference, and if two siblings +both contain the point then the highest one in the stacking order +(i.e. the one that's visible on the screen) gets preference. +.SH KEYWORDS +containing, coordinates, root window diff --git a/doc/CrtGenHdlr.3 b/doc/CrtGenHdlr.3 index 095361f..004e01a 100644 --- a/doc/CrtGenHdlr.3 +++ b/doc/CrtGenHdlr.3 @@ -1,83 +1,83 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: CrtGenHdlr.3,v 1.4 2008/06/30 22:57:01 dkf Exp $ -'\" -.so man.macros -.TH Tk_CreateGenericHandler 3 "" Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_CreateGenericHandler, Tk_DeleteGenericHandler \- associate procedure callback with all X events -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTk_CreateGenericHandler\fR(\fIproc, clientData\fR) -.sp -\fBTk_DeleteGenericHandler\fR(\fIproc, clientData\fR) -.SH ARGUMENTS -.AS "Tk_GenericProc" clientData -.AP Tk_GenericProc *proc in -Procedure to invoke whenever any X event occurs on any display. -.AP ClientData clientData in -Arbitrary one-word value to pass to \fIproc\fR. -.BE -.SH DESCRIPTION -.PP -\fBTk_CreateGenericHandler\fR arranges for \fIproc\fR to be -invoked in the future whenever any X event occurs. This mechanism is -\fInot\fR intended for dispatching X events on windows managed by Tk -(you should use \fBTk_CreateEventHandler\fR for this purpose). -\fBTk_CreateGenericHandler\fR is intended for other purposes, such -as tracing X events, monitoring events on windows not owned by Tk, -accessing X-related libraries that were not originally designed for -use with Tk, and so on. -.PP -The callback to \fIproc\fR will be made by \fBTk_HandleEvent\fR; -this mechanism only works in programs that dispatch events -through \fBTk_HandleEvent\fR (or through other Tk procedures that -call \fBTk_HandleEvent\fR, such as \fBTk_DoOneEvent\fR or -\fBTk_MainLoop\fR). -.PP -\fIProc\fR should have arguments and result that match the -type \fBTk_GenericProc\fR: -.CS -typedef int \fBTk_GenericProc\fR( - ClientData \fIclientData\fR, - XEvent *\fIeventPtr\fR); -.CE -The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR -argument given to \fBTk_CreateGenericHandler\fR when the callback -was created. Typically, \fIclientData\fR points to a data -structure containing application-specific information about -how to handle events. -\fIEventPtr\fR is a pointer to the X event. -.PP -Whenever an X event is processed by \fBTk_HandleEvent\fR, \fIproc\fR -is called. The return value from \fIproc\fR is normally 0. -A non-zero return value indicates that the event is not to be handled -further; that is, \fIproc\fR has done all processing that is to be -allowed for the event. -.PP -If there are multiple generic event handlers, each one is called -for each event, in the order in which they were established. -.PP -\fBTk_DeleteGenericHandler\fR may be called to delete a -previously-created generic event handler: it deletes each handler -it finds that matches the \fIproc\fR and \fIclientData\fR arguments. If -no such handler exists, then \fBTk_DeleteGenericHandler\fR returns -without doing anything. Although Tk supports it, it's probably -a bad idea to have more than one callback with the same -\fIproc\fR and \fIclientData\fR arguments. -.PP -Establishing a generic event handler does nothing to ensure that the -process will actually receive the X events that the handler wants to -process. -For example, it is the caller's responsibility to invoke -\fBXSelectInput\fR to select the desired events, if that is necessary. -.SH KEYWORDS -bind, callback, event, handler +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: CrtGenHdlr.3,v 1.5 2008/07/08 22:40:50 patthoyts Exp $ +'\" +.so man.macros +.TH Tk_CreateGenericHandler 3 "" Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_CreateGenericHandler, Tk_DeleteGenericHandler \- associate procedure callback with all X events +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +\fBTk_CreateGenericHandler\fR(\fIproc, clientData\fR) +.sp +\fBTk_DeleteGenericHandler\fR(\fIproc, clientData\fR) +.SH ARGUMENTS +.AS "Tk_GenericProc" clientData +.AP Tk_GenericProc *proc in +Procedure to invoke whenever any X event occurs on any display. +.AP ClientData clientData in +Arbitrary one-word value to pass to \fIproc\fR. +.BE +.SH DESCRIPTION +.PP +\fBTk_CreateGenericHandler\fR arranges for \fIproc\fR to be +invoked in the future whenever any X event occurs. This mechanism is +\fInot\fR intended for dispatching X events on windows managed by Tk +(you should use \fBTk_CreateEventHandler\fR for this purpose). +\fBTk_CreateGenericHandler\fR is intended for other purposes, such +as tracing X events, monitoring events on windows not owned by Tk, +accessing X-related libraries that were not originally designed for +use with Tk, and so on. +.PP +The callback to \fIproc\fR will be made by \fBTk_HandleEvent\fR; +this mechanism only works in programs that dispatch events +through \fBTk_HandleEvent\fR (or through other Tk procedures that +call \fBTk_HandleEvent\fR, such as \fBTk_DoOneEvent\fR or +\fBTk_MainLoop\fR). +.PP +\fIProc\fR should have arguments and result that match the +type \fBTk_GenericProc\fR: +.CS +typedef int \fBTk_GenericProc\fR( + ClientData \fIclientData\fR, + XEvent *\fIeventPtr\fR); +.CE +The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR +argument given to \fBTk_CreateGenericHandler\fR when the callback +was created. Typically, \fIclientData\fR points to a data +structure containing application-specific information about +how to handle events. +\fIEventPtr\fR is a pointer to the X event. +.PP +Whenever an X event is processed by \fBTk_HandleEvent\fR, \fIproc\fR +is called. The return value from \fIproc\fR is normally 0. +A non-zero return value indicates that the event is not to be handled +further; that is, \fIproc\fR has done all processing that is to be +allowed for the event. +.PP +If there are multiple generic event handlers, each one is called +for each event, in the order in which they were established. +.PP +\fBTk_DeleteGenericHandler\fR may be called to delete a +previously-created generic event handler: it deletes each handler +it finds that matches the \fIproc\fR and \fIclientData\fR arguments. If +no such handler exists, then \fBTk_DeleteGenericHandler\fR returns +without doing anything. Although Tk supports it, it's probably +a bad idea to have more than one callback with the same +\fIproc\fR and \fIclientData\fR arguments. +.PP +Establishing a generic event handler does nothing to ensure that the +process will actually receive the X events that the handler wants to +process. +For example, it is the caller's responsibility to invoke +\fBXSelectInput\fR to select the desired events, if that is necessary. +.SH KEYWORDS +bind, callback, event, handler diff --git a/doc/DrawFocHlt.3 b/doc/DrawFocHlt.3 index a66d347..a3dffed 100644 --- a/doc/DrawFocHlt.3 +++ b/doc/DrawFocHlt.3 @@ -1,38 +1,38 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: DrawFocHlt.3,v 1.4 2008/06/30 22:57:01 dkf Exp $ -'\" -.so man.macros -.TH Tk_DrawFocusHighlight 3 4.0 Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_DrawFocusHighlight \- draw the traversal highlight ring for a widget -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTk_DrawFocusHighlight(\fItkwin, gc, width, drawable\fB)\fR -.SH ARGUMENTS -.AS "Tcl_Interp" *joinPtr -.AP Tk_Window tkwin in -Window for which the highlight is being drawn. Used to retrieve -the window's dimensions, among other things. -.AP GC gc in -Graphics context to use for drawing the highlight. -.AP int width in -Width of the highlight ring, in pixels. -.AP Drawable drawable in -Drawable in which to draw the highlight; usually an offscreen -pixmap for double buffering. -.BE -.SH DESCRIPTION -.PP -\fBTk_DrawFocusHighlight\fR is a utility procedure that draws the -traversal highlight ring for a widget. -It is typically invoked by widgets during redisplay. -.SH KEYWORDS -focus, traversal highlight +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: DrawFocHlt.3,v 1.5 2008/07/08 22:40:50 patthoyts Exp $ +'\" +.so man.macros +.TH Tk_DrawFocusHighlight 3 4.0 Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_DrawFocusHighlight \- draw the traversal highlight ring for a widget +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +\fBTk_DrawFocusHighlight(\fItkwin, gc, width, drawable\fB)\fR +.SH ARGUMENTS +.AS "Tcl_Interp" *joinPtr +.AP Tk_Window tkwin in +Window for which the highlight is being drawn. Used to retrieve +the window's dimensions, among other things. +.AP GC gc in +Graphics context to use for drawing the highlight. +.AP int width in +Width of the highlight ring, in pixels. +.AP Drawable drawable in +Drawable in which to draw the highlight; usually an offscreen +pixmap for double buffering. +.BE +.SH DESCRIPTION +.PP +\fBTk_DrawFocusHighlight\fR is a utility procedure that draws the +traversal highlight ring for a widget. +It is typically invoked by widgets during redisplay. +.SH KEYWORDS +focus, traversal highlight diff --git a/doc/EventHndlr.3 b/doc/EventHndlr.3 index 3096c38..36ac475 100644 --- a/doc/EventHndlr.3 +++ b/doc/EventHndlr.3 @@ -1,77 +1,77 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: EventHndlr.3,v 1.6 2008/06/30 22:57:01 dkf Exp $ -'\" -.so man.macros -.TH Tk_CreateEventHandler 3 "" Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_CreateEventHandler, Tk_DeleteEventHandler \- associate procedure callback with an X event -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTk_CreateEventHandler\fR(\fItkwin, mask, proc, clientData\fR) -.sp -\fBTk_DeleteEventHandler\fR(\fItkwin, mask, proc, clientData\fR) -.SH ARGUMENTS -.AS "unsigned long" clientData -.AP Tk_Window tkwin in -Token for window in which events may occur. -.AP "unsigned long" mask in -Bit-mask of events (such as \fBButtonPressMask\fR) -for which \fIproc\fR should be called. -.AP Tk_EventProc *proc in -Procedure to invoke whenever an event in \fImask\fR occurs -in the window given by \fItkwin\fR. -.AP ClientData clientData in -Arbitrary one-word value to pass to \fIproc\fR. -.BE -.SH DESCRIPTION -.PP -\fBTk_CreateEventHandler\fR arranges for \fIproc\fR to be -invoked in the future whenever one of the event types specified -by \fImask\fR occurs in the window specified by \fItkwin\fR. -The callback to \fIproc\fR will be made by \fBTk_HandleEvent\fR; -this mechanism only works in programs that dispatch events -through \fBTk_HandleEvent\fR (or through other Tk procedures that -call \fBTk_HandleEvent\fR, such as \fBTk_DoOneEvent\fR or -\fBTk_MainLoop\fR). -.PP -\fIProc\fR should have arguments and result that match the -type \fBTk_EventProc\fR: -.CS -typedef void \fBTk_EventProc\fR( - ClientData \fIclientData\fR, - XEvent *\fIeventPtr\fR); -.CE -The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR -argument given to \fBTk_CreateEventHandler\fR when the callback -was created. Typically, \fIclientData\fR points to a data -structure containing application-specific information about -the window in which the event occurred. \fIEventPtr\fR is -a pointer to the X event, which will be one of the ones -specified in the \fImask\fR argument to \fBTk_CreateEventHandler\fR. -.PP -\fBTk_DeleteEventHandler\fR may be called to delete a -previously-created event handler: it deletes the first handler -it finds that is associated with \fItkwin\fR and matches the -\fImask\fR, \fIproc\fR, and \fIclientData\fR arguments. If -no such handler exists, then \fBTk_HandleEvent\fR returns -without doing anything. Although Tk supports it, it's probably -a bad idea to have more than one callback with the same \fImask\fR, -\fIproc\fR, and \fIclientData\fR arguments. -When a window is deleted all of its handlers will be deleted -automatically; in this case there is no need to call -\fBTk_DeleteEventHandler\fR. -.PP -If multiple handlers are declared for the same type of X event -on the same window, then the handlers will be invoked in the -order they were created. -.SH KEYWORDS -bind, callback, event, handler +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: EventHndlr.3,v 1.7 2008/07/08 22:40:50 patthoyts Exp $ +'\" +.so man.macros +.TH Tk_CreateEventHandler 3 "" Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_CreateEventHandler, Tk_DeleteEventHandler \- associate procedure callback with an X event +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +\fBTk_CreateEventHandler\fR(\fItkwin, mask, proc, clientData\fR) +.sp +\fBTk_DeleteEventHandler\fR(\fItkwin, mask, proc, clientData\fR) +.SH ARGUMENTS +.AS "unsigned long" clientData +.AP Tk_Window tkwin in +Token for window in which events may occur. +.AP "unsigned long" mask in +Bit-mask of events (such as \fBButtonPressMask\fR) +for which \fIproc\fR should be called. +.AP Tk_EventProc *proc in +Procedure to invoke whenever an event in \fImask\fR occurs +in the window given by \fItkwin\fR. +.AP ClientData clientData in +Arbitrary one-word value to pass to \fIproc\fR. +.BE +.SH DESCRIPTION +.PP +\fBTk_CreateEventHandler\fR arranges for \fIproc\fR to be +invoked in the future whenever one of the event types specified +by \fImask\fR occurs in the window specified by \fItkwin\fR. +The callback to \fIproc\fR will be made by \fBTk_HandleEvent\fR; +this mechanism only works in programs that dispatch events +through \fBTk_HandleEvent\fR (or through other Tk procedures that +call \fBTk_HandleEvent\fR, such as \fBTk_DoOneEvent\fR or +\fBTk_MainLoop\fR). +.PP +\fIProc\fR should have arguments and result that match the +type \fBTk_EventProc\fR: +.CS +typedef void \fBTk_EventProc\fR( + ClientData \fIclientData\fR, + XEvent *\fIeventPtr\fR); +.CE +The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR +argument given to \fBTk_CreateEventHandler\fR when the callback +was created. Typically, \fIclientData\fR points to a data +structure containing application-specific information about +the window in which the event occurred. \fIEventPtr\fR is +a pointer to the X event, which will be one of the ones +specified in the \fImask\fR argument to \fBTk_CreateEventHandler\fR. +.PP +\fBTk_DeleteEventHandler\fR may be called to delete a +previously-created event handler: it deletes the first handler +it finds that is associated with \fItkwin\fR and matches the +\fImask\fR, \fIproc\fR, and \fIclientData\fR arguments. If +no such handler exists, then \fBTk_HandleEvent\fR returns +without doing anything. Although Tk supports it, it's probably +a bad idea to have more than one callback with the same \fImask\fR, +\fIproc\fR, and \fIclientData\fR arguments. +When a window is deleted all of its handlers will be deleted +automatically; in this case there is no need to call +\fBTk_DeleteEventHandler\fR. +.PP +If multiple handlers are declared for the same type of X event +on the same window, then the handlers will be invoked in the +order they were created. +.SH KEYWORDS +bind, callback, event, handler diff --git a/doc/GeomReq.3 b/doc/GeomReq.3 index 72ccc5a..ab2223a 100644 --- a/doc/GeomReq.3 +++ b/doc/GeomReq.3 @@ -1,95 +1,95 @@ -'\" -'\" 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. -'\" -'\" -'\" RCS: @(#) $Id: GeomReq.3,v 1.4 2008/06/30 22:57:01 dkf Exp $ -'\" -.so man.macros -.TH Tk_GeometryRequest 3 "8.4" Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_GeometryRequest, Tk_SetMinimumRequestSize, Tk_SetInternalBorder, Tk_SetInternalBorderEx \- specify desired geometry or internal border for a window -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTk_GeometryRequest\fR(\fItkwin, reqWidth, reqHeight\fR) -.sp -\fBTk_SetMinimumRequestSize\fR(\fItkwin, minWidth, minHeight\fR) -.sp -\fBTk_SetInternalBorder\fR(\fItkwin, width\fR) -.sp -\fBTk_SetInternalBorderEx\fR(\fItkwin, left, right, top, bottom\fR) -.SH ARGUMENTS -.AS baseHeight clientData -.AP Tk_Window tkwin in -Window for which geometry is being requested. -.AP int reqWidth in -Desired width for \fItkwin\fR, in pixel units. -.AP int reqHeight in -Desired height for \fItkwin\fR, in pixel units. -.AP int minWidth in -Desired minimum requested width for \fItkwin\fR, in pixel units. -.AP int minHeight in -Desired minimum requested height for \fItkwin\fR, in pixel units. -.AP int width in -Space to leave for internal border for \fItkwin\fR, in pixel units. -.AP int left in -Space to leave for left side of internal border for \fItkwin\fR, in pixel units. -.AP int right in -Space to leave for right side of internal border for \fItkwin\fR, in pixel units. -.AP int top in -Space to leave for top side of internal border for \fItkwin\fR, in pixel units. -.AP int bottom in -Space to leave for bottom side of internal border for \fItkwin\fR, in pixel units. -.BE -.SH DESCRIPTION -.PP -\fBTk_GeometryRequest\fR is called by widget code to indicate its -preference for the dimensions of a particular window. The arguments -to \fBTk_GeometryRequest\fR are made available to the geometry -manager for the window, which then decides on the actual geometry -for the window. Although geometry managers generally try to satisfy -requests made to \fBTk_GeometryRequest\fR, there is no guarantee that -this will always be possible. Widget code should not assume that -a geometry request will be satisfied until it receives a -\fBConfigureNotify\fR event indicating that the geometry change has -occurred. Widget code should never call procedures like -\fBTk_ResizeWindow\fR directly. Instead, it should invoke -\fBTk_GeometryRequest\fR and leave the final geometry decisions to -the geometry manager. -.PP -If \fItkwin\fR is a top-level window, then the geometry information -will be passed to the window manager using the standard ICCCM protocol. -.PP -\fBTk_SetInternalBorder\fR is called by widget code to indicate that -the widget has an internal border. This means that the widget draws -a decorative border inside the window instead of using the standard -X borders, which are external to the window's area. For example, -internal borders are used to draw 3-D effects. \fIWidth\fR -specifies the width of the border in pixels. Geometry managers will -use this information to avoid placing any children of \fItkwin\fR -overlapping the outermost \fIwidth\fR pixels of \fItkwin\fR's area. -.PP -\fBTk_SetInternalBorderEx\fR works like \fBTk_SetInternalBorder\fR -but lets you specify different widths for different sides of the window. -.PP -\fBTk_SetMinimumRequestSize\fR is called by widget code to indicate -that a geometry manager should request at least this size for the -widget. This allows a widget to have some control over its size when -a propagating geometry manager is used inside it. -.PP -The information specified in calls to \fBTk_GeometryRequest\fR, -\fBTk_SetMinimumRequestSize\fR, \fBTk_SetInternalBorder\fR and -\fBTk_SetInternalBorderEx\fR can be retrieved using the macros -\fBTk_ReqWidth\fR, \fBTk_ReqHeight\fR, \fBTk_MinReqWidth\fR, -\fBTk_MinReqHeight\fR, \fBTk_MinReqWidth\fR, \fBTk_InternalBorderLeft\fR, -\fBTk_InternalBorderRight\fR, \fBTk_InternalBorderTop\fR and -\fBTk_InternalBorderBottom\fR. -See the \fBTk_WindowId\fR manual entry for details. -.SH KEYWORDS -geometry, request +'\" +'\" 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. +'\" +'\" +'\" RCS: @(#) $Id: GeomReq.3,v 1.5 2008/07/08 22:40:50 patthoyts Exp $ +'\" +.so man.macros +.TH Tk_GeometryRequest 3 "8.4" Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_GeometryRequest, Tk_SetMinimumRequestSize, Tk_SetInternalBorder, Tk_SetInternalBorderEx \- specify desired geometry or internal border for a window +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +\fBTk_GeometryRequest\fR(\fItkwin, reqWidth, reqHeight\fR) +.sp +\fBTk_SetMinimumRequestSize\fR(\fItkwin, minWidth, minHeight\fR) +.sp +\fBTk_SetInternalBorder\fR(\fItkwin, width\fR) +.sp +\fBTk_SetInternalBorderEx\fR(\fItkwin, left, right, top, bottom\fR) +.SH ARGUMENTS +.AS baseHeight clientData +.AP Tk_Window tkwin in +Window for which geometry is being requested. +.AP int reqWidth in +Desired width for \fItkwin\fR, in pixel units. +.AP int reqHeight in +Desired height for \fItkwin\fR, in pixel units. +.AP int minWidth in +Desired minimum requested width for \fItkwin\fR, in pixel units. +.AP int minHeight in +Desired minimum requested height for \fItkwin\fR, in pixel units. +.AP int width in +Space to leave for internal border for \fItkwin\fR, in pixel units. +.AP int left in +Space to leave for left side of internal border for \fItkwin\fR, in pixel units. +.AP int right in +Space to leave for right side of internal border for \fItkwin\fR, in pixel units. +.AP int top in +Space to leave for top side of internal border for \fItkwin\fR, in pixel units. +.AP int bottom in +Space to leave for bottom side of internal border for \fItkwin\fR, in pixel units. +.BE +.SH DESCRIPTION +.PP +\fBTk_GeometryRequest\fR is called by widget code to indicate its +preference for the dimensions of a particular window. The arguments +to \fBTk_GeometryRequest\fR are made available to the geometry +manager for the window, which then decides on the actual geometry +for the window. Although geometry managers generally try to satisfy +requests made to \fBTk_GeometryRequest\fR, there is no guarantee that +this will always be possible. Widget code should not assume that +a geometry request will be satisfied until it receives a +\fBConfigureNotify\fR event indicating that the geometry change has +occurred. Widget code should never call procedures like +\fBTk_ResizeWindow\fR directly. Instead, it should invoke +\fBTk_GeometryRequest\fR and leave the final geometry decisions to +the geometry manager. +.PP +If \fItkwin\fR is a top-level window, then the geometry information +will be passed to the window manager using the standard ICCCM protocol. +.PP +\fBTk_SetInternalBorder\fR is called by widget code to indicate that +the widget has an internal border. This means that the widget draws +a decorative border inside the window instead of using the standard +X borders, which are external to the window's area. For example, +internal borders are used to draw 3-D effects. \fIWidth\fR +specifies the width of the border in pixels. Geometry managers will +use this information to avoid placing any children of \fItkwin\fR +overlapping the outermost \fIwidth\fR pixels of \fItkwin\fR's area. +.PP +\fBTk_SetInternalBorderEx\fR works like \fBTk_SetInternalBorder\fR +but lets you specify different widths for different sides of the window. +.PP +\fBTk_SetMinimumRequestSize\fR is called by widget code to indicate +that a geometry manager should request at least this size for the +widget. This allows a widget to have some control over its size when +a propagating geometry manager is used inside it. +.PP +The information specified in calls to \fBTk_GeometryRequest\fR, +\fBTk_SetMinimumRequestSize\fR, \fBTk_SetInternalBorder\fR and +\fBTk_SetInternalBorderEx\fR can be retrieved using the macros +\fBTk_ReqWidth\fR, \fBTk_ReqHeight\fR, \fBTk_MinReqWidth\fR, +\fBTk_MinReqHeight\fR, \fBTk_MinReqWidth\fR, \fBTk_InternalBorderLeft\fR, +\fBTk_InternalBorderRight\fR, \fBTk_InternalBorderTop\fR and +\fBTk_InternalBorderBottom\fR. +See the \fBTk_WindowId\fR manual entry for details. +.SH KEYWORDS +geometry, request diff --git a/doc/GetGC.3 b/doc/GetGC.3 index 97ac503..c2b61b9 100644 --- a/doc/GetGC.3 +++ b/doc/GetGC.3 @@ -1,72 +1,72 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: GetGC.3,v 1.3 2008/06/30 22:57:01 dkf Exp $ -'\" -.so man.macros -.TH Tk_GetGC 3 "" Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_GetGC, Tk_FreeGC \- maintain database of read-only graphics contexts -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -GC -\fBTk_GetGC\fR(\fItkwin, valueMask, valuePtr\fR) -.sp -\fBTk_FreeGC(\fIdisplay, gc\fR) -.SH ARGUMENTS -.AS "unsigned long" valueMask -.AP Tk_Window tkwin in -Token for window in which the graphics context will be used. -.AP "unsigned long" valueMask in -Mask of bits (such as \fBGCForeground\fR or \fBGCStipple\fR) -indicating which fields of \fI*valuePtr\fR are valid. -.AP XGCValues *valuePtr in -Pointer to structure describing the desired values for the -graphics context. -.AP Display *display in -Display for which \fIgc\fR was allocated. -.AP GC gc in -X identifier for graphics context that is no longer needed. -Must have been allocated by \fBTk_GetGC\fR. -.BE -.SH DESCRIPTION -.PP -\fBTk_GetGC\fR and \fBTk_FreeGC\fR manage a collection of graphics contexts -being used by an application. The procedures allow graphics contexts to be -shared, thereby avoiding the server overhead that would be incurred -if a separate GC were created for each use. \fBTk_GetGC\fR takes arguments -describing the desired graphics context and returns an X identifier -for a GC that fits the description. The graphics context that is returned -will have default values in all of the fields not specified explicitly -by \fIvalueMask\fR and \fIvaluePtr\fR. -.PP -\fBTk_GetGC\fR maintains a -database of all the graphics contexts it has created. Whenever possible, -a call to \fBTk_GetGC\fR will -return an existing graphics context rather than creating a new one. This -approach can substantially reduce server overhead, so \fBTk_GetGC\fR -should generally be used in preference to the Xlib procedure -\fBXCreateGC\fR, which creates a new graphics context on each call. -.PP -Since the return values of \fBTk_GetGC\fR -are shared, callers should never modify the graphics contexts -returned by \fBTk_GetGC\fR. -If a graphics context must be modified dynamically, then it should be -created by calling \fBXCreateGC\fR instead of \fBTk_GetGC\fR. -.PP -When a graphics context -is no longer needed, \fBTk_FreeGC\fR should be called to release it. -There should be exactly one call to \fBTk_FreeGC\fR for -each call to \fBTk_GetGC\fR. -When a graphics context is no longer in use anywhere (i.e. it has -been freed as many times as it has been gotten) \fBTk_FreeGC\fR -will release it to the X server and delete it from the database. -.SH KEYWORDS -graphics context +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: GetGC.3,v 1.4 2008/07/08 22:40:50 patthoyts Exp $ +'\" +.so man.macros +.TH Tk_GetGC 3 "" Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_GetGC, Tk_FreeGC \- maintain database of read-only graphics contexts +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +GC +\fBTk_GetGC\fR(\fItkwin, valueMask, valuePtr\fR) +.sp +\fBTk_FreeGC(\fIdisplay, gc\fR) +.SH ARGUMENTS +.AS "unsigned long" valueMask +.AP Tk_Window tkwin in +Token for window in which the graphics context will be used. +.AP "unsigned long" valueMask in +Mask of bits (such as \fBGCForeground\fR or \fBGCStipple\fR) +indicating which fields of \fI*valuePtr\fR are valid. +.AP XGCValues *valuePtr in +Pointer to structure describing the desired values for the +graphics context. +.AP Display *display in +Display for which \fIgc\fR was allocated. +.AP GC gc in +X identifier for graphics context that is no longer needed. +Must have been allocated by \fBTk_GetGC\fR. +.BE +.SH DESCRIPTION +.PP +\fBTk_GetGC\fR and \fBTk_FreeGC\fR manage a collection of graphics contexts +being used by an application. The procedures allow graphics contexts to be +shared, thereby avoiding the server overhead that would be incurred +if a separate GC were created for each use. \fBTk_GetGC\fR takes arguments +describing the desired graphics context and returns an X identifier +for a GC that fits the description. The graphics context that is returned +will have default values in all of the fields not specified explicitly +by \fIvalueMask\fR and \fIvaluePtr\fR. +.PP +\fBTk_GetGC\fR maintains a +database of all the graphics contexts it has created. Whenever possible, +a call to \fBTk_GetGC\fR will +return an existing graphics context rather than creating a new one. This +approach can substantially reduce server overhead, so \fBTk_GetGC\fR +should generally be used in preference to the Xlib procedure +\fBXCreateGC\fR, which creates a new graphics context on each call. +.PP +Since the return values of \fBTk_GetGC\fR +are shared, callers should never modify the graphics contexts +returned by \fBTk_GetGC\fR. +If a graphics context must be modified dynamically, then it should be +created by calling \fBXCreateGC\fR instead of \fBTk_GetGC\fR. +.PP +When a graphics context +is no longer needed, \fBTk_FreeGC\fR should be called to release it. +There should be exactly one call to \fBTk_FreeGC\fR for +each call to \fBTk_GetGC\fR. +When a graphics context is no longer in use anywhere (i.e. it has +been freed as many times as it has been gotten) \fBTk_FreeGC\fR +will release it to the X server and delete it from the database. +.SH KEYWORDS +graphics context diff --git a/doc/GetHWND.3 b/doc/GetHWND.3 index 664277c..7356f89 100644 --- a/doc/GetHWND.3 +++ b/doc/GetHWND.3 @@ -1,39 +1,39 @@ -'\" -'\" Copyright (c) 1998-2000 by Scriptics Corporation. -'\" All rights reserved. -'\" -'\" RCS: @(#) $Id: GetHWND.3,v 1.5 2008/06/30 22:57:01 dkf Exp $ -'\" -'\" -.so man.macros -.TH HWND 3 8.0 Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_GetHWND, Tk_AttachHWND \- manage interactions between the Windows handle and an X window -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -HWND -\fBTk_GetHWND\fR(\fIwindow\fR) -.sp -Window -\fBTk_AttachHWND\fR(\fItkwin, hwnd\fR) -.SH ARGUMENTS -.AP Window window in -X token for window. -.AP Tk_Window tkwin in -Tk window for window. -.AP HWND hwnd in -Windows HWND for window. -.BE -.SH DESCRIPTION -.PP -\fBTk_GetHWND\fR returns the Windows HWND identifier for X Windows -window given by \fIwindow\fR. -.PP -\fBTk_AttachHWND\fR binds the Windows HWND identifier to the -specified Tk_Window given by \fItkwin\fR. It returns an X Windows -window that encapsulates the HWND. -.SH KEYWORDS -identifier, window +'\" +'\" Copyright (c) 1998-2000 by Scriptics Corporation. +'\" All rights reserved. +'\" +'\" RCS: @(#) $Id: GetHWND.3,v 1.6 2008/07/08 22:40:50 patthoyts Exp $ +'\" +'\" +.so man.macros +.TH HWND 3 8.0 Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_GetHWND, Tk_AttachHWND \- manage interactions between the Windows handle and an X window +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +HWND +\fBTk_GetHWND\fR(\fIwindow\fR) +.sp +Window +\fBTk_AttachHWND\fR(\fItkwin, hwnd\fR) +.SH ARGUMENTS +.AP Window window in +X token for window. +.AP Tk_Window tkwin in +Tk window for window. +.AP HWND hwnd in +Windows HWND for window. +.BE +.SH DESCRIPTION +.PP +\fBTk_GetHWND\fR returns the Windows HWND identifier for X Windows +window given by \fIwindow\fR. +.PP +\fBTk_AttachHWND\fR binds the Windows HWND identifier to the +specified Tk_Window given by \fItkwin\fR. It returns an X Windows +window that encapsulates the HWND. +.SH KEYWORDS +identifier, window diff --git a/doc/GetPixmap.3 b/doc/GetPixmap.3 index d851387..93460c0 100644 --- a/doc/GetPixmap.3 +++ b/doc/GetPixmap.3 @@ -1,54 +1,54 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: GetPixmap.3,v 1.3 2008/06/30 22:57:01 dkf Exp $ -'\" -.so man.macros -.TH Tk_GetPixmap 3 4.0 Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_GetPixmap, Tk_FreePixmap \- allocate and free pixmaps -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -Pixmap -\fBTk_GetPixmap(\fIdisplay, d, width, height, depth\fB)\fR -.sp -\fBTk_FreePixmap(\fIdisplay, pixmap\fB)\fR -.SH ARGUMENTS -.AS "Drawable" *pixelPtr -.AP Display *display in -X display for the pixmap. -.AP Drawable d in -Pixmap or window where the new pixmap will be used for drawing. -.AP "int" width in -Width of pixmap. -.AP "int" height in -Height of pixmap. -.AP "int" depth in -Number of bits per pixel in pixmap. -.AP Pixmap pixmap in -Pixmap to destroy. -.BE -.SH DESCRIPTION -.PP -These procedures are identical to the Xlib procedures \fBXCreatePixmap\fR -and \fBXFreePixmap\fR, except that they have extra code to manage X -resource identifiers so that identifiers for deleted pixmaps can be -reused in the future. -It is important for Tk applications to use these procedures rather -than \fBXCreatePixmap\fR and \fBXFreePixmap\fR; otherwise long-running -applications may run out of resource identifiers. -.PP -\fBTk_GetPixmap\fR creates a pixmap suitable for drawing in \fId\fR, -with dimensions given by \fIwidth\fR, \fIheight\fR, and \fIdepth\fR, -and returns its identifier. -\fBTk_FreePixmap\fR destroys the pixmap given by \fIpixmap\fR and makes -its resource identifier available for reuse. -.SH KEYWORDS -pixmap, resource identifier +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: GetPixmap.3,v 1.4 2008/07/08 22:40:50 patthoyts Exp $ +'\" +.so man.macros +.TH Tk_GetPixmap 3 4.0 Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_GetPixmap, Tk_FreePixmap \- allocate and free pixmaps +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +Pixmap +\fBTk_GetPixmap(\fIdisplay, d, width, height, depth\fB)\fR +.sp +\fBTk_FreePixmap(\fIdisplay, pixmap\fB)\fR +.SH ARGUMENTS +.AS "Drawable" *pixelPtr +.AP Display *display in +X display for the pixmap. +.AP Drawable d in +Pixmap or window where the new pixmap will be used for drawing. +.AP "int" width in +Width of pixmap. +.AP "int" height in +Height of pixmap. +.AP "int" depth in +Number of bits per pixel in pixmap. +.AP Pixmap pixmap in +Pixmap to destroy. +.BE +.SH DESCRIPTION +.PP +These procedures are identical to the Xlib procedures \fBXCreatePixmap\fR +and \fBXFreePixmap\fR, except that they have extra code to manage X +resource identifiers so that identifiers for deleted pixmaps can be +reused in the future. +It is important for Tk applications to use these procedures rather +than \fBXCreatePixmap\fR and \fBXFreePixmap\fR; otherwise long-running +applications may run out of resource identifiers. +.PP +\fBTk_GetPixmap\fR creates a pixmap suitable for drawing in \fId\fR, +with dimensions given by \fIwidth\fR, \fIheight\fR, and \fIdepth\fR, +and returns its identifier. +\fBTk_FreePixmap\fR destroys the pixmap given by \fIpixmap\fR and makes +its resource identifier available for reuse. +.SH KEYWORDS +pixmap, resource identifier diff --git a/doc/Grab.3 b/doc/Grab.3 index 0db62c0..fd4c2f7 100644 --- a/doc/Grab.3 +++ b/doc/Grab.3 @@ -1,60 +1,60 @@ -'\" -'\" Copyright (c) 1998-2000 by Scriptics Corporation. -'\" All rights reserved. -'\" -'\" RCS: @(#) $Id: Grab.3,v 1.3 2008/06/30 22:57:01 dkf Exp $ -'\" -.so man.macros -.TH Tk_Grab 3 "" Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_Grab, Tk_Ungrab \- manipulate grab state in an application -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -int -\fBTk_Grab\fR(\fIinterp, tkwin, grabGlobal\fR) -.sp -void -\fBTk_Ungrab\fR(\fItkwin\fR) -.SH ARGUMENTS -.AP Tcl_Interp *interp in -Interpreter to use for error reporting -.AP Tk_Window tkwin in -Window on whose behalf the pointer is to be grabbed or released -.AP int grabGlobal in -Boolean indicating whether the grab is global or application local -.BE -.SH DESCRIPTION -.PP -These functions are used to set or release a global or -application local grab. When a grab is set on a particular window -in a Tk application, mouse and keyboard events can only be received by -that window and its descendants. Mouse and keyboard events for -windows outside the tree rooted at \fItkwin\fR will be redirected to -\fItkwin\fR. If the grab is global, then all mouse and keyboard -events for windows outside the tree rooted at \fItkwin\fR (even those -intended for windows in other applications) will be redirected to -\fItkwin\fR. If the grab is application local, only mouse and -keyboard events intended for a windows within the same application -(but outside the tree rooted at \fItkwin\fR) will be redirected. -.PP -\fBTk_Grab\fR sets a grab on a particular window. \fITkwin\fR -specifies the window on whose behalf the pointer is to be grabbed. -\fIGrabGlobal\fR indicates whether the grab should be global or -application local; if it is non-zero, it means the grab should be -global. Normally, \fBTk_Grab\fR returns \fBTCL_OK\fR; if an error occurs -and the grab cannot be set, \fBTCL_ERROR\fR is returned and an error message -is left if \fIinterp\fR's result. Once this call completes -successfully, no window outside the tree rooted at \fItkwin\fR will -receive pointer- or keyboard-related events until the next call to -Tk_Ungrab. If a previous grab was in effect within the application, -then it is replaced with a new one. -.PP -\fBTcl_Ungrab\fR releases a grab on the mouse pointer and keyboard, if -there is one set on the window given by \fItkwin\fR. Once a grab is -released, pointer and keyboard events will start being delivered to -other windows again. -.SH KEYWORDS -grab, window +'\" +'\" Copyright (c) 1998-2000 by Scriptics Corporation. +'\" All rights reserved. +'\" +'\" RCS: @(#) $Id: Grab.3,v 1.4 2008/07/08 22:40:50 patthoyts Exp $ +'\" +.so man.macros +.TH Tk_Grab 3 "" Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_Grab, Tk_Ungrab \- manipulate grab state in an application +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +int +\fBTk_Grab\fR(\fIinterp, tkwin, grabGlobal\fR) +.sp +void +\fBTk_Ungrab\fR(\fItkwin\fR) +.SH ARGUMENTS +.AP Tcl_Interp *interp in +Interpreter to use for error reporting +.AP Tk_Window tkwin in +Window on whose behalf the pointer is to be grabbed or released +.AP int grabGlobal in +Boolean indicating whether the grab is global or application local +.BE +.SH DESCRIPTION +.PP +These functions are used to set or release a global or +application local grab. When a grab is set on a particular window +in a Tk application, mouse and keyboard events can only be received by +that window and its descendants. Mouse and keyboard events for +windows outside the tree rooted at \fItkwin\fR will be redirected to +\fItkwin\fR. If the grab is global, then all mouse and keyboard +events for windows outside the tree rooted at \fItkwin\fR (even those +intended for windows in other applications) will be redirected to +\fItkwin\fR. If the grab is application local, only mouse and +keyboard events intended for a windows within the same application +(but outside the tree rooted at \fItkwin\fR) will be redirected. +.PP +\fBTk_Grab\fR sets a grab on a particular window. \fITkwin\fR +specifies the window on whose behalf the pointer is to be grabbed. +\fIGrabGlobal\fR indicates whether the grab should be global or +application local; if it is non-zero, it means the grab should be +global. Normally, \fBTk_Grab\fR returns \fBTCL_OK\fR; if an error occurs +and the grab cannot be set, \fBTCL_ERROR\fR is returned and an error message +is left if \fIinterp\fR's result. Once this call completes +successfully, no window outside the tree rooted at \fItkwin\fR will +receive pointer- or keyboard-related events until the next call to +Tk_Ungrab. If a previous grab was in effect within the application, +then it is replaced with a new one. +.PP +\fBTcl_Ungrab\fR releases a grab on the mouse pointer and keyboard, if +there is one set on the window given by \fItkwin\fR. Once a grab is +released, pointer and keyboard events will start being delivered to +other windows again. +.SH KEYWORDS +grab, window diff --git a/doc/HWNDToWindow.3 b/doc/HWNDToWindow.3 index 9e60bab..8fdf4a2 100644 --- a/doc/HWNDToWindow.3 +++ b/doc/HWNDToWindow.3 @@ -1,28 +1,28 @@ -'\" -'\" Copyright (c) 1998-2000 by Scriptics Corporation. -'\" All rights reserved. -'\" -'\" RCS: @(#) $Id: HWNDToWindow.3,v 1.3 2008/06/30 22:57:01 dkf Exp $ -'\" -.so man.macros -.TH Tk_HWNDToWindow 3 "" Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_HWNDToWindow \- Find Tk's window information for a Windows window -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -Tk_Window -\fBTk_HWNDToWindow\fR(\fIhwnd\fR) -.SH ARGUMENTS -.AP HWND hwnd in -Windows handle for the window. -.BE -.SH DESCRIPTION -.PP -Given a Windows HWND window identifier, this procedure returns the -corresponding Tk_Window handle. If there is no Tk_Window corresponding -to \fIhwnd\fR then NULL is returned. -.SH KEYWORDS -Windows window id +'\" +'\" Copyright (c) 1998-2000 by Scriptics Corporation. +'\" All rights reserved. +'\" +'\" RCS: @(#) $Id: HWNDToWindow.3,v 1.4 2008/07/08 22:40:51 patthoyts Exp $ +'\" +.so man.macros +.TH Tk_HWNDToWindow 3 "" Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_HWNDToWindow \- Find Tk's window information for a Windows window +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +Tk_Window +\fBTk_HWNDToWindow\fR(\fIhwnd\fR) +.SH ARGUMENTS +.AP HWND hwnd in +Windows handle for the window. +.BE +.SH DESCRIPTION +.PP +Given a Windows HWND window identifier, this procedure returns the +corresponding Tk_Window handle. If there is no Tk_Window corresponding +to \fIhwnd\fR then NULL is returned. +.SH KEYWORDS +Windows window id diff --git a/doc/HandleEvent.3 b/doc/HandleEvent.3 index 69ed289..8f1b319 100644 --- a/doc/HandleEvent.3 +++ b/doc/HandleEvent.3 @@ -1,47 +1,47 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: HandleEvent.3,v 1.5 2008/06/30 22:57:01 dkf Exp $ -'\" -.so man.macros -.TH Tk_HandleEvent 3 "" Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_HandleEvent \- invoke event handlers for window system events -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTk_HandleEvent\fR(\fIeventPtr\fR) -.SH ARGUMENTS -.AS XEvent *eventPtr -.AP XEvent *eventPtr in -Pointer to X event to dispatch to relevant handler(s). -.BE -.SH DESCRIPTION -.PP -\fBTk_HandleEvent\fR is a lower-level procedure that deals with window -events. It is called by \fBTcl_ServiceEvent\fR (and indirectly by -\fBTk_DoOneEvent\fR), and in a few other cases within Tk. -It makes callbacks to any window event -handlers (created by calls to \fBTk_CreateEventHandler\fR) -that match \fIeventPtr\fR and then returns. In some cases -it may be useful for an application to bypass the Tk event -queue and call \fBTk_HandleEvent\fR directly instead of -calling \fBTcl_QueueEvent\fR followed by -\fBTcl_ServiceEvent\fR. -.PP -This procedure may be invoked recursively. For example, -it is possible to invoke \fBTk_HandleEvent\fR recursively -from a handler called by \fBTk_HandleEvent\fR. This sort -of operation is useful in some modal situations, such -as when a -notifier has been popped up and an application wishes to -wait for the user to click a button in the notifier before -doing anything else. -.SH KEYWORDS -callback, event, handler, window +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: HandleEvent.3,v 1.6 2008/07/08 22:40:51 patthoyts Exp $ +'\" +.so man.macros +.TH Tk_HandleEvent 3 "" Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_HandleEvent \- invoke event handlers for window system events +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +\fBTk_HandleEvent\fR(\fIeventPtr\fR) +.SH ARGUMENTS +.AS XEvent *eventPtr +.AP XEvent *eventPtr in +Pointer to X event to dispatch to relevant handler(s). +.BE +.SH DESCRIPTION +.PP +\fBTk_HandleEvent\fR is a lower-level procedure that deals with window +events. It is called by \fBTcl_ServiceEvent\fR (and indirectly by +\fBTk_DoOneEvent\fR), and in a few other cases within Tk. +It makes callbacks to any window event +handlers (created by calls to \fBTk_CreateEventHandler\fR) +that match \fIeventPtr\fR and then returns. In some cases +it may be useful for an application to bypass the Tk event +queue and call \fBTk_HandleEvent\fR directly instead of +calling \fBTcl_QueueEvent\fR followed by +\fBTcl_ServiceEvent\fR. +.PP +This procedure may be invoked recursively. For example, +it is possible to invoke \fBTk_HandleEvent\fR recursively +from a handler called by \fBTk_HandleEvent\fR. This sort +of operation is useful in some modal situations, such +as when a +notifier has been popped up and an application wishes to +wait for the user to click a button in the notifier before +doing anything else. +.SH KEYWORDS +callback, event, handler, window diff --git a/doc/IdToWindow.3 b/doc/IdToWindow.3 index b1cb5c3..f6e2486 100644 --- a/doc/IdToWindow.3 +++ b/doc/IdToWindow.3 @@ -1,34 +1,34 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: IdToWindow.3,v 1.3 2008/06/30 22:57:01 dkf Exp $ -'\" -.so man.macros -.TH Tk_IdToWindow 3 4.0 Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_IdToWindow \- Find Tk's window information for an X window -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -Tk_Window -\fBTk_IdToWindow\fR(\fIdisplay, window\fR) -.SH ARGUMENTS -.AS Tk_Window display -.AP Display *display in -X display containing the window. -.AP Window window in -X id for window. -.BE -.SH DESCRIPTION -.PP -Given an X window identifier and the X display it corresponds to, -this procedure returns the corresponding Tk_Window handle. -If there is no Tk_Window corresponding to \fIwindow\fR then -NULL is returned. -.SH KEYWORDS -X window id +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: IdToWindow.3,v 1.4 2008/07/08 22:40:51 patthoyts Exp $ +'\" +.so man.macros +.TH Tk_IdToWindow 3 4.0 Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_IdToWindow \- Find Tk's window information for an X window +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +Tk_Window +\fBTk_IdToWindow\fR(\fIdisplay, window\fR) +.SH ARGUMENTS +.AS Tk_Window display +.AP Display *display in +X display containing the window. +.AP Window window in +X id for window. +.BE +.SH DESCRIPTION +.PP +Given an X window identifier and the X display it corresponds to, +this procedure returns the corresponding Tk_Window handle. +If there is no Tk_Window corresponding to \fIwindow\fR then +NULL is returned. +.SH KEYWORDS +X window id diff --git a/doc/ImgChanged.3 b/doc/ImgChanged.3 index 99f24fd..7344c53 100644 --- a/doc/ImgChanged.3 +++ b/doc/ImgChanged.3 @@ -1,66 +1,66 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: ImgChanged.3,v 1.3 2008/06/30 22:57:01 dkf Exp $ -'\" -.so man.macros -.TH Tk_ImageChanged 3 4.0 Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_ImageChanged \- notify widgets that image needs to be redrawn -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTk_ImageChanged\fR(\fIimageMaster, x, y, width, height, imageWidth, imageHeight\fR) -.SH ARGUMENTS -.AS Tk_ImageMaster imageHeight -.AP Tk_ImageMaster imageMaster in -Token for image, which was passed to image's \fIcreateProc\fR when -the image was created. -.AP int x in -X-coordinate of upper-left corner of region that needs redisplay (measured -from upper-left corner of image). -.AP int y in -Y-coordinate of upper-left corner of region that needs redisplay (measured -from upper-left corner of image). -.AP "int" width in -Width of region that needs to be redrawn, in pixels. -.AP "int" height in -Height of region that needs to be redrawn, in pixels. -.AP "int" imageWidth in -Current width of image, in pixels. -.AP "int" imageHeight in -Current height of image, in pixels. -.BE -.SH DESCRIPTION -.PP -An image manager calls \fBTk_ImageChanged\fR for an image -whenever anything happens that requires the image to be redrawn. -As a result of calling \fBTk_ImageChanged\fR, any widgets using -the image are notified so that they can redisplay themselves -appropriately. -The \fIimageMaster\fR argument identifies the image, and -\fIx\fR, \fIy\fR, \fIwidth\fR, and \fIheight\fR -specify a rectangular region within the image that needs to -be redrawn. -\fIimageWidth\fR and \fIimageHeight\fR specify the image's (new) size. -.PP -An image manager should call \fBTk_ImageChanged\fR during -its \fIcreateProc\fR to specify the image's initial size and to -force redisplay if there are existing instances for the image. -If any of the pixel values in the image should change later on, -\fBTk_ImageChanged\fR should be called again with \fIx\fR, \fIy\fR, -\fIwidth\fR, and \fIheight\fR values that cover all the pixels -that changed. -If the size of the image should change, then \fBTk_ImageChanged\fR -must be called to indicate the new size, even if no pixels -need to be redisplayed. -.SH "SEE ALSO" -Tk_CreateImageType -.SH KEYWORDS -images, redisplay, image size changes +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: ImgChanged.3,v 1.4 2008/07/08 22:40:51 patthoyts Exp $ +'\" +.so man.macros +.TH Tk_ImageChanged 3 4.0 Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_ImageChanged \- notify widgets that image needs to be redrawn +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +\fBTk_ImageChanged\fR(\fIimageMaster, x, y, width, height, imageWidth, imageHeight\fR) +.SH ARGUMENTS +.AS Tk_ImageMaster imageHeight +.AP Tk_ImageMaster imageMaster in +Token for image, which was passed to image's \fIcreateProc\fR when +the image was created. +.AP int x in +X-coordinate of upper-left corner of region that needs redisplay (measured +from upper-left corner of image). +.AP int y in +Y-coordinate of upper-left corner of region that needs redisplay (measured +from upper-left corner of image). +.AP "int" width in +Width of region that needs to be redrawn, in pixels. +.AP "int" height in +Height of region that needs to be redrawn, in pixels. +.AP "int" imageWidth in +Current width of image, in pixels. +.AP "int" imageHeight in +Current height of image, in pixels. +.BE +.SH DESCRIPTION +.PP +An image manager calls \fBTk_ImageChanged\fR for an image +whenever anything happens that requires the image to be redrawn. +As a result of calling \fBTk_ImageChanged\fR, any widgets using +the image are notified so that they can redisplay themselves +appropriately. +The \fIimageMaster\fR argument identifies the image, and +\fIx\fR, \fIy\fR, \fIwidth\fR, and \fIheight\fR +specify a rectangular region within the image that needs to +be redrawn. +\fIimageWidth\fR and \fIimageHeight\fR specify the image's (new) size. +.PP +An image manager should call \fBTk_ImageChanged\fR during +its \fIcreateProc\fR to specify the image's initial size and to +force redisplay if there are existing instances for the image. +If any of the pixel values in the image should change later on, +\fBTk_ImageChanged\fR should be called again with \fIx\fR, \fIy\fR, +\fIwidth\fR, and \fIheight\fR values that cover all the pixels +that changed. +If the size of the image should change, then \fBTk_ImageChanged\fR +must be called to indicate the new size, even if no pixels +need to be redisplayed. +.SH "SEE ALSO" +Tk_CreateImageType +.SH KEYWORDS +images, redisplay, image size changes diff --git a/doc/MainLoop.3 b/doc/MainLoop.3 index 0b7f39d..d3129e0 100644 --- a/doc/MainLoop.3 +++ b/doc/MainLoop.3 @@ -1,30 +1,30 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: MainLoop.3,v 1.3 2008/06/30 22:57:01 dkf Exp $ -'\" -.so man.macros -.TH Tk_MainLoop 3 "" Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_MainLoop \- loop for events until all windows are deleted -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTk_MainLoop\fR() -.BE -.SH DESCRIPTION -.PP -\fBTk_MainLoop\fR is a procedure that loops repeatedly calling -\fBTcl_DoOneEvent\fR. It returns only when there are no applications -left in this process (i.e. no main windows exist anymore). Most -windowing applications will call \fBTk_MainLoop\fR after -initialization; the main execution of the application will consist -entirely of callbacks invoked via \fBTcl_DoOneEvent\fR. -.SH KEYWORDS -application, event, main loop +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: MainLoop.3,v 1.4 2008/07/08 22:40:51 patthoyts Exp $ +'\" +.so man.macros +.TH Tk_MainLoop 3 "" Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_MainLoop \- loop for events until all windows are deleted +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +\fBTk_MainLoop\fR() +.BE +.SH DESCRIPTION +.PP +\fBTk_MainLoop\fR is a procedure that loops repeatedly calling +\fBTcl_DoOneEvent\fR. It returns only when there are no applications +left in this process (i.e. no main windows exist anymore). Most +windowing applications will call \fBTk_MainLoop\fR after +initialization; the main execution of the application will consist +entirely of callbacks invoked via \fBTcl_DoOneEvent\fR. +.SH KEYWORDS +application, event, main loop diff --git a/doc/MainWin.3 b/doc/MainWin.3 index 93f0190..c80f6b5 100644 --- a/doc/MainWin.3 +++ b/doc/MainWin.3 @@ -1,43 +1,43 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: MainWin.3,v 1.4 2008/06/30 22:57:01 dkf Exp $ -'\" -.so man.macros -.TH Tk_MainWindow 3 7.0 Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_MainWindow, Tk_GetNumMainWindows \- functions for querying main -window information -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -Tk_Window -\fBTk_MainWindow\fR(\fIinterp\fR) -.sp -int -\fBTk_GetNumMainWindows\fR() -.SH ARGUMENTS -.AS Tcl_Interp *pathName -.AP Tcl_Interp *interp in/out -Interpreter associated with the application. -.BE -.SH DESCRIPTION -.PP -A main window is a special kind of toplevel window used as the -outermost window in an application. -.PP -If \fIinterp\fR is associated with a Tk application then \fBTk_MainWindow\fR -returns the application's main window. If there is no Tk application -associated with \fIinterp\fR then \fBTk_MainWindow\fR returns NULL and -leaves an error message in \fIinterp->result\fR. -.PP -\fBTk_GetNumMainWindows\fR returns a count of the number of main -windows currently open in the process. -.SH KEYWORDS -application, main window +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: MainWin.3,v 1.5 2008/07/08 22:40:51 patthoyts Exp $ +'\" +.so man.macros +.TH Tk_MainWindow 3 7.0 Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_MainWindow, Tk_GetNumMainWindows \- functions for querying main +window information +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +Tk_Window +\fBTk_MainWindow\fR(\fIinterp\fR) +.sp +int +\fBTk_GetNumMainWindows\fR() +.SH ARGUMENTS +.AS Tcl_Interp *pathName +.AP Tcl_Interp *interp in/out +Interpreter associated with the application. +.BE +.SH DESCRIPTION +.PP +A main window is a special kind of toplevel window used as the +outermost window in an application. +.PP +If \fIinterp\fR is associated with a Tk application then \fBTk_MainWindow\fR +returns the application's main window. If there is no Tk application +associated with \fIinterp\fR then \fBTk_MainWindow\fR returns NULL and +leaves an error message in \fIinterp->result\fR. +.PP +\fBTk_GetNumMainWindows\fR returns a count of the number of main +windows currently open in the process. +.SH KEYWORDS +application, main window diff --git a/doc/OwnSelect.3 b/doc/OwnSelect.3 index 98d9fb5..83b5b25 100644 --- a/doc/OwnSelect.3 +++ b/doc/OwnSelect.3 @@ -1,51 +1,51 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: OwnSelect.3,v 1.3 2008/06/30 22:57:01 dkf Exp $ -'\" -.so man.macros -.TH Tk_OwnSelection 3 4.0 Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_OwnSelection \- make a window the owner of the primary selection -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTk_OwnSelection\fR(\fItkwin, selection, proc, clientData\fR) -.SH ARGUMENTS -.AS Tk_LostSelProc clientData -.AP Tk_Window tkwin in -Window that is to become new selection owner. -.AP Atom selection in -The name of the selection to be owned, such as XA_PRIMARY. -.AP Tk_LostSelProc *proc in -Procedure to invoke when \fItkwin\fR loses selection ownership later. -.AP ClientData clientData in -Arbitrary one-word value to pass to \fIproc\fR. -.BE -.SH DESCRIPTION -.PP -\fBTk_OwnSelection\fR arranges for \fItkwin\fR to become the -new owner of the selection specified by the atom -\fIselection\fR. After this call completes, future requests -for the selection will be directed to handlers created for -\fItkwin\fR using \fBTk_CreateSelHandler\fR. When \fItkwin\fR -eventually loses the selection ownership, \fIproc\fR will be -invoked so that the window can clean itself up (e.g. by -unhighlighting the selection). \fIProc\fR should have arguments and -result that match the type \fBTk_LostSelProc\fR: -.CS -typedef void \fBTk_LostSelProc\fR( - ClientData \fIclientData\fR); -.CE -The \fIclientData\fR parameter to \fIproc\fR is a copy of the -\fIclientData\fR argument given to \fBTk_OwnSelection\fR, and is -usually a pointer to a data structure containing application-specific -information about \fItkwin\fR. -.SH KEYWORDS -own, selection owner +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: OwnSelect.3,v 1.4 2008/07/08 22:40:51 patthoyts Exp $ +'\" +.so man.macros +.TH Tk_OwnSelection 3 4.0 Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_OwnSelection \- make a window the owner of the primary selection +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +\fBTk_OwnSelection\fR(\fItkwin, selection, proc, clientData\fR) +.SH ARGUMENTS +.AS Tk_LostSelProc clientData +.AP Tk_Window tkwin in +Window that is to become new selection owner. +.AP Atom selection in +The name of the selection to be owned, such as XA_PRIMARY. +.AP Tk_LostSelProc *proc in +Procedure to invoke when \fItkwin\fR loses selection ownership later. +.AP ClientData clientData in +Arbitrary one-word value to pass to \fIproc\fR. +.BE +.SH DESCRIPTION +.PP +\fBTk_OwnSelection\fR arranges for \fItkwin\fR to become the +new owner of the selection specified by the atom +\fIselection\fR. After this call completes, future requests +for the selection will be directed to handlers created for +\fItkwin\fR using \fBTk_CreateSelHandler\fR. When \fItkwin\fR +eventually loses the selection ownership, \fIproc\fR will be +invoked so that the window can clean itself up (e.g. by +unhighlighting the selection). \fIProc\fR should have arguments and +result that match the type \fBTk_LostSelProc\fR: +.CS +typedef void \fBTk_LostSelProc\fR( + ClientData \fIclientData\fR); +.CE +The \fIclientData\fR parameter to \fIproc\fR is a copy of the +\fIclientData\fR argument given to \fBTk_OwnSelection\fR, and is +usually a pointer to a data structure containing application-specific +information about \fItkwin\fR. +.SH KEYWORDS +own, selection owner diff --git a/doc/QWinEvent.3 b/doc/QWinEvent.3 index 1117b86..0f82210 100644 --- a/doc/QWinEvent.3 +++ b/doc/QWinEvent.3 @@ -1,51 +1,51 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: QWinEvent.3,v 1.4 2008/06/30 22:57:01 dkf Exp $ -'\" -.so man.macros -.TH Tk_QueueWindowEvent 3 7.5 Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_CollapseMotionEvents, Tk_QueueWindowEvent \- Add a window event to the Tcl event queue -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -int -\fBTk_CollapseMotionEvents\fR(\fIdisplay, collapse\fR) -.sp -\fBTk_QueueWindowEvent\fR(\fIeventPtr, position\fR) -.SH ARGUMENTS -.AS Tcl_QueuePosition position -.AP Display *display in -Display for which to control motion event collapsing. -.AP int collapse in -Indicates whether motion events should be collapsed or not. -.AP XEvent *eventPtr in -An event to add to the event queue. -.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. -.BE -.SH DESCRIPTION -.PP -\fBTk_QueueWindowEvent\fR places a window event on Tcl's internal event -queue for eventual servicing. It creates a Tcl_Event structure, copies the -event into that structure, and calls \fBTcl_QueueEvent\fR to add the event -to the queue. When the event is eventually removed from the queue it is -processed just like all window events. -.PP -When multiple motion events are received for the same window in rapid -succession, they are collapsed by default. This behavior can be controlled -with \fBTk_CollapseMotionEvents\fR. \fBTk_CollapseMotionEvents\fR always -returns the previous value for collapse behavior on the \fIdisplay\fR. -.PP -The \fIposition\fR argument to \fBTk_QueueWindowEvent\fR has -the same significance as for \fBTcl_QueueEvent\fR; see the -documentation for \fBTcl_QueueEvent\fR for details. -.SH KEYWORDS -callback, clock, handler, modal timeout, events +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: QWinEvent.3,v 1.5 2008/07/08 22:40:51 patthoyts Exp $ +'\" +.so man.macros +.TH Tk_QueueWindowEvent 3 7.5 Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_CollapseMotionEvents, Tk_QueueWindowEvent \- Add a window event to the Tcl event queue +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +int +\fBTk_CollapseMotionEvents\fR(\fIdisplay, collapse\fR) +.sp +\fBTk_QueueWindowEvent\fR(\fIeventPtr, position\fR) +.SH ARGUMENTS +.AS Tcl_QueuePosition position +.AP Display *display in +Display for which to control motion event collapsing. +.AP int collapse in +Indicates whether motion events should be collapsed or not. +.AP XEvent *eventPtr in +An event to add to the event queue. +.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. +.BE +.SH DESCRIPTION +.PP +\fBTk_QueueWindowEvent\fR places a window event on Tcl's internal event +queue for eventual servicing. It creates a Tcl_Event structure, copies the +event into that structure, and calls \fBTcl_QueueEvent\fR to add the event +to the queue. When the event is eventually removed from the queue it is +processed just like all window events. +.PP +When multiple motion events are received for the same window in rapid +succession, they are collapsed by default. This behavior can be controlled +with \fBTk_CollapseMotionEvents\fR. \fBTk_CollapseMotionEvents\fR always +returns the previous value for collapse behavior on the \fIdisplay\fR. +.PP +The \fIposition\fR argument to \fBTk_QueueWindowEvent\fR has +the same significance as for \fBTcl_QueueEvent\fR; see the +documentation for \fBTcl_QueueEvent\fR for details. +.SH KEYWORDS +callback, clock, handler, modal timeout, events diff --git a/doc/Restack.3 b/doc/Restack.3 index a0a6350..cda9284 100644 --- a/doc/Restack.3 +++ b/doc/Restack.3 @@ -1,47 +1,47 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: Restack.3,v 1.3 2008/06/30 22:57:02 dkf Exp $ -'\" -.so man.macros -.TH Tk_RestackWindow 3 "" Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_RestackWindow \- Change a window's position in the stacking order -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -int -\fBTk_RestackWindow\fR(\fItkwin, aboveBelow, other\fR) -.SH ARGUMENTS -.AS Tk_Window aboveBelow -.AP Tk_Window tkwin in -Token for window to restack. -.AP int aboveBelow in -Indicates new position of \fItkwin\fR relative to \fIother\fR; -must be \fBAbove\fR or \fBBelow\fR. -.AP Tk_Window other in -\fITkwin\fR will be repositioned just above or below this window. -Must be a sibling of \fItkwin\fR or a descendant of a sibling. -If NULL then \fItkwin\fR is restacked above or below all siblings. -.BE -.SH DESCRIPTION -.PP -\fBTk_RestackWindow\fR changes the stacking order of \fIwindow\fR relative -to its siblings. -If \fIother\fR is specified as NULL then \fIwindow\fR is repositioned -at the top or bottom of its stacking order, depending on whether -\fIaboveBelow\fR is \fBAbove\fR or \fBBelow\fR. -If \fIother\fR has a non-NULL value then \fIwindow\fR is repositioned -just above or below \fIother\fR. -.PP -The \fIaboveBelow\fR argument must have one of the symbolic values -\fBAbove\fR or \fBBelow\fR. -Both of these values are defined by the include file . -.SH KEYWORDS -above, below, obscure, stacking order +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: Restack.3,v 1.4 2008/07/08 22:40:51 patthoyts Exp $ +'\" +.so man.macros +.TH Tk_RestackWindow 3 "" Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_RestackWindow \- Change a window's position in the stacking order +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +int +\fBTk_RestackWindow\fR(\fItkwin, aboveBelow, other\fR) +.SH ARGUMENTS +.AS Tk_Window aboveBelow +.AP Tk_Window tkwin in +Token for window to restack. +.AP int aboveBelow in +Indicates new position of \fItkwin\fR relative to \fIother\fR; +must be \fBAbove\fR or \fBBelow\fR. +.AP Tk_Window other in +\fITkwin\fR will be repositioned just above or below this window. +Must be a sibling of \fItkwin\fR or a descendant of a sibling. +If NULL then \fItkwin\fR is restacked above or below all siblings. +.BE +.SH DESCRIPTION +.PP +\fBTk_RestackWindow\fR changes the stacking order of \fIwindow\fR relative +to its siblings. +If \fIother\fR is specified as NULL then \fIwindow\fR is repositioned +at the top or bottom of its stacking order, depending on whether +\fIaboveBelow\fR is \fBAbove\fR or \fBBelow\fR. +If \fIother\fR has a non-NULL value then \fIwindow\fR is repositioned +just above or below \fIother\fR. +.PP +The \fIaboveBelow\fR argument must have one of the symbolic values +\fBAbove\fR or \fBBelow\fR. +Both of these values are defined by the include file . +.SH KEYWORDS +above, below, obscure, stacking order diff --git a/doc/SetCaret.3 b/doc/SetCaret.3 index 298387b..e01c89d 100644 --- a/doc/SetCaret.3 +++ b/doc/SetCaret.3 @@ -1,38 +1,38 @@ -'\" -'\" Copyright (c) 2002 ActiveState Corporation. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: SetCaret.3,v 1.2 2008/06/30 22:57:02 dkf Exp $ -'\" -.so man.macros -.TH Tk_SetCaretPos 3 8.4 Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_SetCaretPos \- set the display caret location -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -int -\fBTk_SetCaretPos\fR(\fItkwin, x, y, height\fR) -.SH ARGUMENTS -.AP Tk_Window tkwin in -Token for window. -.AP int x in -Window-relative x coordinate. -.AP int y in -Window-relative y coordinate. -.AP int h in -Height of the caret in the window. -.BE -.SH DESCRIPTION -.PP -\fBTk_SetCaretPos\fR sets the caret location for the display of the -specified Tk_Window \fItkwin\fR. The caret is the per-display cursor -location used for indicating global focus (e.g. to comply with Microsoft -Accessibility guidelines), as well as for location of the over-the-spot XIM -(X Input Methods) or Windows IME windows. -.SH KEYWORDS -caret, cursor +'\" +'\" Copyright (c) 2002 ActiveState Corporation. +'\" +'\" See the file "license.terms" for information on usage and redistribution +'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. +'\" +'\" RCS: @(#) $Id: SetCaret.3,v 1.3 2008/07/08 22:40:51 patthoyts Exp $ +'\" +.so man.macros +.TH Tk_SetCaretPos 3 8.4 Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_SetCaretPos \- set the display caret location +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +int +\fBTk_SetCaretPos\fR(\fItkwin, x, y, height\fR) +.SH ARGUMENTS +.AP Tk_Window tkwin in +Token for window. +.AP int x in +Window-relative x coordinate. +.AP int y in +Window-relative y coordinate. +.AP int h in +Height of the caret in the window. +.BE +.SH DESCRIPTION +.PP +\fBTk_SetCaretPos\fR sets the caret location for the display of the +specified Tk_Window \fItkwin\fR. The caret is the per-display cursor +location used for indicating global focus (e.g. to comply with Microsoft +Accessibility guidelines), as well as for location of the over-the-spot XIM +(X Input Methods) or Windows IME windows. +.SH KEYWORDS +caret, cursor diff --git a/doc/SetClass.3 b/doc/SetClass.3 index ad3d4ce..2fb095f 100644 --- a/doc/SetClass.3 +++ b/doc/SetClass.3 @@ -1,59 +1,59 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: SetClass.3,v 1.3 2008/06/30 22:57:02 dkf Exp $ -'\" -.so man.macros -.TH Tk_SetClass 3 "" Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_SetClass, Tk_Class \- set or retrieve a window's class -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTk_SetClass\fR(\fItkwin, class\fR) -.sp -Tk_Uid -\fBTk_Class\fR(\fItkwin\fR) -.SH ARGUMENTS -.AS Tk_Window parent -.AP Tk_Window tkwin in -Token for window. -.AP char *class in -New class name for window. -.BE -.SH DESCRIPTION -.PP -\fBTk_SetClass\fR is called to associate a class with a particular -window. The \fIclass\fR string identifies the type of the -window; all windows with the same general class of behavior -(button, menu, etc.) should have the same class. By -convention all class names start with a capital letter, and -there exists a Tcl command with the same name as -each class (except all in lower-case) which can be used to -create and manipulate windows of that class. -A window's class string is initialized to NULL -when the window is created. -.PP -For main windows, Tk automatically propagates the name and class -to the WM_CLASS property used by window managers. This happens -either when a main window is actually created (e.g. in -\fBTk_MakeWindowExist\fR), or when \fBTk_SetClass\fR -is called, whichever occurs later. If a main window has not been -assigned a class then Tk will not set the WM_CLASS property for -the window. -.PP -\fBTk_Class\fR is a macro that returns the -current value of \fItkwin\fR's class. The value is returned -as a Tk_Uid, which may be used just like a string pointer but also has -the properties of a unique identifier (see the manual entry for -\fBTk_GetUid\fR for details). -If \fItkwin\fR has not yet been given a class, then -\fBTk_Class\fR will return NULL. -.SH KEYWORDS -class, unique identifier, window, window manager +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: SetClass.3,v 1.4 2008/07/08 22:40:51 patthoyts Exp $ +'\" +.so man.macros +.TH Tk_SetClass 3 "" Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_SetClass, Tk_Class \- set or retrieve a window's class +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +\fBTk_SetClass\fR(\fItkwin, class\fR) +.sp +Tk_Uid +\fBTk_Class\fR(\fItkwin\fR) +.SH ARGUMENTS +.AS Tk_Window parent +.AP Tk_Window tkwin in +Token for window. +.AP char *class in +New class name for window. +.BE +.SH DESCRIPTION +.PP +\fBTk_SetClass\fR is called to associate a class with a particular +window. The \fIclass\fR string identifies the type of the +window; all windows with the same general class of behavior +(button, menu, etc.) should have the same class. By +convention all class names start with a capital letter, and +there exists a Tcl command with the same name as +each class (except all in lower-case) which can be used to +create and manipulate windows of that class. +A window's class string is initialized to NULL +when the window is created. +.PP +For main windows, Tk automatically propagates the name and class +to the WM_CLASS property used by window managers. This happens +either when a main window is actually created (e.g. in +\fBTk_MakeWindowExist\fR), or when \fBTk_SetClass\fR +is called, whichever occurs later. If a main window has not been +assigned a class then Tk will not set the WM_CLASS property for +the window. +.PP +\fBTk_Class\fR is a macro that returns the +current value of \fItkwin\fR's class. The value is returned +as a Tk_Uid, which may be used just like a string pointer but also has +the properties of a unique identifier (see the manual entry for +\fBTk_GetUid\fR for details). +If \fItkwin\fR has not yet been given a class, then +\fBTk_Class\fR will return NULL. +.SH KEYWORDS +class, unique identifier, window, window manager diff --git a/doc/SetClassProcs.3 b/doc/SetClassProcs.3 index 85a98d8..70709aa 100644 --- a/doc/SetClassProcs.3 +++ b/doc/SetClassProcs.3 @@ -1,89 +1,89 @@ -'\" -'\" Copyright (c) 2000 Ajuba Solutions. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: SetClassProcs.3,v 1.4 2008/06/30 22:57:02 dkf Exp $ -'\" -.so man.macros -.TH Tk_SetClassProcs 3 8.4 Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_SetClassProcs \- register widget specific procedures -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTk_SetClassProcs\fR(\fItkwin, procs, instanceData\fR) -.SH ARGUMENTS -.AS Tk_ClassProc instanceData -.AP Tk_Window tkwin in -Token for window to modify. -.AP Tk_ClassProcs *procs in -Pointer to data structure containing widget specific procedures. -The data structure pointed to by \fIprocs\fR must be static: -Tk keeps a reference to it as long as the window exists. -.AP ClientData instanceData in -Arbitrary one-word value to pass to widget callbacks. -.BE -.SH DESCRIPTION -.PP -\fBTk_SetClassProcs\fR is called to register a set of procedures that -are used as callbacks in different places. -.PP -The structure pointed to by \fIprocs\fR contains the following: -.CS -typedef struct Tk_ClassProcs { - unsigned int \fIsize\fR; - Tk_ClassWorldChangedProc *\fIworldChangedProc\fR; - Tk_ClassCreateProc *\fIcreateProc\fR; - Tk_ClassModalProc *\fImodalProc\fR; -} \fBTk_ClassProcs\fR; -.CE -The \fIsize\fR field is used to simplify future expansion of the -structure. It should always be set to (literally) \fBsizeof(Tk_ClassProcs)\fR. -.PP -\fIworldChangedProc\fR is invoked when the system has altered -in some way that requires some reaction from the widget. For example, -when a font alias (see the \fBfont\fR manual entry) is reconfigured, -widgets configured to use that font alias must update their display -accordingly. \fIworldChangedProc\fR should have arguments and results -that match the type \fBTk_ClassWorldChangedProc\fR: -.CS -typedef void \fBTk_ClassWorldChangedProc\fR( - ClientData \fIinstanceData\fR); -.CE -The \fIinstanceData\fR parameter passed to the \fIworldChangedProc\fR -will be identical to the \fIinstanceData\fR parameter passed to -\fBTk_SetClassProcs\fR. -.PP -\fIcreateProc\fR is used to create platform-dependant windows. It is -invoked by \fBTk_MakeWindowExist\fR. \fIcreateProc\fR should have -arguments and results that match the type \fBTk_ClassCreateProc\fR: -.CS -typedef Window \fBTk_ClassCreateProc\fR( - Tk_Window \fItkwin\fR, - Window \fIparent\fR, - ClientData \fIinstanceData\fR); -.CE -The \fItkwin\fR and \fIinstanceData\fR parameters will be identical to -the \fItkwin\fR and \fIinstanceData\fR parameters passed to -\fBTk_SetClassProcs\fR. The \fIparent\fR parameter will be the parent -of the window to be created. The \fIcreateProc\fR should return the -created window. -.PP -\fImodalProc\fR is invoked after all bindings on a widget have been -triggered in order to handle a modal loop. \fImodalProc\fR should -have arguments and results that match the type \fBTk_ClassModalProc\fR: -.CS -typedef void \fBTk_ClassModalProc\fR( - Tk_Window \fItkwin\fR, - XEvent *\fIeventPtr\fR); -.CE -The \fItkwin\fR parameter to \fImodalProc\fR will be identical to the -\fItkwin\fR parameter passed to \fBTk_SetClassProcs\fR. The -\fIeventPtr\fR parameter will be a pointer to an XEvent structure -describing the event being processed. -.SH KEYWORDS -callback, class +'\" +'\" Copyright (c) 2000 Ajuba Solutions. +'\" +'\" See the file "license.terms" for information on usage and redistribution +'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. +'\" +'\" RCS: @(#) $Id: SetClassProcs.3,v 1.5 2008/07/08 22:40:51 patthoyts Exp $ +'\" +.so man.macros +.TH Tk_SetClassProcs 3 8.4 Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_SetClassProcs \- register widget specific procedures +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +\fBTk_SetClassProcs\fR(\fItkwin, procs, instanceData\fR) +.SH ARGUMENTS +.AS Tk_ClassProc instanceData +.AP Tk_Window tkwin in +Token for window to modify. +.AP Tk_ClassProcs *procs in +Pointer to data structure containing widget specific procedures. +The data structure pointed to by \fIprocs\fR must be static: +Tk keeps a reference to it as long as the window exists. +.AP ClientData instanceData in +Arbitrary one-word value to pass to widget callbacks. +.BE +.SH DESCRIPTION +.PP +\fBTk_SetClassProcs\fR is called to register a set of procedures that +are used as callbacks in different places. +.PP +The structure pointed to by \fIprocs\fR contains the following: +.CS +typedef struct Tk_ClassProcs { + unsigned int \fIsize\fR; + Tk_ClassWorldChangedProc *\fIworldChangedProc\fR; + Tk_ClassCreateProc *\fIcreateProc\fR; + Tk_ClassModalProc *\fImodalProc\fR; +} \fBTk_ClassProcs\fR; +.CE +The \fIsize\fR field is used to simplify future expansion of the +structure. It should always be set to (literally) \fBsizeof(Tk_ClassProcs)\fR. +.PP +\fIworldChangedProc\fR is invoked when the system has altered +in some way that requires some reaction from the widget. For example, +when a font alias (see the \fBfont\fR manual entry) is reconfigured, +widgets configured to use that font alias must update their display +accordingly. \fIworldChangedProc\fR should have arguments and results +that match the type \fBTk_ClassWorldChangedProc\fR: +.CS +typedef void \fBTk_ClassWorldChangedProc\fR( + ClientData \fIinstanceData\fR); +.CE +The \fIinstanceData\fR parameter passed to the \fIworldChangedProc\fR +will be identical to the \fIinstanceData\fR parameter passed to +\fBTk_SetClassProcs\fR. +.PP +\fIcreateProc\fR is used to create platform-dependant windows. It is +invoked by \fBTk_MakeWindowExist\fR. \fIcreateProc\fR should have +arguments and results that match the type \fBTk_ClassCreateProc\fR: +.CS +typedef Window \fBTk_ClassCreateProc\fR( + Tk_Window \fItkwin\fR, + Window \fIparent\fR, + ClientData \fIinstanceData\fR); +.CE +The \fItkwin\fR and \fIinstanceData\fR parameters will be identical to +the \fItkwin\fR and \fIinstanceData\fR parameters passed to +\fBTk_SetClassProcs\fR. The \fIparent\fR parameter will be the parent +of the window to be created. The \fIcreateProc\fR should return the +created window. +.PP +\fImodalProc\fR is invoked after all bindings on a widget have been +triggered in order to handle a modal loop. \fImodalProc\fR should +have arguments and results that match the type \fBTk_ClassModalProc\fR: +.CS +typedef void \fBTk_ClassModalProc\fR( + Tk_Window \fItkwin\fR, + XEvent *\fIeventPtr\fR); +.CE +The \fItkwin\fR parameter to \fImodalProc\fR will be identical to the +\fItkwin\fR parameter passed to \fBTk_SetClassProcs\fR. The +\fIeventPtr\fR parameter will be a pointer to an XEvent structure +describing the event being processed. +.SH KEYWORDS +callback, class diff --git a/doc/SetGrid.3 b/doc/SetGrid.3 index ee8a231..57efb97 100644 --- a/doc/SetGrid.3 +++ b/doc/SetGrid.3 @@ -1,65 +1,65 @@ -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: SetGrid.3,v 1.3 2008/06/30 22:57:02 dkf Exp $ -'\" -.so man.macros -.TH Tk_SetGrid 3 4.0 Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_SetGrid, Tk_UnsetGrid \- control the grid for interactive resizing -.SH SYNOPSIS -.nf -\fB#include \fR -.sp -\fBTk_SetGrid\fR(\fItkwin, reqWidth, reqHeight, widthInc, heightInc\fR) -.sp -\fBTk_UnsetGrid\fR(\fItkwin\fR) -.SH ARGUMENTS -.AS Tk_Window heightInc -.AP Tk_Window tkwin in -Token for window. -.AP int reqWidth in -Width in grid units that corresponds to the pixel dimension \fItkwin\fR -has requested via \fBTk_GeometryRequest\fR. -.AP int reqHeight in -Height in grid units that corresponds to the pixel dimension \fItkwin\fR -has requested via \fBTk_GeometryRequest\fR. -.AP int widthInc in -Width of one grid unit, in pixels. -.AP int heightInc in -Height of one grid unit, in pixels. -.BE -.SH DESCRIPTION -.PP -\fBTk_SetGrid\fR turns on gridded geometry management for \fItkwin\fR's -toplevel window and specifies the geometry of the grid. -\fBTk_SetGrid\fR is typically invoked by a widget when its \fBsetGrid\fR -option is true. -It restricts interactive resizing of \fItkwin\fR's toplevel window so -that the space allocated to the toplevel is equal to its requested -size plus or minus even multiples of \fIwidthInc\fR and \fIheightInc\fR. -Furthermore, the \fIreqWidth\fR and \fIreqHeight\fR values are -passed to the window manager so that it can report the window's -size in grid units during interactive resizes. -If \fItkwin\fR's configuration changes (e.g., the size of a grid unit -changes) then the widget should invoke \fBTk_SetGrid\fR again with the new -information. -.PP -\fBTk_UnsetGrid\fR cancels gridded geometry management for -\fItkwin\fR's toplevel window. -.PP -For each toplevel window there can be at most one internal window -with gridding enabled. -If \fBTk_SetGrid\fR or \fBTk_UnsetGrid\fR is invoked when some -other window is already controlling gridding for \fItkwin\fR's -toplevel, the calls for the new window have no effect. -.PP -See the \fBwm\fR manual entry for additional information on gridded geometry -management. -.SH KEYWORDS -grid, window, window manager +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: SetGrid.3,v 1.4 2008/07/08 22:40:51 patthoyts Exp $ +'\" +.so man.macros +.TH Tk_SetGrid 3 4.0 Tk "Tk Library Procedures" +.BS +.SH NAME +Tk_SetGrid, Tk_UnsetGrid \- control the grid for interactive resizing +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +\fBTk_SetGrid\fR(\fItkwin, reqWidth, reqHeight, widthInc, heightInc\fR) +.sp +\fBTk_UnsetGrid\fR(\fItkwin\fR) +.SH ARGUMENTS +.AS Tk_Window heightInc +.AP Tk_Window tkwin in +Token for window. +.AP int reqWidth in +Width in grid units that corresponds to the pixel dimension \fItkwin\fR +has requested via \fBTk_GeometryRequest\fR. +.AP int reqHeight in +Height in grid units that corresponds to the pixel dimension \fItkwin\fR +has requested via \fBTk_GeometryRequest\fR. +.AP int widthInc in +Width of one grid unit, in pixels. +.AP int heightInc in +Height of one grid unit, in pixels. +.BE +.SH DESCRIPTION +.PP +\fBTk_SetGrid\fR turns on gridded geometry management for \fItkwin\fR's +toplevel window and specifies the geometry of the grid. +\fBTk_SetGrid\fR is typically invoked by a widget when its \fBsetGrid\fR +option is true. +It restricts interactive resizing of \fItkwin\fR's toplevel window so +that the space allocated to the toplevel is equal to its requested +size plus or minus even multiples of \fIwidthInc\fR and \fIheightInc\fR. +Furthermore, the \fIreqWidth\fR and \fIreqHeight\fR values are +passed to the window manager so that it can report the window's +size in grid units during interactive resizes. +If \fItkwin\fR's configuration changes (e.g., the size of a grid unit +changes) then the widget should invoke \fBTk_SetGrid\fR again with the new +information. +.PP +\fBTk_UnsetGrid\fR cancels gridded geometry management for +\fItkwin\fR's toplevel window. +.PP +For each toplevel window there can be at most one internal window +with gridding enabled. +If \fBTk_SetGrid\fR or \fBTk_UnsetGrid\fR is invoked when some +other window is already controlling gridding for \fItkwin\fR's +toplevel, the calls for the new window have no effect. +.PP +See the \fBwm\fR manual entry for additional information on gridded geometry +management. +.SH KEYWORDS +grid, window, window manager diff --git a/doc/bell.n b/doc/bell.n index a7eaa9f..b2cd708 100644 --- a/doc/bell.n +++ b/doc/bell.n @@ -1,34 +1,34 @@ -'\" -*- nroff -*- -'\" -'\" Copyright (c) 1994 The Regents of the University of California. -'\" Copyright (c) 1994-1996 Sun Microsystems, Inc. -'\" Copyright (c) 2000 Ajuba Solutions. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: bell.n,v 1.5 2008/06/30 22:57:02 dkf Exp $ -'\" -.so man.macros -.TH bell n 8.4 Tk "Tk Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -bell \- Ring a display's bell -.SH SYNOPSIS -\fBbell \fR?\fB\-displayof \fIwindow\fR? ?\fB\-nice\fR? -.BE -.SH DESCRIPTION -.PP -This command rings the bell on the display for \fIwindow\fR and -returns an empty string. -If the \fB\-displayof\fR option is omitted, the display of the -application's main window is used by default. -The command uses the current bell-related settings for the display, which -may be modified with programs such as \fBxset\fR. -.PP -If \fB\-nice\fR is not specified, this command also resets the screen saver -for the screen. Some screen savers will ignore this, but others will reset -so that the screen becomes visible again. -.SH KEYWORDS -beep, bell, ring +'\" -*- nroff -*- +'\" +'\" Copyright (c) 1994 The Regents of the University of California. +'\" Copyright (c) 1994-1996 Sun Microsystems, Inc. +'\" Copyright (c) 2000 Ajuba Solutions. +'\" +'\" See the file "license.terms" for information on usage and redistribution +'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. +'\" +'\" RCS: @(#) $Id: bell.n,v 1.6 2008/07/08 22:40:51 patthoyts Exp $ +'\" +.so man.macros +.TH bell n 8.4 Tk "Tk Built-In Commands" +.BS +'\" Note: do not modify the .SH NAME line immediately below! +.SH NAME +bell \- Ring a display's bell +.SH SYNOPSIS +\fBbell \fR?\fB\-displayof \fIwindow\fR? ?\fB\-nice\fR? +.BE +.SH DESCRIPTION +.PP +This command rings the bell on the display for \fIwindow\fR and +returns an empty string. +If the \fB\-displayof\fR option is omitted, the display of the +application's main window is used by default. +The command uses the current bell-related settings for the display, which +may be modified with programs such as \fBxset\fR. +.PP +If \fB\-nice\fR is not specified, this command also resets the screen saver +for the screen. Some screen savers will ignore this, but others will reset +so that the screen becomes visible again. +.SH KEYWORDS +beep, bell, ring diff --git a/doc/bitmap.n b/doc/bitmap.n index 065d0ad..dcb26e6 100644 --- a/doc/bitmap.n +++ b/doc/bitmap.n @@ -1,111 +1,111 @@ -'\" -*- nroff -*- -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: bitmap.n,v 1.3 2008/06/30 22:57:02 dkf Exp $ -'\" -.so man.macros -.TH bitmap n 4.0 Tk "Tk Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -bitmap \- Images that display two colors -.SH SYNOPSIS -\fBimage create bitmap \fR?\fIname\fR? ?\fIoptions\fR? -.BE -.SH DESCRIPTION -.PP -A bitmap is an image whose pixels can display either of two colors -or be transparent. -A bitmap image is defined by four things: a background color, -a foreground color, and two bitmaps, called the \fIsource\fR -and the \fImask\fR. -Each of the bitmaps specifies 0/1 values for a rectangular -array of pixels, and the two bitmaps must have the same -dimensions. -For pixels where the mask is zero, the image displays nothing, -producing a transparent effect. -For other pixels, the image displays the foreground color if -the source data is one and the background color if the source -data is zero. -.SH "CREATING BITMAPS" -.PP -Like all images, bitmaps are created using the \fBimage create\fR -command. -Bitmaps support the following \fIoptions\fR: -.TP -\fB\-background \fIcolor\fR -Specifies a background color for the image in any of the standard -ways accepted by Tk. If this option is set to an empty string -then the background pixels will be transparent. This effect -is achieved by using the source bitmap as the mask bitmap, ignoring -any \fB\-maskdata\fR or \fB\-maskfile\fR options. -.TP -\fB\-data \fIstring\fR -Specifies the contents of the source bitmap as a string. -The string must adhere to X11 bitmap format (e.g., as generated -by the \fBbitmap\fR program). -If both the \fB\-data\fR and \fB\-file\fR options are specified, -the \fB\-data\fR option takes precedence. -.TP -\fB\-file \fIname\fR -\fIname\fR gives the name of a file whose contents define the -source bitmap. -The file must adhere to X11 bitmap format (e.g., as generated -by the \fBbitmap\fR program). -.TP -\fB\-foreground \fIcolor\fR -Specifies a foreground color for the image in any of the standard -ways accepted by Tk. -.TP -\fB\-maskdata \fIstring\fR -Specifies the contents of the mask as a string. -The string must adhere to X11 bitmap format (e.g., as generated -by the \fBbitmap\fR program). -If both the \fB\-maskdata\fR and \fB\-maskfile\fR options are specified, -the \fB\-maskdata\fR option takes precedence. -.TP -\fB\-maskfile \fIname\fR -\fIname\fR gives the name of a file whose contents define the -mask. -The file must adhere to X11 bitmap format (e.g., as generated -by the \fBbitmap\fR program). -.SH "IMAGE COMMAND" -.PP -When a bitmap image is created, Tk also creates a new command -whose name is the same as the image. -This command may be used to invoke various operations -on the image. -It has the following general form: -.CS -\fIimageName option \fR?\fIarg arg ...\fR? -.CE -\fIOption\fR and the \fIarg\fRs -determine the exact behavior of the command. The following -commands are possible for bitmap images: -.TP -\fIimageName \fBcget\fR \fIoption\fR -Returns the current value of the configuration option given -by \fIoption\fR. -\fIOption\fR may have any of the values accepted by the -\fBimage create bitmap\fR command. -.TP -\fIimageName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? -Query or modify the configuration options for the image. -If no \fIoption\fR is specified, returns a list describing all of -the available options for \fIimageName\fR (see \fBTk_ConfigureInfo\fR for -information on the format of this list). If \fIoption\fR is specified -with no \fIvalue\fR, then the command returns a list describing the -one named option (this list will be identical to the corresponding -sublist of the value returned if no \fIoption\fR is specified). If -one or more \fIoption\-value\fR pairs are specified, then the command -modifies the given option(s) to have the given value(s); in -this case the command returns an empty string. -\fIOption\fR may have any of the values accepted by the -\fBimage create bitmap\fR command. -.SH KEYWORDS -bitmap, image +'\" -*- nroff -*- +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: bitmap.n,v 1.4 2008/07/08 22:40:51 patthoyts Exp $ +'\" +.so man.macros +.TH bitmap n 4.0 Tk "Tk Built-In Commands" +.BS +'\" Note: do not modify the .SH NAME line immediately below! +.SH NAME +bitmap \- Images that display two colors +.SH SYNOPSIS +\fBimage create bitmap \fR?\fIname\fR? ?\fIoptions\fR? +.BE +.SH DESCRIPTION +.PP +A bitmap is an image whose pixels can display either of two colors +or be transparent. +A bitmap image is defined by four things: a background color, +a foreground color, and two bitmaps, called the \fIsource\fR +and the \fImask\fR. +Each of the bitmaps specifies 0/1 values for a rectangular +array of pixels, and the two bitmaps must have the same +dimensions. +For pixels where the mask is zero, the image displays nothing, +producing a transparent effect. +For other pixels, the image displays the foreground color if +the source data is one and the background color if the source +data is zero. +.SH "CREATING BITMAPS" +.PP +Like all images, bitmaps are created using the \fBimage create\fR +command. +Bitmaps support the following \fIoptions\fR: +.TP +\fB\-background \fIcolor\fR +Specifies a background color for the image in any of the standard +ways accepted by Tk. If this option is set to an empty string +then the background pixels will be transparent. This effect +is achieved by using the source bitmap as the mask bitmap, ignoring +any \fB\-maskdata\fR or \fB\-maskfile\fR options. +.TP +\fB\-data \fIstring\fR +Specifies the contents of the source bitmap as a string. +The string must adhere to X11 bitmap format (e.g., as generated +by the \fBbitmap\fR program). +If both the \fB\-data\fR and \fB\-file\fR options are specified, +the \fB\-data\fR option takes precedence. +.TP +\fB\-file \fIname\fR +\fIname\fR gives the name of a file whose contents define the +source bitmap. +The file must adhere to X11 bitmap format (e.g., as generated +by the \fBbitmap\fR program). +.TP +\fB\-foreground \fIcolor\fR +Specifies a foreground color for the image in any of the standard +ways accepted by Tk. +.TP +\fB\-maskdata \fIstring\fR +Specifies the contents of the mask as a string. +The string must adhere to X11 bitmap format (e.g., as generated +by the \fBbitmap\fR program). +If both the \fB\-maskdata\fR and \fB\-maskfile\fR options are specified, +the \fB\-maskdata\fR option takes precedence. +.TP +\fB\-maskfile \fIname\fR +\fIname\fR gives the name of a file whose contents define the +mask. +The file must adhere to X11 bitmap format (e.g., as generated +by the \fBbitmap\fR program). +.SH "IMAGE COMMAND" +.PP +When a bitmap image is created, Tk also creates a new command +whose name is the same as the image. +This command may be used to invoke various operations +on the image. +It has the following general form: +.CS +\fIimageName option \fR?\fIarg arg ...\fR? +.CE +\fIOption\fR and the \fIarg\fRs +determine the exact behavior of the command. The following +commands are possible for bitmap images: +.TP +\fIimageName \fBcget\fR \fIoption\fR +Returns the current value of the configuration option given +by \fIoption\fR. +\fIOption\fR may have any of the values accepted by the +\fBimage create bitmap\fR command. +.TP +\fIimageName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? +Query or modify the configuration options for the image. +If no \fIoption\fR is specified, returns a list describing all of +the available options for \fIimageName\fR (see \fBTk_ConfigureInfo\fR for +information on the format of this list). If \fIoption\fR is specified +with no \fIvalue\fR, then the command returns a list describing the +one named option (this list will be identical to the corresponding +sublist of the value returned if no \fIoption\fR is specified). If +one or more \fIoption\-value\fR pairs are specified, then the command +modifies the given option(s) to have the given value(s); in +this case the command returns an empty string. +\fIOption\fR may have any of the values accepted by the +\fBimage create bitmap\fR command. +.SH KEYWORDS +bitmap, image diff --git a/doc/keysyms.n b/doc/keysyms.n index fdd2a5d..6cb530f 100644 --- a/doc/keysyms.n +++ b/doc/keysyms.n @@ -1,928 +1,928 @@ -'\" -*- nroff -*- -'\" -'\" Copyright (c) 1998-2000 by Scriptics Corporation. -'\" All rights reserved. -'\" -'\" RCS: @(#) $Id: keysyms.n,v 1.5 2008/06/30 22:57:02 dkf Exp $ -'\" -'\" -.so man.macros -.TH keysyms n 8.3 Tk "Tk Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -keysyms \- keysyms recognized by Tk -.BE -.SH DESCRIPTION -.PP -Tk recognizes many keysyms when specifying key bindings (e.g. -\fBbind . \fR). The following list enumerates the -keysyms that will be recognized by Tk. Note that not all keysyms will -be valid on all platforms. For example, on Unix systems, the presence -of a particular keysym is dependant on the configuration of the -keyboard modifier map. This list shows keysyms along with their -decimal and hexadecimal values. -.PP -.CS -space 32 0x0020 -exclam 33 0x0021 -quotedbl 34 0x0022 -numbersign 35 0x0023 -dollar 36 0x0024 -percent 37 0x0025 -ampersand 38 0x0026 -quoteright 39 0x0027 -parenleft 40 0x0028 -parenright 41 0x0029 -asterisk 42 0x002a -plus 43 0x002b -comma 44 0x002c -minus 45 0x002d -period 46 0x002e -slash 47 0x002f -0 48 0x0030 -1 49 0x0031 -2 50 0x0032 -3 51 0x0033 -4 52 0x0034 -5 53 0x0035 -6 54 0x0036 -7 55 0x0037 -8 56 0x0038 -9 57 0x0039 -colon 58 0x003a -semicolon 59 0x003b -less 60 0x003c -equal 61 0x003d -greater 62 0x003e -question 63 0x003f -at 64 0x0040 -A 65 0x0041 -B 66 0x0042 -C 67 0x0043 -D 68 0x0044 -E 69 0x0045 -F 70 0x0046 -G 71 0x0047 -H 72 0x0048 -I 73 0x0049 -J 74 0x004a -K 75 0x004b -L 76 0x004c -M 77 0x004d -N 78 0x004e -O 79 0x004f -P 80 0x0050 -Q 81 0x0051 -R 82 0x0052 -S 83 0x0053 -T 84 0x0054 -U 85 0x0055 -V 86 0x0056 -W 87 0x0057 -X 88 0x0058 -Y 89 0x0059 -Z 90 0x005a -bracketleft 91 0x005b -backslash 92 0x005c -bracketright 93 0x005d -asciicircum 94 0x005e -underscore 95 0x005f -quoteleft 96 0x0060 -a 97 0x0061 -b 98 0x0062 -c 99 0x0063 -d 100 0x0064 -e 101 0x0065 -f 102 0x0066 -g 103 0x0067 -h 104 0x0068 -i 105 0x0069 -j 106 0x006a -k 107 0x006b -l 108 0x006c -m 109 0x006d -n 110 0x006e -o 111 0x006f -p 112 0x0070 -q 113 0x0071 -r 114 0x0072 -s 115 0x0073 -t 116 0x0074 -u 117 0x0075 -v 118 0x0076 -w 119 0x0077 -x 120 0x0078 -y 121 0x0079 -z 122 0x007a -braceleft 123 0x007b -bar 124 0x007c -braceright 125 0x007d -asciitilde 126 0x007e -nobreakspace 160 0x00a0 -exclamdown 161 0x00a1 -cent 162 0x00a2 -sterling 163 0x00a3 -currency 164 0x00a4 -yen 165 0x00a5 -brokenbar 166 0x00a6 -section 167 0x00a7 -diaeresis 168 0x00a8 -copyright 169 0x00a9 -ordfeminine 170 0x00aa -guillemotleft 171 0x00ab -notsign 172 0x00ac -hyphen 173 0x00ad -registered 174 0x00ae -macron 175 0x00af -degree 176 0x00b0 -plusminus 177 0x00b1 -twosuperior 178 0x00b2 -threesuperior 179 0x00b3 -acute 180 0x00b4 -mu 181 0x00b5 -paragraph 182 0x00b6 -periodcentered 183 0x00b7 -cedilla 184 0x00b8 -onesuperior 185 0x00b9 -masculine 186 0x00ba -guillemotright 187 0x00bb -onequarter 188 0x00bc -onehalf 189 0x00bd -threequarters 190 0x00be -questiondown 191 0x00bf -Agrave 192 0x00c0 -Aacute 193 0x00c1 -Acircumflex 194 0x00c2 -Atilde 195 0x00c3 -Adiaeresis 196 0x00c4 -Aring 197 0x00c5 -AE 198 0x00c6 -Ccedilla 199 0x00c7 -Egrave 200 0x00c8 -Eacute 201 0x00c9 -Ecircumflex 202 0x00ca -Ediaeresis 203 0x00cb -Igrave 204 0x00cc -Iacute 205 0x00cd -Icircumflex 206 0x00ce -Idiaeresis 207 0x00cf -Eth 208 0x00d0 -Ntilde 209 0x00d1 -Ograve 210 0x00d2 -Oacute 211 0x00d3 -Ocircumflex 212 0x00d4 -Otilde 213 0x00d5 -Odiaeresis 214 0x00d6 -multiply 215 0x00d7 -Ooblique 216 0x00d8 -Ugrave 217 0x00d9 -Uacute 218 0x00da -Ucircumflex 219 0x00db -Udiaeresis 220 0x00dc -Yacute 221 0x00dd -Thorn 222 0x00de -ssharp 223 0x00df -agrave 224 0x00e0 -aacute 225 0x00e1 -acircumflex 226 0x00e2 -atilde 227 0x00e3 -adiaeresis 228 0x00e4 -aring 229 0x00e5 -ae 230 0x00e6 -ccedilla 231 0x00e7 -egrave 232 0x00e8 -eacute 233 0x00e9 -ecircumflex 234 0x00ea -ediaeresis 235 0x00eb -igrave 236 0x00ec -iacute 237 0x00ed -icircumflex 238 0x00ee -idiaeresis 239 0x00ef -eth 240 0x00f0 -ntilde 241 0x00f1 -ograve 242 0x00f2 -oacute 243 0x00f3 -ocircumflex 244 0x00f4 -otilde 245 0x00f5 -odiaeresis 246 0x00f6 -division 247 0x00f7 -oslash 248 0x00f8 -ugrave 249 0x00f9 -uacute 250 0x00fa -ucircumflex 251 0x00fb -udiaeresis 252 0x00fc -yacute 253 0x00fd -thorn 254 0x00fe -ydiaeresis 255 0x00ff -Aogonek 417 0x01a1 -breve 418 0x01a2 -Lstroke 419 0x01a3 -Lcaron 421 0x01a5 -Sacute 422 0x01a6 -Scaron 425 0x01a9 -Scedilla 426 0x01aa -Tcaron 427 0x01ab -Zacute 428 0x01ac -.CE -.CS -Zcaron 430 0x01ae -Zabovedot 431 0x01af -aogonek 433 0x01b1 -ogonek 434 0x01b2 -lstroke 435 0x01b3 -lcaron 437 0x01b5 -sacute 438 0x01b6 -caron 439 0x01b7 -scaron 441 0x01b9 -scedilla 442 0x01ba -tcaron 443 0x01bb -zacute 444 0x01bc -doubleacute 445 0x01bd -zcaron 446 0x01be -zabovedot 447 0x01bf -Racute 448 0x01c0 -Abreve 451 0x01c3 -Cacute 454 0x01c6 -Ccaron 456 0x01c8 -Eogonek 458 0x01ca -Ecaron 460 0x01cc -Dcaron 463 0x01cf -Nacute 465 0x01d1 -Ncaron 466 0x01d2 -Odoubleacute 469 0x01d5 -Rcaron 472 0x01d8 -Uring 473 0x01d9 -Udoubleacute 475 0x01db -Tcedilla 478 0x01de -racute 480 0x01e0 -abreve 483 0x01e3 -cacute 486 0x01e6 -ccaron 488 0x01e8 -eogonek 490 0x01ea -ecaron 492 0x01ec -dcaron 495 0x01ef -nacute 497 0x01f1 -ncaron 498 0x01f2 -odoubleacute 501 0x01f5 -rcaron 504 0x01f8 -uring 505 0x01f9 -udoubleacute 507 0x01fb -tcedilla 510 0x01fe -abovedot 511 0x01ff -Hstroke 673 0x02a1 -Hcircumflex 678 0x02a6 -Iabovedot 681 0x02a9 -Gbreve 683 0x02ab -Jcircumflex 684 0x02ac -hstroke 689 0x02b1 -hcircumflex 694 0x02b6 -idotless 697 0x02b9 -gbreve 699 0x02bb -jcircumflex 700 0x02bc -Cabovedot 709 0x02c5 -Ccircumflex 710 0x02c6 -Gabovedot 725 0x02d5 -Gcircumflex 728 0x02d8 -Ubreve 733 0x02dd -Scircumflex 734 0x02de -cabovedot 741 0x02e5 -ccircumflex 742 0x02e6 -gabovedot 757 0x02f5 -gcircumflex 760 0x02f8 -ubreve 765 0x02fd -scircumflex 766 0x02fe -kappa 930 0x03a2 -Rcedilla 931 0x03a3 -Itilde 933 0x03a5 -Lcedilla 934 0x03a6 -Emacron 938 0x03aa -Gcedilla 939 0x03ab -Tslash 940 0x03ac -rcedilla 947 0x03b3 -itilde 949 0x03b5 -lcedilla 950 0x03b6 -emacron 954 0x03ba -gacute 955 0x03bb -tslash 956 0x03bc -ENG 957 0x03bd -eng 959 0x03bf -Amacron 960 0x03c0 -Iogonek 967 0x03c7 -Eabovedot 972 0x03cc -Imacron 975 0x03cf -Ncedilla 977 0x03d1 -Omacron 978 0x03d2 -Kcedilla 979 0x03d3 -Uogonek 985 0x03d9 -Utilde 989 0x03dd -Umacron 990 0x03de -amacron 992 0x03e0 -iogonek 999 0x03e7 -eabovedot 1004 0x03ec -imacron 1007 0x03ef -ncedilla 1009 0x03f1 -omacron 1010 0x03f2 -kcedilla 1011 0x03f3 -uogonek 1017 0x03f9 -utilde 1021 0x03fd -umacron 1022 0x03fe -overline 1150 0x047e -kana_fullstop 1185 0x04a1 -kana_openingbracket 1186 0x04a2 -kana_closingbracket 1187 0x04a3 -kana_comma 1188 0x04a4 -kana_middledot 1189 0x04a5 -kana_WO 1190 0x04a6 -kana_a 1191 0x04a7 -kana_i 1192 0x04a8 -kana_u 1193 0x04a9 -kana_e 1194 0x04aa -kana_o 1195 0x04ab -kana_ya 1196 0x04ac -kana_yu 1197 0x04ad -kana_yo 1198 0x04ae -kana_tu 1199 0x04af -prolongedsound 1200 0x04b0 -kana_A 1201 0x04b1 -kana_I 1202 0x04b2 -kana_U 1203 0x04b3 -kana_E 1204 0x04b4 -kana_O 1205 0x04b5 -kana_KA 1206 0x04b6 -kana_KI 1207 0x04b7 -kana_KU 1208 0x04b8 -kana_KE 1209 0x04b9 -kana_KO 1210 0x04ba -kana_SA 1211 0x04bb -kana_SHI 1212 0x04bc -kana_SU 1213 0x04bd -kana_SE 1214 0x04be -kana_SO 1215 0x04bf -kana_TA 1216 0x04c0 -kana_TI 1217 0x04c1 -kana_TU 1218 0x04c2 -kana_TE 1219 0x04c3 -kana_TO 1220 0x04c4 -kana_NA 1221 0x04c5 -kana_NI 1222 0x04c6 -kana_NU 1223 0x04c7 -kana_NE 1224 0x04c8 -kana_NO 1225 0x04c9 -kana_HA 1226 0x04ca -kana_HI 1227 0x04cb -kana_HU 1228 0x04cc -kana_HE 1229 0x04cd -kana_HO 1230 0x04ce -kana_MA 1231 0x04cf -kana_MI 1232 0x04d0 -kana_MU 1233 0x04d1 -kana_ME 1234 0x04d2 -kana_MO 1235 0x04d3 -kana_YA 1236 0x04d4 -kana_YU 1237 0x04d5 -kana_YO 1238 0x04d6 -kana_RA 1239 0x04d7 -kana_RI 1240 0x04d8 -kana_RU 1241 0x04d9 -kana_RE 1242 0x04da -kana_RO 1243 0x04db -kana_WA 1244 0x04dc -kana_N 1245 0x04dd -voicedsound 1246 0x04de -semivoicedsound 1247 0x04df -Arabic_comma 1452 0x05ac -Arabic_semicolon 1467 0x05bb -Arabic_question_mark 1471 0x05bf -Arabic_hamza 1473 0x05c1 -Arabic_maddaonalef 1474 0x05c2 -Arabic_hamzaonalef 1475 0x05c3 -Arabic_hamzaonwaw 1476 0x05c4 -Arabic_hamzaunderalef 1477 0x05c5 -Arabic_hamzaonyeh 1478 0x05c6 -Arabic_alef 1479 0x05c7 -Arabic_beh 1480 0x05c8 -Arabic_tehmarbuta 1481 0x05c9 -Arabic_teh 1482 0x05ca -Arabic_theh 1483 0x05cb -Arabic_jeem 1484 0x05cc -Arabic_hah 1485 0x05cd -Arabic_khah 1486 0x05ce -Arabic_dal 1487 0x05cf -Arabic_thal 1488 0x05d0 -Arabic_ra 1489 0x05d1 -Arabic_zain 1490 0x05d2 -Arabic_seen 1491 0x05d3 -Arabic_sheen 1492 0x05d4 -Arabic_sad 1493 0x05d5 -Arabic_dad 1494 0x05d6 -Arabic_tah 1495 0x05d7 -Arabic_zah 1496 0x05d8 -Arabic_ain 1497 0x05d9 -Arabic_ghain 1498 0x05da -Arabic_tatweel 1504 0x05e0 -Arabic_feh 1505 0x05e1 -Arabic_qaf 1506 0x05e2 -Arabic_kaf 1507 0x05e3 -Arabic_lam 1508 0x05e4 -Arabic_meem 1509 0x05e5 -.CE -.CS -Arabic_noon 1510 0x05e6 -Arabic_heh 1511 0x05e7 -Arabic_waw 1512 0x05e8 -Arabic_alefmaksura 1513 0x05e9 -Arabic_yeh 1514 0x05ea -Arabic_fathatan 1515 0x05eb -Arabic_dammatan 1516 0x05ec -Arabic_kasratan 1517 0x05ed -Arabic_fatha 1518 0x05ee -Arabic_damma 1519 0x05ef -Arabic_kasra 1520 0x05f0 -Arabic_shadda 1521 0x05f1 -Arabic_sukun 1522 0x05f2 -Serbian_dje 1697 0x06a1 -Macedonia_gje 1698 0x06a2 -Cyrillic_io 1699 0x06a3 -Ukranian_je 1700 0x06a4 -Macedonia_dse 1701 0x06a5 -Ukranian_i 1702 0x06a6 -Ukranian_yi 1703 0x06a7 -Serbian_je 1704 0x06a8 -Serbian_lje 1705 0x06a9 -Serbian_nje 1706 0x06aa -Serbian_tshe 1707 0x06ab -Macedonia_kje 1708 0x06ac -Byelorussian_shortu 1710 0x06ae -Serbian_dze 1711 0x06af -numerosign 1712 0x06b0 -Serbian_DJE 1713 0x06b1 -Macedonia_GJE 1714 0x06b2 -Cyrillic_IO 1715 0x06b3 -Ukranian_JE 1716 0x06b4 -Macedonia_DSE 1717 0x06b5 -Ukranian_I 1718 0x06b6 -Ukranian_YI 1719 0x06b7 -Serbian_JE 1720 0x06b8 -Serbian_LJE 1721 0x06b9 -Serbian_NJE 1722 0x06ba -Serbian_TSHE 1723 0x06bb -Macedonia_KJE 1724 0x06bc -Byelorussian_SHORTU 1726 0x06be -Serbian_DZE 1727 0x06bf -Cyrillic_yu 1728 0x06c0 -Cyrillic_a 1729 0x06c1 -Cyrillic_be 1730 0x06c2 -Cyrillic_tse 1731 0x06c3 -Cyrillic_de 1732 0x06c4 -Cyrillic_ie 1733 0x06c5 -Cyrillic_ef 1734 0x06c6 -Cyrillic_ghe 1735 0x06c7 -Cyrillic_ha 1736 0x06c8 -Cyrillic_i 1737 0x06c9 -Cyrillic_shorti 1738 0x06ca -Cyrillic_ka 1739 0x06cb -Cyrillic_el 1740 0x06cc -Cyrillic_em 1741 0x06cd -Cyrillic_en 1742 0x06ce -Cyrillic_o 1743 0x06cf -Cyrillic_pe 1744 0x06d0 -Cyrillic_ya 1745 0x06d1 -Cyrillic_er 1746 0x06d2 -Cyrillic_es 1747 0x06d3 -Cyrillic_te 1748 0x06d4 -Cyrillic_u 1749 0x06d5 -Cyrillic_zhe 1750 0x06d6 -Cyrillic_ve 1751 0x06d7 -Cyrillic_softsign 1752 0x06d8 -Cyrillic_yeru 1753 0x06d9 -Cyrillic_ze 1754 0x06da -Cyrillic_sha 1755 0x06db -Cyrillic_e 1756 0x06dc -Cyrillic_shcha 1757 0x06dd -Cyrillic_che 1758 0x06de -Cyrillic_hardsign 1759 0x06df -Cyrillic_YU 1760 0x06e0 -Cyrillic_A 1761 0x06e1 -Cyrillic_BE 1762 0x06e2 -Cyrillic_TSE 1763 0x06e3 -Cyrillic_DE 1764 0x06e4 -Cyrillic_IE 1765 0x06e5 -Cyrillic_EF 1766 0x06e6 -Cyrillic_GHE 1767 0x06e7 -Cyrillic_HA 1768 0x06e8 -Cyrillic_I 1769 0x06e9 -Cyrillic_SHORTI 1770 0x06ea -Cyrillic_KA 1771 0x06eb -Cyrillic_EL 1772 0x06ec -Cyrillic_EM 1773 0x06ed -Cyrillic_EN 1774 0x06ee -Cyrillic_O 1775 0x06ef -Cyrillic_PE 1776 0x06f0 -Cyrillic_YA 1777 0x06f1 -Cyrillic_ER 1778 0x06f2 -Cyrillic_ES 1779 0x06f3 -Cyrillic_TE 1780 0x06f4 -Cyrillic_U 1781 0x06f5 -Cyrillic_ZHE 1782 0x06f6 -Cyrillic_VE 1783 0x06f7 -Cyrillic_SOFTSIGN 1784 0x06f8 -Cyrillic_YERU 1785 0x06f9 -Cyrillic_ZE 1786 0x06fa -Cyrillic_SHA 1787 0x06fb -Cyrillic_E 1788 0x06fc -Cyrillic_SHCHA 1789 0x06fd -Cyrillic_CHE 1790 0x06fe -Cyrillic_HARDSIGN 1791 0x06ff -Greek_ALPHAaccent 1953 0x07a1 -Greek_EPSILONaccent 1954 0x07a2 -Greek_ETAaccent 1955 0x07a3 -Greek_IOTAaccent 1956 0x07a4 -Greek_IOTAdiaeresis 1957 0x07a5 -Greek_IOTAaccentdiaeresis 1958 0x07a6 -Greek_OMICRONaccent 1959 0x07a7 -Greek_UPSILONaccent 1960 0x07a8 -Greek_UPSILONdieresis 1961 0x07a9 -Greek_UPSILONaccentdieresis 1962 0x07aa -Greek_OMEGAaccent 1963 0x07ab -Greek_alphaaccent 1969 0x07b1 -Greek_epsilonaccent 1970 0x07b2 -Greek_etaaccent 1971 0x07b3 -Greek_iotaaccent 1972 0x07b4 -Greek_iotadieresis 1973 0x07b5 -Greek_iotaaccentdieresis 1974 0x07b6 -Greek_omicronaccent 1975 0x07b7 -Greek_upsilonaccent 1976 0x07b8 -Greek_upsilondieresis 1977 0x07b9 -Greek_upsilonaccentdieresis 1978 0x07ba -Greek_omegaaccent 1979 0x07bb -Greek_ALPHA 1985 0x07c1 -Greek_BETA 1986 0x07c2 -Greek_GAMMA 1987 0x07c3 -Greek_DELTA 1988 0x07c4 -Greek_EPSILON 1989 0x07c5 -Greek_ZETA 1990 0x07c6 -Greek_ETA 1991 0x07c7 -Greek_THETA 1992 0x07c8 -Greek_IOTA 1993 0x07c9 -Greek_KAPPA 1994 0x07ca -Greek_LAMBDA 1995 0x07cb -Greek_MU 1996 0x07cc -Greek_NU 1997 0x07cd -Greek_XI 1998 0x07ce -Greek_OMICRON 1999 0x07cf -Greek_PI 2000 0x07d0 -Greek_RHO 2001 0x07d1 -Greek_SIGMA 2002 0x07d2 -Greek_TAU 2004 0x07d4 -Greek_UPSILON 2005 0x07d5 -Greek_PHI 2006 0x07d6 -Greek_CHI 2007 0x07d7 -Greek_PSI 2008 0x07d8 -Greek_OMEGA 2009 0x07d9 -Greek_alpha 2017 0x07e1 -Greek_beta 2018 0x07e2 -Greek_gamma 2019 0x07e3 -Greek_delta 2020 0x07e4 -Greek_epsilon 2021 0x07e5 -Greek_zeta 2022 0x07e6 -Greek_eta 2023 0x07e7 -Greek_theta 2024 0x07e8 -Greek_iota 2025 0x07e9 -Greek_kappa 2026 0x07ea -Greek_lambda 2027 0x07eb -Greek_mu 2028 0x07ec -Greek_nu 2029 0x07ed -Greek_xi 2030 0x07ee -Greek_omicron 2031 0x07ef -Greek_pi 2032 0x07f0 -Greek_rho 2033 0x07f1 -Greek_sigma 2034 0x07f2 -Greek_finalsmallsigma 2035 0x07f3 -Greek_tau 2036 0x07f4 -Greek_upsilon 2037 0x07f5 -Greek_phi 2038 0x07f6 -Greek_chi 2039 0x07f7 -Greek_psi 2040 0x07f8 -Greek_omega 2041 0x07f9 -leftradical 2209 0x08a1 -topleftradical 2210 0x08a2 -horizconnector 2211 0x08a3 -topintegral 2212 0x08a4 -botintegral 2213 0x08a5 -vertconnector 2214 0x08a6 -topleftsqbracket 2215 0x08a7 -botleftsqbracket 2216 0x08a8 -toprightsqbracket 2217 0x08a9 -botrightsqbracket 2218 0x08aa -topleftparens 2219 0x08ab -botleftparens 2220 0x08ac -toprightparens 2221 0x08ad -botrightparens 2222 0x08ae -leftmiddlecurlybrace 2223 0x08af -rightmiddlecurlybrace 2224 0x08b0 -topleftsummation 2225 0x08b1 -botleftsummation 2226 0x08b2 -topvertsummationconnector 2227 0x08b3 -botvertsummationconnector 2228 0x08b4 -toprightsummation 2229 0x08b5 -botrightsummation 2230 0x08b6 -rightmiddlesummation 2231 0x08b7 -.CE -.CS -lessthanequal 2236 0x08bc -notequal 2237 0x08bd -greaterthanequal 2238 0x08be -integral 2239 0x08bf -therefore 2240 0x08c0 -variation 2241 0x08c1 -infinity 2242 0x08c2 -nabla 2245 0x08c5 -approximate 2248 0x08c8 -similarequal 2249 0x08c9 -ifonlyif 2253 0x08cd -implies 2254 0x08ce -identical 2255 0x08cf -radical 2262 0x08d6 -includedin 2266 0x08da -includes 2267 0x08db -intersection 2268 0x08dc -union 2269 0x08dd -logicaland 2270 0x08de -logicalor 2271 0x08df -partialderivative 2287 0x08ef -function 2294 0x08f6 -leftarrow 2299 0x08fb -uparrow 2300 0x08fc -rightarrow 2301 0x08fd -downarrow 2302 0x08fe -blank 2527 0x09df -soliddiamond 2528 0x09e0 -checkerboard 2529 0x09e1 -ht 2530 0x09e2 -ff 2531 0x09e3 -cr 2532 0x09e4 -lf 2533 0x09e5 -nl 2536 0x09e8 -vt 2537 0x09e9 -lowrightcorner 2538 0x09ea -uprightcorner 2539 0x09eb -upleftcorner 2540 0x09ec -lowleftcorner 2541 0x09ed -crossinglines 2542 0x09ee -horizlinescan1 2543 0x09ef -horizlinescan3 2544 0x09f0 -horizlinescan5 2545 0x09f1 -horizlinescan7 2546 0x09f2 -horizlinescan9 2547 0x09f3 -leftt 2548 0x09f4 -rightt 2549 0x09f5 -bott 2550 0x09f6 -topt 2551 0x09f7 -vertbar 2552 0x09f8 -emspace 2721 0x0aa1 -enspace 2722 0x0aa2 -em3space 2723 0x0aa3 -em4space 2724 0x0aa4 -digitspace 2725 0x0aa5 -punctspace 2726 0x0aa6 -thinspace 2727 0x0aa7 -hairspace 2728 0x0aa8 -emdash 2729 0x0aa9 -endash 2730 0x0aaa -signifblank 2732 0x0aac -ellipsis 2734 0x0aae -doubbaselinedot 2735 0x0aaf -onethird 2736 0x0ab0 -twothirds 2737 0x0ab1 -onefifth 2738 0x0ab2 -twofifths 2739 0x0ab3 -threefifths 2740 0x0ab4 -fourfifths 2741 0x0ab5 -onesixth 2742 0x0ab6 -fivesixths 2743 0x0ab7 -careof 2744 0x0ab8 -figdash 2747 0x0abb -leftanglebracket 2748 0x0abc -decimalpoint 2749 0x0abd -rightanglebracket 2750 0x0abe -marker 2751 0x0abf -oneeighth 2755 0x0ac3 -threeeighths 2756 0x0ac4 -fiveeighths 2757 0x0ac5 -seveneighths 2758 0x0ac6 -trademark 2761 0x0ac9 -signaturemark 2762 0x0aca -trademarkincircle 2763 0x0acb -leftopentriangle 2764 0x0acc -rightopentriangle 2765 0x0acd -emopencircle 2766 0x0ace -emopenrectangle 2767 0x0acf -leftsinglequotemark 2768 0x0ad0 -rightsinglequotemark 2769 0x0ad1 -leftdoublequotemark 2770 0x0ad2 -rightdoublequotemark 2771 0x0ad3 -prescription 2772 0x0ad4 -minutes 2774 0x0ad6 -seconds 2775 0x0ad7 -latincross 2777 0x0ad9 -hexagram 2778 0x0ada -filledrectbullet 2779 0x0adb -filledlefttribullet 2780 0x0adc -filledrighttribullet 2781 0x0add -emfilledcircle 2782 0x0ade -emfilledrect 2783 0x0adf -enopencircbullet 2784 0x0ae0 -enopensquarebullet 2785 0x0ae1 -openrectbullet 2786 0x0ae2 -opentribulletup 2787 0x0ae3 -opentribulletdown 2788 0x0ae4 -openstar 2789 0x0ae5 -enfilledcircbullet 2790 0x0ae6 -enfilledsqbullet 2791 0x0ae7 -filledtribulletup 2792 0x0ae8 -filledtribulletdown 2793 0x0ae9 -leftpointer 2794 0x0aea -rightpointer 2795 0x0aeb -club 2796 0x0aec -diamond 2797 0x0aed -heart 2798 0x0aee -maltesecross 2800 0x0af0 -dagger 2801 0x0af1 -doubledagger 2802 0x0af2 -checkmark 2803 0x0af3 -ballotcross 2804 0x0af4 -musicalsharp 2805 0x0af5 -musicalflat 2806 0x0af6 -malesymbol 2807 0x0af7 -femalesymbol 2808 0x0af8 -telephone 2809 0x0af9 -telephonerecorder 2810 0x0afa -phonographcopyright 2811 0x0afb -caret 2812 0x0afc -singlelowquotemark 2813 0x0afd -doublelowquotemark 2814 0x0afe -cursor 2815 0x0aff -leftcaret 2979 0x0ba3 -rightcaret 2982 0x0ba6 -downcaret 2984 0x0ba8 -upcaret 2985 0x0ba9 -overbar 3008 0x0bc0 -downtack 3010 0x0bc2 -upshoe 3011 0x0bc3 -downstile 3012 0x0bc4 -underbar 3014 0x0bc6 -jot 3018 0x0bca -quad 3020 0x0bcc -uptack 3022 0x0bce -circle 3023 0x0bcf -upstile 3027 0x0bd3 -downshoe 3030 0x0bd6 -rightshoe 3032 0x0bd8 -leftshoe 3034 0x0bda -lefttack 3036 0x0bdc -righttack 3068 0x0bfc -hebrew_aleph 3296 0x0ce0 -hebrew_beth 3297 0x0ce1 -hebrew_gimmel 3298 0x0ce2 -hebrew_daleth 3299 0x0ce3 -hebrew_he 3300 0x0ce4 -hebrew_waw 3301 0x0ce5 -hebrew_zayin 3302 0x0ce6 -hebrew_het 3303 0x0ce7 -hebrew_teth 3304 0x0ce8 -hebrew_yod 3305 0x0ce9 -hebrew_finalkaph 3306 0x0cea -hebrew_kaph 3307 0x0ceb -hebrew_lamed 3308 0x0cec -hebrew_finalmem 3309 0x0ced -hebrew_mem 3310 0x0cee -hebrew_finalnun 3311 0x0cef -hebrew_nun 3312 0x0cf0 -hebrew_samekh 3313 0x0cf1 -hebrew_ayin 3314 0x0cf2 -hebrew_finalpe 3315 0x0cf3 -hebrew_pe 3316 0x0cf4 -hebrew_finalzadi 3317 0x0cf5 -hebrew_zadi 3318 0x0cf6 -hebrew_kuf 3319 0x0cf7 -hebrew_resh 3320 0x0cf8 -hebrew_shin 3321 0x0cf9 -hebrew_taf 3322 0x0cfa -BackSpace 65288 0xff08 -Tab 65289 0xff09 -Linefeed 65290 0xff0a -Clear 65291 0xff0b -Return 65293 0xff0d -Pause 65299 0xff13 -Scroll_Lock 65300 0xff14 -Sys_Req 65301 0xff15 -Escape 65307 0xff1b -Multi_key 65312 0xff20 -Kanji 65313 0xff21 -Home 65360 0xff50 -Left 65361 0xff51 -Up 65362 0xff52 -Right 65363 0xff53 -Down 65364 0xff54 -Prior 65365 0xff55 -Next 65366 0xff56 -End 65367 0xff57 -Begin 65368 0xff58 -Win_L 65371 0xff5b -Win_R 65372 0xff5c -.CE -.CS -App 65373 0xff5d -Select 65376 0xff60 -Print 65377 0xff61 -Execute 65378 0xff62 -Insert 65379 0xff63 -Undo 65381 0xff65 -Redo 65382 0xff66 -Menu 65383 0xff67 -Find 65384 0xff68 -Cancel 65385 0xff69 -Help 65386 0xff6a -Break 65387 0xff6b -Hebrew_switch 65406 0xff7e -Num_Lock 65407 0xff7f -KP_Space 65408 0xff80 -KP_Tab 65417 0xff89 -KP_Enter 65421 0xff8d -KP_F1 65425 0xff91 -KP_F2 65426 0xff92 -KP_F3 65427 0xff93 -KP_F4 65428 0xff94 -KP_Multiply 65450 0xffaa -KP_Add 65451 0xffab -KP_Separator 65452 0xffac -KP_Subtract 65453 0xffad -KP_Decimal 65454 0xffae -KP_Divide 65455 0xffaf -KP_0 65456 0xffb0 -KP_1 65457 0xffb1 -KP_2 65458 0xffb2 -KP_3 65459 0xffb3 -KP_4 65460 0xffb4 -KP_5 65461 0xffb5 -KP_6 65462 0xffb6 -KP_7 65463 0xffb7 -KP_8 65464 0xffb8 -KP_9 65465 0xffb9 -KP_Equal 65469 0xffbd -F1 65470 0xffbe -F2 65471 0xffbf -F3 65472 0xffc0 -F4 65473 0xffc1 -F5 65474 0xffc2 -F6 65475 0xffc3 -F7 65476 0xffc4 -F8 65477 0xffc5 -F9 65478 0xffc6 -F10 65479 0xffc7 -L1 65480 0xffc8 -L2 65481 0xffc9 -L3 65482 0xffca -L4 65483 0xffcb -L5 65484 0xffcc -L6 65485 0xffcd -L7 65486 0xffce -L8 65487 0xffcf -L9 65488 0xffd0 -L10 65489 0xffd1 -R1 65490 0xffd2 -R2 65491 0xffd3 -R3 65492 0xffd4 -R4 65493 0xffd5 -R5 65494 0xffd6 -R6 65495 0xffd7 -R7 65496 0xffd8 -R8 65497 0xffd9 -R9 65498 0xffda -R10 65499 0xffdb -R11 65500 0xffdc -R12 65501 0xffdd -F33 65502 0xffde -R14 65503 0xffdf -R15 65504 0xffe0 -Shift_L 65505 0xffe1 -Shift_R 65506 0xffe2 -Control_L 65507 0xffe3 -Control_R 65508 0xffe4 -Caps_Lock 65509 0xffe5 -Shift_Lock 65510 0xffe6 -Meta_L 65511 0xffe7 -Meta_R 65512 0xffe8 -Alt_L 65513 0xffe9 -Alt_R 65514 0xffea -Super_L 65515 0xffeb -Super_R 65516 0xffec -Hyper_L 65517 0xffed -Hyper_R 65518 0xffee -Delete 65535 0xffff -.CE -.SH "SEE ALSO" -bind -.SH KEYWORDS -keysym, bind, binding +'\" -*- nroff -*- +'\" +'\" Copyright (c) 1998-2000 by Scriptics Corporation. +'\" All rights reserved. +'\" +'\" RCS: @(#) $Id: keysyms.n,v 1.6 2008/07/08 22:40:51 patthoyts Exp $ +'\" +'\" +.so man.macros +.TH keysyms n 8.3 Tk "Tk Built-In Commands" +.BS +'\" Note: do not modify the .SH NAME line immediately below! +.SH NAME +keysyms \- keysyms recognized by Tk +.BE +.SH DESCRIPTION +.PP +Tk recognizes many keysyms when specifying key bindings (e.g. +\fBbind . \fR). The following list enumerates the +keysyms that will be recognized by Tk. Note that not all keysyms will +be valid on all platforms. For example, on Unix systems, the presence +of a particular keysym is dependant on the configuration of the +keyboard modifier map. This list shows keysyms along with their +decimal and hexadecimal values. +.PP +.CS +space 32 0x0020 +exclam 33 0x0021 +quotedbl 34 0x0022 +numbersign 35 0x0023 +dollar 36 0x0024 +percent 37 0x0025 +ampersand 38 0x0026 +quoteright 39 0x0027 +parenleft 40 0x0028 +parenright 41 0x0029 +asterisk 42 0x002a +plus 43 0x002b +comma 44 0x002c +minus 45 0x002d +period 46 0x002e +slash 47 0x002f +0 48 0x0030 +1 49 0x0031 +2 50 0x0032 +3 51 0x0033 +4 52 0x0034 +5 53 0x0035 +6 54 0x0036 +7 55 0x0037 +8 56 0x0038 +9 57 0x0039 +colon 58 0x003a +semicolon 59 0x003b +less 60 0x003c +equal 61 0x003d +greater 62 0x003e +question 63 0x003f +at 64 0x0040 +A 65 0x0041 +B 66 0x0042 +C 67 0x0043 +D 68 0x0044 +E 69 0x0045 +F 70 0x0046 +G 71 0x0047 +H 72 0x0048 +I 73 0x0049 +J 74 0x004a +K 75 0x004b +L 76 0x004c +M 77 0x004d +N 78 0x004e +O 79 0x004f +P 80 0x0050 +Q 81 0x0051 +R 82 0x0052 +S 83 0x0053 +T 84 0x0054 +U 85 0x0055 +V 86 0x0056 +W 87 0x0057 +X 88 0x0058 +Y 89 0x0059 +Z 90 0x005a +bracketleft 91 0x005b +backslash 92 0x005c +bracketright 93 0x005d +asciicircum 94 0x005e +underscore 95 0x005f +quoteleft 96 0x0060 +a 97 0x0061 +b 98 0x0062 +c 99 0x0063 +d 100 0x0064 +e 101 0x0065 +f 102 0x0066 +g 103 0x0067 +h 104 0x0068 +i 105 0x0069 +j 106 0x006a +k 107 0x006b +l 108 0x006c +m 109 0x006d +n 110 0x006e +o 111 0x006f +p 112 0x0070 +q 113 0x0071 +r 114 0x0072 +s 115 0x0073 +t 116 0x0074 +u 117 0x0075 +v 118 0x0076 +w 119 0x0077 +x 120 0x0078 +y 121 0x0079 +z 122 0x007a +braceleft 123 0x007b +bar 124 0x007c +braceright 125 0x007d +asciitilde 126 0x007e +nobreakspace 160 0x00a0 +exclamdown 161 0x00a1 +cent 162 0x00a2 +sterling 163 0x00a3 +currency 164 0x00a4 +yen 165 0x00a5 +brokenbar 166 0x00a6 +section 167 0x00a7 +diaeresis 168 0x00a8 +copyright 169 0x00a9 +ordfeminine 170 0x00aa +guillemotleft 171 0x00ab +notsign 172 0x00ac +hyphen 173 0x00ad +registered 174 0x00ae +macron 175 0x00af +degree 176 0x00b0 +plusminus 177 0x00b1 +twosuperior 178 0x00b2 +threesuperior 179 0x00b3 +acute 180 0x00b4 +mu 181 0x00b5 +paragraph 182 0x00b6 +periodcentered 183 0x00b7 +cedilla 184 0x00b8 +onesuperior 185 0x00b9 +masculine 186 0x00ba +guillemotright 187 0x00bb +onequarter 188 0x00bc +onehalf 189 0x00bd +threequarters 190 0x00be +questiondown 191 0x00bf +Agrave 192 0x00c0 +Aacute 193 0x00c1 +Acircumflex 194 0x00c2 +Atilde 195 0x00c3 +Adiaeresis 196 0x00c4 +Aring 197 0x00c5 +AE 198 0x00c6 +Ccedilla 199 0x00c7 +Egrave 200 0x00c8 +Eacute 201 0x00c9 +Ecircumflex 202 0x00ca +Ediaeresis 203 0x00cb +Igrave 204 0x00cc +Iacute 205 0x00cd +Icircumflex 206 0x00ce +Idiaeresis 207 0x00cf +Eth 208 0x00d0 +Ntilde 209 0x00d1 +Ograve 210 0x00d2 +Oacute 211 0x00d3 +Ocircumflex 212 0x00d4 +Otilde 213 0x00d5 +Odiaeresis 214 0x00d6 +multiply 215 0x00d7 +Ooblique 216 0x00d8 +Ugrave 217 0x00d9 +Uacute 218 0x00da +Ucircumflex 219 0x00db +Udiaeresis 220 0x00dc +Yacute 221 0x00dd +Thorn 222 0x00de +ssharp 223 0x00df +agrave 224 0x00e0 +aacute 225 0x00e1 +acircumflex 226 0x00e2 +atilde 227 0x00e3 +adiaeresis 228 0x00e4 +aring 229 0x00e5 +ae 230 0x00e6 +ccedilla 231 0x00e7 +egrave 232 0x00e8 +eacute 233 0x00e9 +ecircumflex 234 0x00ea +ediaeresis 235 0x00eb +igrave 236 0x00ec +iacute 237 0x00ed +icircumflex 238 0x00ee +idiaeresis 239 0x00ef +eth 240 0x00f0 +ntilde 241 0x00f1 +ograve 242 0x00f2 +oacute 243 0x00f3 +ocircumflex 244 0x00f4 +otilde 245 0x00f5 +odiaeresis 246 0x00f6 +division 247 0x00f7 +oslash 248 0x00f8 +ugrave 249 0x00f9 +uacute 250 0x00fa +ucircumflex 251 0x00fb +udiaeresis 252 0x00fc +yacute 253 0x00fd +thorn 254 0x00fe +ydiaeresis 255 0x00ff +Aogonek 417 0x01a1 +breve 418 0x01a2 +Lstroke 419 0x01a3 +Lcaron 421 0x01a5 +Sacute 422 0x01a6 +Scaron 425 0x01a9 +Scedilla 426 0x01aa +Tcaron 427 0x01ab +Zacute 428 0x01ac +.CE +.CS +Zcaron 430 0x01ae +Zabovedot 431 0x01af +aogonek 433 0x01b1 +ogonek 434 0x01b2 +lstroke 435 0x01b3 +lcaron 437 0x01b5 +sacute 438 0x01b6 +caron 439 0x01b7 +scaron 441 0x01b9 +scedilla 442 0x01ba +tcaron 443 0x01bb +zacute 444 0x01bc +doubleacute 445 0x01bd +zcaron 446 0x01be +zabovedot 447 0x01bf +Racute 448 0x01c0 +Abreve 451 0x01c3 +Cacute 454 0x01c6 +Ccaron 456 0x01c8 +Eogonek 458 0x01ca +Ecaron 460 0x01cc +Dcaron 463 0x01cf +Nacute 465 0x01d1 +Ncaron 466 0x01d2 +Odoubleacute 469 0x01d5 +Rcaron 472 0x01d8 +Uring 473 0x01d9 +Udoubleacute 475 0x01db +Tcedilla 478 0x01de +racute 480 0x01e0 +abreve 483 0x01e3 +cacute 486 0x01e6 +ccaron 488 0x01e8 +eogonek 490 0x01ea +ecaron 492 0x01ec +dcaron 495 0x01ef +nacute 497 0x01f1 +ncaron 498 0x01f2 +odoubleacute 501 0x01f5 +rcaron 504 0x01f8 +uring 505 0x01f9 +udoubleacute 507 0x01fb +tcedilla 510 0x01fe +abovedot 511 0x01ff +Hstroke 673 0x02a1 +Hcircumflex 678 0x02a6 +Iabovedot 681 0x02a9 +Gbreve 683 0x02ab +Jcircumflex 684 0x02ac +hstroke 689 0x02b1 +hcircumflex 694 0x02b6 +idotless 697 0x02b9 +gbreve 699 0x02bb +jcircumflex 700 0x02bc +Cabovedot 709 0x02c5 +Ccircumflex 710 0x02c6 +Gabovedot 725 0x02d5 +Gcircumflex 728 0x02d8 +Ubreve 733 0x02dd +Scircumflex 734 0x02de +cabovedot 741 0x02e5 +ccircumflex 742 0x02e6 +gabovedot 757 0x02f5 +gcircumflex 760 0x02f8 +ubreve 765 0x02fd +scircumflex 766 0x02fe +kappa 930 0x03a2 +Rcedilla 931 0x03a3 +Itilde 933 0x03a5 +Lcedilla 934 0x03a6 +Emacron 938 0x03aa +Gcedilla 939 0x03ab +Tslash 940 0x03ac +rcedilla 947 0x03b3 +itilde 949 0x03b5 +lcedilla 950 0x03b6 +emacron 954 0x03ba +gacute 955 0x03bb +tslash 956 0x03bc +ENG 957 0x03bd +eng 959 0x03bf +Amacron 960 0x03c0 +Iogonek 967 0x03c7 +Eabovedot 972 0x03cc +Imacron 975 0x03cf +Ncedilla 977 0x03d1 +Omacron 978 0x03d2 +Kcedilla 979 0x03d3 +Uogonek 985 0x03d9 +Utilde 989 0x03dd +Umacron 990 0x03de +amacron 992 0x03e0 +iogonek 999 0x03e7 +eabovedot 1004 0x03ec +imacron 1007 0x03ef +ncedilla 1009 0x03f1 +omacron 1010 0x03f2 +kcedilla 1011 0x03f3 +uogonek 1017 0x03f9 +utilde 1021 0x03fd +umacron 1022 0x03fe +overline 1150 0x047e +kana_fullstop 1185 0x04a1 +kana_openingbracket 1186 0x04a2 +kana_closingbracket 1187 0x04a3 +kana_comma 1188 0x04a4 +kana_middledot 1189 0x04a5 +kana_WO 1190 0x04a6 +kana_a 1191 0x04a7 +kana_i 1192 0x04a8 +kana_u 1193 0x04a9 +kana_e 1194 0x04aa +kana_o 1195 0x04ab +kana_ya 1196 0x04ac +kana_yu 1197 0x04ad +kana_yo 1198 0x04ae +kana_tu 1199 0x04af +prolongedsound 1200 0x04b0 +kana_A 1201 0x04b1 +kana_I 1202 0x04b2 +kana_U 1203 0x04b3 +kana_E 1204 0x04b4 +kana_O 1205 0x04b5 +kana_KA 1206 0x04b6 +kana_KI 1207 0x04b7 +kana_KU 1208 0x04b8 +kana_KE 1209 0x04b9 +kana_KO 1210 0x04ba +kana_SA 1211 0x04bb +kana_SHI 1212 0x04bc +kana_SU 1213 0x04bd +kana_SE 1214 0x04be +kana_SO 1215 0x04bf +kana_TA 1216 0x04c0 +kana_TI 1217 0x04c1 +kana_TU 1218 0x04c2 +kana_TE 1219 0x04c3 +kana_TO 1220 0x04c4 +kana_NA 1221 0x04c5 +kana_NI 1222 0x04c6 +kana_NU 1223 0x04c7 +kana_NE 1224 0x04c8 +kana_NO 1225 0x04c9 +kana_HA 1226 0x04ca +kana_HI 1227 0x04cb +kana_HU 1228 0x04cc +kana_HE 1229 0x04cd +kana_HO 1230 0x04ce +kana_MA 1231 0x04cf +kana_MI 1232 0x04d0 +kana_MU 1233 0x04d1 +kana_ME 1234 0x04d2 +kana_MO 1235 0x04d3 +kana_YA 1236 0x04d4 +kana_YU 1237 0x04d5 +kana_YO 1238 0x04d6 +kana_RA 1239 0x04d7 +kana_RI 1240 0x04d8 +kana_RU 1241 0x04d9 +kana_RE 1242 0x04da +kana_RO 1243 0x04db +kana_WA 1244 0x04dc +kana_N 1245 0x04dd +voicedsound 1246 0x04de +semivoicedsound 1247 0x04df +Arabic_comma 1452 0x05ac +Arabic_semicolon 1467 0x05bb +Arabic_question_mark 1471 0x05bf +Arabic_hamza 1473 0x05c1 +Arabic_maddaonalef 1474 0x05c2 +Arabic_hamzaonalef 1475 0x05c3 +Arabic_hamzaonwaw 1476 0x05c4 +Arabic_hamzaunderalef 1477 0x05c5 +Arabic_hamzaonyeh 1478 0x05c6 +Arabic_alef 1479 0x05c7 +Arabic_beh 1480 0x05c8 +Arabic_tehmarbuta 1481 0x05c9 +Arabic_teh 1482 0x05ca +Arabic_theh 1483 0x05cb +Arabic_jeem 1484 0x05cc +Arabic_hah 1485 0x05cd +Arabic_khah 1486 0x05ce +Arabic_dal 1487 0x05cf +Arabic_thal 1488 0x05d0 +Arabic_ra 1489 0x05d1 +Arabic_zain 1490 0x05d2 +Arabic_seen 1491 0x05d3 +Arabic_sheen 1492 0x05d4 +Arabic_sad 1493 0x05d5 +Arabic_dad 1494 0x05d6 +Arabic_tah 1495 0x05d7 +Arabic_zah 1496 0x05d8 +Arabic_ain 1497 0x05d9 +Arabic_ghain 1498 0x05da +Arabic_tatweel 1504 0x05e0 +Arabic_feh 1505 0x05e1 +Arabic_qaf 1506 0x05e2 +Arabic_kaf 1507 0x05e3 +Arabic_lam 1508 0x05e4 +Arabic_meem 1509 0x05e5 +.CE +.CS +Arabic_noon 1510 0x05e6 +Arabic_heh 1511 0x05e7 +Arabic_waw 1512 0x05e8 +Arabic_alefmaksura 1513 0x05e9 +Arabic_yeh 1514 0x05ea +Arabic_fathatan 1515 0x05eb +Arabic_dammatan 1516 0x05ec +Arabic_kasratan 1517 0x05ed +Arabic_fatha 1518 0x05ee +Arabic_damma 1519 0x05ef +Arabic_kasra 1520 0x05f0 +Arabic_shadda 1521 0x05f1 +Arabic_sukun 1522 0x05f2 +Serbian_dje 1697 0x06a1 +Macedonia_gje 1698 0x06a2 +Cyrillic_io 1699 0x06a3 +Ukranian_je 1700 0x06a4 +Macedonia_dse 1701 0x06a5 +Ukranian_i 1702 0x06a6 +Ukranian_yi 1703 0x06a7 +Serbian_je 1704 0x06a8 +Serbian_lje 1705 0x06a9 +Serbian_nje 1706 0x06aa +Serbian_tshe 1707 0x06ab +Macedonia_kje 1708 0x06ac +Byelorussian_shortu 1710 0x06ae +Serbian_dze 1711 0x06af +numerosign 1712 0x06b0 +Serbian_DJE 1713 0x06b1 +Macedonia_GJE 1714 0x06b2 +Cyrillic_IO 1715 0x06b3 +Ukranian_JE 1716 0x06b4 +Macedonia_DSE 1717 0x06b5 +Ukranian_I 1718 0x06b6 +Ukranian_YI 1719 0x06b7 +Serbian_JE 1720 0x06b8 +Serbian_LJE 1721 0x06b9 +Serbian_NJE 1722 0x06ba +Serbian_TSHE 1723 0x06bb +Macedonia_KJE 1724 0x06bc +Byelorussian_SHORTU 1726 0x06be +Serbian_DZE 1727 0x06bf +Cyrillic_yu 1728 0x06c0 +Cyrillic_a 1729 0x06c1 +Cyrillic_be 1730 0x06c2 +Cyrillic_tse 1731 0x06c3 +Cyrillic_de 1732 0x06c4 +Cyrillic_ie 1733 0x06c5 +Cyrillic_ef 1734 0x06c6 +Cyrillic_ghe 1735 0x06c7 +Cyrillic_ha 1736 0x06c8 +Cyrillic_i 1737 0x06c9 +Cyrillic_shorti 1738 0x06ca +Cyrillic_ka 1739 0x06cb +Cyrillic_el 1740 0x06cc +Cyrillic_em 1741 0x06cd +Cyrillic_en 1742 0x06ce +Cyrillic_o 1743 0x06cf +Cyrillic_pe 1744 0x06d0 +Cyrillic_ya 1745 0x06d1 +Cyrillic_er 1746 0x06d2 +Cyrillic_es 1747 0x06d3 +Cyrillic_te 1748 0x06d4 +Cyrillic_u 1749 0x06d5 +Cyrillic_zhe 1750 0x06d6 +Cyrillic_ve 1751 0x06d7 +Cyrillic_softsign 1752 0x06d8 +Cyrillic_yeru 1753 0x06d9 +Cyrillic_ze 1754 0x06da +Cyrillic_sha 1755 0x06db +Cyrillic_e 1756 0x06dc +Cyrillic_shcha 1757 0x06dd +Cyrillic_che 1758 0x06de +Cyrillic_hardsign 1759 0x06df +Cyrillic_YU 1760 0x06e0 +Cyrillic_A 1761 0x06e1 +Cyrillic_BE 1762 0x06e2 +Cyrillic_TSE 1763 0x06e3 +Cyrillic_DE 1764 0x06e4 +Cyrillic_IE 1765 0x06e5 +Cyrillic_EF 1766 0x06e6 +Cyrillic_GHE 1767 0x06e7 +Cyrillic_HA 1768 0x06e8 +Cyrillic_I 1769 0x06e9 +Cyrillic_SHORTI 1770 0x06ea +Cyrillic_KA 1771 0x06eb +Cyrillic_EL 1772 0x06ec +Cyrillic_EM 1773 0x06ed +Cyrillic_EN 1774 0x06ee +Cyrillic_O 1775 0x06ef +Cyrillic_PE 1776 0x06f0 +Cyrillic_YA 1777 0x06f1 +Cyrillic_ER 1778 0x06f2 +Cyrillic_ES 1779 0x06f3 +Cyrillic_TE 1780 0x06f4 +Cyrillic_U 1781 0x06f5 +Cyrillic_ZHE 1782 0x06f6 +Cyrillic_VE 1783 0x06f7 +Cyrillic_SOFTSIGN 1784 0x06f8 +Cyrillic_YERU 1785 0x06f9 +Cyrillic_ZE 1786 0x06fa +Cyrillic_SHA 1787 0x06fb +Cyrillic_E 1788 0x06fc +Cyrillic_SHCHA 1789 0x06fd +Cyrillic_CHE 1790 0x06fe +Cyrillic_HARDSIGN 1791 0x06ff +Greek_ALPHAaccent 1953 0x07a1 +Greek_EPSILONaccent 1954 0x07a2 +Greek_ETAaccent 1955 0x07a3 +Greek_IOTAaccent 1956 0x07a4 +Greek_IOTAdiaeresis 1957 0x07a5 +Greek_IOTAaccentdiaeresis 1958 0x07a6 +Greek_OMICRONaccent 1959 0x07a7 +Greek_UPSILONaccent 1960 0x07a8 +Greek_UPSILONdieresis 1961 0x07a9 +Greek_UPSILONaccentdieresis 1962 0x07aa +Greek_OMEGAaccent 1963 0x07ab +Greek_alphaaccent 1969 0x07b1 +Greek_epsilonaccent 1970 0x07b2 +Greek_etaaccent 1971 0x07b3 +Greek_iotaaccent 1972 0x07b4 +Greek_iotadieresis 1973 0x07b5 +Greek_iotaaccentdieresis 1974 0x07b6 +Greek_omicronaccent 1975 0x07b7 +Greek_upsilonaccent 1976 0x07b8 +Greek_upsilondieresis 1977 0x07b9 +Greek_upsilonaccentdieresis 1978 0x07ba +Greek_omegaaccent 1979 0x07bb +Greek_ALPHA 1985 0x07c1 +Greek_BETA 1986 0x07c2 +Greek_GAMMA 1987 0x07c3 +Greek_DELTA 1988 0x07c4 +Greek_EPSILON 1989 0x07c5 +Greek_ZETA 1990 0x07c6 +Greek_ETA 1991 0x07c7 +Greek_THETA 1992 0x07c8 +Greek_IOTA 1993 0x07c9 +Greek_KAPPA 1994 0x07ca +Greek_LAMBDA 1995 0x07cb +Greek_MU 1996 0x07cc +Greek_NU 1997 0x07cd +Greek_XI 1998 0x07ce +Greek_OMICRON 1999 0x07cf +Greek_PI 2000 0x07d0 +Greek_RHO 2001 0x07d1 +Greek_SIGMA 2002 0x07d2 +Greek_TAU 2004 0x07d4 +Greek_UPSILON 2005 0x07d5 +Greek_PHI 2006 0x07d6 +Greek_CHI 2007 0x07d7 +Greek_PSI 2008 0x07d8 +Greek_OMEGA 2009 0x07d9 +Greek_alpha 2017 0x07e1 +Greek_beta 2018 0x07e2 +Greek_gamma 2019 0x07e3 +Greek_delta 2020 0x07e4 +Greek_epsilon 2021 0x07e5 +Greek_zeta 2022 0x07e6 +Greek_eta 2023 0x07e7 +Greek_theta 2024 0x07e8 +Greek_iota 2025 0x07e9 +Greek_kappa 2026 0x07ea +Greek_lambda 2027 0x07eb +Greek_mu 2028 0x07ec +Greek_nu 2029 0x07ed +Greek_xi 2030 0x07ee +Greek_omicron 2031 0x07ef +Greek_pi 2032 0x07f0 +Greek_rho 2033 0x07f1 +Greek_sigma 2034 0x07f2 +Greek_finalsmallsigma 2035 0x07f3 +Greek_tau 2036 0x07f4 +Greek_upsilon 2037 0x07f5 +Greek_phi 2038 0x07f6 +Greek_chi 2039 0x07f7 +Greek_psi 2040 0x07f8 +Greek_omega 2041 0x07f9 +leftradical 2209 0x08a1 +topleftradical 2210 0x08a2 +horizconnector 2211 0x08a3 +topintegral 2212 0x08a4 +botintegral 2213 0x08a5 +vertconnector 2214 0x08a6 +topleftsqbracket 2215 0x08a7 +botleftsqbracket 2216 0x08a8 +toprightsqbracket 2217 0x08a9 +botrightsqbracket 2218 0x08aa +topleftparens 2219 0x08ab +botleftparens 2220 0x08ac +toprightparens 2221 0x08ad +botrightparens 2222 0x08ae +leftmiddlecurlybrace 2223 0x08af +rightmiddlecurlybrace 2224 0x08b0 +topleftsummation 2225 0x08b1 +botleftsummation 2226 0x08b2 +topvertsummationconnector 2227 0x08b3 +botvertsummationconnector 2228 0x08b4 +toprightsummation 2229 0x08b5 +botrightsummation 2230 0x08b6 +rightmiddlesummation 2231 0x08b7 +.CE +.CS +lessthanequal 2236 0x08bc +notequal 2237 0x08bd +greaterthanequal 2238 0x08be +integral 2239 0x08bf +therefore 2240 0x08c0 +variation 2241 0x08c1 +infinity 2242 0x08c2 +nabla 2245 0x08c5 +approximate 2248 0x08c8 +similarequal 2249 0x08c9 +ifonlyif 2253 0x08cd +implies 2254 0x08ce +identical 2255 0x08cf +radical 2262 0x08d6 +includedin 2266 0x08da +includes 2267 0x08db +intersection 2268 0x08dc +union 2269 0x08dd +logicaland 2270 0x08de +logicalor 2271 0x08df +partialderivative 2287 0x08ef +function 2294 0x08f6 +leftarrow 2299 0x08fb +uparrow 2300 0x08fc +rightarrow 2301 0x08fd +downarrow 2302 0x08fe +blank 2527 0x09df +soliddiamond 2528 0x09e0 +checkerboard 2529 0x09e1 +ht 2530 0x09e2 +ff 2531 0x09e3 +cr 2532 0x09e4 +lf 2533 0x09e5 +nl 2536 0x09e8 +vt 2537 0x09e9 +lowrightcorner 2538 0x09ea +uprightcorner 2539 0x09eb +upleftcorner 2540 0x09ec +lowleftcorner 2541 0x09ed +crossinglines 2542 0x09ee +horizlinescan1 2543 0x09ef +horizlinescan3 2544 0x09f0 +horizlinescan5 2545 0x09f1 +horizlinescan7 2546 0x09f2 +horizlinescan9 2547 0x09f3 +leftt 2548 0x09f4 +rightt 2549 0x09f5 +bott 2550 0x09f6 +topt 2551 0x09f7 +vertbar 2552 0x09f8 +emspace 2721 0x0aa1 +enspace 2722 0x0aa2 +em3space 2723 0x0aa3 +em4space 2724 0x0aa4 +digitspace 2725 0x0aa5 +punctspace 2726 0x0aa6 +thinspace 2727 0x0aa7 +hairspace 2728 0x0aa8 +emdash 2729 0x0aa9 +endash 2730 0x0aaa +signifblank 2732 0x0aac +ellipsis 2734 0x0aae +doubbaselinedot 2735 0x0aaf +onethird 2736 0x0ab0 +twothirds 2737 0x0ab1 +onefifth 2738 0x0ab2 +twofifths 2739 0x0ab3 +threefifths 2740 0x0ab4 +fourfifths 2741 0x0ab5 +onesixth 2742 0x0ab6 +fivesixths 2743 0x0ab7 +careof 2744 0x0ab8 +figdash 2747 0x0abb +leftanglebracket 2748 0x0abc +decimalpoint 2749 0x0abd +rightanglebracket 2750 0x0abe +marker 2751 0x0abf +oneeighth 2755 0x0ac3 +threeeighths 2756 0x0ac4 +fiveeighths 2757 0x0ac5 +seveneighths 2758 0x0ac6 +trademark 2761 0x0ac9 +signaturemark 2762 0x0aca +trademarkincircle 2763 0x0acb +leftopentriangle 2764 0x0acc +rightopentriangle 2765 0x0acd +emopencircle 2766 0x0ace +emopenrectangle 2767 0x0acf +leftsinglequotemark 2768 0x0ad0 +rightsinglequotemark 2769 0x0ad1 +leftdoublequotemark 2770 0x0ad2 +rightdoublequotemark 2771 0x0ad3 +prescription 2772 0x0ad4 +minutes 2774 0x0ad6 +seconds 2775 0x0ad7 +latincross 2777 0x0ad9 +hexagram 2778 0x0ada +filledrectbullet 2779 0x0adb +filledlefttribullet 2780 0x0adc +filledrighttribullet 2781 0x0add +emfilledcircle 2782 0x0ade +emfilledrect 2783 0x0adf +enopencircbullet 2784 0x0ae0 +enopensquarebullet 2785 0x0ae1 +openrectbullet 2786 0x0ae2 +opentribulletup 2787 0x0ae3 +opentribulletdown 2788 0x0ae4 +openstar 2789 0x0ae5 +enfilledcircbullet 2790 0x0ae6 +enfilledsqbullet 2791 0x0ae7 +filledtribulletup 2792 0x0ae8 +filledtribulletdown 2793 0x0ae9 +leftpointer 2794 0x0aea +rightpointer 2795 0x0aeb +club 2796 0x0aec +diamond 2797 0x0aed +heart 2798 0x0aee +maltesecross 2800 0x0af0 +dagger 2801 0x0af1 +doubledagger 2802 0x0af2 +checkmark 2803 0x0af3 +ballotcross 2804 0x0af4 +musicalsharp 2805 0x0af5 +musicalflat 2806 0x0af6 +malesymbol 2807 0x0af7 +femalesymbol 2808 0x0af8 +telephone 2809 0x0af9 +telephonerecorder 2810 0x0afa +phonographcopyright 2811 0x0afb +caret 2812 0x0afc +singlelowquotemark 2813 0x0afd +doublelowquotemark 2814 0x0afe +cursor 2815 0x0aff +leftcaret 2979 0x0ba3 +rightcaret 2982 0x0ba6 +downcaret 2984 0x0ba8 +upcaret 2985 0x0ba9 +overbar 3008 0x0bc0 +downtack 3010 0x0bc2 +upshoe 3011 0x0bc3 +downstile 3012 0x0bc4 +underbar 3014 0x0bc6 +jot 3018 0x0bca +quad 3020 0x0bcc +uptack 3022 0x0bce +circle 3023 0x0bcf +upstile 3027 0x0bd3 +downshoe 3030 0x0bd6 +rightshoe 3032 0x0bd8 +leftshoe 3034 0x0bda +lefttack 3036 0x0bdc +righttack 3068 0x0bfc +hebrew_aleph 3296 0x0ce0 +hebrew_beth 3297 0x0ce1 +hebrew_gimmel 3298 0x0ce2 +hebrew_daleth 3299 0x0ce3 +hebrew_he 3300 0x0ce4 +hebrew_waw 3301 0x0ce5 +hebrew_zayin 3302 0x0ce6 +hebrew_het 3303 0x0ce7 +hebrew_teth 3304 0x0ce8 +hebrew_yod 3305 0x0ce9 +hebrew_finalkaph 3306 0x0cea +hebrew_kaph 3307 0x0ceb +hebrew_lamed 3308 0x0cec +hebrew_finalmem 3309 0x0ced +hebrew_mem 3310 0x0cee +hebrew_finalnun 3311 0x0cef +hebrew_nun 3312 0x0cf0 +hebrew_samekh 3313 0x0cf1 +hebrew_ayin 3314 0x0cf2 +hebrew_finalpe 3315 0x0cf3 +hebrew_pe 3316 0x0cf4 +hebrew_finalzadi 3317 0x0cf5 +hebrew_zadi 3318 0x0cf6 +hebrew_kuf 3319 0x0cf7 +hebrew_resh 3320 0x0cf8 +hebrew_shin 3321 0x0cf9 +hebrew_taf 3322 0x0cfa +BackSpace 65288 0xff08 +Tab 65289 0xff09 +Linefeed 65290 0xff0a +Clear 65291 0xff0b +Return 65293 0xff0d +Pause 65299 0xff13 +Scroll_Lock 65300 0xff14 +Sys_Req 65301 0xff15 +Escape 65307 0xff1b +Multi_key 65312 0xff20 +Kanji 65313 0xff21 +Home 65360 0xff50 +Left 65361 0xff51 +Up 65362 0xff52 +Right 65363 0xff53 +Down 65364 0xff54 +Prior 65365 0xff55 +Next 65366 0xff56 +End 65367 0xff57 +Begin 65368 0xff58 +Win_L 65371 0xff5b +Win_R 65372 0xff5c +.CE +.CS +App 65373 0xff5d +Select 65376 0xff60 +Print 65377 0xff61 +Execute 65378 0xff62 +Insert 65379 0xff63 +Undo 65381 0xff65 +Redo 65382 0xff66 +Menu 65383 0xff67 +Find 65384 0xff68 +Cancel 65385 0xff69 +Help 65386 0xff6a +Break 65387 0xff6b +Hebrew_switch 65406 0xff7e +Num_Lock 65407 0xff7f +KP_Space 65408 0xff80 +KP_Tab 65417 0xff89 +KP_Enter 65421 0xff8d +KP_F1 65425 0xff91 +KP_F2 65426 0xff92 +KP_F3 65427 0xff93 +KP_F4 65428 0xff94 +KP_Multiply 65450 0xffaa +KP_Add 65451 0xffab +KP_Separator 65452 0xffac +KP_Subtract 65453 0xffad +KP_Decimal 65454 0xffae +KP_Divide 65455 0xffaf +KP_0 65456 0xffb0 +KP_1 65457 0xffb1 +KP_2 65458 0xffb2 +KP_3 65459 0xffb3 +KP_4 65460 0xffb4 +KP_5 65461 0xffb5 +KP_6 65462 0xffb6 +KP_7 65463 0xffb7 +KP_8 65464 0xffb8 +KP_9 65465 0xffb9 +KP_Equal 65469 0xffbd +F1 65470 0xffbe +F2 65471 0xffbf +F3 65472 0xffc0 +F4 65473 0xffc1 +F5 65474 0xffc2 +F6 65475 0xffc3 +F7 65476 0xffc4 +F8 65477 0xffc5 +F9 65478 0xffc6 +F10 65479 0xffc7 +L1 65480 0xffc8 +L2 65481 0xffc9 +L3 65482 0xffca +L4 65483 0xffcb +L5 65484 0xffcc +L6 65485 0xffcd +L7 65486 0xffce +L8 65487 0xffcf +L9 65488 0xffd0 +L10 65489 0xffd1 +R1 65490 0xffd2 +R2 65491 0xffd3 +R3 65492 0xffd4 +R4 65493 0xffd5 +R5 65494 0xffd6 +R6 65495 0xffd7 +R7 65496 0xffd8 +R8 65497 0xffd9 +R9 65498 0xffda +R10 65499 0xffdb +R11 65500 0xffdc +R12 65501 0xffdd +F33 65502 0xffde +R14 65503 0xffdf +R15 65504 0xffe0 +Shift_L 65505 0xffe1 +Shift_R 65506 0xffe2 +Control_L 65507 0xffe3 +Control_R 65508 0xffe4 +Caps_Lock 65509 0xffe5 +Shift_Lock 65510 0xffe6 +Meta_L 65511 0xffe7 +Meta_R 65512 0xffe8 +Alt_L 65513 0xffe9 +Alt_R 65514 0xffea +Super_L 65515 0xffeb +Super_R 65516 0xffec +Hyper_L 65517 0xffed +Hyper_R 65518 0xffee +Delete 65535 0xffff +.CE +.SH "SEE ALSO" +bind +.SH KEYWORDS +keysym, bind, binding diff --git a/doc/lower.n b/doc/lower.n index 6e77207..4c404cc 100644 --- a/doc/lower.n +++ b/doc/lower.n @@ -1,36 +1,36 @@ -'\" -*- nroff -*- -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: lower.n,v 1.3 2008/06/30 22:57:03 dkf Exp $ -'\" -.so man.macros -.TH lower n 3.3 Tk "Tk Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -lower \- Change a window's position in the stacking order -.SH SYNOPSIS -\fBlower \fIwindow \fR?\fIbelowThis\fR? -.BE -.SH DESCRIPTION -.PP -If the \fIbelowThis\fR argument is omitted then the command lowers -\fIwindow\fR so that it is below all of its siblings in the stacking -order (it will be obscured by any siblings that overlap it and -will not obscure any siblings). -If \fIbelowThis\fR is specified then it must be the path name of -a window that is either a sibling of \fIwindow\fR or the descendant -of a sibling of \fIwindow\fR. -In this case the \fBlower\fR command will insert -\fIwindow\fR into the stacking order just below \fIbelowThis\fR -(or the ancestor of \fIbelowThis\fR that is a sibling of \fIwindow\fR); -this could end up either raising or lowering \fIwindow\fR. -.SH "SEE ALSO" -raise -.SH KEYWORDS -lower, obscure, stacking order +'\" -*- nroff -*- +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: lower.n,v 1.4 2008/07/08 22:40:51 patthoyts Exp $ +'\" +.so man.macros +.TH lower n 3.3 Tk "Tk Built-In Commands" +.BS +'\" Note: do not modify the .SH NAME line immediately below! +.SH NAME +lower \- Change a window's position in the stacking order +.SH SYNOPSIS +\fBlower \fIwindow \fR?\fIbelowThis\fR? +.BE +.SH DESCRIPTION +.PP +If the \fIbelowThis\fR argument is omitted then the command lowers +\fIwindow\fR so that it is below all of its siblings in the stacking +order (it will be obscured by any siblings that overlap it and +will not obscure any siblings). +If \fIbelowThis\fR is specified then it must be the path name of +a window that is either a sibling of \fIwindow\fR or the descendant +of a sibling of \fIwindow\fR. +In this case the \fBlower\fR command will insert +\fIwindow\fR into the stacking order just below \fIbelowThis\fR +(or the ancestor of \fIbelowThis\fR that is a sibling of \fIwindow\fR); +this could end up either raising or lowering \fIwindow\fR. +.SH "SEE ALSO" +raise +.SH KEYWORDS +lower, obscure, stacking order diff --git a/doc/menubar.n b/doc/menubar.n index bb7c1a8..f7ca645 100644 --- a/doc/menubar.n +++ b/doc/menubar.n @@ -1,38 +1,38 @@ -'\" -*- nroff -*- -'\" -'\" Copyright (c) 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. -'\" -'\" RCS: @(#) $Id: menubar.n,v 1.4 2008/06/30 22:57:03 dkf Exp $ -'\" -.so man.macros -.TH tk_menuBar n "" Tk "Tk Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -tk_menuBar, tk_bindForTraversal \- Obsolete support for menu bars -.SH SYNOPSIS -\fBtk_menuBar \fIframe \fR?\fImenu menu ...\fR? -.sp -\fBtk_bindForTraversal \fIarg arg ... \fR -.BE -.SH DESCRIPTION -.PP -These procedures were used in Tk 3.6 and earlier releases to help -manage pulldown menus and to implement keyboard traversal of menus. -In Tk 4.0 and later releases they are no -longer needed. Stubs for these procedures have been retained for -backward compatibility, but they have no effect. You should remove -calls to these procedures from your code, since eventually the -procedures will go away. -.PP -From Tk 8.0 onwards, you should instead construct your menubar as a -normal \fBmenu\fR and then attach it to the \fBtoplevel\fR of your -choice using the \fB\-menu\fR option of that widget. -.SH "SEE ALSO" -menu(n), toplevel(n) -.SH KEYWORDS -keyboard traversal, menu, menu bar, post +'\" -*- nroff -*- +'\" +'\" Copyright (c) 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. +'\" +'\" RCS: @(#) $Id: menubar.n,v 1.5 2008/07/08 22:40:51 patthoyts Exp $ +'\" +.so man.macros +.TH tk_menuBar n "" Tk "Tk Built-In Commands" +.BS +'\" Note: do not modify the .SH NAME line immediately below! +.SH NAME +tk_menuBar, tk_bindForTraversal \- Obsolete support for menu bars +.SH SYNOPSIS +\fBtk_menuBar \fIframe \fR?\fImenu menu ...\fR? +.sp +\fBtk_bindForTraversal \fIarg arg ... \fR +.BE +.SH DESCRIPTION +.PP +These procedures were used in Tk 3.6 and earlier releases to help +manage pulldown menus and to implement keyboard traversal of menus. +In Tk 4.0 and later releases they are no +longer needed. Stubs for these procedures have been retained for +backward compatibility, but they have no effect. You should remove +calls to these procedures from your code, since eventually the +procedures will go away. +.PP +From Tk 8.0 onwards, you should instead construct your menubar as a +normal \fBmenu\fR and then attach it to the \fBtoplevel\fR of your +choice using the \fB\-menu\fR option of that widget. +.SH "SEE ALSO" +menu(n), toplevel(n) +.SH KEYWORDS +keyboard traversal, menu, menu bar, post diff --git a/doc/popup.n b/doc/popup.n index a44917c..a59492c 100644 --- a/doc/popup.n +++ b/doc/popup.n @@ -1,49 +1,49 @@ -'\" -*- nroff -*- -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: popup.n,v 1.5 2008/06/30 22:57:03 dkf Exp $ -'\" -.so man.macros -.TH tk_popup n 4.0 Tk "Tk Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -tk_popup \- Post a popup menu -.SH SYNOPSIS -\fBtk_popup \fImenu x y \fR?\fIentry\fR? -.BE -.SH DESCRIPTION -.PP -This procedure posts a menu at a given position on the screen and -configures Tk so that the menu and its cascaded children can be -traversed with the mouse or the keyboard. -\fIMenu\fR is the name of a menu widget and \fIx\fR and \fIy\fR -are the root coordinates at which to display the menu. -If \fIentry\fR is omitted or an empty string, the -menu's upper left corner is positioned at the given point. -Otherwise \fIentry\fR gives the index of an entry in \fImenu\fR and -the menu will be positioned so that the entry is positioned over -the given point. -.SH EXAMPLE -.PP -How to attach a simple popup menu to a widget. -.CS -# Create a menu -set m [menu .popupMenu] -$m add command \-label "Example 1" \-command bell -$m add command \-label "Example 2" \-command bell - -# Create something to attach it to -pack [label .l \-text "Click me!"] - -# Arrange for the menu to pop up when the label is clicked -bind .l <1> {\fBtk_popup\fR .popupMenu %X %Y} -.CE -.SH "SEE ALSO" -bind(n), menu(n), tk_optionMenu(n) -.SH KEYWORDS -menu, popup +'\" -*- nroff -*- +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: popup.n,v 1.6 2008/07/08 22:40:51 patthoyts Exp $ +'\" +.so man.macros +.TH tk_popup n 4.0 Tk "Tk Built-In Commands" +.BS +'\" Note: do not modify the .SH NAME line immediately below! +.SH NAME +tk_popup \- Post a popup menu +.SH SYNOPSIS +\fBtk_popup \fImenu x y \fR?\fIentry\fR? +.BE +.SH DESCRIPTION +.PP +This procedure posts a menu at a given position on the screen and +configures Tk so that the menu and its cascaded children can be +traversed with the mouse or the keyboard. +\fIMenu\fR is the name of a menu widget and \fIx\fR and \fIy\fR +are the root coordinates at which to display the menu. +If \fIentry\fR is omitted or an empty string, the +menu's upper left corner is positioned at the given point. +Otherwise \fIentry\fR gives the index of an entry in \fImenu\fR and +the menu will be positioned so that the entry is positioned over +the given point. +.SH EXAMPLE +.PP +How to attach a simple popup menu to a widget. +.CS +# Create a menu +set m [menu .popupMenu] +$m add command \-label "Example 1" \-command bell +$m add command \-label "Example 2" \-command bell + +# Create something to attach it to +pack [label .l \-text "Click me!"] + +# Arrange for the menu to pop up when the label is clicked +bind .l <1> {\fBtk_popup\fR .popupMenu %X %Y} +.CE +.SH "SEE ALSO" +bind(n), menu(n), tk_optionMenu(n) +.SH KEYWORDS +menu, popup diff --git a/doc/tkerror.n b/doc/tkerror.n index d57acc9..392aaf9 100644 --- a/doc/tkerror.n +++ b/doc/tkerror.n @@ -1,37 +1,37 @@ -'\" -*- nroff -*- -'\" -'\" 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. -'\" -'\" RCS: @(#) $Id: tkerror.n,v 1.3 2008/06/30 22:57:03 dkf Exp $ -'\" -.so man.macros -.TH tkerror n 4.1 Tk "Tk Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -tkerror \- Command invoked to process background errors -.SH SYNOPSIS -\fBtkerror \fImessage\fR -.BE -.SH DESCRIPTION -.PP -Note: as of Tk 4.1 the \fBtkerror\fR command has been renamed to -\fBbgerror\fR because the event loop (which is what usually invokes -it) is now part of Tcl. For backward compatibility -the \fBbgerror\fR provided by the current Tk version still -tries to call \fBtkerror\fR if there is one (or an auto loadable one), -so old script defining that error handler should still work, but you -should anyhow modify your scripts to use \fBbgerror\fR instead -of \fBtkerror\fR because that support for the old name might vanish -in the near future. If that call fails, \fBbgerror\fR -posts a dialog showing the error and offering to see the stack trace -to the user. If you want your own error management you should -directly override \fBbgerror\fR instead of \fBtkerror\fR. -Documentation for \fBbgerror\fR is available as part of Tcl's -documentation. -.SH KEYWORDS -background error, reporting +'\" -*- nroff -*- +'\" +'\" 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. +'\" +'\" RCS: @(#) $Id: tkerror.n,v 1.4 2008/07/08 22:40:51 patthoyts Exp $ +'\" +.so man.macros +.TH tkerror n 4.1 Tk "Tk Built-In Commands" +.BS +'\" Note: do not modify the .SH NAME line immediately below! +.SH NAME +tkerror \- Command invoked to process background errors +.SH SYNOPSIS +\fBtkerror \fImessage\fR +.BE +.SH DESCRIPTION +.PP +Note: as of Tk 4.1 the \fBtkerror\fR command has been renamed to +\fBbgerror\fR because the event loop (which is what usually invokes +it) is now part of Tcl. For backward compatibility +the \fBbgerror\fR provided by the current Tk version still +tries to call \fBtkerror\fR if there is one (or an auto loadable one), +so old script defining that error handler should still work, but you +should anyhow modify your scripts to use \fBbgerror\fR instead +of \fBtkerror\fR because that support for the old name might vanish +in the near future. If that call fails, \fBbgerror\fR +posts a dialog showing the error and offering to see the stack trace +to the user. If you want your own error management you should +directly override \fBbgerror\fR instead of \fBtkerror\fR. +Documentation for \fBbgerror\fR is available as part of Tcl's +documentation. +.SH KEYWORDS +background error, reporting diff --git a/doc/tkwait.n b/doc/tkwait.n index 33d6426..0ca751c 100644 --- a/doc/tkwait.n +++ b/doc/tkwait.n @@ -1,50 +1,50 @@ -'\" -*- nroff -*- -'\" -'\" Copyright (c) 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. -'\" -'\" RCS: @(#) $Id: tkwait.n,v 1.3 2008/06/30 22:57:03 dkf Exp $ -'\" -.so man.macros -.TH tkwait n "" Tk "Tk Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -tkwait \- Wait for variable to change or window to be destroyed -.SH SYNOPSIS -\fBtkwait variable \fIname\fR -.sp -\fBtkwait visibility \fIname\fR -.sp -\fBtkwait window \fIname\fR -.BE -.SH DESCRIPTION -.PP -The \fBtkwait\fR command waits for one of several things to happen, -then it returns without taking any other actions. -The return value is always an empty string. -If the first argument is \fBvariable\fR (or any abbreviation of -it) then the second argument is the name of a global variable and the -command waits for that variable to be modified. -If the first argument is \fBvisibility\fR (or any abbreviation -of it) then the second argument is the name of a window and the -\fBtkwait\fR command waits for a change in its -visibility state (as indicated by the arrival of a VisibilityNotify -event). This form is typically used to wait for a newly-created -window to appear on the screen before taking some action. -If the first argument is \fBwindow\fR (or any abbreviation -of it) then the second argument is the name of a window and the -\fBtkwait\fR command waits for that window to be destroyed. -This form is typically used to wait for a user to finish interacting -with a dialog box before using the result of that interaction. -.PP -While the \fBtkwait\fR command is waiting it processes events in -the normal fashion, so the application will continue to respond -to user interactions. -If an event handler invokes \fBtkwait\fR again, the nested call -to \fBtkwait\fR must complete before the outer call can complete. -.SH KEYWORDS -variable, visibility, wait, window +'\" -*- nroff -*- +'\" +'\" Copyright (c) 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. +'\" +'\" RCS: @(#) $Id: tkwait.n,v 1.4 2008/07/08 22:40:51 patthoyts Exp $ +'\" +.so man.macros +.TH tkwait n "" Tk "Tk Built-In Commands" +.BS +'\" Note: do not modify the .SH NAME line immediately below! +.SH NAME +tkwait \- Wait for variable to change or window to be destroyed +.SH SYNOPSIS +\fBtkwait variable \fIname\fR +.sp +\fBtkwait visibility \fIname\fR +.sp +\fBtkwait window \fIname\fR +.BE +.SH DESCRIPTION +.PP +The \fBtkwait\fR command waits for one of several things to happen, +then it returns without taking any other actions. +The return value is always an empty string. +If the first argument is \fBvariable\fR (or any abbreviation of +it) then the second argument is the name of a global variable and the +command waits for that variable to be modified. +If the first argument is \fBvisibility\fR (or any abbreviation +of it) then the second argument is the name of a window and the +\fBtkwait\fR command waits for a change in its +visibility state (as indicated by the arrival of a VisibilityNotify +event). This form is typically used to wait for a newly-created +window to appear on the screen before taking some action. +If the first argument is \fBwindow\fR (or any abbreviation +of it) then the second argument is the name of a window and the +\fBtkwait\fR command waits for that window to be destroyed. +This form is typically used to wait for a user to finish interacting +with a dialog box before using the result of that interaction. +.PP +While the \fBtkwait\fR command is waiting it processes events in +the normal fashion, so the application will continue to respond +to user interactions. +If an event handler invokes \fBtkwait\fR again, the nested call +to \fBtkwait\fR must complete before the outer call can complete. +.SH KEYWORDS +variable, visibility, wait, window -- cgit v0.12 From 68b8aff0b661e2087ed2cdcc597bd60c992a3bff Mon Sep 17 00:00:00 2001 From: das Date: Sun, 13 Jul 2008 12:58:02 +0000 Subject: add new NRE files --- macosx/Wish.xcodeproj/project.pbxproj | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/macosx/Wish.xcodeproj/project.pbxproj b/macosx/Wish.xcodeproj/project.pbxproj index 6ecdd4c..65f5195 100644 --- a/macosx/Wish.xcodeproj/project.pbxproj +++ b/macosx/Wish.xcodeproj/project.pbxproj @@ -2085,6 +2085,8 @@ F9A3084E08F2D4F400BAE1AB /* Tcl.framework */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.framework; path = Tcl.framework; sourceTree = BUILT_PRODUCTS_DIR; }; F9A493240CEBF38300B78AE2 /* chanio.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = chanio.test; sourceTree = ""; }; F9D1360A0CDC252C00DBE0B5 /* mclist.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = mclist.tcl; sourceTree = ""; }; + F9E070AE0E2A2BB400B853D2 /* tclNRE.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclNRE.h; sourceTree = ""; }; + F9E070B40E2A2BCC00B853D2 /* NRE.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NRE.test; sourceTree = ""; }; F9ECB1120B26521500A28025 /* pkgIndex.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = pkgIndex.tcl; sourceTree = ""; }; F9ECB1130B26521500A28025 /* platform.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = platform.tcl; sourceTree = ""; }; F9ECB1140B26521500A28025 /* shell.tcl */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = shell.tcl; sourceTree = ""; }; @@ -2141,7 +2143,7 @@ F966C06F08F281DC005CB29B /* Frameworks */, 1AB674ADFE9D54B511CA2CBB /* Products */, ); - comments = "Copyright (c) 2004-2008 Daniel A. Steffen \n\nSee the file \"license.terms\" for information on usage and redistribution of\nthis file, and for a DISCLAIMER OF ALL WARRANTIES.\n\nRCS: @(#) $Id: project.pbxproj,v 1.41 2008/06/12 06:31:11 das Exp $\n"; + comments = "Copyright (c) 2004-2008 Daniel A. Steffen \n\nSee the file \"license.terms\" for information on usage and redistribution of\nthis file, and for a DISCLAIMER OF ALL WARRANTIES.\n\nRCS: @(#) $Id: project.pbxproj,v 1.42 2008/07/13 12:58:02 das Exp $\n"; name = Wish; path = .; sourceTree = SOURCE_ROOT; @@ -3336,6 +3338,7 @@ F96D3F0A08F272A7004A47F5 /* tclMain.c */, F96D3F0B08F272A7004A47F5 /* tclNamesp.c */, F96D3F0C08F272A7004A47F5 /* tclNotify.c */, + F9E070AE0E2A2BB400B853D2 /* tclNRE.h */, F96D3F0D08F272A7004A47F5 /* tclObj.c */, F93599B20DF1F75400E04F67 /* tclOO.c */, F93599B40DF1F75900E04F67 /* tclOO.decls */, @@ -3711,6 +3714,7 @@ F96D439108F272B6004A47F5 /* namespace-old.test */, F96D439208F272B7004A47F5 /* namespace.test */, F96D439308F272B7004A47F5 /* notify.test */, + F9E070B40E2A2BCC00B853D2 /* NRE.test */, F96D439408F272B7004A47F5 /* obj.test */, F93599C80DF1F81900E04F67 /* oo.test */, F96D439508F272B7004A47F5 /* opt.test */, -- cgit v0.12 From f17e0dcfad73ba08f3b53d2b51bb1b729c4731cf Mon Sep 17 00:00:00 2001 From: aniap Date: Tue, 22 Jul 2008 11:39:08 +0000 Subject: Update to tcltest2 --- tests/bell.test | 59 ++++++++++++++++++++++++++++++------------------------ tests/bgerror.test | 47 +++++++++++++++++++++++++------------------ 2 files changed, 61 insertions(+), 45 deletions(-) diff --git a/tests/bell.test b/tests/bell.test index 455eb76..b110619 100644 --- a/tests/bell.test +++ b/tests/bell.test @@ -5,34 +5,42 @@ # Copyright (c) 1998-2000 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: bell.test,v 1.8 2004/05/23 17:34:48 dkf Exp $ +# RCS: @(#) $Id: bell.test,v 1.9 2008/07/22 11:39:08 aniap Exp $ -package require tcltest 2.1 +package require tcltest 2.2 +namespace import ::tcltest::* eval tcltest::configure $argv tcltest::loadTestedCommands -test bell-1.1 {bell command} { - list [catch {bell a} msg] $msg -} {1 {bad option "a": must be -displayof or -nice}} -test bell-1.2 {bell command} { - list [catch {bell a b} msg] $msg -} {1 {bad option "a": must be -displayof or -nice}} -test bell-1.3 {bell command} { - list [catch {bell -displayof gorp} msg] $msg -} {1 {bad window path name "gorp"}} -test bell-1.4 {bell command} { - list [catch {bell -nice -displayof} msg] $msg -} {1 {wrong # args: should be "bell ?-displayof window? ?-nice?"}} -test bell-1.5 {bell command} { - list [catch {bell -nice -nice -nice} msg] $msg -} {0 {}} -test bell-1.6 {bell command} { - list [catch {bell -displayof . -nice} msg] $msg -} {0 {}} -test bell-1.7 {bell command} { - list [catch {bell -nice -displayof . -nice} msg] $msg -} {1 {wrong # args: should be "bell ?-displayof window? ?-nice?"}} -test bell-1.8 {bell command} { +test bell-1.1 {bell command} -body { + bell a +} -returnCodes {error} -result {bad option "a": must be -displayof or -nice} + +test bell-1.2 {bell command} -body { + bell a b +} -returnCodes {error} -result {bad option "a": must be -displayof or -nice} + +test bell-1.3 {bell command} -body { + bell -displayof gorp +} -returnCodes {error} -result {bad window path name "gorp"} + +test bell-1.4 {bell command} -body { + bell -nice -displayof +} -returnCodes {error} -result {wrong # args: should be "bell ?-displayof window? ?-nice?"} + +test bell-1.5 {bell command} -body { + bell -nice -nice -nice +} -returnCodes {ok} -result {} ;#keep -result {} and -retutnCodes {ok} for clarity? + +test bell-1.6 {bell command} -body { + bell -displayof . -nice +} -returnCodes {ok} -result {} + +test bell-1.7 {bell command} -body { + bell -nice -displayof . -nice +} -returnCodes {error} -result {wrong # args: should be "bell ?-displayof window? ?-nice?"} + +test bell-1.8 {bell command} -body { puts "Bell should ring now ..." flush stdout after 200 @@ -41,8 +49,7 @@ test bell-1.8 {bell command} { bell -nice after 200 bell -} {} +} -result {} -# cleanup cleanupTests return diff --git a/tests/bgerror.test b/tests/bgerror.test index 7d35862..6148c71 100644 --- a/tests/bgerror.test +++ b/tests/bgerror.test @@ -5,51 +5,60 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: bgerror.test,v 1.6 2004/05/23 17:34:48 dkf Exp $ +# RCS: @(#) $Id: bgerror.test,v 1.7 2008/07/22 11:48:24 aniap Exp $ -package require tcltest 2.1 +package require tcltest 2.2 +namespace import ::tcltest::* eval tcltest::configure $argv tcltest::loadTestedCommands -test bgerror-1.1 {bgerror / tkerror compat} { +test bgerror-1.1 {bgerror / tkerror compat} -setup { set errRes {} proc tkerror {err} { - global errRes; - set errRes $err; + global errRes; + set errRes $err; } +} -body { after 0 {error err1} vwait errRes; - set errRes; -} err1 + return $errRes; +} -cleanup { + catch {rename tkerror {}} +} -result {err1} -test bgerror-1.2 {bgerror / tkerror compat / accumulation} { +test bgerror-1.2 {bgerror / tkerror compat / accumulation} -setup { set errRes {} proc tkerror {err} { - global errRes; - lappend errRes $err; + global errRes; + lappend errRes $err; } +} -body { after 0 {error err1} after 0 {error err2} after 0 {error err3} update - set errRes; -} {err1 err2 err3} + return $errRes; +} -cleanup { + catch {rename tkerror {}} +} -result {err1 err2 err3} -test bgerror-1.3 {bgerror / tkerror compat / accumulation / break} { +test bgerror-1.3 {bgerror / tkerror compat / accumulation / break} -setup { set errRes {} proc tkerror {err} { - global errRes; - lappend errRes $err; - return -code break "skip!"; + global errRes; + lappend errRes $err; + return -code break "skip!"; } +} -body { after 0 {error err1} after 0 {error err2} after 0 {error err3} update - set errRes; -} err1 + return $errRes; +} -cleanup { + catch {rename tkerror {}} +} -result {err1} -catch {rename tkerror {}} # some testing of the default error dialog # would be needed too, but that's not easy at all -- cgit v0.12 From e06421edf24ca33301cc5c438b3a63f833de0735 Mon Sep 17 00:00:00 2001 From: aniap Date: Tue, 22 Jul 2008 11:55:57 +0000 Subject: Update to tcltest2 --- tests/bitmap.test | 84 +- tests/border.test | 160 +- tests/button.test | 4414 ++++++++++++++++++++++++++++++++++++++++++++-------- tests/entry.test | 3702 ++++++++++++++++++++++++++++++++----------- tests/spinbox.test | 4087 +++++++++++++++++++++++++++++++++++++----------- 5 files changed, 9821 insertions(+), 2626 deletions(-) diff --git a/tests/bitmap.test b/tests/bitmap.test index 3186cad..9a27b55 100644 --- a/tests/bitmap.test +++ b/tests/bitmap.test @@ -6,57 +6,73 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: bitmap.test,v 1.6 2004/06/17 22:38:57 dkf Exp $ +# RCS: @(#) $Id: bitmap.test,v 1.7 2008/07/22 11:55:57 aniap Exp $ -package require tcltest 2.1 +package require tcltest 2.2 +namespace import ::tcltest::* eval tcltest::configure $argv tcltest::loadTestedCommands -test bitmap-1.1 {Tk_AllocBitmapFromObj - converting internal reps} testbitmap { +test bitmap-1.1 {Tk_AllocBitmapFromObj - converting internal reps} -constraints { + testbitmap +} -body { set x gray25 - lindex $x 0 - destroy .b1 - button .b1 -bitmap $x + lindex $x 0 + button .b -bitmap $x lindex $x 0 testbitmap gray25 -} {{1 0}} -test bitmap-1.2 {Tk_AllocBitmapFromObj - discard stale bitmap} testbitmap { +} -cleanup { + destroy .b +} -result {{1 0}} +test bitmap-1.2 {Tk_AllocBitmapFromObj - discard stale bitmap} -constraints { + testbitmap +} -setup { + set result {} +} -body { set x gray25 - destroy .b1 .b2 button .b1 -bitmap $x destroy .b1 - set result {} lappend result [testbitmap gray25] button .b2 -bitmap $x lappend result [testbitmap gray25] -} {{} {{1 1}}} -test bitmap-1.3 {Tk_AllocBitmapFromObj - reuse existing bitmap} testbitmap { - set x gray25 +} -cleanup { destroy .b1 .b2 - button .b1 -bitmap $x +} -result {{} {{1 1}}} +test bitmap-1.3 {Tk_AllocBitmapFromObj - reuse existing bitmap} -constraints { + testbitmap +} -setup { set result {} +} -body { + set x gray25 + button .b1 -bitmap $x lappend result [testbitmap gray25] button .b2 -bitmap $x pack .b1 .b2 -side top lappend result [testbitmap gray25] -} {{{1 1}} {{2 1}}} +} -cleanup { + destroy .b1 .b2 +} -result {{{1 1}} {{2 1}}} -test bitmap-2.1 {Tk_GetBitmap procedure} { - destroy .b1 - list [catch {button .b1 -bitmap bad_name} msg] $msg -} {1 {bitmap "bad_name" not defined}} -test bitmap-2.2 {Tk_GetBitmap procedure} { - destroy .b1 - list [catch {button .b1 -bitmap @xyzzy} msg] $msg -} {1 {error reading bitmap file "xyzzy"}} +test bitmap-2.1 {Tk_GetBitmap procedure} -body { + button .b1 -bitmap bad_name +} -cleanup { + destroy .b1 +} -returnCodes error -result {bitmap "bad_name" not defined} +test bitmap-2.2 {Tk_GetBitmap procedure} -body { + button .b1 -bitmap @xyzzy +} -cleanup { + destroy .b1 +} -returnCodes error -result {error reading bitmap file "xyzzy"} -test bitmap-3.1 {Tk_FreeBitmapFromObj - reference counts} testbitmap { +test bitmap-3.1 {Tk_FreeBitmapFromObj - reference counts} -constraints { + testbitmap +} -setup { + set result {} +} -body { set x questhead - destroy .b1 .b2 .b3 button .b1 -bitmap $x button .b3 -bitmap $x button .b2 -bitmap $x - set result {} lappend result [testbitmap questhead] destroy .b1 lappend result [testbitmap questhead] @@ -64,10 +80,13 @@ test bitmap-3.1 {Tk_FreeBitmapFromObj - reference counts} testbitmap { lappend result [testbitmap questhead] destroy .b3 lappend result [testbitmap questhead] -} {{{3 1}} {{2 1}} {{1 1}} {}} +} -cleanup { + destroy .b1 .b2 .b3 ;# destroying just in case +} -result {{{3 1}} {{2 1}} {{1 1}} {}} -test bitmap-4.1 {FreeBitmapObjProc} testbitmap { - destroy .b +test bitmap-4.1 {FreeBitmapObjProc} -constraints { + testbitmap +} -body { set x [format questhead] button .b -bitmap $x set y [format questhead] @@ -83,10 +102,11 @@ test bitmap-4.1 {FreeBitmapObjProc} testbitmap { destroy .b lappend result [testbitmap questhead] set y bogus - set result -} {{{1 3}} {{1 2}} {{1 1}} {}} + return $result +} -cleanup { + destroy .b +} -result {{{1 3}} {{1 2}} {{1 1}} {}} -destroy .t # cleanup cleanupTests diff --git a/tests/border.test b/tests/border.test index db1a5f7..0348959 100644 --- a/tests/border.test +++ b/tests/border.test @@ -5,51 +5,62 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: border.test,v 1.7 2004/12/04 00:04:40 dkf Exp $ +# RCS: @(#) $Id: border.test,v 1.8 2008/07/22 11:55:57 aniap Exp $ -package require tcltest 2.1 +package require tcltest 2.2 +namespace import ::tcltest::* eval tcltest::configure $argv tcltest::loadTestedCommands -if {[testConstraint pseudocolor8]} { - toplevel .t -visual {pseudocolor 8} -colormap new - wm geom .t +0+0 -} - -test border-1.1 {Tk_AllocBorderFromObj - converting internal reps} testborder { +test border-1.1 {Tk_AllocBorderFromObj - converting internal reps} -constraints { + testborder +} -body { set x orange lindex $x 0 - destroy .b1 button .b1 -bg $x -text .b1 lindex $x 0 testborder orange -} {{1 0}} -test border-1.3 {Tk_AllocBorderFromObj - discard stale border} testborder { +} -cleanup { + destroy .b1 +} -result {{1 0}} +test border-1.2 {Tk_AllocBorderFromObj - discard stale border} -constraints { + testborder +} -setup { + set result {} +} -body { set x orange - destroy .b1 .b2 button .b1 -bg $x -text First destroy .b1 - set result {} lappend result [testborder orange] button .b2 -bg $x -text Second lappend result [testborder orange] -} {{} {{1 1}}} -test border-1.2 {Tk_AllocBorderFromObj - reuse existing border} testborder { - set x orange +} -cleanup { destroy .b1 .b2 - button .b1 -bg $x -text First +} -result {{} {{1 1}}} +test border-1.3 {Tk_AllocBorderFromObj - reuse existing border} -constraints { + testborder +} -setup { set result {} +} -body { + set x orange + button .b1 -bg $x -text First lappend result [testborder orange] button .b2 -bg $x -text Second pack .b1 .b2 -side top lappend result [testborder orange] -} {{{1 1}} {{2 1}}} -test border-1.4 {Tk_AllocBorderFromObj - try other borders in list} {pseudocolor8 testborder} { +} -cleanup { + destroy .b1 .b2 +} -result {{{1 1}} {{2 1}}} +test border-1.4 {Tk_AllocBorderFromObj - try other borders in list} -constraints { + testborder pseudocolor8 +} -setup { + toplevel .t -visual {pseudocolor 8} -colormap new + wm geom .t +0+0 + set result {} +} -body { set x purple - destroy .b1 .b2 .t.b button .b1 -bg $x -text First pack .b1 -side top - set result {} lappend result [testborder purple] button .t.b -bg $x -text Second pack .t.b -side top @@ -57,18 +68,24 @@ test border-1.4 {Tk_AllocBorderFromObj - try other borders in list} {pseudocolor button .b2 -bg $x -text Third pack .b2 -side top lappend result [testborder purple] -} {{{1 1}} {{1 1} {1 0}} {{1 0} {2 1}}} +} -cleanup { + destroy .b1 .b2 .t +} -result {{{1 1}} {{1 1} {1 0}} {{1 0} {2 1}}} -test border-3.1 {Tk_Free3DBorder - reference counts} {pseudocolor8 testborder} { +test border-2.1 {Tk_Free3DBorder - reference counts} -constraints { + testborder pseudocolor8 +} -setup { + toplevel .t -visual {pseudocolor 8} -colormap new + wm geom .t +0+0 + set result {} +} -body { set x purple - destroy .b1 .b2 .t.b button .b1 -bg $x -text First pack .b1 -side top button .t.b -bg $x -text Second pack .t.b -side top button .b2 -bg $x -text Third pack .b2 -side top - set result {} lappend result [testborder purple] destroy .b1 lappend result [testborder purple] @@ -76,11 +93,18 @@ test border-3.1 {Tk_Free3DBorder - reference counts} {pseudocolor8 testborder} { lappend result [testborder purple] destroy .t.b lappend result [testborder purple] -} {{{1 0} {2 1}} {{1 0} {1 1}} {{1 0}} {}} -test border-3.4 {Tk_Free3DBorder - unlinking from list} {pseudocolor8 testborder} { - destroy .b .t.b .t2 .t3 +} -cleanup { + destroy .b1 .b2 .t +} -result {{{1 0} {2 1}} {{1 0} {1 1}} {{1 0}} {}} +test border-2.2 {Tk_Free3DBorder - unlinking from list} -constraints { + testborder pseudocolor8 +} -setup { + toplevel .t -visual {pseudocolor 8} -colormap new + wm geom .t +0+0 toplevel .t2 -visual {pseudocolor 8} -colormap new toplevel .t3 -visual {pseudocolor 8} -colormap new + set result {} +} -body { set x purple button .b -bg $x -text .b1 button .t.b1 -bg $x -text .t.b1 @@ -92,7 +116,6 @@ test border-3.4 {Tk_Free3DBorder - unlinking from list} {pseudocolor8 testborder button .t3.b2 -bg $x -text .t3.b2 button .t3.b3 -bg $x -text .t3.b3 button .t3.b4 -bg $x -text .t3.b4 - set result {} lappend result [testborder purple] destroy .t2 lappend result [testborder purple] @@ -102,17 +125,21 @@ test border-3.4 {Tk_Free3DBorder - unlinking from list} {pseudocolor8 testborder lappend result [testborder purple] destroy .t lappend result [testborder purple] -} {{{4 1} {3 0} {2 0} {1 0}} {{4 1} {2 0} {1 0}} {{4 1} {2 0}} {{2 0}} {}} +} -cleanup { + destroy .b .t2 .t3 .t +} -result {{{4 1} {3 0} {2 0} {1 0}} {{4 1} {2 0} {1 0}} {{4 1} {2 0}} {{2 0}} {}} -test border-4.1 {FreeBorderObjProc} testborder { - destroy .b +test border-3.1 {FreeBorderObjProc} -constraints { + testborder +} -setup { + set result {} +} -body { set x [format purple] button .b -bg $x -text .b1 set y [format purple] .b configure -bg $y set z [format purple] .b configure -bg $z - set result {} lappend result [testborder purple] set x red lappend result [testborder purple] @@ -121,42 +148,53 @@ test border-4.1 {FreeBorderObjProc} testborder { destroy .b lappend result [testborder purple] set y bogus - set result -} {{{1 3}} {{1 2}} {{1 1}} {}} + return $result +} -cleanup { + destroy .b +} -result {{{1 3}} {{1 2}} {{1 1}} {}} -catch {destroy .b} -button .b -test border-5.1 {Tk_GetReliefFromObj} { - .b configure -relief flat +test border-4.1 {Tk_GetReliefFromObj} -body { + button .b -relief flat .b cget -relief -} {flat} -test border-5.2 {Tk_GetReliefFromObj} { - .b configure -relief groove +} -cleanup { + destroy .b +} -result {flat} +test border-4.2 {Tk_GetReliefFromObj} -body { + button .b -relief groove .b cget -relief -} {groove} -test border-5.3 {Tk_GetReliefFromObj} { - .b configure -relief raised +} -cleanup { + destroy .b +} -result {groove} +test border-4.3 {Tk_GetReliefFromObj} -body { + button .b -relief raised .b cget -relief -} {raised} -test border-5.4 {Tk_GetReliefFromObj} { - .b configure -relief ridge +} -cleanup { + destroy .b +} -result {raised} +test border-4.4 {Tk_GetReliefFromObj} -body { + button .b -relief ridge .b cget -relief -} {ridge} -test border-5.5 {Tk_GetReliefFromObj} { - .b configure -relief solid +} -cleanup { + destroy .b +} -result {ridge} +test border-4.5 {Tk_GetReliefFromObj} -body { + button .b -relief solid .b cget -relief -} {solid} -test border-5.6 {Tk_GetReliefFromObj} { - .b configure -relief sunken +} -cleanup { + destroy .b +} -result {solid} +test border-4.6 {Tk_GetReliefFromObj} -body { + button .b -relief sunken .b cget -relief -} {sunken} -test border-5.7 {Tk_GetReliefFromObj - error} { - list [catch {.b configure -relief upanddown} msg] $msg -} {1 {bad relief "upanddown": must be flat, groove, raised, ridge, solid, or sunken}} +} -cleanup { + destroy .b +} -result {sunken} +test border-4.7 {Tk_GetReliefFromObj - error} -body { + button .b -relief upanddown +} -cleanup { + destroy .b +} -returnCodes error -result {bad relief "upanddown": must be flat, groove, raised, ridge, solid, or sunken} -if {[testConstraint pseudocolor8]} { - destroy .t -} # cleanup cleanupTests diff --git a/tests/button.test b/tests/button.test index 9d13ce4..abc9315 100644 --- a/tests/button.test +++ b/tests/button.test @@ -7,429 +7,3203 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: button.test,v 1.20 2004/12/07 21:22:19 dgp Exp $ +# RCS: @(#) $Id: button.test,v 1.21 2008/07/22 11:55:57 aniap Exp $ -package require tcltest 2.1 +package require tcltest 2.2 +namespace import ::tcltest::* eval tcltest::configure $argv tcltest::loadTestedCommands + proc bogusTrace args { error "trace aborted" } -catch {unset value} -catch {unset value2} -# Create entries in the option database to be sure that geometry options -# like border width have predictable values. +test button-1.1 {configuration option: "activebackground" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -activebackground #012345 + .l cget -activebackground +} -cleanup { + destroy .l +} -result {#012345} +test button-1.2 {configuration option: "activebackground" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -activebackground non-existent +} -cleanup { + destroy .l +} -returnCodes {error} -result {unknown color name "non-existent"} +test button-1.3 {configuration option: "activebackground" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -activebackground #012345 + .b cget -activebackground +} -cleanup { + destroy .b +} -result {#012345} +test button-1.4 {configuration option: "activebackground" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -activebackground non-existent +} -cleanup { + destroy .b +} -returnCodes {error} -result {unknown color name "non-existent"} +test button-1.5 {configuration option: "activebackground" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -activebackground #012345 + .c cget -activebackground +} -cleanup { + destroy .c +} -result {#012345} +test button-1.6 {configuration option: "activebackground" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -activebackground non-existent +} -cleanup { + destroy .c +} -returnCodes {error} -result {unknown color name "non-existent"} +test button-1.7 {configuration option: "activebackground" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -activebackground #012345 + .r cget -activebackground +} -cleanup { + destroy .r +} -result {#012345} +test button-1.8 {configuration option: "activebackground" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -activebackground non-existent +} -cleanup { + destroy .r +} -returnCodes {error} -result {unknown color name "non-existent"} + +test button-1.9 {configuration option: "activeforeground" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -activeforeground #ff0000 + .l cget -activeforeground +} -cleanup { + destroy .l +} -result {#ff0000} +test button-1.10 {configuration option: "activeforeground" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -activeforeground non-existent +} -cleanup { + destroy .l +} -returnCodes {error} -result {unknown color name "non-existent"} +test button-1.11 {configuration option: "activeforeground" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -activeforeground #ff0000 + .b cget -activeforeground +} -cleanup { + destroy .b +} -result {#ff0000} +test button-1.12 {configuration option: "activeforeground" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -activeforeground non-existent +} -cleanup { + destroy .b +} -returnCodes {error} -result {unknown color name "non-existent"} +test button-1.13 {configuration option: "activeforeground" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -activeforeground #ff0000 + .c cget -activeforeground +} -cleanup { + destroy .c +} -result {#ff0000} +test button-1.14 {configuration option: "activeforeground" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -activeforeground non-existent +} -cleanup { + destroy .c +} -returnCodes {error} -result {unknown color name "non-existent"} +test button-1.15 {configuration option: "activeforeground" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -activeforeground #ff0000 + .r cget -activeforeground +} -cleanup { + destroy .r +} -result {#ff0000} +test button-1.16 {configuration option: "activeforeground" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -activeforeground non-existent +} -cleanup { + destroy .r +} -returnCodes {error} -result {unknown color name "non-existent"} + +test button-1.17 {configuration option: "anchor" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -anchor nw + .l cget -anchor +} -cleanup { + destroy .l +} -result {nw} +test button-1.18 {configuration option: "anchor" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -anchor bogus +} -cleanup { + destroy .l +} -returnCodes {error} -result {bad anchor "bogus": must be n, ne, e, se, s, sw, w, nw, or center} +test button-1.19 {configuration option: "anchor" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -anchor nw + .b cget -anchor +} -cleanup { + destroy .b +} -result {nw} +test button-1.20 {configuration option: "anchor" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -anchor bogus +} -cleanup { + destroy .b +} -returnCodes {error} -result {bad anchor "bogus": must be n, ne, e, se, s, sw, w, nw, or center} +test button-1.21 {configuration option: "anchor" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -anchor nw + .c cget -anchor +} -cleanup { + destroy .c +} -result {nw} +test button-1.22 {configuration option: "anchor" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -anchor bogus +} -cleanup { + destroy .c +} -returnCodes {error} -result {bad anchor "bogus": must be n, ne, e, se, s, sw, w, nw, or center} +test button-1.23 {configuration option: "anchor" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -anchor nw + .r cget -anchor +} -cleanup { + destroy .r +} -result {nw} +test button-1.24 {configuration option: "anchor" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -anchor bogus +} -cleanup { + destroy .r +} -returnCodes {error} -result {bad anchor "bogus": must be n, ne, e, se, s, sw, w, nw, or center} + +test button-1.25 {configuration option: "background" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -background #ff0000 + .l cget -background +} -cleanup { + destroy .l +} -result {#ff0000} +test button-1.26 {configuration option: "background" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -background non-existent +} -cleanup { + destroy .l +} -returnCodes {error} -result {unknown color name "non-existent"} +test button-1.27 {configuration option: "background" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -background #ff0000 + .b cget -background +} -cleanup { + destroy .b +} -result {#ff0000} +test button-1.28 {configuration option: "background" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -background non-existent +} -cleanup { + destroy .b +} -returnCodes {error} -result {unknown color name "non-existent"} +test button-1.29 {configuration option: "background" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -background #ff0000 + .c cget -background +} -cleanup { + destroy .c +} -result {#ff0000} +test button-1.30 {configuration option: "background" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -background non-existent +} -cleanup { + destroy .c +} -returnCodes {error} -result {unknown color name "non-existent"} +test button-1.31 {configuration option: "background" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -background #ff0000 + .r cget -background +} -cleanup { + destroy .r +} -result {#ff0000} +test button-1.32 {configuration option: "background" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -background non-existent +} -cleanup { + destroy .r +} -returnCodes {error} -result {unknown color name "non-existent"} + +test button-1.33 {configuration option: "bd" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -bd 4 + .l cget -bd +} -cleanup { + destroy .l +} -result {4} +test button-1.34 {configuration option: "bd" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -bd badValue +} -cleanup { + destroy .l +} -returnCodes {error} -result {bad screen distance "badValue"} +test button-1.35 {configuration option: "bd" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -bd 4 + .b cget -bd +} -cleanup { + destroy .b +} -result {4} +test button-1.36 {configuration option: "bd" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -bd badValue +} -cleanup { + destroy .b +} -returnCodes {error} -result {bad screen distance "badValue"} +test button-1.37 {configuration option: "bd" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -bd 4 + .c cget -bd +} -cleanup { + destroy .c +} -result {4} +test button-1.38 {configuration option: "bd" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -bd badValue +} -cleanup { + destroy .c +} -returnCodes {error} -result {bad screen distance "badValue"} +test button-1.39 {configuration option: "bd" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -bd 4 + .r cget -bd +} -cleanup { + destroy .r +} -result {4} +test button-1.40 {configuration option: "bd" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -bd badValue +} -cleanup { + destroy .r +} -returnCodes {error} -result {bad screen distance "badValue"} + +test button-1.41 {configuration option: "bg" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -bg #ff0000 + .l cget -bg +} -cleanup { + destroy .l +} -result {#ff0000} +test button-1.42 {configuration option: "bg" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -bg non-existent +} -cleanup { + destroy .l +} -returnCodes {error} -result {unknown color name "non-existent"} +test button-1.43 {configuration option: "bg" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -bg #ff0000 + .b cget -bg +} -cleanup { + destroy .b +} -result {#ff0000} +test button-1.44 {configuration option: "bg" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -bg non-existent +} -cleanup { + destroy .b +} -returnCodes {error} -result {unknown color name "non-existent"} +test button-1.45 {configuration option: "bg" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -bg #ff0000 + .c cget -bg +} -cleanup { + destroy .c +} -result {#ff0000} +test button-1.46 {configuration option: "bg" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -bg non-existent +} -cleanup { + destroy .c +} -returnCodes {error} -result {unknown color name "non-existent"} +test button-1.47 {configuration option: "bg" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -bg #ff0000 + .r cget -bg +} -cleanup { + destroy .r +} -result {#ff0000} +test button-1.48 {configuration option: "bg" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -bg non-existent +} -cleanup { + destroy .r +} -returnCodes {error} -result {unknown color name "non-existent"} + +test button-1.49 {configuration option: "bitmap" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -bitmap questhead + .l cget -bitmap +} -cleanup { + destroy .l +} -result {questhead} +test button-1.50 {configuration option: "bitmap" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -bitmap badValue +} -cleanup { + destroy .l +} -returnCodes {error} -result {bitmap "badValue" not defined} +test button-1.51 {configuration option: "bitmap" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -bitmap questhead + .b cget -bitmap +} -cleanup { + destroy .b +} -result {questhead} +test button-1.52 {configuration option: "bitmap" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -bitmap badValue +} -cleanup { + destroy .b +} -returnCodes {error} -result {bitmap "badValue" not defined} +test button-1.53 {configuration option: "bitmap" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -bitmap questhead + .c cget -bitmap +} -cleanup { + destroy .c +} -result {questhead} +test button-1.54 {configuration option: "bitmap" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -bitmap badValue +} -cleanup { + destroy .c +} -returnCodes {error} -result {bitmap "badValue" not defined} +test button-1.55 {configuration option: "bitmap" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -bitmap questhead + .r cget -bitmap +} -cleanup { + destroy .r +} -result {questhead} +test button-1.56 {configuration option: "bitmap" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -bitmap badValue +} -cleanup { + destroy .r +} -returnCodes {error} -result {bitmap "badValue" not defined} + +test button-1.57 {configuration option: "borderwidth" for label} -setup { + label .l -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -borderwidth 1.3 + .l cget -borderwidth +} -cleanup { + destroy .l +} -result {1.3} +test button-1.58 {configuration option: "borderwidth" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -borderwidth badValue +} -cleanup { + destroy .l +} -returnCodes {error} -result {bad screen distance "badValue"} +test button-1.59 {configuration option: "borderwidth" for button} -setup { + button .b -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -borderwidth 1.3 + .b cget -borderwidth +} -cleanup { + destroy .b +} -result {1.3} +test button-1.60 {configuration option: "borderwidth" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -borderwidth badValue +} -cleanup { + destroy .b +} -returnCodes {error} -result {bad screen distance "badValue"} +test button-1.61 {configuration option: "borderwidth" for checkbutton} -setup { + checkbutton .c -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -borderwidth 1.3 + .c cget -borderwidth +} -cleanup { + destroy .c +} -result {1.3} +test button-1.62 {configuration option: "borderwidth" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -borderwidth badValue +} -cleanup { + destroy .c +} -returnCodes {error} -result {bad screen distance "badValue"} +test button-1.63 {configuration option: "borderwidth" for radiobutton} -setup { + radiobutton .r -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -borderwidth 1.3 + .r cget -borderwidth +} -cleanup { + destroy .r +} -result {1.3} +test button-1.64 {configuration option: "borderwidth" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -borderwidth badValue +} -cleanup { + destroy .r +} -returnCodes {error} -result {bad screen distance "badValue"} + +test button-1.65 {configuration option: "command" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -command {set x} + .b cget -command +} -cleanup { + destroy .b +} -result {set x} +test button-1.66 {configuration option: "command" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -command {set x} + .b cget -command +} -cleanup { + destroy .b +} -result {set x} +test button-1.67 {configuration option: "command" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -command {set x} + .c cget -command +} -cleanup { + destroy .c +} -result {set x} +test button-1.68 {configuration option: "command" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -command {set x} + .r cget -command +} -cleanup { + destroy .r +} -result {set x} + +test button-1.69 {configuration option: "compound" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -compound left + .l cget -compound +} -cleanup { + destroy .l +} -result {left} +test button-1.70 {configuration option: "compound" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -compound bogus +} -cleanup { + destroy .l +} -returnCodes {error} -result {bad compound "bogus": must be bottom, center, left, none, right, or top} +test button-1.71 {configuration option: "compound" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -compound left + .b cget -compound +} -cleanup { + destroy .b +} -result {left} +test button-1.72 {configuration option: "compound" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -compound bogus +} -cleanup { + destroy .b +} -returnCodes {error} -result {bad compound "bogus": must be bottom, center, left, none, right, or top} +test button-1.73 {configuration option: "compound" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -compound left + .c cget -compound +} -cleanup { + destroy .c +} -result {left} +test button-1.74 {configuration option: "compound" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -compound bogus +} -cleanup { + destroy .c +} -returnCodes {error} -result {bad compound "bogus": must be bottom, center, left, none, right, or top} +test button-1.75 {configuration option: "compound" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -compound left + .r cget -compound +} -cleanup { + destroy .r +} -result {left} +test button-1.76 {configuration option: "compound" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -compound bogus +} -cleanup { + destroy .r +} -returnCodes {error} -result {bad compound "bogus": must be bottom, center, left, none, right, or top} + +test button-1.77 {configuration option: "cursor" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -cursor arrow + .l cget -cursor +} -cleanup { + destroy .l +} -result {arrow} +test button-1.78 {configuration option: "cursor" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -cursor badValue +} -cleanup { + destroy .l +} -returnCodes {error} -result {bad cursor spec "badValue"} +test button-1.79 {configuration option: "cursor" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -cursor arrow + .b cget -cursor +} -cleanup { + destroy .b +} -result {arrow} +test button-1.80 {configuration option: "cursor" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -cursor badValue +} -cleanup { + destroy .b +} -returnCodes {error} -result {bad cursor spec "badValue"} +test button-1.81 {configuration option: "cursor" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -cursor arrow + .c cget -cursor +} -cleanup { + destroy .c +} -result {arrow} +test button-1.82 {configuration option: "cursor" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -cursor badValue +} -cleanup { + destroy .c +} -returnCodes {error} -result {bad cursor spec "badValue"} +test button-1.83 {configuration option: "cursor" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -cursor arrow + .r cget -cursor +} -cleanup { + destroy .r +} -result {arrow} +test button-1.84 {configuration option: "cursor" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -cursor badValue +} -cleanup { + destroy .r +} -returnCodes {error} -result {bad cursor spec "badValue"} + +test button-1.85 {configuration option: "default" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -default active + .b cget -default +} -cleanup { + destroy .b +} -result {active} +test button-1.86 {configuration option: "default" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -default huh? +} -cleanup { + destroy .b +} -returnCodes {error} -result {bad default "huh?": must be active, disabled, or normal} + +test button-1.87 {configuration option: "disabledforeground" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -disabledforeground #00ff00 + .l cget -disabledforeground +} -cleanup { + destroy .l +} -result {#00ff00} +test button-1.88 {configuration option: "disabledforeground" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -disabledforeground non-existent +} -cleanup { + destroy .l +} -returnCodes {error} -result {unknown color name "non-existent"} +test button-1.89 {configuration option: "disabledforeground" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -disabledforeground #00ff00 + .b cget -disabledforeground +} -cleanup { + destroy .b +} -result {#00ff00} +test button-1.90 {configuration option: "disabledforeground" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -disabledforeground non-existent +} -cleanup { + destroy .b +} -returnCodes {error} -result {unknown color name "non-existent"} +test button-1.91 {configuration option: "disabledforeground" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -disabledforeground #00ff00 + .c cget -disabledforeground +} -cleanup { + destroy .c +} -result {#00ff00} +test button-1.92 {configuration option: "disabledforeground" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -disabledforeground non-existent +} -cleanup { + destroy .c +} -returnCodes {error} -result {unknown color name "non-existent"} +test button-1.93 {configuration option: "disabledforeground" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -disabledforeground #00ff00 + .r cget -disabledforeground +} -cleanup { + destroy .r +} -result {#00ff00} +test button-1.94 {configuration option: "disabledforeground" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -disabledforeground non-existent +} -cleanup { + destroy .r +} -returnCodes {error} -result {unknown color name "non-existent"} + +test button-1.95 {configuration option: "fg" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -fg #110022 + .l cget -fg +} -cleanup { + destroy .l +} -result {#110022} +test button-1.96 {configuration option: "fg" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -fg non-existent +} -cleanup { + destroy .l +} -returnCodes {error} -result {unknown color name "non-existent"} +test button-1.97 {configuration option: "fg" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -fg #110022 + .b cget -fg +} -cleanup { + destroy .b +} -result {#110022} +test button-1.98 {configuration option: "fg" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -fg non-existent +} -cleanup { + destroy .b +} -returnCodes {error} -result {unknown color name "non-existent"} +test button-1.99 {configuration option: "fg" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -fg #110022 + .c cget -fg +} -cleanup { + destroy .c +} -result {#110022} +test button-1.100 {configuration option: "fg" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -fg non-existent +} -cleanup { + destroy .c +} -returnCodes {error} -result {unknown color name "non-existent"} +test button-1.101 {configuration option: "fg" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -fg #110022 + .r cget -fg +} -cleanup { + destroy .r +} -result {#110022} +test button-1.102 {configuration option: "fg" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -fg non-existent +} -cleanup { + destroy .r +} -returnCodes {error} -result {unknown color name "non-existent"} + +test button-1.103 {configuration option: "font" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 + pack .l + update +} -body { + .l configure -font {Helvetica -12} + .l cget -font +} -cleanup { + destroy .l +} -result {Helvetica -12} +test button-1.104 {configuration option: "activebackground" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 + pack .l + update +} -body { + .l configure -font {} +} -cleanup { + destroy .l +} -returnCodes {error} -result {font "" doesn't exist} +test button-1.105 {configuration option: "font" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 + pack .b + update +} -body { + .b configure -font {Helvetica -12} + .b cget -font +} -cleanup { + destroy .b +} -result {Helvetica -12} +test button-1.106 {configuration option: "activebackground" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 + pack .b + update +} -body { + .b configure -font {} +} -cleanup { + destroy .b +} -returnCodes {error} -result {font "" doesn't exist} +test button-1.107 {configuration option: "font" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 + pack .c + update +} -body { + .c configure -font {Helvetica -12} + .c cget -font +} -cleanup { + destroy .c +} -result {Helvetica -12} +test button-1.108 {configuration option: "activebackground" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 + pack .c + update +} -body { + .c configure -font {} +} -cleanup { + destroy .c +} -returnCodes {error} -result {font "" doesn't exist} +test button-1.109 {configuration option: "font" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 + pack .r + update +} -body { + .r configure -font {Helvetica -12} + .r cget -font +} -cleanup { + destroy .r +} -result {Helvetica -12} +test button-1.110 {configuration option: "activebackground" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 + pack .r + update +} -body { + .r configure -font {} +} -cleanup { + destroy .r +} -returnCodes {error} -result {font "" doesn't exist} + +test button-1.111 {configuration option: "foreground" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -foreground #110022 + .l cget -foreground +} -cleanup { + destroy .l +} -result {#110022} +test button-1.112 {configuration option: "foreground" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -foreground non-existent +} -cleanup { + destroy .l +} -returnCodes {error} -result {unknown color name "non-existent"} +test button-1.113 {configuration option: "foreground" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -foreground #110022 + .b cget -foreground +} -cleanup { + destroy .b +} -result {#110022} +test button-1.114 {configuration option: "foreground" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -foreground non-existent +} -cleanup { + destroy .b +} -returnCodes {error} -result {unknown color name "non-existent"} +test button-1.115 {configuration option: "foreground" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -foreground #110022 + .c cget -foreground +} -cleanup { + destroy .c +} -result {#110022} +test button-1.116 {configuration option: "foreground" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -foreground non-existent +} -cleanup { + destroy .c +} -returnCodes {error} -result {unknown color name "non-existent"} +test button-1.117 {configuration option: "foreground" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -foreground #110022 + .r cget -foreground +} -cleanup { + destroy .r +} -result {#110022} +test button-1.118 {configuration option: "foreground" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -foreground non-existent +} -cleanup { + destroy .r +} -returnCodes {error} -result {unknown color name "non-existent"} + +test button-1.119 {configuration option: "height" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -height 18 + .l cget -height +} -cleanup { + destroy .l +} -result {18} +test button-1.120 {configuration option: "height" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -height 20.0 +} -cleanup { + destroy .l +} -returnCodes {error} -result {expected integer but got "20.0"} +test button-1.121 {configuration option: "height" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -height 18 + .b cget -height +} -cleanup { + destroy .b +} -result {18} +test button-1.122 {configuration option: "height" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -height 20.0 +} -cleanup { + destroy .b +} -returnCodes {error} -result {expected integer but got "20.0"} +test button-1.123 {configuration option: "height" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -height 18 + .c cget -height +} -cleanup { + destroy .c +} -result {18} +test button-1.124 {configuration option: "height" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -height 20.0 +} -cleanup { + destroy .c +} -returnCodes {error} -result {expected integer but got "20.0"} +test button-1.125 {configuration option: "height" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -height 18 + .r cget -height +} -cleanup { + destroy .r +} -result {18} +test button-1.126 {configuration option: "height" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -height 20.0 +} -cleanup { + destroy .r +} -returnCodes {error} -result {expected integer but got "20.0"} + +test button-1.127 {configuration option: "highlightbackground" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -highlightbackground #110022 + .l cget -highlightbackground +} -cleanup { + destroy .l +} -result {#110022} +test button-1.128 {configuration option: "highlightbackground" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -highlightbackground non-existent +} -cleanup { + destroy .l +} -returnCodes {error} -result {unknown color name "non-existent"} +test button-1.129 {configuration option: "highlightbackground" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -highlightbackground #110022 + .b cget -highlightbackground +} -cleanup { + destroy .b +} -result {#110022} +test button-1.130 {configuration option: "highlightbackground" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -highlightbackground non-existent +} -cleanup { + destroy .b +} -returnCodes {error} -result {unknown color name "non-existent"} +test button-1.131 {configuration option: "highlightbackground" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -highlightbackground #110022 + .c cget -highlightbackground +} -cleanup { + destroy .c +} -result {#110022} +test button-1.132 {configuration option: "highlightbackground" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -highlightbackground non-existent +} -cleanup { + destroy .c +} -returnCodes {error} -result {unknown color name "non-existent"} +test button-1.133 {configuration option: "highlightbackground" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -highlightbackground #110022 + .r cget -highlightbackground +} -cleanup { + destroy .r +} -result {#110022} +test button-1.134 {configuration option: "highlightbackground" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -highlightbackground non-existent +} -cleanup { + destroy .r +} -returnCodes {error} -result {unknown color name "non-existent"} + +test button-1.135 {configuration option: "highlightcolor" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -highlightcolor #110022 + .l cget -highlightcolor +} -cleanup { + destroy .l +} -result {#110022} +test button-1.136 {configuration option: "highlightcolor" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -highlightcolor non-existent +} -cleanup { + destroy .l +} -returnCodes {error} -result {unknown color name "non-existent"} +test button-1.137 {configuration option: "highlightcolor" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -highlightcolor #110022 + .b cget -highlightcolor +} -cleanup { + destroy .b +} -result {#110022} +test button-1.138 {configuration option: "highlightcolor" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -highlightcolor non-existent +} -cleanup { + destroy .b +} -returnCodes {error} -result {unknown color name "non-existent"} +test button-1.139 {configuration option: "highlightcolor" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -highlightcolor #110022 + .c cget -highlightcolor +} -cleanup { + destroy .c +} -result {#110022} +test button-1.140 {configuration option: "highlightcolor" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -highlightcolor non-existent +} -cleanup { + destroy .c +} -returnCodes {error} -result {unknown color name "non-existent"} +test button-1.141 {configuration option: "highlightcolor" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -highlightcolor #110022 + .r cget -highlightcolor +} -cleanup { + destroy .r +} -result {#110022} +test button-1.142 {configuration option: "highlightcolor" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -highlightcolor non-existent +} -cleanup { + destroy .r +} -returnCodes {error} -result {unknown color name "non-existent"} + +test button-1.143 {configuration option: "highlightthickness" for label} -setup { + label .l -borderwidth 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -highlightthickness 6m + .l cget -highlightthickness +} -cleanup { + destroy .l +} -result {6m} +test button-1.144 {configuration option: "highlightthickness" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -highlightthickness badValue +} -cleanup { + destroy .l +} -returnCodes {error} -result {bad screen distance "badValue"} +test button-1.145 {configuration option: "highlightthickness" for button} -setup { + button .b -borderwidth 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -highlightthickness 6m + .b cget -highlightthickness +} -cleanup { + destroy .b +} -result {6m} +test button-1.146 {configuration option: "highlightthickness" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -highlightthickness badValue +} -cleanup { + destroy .b +} -returnCodes {error} -result {bad screen distance "badValue"} +test button-1.147 {configuration option: "highlightthickness" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -highlightthickness 6m + .c cget -highlightthickness +} -cleanup { + destroy .c +} -result {6m} +test button-1.148 {configuration option: "highlightthickness" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -highlightthickness badValue +} -cleanup { + destroy .c +} -returnCodes {error} -result {bad screen distance "badValue"} +test button-1.149 {configuration option: "highlightthickness" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -highlightthickness 6m + .r cget -highlightthickness +} -cleanup { + destroy .r +} -result {6m} +test button-1.150 {configuration option: "highlightthickness" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -highlightthickness badValue +} -cleanup { + destroy .r +} -returnCodes {error} -result {bad screen distance "badValue"} + +test button-1.151 {configuration option: "image" for label} -constraints { + testImageType +} -setup { + image create test image1 + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -image image1 + .l cget -image +} -cleanup { + destroy .l + image delete image1 +} -result {image1} +test button-1.152 {configuration option: "image" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -image bogus +} -cleanup { + destroy .l +} -returnCodes {error} -result {image "bogus" doesn't exist} +test button-1.153 {configuration option: "image" for button} -constraints { + testImageType +} -setup { + image create test image1 + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -image image1 + .b cget -image +} -cleanup { + destroy .b + image delete image1 +} -result {image1} +test button-1.154 {configuration option: "image" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -image bogus +} -cleanup { + destroy .b +} -returnCodes {error} -result {image "bogus" doesn't exist} +test button-1.155 {configuration option: "image" for checkbutton} -constraints { + testImageType +} -setup { + image create test image1 + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -image image1 + .c cget -image +} -cleanup { + destroy .c + image delete image1 +} -result {image1} +test button-1.156 {configuration option: "image" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -image bogus +} -cleanup { + destroy .c +} -returnCodes {error} -result {image "bogus" doesn't exist} +test button-1.157 {configuration option: "image" for radiobutton} -constraints { + testImageType +} -setup { + image create test image1 + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -image image1 + .r cget -image +} -cleanup { + destroy .r + image delete image1 +} -result {image1} +test button-1.158 {configuration option: "image" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -image bogus +} -cleanup { + destroy .r +} -returnCodes {error} -result {image "bogus" doesn't exist} + +test button-1.159 {configuration option: "indicatoron" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -indicatoron yes + .c cget -indicatoron +} -cleanup { + destroy .c +} -result {1} +test button-1.160 {configuration option: "indicatoron" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -indicatoron no_way +} -cleanup { + destroy .c +} -returnCodes {error} -result {expected boolean value but got "no_way"} +test button-1.161 {configuration option: "indicatoron" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -indicatoron yes + .r cget -indicatoron +} -cleanup { + destroy .r +} -result {1} +test button-1.162 {configuration option: "indicatoron" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -indicatoron no_way +} -cleanup { + destroy .r +} -returnCodes {error} -result {expected boolean value but got "no_way"} + +test button-1.163 {configuration option: "justify" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -justify right + .l cget -justify +} -cleanup { + destroy .l +} -result {right} +test button-1.164 {configuration option: "justify" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -justify bogus +} -cleanup { + destroy .l +} -returnCodes {error} -result {bad justification "bogus": must be left, right, or center} +test button-1.165 {configuration option: "justify" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -justify right + .b cget -justify +} -cleanup { + destroy .b +} -result {right} +test button-1.166 {configuration option: "justify" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -justify bogus +} -cleanup { + destroy .b +} -returnCodes {error} -result {bad justification "bogus": must be left, right, or center} +test button-1.167 {configuration option: "justify" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -justify right + .c cget -justify +} -cleanup { + destroy .c +} -result {right} +test button-1.168 {configuration option: "justify" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -justify bogus +} -cleanup { + destroy .c +} -returnCodes {error} -result {bad justification "bogus": must be left, right, or center} +test button-1.169 {configuration option: "justify" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -justify right + .r cget -justify +} -cleanup { + destroy .r +} -result {right} +test button-1.170 {configuration option: "justify" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -justify bogus +} -cleanup { + destroy .r +} -returnCodes {error} -result {bad justification "bogus": must be left, right, or center} + +test button-1.171 {configuration option: "offrelief" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -offrelief flat + .c cget -offrelief +} -cleanup { + destroy .c +} -result {flat} +test button-1.172 {configuration option: "offrelief" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -offrelief 1.5 +} -cleanup { + destroy .c +} -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} +test button-1.173 {configuration option: "offrelief" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -offrelief flat + .r cget -offrelief +} -cleanup { + destroy .r +} -result {flat} +test button-1.174 {configuration option: "offrelief" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -offrelief 1.5 +} -cleanup { + destroy .r +} -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} + +test button-1.175 {configuration option: "offvalue" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -offvalue lousy + .c cget -offvalue +} -cleanup { + destroy .c +} -result {lousy} + +test button-1.176 {configuration option: "onvalue" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -onvalue fantastic + .c cget -onvalue +} -cleanup { + destroy .c +} -result {fantastic} + +test button-1.177 {configuration option: "overrelief" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -overrelief "" + .b cget -overrelief +} -cleanup { + destroy .b +} -result {} +test button-1.178 {configuration option: "overrelief" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -overrelief 1.5 +} -cleanup { + destroy .b +} -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} +test button-1.179 {configuration option: "overrelief" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -overrelief "" + .c cget -overrelief +} -cleanup { + destroy .c +} -result {} +test button-1.180 {configuration option: "overrelief" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -overrelief 1.5 +} -cleanup { + destroy .c +} -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} +test button-1.181 {configuration option: "overrelief" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -overrelief "" + .r cget -overrelief +} -cleanup { + destroy .r +} -result {} +test button-1.182 {configuration option: "overrelief" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -overrelief 1.5 +} -cleanup { + destroy .r +} -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} + +test button-1.183 {configuration option: "padx" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -padx 12m + .l cget -padx +} -cleanup { + destroy .l +} -result {12m} +test button-1.184 {configuration option: "padx" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -padx 420x +} -cleanup { + destroy .l +} -returnCodes {error} -result {bad screen distance "420x"} +test button-1.185 {configuration option: "padx" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -padx 12m + .b cget -padx +} -cleanup { + destroy .b +} -result {12m} +test button-1.186 {configuration option: "padx" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -padx 420x +} -cleanup { + destroy .b +} -returnCodes {error} -result {bad screen distance "420x"} +test button-1.187 {configuration option: "padx" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -padx 12m + .c cget -padx +} -cleanup { + destroy .c +} -result {12m} +test button-1.188 {configuration option: "padx" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -padx 420x +} -cleanup { + destroy .c +} -returnCodes {error} -result {bad screen distance "420x"} +test button-1.189 {configuration option: "padx" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -padx 12m + .r cget -padx +} -cleanup { + destroy .r +} -result {12m} +test button-1.190 {configuration option: "padx" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -padx 420x +} -cleanup { + destroy .r +} -returnCodes {error} -result {bad screen distance "420x"} + +test button-1.191 {configuration option: "pady" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -pady 12m + .l cget -pady +} -cleanup { + destroy .l +} -result {12m} +test button-1.192 {configuration option: "pady" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -pady 420x +} -cleanup { + destroy .l +} -returnCodes {error} -result {bad screen distance "420x"} +test button-1.193 {configuration option: "pady" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -pady 12m + .b cget -pady +} -cleanup { + destroy .b +} -result {12m} +test button-1.194 {configuration option: "pady" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -pady 420x +} -cleanup { + destroy .b +} -returnCodes {error} -result {bad screen distance "420x"} +test button-1.195 {configuration option: "pady" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -pady 12m + .c cget -pady +} -cleanup { + destroy .c +} -result {12m} +test button-1.196 {configuration option: "pady" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -pady 420x +} -cleanup { + destroy .c +} -returnCodes {error} -result {bad screen distance "420x"} +test button-1.197 {configuration option: "pady" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -pady 12m + .r cget -pady +} -cleanup { + destroy .r +} -result {12m} +test button-1.198 {configuration option: "pady" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -pady 420x +} -cleanup { + destroy .r +} -returnCodes {error} -result {bad screen distance "420x"} + +test button-1.199 {configuration option: "repeatdelay" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -repeatdelay 100 + .b cget -repeatdelay +} -cleanup { + destroy .b +} -result {100} +test button-1.200 {configuration option: "repeatdelay" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -repeatdelay foo +} -cleanup { + destroy .b +} -returnCodes {error} -result {expected integer but got "foo"} + +test button-1.201 {configuration option: "repeatinterval" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -repeatinterval 100 + .b cget -repeatinterval +} -cleanup { + destroy .b +} -result {100} +test button-1.202 {configuration option: "repeatinterval" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -repeatinterval foo +} -cleanup { + destroy .b +} -returnCodes {error} -result {expected integer but got "foo"} + +test button-1.203 {configuration option: "relief" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -relief flat + .l cget -relief +} -cleanup { + destroy .l +} -result {flat} +test button-1.204 {configuration option: "relief" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -relief 1.5 +} -cleanup { + destroy .l +} -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} +test button-1.205 {configuration option: "relief" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -relief flat + .b cget -relief +} -cleanup { + destroy .b +} -result {flat} +test button-1.206 {configuration option: "relief" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -relief 1.5 +} -cleanup { + destroy .b +} -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} +test button-1.207 {configuration option: "relief" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -relief flat + .c cget -relief +} -cleanup { + destroy .c +} -result {flat} +test button-1.208 {configuration option: "relief" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -relief 1.5 +} -cleanup { + destroy .c +} -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} +test button-1.209 {configuration option: "relief" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -relief flat + .r cget -relief +} -cleanup { + destroy .r +} -result {flat} +test button-1.210 {configuration option: "relief" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -relief 1.5 +} -cleanup { + destroy .r +} -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} -option add *Button.borderWidth 2 -option add *Button.highlightThickness 2 -option add *Button.font {Helvetica -12 bold} +test button-1.211 {configuration option: "selectcolor" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -selectcolor #110022 + .c cget -selectcolor +} -cleanup { + destroy .c +} -result {#110022} +test button-1.212 {configuration option: "selectcolor" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -selectcolor non-existent +} -cleanup { + destroy .c +} -returnCodes {error} -result {unknown color name "non-existent"} +test button-1.213 {configuration option: "selectcolor" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -selectcolor #110022 + .r cget -selectcolor +} -cleanup { + destroy .r +} -result {#110022} +test button-1.214 {configuration option: "selectcolor" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -selectcolor non-existent +} -cleanup { + destroy .r +} -returnCodes {error} -result {unknown color name "non-existent"} -eval image delete [image names] -if {[testConstraint testImageType]} { +test button-1.215 {configuration option: "selectimage" for checkbutton} -constraints { + testImageType +} -setup { image create test image1 -} -label .l -text Label -button .b -text Button -checkbutton .c -text Checkbutton -radiobutton .r -text Radiobutton -pack .l .b .c .r -update -set i 1 -foreach test { - {-activebackground #012345 #012345 non-existent - {unknown color name "non-existent"} {1 1 1 1}} - {-activeforeground #ff0000 #ff0000 non-existent - {unknown color name "non-existent"} {1 1 1 1}} - {-anchor nw nw bogus - {bad anchor "bogus": must be n, ne, e, se, s, sw, w, nw, or center} - {1 1 1 1}} - {-background #ff0000 #ff0000 non-existent - {unknown color name "non-existent"} {1 1 1 1}} - {-bd 4 4 badValue {bad screen distance "badValue"} {1 1 1 1}} - {-bg #ff0000 #ff0000 non-existent {unknown color name "non-existent"} - {1 1 1 1}} - {-bitmap questhead questhead badValue {bitmap "badValue" not defined} - {1 1 1 1}} - {-borderwidth 1.3 1.3 badValue {bad screen distance "badValue"} {1 1 1 1}} - {-command "set x" {set x} {} {} {0 1 1 1}} - {-compound left left bogus - {bad compound "bogus": must be bottom, center, left, none, right, or top} - {1 1 1 1}} - {-cursor arrow arrow badValue {bad cursor spec "badValue"} {1 1 1 1}} - {-default active active huh? - {bad default "huh?": must be active, disabled, or normal} - {0 1 0 0}} - {-disabledforeground #00ff00 #00ff00 xyzzy {unknown color name "xyzzy"} - {1 1 1 1}} - {-fg #110022 #110022 bogus {unknown color name "bogus"} {1 1 1 1}} - {-font {Helvetica 12} {Helvetica 12} {} {font "" doesn't exist} {1 1 1 1}} - {-foreground #110022 #110022 bogus {unknown color name "bogus"} {1 1 1 1}} - {-height 18 18 20.0 {expected integer but got "20.0"} {1 1 1 1}} - {-highlightbackground #112233 #112233 ugly {unknown color name "ugly"} - {1 1 1 1}} - {-highlightcolor #110022 #110022 bogus {unknown color name "bogus"} - {1 1 1 1}} - {-highlightthickness 6m 6m badValue {bad screen distance "badValue"} - {1 1 1 1}} - {-image image1 image1 bogus {image "bogus" doesn't exist} {1 1 1 1}} - {-indicatoron yes 1 no_way {expected boolean value but got "no_way"} - {0 0 1 1}} - {-justify right right bogus - {bad justification "bogus": must be left, right, or center} - {1 1 1 1}} - {-offrelief flat flat 1.5 - {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} - {0 0 1 1}} - {-offvalue lousy lousy {} {} {0 0 1 0}} - {-onvalue fantastic fantastic {} {} {0 0 1 0}} - {-overrelief "" "" 1.5 - {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} - {0 1 1 1}} - {-padx 12m 12m 420x {bad screen distance "420x"} {1 1 1 1}} - {-pady 12m 12m 420x {bad screen distance "420x"} {1 1 1 1}} - {-repeatdelay 100 100 foo {expected integer but got "foo"} {0 1 0 0}} - {-repeatinterval 100 100 foo {expected integer but got "foo"} {0 1 0 0}} - {-relief flat flat 1.5 - {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} - {1 1 1 1}} - {-selectcolor #110022 #110022 bogus {unknown color name "bogus"} {0 0 1 1}} - {-selectimage image1 image1 bogus {image "bogus" doesn't exist} {0 0 1 1}} - {-state normal normal bogus - {bad state "bogus": must be active, disabled, or normal} - {1 1 1 1}} - {-takefocus "any string" "any string" {} {} {1 1 1 1}} - {-text "Sample text" {Sample text} {} {} {1 1 1 1}} - {-textvariable i i {} {} {1 1 1 1}} - {-tristateimage image1 image1 bogus {image "bogus" doesn't exist} - {0 0 1 1}} - {-tristatevalue unknowable unknowable {} {} {0 0 1 1}} - {-underline 5 5 3p {expected integer but got "3p"} {1 1 1 1}} - {-value anyString anyString {} {} {0 0 0 1}} - {-width 402 402 3p {expected integer but got "3p"} {1 1 1 1}} - {-wraplength 100 100 6x {bad screen distance "6x"} {1 1 1 1}} -} { - lassign $test name value okResult badValue badResult classes - foreach w {.l .b .c .r} hasOption $classes { - set classname [winfo class $w] - if {$hasOption} { - test button-1.$i "configuration option $name for $classname" \ - -constraints testImageType -body " - $w configure $name [list $value] - lindex \[$w configure $name] 4 - " -result $okResult - incr i - if {$badValue ne ""} { - test button-1.$i "configuration option $name for $classname" \ - -constraints testImageType \ - -body [list $w configure $name $badValue] \ - -returnCodes error -result $badResult - incr i - } - $w configure $name [lindex [$w configure $name] 3] - } else { - test button-1.$i "configuration option $name for $classname" \ - -constraints testImageType \ - -body [list $w configure $name $value] \ - -returnCodes error -result "unknown option \"$name\"" - incr i - } - } -} -test button-1.$i {configuration options} { - # Additional check to make sure that -selectcolor may be empty in - # checkbox widgets + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -selectimage image1 + .c cget -selectimage +} -cleanup { + destroy .c + image delete image1 +} -result {image1} +test button-1.216 {configuration option: "selectimage" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -selectimage bogus +} -cleanup { + destroy .c +} -returnCodes {error} -result {image "bogus" doesn't exist} +test button-1.217 {configuration option: "selectimage" for radiobutton} -constraints { + testImageType +} -setup { + image create test image1 + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -selectimage image1 + .r cget -selectimage +} -cleanup { + destroy .r + image delete image1 +} -result {image1} +test button-1.218 {configuration option: "selectimage" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -selectimage bogus +} -cleanup { + destroy .r +} -returnCodes {error} -result {image "bogus" doesn't exist} + +test button-1.219 {configuration option: "state" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -state normal + .l cget -state +} -cleanup { + destroy .l +} -result {normal} +test button-1.220 {configuration option: "state" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -state bogus +} -cleanup { + destroy .l +} -returnCodes {error} -result {bad state "bogus": must be active, disabled, or normal} +test button-1.221 {configuration option: "state" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -state normal + .b cget -state +} -cleanup { + destroy .b +} -result {normal} +test button-1.222 {configuration option: "state" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -state bogus +} -cleanup { + destroy .b +} -returnCodes {error} -result {bad state "bogus": must be active, disabled, or normal} +test button-1.223 {configuration option: "state" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -state normal + .c cget -state +} -cleanup { + destroy .c +} -result {normal} +test button-1.224 {configuration option: "state" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -state bogus +} -cleanup { + destroy .c +} -returnCodes {error} -result {bad state "bogus": must be active, disabled, or normal} +test button-1.225 {configuration option: "state" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -state normal + .r cget -state +} -cleanup { + destroy .r +} -result {normal} +test button-1.226 {configuration option: "state" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -state bogus +} -cleanup { + destroy .r +} -returnCodes {error} -result {bad state "bogus": must be active, disabled, or normal} + +test button-1.227 {configuration option: "takefocus" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -takefocus "any string" + .l cget -takefocus +} -cleanup { + destroy .l +} -result {any string} +test button-1.228 {configuration option: "takefocus" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -takefocus "any string" + .b cget -takefocus +} -cleanup { + destroy .b +} -result {any string} +test button-1.229 {configuration option: "takefocus" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -takefocus "any string" + .c cget -takefocus +} -cleanup { + destroy .c +} -result {any string} +test button-1.230 {configuration option: "takefocus" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -takefocus "any string" + .r cget -takefocus +} -cleanup { + destroy .r +} -result {any string} + +test button-1.231 {configuration option: "text" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -text "Sample text" + .l cget -text +} -cleanup { + destroy .l +} -result {Sample text} +test button-1.232 {configuration option: "text" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -text "Sample text" + .b cget -text +} -cleanup { + destroy .b +} -result {Sample text} +test button-1.233 {configuration option: "text" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -text "Sample text" + .c cget -text +} -cleanup { + destroy .c +} -result {Sample text} +test button-1.234 {configuration option: "text" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -text "Sample text" + .r cget -text +} -cleanup { + destroy .r +} -result {Sample text} + +test button-1.235 {configuration option: "textvariable" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -textvariable i + .l cget -textvariable +} -cleanup { + destroy .l +} -result {i} +test button-1.236 {configuration option: "textvariable" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -textvariable i + .b cget -textvariable +} -cleanup { + destroy .b +} -result {i} +test button-1.237 {configuration option: "textvariable" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -textvariable i + .c cget -textvariable +} -cleanup { + destroy .c +} -result {i} +test button-1.238 {configuration option: "textvariable" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -textvariable i + .r cget -textvariable +} -cleanup { + destroy .r +} -result {i} + +test button-1.239 {configuration option: "tristateimage" for checkbutton} -constraints { + testImageType +} -setup { + image create test image1 + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -tristateimage image1 + .c cget -tristateimage +} -cleanup { + destroy .c + image delete image1 +} -result {image1} +test button-1.240 {configuration option: "tristateimage" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -tristateimage bogus +} -cleanup { + destroy .c +} -returnCodes {error} -result {image "bogus" doesn't exist} +test button-1.241 {configuration option: "tristateimage" for radiobutton} -constraints { + testImageType +} -setup { + image create test image1 + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -tristateimage image1 + .r cget -tristateimage +} -cleanup { + destroy .r + image delete image1 +} -result {image1} +test button-1.242 {configuration option: "tristateimage" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -tristateimage bogus +} -cleanup { + destroy .r +} -returnCodes {error} -result {image "bogus" doesn't exist} + +test button-1.243 {configuration option: "underline" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -underline 5 + .l cget -underline +} -cleanup { + destroy .l +} -result {5} +test button-1.244 {configuration option: "underline" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -underline 3p +} -cleanup { + destroy .l +} -returnCodes {error} -result {expected integer but got "3p"} +test button-1.245 {configuration option: "underline" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -underline 5 + .b cget -underline +} -cleanup { + destroy .b +} -result {5} +test button-1.246 {configuration option: "underline" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -underline 3p +} -cleanup { + destroy .b +} -returnCodes {error} -result {expected integer but got "3p"} +test button-1.247 {configuration option: "underline" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -underline 5 + .c cget -underline +} -cleanup { + destroy .c +} -result {5} +test button-1.248 {configuration option: "underline" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -underline 3p +} -cleanup { + destroy .c +} -returnCodes {error} -result {expected integer but got "3p"} +test button-1.249 {configuration option: "underline" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -underline 5 + .r cget -underline +} -cleanup { + destroy .r +} -result {5} +test button-1.250 {configuration option: "underline" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -underline 3p +} -cleanup { + destroy .r +} -returnCodes {error} -result {expected integer but got "3p"} + +test button-1.251 {configuration option: "tristatevalue" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -tristatevalue unknowable + .c cget -tristatevalue +} -cleanup { + destroy .c +} -result {unknowable} +test button-1.252 {configuration option: "tristatevalue" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -tristatevalue unknowable + .r cget -tristatevalue +} -cleanup { + destroy .r +} -result {unknowable} + +test button-1.253 {configuration option: "value" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -value anyString + .r cget -value +} -cleanup { + destroy .r +} -result {anyString} + +test button-1.254 {configuration option: "width" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -width 402 + .l cget -width +} -cleanup { + destroy .l +} -result {402} +test button-1.255 {configuration option: "width" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -width 3p +} -cleanup { + destroy .l +} -returnCodes {error} -result {expected integer but got "3p"} +test button-1.256 {configuration option: "width" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -width 402 + .b cget -width +} -cleanup { + destroy .b +} -result {402} +test button-1.257 {configuration option: "width" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -width 3p +} -cleanup { + destroy .b +} -returnCodes {error} -result {expected integer but got "3p"} +test button-1.258 {configuration option: "width" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -width 402 + .c cget -width +} -cleanup { + destroy .c +} -result {402} +test button-1.259 {configuration option: "width" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -width 3p +} -cleanup { + destroy .c +} -returnCodes {error} -result {expected integer but got "3p"} +test button-1.260 {configuration option: "width" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -width 402 + .r cget -width +} -cleanup { + destroy .r +} -result {402} +test button-1.261 {configuration option: "width" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -width 3p +} -cleanup { + destroy .r +} -returnCodes {error} -result {expected integer but got "3p"} + +test button-1.262 {configuration option: "wraplength" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -wraplength 100 + .l cget -wraplength +} -cleanup { + destroy .l +} -result {100} +test button-1.263 {configuration option: "wraplength" for label} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .l + update +} -body { + .l configure -wraplength 6x +} -cleanup { + destroy .l +} -returnCodes {error} -result {bad screen distance "6x"} +test button-1.264 {configuration option: "wraplength" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -wraplength 100 + .b cget -wraplength +} -cleanup { + destroy .b +} -result {100} +test button-1.265 {configuration option: "wraplength" for button} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .b + update +} -body { + .b configure -wraplength 6x +} -cleanup { + destroy .b +} -returnCodes {error} -result {bad screen distance "6x"} +test button-1.266 {configuration option: "wraplength" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -wraplength 100 + .c cget -wraplength +} -cleanup { + destroy .c +} -result {100} +test button-1.267 {configuration option: "wraplength" for checkbutton} -setup { + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .c + update +} -body { + .c configure -wraplength 6x +} -cleanup { + destroy .c +} -returnCodes {error} -result {bad screen distance "6x"} +test button-1.268 {configuration option: "wraplength" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -wraplength 100 + .r cget -wraplength +} -cleanup { + destroy .r +} -result {100} +test button-1.269 {configuration option: "wraplength" for radiobutton} -setup { + radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .r + update +} -body { + .r configure -wraplength 6x +} -cleanup { + destroy .r +} -returnCodes {error} -result {bad screen distance "6x"} + +test button-1.270 {configuration options} -body { +# Additional check to make sure that -selectcolor may be empty in +# checkbox widgets + checkbutton .c .c configure -selectcolor {} -} {} - -test button-3.1 {ButtonCreate - not enough cd ../unix -} { - list [catch {button} msg] $msg -} {1 {wrong # args: should be "button pathName ?options?"}} -test button-3.2 {ButtonCreate procedure - setting label class} { - catch {destroy .x} +} -cleanup { + destroy .c +} -result {} + +# ex-tests 3.* +test button-2.1 {ButtonCreate - not enough arguments} -body { + button +} -returnCodes {error} -result {wrong # args: should be "button pathName ?options?"} + +test button-2.2 {ButtonCreate procedure - setting label class} -body { label .x winfo class .x -} {Label} -test button-3.3 {ButtonCreate - setting button class} { - catch {destroy .x} +} -cleanup { + destroy .x +} -result {Label} +test button-2.3 {ButtonCreate - setting button class} -body { button .x winfo class .x -} {Button} -test button-3.4 {ButtonCreate - setting checkbutton class} { - catch {destroy .x} +} -cleanup { + destroy .x +} -result {Button} +test button-2.4 {ButtonCreate - setting checkbutton class} -body { checkbutton .x winfo class .x -} {Checkbutton} -test button-3.5 {ButtonCreate - setting radiobutton class} { - catch {destroy .x} +} -cleanup { + destroy .x +} -result {Checkbutton} +test button-2.5 {ButtonCreate - setting radiobutton class} -body { radiobutton .x winfo class .x -} {Radiobutton} -rename button gorp -test button-3.6 {ButtonCreate - setting class} { - catch {destroy .x} +} -cleanup { + destroy .x +} -result {Radiobutton} +test button-2.6 {ButtonCreate - setting class} -body { + rename button gorp gorp .x winfo class .x -} {Button} -rename gorp button -test button-3.7 {ButtonCreate - bad window name} { - list [catch {button foo} msg] $msg -} {1 {bad window path name "foo"}} -test button-3.8 {ButtonCreate procedure - error in default option value} { - catch {destroy .funny} +} -cleanup { + destroy .x + rename gorp button +} -result {Button} + +test button-2.7 {ButtonCreate - bad window name} -body { + button foo +} -cleanup { + destroy foo +} -returnCodes {error} -result {bad window path name "foo"} +######### test ex 3.8 +test button-2.8 {ButtonCreate procedure - error in default option value} -body { option add *funny.background bogus - list [catch {button .funny} msg] $msg $errorInfo -} {1 {unknown color name "bogus"} {unknown color name "bogus" + button .funny +} -cleanup { + option clear + destroy .funny +} -returnCodes {error} -result {unknown color name "bogus"} +test button-2.9 {ButtonCreate procedure - error in default option value} -body { + option add *funny.background bogus + catch {button .funny} + return $errorInfo +} -cleanup { + option clear + destroy .funny +} -result {unknown color name "bogus" (database entry for "-background" in widget ".funny") invoked from within -"button .funny"}} -test button-3.9 {ButtonCreate procedure - option error} { - catch {destroy .x} - list [catch {button .x -gorp foo} msg] $msg [winfo exists .x] -} {1 {unknown option "-gorp"} 0} -test button-3.10 {ButtonCreate procedure - return value} { - catch {destroy .abcd} +"button .funny"} + +test button-2.10 {ButtonCreate procedure - option error} -body { + button .x -gorp foo +} -cleanup { + destroy .x +} -returnCodes {error} -result {unknown option "-gorp"} +test button-2.11 {ButtonCreate procedure - option error} -body { + catch {button .x -gorp foo} + winfo exists .x +} -cleanup { + destroy .x +} -result 0 +######### ex 3.10 +test button-2.12 {ButtonCreate procedure - return value} -body { set x [button .abcd] - destroy .abc - set x -} {.abcd} - -test button-4.1 {ButtonWidgetCmd - too few arguments} { - list [catch {.b} msg] $msg -} {1 {wrong # args: should be ".b option ?arg arg ...?"}} -test button-4.2 {ButtonWidgetCmd - bad option name} { - list [catch {.b c} msg] $msg -} {1 {ambiguous option "c": must be cget, configure, flash, or invoke}} -test button-4.3 {ButtonWidgetCmd - bad option name} { - list [catch {.b bogus} msg] $msg -} {1 {bad option "bogus": must be cget, configure, flash, or invoke}} -test button-4.4 {ButtonWidgetCmd procedure, "cget" option} { - list [catch {.b cget a b} msg] $msg -} {1 {wrong # args: should be ".b cget option"}} -test button-4.5 {ButtonWidgetCmd procedure, "cget" option} { - list [catch {.b cget -gorp} msg] $msg -} {1 {unknown option "-gorp"}} -test button-4.6 {ButtonWidgetCmd procedure, "cget" option} { - .b configure -highlightthickness 3 - .b cget -highlightthickness -} {3} -test button-4.7 {ButtonWidgetCmd procedure, "cget" option} { - catch {.l cget -disabledforeground} -} {0} -test button-4.8 {ButtonWidgetCmd procedure, "cget" option} { - catch {.b cget -disabledforeground} -} {0} -test button-4.9 {ButtonWidgetCmd procedure, "cget" option} { - list [catch {.b cget -variable} msg] $msg -} {1 {unknown option "-variable"}} -test button-4.10 {ButtonWidgetCmd procedure, "cget" option} { - catch {.c cget -variable} -} {0} -test button-4.11 {ButtonWidgetCmd procedure, "cget" option} { - list [catch {.c cget -value} msg] $msg -} {1 {unknown option "-value"}} -test button-4.12 {ButtonWidgetCmd procedure, "cget" option} { - catch {.r cget -value} -} {0} -test button-4.13 {ButtonWidgetCmd procedure, "cget" option} { - list [catch {.r cget -onvalue} msg] $msg -} {1 {unknown option "-onvalue"}} -test button-4.14 {ButtonWidgetCmd procedure, "configure" option} { + return $x +} -cleanup { + destroy .abcd +} -result {.abcd} + +######### ex 4.* +test button-3.1 {ButtonWidgetCmd - too few arguments} -body { + button .b + .b +} -cleanup { + destroy .b +} -returnCodes {error} -result {wrong # args: should be ".b option ?arg arg ...?"} +test button-3.2 {ButtonWidgetCmd - bad option name} -body { + button .b + .b c +} -cleanup { + destroy .b +} -returnCodes {error} -result {ambiguous option "c": must be cget, configure, flash, or invoke} +test button-3.3 {ButtonWidgetCmd - bad option name} -body { + button .b + .b bogus +} -cleanup { + destroy .b +} -returnCodes {error} -result {bad option "bogus": must be cget, configure, flash, or invoke} +test button-3.4 {ButtonWidgetCmd procedure, "cget" option} -body { + button .b + .b cget a b +} -cleanup { + destroy .b +} -returnCodes {error} -result {wrong # args: should be ".b cget option"} +test button-3.5 {ButtonWidgetCmd procedure, "cget" option} -body { + button .b + .b cget -gorp +} -cleanup { + destroy .b +} -returnCodes {error} -result {unknown option "-gorp"} + +#ex 4.7 +test button-3.6 {ButtonWidgetCmd procedure, "cget" option} -body { + label .l + .l cget -disabledforeground +} -cleanup { + destroy .l +} -returnCodes {ok} -match {glob} -result {*} +test button-3.7 {ButtonWidgetCmd procedure, "cget" option} -body { + button .b + .b cget -disabledforeground +} -cleanup { + destroy .b +} -returnCodes {ok} -match {glob} -result {*} +test button-3.8 {ButtonWidgetCmd procedure, "cget" option} -body { + button .b + .b cget -variable +} -cleanup { + destroy .b +} -returnCodes {error} -result {unknown option "-variable"} + +test button-3.9 {ButtonWidgetCmd procedure, "cget" option} -body { + checkbutton .c + .c cget -variable +} -cleanup { + destroy .c +} -returnCodes {ok} -match {glob} -result {*} +test button-3.10 {ButtonWidgetCmd procedure, "cget" option} -body { + checkbutton .c + .c cget -value +} -cleanup { + destroy .c +} -returnCodes {error} -result {unknown option "-value"} + +test button-3.11 {ButtonWidgetCmd procedure, "cget" option} -body { + radiobutton .r + .r cget -value +} -cleanup { + destroy .r +} -returnCodes {ok} -match {glob} -result {*} +test button-3.12 {ButtonWidgetCmd procedure, "cget" option} -body { + radiobutton .r + .r cget -onvalue +} -cleanup { + destroy .r +} -returnCodes {error} -result {unknown option "-onvalue"} + +# ex 4.6 +test button-3.13 {ButtonWidgetCmd procedure, "configure" option} -body { + button .b -highlightthickness 3 + lindex [.b configure -highlightthickness] 4 +} -cleanup { + destroy .b +} -result {3} +test button-3.14 {ButtonWidgetCmd procedure, "configure" option} -body { + checkbutton .c llength [.c configure] -} {41} -test button-4.15 {ButtonWidgetCmd procedure, "configure" option} { - list [catch {.b configure -gorp} msg] $msg -} {1 {unknown option "-gorp"}} -test button-4.16 {ButtonWidgetCmd procedure, "configure" option} { - list [catch {.b co -bg #ffffff -fg} msg] $msg -} {1 {value for "-fg" missing}} -test button-4.17 {ButtonWidgetCmd procedure, "configure" option} { +} -cleanup { + destroy .c +} -result {41} +test button-3.15 {ButtonWidgetCmd procedure, "configure" option} -body { + button .b + .b configure -gorp +} -cleanup { + destroy .b +} -returnCodes {error} -result {unknown option "-gorp"} +test button-3.16 {ButtonWidgetCmd procedure, "configure" option} -setup { + button .b +} -body { + .b co -bg #ffffff -fg +} -cleanup { + destroy .b +} -returnCodes {error} -result {value for "-fg" missing} +test button-3.17 {ButtonWidgetCmd procedure, "configure" option} -setup { + button .b +} -body { .b configure -fg #123456 .b configure -bg #654321 lindex [.b configure -fg] 4 -} {#123456} -.c configure -variable value -onvalue 1 -offvalue 0 -.r configure -variable value2 -value red -test button-4.18 {ButtonWidgetCmd procedure, "deselect" option} { - list [catch {.c deselect foo} msg] $msg -} {1 {wrong # args: should be ".c deselect"}} -test button-4.19 {ButtonWidgetCmd procedure, "deselect" option} { - list [catch {.l deselect} msg] $msg -} {1 {bad option "deselect": must be cget or configure}} -test button-4.20 {ButtonWidgetCmd procedure, "deselect" option} { - list [catch {.b deselect} msg] $msg -} {1 {bad option "deselect": must be cget, configure, flash, or invoke}} -test button-4.21 {ButtonWidgetCmd procedure, "deselect" option} { - set value 1 +} -cleanup { + destroy .b +} -result {#123456} +test button-3.18 {ButtonWidgetCmd procedure, "deselect" option} -body { + checkbutton .c + .c deselect foo +} -cleanup { + destroy .c +} -returnCodes {error} -result {wrong # args: should be ".c deselect"} +test button-3.19 {ButtonWidgetCmd procedure, "deselect" option} -body { + label .l + .l deselect +} -cleanup { + destroy .l +} -returnCodes {error} -result {bad option "deselect": must be cget or configure} +test button-3.20 {ButtonWidgetCmd procedure, "deselect" option} -body { + button .b + .b deselect +} -cleanup { + destroy .b +} -returnCodes {error} -result {bad option "deselect": must be cget, configure, flash, or invoke} + +test button-3.21 {ButtonWidgetCmd procedure, "deselect" option} -body { + checkbutton .c -variable checkvar -onvalue 1 -offvalue 0 + set checkvar 1 .c d - set value -} {0} -test button-4.22 {ButtonWidgetCmd procedure, "deselect" option} { - set value2 green + return $checkvar +} -cleanup { + destroy .c +} -result {0} +test button-3.22 {ButtonWidgetCmd procedure, "deselect" option} -body { + radiobutton .r -variable radiovar -value red + set radiovar green .r deselect - set value2 -} {green} -test button-4.23 {ButtonWidgetCmd procedure, "deselect" option} { - set value2 red + return $radiovar +} -cleanup { + destroy .r +} -result {green} +test button-3.23 {ButtonWidgetCmd procedure, "deselect" option} -body { + radiobutton .r -variable radiovar -value red + set radiovar red .r deselect - set value2 -} {} -test button-4.24 {ButtonWidgetCmd procedure, "deselect" option} -body { - set value 1 - trace variable value w bogusTrace - set result [list [catch {.c deselect} msg] $msg $errorInfo $value] - trace vdelete value w bogusTrace - set result -} -match glob -result {1 {can't set "value": trace aborted} {*trace aborted + return $radiovar +} -cleanup { + destroy .r +} -result {} + +test button-3.24 {ButtonWidgetCmd procedure, "deselect" option} -body { + checkbutton .c -variable checkvar -onvalue 1 -offvalue 0 + set checkvar 1 + trace variable checkvar w bogusTrace + .c deselect +} -cleanup { + destroy .c + trace vdelete checkvar w bogusTrace +} -returnCodes {error} -result {can't set "checkvar": trace aborted} +test button-3.25 {ButtonWidgetCmd procedure, "deselect" option} -body { + checkbutton .c -variable checkvar -onvalue 1 -offvalue 0 + set checkvar 1 + trace variable checkvar w bogusTrace + catch {.c deselect} + list $errorInfo $checkvar +} -cleanup { + trace vdelete checkvar w bogusTrace + destroy .c +} -match {glob} -result {{*trace aborted while executing * ".c deselect"} 0} -test button-4.25 {ButtonWidgetCmd procedure, "deselect" option} -body { - set value2 red - trace variable value2 w bogusTrace - set result [list [catch {.r deselect} msg] $msg $errorInfo $value2] - trace vdelete value2 w bogusTrace - set result -} -match glob -result {1 {can't set "value2": trace aborted} {*trace aborted +test button-3.26 {ButtonWidgetCmd procedure, "deselect" option} -body { + radiobutton .r -variable radiovar -value red + set radiovar red + trace variable radiovar w bogusTrace + .r deselect +} -cleanup { + destroy .r + trace vdelete radiovar w bogusTrace +} -match {glob} -returnCodes {error} -result {can't set "radiovar": trace aborted} +test button-3.27 {ButtonWidgetCmd procedure, "deselect" option} -body { + radiobutton .r -variable radiovar -value red + set radiovar red + trace variable radiovar w bogusTrace + catch {.r deselect} + list $errorInfo $radiovar +} -cleanup { + destroy .r + trace vdelete radiovar w bogusTrace +} -match glob -result {{*trace aborted while executing * ".r deselect"} {}} -test button-4.26 {ButtonWidgetCmd procedure, "flash" option} { - list [catch {.b flash foo} msg] $msg -} {1 {wrong # args: should be ".b flash"}} -test button-4.27 {ButtonWidgetCmd procedure, "flash" option} { - list [catch {.l flash} msg] $msg -} {1 {bad option "flash": must be cget or configure}} -test button-4.28 {ButtonWidgetCmd procedure, "flash" option} { - list [catch {.b flash} msg] $msg -} {0 {}} -test button-4.29 {ButtonWidgetCmd procedure, "flash" option} { - list [catch {.c flash} msg] $msg -} {0 {}} -test button-4.30 {ButtonWidgetCmd procedure, "flash" option} { - list [catch {.r f} msg] $msg -} {0 {}} -test button-4.31 {ButtonWidgetCmd procedure, "invoke" option} { - list [catch {.b invoke foo} msg] $msg -} {1 {wrong # args: should be ".b invoke"}} -test button-4.32 {ButtonWidgetCmd procedure, "invoke" option} { - list [catch {.l invoke} msg] $msg -} {1 {bad option "invoke": must be cget or configure}} -test button-4.33 {ButtonWidgetCmd procedure, "invoke" option} { + +test button-3.28 {ButtonWidgetCmd procedure, "flash" option} -body { + button .b + .b flash foo +} -cleanup { + destroy .b +} -returnCodes {error} -result {wrong # args: should be ".b flash"} +test button-3.29 {ButtonWidgetCmd procedure, "flash" option} -body { + label .l + .l flash +} -cleanup { + destroy .l +} -returnCodes {error} -result {bad option "flash": must be cget or configure} +test button-3.30 {ButtonWidgetCmd procedure, "flash" option} -body { + button .b + catch {.b flash} +} -cleanup { + destroy .b +} -returnCodes {ok} -match {glob} -result {*} +test button-3.31 {ButtonWidgetCmd procedure, "flash" option} -body { + checkbutton .c + catch {.c flash} +} -cleanup { + destroy .c +} -returnCodes {ok} -match {glob} -result {*} +test button-3.32 {ButtonWidgetCmd procedure, "flash" option} -body { + radiobutton .r + catch {.r f} +} -cleanup { + destroy .r +} -returnCodes {ok} -match {glob} -result {*} + +test button-3.33 {ButtonWidgetCmd procedure, "invoke" option} -body { + label .l + .l invoke +} -cleanup { + destroy .l +} -returnCodes {error} -result {bad option "invoke": must be cget or configure} +test button-3.34 {ButtonWidgetCmd procedure, "invoke" option} -body { + button .b + .b invoke foo +} -cleanup { + destroy .b +} -returnCodes {error} -result {wrong # args: should be ".b invoke"} +test button-3.35 {ButtonWidgetCmd procedure, "invoke" option} -body { + button .b .b configure -command {set x invoked} set x "not invoked" .b invoke - set x -} {invoked} -test button-4.34 {ButtonWidgetCmd procedure, "invoke" option} { + return $x +} -cleanup { + destroy .b +} -result {invoked} +test button-3.36 {ButtonWidgetCmd procedure, "invoke" option} -body { + button .b .b configure -command {set x invoked} -state disabled set x "not invoked" .b invoke - set x -} {not invoked} -test button-4.35 {ButtonWidgetCmd procedure, "invoke" option} { - set value bogus - .c configure -command {set x invoked} -variable value -onvalue 1 \ - -offvalue 0 + return $x +} -cleanup { + destroy .b +} -result {not invoked} +test button-3.37 {ButtonWidgetCmd procedure, "invoke" option} -body { + checkbutton .c -variable checkvar -onvalue 1 -offvalue 0 \ + -command {set x invoked} + set checkvar bogus set x "not invoked" .c invoke - list $x $value -} {invoked 1} -test button-4.36 {ButtonWidgetCmd procedure, "invoke" option} { - set value2 green - .r configure -command {set x invoked} -variable value2 -value red + list $x $checkvar +} -cleanup { + destroy .c +} -result {invoked 1} +test button-3.38 {ButtonWidgetCmd procedure, "invoke" option} -body { + radiobutton .r -command {set x invoked} -variable radiovar -value red + set radiovar green set x "not invoked" .r i - list $x $value2 -} {invoked red} -test button-4.37 {ButtonWidgetCmd procedure, "select" option} { - list [catch {.l select} msg] $msg -} {1 {bad option "select": must be cget or configure}} -test button-4.38 {ButtonWidgetCmd procedure, "select" option} { - list [catch {.b select} msg] $msg -} {1 {bad option "select": must be cget, configure, flash, or invoke}} -test button-4.39 {ButtonWidgetCmd procedure, "select" option} { - list [catch {.c select foo} msg] $msg -} {1 {wrong # args: should be ".c select"}} -test button-4.40 {ButtonWidgetCmd procedure, "select" option} { - set value bogus - .c configure -command {} -variable value -onvalue lovely -offvalue 0 + list $x $radiovar +} -cleanup { + destroy .r +} -result {invoked red} + +test button-3.39 {ButtonWidgetCmd procedure, "select" option} -body { + label .l + .l select +} -cleanup { + destroy .l +} -returnCodes {error} -result {bad option "select": must be cget or configure} +test button-3.40 {ButtonWidgetCmd procedure, "select" option} -body { + button .b + .b select +} -cleanup { + destroy .b +} -returnCodes {error} -result {bad option "select": must be cget, configure, flash, or invoke} +test button-3.41 {ButtonWidgetCmd procedure, "select" option} -body { + checkbutton .c + .c select foo +} -cleanup { + destroy .c +} -returnCodes {error} -result {wrong # args: should be ".c select"} +test button-3.42 {ButtonWidgetCmd procedure, "select" option} -body { + checkbutton .c -variable checkvar -onvalue lovely -offvalue 0 + set checkvar bogus .c s - set value -} {lovely} -test button-4.41 {ButtonWidgetCmd procedure, "select" option} { - set value2 green - .r configure -command {} -variable value2 -value red + return $checkvar +} -cleanup { + destroy .c +} -result {lovely} +test button-3.43 {ButtonWidgetCmd procedure, "select" option} -body { + radiobutton .r -variable radiovar -value red + set radiovar green .r select - set value2 -} {red} -test button-4.42 {ButtonWidgetCmd procedure, "select" option} -body { - set value2 yellow - trace variable value2 w bogusTrace - set result [list [catch {.r select} msg] $msg $errorInfo $value2] - trace vdelete value2 w bogusTrace - set result -} -match glob -result {1 {can't set "value2": trace aborted} {*trace aborted + return $radiovar +} -cleanup { + destroy .r +} -result {red} +test button-3.44 {ButtonWidgetCmd procedure, "select" option} -body { + radiobutton .r -variable radiovar -value red + set radiovar yellow + trace variable radiovar w bogusTrace + .r select +} -cleanup { + destroy .r + trace vdelete radiovar w bogusTrace +} -returnCodes {error} -result {can't set "radiovar": trace aborted} +test button-3.45 {ButtonWidgetCmd procedure, "select" option} -body { + radiobutton .r -variable radiovar -value red + set radiovar yellow + trace variable radiovar w bogusTrace + catch {.r select} + list $errorInfo $radiovar +} -cleanup { + destroy .r + trace vdelete radiovar w bogusTrace +} -match {glob} -result {{*trace aborted while executing * ".r select"} red} -test button-4.43 {ButtonWidgetCmd procedure, "toggle" option} { - list [catch {.l toggle} msg] $msg -} {1 {bad option "toggle": must be cget or configure}} -test button-4.44 {ButtonWidgetCmd procedure, "toggle" option} { - list [catch {.b toggle} msg] $msg -} {1 {bad option "toggle": must be cget, configure, flash, or invoke}} -test button-4.45 {ButtonWidgetCmd procedure, "toggle" option} { - list [catch {.r toggle} msg] $msg -} {1 {bad option "toggle": must be cget, configure, deselect, flash, invoke, or select}} -test button-4.46 {ButtonWidgetCmd procedure, "toggle" option} { - list [catch {.c toggle foo} msg] $msg -} {1 {wrong # args: should be ".c toggle"}} -test button-4.47 {ButtonWidgetCmd procedure, "toggle" option} { - set value bogus - .c configure -command {} -variable value -onvalue sunshine -offvalue rain + +# ex 4.43 +test button-3.46 {ButtonWidgetCmd procedure, "toggle" option} -body { + label .l + .l toggle +} -cleanup { + destroy .l +} -returnCodes {error} -result {bad option "toggle": must be cget or configure} +test button-3.47 {ButtonWidgetCmd procedure, "toggle" option} -body { + button .b + .b toggle +} -cleanup { + destroy .b +} -returnCodes {error} -result {bad option "toggle": must be cget, configure, flash, or invoke} +test button-3.48 {ButtonWidgetCmd procedure, "toggle" option} -body { + radiobutton .r + .r toggle +} -cleanup { + destroy .r +} -returnCodes {error} -result {bad option "toggle": must be cget, configure, deselect, flash, invoke, or select} +test button-3.49 {ButtonWidgetCmd procedure, "toggle" option} -body { + checkbutton .c + .c toggle foo +} -cleanup { + destroy .c +} -returnCodes {error} -result {wrong # args: should be ".c toggle"} +test button-3.50 {ButtonWidgetCmd procedure, "toggle" option} -body { + set checkvar bogus + checkbutton .c -variable checkvar -onvalue sunshine -offvalue rain + .c toggle + set result $checkvar .c toggle - set result $value + lappend result $checkvar .c toggle - lappend result $value + lappend result $checkvar + return $result +} -cleanup { + destroy .c +} -result {sunshine rain sunshine} +test button-3.51 {ButtonWidgetCmd procedure, "toggle" option} -body { + checkbutton .c -variable checkvar -onvalue xyz -offvalue abc + set checkvar xyz + trace variable checkvar w bogusTrace .c toggle - lappend result $value -} {sunshine rain sunshine} -test button-4.48 {ButtonWidgetCmd procedure, "toggle" option} -body { - .c configure -onvalue xyz -offvalue abc - set value xyz - trace variable value w bogusTrace - set result [list [catch {.c toggle} msg] $msg $errorInfo $value] - trace vdelete value w bogusTrace - set result -} -match glob -result {1 {can't set "value": trace aborted} {*trace aborted +} -cleanup { + destroy .c + trace vdelete checkvar w bogusTrace +} -returnCodes {error} -result {can't set "checkvar": trace aborted} +test button-3.52 {ButtonWidgetCmd procedure, "toggle" option} -body { + checkbutton .c -variable checkvar -onvalue xyz -offvalue abc + set checkvar xyz + trace variable checkvar w bogusTrace + catch {.c toggle} + list $errorInfo $checkvar +} -cleanup { + trace vdelete checkvar w bogusTrace + destroy .c +} -match {glob} -result {{*trace aborted while executing * ".c toggle"} abc} -test button-4.49 {ButtonWidgetCmd procedure, "toggle" option} -body { - .c configure -onvalue xyz -offvalue abc - set value abc - trace variable value w bogusTrace - set result [list [catch {.c toggle} msg] $msg $errorInfo $value] - trace vdelete value w bogusTrace - set result -} -match glob -result {1 {can't set "value": trace aborted} {*trace aborted +test button-3.53 {ButtonWidgetCmd procedure, "toggle" option} -body { + checkbutton .c -variable checkvar -onvalue xyz -offvalue abc + set checkvar abc + trace variable checkvar w bogusTrace + .c toggle +} -cleanup { + trace vdelete checkvar w bogusTrace + destroy .c +} -returnCodes {error} -result {can't set "checkvar": trace aborted} +test button-3.54 {ButtonWidgetCmd procedure, "toggle" option} -body { + checkbutton .c -variable checkvar -onvalue xyz -offvalue abc + set checkvar abc + trace variable checkvar w bogusTrace + catch {.c toggle} + list $errorInfo $checkvar +} -cleanup { + trace vdelete checkvar w bogusTrace + destroy .c +} -match {glob} -result {{*trace aborted while executing * ".c toggle"} xyz} -test button-4.50 {ButtonWidgetCmd procedure, "toggle" option} { - catch {unset value}; set value(1) 1; - set result [list [catch {.c toggle} msg] $msg $errorInfo] - unset value; - set result -} {1 {can't set "value": variable is array} {can't set "value": variable is array +test button-3.55 {ButtonWidgetCmd procedure, "toggle" option} -setup { + unset -nocomplain checkvar +} -body { + checkbutton .c -variable checkvar -onvalue xyz -offvalue abc + unset checkvar + set checkvar(1) 1 + .c toggle +} -cleanup { + destroy .c +} -returnCodes {error} -result {can't set "checkvar": variable is array} +test button-3.56 {ButtonWidgetCmd procedure, "toggle" option} -setup { + unset -nocomplain checkvar +} -body { + checkbutton .c -variable checkvar -onvalue xyz -offvalue abc + unset checkvar + set checkvar(1) 1 + catch {.c toggle} + return $errorInfo +} -cleanup { + destroy .c +} -match {glob} -result {can't set "checkvar": variable is array while executing -".c toggle"}} +".c toggle"} -test button-5.1 {DestroyButton procedure} testImageType { +test button-4.1 {DestroyButton procedure} -constraints { + testImageType +} -setup { image create test image1 + unset -nocomplain x +} -body { button .b1 -image image1 button .b2 -fg #ff0000 -text "Button 2" button .b3 -state active -text "Button 3" @@ -437,402 +3211,722 @@ test button-5.1 {DestroyButton procedure} testImageType { checkbutton .b5 -variable x -text "Checkbutton 5" set x 1 pack .b1 .b2 .b3 .b4 .b5 - update - deleteWindows -} {} - -test button-6.1 {ConfigureButton - textvariable trace} { - catch {destroy .b1} - button .b1 -bd 4 -bg green - catch {.b1 configure -bd 7 -bg green -fg bogus} - list [catch {.b1 configure -bd 7 -bg red -fg bogus} msg] \ - $msg [.b1 cget -bd] [.b1 cget -bg] -} {1 {unknown color name "bogus"} 4 green} -test button-6.2 {ConfigureButton - textvariable trace} { - catch {destroy .b1} + update + deleteWindows +} -cleanup { + destroy .b1 .b2 .b3 .b4 .b5 + image delete image1 +} -result {} + +test button-5.1 {ConfigureButton - textvariable trace} -body { + button .b -bd 4 -bg green + .b configure -bd 7 -bg red -fg bogus +} -cleanup { + destroy .b +} -returnCodes {error} -result {unknown color name "bogus"} +test button-5.2 {ConfigureButton - textvariable trace} -body { + button .b -bd 4 -bg green + catch {.b configure -bd 7 -bg red -fg bogus} + list [.b cget -bd] [.b cget -bg] +} -cleanup { + destroy .b +} -result {4 green} +test button-5.3 {ConfigureButton - textvariable trace} -body { + button .b -textvariable x set x From-x set y From-y - button .b1 -textvariable x - .b1 configure -textvariable y + .b configure -textvariable y set x New - lindex [.b1 configure -text] 4 -} {From-y} -test button-6.2a {ConfigureButton - variable traces} { - catch {destroy .b1} - catch {unset x} - checkbutton .b1 -variable x + lindex [.b configure -text] 4 +} -cleanup { + destroy .b +} -result {From-y} +test button-5.4 {ConfigureButton - variable trace} -body { ;# ex 6.2a + checkbutton .c -variable x set x 1 set y 1 - .b1 configure -textvariable y + .c configure -textvariable y set x 0 - .b1 toggle - set y -} {1} -test button-6.3 {ConfigureButton - image handling} testImageType { - catch {destroy .b1} - eval image delete [image names] + .c toggle + return $y +} -cleanup { + destroy .c +} -result {1} + +test button-5.5 {ConfigureButton - image handling} -constraints { + testImageType +} -setup { image create test image1 image create test image2 - button .b1 -image image1 +} -body { + button .b -image image1 image delete image1 - .b1 configure -image image2 + .b configure -image image2 image names -} {image2} -test button-6.5 {ConfigureButton - default value for variable} { - catch {destroy .b1} - checkbutton .b1 - .b1 cget -variable -} {b1} -test button-6.6 {ConfigureButton - setting selected state from variable} { - catch {destroy .b1} +} -cleanup { + destroy .b + image delete image1 image2 +} -result {image2} + +test button-5.6 {ConfigureButton - default value for variable} -body { + checkbutton .c + .c cget -variable +} -cleanup { + destroy .c +} -result {c} +test button-5.7 {ConfigureButton - setting selected state from variable} -body { set x 0 set y Shiny - checkbutton .b1 -variable x - .b1 configure -variable y -onvalue Shiny - .b1 toggle - set y -} 0 -test button-6.7 {ConfigureButton - setting selected state from variable} { - catch {destroy .b1} - catch {unset x} - checkbutton .b1 -variable x -offvalue Bogus - set x -} Bogus -test button-6.8 {ConfigureButton - setting selected state from variable} { - catch {destroy .b1} - catch {unset x} - radiobutton .b1 -variable x - set x -} {} -test button-6.9 {ConfigureButton - error in setting variable} { - catch {destroy .b1} - catch {unset x} + checkbutton .c -variable x + .c configure -variable y -onvalue Shiny + .c toggle + return $y +} -cleanup { + destroy .c +} -result {0} +test button-5.8 {ConfigureButton - setting selected state from variable} -setup { + unset -nocomplain x +} -body { + checkbutton .c -variable x -offvalue Bogus + return $x +} -cleanup { + destroy .c +} -result {Bogus} + +test button-5.9 {ConfigureButton - setting selected state from variable} -setup { + unset -nocomplain x +} -body { + radiobutton .r -variable x + return $x +} -cleanup { + destroy .r +} -result {} + +test button-5.10 {ConfigureButton - error in setting variable} -setup { + unset -nocomplain x +} -body { trace variable x w bogusTrace - set result [list [catch {radiobutton .b1 -variable x} msg] $msg] + radiobutton .r -variable x +} -cleanup { + destroy .r trace vdelete x w bogusTrace - set result -} {1 {can't set "x": trace aborted}} -test button-6.10 {ConfigureButton - bad image name} { - catch {destroy .b1} - list [catch {button .b1 -image bogus} msg] $msg -} {1 {image "bogus" doesn't exist}} -test button-6.11 {ConfigureButton - setting variable from current text value} { - catch {destroy .b1} - catch {unset x} - button .b1 -textvariable x -text "Button 1" - set x -} {Button 1} -test button-6.12 {ConfigureButton - using current value of variable} { - catch {destroy .b1} +} -returnCodes {error} -result {can't set "x": trace aborted} + +test button-5.11 {ConfigureButton - bad image name} -body { + button .b -image bogus +} -cleanup { + destroy .b +} -returnCodes {error} -result {image "bogus" doesn't exist} + +test button-5.12 {ConfigureButton - setting variable from current text value} -setup { + unset -nocomplain x +} -body { + button .b -textvariable x -text "Button 1" + return $x +} -cleanup { + destroy .b +} -result {Button 1} + +test button-5.13 {ConfigureButton - using current value of variable} -body { set x Override - button .b1 -textvariable x -text "Button 1" - set x -} {Override} -test button-6.13 {ConfigureButton - variable handling} { - catch {destroy .b1} - catch {unset x} + button .b -textvariable x -text "Button 1" + return $x +} -cleanup { + destroy .b +} -result {Override} + +test button-5.14 {ConfigureButton - variable handling} -setup { + unset -nocomplain x +} -body { + trace variable x w bogusTrace + radiobutton .r -text foo -textvariable x +} -cleanup { + trace vdelete x w bogusTrace + destroy .r +} -returnCodes {error} -result {can't set "x": trace aborted} +test button-5.15 {ConfigureButton - variable handling} -setup { + unset -nocomplain x +} -body { trace variable x w bogusTrace - set result [list [catch {radiobutton .b1 -text foo -textvariable x} msg] \ - $msg $x] + catch {radiobutton .r -text foo -textvariable x} + return $x +} -cleanup { trace vdelete x w bogusTrace - set result -} {1 {can't set "x": trace aborted} foo} -test button-6.14 {ConfigureButton - -width option} { - catch {destroy .b1} - button .b1 -text "Button 1" - list [catch {.b1 configure -width 1i} msg] $msg $errorInfo -} {1 {expected integer but got "1i"} {expected integer but got "1i" + destroy .r +} -result {foo} + +#ex 6.14 +test button-5.16 {ConfigureButton - -width option} -body { + button .b -text "Button 1" + .b configure -width 1i +} -cleanup { + destroy .b +} -returnCodes {error} -result {expected integer but got "1i"} +test button-5.17 {ConfigureButton - -width option} -body { + button .b -text "Button 1" + catch {.b configure -width 1i} + return $errorInfo +} -cleanup { + destroy .b +} -result {expected integer but got "1i" (processing -width option) invoked from within -".b1 configure -width 1i"}} -test button-6.15 {ConfigureButton - -height option} { - catch {destroy .b1} - button .b1 -text "Button 1" - list [catch {.b1 configure -height 0.5c} msg] $msg $errorInfo -} {1 {expected integer but got "0.5c"} {expected integer but got "0.5c" +".b configure -width 1i"} +test button-5.18 {ConfigureButton - -height option} -body { + button .b -text "Button 1" + .b configure -height 0.5c +} -cleanup { + destroy .b +} -returnCodes {error} -result {expected integer but got "0.5c"} +test button-5.19 {ConfigureButton - -height option} -body { + button .b -text "Button 1" + catch {.b configure -height 0.5c} + return $errorInfo +} -cleanup { + destroy .b +} -result {expected integer but got "0.5c" (processing -height option) invoked from within -".b1 configure -height 0.5c"}} -test button-6.16 {ConfigureButton - -width option} { - catch {destroy .b1} - button .b1 -bitmap questhead - list [catch {.b1 configure -width abc} msg] $msg $errorInfo -} {1 {bad screen distance "abc"} {bad screen distance "abc" +".b configure -height 0.5c"} +#ex 6.16 +test button-5.20 {ConfigureButton - -width option} -body { + button .b -bitmap questhead + .b configure -width abc +} -cleanup { + destroy .b +} -returnCodes {error} -result {bad screen distance "abc"} +test button-5.21 {ConfigureButton - -width option} -body { + button .b -bitmap questhead + catch {.b configure -width abc} + return $errorInfo +} -cleanup { + destroy .b +} -result {bad screen distance "abc" (processing -width option) invoked from within -".b1 configure -width abc"}} -test button-6.17 {ConfigureButton - -height option} testImageType { - catch {destroy .b1} - eval image delete [image names] +".b configure -width abc"} +test button-5.22 {ConfigureButton - -height option} -constraints { + testImageType +} -setup { image create test image1 - button .b1 -image image1 - list [catch {.b1 configure -height 0.5x} msg] $msg $errorInfo -} {1 {bad screen distance "0.5x"} {bad screen distance "0.5x" +} -body { + button .b -image image1 + .b configure -height 0.5x +} -cleanup { + destroy .b + image delete image1 +} -returnCodes {error} -result {bad screen distance "0.5x"} +test button-5.23 {ConfigureButton - -height option} -constraints { + testImageType +} -setup { + image create test image1 +} -body { +#ztestImageType + button .b -image image1 + catch {.b configure -height 0.5x} + return $errorInfo +} -cleanup { + destroy .b + image delete image1 +} -result {bad screen distance "0.5x" (processing -height option) invoked from within -".b1 configure -height 0.5x"}} -test button-6.18 {ConfigureButton - computing geometry} {nonPortable fonts} { - catch {destroy .b1} - button .b1 -text "Sample text" -width 10 -height 2 - pack .b1 - set result "[winfo reqwidth .b1] [winfo reqheight .b1]" - .b1 configure -bitmap questhead - lappend result [winfo reqwidth .b1] [winfo reqheight .b1] -} {102 46 20 12} -test button-6.19 {ConfigureButton - computing geometry} { - catch {destroy .b1} - button .b1 -text "Button 1" - set old [winfo reqwidth .b1] - .b1 configure -text "Much longer text" - set new [winfo reqwidth .b1] - expr $old == $new -} {0} - -test button-7.1 {ButtonEventProc procedure} { - catch {destroy .b1} - button .b1 -text "Test Button" -command { - destroy .b1 - set x [list [winfo exists .b1] [info commands .b1]] - } - .b1 invoke - set x -} {0 {}} -test button-7.2 {ButtonEventProc procedure} { - deleteWindows +".b configure -height 0.5x"} +#ex 6.18 +test button-5.24 {ConfigureButton - computing geometry} -constraints { + fonts +} -body { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + .b configure -text "Sample text" -width 10 -height 2 + pack .b + set result "[winfo reqwidth .b] [winfo reqheight .b]" + .b configure -bitmap questhead + lappend result [winfo reqwidth .b] [winfo reqheight .b] +} -cleanup { + destroy .b +} -result {104 46 20 12} + +test button-5.25 {ConfigureButton - computing geometry} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} +} -body { + .b configure -text "Button 1" + set old [winfo reqwidth .b] + .b configure -text "Much longer text" + set new [winfo reqwidth .b] + expr {$old == $new} +} -cleanup { + destroy .b +} -result {0} + +test button-6.1 {ButtonEventProc procedure} -body { + button .b -text "Test Button" -command { + destroy .b + set x [list [winfo exists .b] [info commands .b]] +} + .b invoke + return $x +} -cleanup { + destroy .b +} -result {0 {}} + +test button-6.2 {ButtonEventProc procedure} -setup { + set x {} +} -body { button .b1 -bg #543210 rename .b1 .b2 - set x {} lappend x [winfo children .] lappend x [.b2 cget -bg] destroy .b1 lappend x [info command .b*] [winfo children .] -} {.b1 #543210 {} {}} +} -cleanup { + destroy .b1 +} -result {.b1 #543210 {} {}} -test button-8.1 {ButtonCmdDeletedProc procedure} { - deleteWindows - button .b1 - rename .b1 {} +test button-7.1 {ButtonCmdDeletedProc procedure} -body { + button .b + rename .b {} list [info command .b*] [winfo children .] -} {{} {}} +} -cleanup { + destroy .b +} -result {{} {}} -test button-9.1 {TkInvokeButton procedure} { - catch {destroy .b1} +test button-8.1 {TkInvokeButton procedure} -setup { set x 0 - checkbutton .b1 -variable x +} -body { + checkbutton .c -variable x set result $x - .b1 invoke + .c invoke lappend result $x - .b1 invoke + .c invoke lappend result $x -} {0 1 0} -test button-9.2 {TkInvokeButton procedure} { - catch {destroy .b1} +} -cleanup { + destroy .c +} -result {0 1 0} + +test button-8.2 {TkInvokeButton procedure} -setup { + set x 0 +} -body { + checkbutton .c -variable x + trace variable x w bogusTrace + .c invoke +} -cleanup { + destroy .c + trace vdelete x w bogusTrace +} -returnCodes {error} -result {can't set "x": trace aborted} +test button-8.3 {TkInvokeButton procedure} -setup { set x 0 - checkbutton .b1 -variable x +} -body { + checkbutton .c -variable x + trace variable x w bogusTrace + catch {.c invoke} + return $x +} -cleanup { + destroy .c + trace vdelete x w bogusTrace +} -result {1} +test button-8.4 {TkInvokeButton procedure} -setup { + set x 1 +} -body { + checkbutton .c -variable x trace variable x w bogusTrace - set result [list [catch {.b1 invoke} msg] $msg $x] + .c invoke +} -cleanup { + destroy .c trace vdelete x w bogusTrace - set result -} {1 {can't set "x": trace aborted} 1} -test button-9.3 {TkInvokeButton procedure} { - catch {destroy .b1} +} -returnCodes {error} -result {can't set "x": trace aborted} +test button-8.5 {TkInvokeButton procedure} -setup { set x 1 - checkbutton .b1 -variable x +} -body { + checkbutton .c -variable x trace variable x w bogusTrace - set result [list [catch {.b1 invoke} msg] $msg $x] + catch {.c invoke} + return $x +} -cleanup { + destroy .c trace vdelete x w bogusTrace - set result -} {1 {can't set "x": trace aborted} 0} -test button-9.4 {TkInvokeButton procedure} { - catch {destroy .b1} +} -result {0} + +test button-8.6 {TkInvokeButton procedure} -setup { set x 0 - radiobutton .b1 -variable x -value red +} -body { + radiobutton .r -variable x -value red set result $x - .b1 invoke + .r invoke lappend result $x - .b1 invoke + .r invoke lappend result $x -} {0 red red} -test button-9.5 {TkInvokeButton procedure} -body { - catch {destroy .b1} - radiobutton .b1 -variable x -value red +} -cleanup { + destroy .r +} -result {0 red red} + +test button-8.7 {TkInvokeButton procedure} -body { + radiobutton .r -variable x -value red + set x green + trace variable x w bogusTrace + .r invoke +} -cleanup { + destroy .r + trace vdelete x w bogusTrace +} -returnCodes {error} -result {can't set "x": trace aborted} +test button-8.8 {TkInvokeButton procedure} -body { + radiobutton .r -variable x -value red set x green trace variable x w bogusTrace - set result [list [catch {.b1 invoke} msg] $msg $errorInfo $x] + catch {.r invoke} + list $errorInfo $x +} -cleanup { + destroy .r trace vdelete x w bogusTrace - set result -} -match glob -result {1 {can't set "x": trace aborted} {*trace aborted +} -match {glob} -result {{*trace aborted while executing * -".b1 invoke"} red} -test button-9.6 {TkInvokeButton procedure} { - deleteWindows +".r invoke"} red} + +#ex 9.6 +test button-8.9 {TkInvokeButton procedure} -setup { set result untouched - button .b1 -command {set result invoked} - list [catch {.b1 invoke} msg] $msg $result -} {0 invoked invoked} -test button-9.7 {TkInvokeButton procedure} { - deleteWindows +} -body { + button .b -command {set result invoked} + set msg [.b invoke] + list $msg $result +} -cleanup { + destroy .b +} -result {invoked invoked} +test button-8.10 {TkInvokeButton procedure} -setup { set result untouched set x 0 - checkbutton .b1 -variable x -command {set result "invoked $x"} - list [catch {.b1 invoke} msg] $msg $result -} {0 {invoked 1} {invoked 1}} -test button-9.8 {TkInvokeButton procedure} { - deleteWindows +} -body { + checkbutton .c -variable x -command {set result "invoked $x"} + set msg [.c invoke] + list $msg $result +} -cleanup { + destroy .c +} -result {{invoked 1} {invoked 1}} +test button-8.11 {TkInvokeButton procedure} -setup { set result untouched set x 0 - radiobutton .b1 -variable x -value red -command {set result "invoked $x"} - list [catch {.b1 invoke} msg] $msg $result -} {0 {invoked red} {invoked red}} +} -body { + radiobutton .r -variable x -value red -command {set result "invoked $x"} + set msg [.r invoke] + list $msg $result +} -cleanup { + destroy .r +} -result {{invoked red} {invoked red}} -test button-10.1 {ButtonVarProc procedure} { - deleteWindows +test button-9.1 {ButtonVarProc procedure} -body { set x 1 - checkbutton .b1 -variable x + checkbutton .c -variable x unset x set result [info exists x] - .b1 toggle + .c toggle lappend result $x set x 0 - .b1 toggle + .c toggle lappend result $x -} {0 1 1} -test button-10.2 {ButtonVarProc procedure} { - deleteWindows +} -cleanup { + destroy .c +} -result {0 1 1} +test button-9.2 {ButtonVarProc procedure} -body { set x 0 - checkbutton .b1 -variable x + checkbutton .c -variable x set x 44 - .b1 toggle - set x -} {1} -test button-10.3 {ButtonVarProc procedure} { - deleteWindows + .c toggle + return $x +} -cleanup { + destroy .c +} -result {1} +test button-9.3 {ButtonVarProc procedure} -setup { set x 1 - checkbutton .b1 -variable x +} -body { + checkbutton .c -variable x set x 44 - .b1 toggle - set x -} {1} -test button-10.4 {ButtonVarProc procedure} { - deleteWindows + .c toggle + return $x +} -cleanup { + destroy .c +} -result {1} +test button-9.4 {ButtonVarProc procedure} -setup { set x 0 - checkbutton .b1 -variable x +} -body { + checkbutton .c -variable x set x 1 - .b1 toggle - set x -} {0} -test button-10.5 {ButtonVarProc procedure} { - deleteWindows + .c toggle + return $x +} -cleanup { + destroy .c +} -result {0} +test button-9.5 {ButtonVarProc procedure} -setup { set x 1 - checkbutton .b1 -variable x +} -body { + checkbutton .c -variable x set x 1 - .b1 toggle - set x -} {0} -test button-10.6 {ButtonVarProc procedure} { - deleteWindows + .c toggle + return $x +} -cleanup { + destroy .c +} -result {0} +test button-9.6 {ButtonVarProc procedure} -setup { set x 0 - checkbutton .b1 -variable x +} -body { + checkbutton .c -variable x set x 0 - .b1 toggle - set x -} {1} -test button-10.7 {ButtonVarProc procedure} { - deleteWindows + .c toggle + return $x +} -cleanup { + destroy .c +} -result {1} +test button-9.7 {ButtonVarProc procedure} -setup { set x 1 - checkbutton .b1 -variable x +} -body { + checkbutton .c -variable x set x 0 - .b1 toggle - set x -} {1} -test button-10.8 {ButtonVarProc procedure, can't read variable} { - # This test does nothing but produce a core dump if there's a prbblem. - deleteWindows - catch {unset a} - checkbutton .b1 -variable a + .c toggle + return $x +} -cleanup { + destroy .c +} -result {1} +test button-9.8 {ButtonVarProc procedure, can't read variable} -setup { +# This test does nothing but produce a core dump if there's a prbblem. + unset -nocomplain a +} -body { + checkbutton .c -variable a unset a set a(32) 0 unset a -} {} +} -cleanup { + destroy .c +} -result {} -test button-11.1 {ButtonTextVarProc procedure} { - deleteWindows +test button-10.1 {ButtonTextVarProc procedure} -body { set x Label - button .b1 -textvariable x + button .b -textvariable x unset x - set result [list $x [lindex [.b1 configure -text] 4]] + set result [list $x [.b cget -text]] set x New - lappend result [lindex [.b1 configure -text] 4] -} {Label Label New} -test button-11.2 {ButtonTextVarProc procedure} { - deleteWindows - # Windows buttons have a default min width, so we have to - # set this to be longer to force the wider button. + lappend result [.b cget -text] +} -cleanup { + destroy .b +} -result {Label Label New} +test button-10.2 {ButtonTextVarProc procedure} -setup { + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} +} -body { +# Windows buttons have a default min width, so we have to +# set this to be longer to force the wider button. set x ExtraLongLabel - button .b1 -textvariable x - set old [winfo reqwidth .b1] + .b configure -textvariable x + set old [winfo reqwidth .b] set x New - set new [winfo reqwidth .b1] - list [lindex [.b1 configure -text] 4] [expr $old == $new] -} {New 0} + set new [winfo reqwidth .b] + expr {$old == $new} +} -cleanup { + destroy .b +} -result {0} -test button-12.1 {ButtonImageProc procedure} testImageType { - deleteWindows - eval image delete [image names] +test button-11.1 {ButtonImageProc procedure} -constraints { + testImageType +} -setup { + label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} image create test image1 - label .b1 -image image1 -padx 0 -pady 0 -bd 0 - pack .b1 - set result "[winfo reqwidth .b1] [winfo reqheight .b1]" +} -body { + .l configure -image image1 -padx 0 -pady 0 -bd 0 + pack .l + set result "[winfo reqwidth .l] [winfo reqheight .l]" image1 changed 0 0 0 0 80 100 - lappend result [winfo reqwidth .b1] [winfo reqheight .b1] -} {30 15 80 100} - -deleteWindows -set l [interp hidden] + lappend result [winfo reqwidth .l] [winfo reqheight .l] +} -cleanup { + destroy .l + image delete image1 +} -result {30 15 80 100} -test button-13.1 {button widget vs hidden commands} { - catch {destroy .b} +test button-12.1 {button widget vs hidden commands} -body { button .b -text hello + set l [interp hidden] interp hide {} .b destroy .b - list [winfo children .] [interp hidden] -} [list {} $l] - -deleteWindows - -test button-14.1 {size behaviouor} { - set res {} - foreach class {label button radiobutton checkbutton} { - eval destroy [winfo children .] - - $class .a -text Hej - $class .b -text Hej -width 10 -height 1 - $class .c -text "" -width 10 -height 1 - - for {set t 0} {$t < 2} {incr t} { - set res2 {} - # With -width, width should not be affected by text change - lappend res2 [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}] - # With -height, height should not be affected by text change - lappend res2 [expr {[winfo reqheight .b] == [winfo reqheight .c]}] - # A one line text should be as high as -height 1 - lappend res2 [expr {[winfo reqheight .a] == [winfo reqheight .b]}] - lappend res $res2 - - # Do the second round with another font - .a configure -font "Arial 20" - .b configure -font "Arial 20" - .c configure -font "Arial 20" - } - } - set res -} {{1 1 1} {1 1 1} {1 1 1} {1 1 1} {1 1 1} {1 1 1} {1 1 1} {1 1 1}} - -deleteWindows - -option clear - -# cleanup + + set res1 [list [winfo children .] [interp hidden]] + set res2 [list {} $l] + expr {$res1 == $res2} +} -cleanup { + destroy .b +} -result {1} + +test button-13.1 {size behaviouor: label} -setup { + option add *Button.borderwidth 2 + option add *Button.highlightThickness 2 + option add *Button.font {Helvetica -12 bold} + set result {} +} -body { + label .a -text Hej + label .b -text Hej -width 10 -height 1 + label .c -text "" -width 10 -height 1 + +# With -width, width should not be affected by text change + lappend result [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}] +# With -height, height should not be affected by text change + lappend result [expr {[winfo reqheight .b] == [winfo reqheight .c]}] +# A one line text should be as high as -height 1 + lappend result [expr {[winfo reqheight .a] == [winfo reqheight .b]}] +} -cleanup { + destroy .a .b .c + option clear +} -result {1 1 1} + +test button-13.2 {size behaviouor: label} -setup { + option add *Button.borderwidth 2 + option add *Button.highlightThickness 2 + option add *Button.font {Arial 20} + set result {} +} -body { + label .a -text Hej + label .b -text Hej -width 10 -height 1 + label .c -text "" -width 10 -height 1 + +# With -width, width should not be affected by text change + lappend result [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}] +# With -height, height should not be affected by text change + lappend result [expr {[winfo reqheight .b] == [winfo reqheight .c]}] +# A one line text should be as high as -height 1 + lappend result [expr {[winfo reqheight .a] == [winfo reqheight .b]}] +} -cleanup { + destroy .a .b .c + option clear +} -result {1 1 1} + +test button-13.3 {size behaviouor: button} -setup { + option add *Button.borderwidth 2 + option add *Button.highlightThickness 2 + option add *Button.font {Helvetica -12 bold} + set result {} +} -body { + label .a -text Hej + label .b -text Hej -width 10 -height 1 + label .c -text "" -width 10 -height 1 + +# With -width, width should not be affected by text change + lappend result [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}] +# With -height, height should not be affected by text change + lappend result [expr {[winfo reqheight .b] == [winfo reqheight .c]}] +# A one line text should be as high as -height 1 + lappend result [expr {[winfo reqheight .a] == [winfo reqheight .b]}] +} -cleanup { + destroy .a .b .c + option clear +} -result {1 1 1} +test button-13.4 {size behaviouor: button} -setup { + option add *Button.borderwidth 2 + option add *Button.highlightThickness 2 + option add *Button.font {Arial 20} + set result {} +} -body { + button .a -text Hej + button .b -text Hej -width 10 -height 1 + button .c -text "" -width 10 -height 1 + +# With -width, width should not be affected by text change + lappend result [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}] +# With -height, height should not be affected by text change + lappend result [expr {[winfo reqheight .b] == [winfo reqheight .c]}] +# A one line text should be as high as -height 1 + lappend result [expr {[winfo reqheight .a] == [winfo reqheight .b]}] +} -cleanup { + destroy .a .b .c + option clear +} -result {1 1 1} + +test button-13.5 {size behaviouor: radiobutton} -setup { + option add *Button.borderwidth 2 + option add *Button.highlightThickness 2 + option add *Button.font {Helvetica -12 bold} + set result {} +} -body { + radiobutton .a -text Hej + radiobutton .b -text Hej -width 10 -height 1 + radiobutton .c -text "" -width 10 -height 1 + +# With -width, width should not be affected by text change + lappend result [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}] +# With -height, height should not be affected by text change + lappend result [expr {[winfo reqheight .b] == [winfo reqheight .c]}] +# A one line text should be as high as -height 1 + lappend result [expr {[winfo reqheight .a] == [winfo reqheight .b]}] +} -cleanup { + destroy .a .b .c + option clear +} -result {1 1 1} + +test button-13.6 {size behaviouor: radiobutton} -setup { + option add *Button.borderwidth 2 + option add *Button.highlightThickness 2 + option add *Button.font {Arial 20} + set result {} +} -body { + radiobutton .a -text Hej + radiobutton .b -text Hej -width 10 -height 1 + radiobutton .c -text "" -width 10 -height 1 + +# With -width, width should not be affected by text change + lappend result [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}] +# With -height, height should not be affected by text change + lappend result [expr {[winfo reqheight .b] == [winfo reqheight .c]}] +# A one line text should be as high as -height 1 + lappend result [expr {[winfo reqheight .a] == [winfo reqheight .b]}] +} -cleanup { + destroy .a .b .c + option clear +} -result {1 1 1} + +test button-13.7 {size behaviouor: checkbutton} -setup { + option add *Button.borderwidth 2 + option add *Button.highlightThickness 2 + option add *Button.font {Helvetica -12 bold} + set result {} +} -body { + checkbutton .a -text Hej + checkbutton .b -text Hej -width 10 -height 1 + checkbutton .c -text "" -width 10 -height 1 + +# With -width, width should not be affected by text change + lappend result [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}] +# With -height, height should not be affected by text change + lappend result [expr {[winfo reqheight .b] == [winfo reqheight .c]}] +# A one line text should be as high as -height 1 + lappend result [expr {[winfo reqheight .a] == [winfo reqheight .b]}] +} -cleanup { + destroy .a .b .c + option clear +} -result {1 1 1} + +test button-13.8 {size behaviouor: checkbutton} -setup { + option add *Button.borderwidth 2 + option add *Button.highlightThickness 2 + option add *Button.font {Arial 20} + set result {} +} -body { + checkbutton .a -text Hej + checkbutton .b -text Hej -width 10 -height 1 + checkbutton .c -text "" -width 10 -height 1 + +# With -width, width should not be affected by text change + lappend result [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}] +# With -height, height should not be affected by text change + lappend result [expr {[winfo reqheight .b] == [winfo reqheight .c]}] +# A one line text should be as high as -height 1 + lappend result [expr {[winfo reqheight .a] == [winfo reqheight .b]}] +} -cleanup { + destroy .a .b .c + option clear +} -result {1 1 1} + + cleanupTests return + + + + + + + + + diff --git a/tests/entry.test b/tests/entry.test index dadf623..83d16a0 100644 --- a/tests/entry.test +++ b/tests/entry.test @@ -6,223 +6,882 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: entry.test,v 1.22 2007/12/13 15:27:54 dgp Exp $ +# RCS: @(#) $Id: entry.test,v 1.23 2008/07/22 11:55:57 aniap Exp $ -package require tcltest 2.1 +package require tcltest 2.2 +namespace import ::tcltest::* eval tcltest::configure $argv tcltest::loadTestedCommands +# For xscrollcommand proc scroll args { - global scrollInfo - set scrollInfo $args + global scrollInfo + set scrollInfo $args +} +# For trace variable +proc override args { + global x + set x 12345 } -# Create additional widget that's used to hold the selection at times. - -entry .sel -.sel insert end "This is some sample text" - -# Font names - -set big -adobe-helvetica-medium-r-normal--24-240-75-75-p-*-iso8859-1 -set fixed -adobe-courier-medium-r-normal--12-120-75-75-m-*-iso8859-1 - -# Create entries in the option database to be sure that geometry options -# like border width have predictable values. - -option add *Entry.borderWidth 2 -option add *Entry.highlightThickness 2 -option add *Entry.font {Helvetica -12} - -entry .e -bd 2 -relief sunken -pack .e -update - -set i 1 -foreach test { - {-background #ff0000 #ff0000 non-existent - {unknown color name "non-existent"}} - {-bd 4 4 badValue {bad screen distance "badValue"}} - {-bg #ff0000 #ff0000 non-existent {unknown color name "non-existent"}} - {-borderwidth 1.3 1 badValue {bad screen distance "badValue"}} - {-cursor arrow arrow badValue {bad cursor spec "badValue"}} - {-disabledbackground green green non-existent - {unknown color name "non-existent"}} - {-disabledforeground blue blue non-existent - {unknown color name "non-existent"}} - {-exportselection yes 1 xyzzy {expected boolean value but got "xyzzy"}} - {-fg #110022 #110022 bogus {unknown color name "bogus"}} - {-font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-* - -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-* {} - {font "" doesn't exist}} - {-foreground #110022 #110022 bogus {unknown color name "bogus"}} - {-highlightbackground #123456 #123456 ugly {unknown color name "ugly"}} - {-highlightcolor #123456 #123456 bogus {unknown color name "bogus"}} - {-highlightthickness 6 6 bogus {bad screen distance "bogus"}} - {-highlightthickness -2 0 {} {}} - {-insertbackground #110022 #110022 bogus {unknown color name "bogus"}} - {-insertborderwidth 1.3 1 2.6x {bad screen distance "2.6x"}} - {-insertofftime 100 100 3.2 {expected integer but got "3.2"}} - {-insertontime 100 100 3.2 {expected integer but got "3.2"}} - {-invalidcommand "any string" "any string" {} {}} - {-invcmd "any string" "any string" {} {}} - {-justify right right bogus {bad justification "bogus": must be left, right, or center}} - {-readonlybackground green green non-existent - {unknown color name "non-existent"}} - {-relief groove groove 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}} - {-selectbackground #110022 #110022 bogus {unknown color name "bogus"}} - {-selectborderwidth 1.3 1 badValue {bad screen distance "badValue"}} - {-selectforeground #654321 #654321 bogus {unknown color name "bogus"}} - {-show * * {} {}} - {-state n normal bogus - {bad state "bogus": must be disabled, normal, or readonly}} - {-takefocus "any string" "any string" {} {}} - {-textvariable i i {} {}} - {-width 402 402 3p {expected integer but got "3p"}} - {-xscrollcommand {Some command} {Some command} {} {}} -} { - lassign $test name goodValue goodResult badValue badResult - test entry-1.$i {configuration options} { - .e configure $name $goodValue - list [lindex [.e configure $name] 4] [.e cget $name] - } [list $goodResult $goodResult] - incr i - if {$badValue ne ""} { - test entry-1.$i {configuration options} -body { - .e configure $name $badValue - } -returnCodes error -result $badResult - } - .e configure $name [lindex [.e configure $name] 3] - incr i +# Procedures used in widget VALIDATION tests +proc doval {W d i P s S v V} { + set ::vVals [list $W $d $i $P $s $S $v $V] + return 1 +} +proc doval2 {W d i P s S v V} { + set ::vVals [list $W $d $i $P $s $S $v $V] + set ::e mydata + return 1 +} +proc doval3 {W d i P s S v V} { + set ::vVals [list $W $d $i $P $s $S $v $V] + return 0 } -test entry-2.1 {Tk_EntryCmd procedure} { - list [catch {entry} msg] $msg -} {1 {wrong # args: should be "entry pathName ?options?"}} -test entry-2.2 {Tk_EntryCmd procedure} { - list [catch {entry gorp} msg] $msg -} {1 {bad window path name "gorp"}} -test entry-2.3 {Tk_EntryCmd procedure} { - catch {destroy .e} +set cy [font metrics {Courier -12} -linespace] + + +test entry-1.1 {configuration option: "background" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -background #ff0000 + .e cget -background +} -cleanup { + destroy .e +} -result {#ff0000} +test entry-1.2 {configuration option: "background" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -background non-existent +} -cleanup { + destroy .e +} -returnCodes {error} -result {unknown color name "non-existent"} + +test entry-1.3 {configuration option: "bd" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -bd 4 + .e cget -bd +} -cleanup { + destroy .e +} -result {4} +test entry-1.4 {configuration option: "bd" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -bd badValue +} -cleanup { + destroy .e +} -returnCodes {error} -result {bad screen distance "badValue"} + +test entry-1.5 {configuration option: "bg" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -bg #ff0000 + .e cget -bg +} -cleanup { + destroy .e +} -result {#ff0000} +test entry-1.6 {configuration option: "bg" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -bg non-existent +} -cleanup { + destroy .e +} -returnCodes {error} -result {unknown color name "non-existent"} + +test entry-1.7 {configuration option: "borderwidth" for entry} -setup { + entry .e -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -borderwidth 1.3 + .e cget -borderwidth +} -cleanup { + destroy .e +} -result {1} +test entry-1.8 {configuration option: "borderwidth" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -borderwidth badValue +} -cleanup { + destroy .e +} -returnCodes {error} -result {bad screen distance "badValue"} + +test entry-1.9 {configuration option: "cursor" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -cursor arrow + .e cget -cursor +} -cleanup { + destroy .e +} -result {arrow} +test entry-1.10 {configuration option: "cursor" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -cursor badValue +} -cleanup { + destroy .e +} -returnCodes {error} -result {bad cursor spec "badValue"} + +test entry-1.11 {configuration option: "disabledbackground" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -disabledbackground green + .e cget -disabledbackground +} -cleanup { + destroy .e +} -result {green} +test entry-1.12 {configuration option: "disabledbackground" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -disabledbackground non-existent +} -cleanup { + destroy .e +} -returnCodes {error} -result {unknown color name "non-existent"} + +test entry-1.13 {configuration option: "disabledforeground" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -disabledforeground blue + .e cget -disabledforeground +} -cleanup { + destroy .e +} -result {blue} +test entry-1.14 {configuration option: "disabledforeground" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -disabledforeground non-existent +} -cleanup { + destroy .e +} -returnCodes {error} -result {unknown color name "non-existent"} + +test entry-1.15 {configuration option: "exportselection" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -exportselection yes + .e cget -exportselection +} -cleanup { + destroy .e +} -result {1} +test entry-1.16 {configuration option: "exportselection" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -exportselection xyzzy +} -cleanup { + destroy .e +} -returnCodes {error} -result {expected boolean value but got "xyzzy"} + +test entry-1.17 {configuration option: "fg" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -fg #110022 + .e cget -fg +} -cleanup { + destroy .e +} -result {#110022} +test entry-1.18 {configuration option: "fg" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -fg non-existent +} -cleanup { + destroy .e +} -returnCodes {error} -result {unknown color name "non-existent"} + +test entry-1.19 {configuration option: "font" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { + .e configure -font {Helvetica -12} + .e cget -font +} -cleanup { + destroy .e +} -result {Helvetica -12} +test entry-1.20 {configuration option: "font" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { + .e configure -font {} +} -cleanup { + destroy .e +} -returnCodes {error} -result {font "" doesn't exist} + +test entry-1.21 {configuration option: "foreground" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -foreground #110022 + .e cget -foreground +} -cleanup { + destroy .e +} -result {#110022} +test entry-1.22 {configuration option: "foreground" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -foreground non-existent +} -cleanup { + destroy .e +} -returnCodes {error} -result {unknown color name "non-existent"} + +test entry-1.23 {configuration option: "highlightbackground" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -highlightbackground #110022 + .e cget -highlightbackground +} -cleanup { + destroy .e +} -result {#110022} +test entry-1.24 {configuration option: "highlightbackground" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -highlightbackground non-existent +} -cleanup { + destroy .e +} -returnCodes {error} -result {unknown color name "non-existent"} + +test entry-1.25 {configuration option: "highlightcolor" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -highlightcolor #110022 + .e cget -highlightcolor +} -cleanup { + destroy .e +} -result {#110022} +test entry-1.26 {configuration option: "highlightcolor" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -highlightcolor non-existent +} -cleanup { + destroy .e +} -returnCodes {error} -result {unknown color name "non-existent"} + +test entry-1.27 {configuration option: "highlightthickness" for entry} -setup { + entry .e -borderwidth 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -highlightthickness 6 + .e cget -highlightthickness +} -cleanup { + destroy .e +} -result {6} +test entry-1.28 {configuration option: "highlightthickness" for entry} -setup { + entry .e -borderwidth 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -highlightthickness -2 + .e cget -highlightthickness +} -cleanup { + destroy .e +} -result {0} +test entry-1.29 {configuration option: "highlightthickness" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -highlightthickness badValue +} -cleanup { + destroy .e +} -returnCodes {error} -result {bad screen distance "badValue"} + +test entry-1.30 {configuration option: "insertbackground" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -insertbackground #110022 + .e cget -insertbackground +} -cleanup { + destroy .e +} -result {#110022} +test entry-1.31 {configuration option: "insertbackground" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -insertbackground non-existent +} -cleanup { + destroy .e +} -returnCodes {error} -result {unknown color name "non-existent"} + +test entry-1.32 {configuration option: "insertborderwidth" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -insertborderwidth 1.3 + .e cget -insertborderwidth +} -cleanup { + destroy .e +} -result {1} +test entry-1.33 {configuration option: "insertborderwidth" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -insertborderwidth 2.6x +} -cleanup { + destroy .e +} -returnCodes {error} -result {bad screen distance "2.6x"} + +test entry-1.34 {configuration option: "insertofftime" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -insertofftime 100 + .e cget -insertofftime +} -cleanup { + destroy .e +} -result {100} +test entry-1.35 {configuration option: "insertofftime" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -insertofftime 3.2 +} -cleanup { + destroy .e +} -returnCodes {error} -result {expected integer but got "3.2"} + +test entry-1.36 {configuration option: "insertontime" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -insertontime 100 + .e cget -insertontime +} -cleanup { + destroy .e +} -result {100} +test entry-1.37 {configuration option: "insertontime" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -insertontime 3.2 +} -cleanup { + destroy .e +} -returnCodes {error} -result {expected integer but got "3.2"} + +test entry-1.38 {configuration option: "invalidcommand" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -invalidcommand "any string" + .e cget -invalidcommand +} -cleanup { + destroy .e +} -result {any string} + +test entry-1.39 {configuration option: "invcmd" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -invcmd "any string" + .e cget -invcmd +} -cleanup { + destroy .e +} -result {any string} + +test entry-1.40 {configuration option: "justify" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -justify right + .e cget -justify +} -cleanup { + destroy .e +} -result {right} +test entry-1.41 {configuration option: "justify" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -justify bogus +} -cleanup { + destroy .e +} -returnCodes {error} -result {bad justification "bogus": must be left, right, or center} + +test entry-1.42 {configuration option: "readonlybackground" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -readonlybackground green + .e cget -readonlybackground +} -cleanup { + destroy .e +} -result {green} +test entry-1.43 {configuration option: "readonlybackground" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -readonlybackground non-existent +} -cleanup { + destroy .e +} -returnCodes {error} -result {unknown color name "non-existent"} + +test entry-1.44 {configuration option: "relief" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -relief flat + .e cget -relief +} -cleanup { + destroy .e +} -result {flat} + +test entry-1.45 {configuration option: "selectbackground" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -selectbackground #110022 + .e cget -selectbackground +} -cleanup { + destroy .e +} -result {#110022} +test entry-1.46 {configuration option: "selectbackground" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -selectbackground non-existent +} -cleanup { + destroy .e +} -returnCodes {error} -result {unknown color name "non-existent"} + +test entry-1.47 {configuration option: "selectborderwidth" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -selectborderwidth 1.3 + .e cget -selectborderwidth +} -cleanup { + destroy .e +} -result {1} +test entry-1.48 {configuration option: "selectborderwidth" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -selectborderwidth badValue +} -cleanup { + destroy .e +} -returnCodes {error} -result {bad screen distance "badValue"} + +test entry-1.49 {configuration option: "selectforeground" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -selectforeground #110022 + .e cget -selectforeground +} -cleanup { + destroy .e +} -result {#110022} +test entry-1.50 {configuration option: "selectforeground" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -selectforeground non-existent +} -cleanup { + destroy .e +} -returnCodes {error} -result {unknown color name "non-existent"} + +test entry-1.51 {configuration option: "show" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -show * + .e cget -show +} -cleanup { + destroy .e +} -result {*} + +test entry-1.52 {configuration option: "state" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -state n + .e cget -state +} -cleanup { + destroy .e +} -result {normal} +test entry-1.53 {configuration option: "state" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -state bogus +} -cleanup { + destroy .e +} -returnCodes {error} -result {bad state "bogus": must be disabled, normal, or readonly} + +test entry-1.54 {configuration option: "takefocus" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -takefocus "any string" + .e cget -takefocus +} -cleanup { + destroy .e +} -result {any string} + +test entry-1.55 {configuration option: "textvariable" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -textvariable i + .e cget -textvariable +} -cleanup { + destroy .e +} -result {i} + +test entry-1.56 {configuration option: "width" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -width 402 + .e cget -width +} -cleanup { + destroy .e +} -result {402} +test entry-1.57 {configuration option: "width" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -width 3p +} -cleanup { + destroy .e +} -returnCodes {error} -result {expected integer but got "3p"} + +test entry-1.58 {configuration option: "xscrollcommand" for entry} -setup { + entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + pack .e + update +} -body { + .e configure -xscrollcommand {Some command} + .e cget -xscrollcommand +} -cleanup { + destroy .e +} -result {Some command} + + + +test entry-2.1 {Tk_EntryCmd procedure} -body { + entry +} -returnCodes error -result {wrong # args: should be "entry pathName ?options?"} +test entry-2.2 {Tk_EntryCmd procedure} -body { + entry gorp +} -returnCodes error -result {bad window path name "gorp"} +test entry-2.3 {Tk_EntryCmd procedure} -body { entry .e + pack .e + update list [winfo exists .e] [winfo class .e] [info commands .e] -} {1 Entry .e} -test entry-2.4 {Tk_EntryCmd procedure} { - catch {destroy .e} - list [catch {entry .e -gorp foo} msg] $msg [winfo exists .e] \ - [info commands .e] -} {1 {unknown option "-gorp"} 0 {}} -test entry-2.5 {Tk_EntryCmd procedure} { - catch {destroy .e} +} -cleanup { + destroy .e +} -result {1 Entry .e} +test entry-2.4 {Tk_EntryCmd procedure} -body { + entry .e -gorp foo +} -cleanup { + destroy .e +} -returnCodes error -result {unknown option "-gorp"} +test entry-2.5 {Tk_EntryCmd procedure} -body { + catch {entry .e -gorp foo} + list [winfo exists .e] [info commands .e] +} -cleanup { + destroy .e +} -result {0 {}} +test entry-2.6 {Tk_EntryCmd procedure} -body { entry .e -} {.e} - -catch {destroy .e} -entry .e -font $fixed -pack .e -update - -set cx [font measure $fixed a] -set cy [font metrics $fixed -linespace] -set ux [font measure $fixed \u4e4e] - -test entry-3.1 {EntryWidgetCmd procedure} { - list [catch {.e} msg] $msg -} {1 {wrong # args: should be ".e option ?arg arg ...?"}} -test entry-3.2 {EntryWidgetCmd procedure, "bbox" widget command} { - list [catch {.e bbox} msg] $msg -} {1 {wrong # args: should be ".e bbox index"}} -test entry-3.3 {EntryWidgetCmd procedure, "bbox" widget command} { - list [catch {.e bbox a b} msg] $msg -} {1 {wrong # args: should be ".e bbox index"}} -test entry-3.4 {EntryWidgetCmd procedure, "bbox" widget command} { - list [catch {.e bbox bogus} msg] $msg -} {1 {bad entry index "bogus"}} -test entry-3.5 {EntryWidgetCmd procedure, "bbox" widget command} { - .e delete 0 end - .e bbox 0 -} [list 5 5 0 $cy] -test entry-3.6 {EntryWidgetCmd procedure, "bbox" widget command} { - # Tcl_UtfAtIndex(): no utf chars +} -cleanup { + destroy .e +} -result {.e} - .e delete 0 end + +test entry-3.1 {EntryWidgetCmd procedure} -setup { + entry .e + pack .e + update +} -body { + .e +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e option ?arg arg ...?"} +test entry-3.2 {EntryWidgetCmd procedure, "bbox" widget command} -setup { + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { + .e bbox +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e bbox index"} +test entry-3.3 {EntryWidgetCmd procedure, "bbox" widget command} -setup { + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { + .e bbox a b +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e bbox index"} +test entry-3.4 {EntryWidgetCmd procedure, "bbox" widget command} -setup { + entry .e + pack .e + update +} -body { + .e bbox bogus +} -cleanup { + destroy .e +} -returnCodes error -result {bad entry index "bogus"} +test entry-3.5 {EntryWidgetCmd procedure, "bbox" widget command} -setup { + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { + .e bbox 0 +} -cleanup { + destroy .e +} -result [list 5 5 0 $cy] + +# Previously the result was count using previousli counted font measurements +# and metrics. It was changed to less verbose solution - the result is the one +# that passes fonts constraint (this concerns tests 3.6, 3.7, 3.8, 3.10) +test entry-3.6 {EntryWidgetCmd procedure, "bbox" widget command} -constraints { + fonts +} -setup { + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { +# Tcl_UtfAtIndex(): no utf chars .e insert 0 "abc" list [.e bbox 3] [.e bbox end] -} [list "[expr 5+2*$cx] 5 $cx $cy" "[expr 5+2*$cx] 5 $cx $cy"] -test entry-3.7 {EntryWidgetCmd procedure, "bbox" widget command} { - # Tcl_UtfAtIndex(): utf at end - .e delete 0 end +} -cleanup { + destroy .e +} -result {{19 5 7 13} {19 5 7 13}} +test entry-3.7 {EntryWidgetCmd procedure, "bbox" widget command} -constraints { + fonts +} -setup { + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { +# Tcl_UtfAtIndex(): utf at end .e insert 0 "ab\u4e4e" .e bbox end -} "[expr 5+2*$cx] 5 $ux $cy" -test entry-3.8 {EntryWidgetCmd procedure, "bbox" widget command} { - # Tcl_UtfAtIndex(): utf before index - .e delete 0 end +} -cleanup { + destroy .e +} -result {19 5 12 13} +test entry-3.8 {EntryWidgetCmd procedure, "bbox" widget command} -constraints { + fonts +} -setup { + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { +# Tcl_UtfAtIndex(): utf before index .e insert 0 "ab\u4e4ec" .e bbox 3 -} "[expr 5+2*$cx+$ux] 5 $cx $cy" -test entry-3.9 {EntryWidgetCmd procedure, "bbox" widget command} { - # Tcl_UtfAtIndex(): no chars - .e delete 0 end +} -cleanup { + destroy .e +} -result {31 5 7 13} +test entry-3.9 {EntryWidgetCmd procedure, "bbox" widget command} -setup { + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { +# Tcl_UtfAtIndex(): no chars .e bbox end -} "5 5 0 $cy" -test entry-3.10 {EntryWidgetCmd procedure, "bbox" widget command} { - .e delete 0 end +} -cleanup { + destroy .e +} -result "5 5 0 $cy" +test entry-3.10 {EntryWidgetCmd procedure, "bbox" widget command} -constraints { + fonts +} -setup { + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { .e insert 0 "abcdefghij\u4e4eklmnop" list [.e bbox 0] [.e bbox 1] [.e bbox 10] [.e bbox end] -} [list "5 5 $cx $cy" "[expr 5+$cx] 5 $cx $cy" "[expr 5+10*$cx] 5 $ux $cy" "[expr 5+$ux+15*$cx] 5 $cx $cy"] -test entry-3.11 {EntryWidgetCmd procedure, "cget" widget command} { - list [catch {.e cget} msg] $msg -} {1 {wrong # args: should be ".e cget option"}} -test entry-3.12 {EntryWidgetCmd procedure, "cget" widget command} { - list [catch {.e cget a b} msg] $msg -} {1 {wrong # args: should be ".e cget option"}} -test entry-3.13 {EntryWidgetCmd procedure, "cget" widget command} { - list [catch {.e cget -gorp} msg] $msg -} {1 {unknown option "-gorp"}} -test entry-3.14 {EntryWidgetCmd procedure, "cget" widget command} { +} -cleanup { + destroy .e +} -result {{5 5 7 13} {12 5 7 13} {75 5 12 13} {122 5 7 13}} +test entry-3.11 {EntryWidgetCmd procedure, "cget" widget command} -setup { + entry .e +} -body { + .e cget +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e cget option"} +test entry-3.12 {EntryWidgetCmd procedure, "cget" widget command} -setup { + entry .e +} -body { + .e cget a b +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e cget option"} +test entry-3.13 {EntryWidgetCmd procedure, "cget" widget command} -setup { + entry .e +} -body { + .e cget -gorp +} -cleanup { + destroy .e +} -returnCodes error -result {unknown option "-gorp"} +test entry-3.14 {EntryWidgetCmd procedure, "cget" widget command} -setup { + entry .e +} -body { .e configure -bd 4 .e cget -bd -} {4} -test entry-3.15 {EntryWidgetCmd procedure, "configure" widget command} { +} -cleanup { + destroy .e +} -result {4} +test entry-3.15 {EntryWidgetCmd procedure, "configure" widget command} -setup { + entry .e + pack .e + update +} -body { llength [.e configure] -} {36} -test entry-3.16 {EntryWidgetCmd procedure, "configure" widget command} { - list [catch {.e configure -foo} msg] $msg -} {1 {unknown option "-foo"}} -test entry-3.17 {EntryWidgetCmd procedure, "configure" widget command} { +} -cleanup { + destroy .e +} -result {36} +test entry-3.16 {EntryWidgetCmd procedure, "configure" widget command} -setup { + entry .e +} -body { + .e configure -foo +} -cleanup { + destroy .e +} -returnCodes error -result {unknown option "-foo"} +test entry-3.17 {EntryWidgetCmd procedure, "configure" widget command} -setup { + entry .e +} -body { .e configure -bd 4 .e configure -bg #ffffff lindex [.e configure -bd] 4 -} {4} -test entry-3.18 {EntryWidgetCmd procedure, "delete" widget command} { - list [catch {.e delete} msg] $msg -} {1 {wrong # args: should be ".e delete firstIndex ?lastIndex?"}} -test entry-3.19 {EntryWidgetCmd procedure, "delete" widget command} { - list [catch {.e delete a b c} msg] $msg -} {1 {wrong # args: should be ".e delete firstIndex ?lastIndex?"}} -test entry-3.20 {EntryWidgetCmd procedure, "delete" widget command} { - list [catch {.e delete foo} msg] $msg -} {1 {bad entry index "foo"}} -test entry-3.21 {EntryWidgetCmd procedure, "delete" widget command} { - list [catch {.e delete 0 bar} msg] $msg -} {1 {bad entry index "bar"}} -test entry-3.22 {EntryWidgetCmd procedure, "delete" widget command} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {4} +test entry-3.18 {EntryWidgetCmd procedure, "delete" widget command} -setup { + entry .e +} -body { + .e delete +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e delete firstIndex ?lastIndex?"} +test entry-3.19 {EntryWidgetCmd procedure, "delete" widget command} -setup { + entry .e +} -body { + .e delete a b c +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e delete firstIndex ?lastIndex?"} +test entry-3.20 {EntryWidgetCmd procedure, "delete" widget command} -setup { + entry .e +} -body { + .e delete foo +} -cleanup { + destroy .e +} -returnCodes error -result {bad entry index "foo"} +test entry-3.21 {EntryWidgetCmd procedure, "delete" widget command} -setup { + entry .e +} -body { + .e delete 0 bar +} -cleanup { + destroy .e +} -returnCodes error -result {bad entry index "bar"} +test entry-3.22 {EntryWidgetCmd procedure, "delete" widget command} -setup { + entry .e + pack .e + update +} -body { .e insert end "01234567890" .e delete 2 4 .e get -} {014567890} -test entry-3.23 {EntryWidgetCmd procedure, "delete" widget command} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {014567890} +test entry-3.23 {EntryWidgetCmd procedure, "delete" widget command} -setup { + entry .e +} -body { .e insert end "01234567890" .e delete 6 .e get -} {0123457890} -test entry-3.24 {EntryWidgetCmd procedure, "delete" widget command} { - # UTF +} -cleanup { + destroy .e +} -result {0123457890} +test entry-3.24 {EntryWidgetCmd procedure, "delete" widget command} -setup { + entry .e + pack .e + update set x {} - .e delete 0 end +} -body { +# UTF .e insert end "01234\u4e4e67890" .e delete 6 lappend x [.e get] @@ -234,311 +893,659 @@ test entry-3.24 {EntryWidgetCmd procedure, "delete" widget command} { .e insert end "0123456\u4e4e890" .e delete 6 lappend x [.e get] -} [list "01234\u4e4e7890" "0123457890" "012345\u4e4e890"] -test entry-3.25 {EntryWidgetCmd procedure, "delete" widget command} { - .e delete 0 end +} -cleanup { + destroy .e +} -result [list "01234\u4e4e7890" "0123457890" "012345\u4e4e890"] +test entry-3.25 {EntryWidgetCmd procedure, "delete" widget command} -setup { + entry .e + pack .e + update +} -body { .e insert end "01234567890" .e delete 6 5 .e get -} {01234567890} -test entry-3.26 {EntryWidgetCmd procedure, "delete" widget command} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {01234567890} +test entry-3.26 {EntryWidgetCmd procedure, "delete" widget command} -setup { + entry .e + pack .e + update +} -body { .e insert end "01234567890" .e configure -state disabled .e delete 2 8 .e configure -state normal .e get -} {01234567890} -test entry-3.26a {EntryWidgetCmd procedure, "delete" widget command} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {01234567890} +test entry-3.27 {EntryWidgetCmd procedure, "delete" widget command} -setup { + entry .e + pack .e + update +} -body { .e insert end "01234567890" .e configure -state readonly .e delete 2 8 .e configure -state normal .e get -} {01234567890} -test entry-3.27 {EntryWidgetCmd procedure, "get" widget command} { - list [catch {.e get foo} msg] $msg -} {1 {wrong # args: should be ".e get"}} -test entry-3.28 {EntryWidgetCmd procedure, "icursor" widget command} { - list [catch {.e icursor} msg] $msg -} {1 {wrong # args: should be ".e icursor pos"}} -test entry-3.29 {EntryWidgetCmd procedure, "icursor" widget command} { - list [catch {.e icursor foo} msg] $msg -} {1 {bad entry index "foo"}} -test entry-3.30 {EntryWidgetCmd procedure, "icursor" widget command} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {01234567890} +test entry-3.28 {EntryWidgetCmd procedure, "get" widget command} -setup { + entry .e +} -body { + .e get foo +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e get"} +test entry-3.29 {EntryWidgetCmd procedure, "icursor" widget command} -setup { + entry .e +} -body { + .e icursor +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e icursor pos"} +test entry-3.30 {EntryWidgetCmd procedure, "icursor" widget command} -setup { + entry .e +} -body { + .e icursor foo +} -cleanup { + destroy .e +} -returnCodes error -result {bad entry index "foo"} +test entry-3.31 {EntryWidgetCmd procedure, "icursor" widget command} -setup { + entry .e +} -body { .e insert end "01234567890" .e icursor 4 .e index insert -} {4} -test entry-3.31 {EntryWidgetCmd procedure, "index" widget command} { - list [catch {.e in} msg] $msg -} {1 {ambiguous option "in": must be bbox, cget, configure, delete, get, icursor, index, insert, scan, selection, validate, or xview}} -test entry-3.32 {EntryWidgetCmd procedure, "index" widget command} { - list [catch {.e index} msg] $msg -} {1 {wrong # args: should be ".e index string"}} -test entry-3.33 {EntryWidgetCmd procedure, "index" widget command} { - list [catch {.e index foo} msg] $msg -} {1 {bad entry index "foo"}} -test entry-3.34 {EntryWidgetCmd procedure, "index" widget command} { - list [catch {.e index 0} msg] $msg -} {0 0} -test entry-3.35 {EntryWidgetCmd procedure, "index" widget command} { - # UTF - .e delete 0 end +} -cleanup { + destroy .e +} -result {4} +test entry-3.32 {EntryWidgetCmd procedure, "index" widget command} -setup { + entry .e +} -body { + .e in +} -cleanup { + destroy .e +} -returnCodes error -result {ambiguous option "in": must be bbox, cget, configure, delete, get, icursor, index, insert, scan, selection, validate, or xview} +test entry-3.33 {EntryWidgetCmd procedure, "index" widget command} -setup { + entry .e +} -body { + .e index +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e index string"} +test entry-3.34 {EntryWidgetCmd procedure, "index" widget command} -setup { + entry .e +} -body { + .e index foo +} -cleanup { + destroy .e +} -returnCodes error -result {bad entry index "foo"} +test entry-3.35 {EntryWidgetCmd procedure, "index" widget command} -setup { + entry .e + pack .e + update +} -body { + .e index 0 +} -cleanup { + destroy .e +} -returnCodes {ok} -match glob -result {*} +test entry-3.36 {EntryWidgetCmd procedure, "index" widget command} -setup { + entry .e + pack .e + update +} -body { +# UTF .e insert 0 abc\u4e4e\u0153def list [.e index 3] [.e index 4] [.e index end] -} {3 4 8} -test entry-3.36 {EntryWidgetCmd procedure, "insert" widget command} { - list [catch {.e insert a} msg] $msg -} {1 {wrong # args: should be ".e insert index text"}} -test entry-3.37 {EntryWidgetCmd procedure, "insert" widget command} { - list [catch {.e insert a b c} msg] $msg -} {1 {wrong # args: should be ".e insert index text"}} -test entry-3.38 {EntryWidgetCmd procedure, "insert" widget command} { - list [catch {.e insert foo Text} msg] $msg -} {1 {bad entry index "foo"}} -test entry-3.39 {EntryWidgetCmd procedure, "insert" widget command} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {3 4 8} +test entry-3.37 {EntryWidgetCmd procedure, "insert" widget command} -setup { + entry .e +} -body { + .e insert a +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e insert index text"} +test entry-3.38 {EntryWidgetCmd procedure, "insert" widget command} -setup { + entry .e +} -body { + .e insert a b c +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e insert index text"} +test entry-3.39 {EntryWidgetCmd procedure, "insert" widget command} -setup { + entry .e +} -body { + .e insert foo Text +} -cleanup { + destroy .e +} -returnCodes error -result {bad entry index "foo"} +test entry-3.40 {EntryWidgetCmd procedure, "insert" widget command} -setup { + entry .e + pack .e + update +} -body { .e insert end "01234567890" .e insert 3 xxx .e get -} {012xxx34567890} -test entry-3.40 {EntryWidgetCmd procedure, "insert" widget command} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {012xxx34567890} +test entry-3.41 {EntryWidgetCmd procedure, "insert" widget command} -setup { + entry .e + pack .e + update +} -body { .e insert end "01234567890" .e configure -state disabled .e insert 3 xxx .e configure -state normal .e get -} {01234567890} -test entry-3.40a {EntryWidgetCmd procedure, "insert" widget command} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {01234567890} +test entry-3.42 {EntryWidgetCmd procedure, "insert" widget command} -setup { + entry .e + pack .e + update +} -body { .e insert end "01234567890" .e configure -state readonly .e insert 3 xxx .e configure -state normal .e get -} {01234567890} -test entry-3.41 {EntryWidgetCmd procedure, "insert" widget command} { - list [catch {.e insert a b c} msg] $msg -} {1 {wrong # args: should be ".e insert index text"}} -test entry-3.42 {EntryWidgetCmd procedure, "scan" widget command} { - list [catch {.e scan a} msg] $msg -} {1 {wrong # args: should be ".e scan mark|dragto x"}} -test entry-3.43 {EntryWidgetCmd procedure, "scan" widget command} { - list [catch {.e scan a b c} msg] $msg -} {1 {wrong # args: should be ".e scan mark|dragto x"}} -test entry-3.44 {EntryWidgetCmd procedure, "scan" widget command} { - list [catch {.e scan foobar 20} msg] $msg -} {1 {bad scan option "foobar": must be mark or dragto}} -test entry-3.45 {EntryWidgetCmd procedure, "scan" widget command} { - list [catch {.e scan mark 20.1} msg] $msg -} {1 {expected integer but got "20.1"}} -# This test is non-portable because character sizes vary. +} -cleanup { + destroy .e +} -result {01234567890} +test entry-3.43 {EntryWidgetCmd procedure, "insert" widget command} -setup { + entry .e +} -body { + .e insert a b c +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e insert index text"} +test entry-3.44 {EntryWidgetCmd procedure, "scan" widget command} -setup { + entry .e + pack .e + update +} -body { + .e scan a +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e scan mark|dragto x"} +test entry-3.45 {EntryWidgetCmd procedure, "scan" widget command} -setup { + entry .e + pack .e + update +} -body { + .e scan a b c +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e scan mark|dragto x"} +test entry-3.46 {EntryWidgetCmd procedure, "scan" widget command} -setup { + entry .e + pack .e + update +} -body { + .e scan foobar 20 +} -cleanup { + destroy .e +} -returnCodes error -result {bad scan option "foobar": must be mark or dragto} +test entry-3.47 {EntryWidgetCmd procedure, "scan" widget command} -setup { + entry .e + pack .e + update +} -body { + .e scan mark 20.1 +} -cleanup { + destroy .e +} -returnCodes error -result {expected integer but got "20.1"} -test entry-3.46 {EntryWidgetCmd procedure, "scan" widget command} {fonts} { - .e delete 0 end +# This test is non-portable because character sizes vary. +test entry-3.48 {EntryWidgetCmd procedure, "scan" widget command} -constraints { + fonts +} -setup { + entry .e -font {Helvetica -12} -borderwidth 2 -highlightthickness 2 + pack .e update +} -body { .e insert end "This is quite a long string, in fact a " .e insert end "very very long string" .e scan mark 30 .e scan dragto 28 .e index @0 -} {2} -test entry-3.47 {EntryWidgetCmd procedure, "select" widget command} { - list [catch {.e select} msg] $msg -} {1 {wrong # args: should be ".e selection option ?index?"}} -test entry-3.48 {EntryWidgetCmd procedure, "select" widget command} { - list [catch {.e select foo} msg] $msg -} {1 {bad selection option "foo": must be adjust, clear, from, present, range, or to}} -test entry-3.49 {EntryWidgetCmd procedure, "select clear" widget command} { - list [catch {.e select clear gorp} msg] $msg -} {1 {wrong # args: should be ".e selection clear"}} -test entry-3.50 {EntryWidgetCmd procedure, "select clear" widget command} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {2} +test entry-3.49 {EntryWidgetCmd procedure, "select" widget command} -setup { + entry .e +} -body { + .e select +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e selection option ?index?"} +test entry-3.50 {EntryWidgetCmd procedure, "select" widget command} -setup { + entry .e +} -body { + .e select foo +} -cleanup { + destroy .e +} -returnCodes error -result {bad selection option "foo": must be adjust, clear, from, present, range, or to} + +test entry-3.51 {EntryWidgetCmd procedure, "select clear" widget command} -setup { + entry .e +} -body { + .e select clear gorp +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e selection clear"} +test entry-3.52 {EntryWidgetCmd procedure, "select clear" widget command} -setup { + entry .e +} -body { .e insert end "0123456789" .e select from 1 .e select to 4 update .e select clear - list [catch {selection get} msg] $msg [selection own] -} {1 {PRIMARY selection doesn't exist or form "STRING" not defined} .e} -test entry-3.51 {EntryWidgetCmd procedure, "selection present" widget command} { - list [catch {.e selection present foo} msg] $msg -} {1 {wrong # args: should be ".e selection present"}} -test entry-3.52 {EntryWidgetCmd procedure, "selection present" widget command} { - .e delete 0 end + selection get +} -cleanup { + destroy .e +} -returnCodes error -result {PRIMARY selection doesn't exist or form "STRING" not defined} +test entry-3.53 {EntryWidgetCmd procedure, "select clear" widget command} -setup { + entry .e + pack .e + update +} -body { + .e insert end "0123456789" + .e select from 1 + .e select to 4 + update + .e select clear + catch {selection get} + selection own +} -cleanup { + destroy .e +} -result {.e} + +test entry-3.54 {EntryWidgetCmd procedure, "selection present" widget command} -setup { + entry .e +} -body { + .e selection present foo +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e selection present"} +test entry-3.55 {EntryWidgetCmd procedure, "selection present" widget command} -setup { + entry .e + pack .e + update +} -body { .e insert end 0123456789 .e select from 3 .e select to 6 .e selection present -} {1} -test entry-3.53 {EntryWidgetCmd procedure, "selection present" widget command} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {1} +test entry-3.56 {EntryWidgetCmd procedure, "selection present" widget command} -setup { + entry .e + pack .e + update +} -body { .e insert end 0123456789 .e select from 3 .e select to 6 .e configure -exportselection false .e selection present -} {1} -.e configure -exportselection true -test entry-3.54 {EntryWidgetCmd procedure, "selection present" widget command} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {1} +test entry-3.57 {EntryWidgetCmd procedure, "selection present" widget command} -setup { + entry .e + pack .e + update +} -body { .e insert end 0123456789 .e select from 3 .e select to 6 .e delete 0 end .e selection present -} {0} -test entry-3.55 {EntryWidgetCmd procedure, "selection adjust" widget command} { - list [catch {.e select adjust x} msg] $msg -} {1 {bad entry index "x"}} -test entry-3.56 {EntryWidgetCmd procedure, "selection adjust" widget command} { - list [catch {.e select adjust 2 3} msg] $msg -} {1 {wrong # args: should be ".e selection adjust index"}} -test entry-3.57 {EntryWidgetCmd procedure, "selection adjust" widget command} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {0} +test entry-3.58 {EntryWidgetCmd procedure, "selection adjust" widget command} -setup { + entry .e +} -body { + .e select adjust x +} -cleanup { + destroy .e +} -returnCodes error -result {bad entry index "x"} +test entry-3.59 {EntryWidgetCmd procedure, "selection adjust" widget command} -setup { + entry .e +} -body { + .e select adjust 2 3 +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e selection adjust index"} +test entry-3.60 {EntryWidgetCmd procedure, "selection adjust" widget command} -setup { + entry .e + pack .e + update +} -body { .e insert end "0123456789" .e select from 1 .e select to 5 update .e select adjust 4 selection get -} {123} -test entry-3.58 {EntryWidgetCmd procedure, "selection adjust" widget command} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {123} +test entry-3.61 {EntryWidgetCmd procedure, "selection adjust" widget command} -setup { + entry .e + pack .e + update +} -body { .e insert end "0123456789" .e select from 1 .e select to 5 update .e select adjust 2 selection get -} {234} -test entry-3.59 {EntryWidgetCmd procedure, "selection from" widget command} { - list [catch {.e select from 2 3} msg] $msg -} {1 {wrong # args: should be ".e selection from index"}} -test entry-3.60 {EntryWidgetCmd procedure, "selection range" widget command} { - list [catch {.e select range 2} msg] $msg -} {1 {wrong # args: should be ".e selection range start end"}} -test entry-3.61 {EntryWidgetCmd procedure, "selection range" widget command} { - list [catch {.e selection range 2 3 4} msg] $msg -} {1 {wrong # args: should be ".e selection range start end"}} -test entry-3.62 {EntryWidgetCmd procedure, "selection range" widget command} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {234} +test entry-3.62 {EntryWidgetCmd procedure, "selection from" widget command} -setup { + entry .e +} -body { + .e select from 2 3 +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e selection from index"} + +test entry-3.63 {EntryWidgetCmd procedure, "selection range" widget command} -setup { + entry .e +} -body { + .e select range 2 +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e selection range start end"} +test entry-3.64 {EntryWidgetCmd procedure, "selection range" widget command} -setup { + entry .e +} -body { + .e selection range 2 3 4 +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e selection range start end"} +test entry-3.65 {EntryWidgetCmd procedure, "selection range" widget command} -setup { + entry .e +} -body { .e insert end 0123456789 .e select from 1 .e select to 5 .e select range 4 4 - list [catch {.e index sel.first} msg] $msg -} {1 {selection isn't in widget .e}} -test entry-3.63 {EntryWidgetCmd procedure, "selection range" widget command} { - .e delete 0 end + .e index sel.first +} -cleanup { + destroy .e +} -returnCodes error -result {selection isn't in widget .e} +test entry-3.66 {EntryWidgetCmd procedure, "selection range" widget command} -setup { + entry .e + pack .e + update +} -body { .e insert end 0123456789 .e select from 3 .e select to 7 .e select range 2 9 list [.e index sel.first] [.e index sel.last] [.e index anchor] -} {2 9 3} -test entry-3.64 {EntryWidgetCmd procedure, "selection" widget command} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {2 9 3} +test entry-3.67 {EntryWidgetCmd procedure, "selection" widget command} -setup { + entry .e + pack .e + update +} -body { .e insert end 0123456789 .e selection range 0 end .e configure -state disabled .e selection range 2 4 .e configure -state normal list [.e index sel.first] [.e index sel.last] -} {0 10} -test entry-3.64a {EntryWidgetCmd procedure, "selection" widget command} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {0 10} +test entry-3.68 {EntryWidgetCmd procedure, "selection" widget command} -setup { + entry .e + pack .e + update +} -body { .e insert end 0123456789 .e selection range 0 end .e configure -state readonly .e selection range 2 4 .e configure -state normal list [.e index sel.first] [.e index sel.last] -} {2 4} -.e delete 0 end -.e insert end "This is quite a long text string, so long that it " -.e insert end "runs off the end of the window quite a bit." -test entry-3.64b {EntryWidgetCmd procedure, "selection to" widget command} { - list [catch {.e select to 2 3} msg] $msg -} {1 {wrong # args: should be ".e selection to index"}} -test entry-3.65 {EntryWidgetCmd procedure, "xview" widget command} { +} -cleanup { + destroy .e +} -result {2 4} +test entry-3.69 {EntryWidgetCmd procedure, "selection to" widget command} -setup { + entry .e + pack .e + update + .e insert end "This is quite a long text string, so long that it " + .e insert end "runs off the end of the window quite a bit." +} -body { + .e select to 2 3 +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e selection to index"} + +test entry-3.70 {EntryWidgetCmd procedure, "xview" widget command} -setup { + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { + .e insert end "This is quite a long text string, so long that it " + .e insert end "runs off the end of the window quite a bit." .e xview 5 .e xview -} {0.0537634 0.268817} -test entry-3.66 {EntryWidgetCmd procedure, "xview" widget command} { - list [catch {.e xview gorp} msg] $msg -} {1 {bad entry index "gorp"}} -test entry-3.67 {EntryWidgetCmd procedure, "xview" widget command} { +} -cleanup { + destroy .e +} -result {0.0537634 0.268817} +test entry-3.71 {EntryWidgetCmd procedure, "xview" widget command} -setup { + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { + .e xview gorp +} -cleanup { + destroy .e +} -returnCodes error -result {bad entry index "gorp"} +test entry-3.72 {EntryWidgetCmd procedure, "xview" widget command} -setup { + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { + .e insert end "This is quite a long text string, so long that it " + .e insert end "runs off the end of the window quite a bit." .e xview 0 .e icursor 10 .e xview insert .e xview -} {0.107527 0.322581} -test entry-3.68 {EntryWidgetCmd procedure, "xview" widget command} { - list [catch {.e xview moveto foo bar} msg] $msg -} {1 {wrong # args: should be ".e xview moveto fraction"}} -test entry-3.69 {EntryWidgetCmd procedure, "xview" widget command} { - list [catch {.e xview moveto foo} msg] $msg -} {1 {expected floating-point number but got "foo"}} -test entry-3.70 {EntryWidgetCmd procedure, "xview" widget command} { +} -cleanup { + destroy .e +} -result {0.107527 0.322581} +test entry-3.73 {EntryWidgetCmd procedure, "xview" widget command} -setup { + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { + .e xview moveto foo bar +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e xview moveto fraction"} +test entry-3.74 {EntryWidgetCmd procedure, "xview" widget command} -setup { + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { + .e xview moveto foo +} -cleanup { + destroy .e +} -returnCodes error -result {expected floating-point number but got "foo"} +test entry-3.75 {EntryWidgetCmd procedure, "xview" widget command} -setup { + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { + .e insert end "This is quite a long text string, so long that it " + .e insert end "runs off the end of the window quite a bit." .e xview moveto 0.5 .e xview -} {0.505376 0.72043} -test entry-3.71 {EntryWidgetCmd procedure, "xview" widget command} { - list [catch {.e xview scroll 24} msg] $msg -} {1 {wrong # args: should be ".e xview scroll number units|pages"}} -test entry-3.72 {EntryWidgetCmd procedure, "xview" widget command} { - list [catch {.e xview scroll gorp units} msg] $msg -} {1 {expected integer but got "gorp"}} -test entry-3.73 {EntryWidgetCmd procedure, "xview" widget command} { +} -cleanup { + destroy .e +} -result {0.505376 0.72043} +test entry-3.76 {EntryWidgetCmd procedure, "xview" widget command} -setup { + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { + .e insert end "This is quite a long text string, so long that it " + .e insert end "runs off the end of the window quite a bit." + .e xview scroll 24 +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e xview scroll number units|pages"} +test entry-3.77 {EntryWidgetCmd procedure, "xview" widget command} -setup { + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e +} -body { + .e insert end "This is quite a long text string, so long that it " + .e insert end "runs off the end of the window quite a bit." + update + .e xview scroll gorp units +} -cleanup { + destroy .e +} -returnCodes error -result {expected integer but got "gorp"} +test entry-3.78 {EntryWidgetCmd procedure, "xview" widget command} -setup { + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e +} -body { + .e insert end "This is quite a long text string, so long that it " + .e insert end "runs off the end of the window quite a bit." + update .e xview moveto 0 .e xview scroll 1 pages .e xview -} {0.193548 0.408602} -test entry-3.74 {EntryWidgetCmd procedure, "xview" widget command} { +} -cleanup { + destroy .e +} -result {0.193548 0.408602} +test entry-3.79 {EntryWidgetCmd procedure, "xview" widget command} -setup { + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { + .e insert end "This is quite a long text string, so long that it " + .e insert end "runs off the end of the window quite a bit." .e xview moveto .9 update .e xview scroll -2 p .e xview -} {0.397849 0.612903} -test entry-3.75 {EntryWidgetCmd procedure, "xview" widget command} { +} -cleanup { + destroy .e +} -result {0.397849 0.612903} +test entry-3.80 {EntryWidgetCmd procedure, "xview" widget command} -setup { + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e +} -body { + .e insert end "This is quite a long text string, so long that it " + .e insert end "runs off the end of the window quite a bit." + update .e xview 30 update .e xview scroll 2 units .e index @0 -} {32} -test entry-3.76 {EntryWidgetCmd procedure, "xview" widget command} { +} -cleanup { + destroy .e +} -result {32} +test entry-3.81 {EntryWidgetCmd procedure, "xview" widget command} -setup { + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e +} -body { + .e insert end "This is quite a long text string, so long that it " + .e insert end "runs off the end of the window quite a bit." + update .e xview 30 update .e xview scroll -1 units .e index @0 -} {29} -test entry-3.77 {EntryWidgetCmd procedure, "xview" widget command} { - list [catch {.e xview scroll 23 foobars} msg] $msg -} {1 {bad argument "foobars": must be units or pages}} -test entry-3.78 {EntryWidgetCmd procedure, "xview" widget command} { - list [catch {.e xview eat 23 hamburgers} msg] $msg -} {1 {unknown option "eat": must be moveto or scroll}} -test entry-3.79 {EntryWidgetCmd procedure, "xview" widget command} { +} -cleanup { + destroy .e +} -result {29} +test entry-3.82 {EntryWidgetCmd procedure, "xview" widget command} -setup { + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e +} -body { + .e insert end "This is quite a long text string, so long that it " + .e insert end "runs off the end of the window quite a bit." + update + .e xview scroll 23 foobars +} -cleanup { + destroy .e +} -returnCodes error -result {bad argument "foobars": must be units or pages} +test entry-3.83 {EntryWidgetCmd procedure, "xview" widget command} -setup { + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e +} -body { + .e insert end "This is quite a long text string, so long that it " + .e insert end "runs off the end of the window quite a bit." + update + .e xview eat 23 hamburgers +} -cleanup { + destroy .e +} -returnCodes error -result {unknown option "eat": must be moveto or scroll} +test entry-3.84 {EntryWidgetCmd procedure, "xview" widget command} -setup { + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { + .e insert end "This is quite a long text string, so long that it " + .e insert end "runs off the end of the window quite a bit." .e xview 0 update .e xview -4 .e index @0 -} {0} -test entry-3.80 {EntryWidgetCmd procedure, "xview" widget command} { +} -cleanup { + destroy .e +} -result {0} +test entry-3.85 {EntryWidgetCmd procedure, "xview" widget command} -setup { + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e +} -body { + .e insert end "This is quite a long text string, so long that it " + .e insert end "runs off the end of the window quite a bit." + update .e xview 300 .e index @0 -} {73} -.e insert 10 \u4e4e -test entry-3.81 {EntryWidgetCmd procedure, "xview" widget command} { - # UTF - # If Tcl_NumUtfChars wasn't used, wrong answer would be: - # 0.106383 0.117021 0.117021 - +} -cleanup { + destroy .e +} -result {73} +test entry-3.86 {EntryWidgetCmd procedure, "xview" widget command} -setup { + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e +} -body { + .e insert end "This is quite a long text string, so long that it " + .e insert end "runs off the end of the window quite a bit." + .e insert 10 \u4e4e + update +# UTF +# If Tcl_NumUtfChars wasn't used, wrong answer would be: +# 0.106383 0.117021 0.117021 set x {} .e xview moveto .1 lappend x [lindex [.e xview] 0] @@ -546,261 +1553,382 @@ test entry-3.81 {EntryWidgetCmd procedure, "xview" widget command} { lappend x [lindex [.e xview] 0] .e xview moveto .12 lappend x [lindex [.e xview] 0] -} {0.0957447 0.106383 0.117021} -test entry-3.82 {EntryWidgetCmd procedure} { - list [catch {.e gorp} msg] $msg -} {1 {bad option "gorp": must be bbox, cget, configure, delete, get, icursor, index, insert, scan, selection, validate, or xview}} +} -cleanup { + destroy .e +} -result {0.0957447 0.106383 0.117021} + +test entry-3.87 {EntryWidgetCmd procedure} -setup { + entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { + .e gorp +} -cleanup { + destroy .e +} -returnCodes error -result {bad option "gorp": must be bbox, cget, configure, delete, get, icursor, index, insert, scan, selection, validate, or xview} # The test below doesn't actually check anything directly, but if run # with Purify or some other memory-allocation-checking program it will # ensure that resources get properly freed. -test entry-4.1 {DestroyEntry procedure} { - catch {destroy .e} +test entry-4.1 {DestroyEntry procedure} -body { entry .e -textvariable x -show * pack .e .e insert end "Sample text" update destroy .e -} {} +} -result {} -frame .f -width 200 -height 50 -relief raised -bd 2 -pack .f -side right -test entry-5.1 {ConfigureEntry procedure, -textvariable} { - catch {destroy .e} +test entry-5.1 {ConfigureEntry procedure, -textvariable} -body { set x 12345 entry .e -textvariable x .e get -} {12345} -test entry-5.2 {ConfigureEntry procedure, -textvariable} { - catch {destroy .e} +} -cleanup { + destroy .e +} -result {12345} +test entry-5.2 {ConfigureEntry procedure, -textvariable} -body { set x 12345 entry .e -textvariable x set y abcde .e configure -textvariable y set x 54321 .e get -} {abcde} -test entry-5.3 {ConfigureEntry procedure, -textvariable} { - catch {destroy .e} - catch {unset x} +} -cleanup { + destroy .e +} -result {abcde} +test entry-5.3 {ConfigureEntry procedure, -textvariable} -setup { + unset -nocomplain x entry .e +} -body { .e insert 0 "Some text" .e configure -textvariable x - set x -} {Some text} -test entry-5.4 {ConfigureEntry procedure, -textvariable} { - proc override args { - global x - set x 12345 - } - catch {destroy .e} - catch {unset x} - trace variable x w override + return $x +} -cleanup { + destroy .e +} -result {Some text} +test entry-5.4 {ConfigureEntry procedure, -textvariable} -setup { + unset -nocomplain x entry .e +} -body { + trace variable x w override .e insert 0 "Some text" .e configure -textvariable x - set result [list $x [.e get]] - unset x; rename override {} - set result -} {12345 12345} -test entry-5.5 {ConfigureEntry procedure} { - catch {destroy .e} - entry .e -exportselection false - pack .e - .e insert end "0123456789" - .sel select from 0 - .sel select to 10 + list $x [.e get] +} -cleanup { + destroy .e + trace vdelete x w override + unset x; +} -result {12345 12345} + +test entry-5.5 {ConfigureEntry procedure} -setup { set x {} + entry .e1 + entry .e2 +} -body { + .e2 insert end "This is some sample text" + .e1 configure -exportselection false + .e1 insert end "0123456789" + pack .e1 .e2 + .e2 select from 0 + .e2 select to 10 lappend x [selection get] - .e select from 1 - .e select to 5 + .e1 select from 1 + .e1 select to 5 lappend x [selection get] - .e configure -exportselection 1 + .e1 configure -exportselection 1 lappend x [selection get] - set x -} {{This is so} {This is so} 1234} -test entry-5.6 {ConfigureEntry procedure} { - catch {destroy .e} + return $x +} -cleanup { + destroy .e1 .e2 +} -result {{This is so} {This is so} 1234} +test entry-5.6 {ConfigureEntry procedure} -setup { + entry .e + pack .e +} -body { + .e insert end "0123456789" + .e select from 1 + .e select to 5 + .e configure -exportselection 0 + selection get +} -cleanup { + destroy .e +} -returnCodes error -result {PRIMARY selection doesn't exist or form "STRING" not defined} +test entry-5.7 {ConfigureEntry procedure} -setup { entry .e pack .e +} -body { .e insert end "0123456789" .e select from 1 .e select to 5 .e configure -exportselection 0 - list [catch {selection get} msg] $msg [.e index sel.first] \ - [.e index sel.last] -} {1 {PRIMARY selection doesn't exist or form "STRING" not defined} 1 5} -test entry-5.7 {ConfigureEntry procedure} { - catch {destroy .e} - entry .e -font $fixed -width 4 -xscrollcommand scroll + catch {selection get} + list [.e index sel.first] [.e index sel.last] +} -cleanup { + destroy .e +} -result {1 5} + +test entry-5.8 {ConfigureEntry procedure} -setup { + entry .e -font {Helvetica -12} -borderwidth 2 -highlightthickness 2 pack .e +} -body { + .e configure -font {Courier -12} -width 4 -xscrollcommand scroll .e insert end "01234567890" update .e configure -width 5 - set scrollInfo -} {0 0.363636} -test entry-5.8 {ConfigureEntry procedure} {fonts} { - catch {destroy .e} - entry .e -width 0 + return $scrollInfo +} -cleanup { + destroy .e +} -result {0 0.363636} + + +test entry-5.9 {ConfigureEntry procedure} -constraints { + fonts +} -setup { + entry .e -borderwidth 2 -highlightthickness 2 pack .e +} -body { + .e configure -width 0 -font {Helvetica -12} .e insert end "0123" update - .e configure -font $big + .e configure -font {Helvetica -24} update winfo geom .e -} {62x37+0+0} -test entry-5.9 {ConfigureEntry procedure} {fonts} { - catch {destroy .e} - entry .e -font $fixed -bd 2 -relief raised +} -cleanup { + destroy .e +} -result {62x37+0+0} +test entry-5.10 {ConfigureEntry procedure} -constraints { + fonts +} -setup { + entry .e -borderwidth 2 -highlightthickness 2 pack .e +} -body { + .e configure -font {Courier -12} -bd 2 -relief raised .e insert end "0123" update list [.e index @10] [.e index @11] [.e index @12] [.e index @13] -} {0 0 1 1} -test entry-5.10 {ConfigureEntry procedure} {fonts} { - catch {destroy .e} - entry .e -font $fixed -bd 2 -relief flat +} -cleanup { + destroy .e +} -result {0 0 1 1} +test entry-5.11 {ConfigureEntry procedure} -constraints { + fonts +} -setup { + entry .e -borderwidth 2 -highlightthickness 2 pack .e +} -body { + .e configure -font {Courier -12} -bd 2 -relief flat .e insert end "0123" update list [.e index @10] [.e index @11] [.e index @12] [.e index @13] -} {0 0 1 1} -test entry-5.11 {ConfigureEntry procedure} { - # If "0" in selected font had 0 width, caused divide-by-zero error. - - catch {destroy .e} - pack [entry .e -font {{open look glyph}}] +} -cleanup { + destroy .e +} -result {0 0 1 1} +test entry-5.12 {ConfigureEntry procedure} -setup { + entry .e -borderwidth 2 -highlightthickness 2 + pack .e +} -body { +# If "0" in selected font had 0 width, caused divide-by-zero error. + .e configure -font {{open look glyph}} .e scan dragto 30 update -} {} +} -cleanup { + destroy .e +} -result {} # No tests for DisplayEntry. -test entry-6.1 {EntryComputeGeometry procedure} {fonts} { - catch {destroy .e} - entry .e -font $fixed -bd 2 -relief raised -width 20 -highlightthickness 3 +test entry-6.1 {EntryComputeGeometry procedure} -constraints { + fonts +} -setup { + entry .e pack .e +} -body { + .e configure -font {Courier -12} -bd 2 -relief raised -width 20 \ + -highlightthickness 3 .e insert end 012\t45 update list [.e index @61] [.e index @62] -} {3 4} -test entry-6.2 {EntryComputeGeometry procedure} {fonts} { - catch {destroy .e} - entry .e -font $fixed -bd 2 -relief raised -width 20 -justify center \ - -highlightthickness 3 +} -cleanup { + destroy .e +} -result {3 4} +test entry-6.2 {EntryComputeGeometry procedure} -constraints { + fonts +} -setup { + entry .e pack .e +} -body { + .e configure -font {Courier -12} -bd 2 -relief raised -width 20 \ + -justify center -highlightthickness 3 .e insert end 012\t45 update list [.e index @96] [.e index @97] -} {3 4} -test entry-6.3 {EntryComputeGeometry procedure} {fonts} { - catch {destroy .e} - entry .e -font $fixed -bd 2 -relief raised -width 20 -justify right \ - -highlightthickness 3 +} -cleanup { + destroy .e +} -result {3 4} +test entry-6.3 {EntryComputeGeometry procedure} -constraints { + fonts +} -setup { + entry .e pack .e +} -body { + .e configure -font {Courier -12} -bd 2 -relief raised -width 20 \ + -justify right -highlightthickness 3 .e insert end 012\t45 update list [.e index @131] [.e index @132] -} {3 4} -test entry-6.4 {EntryComputeGeometry procedure} { - catch {destroy .e} - entry .e -font $fixed -bd 2 -relief raised -width 5 +} -cleanup { + destroy .e +} -result {3 4} +test entry-6.4 {EntryComputeGeometry procedure} -setup { + entry .e pack .e +} -body { + .e configure -font {Courier -12} -bd 2 -relief raised -width 5 .e insert end "01234567890" update .e xview 6 .e index @0 -} {6} -test entry-6.5 {EntryComputeGeometry procedure} { - catch {destroy .e} - entry .e -font $fixed -bd 2 -relief raised -width 5 +} -cleanup { + destroy .e +} -result {6} +test entry-6.5 {EntryComputeGeometry procedure} -setup { + entry .e -highlightthickness 2 pack .e +} -body { + .e configure -font {Courier -12} -bd 2 -relief raised -width 5 .e insert end "01234567890" update .e xview 7 .e index @0 -} {6} -test entry-6.6 {EntryComputeGeometry procedure} {fonts} { - catch {destroy .e} - entry .e -font $fixed -bd 2 -relief raised -width 10 +} -cleanup { + destroy .e +} -result {6} +test entry-6.6 {EntryComputeGeometry procedure} -constraints { + fonts +} -setup { + entry .e -highlightthickness 2 pack .e +} -body { + .e configure -font {Courier -12} -bd 2 -relief raised -width 10 .e insert end "01234\t67890" update .e xview 3 list [.e index @39] [.e index @40] -} {5 6} -test entry-6.7 {EntryComputeGeometry procedure} {fonts} { - catch {destroy .e} - entry .e -font $big -bd 3 -relief raised -width 5 +} -cleanup { + destroy .e +} -result {5 6} +test entry-6.7 {EntryComputeGeometry procedure} -constraints { + fonts +} -setup { + entry .e -highlightthickness 2 pack .e +} -body { + .e configure -font {Helvetica -24} -bd 3 -relief raised -width 5 .e insert end "01234567" update list [winfo reqwidth .e] [winfo reqheight .e] -} {77 39} -test entry-6.8 {EntryComputeGeometry procedure} {fonts} { - catch {destroy .e} - entry .e -font $big -bd 3 -relief raised -width 0 +} -cleanup { + destroy .e +} -result {77 39} +test entry-6.8 {EntryComputeGeometry procedure} -constraints { + fonts +} -setup { + entry .e -highlightthickness 2 pack .e +} -body { + .e configure -font {Helvetica -24} -bd 3 -relief raised -width 0 .e insert end "01234567" update list [winfo reqwidth .e] [winfo reqheight .e] -} {116 39} -test entry-6.9 {EntryComputeGeometry procedure} {fonts} { - catch {destroy .e} - entry .e -font $big -bd 3 -relief raised -width 0 -highlightthickness 2 +} -cleanup { + destroy .e +} -result {116 39} +test entry-6.9 {EntryComputeGeometry procedure} -constraints { + fonts +} -setup { + entry .e -highlightthickness 2 pack .e +} -body { + .e configure -font {Helvetica -24} -bd 3 -relief raised -width 0 update list [winfo reqwidth .e] [winfo reqheight .e] -} {25 39} -test entry-6.10 {EntryComputeGeometry procedure} {unix fonts} { - catch {destroy .e} - entry .e -bd 1 -relief raised -width 0 -show . - .e insert 0 12345 +} -cleanup { + destroy .e +} -result {25 39} +test entry-6.10 {EntryComputeGeometry procedure} -constraints { + unix fonts +} -setup { + entry .e -highlightthickness 2 -font {Helvetica -12} pack .e +} -body { + .e configure -bd 1 -relief raised -width 0 -show . + .e insert 0 12345 update set x [winfo reqwidth .e] .e configure -show X lappend x [winfo reqwidth .e] .e configure -show "" lappend x [winfo reqwidth .e] -} {23 53 43} -test entry-6.11 {EntryComputeGeometry procedure} win { - catch {destroy .e} - entry .e -bd 1 -relief raised -width 0 -show . -font {helvetica 12} - .e insert 0 12345 +} -cleanup { + destroy .e +} -result {23 53 43} +test entry-6.11 {EntryComputeGeometry procedure} -constraints { + win +} -setup { + entry .e -highlightthickness 2 pack .e +} -body { + .e configure -bd 1 -relief raised -width 0 -show . -font {helvetica 12} + .e insert 0 12345 update - set x [winfo reqwidth .e] + set x1 [winfo reqwidth .e] + set x2 [expr {8+5*[font measure {helvetica 12} .]}] + set x [expr {$x1 eq $x2}] .e configure -show X - lappend x [winfo reqwidth .e] + set x1 [winfo reqwidth .e] + set x2 [expr {8+5*[font measure {helvetica 12} X]}] + lappend x [expr {$x1 eq $x2}] .e configure -show "" - lappend x [winfo reqwidth .e] -} [list \ - [expr 8+5*[font measure {helvetica 12} .]] \ - [expr 8+5*[font measure {helvetica 12} X]] \ - [expr 8+[font measure {helvetica 12} 12345]]] - -catch {destroy .e} -entry .e -width 10 -font $fixed -textvariable contents -xscrollcommand scroll -pack .e -focus .e -test entry-7.1 {InsertChars procedure} { - .e delete 0 end + set x1 [winfo reqwidth .e] + set x2 [expr {8+[font measure {helvetica 12} 12345]}] + lappend x [expr {$x1 eq $x2}] +} -cleanup { + destroy .e +} -result {1 1 1} + + +test entry-7.1 {InsertChars procedure} -setup { + unset -nocomplain contents + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { + .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde .e insert 2 XXX update list [.e get] $contents $scrollInfo -} {abXXXcde abXXXcde {0 1}} -test entry-7.2 {InsertChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {abXXXcde abXXXcde {0 1}} + +test entry-7.2 {InsertChars procedure} -setup { + unset -nocomplain contents + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { + .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde .e insert 500 XXX update list [.e get] $contents $scrollInfo -} {abcdeXXX abcdeXXX {0 1}} -test entry-7.3 {InsertChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {abcdeXXX abcdeXXX {0 1}} +test entry-7.3 {InsertChars procedure} -setup { + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e +} -body { .e insert 0 0123456789 .e select from 2 .e select to 6 @@ -808,9 +1936,13 @@ test entry-7.3 {InsertChars procedure} { set x "[.e index sel.first] [.e index sel.last]" .e select to 8 lappend x [.e index sel.first] [.e index sel.last] -} {5 9 5 8} -test entry-7.4 {InsertChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {5 9 5 8} +test entry-7.4 {InsertChars procedure} -setup { + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e +} -body { .e insert 0 0123456789 .e select from 2 .e select to 6 @@ -818,9 +1950,13 @@ test entry-7.4 {InsertChars procedure} { set x "[.e index sel.first] [.e index sel.last]" .e select to 8 lappend x [.e index sel.first] [.e index sel.last] -} {2 9 2 8} -test entry-7.5 {InsertChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {2 9 2 8} +test entry-7.5 {InsertChars procedure} -setup { + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e +} -body { .e insert 0 0123456789 .e select from 2 .e select to 6 @@ -828,9 +1964,13 @@ test entry-7.5 {InsertChars procedure} { set x "[.e index sel.first] [.e index sel.last]" .e select to 8 lappend x [.e index sel.first] [.e index sel.last] -} {2 9 2 8} -test entry-7.6 {InsertChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {2 9 2 8} +test entry-7.6 {InsertChars procedure} -setup { + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e +} -body { .e insert 0 0123456789 .e select from 2 .e select to 6 @@ -838,70 +1978,118 @@ test entry-7.6 {InsertChars procedure} { set x "[.e index sel.first] [.e index sel.last]" .e select to 5 lappend x [.e index sel.first] [.e index sel.last] -} {2 6 2 5} -test entry-7.7 {InsertChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {2 6 2 5} +test entry-7.7 {InsertChars procedure} -setup { + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e +} -body { + .e configure -xscrollcommand scroll .e insert 0 0123456789 .e icursor 4 .e insert 4 XXX .e index insert -} {7} -test entry-7.8 {InsertChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {7} +test entry-7.8 {InsertChars procedure} -setup { + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e +} -body { .e insert 0 0123456789 .e icursor 4 .e insert 5 XXX .e index insert -} {4} -test entry-7.9 {InsertChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {4} +test entry-7.9 {InsertChars procedure} -setup { + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e +} -body { .e insert 0 "This is a very long string" update .e xview 4 .e insert 3 XXX .e index @0 -} {7} -test entry-7.10 {InsertChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {7} +test entry-7.10 {InsertChars procedure} -setup { + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e +} -body { .e insert 0 "This is a very long string" update .e xview 4 .e insert 4 XXX .e index @0 -} {4} -.e configure -width 0 -test entry-7.11 {InsertChars procedure} {fonts} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {4} + +test entry-7.11 {InsertChars procedure} -constraints { + fonts +} -setup { + entry .e -width 0 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e +} -body { .e insert 0 "xyzzy" update .e insert 2 00 winfo reqwidth .e -} {59} +} -cleanup { + destroy .e +} -result {59} -.e configure -width 10 -test entry-8.1 {DeleteChars procedure} { - .e delete 0 end +test entry-8.1 {DeleteChars procedure} -setup { + unset -nocomplain contents + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { + .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde .e delete 2 4 update list [.e get] $contents $scrollInfo -} {abe abe {0 1}} -test entry-8.2 {DeleteChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {abe abe {0 1}} +test entry-8.2 {DeleteChars procedure} -setup { + unset -nocomplain contents + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { + .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde .e delete -2 2 update list [.e get] $contents $scrollInfo -} {cde cde {0 1}} -test entry-8.3 {DeleteChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {cde cde {0 1}} +test entry-8.3 {DeleteChars procedure} -setup { + unset -nocomplain contents + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { + .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde .e delete 3 1000 update list [.e get] $contents $scrollInfo -} {abc abc {0 1}} -test entry-8.4 {DeleteChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {abc abc {0 1}} +test entry-8.4 {DeleteChars procedure} -setup { + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { .e insert 0 0123456789abcde .e select from 3 .e select to 8 @@ -910,9 +2098,14 @@ test entry-8.4 {DeleteChars procedure} { set x "[.e index sel.first] [.e index sel.last]" .e select to 5 lappend x [.e index sel.first] [.e index sel.last] -} {1 6 1 5} -test entry-8.5 {DeleteChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {1 6 1 5} +test entry-8.5 {DeleteChars procedure} -setup { + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { .e insert 0 0123456789abcde .e select from 3 .e select to 8 @@ -921,9 +2114,14 @@ test entry-8.5 {DeleteChars procedure} { set x "[.e index sel.first] [.e index sel.last]" .e select to 4 lappend x [.e index sel.first] [.e index sel.last] -} {1 5 1 4} -test entry-8.6 {DeleteChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {1 5 1 4} +test entry-8.6 {DeleteChars procedure} -setup { + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { .e insert 0 0123456789abcde .e select from 3 .e select to 8 @@ -932,17 +2130,28 @@ test entry-8.6 {DeleteChars procedure} { set x "[.e index sel.first] [.e index sel.last]" .e select to 5 lappend x [.e index sel.first] [.e index sel.last] -} {1 2 1 5} -test entry-8.7 {DeleteChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {1 2 1 5} +test entry-8.7 {DeleteChars procedure} -setup { + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { .e insert 0 0123456789abcde .e select from 3 .e select to 8 .e delete 1 8 - list [catch {.e index sel.first} msg] $msg -} {1 {selection isn't in widget .e}} -test entry-8.8 {DeleteChars procedure} { - .e delete 0 end + update + .e index sel.first +} -cleanup { + destroy .e +} -returnCodes error -result {selection isn't in widget .e} +test entry-8.8 {DeleteChars procedure} -setup { + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { .e insert 0 0123456789abcde .e select from 3 .e select to 8 @@ -951,17 +2160,27 @@ test entry-8.8 {DeleteChars procedure} { set x "[.e index sel.first] [.e index sel.last]" .e select to 8 lappend x [.e index sel.first] [.e index sel.last] -} {3 4 3 8} -test entry-8.9 {DeleteChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {3 4 3 8} +test entry-8.9 {DeleteChars procedure} -setup { + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e +} -body { .e insert 0 0123456789abcde .e select from 3 .e select to 8 .e delete 3 8 - list [catch {.e index sel.first} msg] $msg -} {1 {selection isn't in widget .e}} -test entry-8.10 {DeleteChars procedure} { - .e delete 0 end + update + .e index sel.first +} -cleanup { + destroy .e +} -returnCodes error -result {selection isn't in widget .e} +test entry-8.10 {DeleteChars procedure} -setup { + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { .e insert 0 0123456789abcde .e select from 8 .e select to 3 @@ -970,9 +2189,14 @@ test entry-8.10 {DeleteChars procedure} { set x "[.e index sel.first] [.e index sel.last]" .e select to 8 lappend x [.e index sel.first] [.e index sel.last] -} {3 5 5 8} -test entry-8.11 {DeleteChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {3 5 5 8} +test entry-8.11 {DeleteChars procedure} -setup { + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { .e insert 0 0123456789abcde .e select from 8 .e select to 3 @@ -981,124 +2205,186 @@ test entry-8.11 {DeleteChars procedure} { set x "[.e index sel.first] [.e index sel.last]" .e select to 4 lappend x [.e index sel.first] [.e index sel.last] -} {3 8 4 8} -test entry-8.12 {DeleteChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {3 8 4 8} +test entry-8.12 {DeleteChars procedure} -setup { + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { .e insert 0 0123456789abcde .e icursor 4 .e delete 1 4 + update .e index insert -} {1} -test entry-8.13 {DeleteChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {1} +test entry-8.13 {DeleteChars procedure} -setup { + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { .e insert 0 0123456789abcde .e icursor 4 .e delete 1 5 + update .e index insert -} {1} -test entry-8.14 {DeleteChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {1} +test entry-8.14 {DeleteChars procedure} -setup { + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { .e insert 0 0123456789abcde .e icursor 4 .e delete 4 6 + update .e index insert -} {4} -test entry-8.15 {DeleteChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {4} +test entry-8.15 {DeleteChars procedure} -setup { + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { .e insert 0 "This is a very long string" .e xview 4 .e delete 1 4 + update .e index @0 -} {1} -test entry-8.16 {DeleteChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {1} +test entry-8.16 {DeleteChars procedure} -setup { + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { .e insert 0 "This is a very long string" .e xview 4 .e delete 1 5 + update .e index @0 -} {1} -test entry-8.17 {DeleteChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {1} +test entry-8.17 {DeleteChars procedure} -setup { + entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { .e insert 0 "This is a very long string" .e xview 4 .e delete 4 6 + update .e index @0 -} {4} -.e configure -width 0 -test entry-8.18 {DeleteChars procedure} {fonts} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {4} +test entry-8.18 {DeleteChars procedure} -setup { + entry .e -width 0 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { .e insert 0 "xyzzy" update .e delete 2 4 winfo reqwidth .e -} {31} +} -cleanup { + destroy .e +} -result {31} -test entry-9.1 {EntryValueChanged procedure} { - catch {destroy .e} - proc override args { - global x - set x 12345 - } - catch {unset x} +test entry-9.1 {EntryValueChanged procedure} -setup { + unset -nocomplain x +} -body { trace variable x w override - entry .e -textvariable x + entry .e -textvariable x -width 0 .e insert 0 foo - set result [list $x [.e get]] - unset x; rename override {} - set result -} {12345 12345} - -catch {destroy .e} -entry .e -pack .e -.e configure -width 0 -test entry-10.1 {EntrySetValue procedure} {fonts} { + list $x [.e get] +} -cleanup { + destroy .e + trace vdelete x w override + unset x +} -result {12345 12345} + + +test entry-10.1 {EntrySetValue procedure} -constraints fonts -body { set x abcde set y ab - .e configure -textvariable x - update + entry .e -font {Helvetica -12} -highlightthickness 2 -bd 2 -width 0 + pack .e + .e configure -textvariable x .e configure -textvariable y update list [.e get] [winfo reqwidth .e] -} {ab 24} -test entry-10.2 {EntrySetValue procedure, updating selection} { - catch {destroy .e} - entry .e -textvariable x +} -cleanup { + destroy .e +} -result {ab 24} +test entry-10.2 {EntrySetValue procedure, updating selection} -setup { + unset -nocomplain x + entry .e -font {Helvetica -12} -highlightthickness 2 -bd 2 + pack .e +} -body { + .e configure -textvariable x .e insert 0 "abcdefghjklmnopqrstu" .e selection range 4 10 set x "a" - list [catch {.e index sel.first} msg] $msg -} {1 {selection isn't in widget .e}} -test entry-10.3 {EntrySetValue procedure, updating selection} { - catch {destroy .e} - entry .e -textvariable x + .e index sel.first +} -cleanup { + destroy .e +} -returnCodes error -result {selection isn't in widget .e} +test entry-10.3 {EntrySetValue procedure, updating selection} -setup { + unset -nocomplain x + entry .e -font {Helvetica -12} -highlightthickness 2 -bd 2 + pack .e +} -body { + .e configure -textvariable x .e insert 0 "abcdefghjklmnopqrstu" .e selection range 4 10 set x "abcdefg" list [.e index sel.first] [.e index sel.last] -} {4 7} -test entry-10.4 {EntrySetValue procedure, updating selection} { - catch {destroy .e} - entry .e -textvariable x +} -cleanup { + destroy .e +} -result {4 7} +test entry-10.4 {EntrySetValue procedure, updating selection} -setup { + unset -nocomplain x + entry .e -font {Helvetica -12} -highlightthickness 2 -bd 2 + pack .e +} -body { + .e configure -textvariable x .e insert 0 "abcdefghjklmnopqrstu" .e selection range 4 10 set x "abcdefghijklmn" list [.e index sel.first] [.e index sel.last] -} {4 10} -test entry-10.5 {EntrySetValue procedure, updating display position} { - catch {destroy .e} - entry .e -width 10 -font $fixed -textvariable x +} -cleanup { + destroy .e +} -result {4 10} +test entry-10.5 {EntrySetValue procedure, updating display position} -setup { + unset -nocomplain x + entry .e -highlightthickness 2 -bd 2 pack .e +} -body { + .e configure -width 10 -font {Courier -12} -textvariable x .e insert 0 "abcdefghjklmnopqrstuvwxyz" .e xview 10 update set x "abcdefg" update .e index @0 -} {0} -test entry-10.6 {EntrySetValue procedure, updating display position} { - catch {destroy .e} - entry .e -width 10 -font $fixed -textvariable x +} -cleanup { + destroy .e +} -result {0} +test entry-10.6 {EntrySetValue procedure, updating display position} -setup { + unset -nocomplain x + entry .e -highlightthickness 2 -bd 2 + pack .e +} -body { + .e configure -width 10 -font {Courier -12} -textvariable x pack .e .e insert 0 "abcdefghjklmnopqrstuvwxyz" .e xview 10 @@ -1106,192 +2392,463 @@ test entry-10.6 {EntrySetValue procedure, updating display position} { set x "1234567890123456789012" update .e index @0 -} {10} -test entry-10.7 {EntrySetValue procedure, updating insertion cursor} { - catch {destroy .e} - entry .e -width 10 -font $fixed -textvariable x +} -cleanup { + destroy .e +} -result {10} +test entry-10.7 {EntrySetValue procedure, updating insertion cursor} -setup { + unset -nocomplain x + entry .e -highlightthickness 2 -bd 2 + pack .e + update +} -body { + .e configure -width 10 -font {Courier -12} -textvariable x pack .e .e insert 0 "abcdefghjklmnopqrstuvwxyz" .e icursor 5 set x "123" .e index insert -} {3} -test entry-10.8 {EntrySetValue procedure, updating insertion cursor} { - catch {destroy .e} - entry .e -width 10 -font $fixed -textvariable x +} -cleanup { + destroy .e +} -result {3} +test entry-10.8 {EntrySetValue procedure, updating insertion cursor} -setup { + unset -nocomplain x + entry .e -highlightthickness 2 -bd 2 + pack .e +} -body { + .e configure -width 10 -font {Courier -12} -textvariable x pack .e .e insert 0 "abcdefghjklmnopqrstuvwxyz" .e icursor 5 set x "123456" .e index insert -} {5} +} -cleanup { + destroy .e +} -result {5} -test entry-11.1 {EntryEventProc procedure} { - catch {destroy .e} - entry .e +test entry-11.1 {EntryEventProc procedure} -setup { + entry .e -highlightthickness 2 -bd 2 -font {Helvetica -12} + pack .e +} -body { .e insert 0 abcdefg destroy .e update -} {} -test entry-11.2 {EntryEventProc procedure} { - deleteWindows +} -cleanup { + destroy .e +} -result {} +test entry-11.2 {EntryEventProc procedure} -setup { + set x {} +} -body { entry .e1 -fg #112233 rename .e1 .e2 - set x {} lappend x [winfo children .] lappend x [.e2 cget -fg] destroy .e1 lappend x [info command .e*] [winfo children .] -} {.e1 #112233 {} {}} - -test entry-12.1 {EntryCmdDeletedProc procedure} { - deleteWindows - button .e1 -text "xyz_123" - rename .e1 {} - list [info command .e*] [winfo children .] -} {{} {}} - -catch {destroy .e} -entry .e -font $fixed -width 5 -bd 2 -relief sunken -pack .e -.e insert 0 012345678901234567890 -.e xview 4 -update -test entry-13.1 {GetEntryIndex procedure} { +} -cleanup { + destroy .e1 +} -result {.e1 #112233 {} {}} + +test entry-12.1 {EntryCmdDeletedProc procedure} -body { + button .b -text "xyz_123" + rename .b {} + list [info command .b*] [winfo children .] +} -cleanup { + destroy .b +} -result {{} {}} + + +test entry-13.1 {GetEntryIndex procedure} -setup { + entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken + pack .e +} -body { + .e insert 0 012345678901234567890 + .e xview 4 + update .e index end -} {21} -test entry-13.2 {GetEntryIndex procedure} { - list [catch {.e index abogus} msg] $msg -} {1 {bad entry index "abogus"}} -test entry-13.3 {GetEntryIndex procedure} { +} -cleanup { + destroy .e +} -result {21} +test entry-13.2 {GetEntryIndex procedure} -body { + entry .e + .e index abogus +} -cleanup { + destroy .e +} -returnCodes error -result {bad entry index "abogus"} +test entry-13.3 {GetEntryIndex procedure} -setup { + entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken + pack .e +} -body { + .e insert 0 012345678901234567890 + .e xview 4 + update .e select from 1 .e select to 6 .e index anchor -} {1} -test entry-13.4 {GetEntryIndex procedure} { +} -cleanup { + destroy .e +} -result {1} +test entry-13.4 {GetEntryIndex procedure} -setup { + entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken + pack .e +} -body { + .e insert 0 012345678901234567890 + .e xview 4 + update .e select from 4 .e select to 1 .e index anchor -} {4} -test entry-13.5 {GetEntryIndex procedure} { +} -cleanup { + destroy .e +} -result {4} +test entry-13.5 {GetEntryIndex procedure} -setup { + entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken + pack .e +} -body { + .e insert 0 012345678901234567890 + .e xview 4 + update .e select from 3 .e select to 15 .e select adjust 4 .e index anchor -} {15} -test entry-13.6 {GetEntryIndex procedure} { - list [catch {.e index ebogus} msg] $msg -} {1 {bad entry index "ebogus"}} -test entry-13.7 {GetEntryIndex procedure} { +} -cleanup { + destroy .e +} -result {15} +test entry-13.6 {GetEntryIndex procedure} -setup { + entry .e +} -body { + .e index ebogus +} -cleanup { + destroy .e +} -returnCodes error -result {bad entry index "ebogus"} +test entry-13.7 {GetEntryIndex procedure} -setup { + entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken + pack .e +} -body { + .e insert 0 012345678901234567890 + .e xview 4 + update .e icursor 2 .e index insert -} {2} -test entry-13.8 {GetEntryIndex procedure} { - list [catch {.e index ibogus} msg] $msg -} {1 {bad entry index "ibogus"}} -test entry-13.9 {GetEntryIndex procedure} { +} -cleanup { + destroy .e +} -result {2} +test entry-13.8 {GetEntryIndex procedure} -setup { + entry .e +} -body { + .e index ibogus +} -cleanup { + destroy .e +} -returnCodes error -result {bad entry index "ibogus"} +test entry-13.9 {GetEntryIndex procedure} -setup { + entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken + pack .e +} -body { + .e insert 0 012345678901234567890 + .e xview 4 + update .e select from 1 .e select to 6 list [.e index sel.first] [.e index sel.last] -} {1 6} -selection clear .e -test entry-13.10 {GetEntryIndex procedure} unix { - # On unix, when selection is cleared, entry widget's internal - # selection range is reset. - - list [catch {.e index sel.first} msg] $msg -} {1 {selection isn't in widget .e}} -test entry-13.11 {GetEntryIndex procedure} win { - # On mac and pc, when selection is cleared, entry widget remembers - # last selected range. When selection ownership is restored to - # entry, the old range will be rehighlighted. - - list [catch {selection get}] [.e index sel.first] -} {1 1} -test entry-13.12 {GetEntryIndex procedure} unix { - list [catch {.e index sbogus} msg] $msg -} {1 {selection isn't in widget .e}} -test entry-13.13 {GetEntryIndex procedure} win { - list [catch {.e index sbogus} msg] $msg -} {1 {bad entry index "sbogus"}} -test entry-13.14 {GetEntryIndex procedure} win { - list [catch {selection get}] [catch {.e index sbogus}] -} {1 1} -test entry-13.15 {GetEntryIndex procedure} { - list [catch {.e index @xyz} msg] $msg -} {1 {bad entry index "@xyz"}} -test entry-13.16 {GetEntryIndex procedure} {fonts} { +} -cleanup { + destroy .e +} -result {1 6} + +test entry-13.10 {GetEntryIndex procedure} -constraints unix -body { +# On unix, when selection is cleared, entry widget's internal +# selection range is reset. +# Previous settings: + entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update + .e select from 1 + .e select to 6 + list [.e index sel.first] [.e index sel.last] +# Testing: + selection clear .e + .e index sel.first +} -cleanup { + destroy .e +} -returnCodes error -result {selection isn't in widget .e} +test entry-13.11 {GetEntryIndex procedure} -constraints unix -body { +# Previous settings: + entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update + .e select from 1 + .e select to 6 + list [.e index sel.first] [.e index sel.last] +# Testing: + selection clear .e + .e index sbogus +} -cleanup { + destroy .e +} -returnCodes error -result {selection isn't in widget .e} + +# why when string in .e index changed to not beginning with s, +# it behaves differently? +test entry-13.12 {GetEntryIndex procedure} -constraints unix -body { +# Previous settings: + entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update + .e select from 1 + .e select to 6 + list [.e index sel.first] [.e index sel.last] +# Testing: + selection clear .e + .e index bogus +} -cleanup { + destroy .e +} -returnCodes error -result {bad entry index "bogus"} + +test entry-13.13 {GetEntryIndex procedure} -constraints win -body { +# On mac and pc, when selection is cleared, entry widget remembers +# last selected range. When selection ownership is restored to +# entry, the old range will be rehighlighted. +# Previous settings: + entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update + .e select from 1 + .e select to 6 + list [.e index sel.first] [.e index sel.last] +# Testing: + selection clear .e + selection get +} -cleanup { + destroy .e +} -returnCodes error -match glob -result {*} +test entry-13.14 {GetEntryIndex procedure} -constraints win -body { +# On mac and pc, when selection is cleared, entry widget remembers +# last selected range. When selection ownership is restored to +# entry, the old range will be rehighlighted. +# Previous settings: + entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update + .e select from 1 + .e select to 6 + list [.e index sel.first] [.e index sel.last] +# Testing: + selection clear .e + catch {selection get} + .e index sel.first +} -cleanup { + destroy .e +} -result {1} +test entry-13.15 {GetEntryIndex procedure} -constraints win -body { +# On mac and pc, when selection is cleared, entry widget remembers +# last selected range. When selection ownership is restored to +# entry, the old range will be rehighlighted. +# Previous settings: + entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update + .e select from 1 + .e select to 6 + list [.e index sel.first] [.e index sel.last] +# Testing: + selection clear .e + catch {selection get} + .e index sbogus +} -cleanup { + destroy .e +} -returnCodes error -match glob -result {*} +test entry-13.16 {GetEntryIndex procedure} -constraints win -body { +# Previous settings: + entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update + .e select from 1 + .e select to 6 + list [.e index sel.first] [.e index sel.last] +# Testing: + selection clear .e + .e index sbogus +} -cleanup { + destroy .e +} -returnCodes error -result {bad entry index "sbogus"} + +test entry-13.17 {GetEntryIndex procedure} -body { + entry .e + selection clear .e + .e index @xyz +} -cleanup { + destroy .e +} -returnCodes error -result {bad entry index "@xyz"} + +test entry-13.18 {GetEntryIndex procedure} -constraints fonts -body { + entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\ + -font {Courier -12} + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update .e index @4 -} {4} -test entry-13.17 {GetEntryIndex procedure} {fonts} { +} -cleanup { + destroy .e +} -result {4} +test entry-13.19 {GetEntryIndex procedure} -constraints fonts -body { + entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\ + -font {Courier -12} + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update .e index @11 -} {4} -test entry-13.18 {GetEntryIndex procedure} {fonts} { +} -cleanup { + destroy .e +} -result {4} +test entry-13.20 {GetEntryIndex procedure} -constraints fonts -body { + entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\ + -font {Courier -12} + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update .e index @12 -} {5} -test entry-13.19 {GetEntryIndex procedure} {fonts} { - .e index @[expr [winfo width .e] - 6] -} {8} -test entry-13.20 {GetEntryIndex procedure} {fonts} { - .e index @[expr [winfo width .e] - 5] -} {9} -test entry-13.21 {GetEntryIndex procedure} { +} -cleanup { + destroy .e +} -result {5} +test entry-13.21 {GetEntryIndex procedure} -constraints fonts -body { + entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\ + -font {Courier -12} + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update + .e index @[expr {[winfo width .e] - 6}] +} -cleanup { + destroy .e +} -result {8} +test entry-13.22 {GetEntryIndex procedure} -constraints fonts -body { + entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\ + -font {Courier -12} + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update + .e index @[expr {[winfo width .e] - 5}] +} -cleanup { + destroy .e +} -result {9} +test entry-13.23 {GetEntryIndex procedure} -body { + entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\ + -font {Courier -12} + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update .e index @1000 -} {9} -test entry-13.22 {GetEntryIndex procedure} { - list [catch {.e index 1xyz} msg] $msg -} {1 {bad entry index "1xyz"}} -test entry-13.23 {GetEntryIndex procedure} { +} -cleanup { + destroy .e +} -result {9} +test entry-13.24 {GetEntryIndex procedure} -setup { + entry .e + pack .e + update +} -body { + .e index 1xyz +} -cleanup { + destroy .e +} -returnCodes error -result {bad entry index "1xyz"} +test entry-13.25 {GetEntryIndex procedure} -body { + entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\ + -font {Courier -12} + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update .e index -10 -} {0} -test entry-13.24 {GetEntryIndex procedure} { +} -cleanup { + destroy .e +} -result {0} +test entry-13.26 {GetEntryIndex procedure} -body { + entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\ + -font {Courier -12} + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update .e index 12 -} {12} -test entry-13.25 {GetEntryIndex procedure} { +} -cleanup { + destroy .e +} -result {12} +test entry-13.27 {GetEntryIndex procedure} -body { + entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\ + -font {Courier -12} + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update .e index 49 -} {21} -test entry-13.26 {GetEntryIndex procedure} {fonts} { - catch {destroy .e} - entry .e -show . +} -cleanup { + destroy .e +} -result {21} +test entry-13.28 {GetEntryIndex procedure} -constraints fonts -body { + entry .e -highlightthickness 2 -bd 2 -font {Helvetica -12} + selection clear .e + .e configure -show . .e insert 0 XXXYZZY pack .e update list [.e index @7] [.e index @8] -} {0 1} +} -cleanup { + destroy .e +} -result {0 1} # XXX Still need to write tests for EntryScanTo and EntrySelectTo. -set x {} -for {set i 1} {$i <= 500} {incr i} { - append x "This is line $i, out of 500\n" -} -test entry-14.1 {EntryFetchSelection procedure} { - catch {destroy .e} + +test entry-14.1 {EntryFetchSelection procedure} -body { entry .e .e insert end "This is a test string" .e select from 1 .e select to 18 selection get -} {his is a test str} -test entry-14.2 {EntryFetchSelection procedure} { - catch {destroy .e} +} -cleanup { + destroy .e +} -result {his is a test str} +test entry-14.2 {EntryFetchSelection procedure} -body { entry .e -show * .e insert end "This is a test string" .e select from 1 .e select to 18 selection get -} {*****************} -test entry-14.3 {EntryFetchSelection procedure} { - catch {destroy .e} +} -cleanup { + destroy .e +} -result {*****************} +test entry-14.3 {EntryFetchSelection procedure} -setup { + set x {} + for {set i 1} {$i <= 500} {incr i} { + append x "This is line $i, out of 500\n" +} +} -body { entry .e - .e insert end $x + .e insert end $x .e select from 0 .e select to end string compare [selection get] $x -} 0 +} -cleanup { + destroy .e +} -result {0} -test entry-15.1 {EntryLostSelection} { - catch {destroy .e} +test entry-15.1 {EntryLostSelection} -body { entry .e .e insert 0 "Text" .e select from 0 @@ -1301,334 +2858,617 @@ test entry-15.1 {EntryLostSelection} { .e select from 0 .e select to 4 lappend result [selection get] -} {Text Text} - -# No tests for EventuallyRedraw. - -catch {destroy .e} -entry .e -width 10 -xscrollcommand scroll -pack .e -update +} -cleanup { + destroy .e +} -result {Text Text} -test entry-16.1 {EntryVisibleRange procedure} {fonts} { - .e delete 0 end - .e insert 0 ............................. +# is scrollcommand needed here?? +test entry-16.1 {EntryVisibleRange procedure} -constraints fonts -body { + entry .e -width 10 -font {Helvetica -12} + pack .e + update + .e insert 0 "............................." .e xview -} {0 0.827586} -test entry-15.2 {EntryVisibleRange procedure} {unix fonts} { - .e configure -show X - .e delete 0 end - .e insert 0 ............................. +} -cleanup { + destroy .e +} -result {0 0.827586} +test entry-16.2 {EntryVisibleRange procedure} -constraints { + unix fonts +} -body { + entry .e -show X -width 10 -font {Helvetica -12} + pack .e + update + .e insert 0 "............................." .e xview -} {0 0.275862} -test entry-15.3 {EntryVisibleRange procedure} win { - .e configure -show . - .e delete 0 end +} -cleanup { + destroy .e +} -result {0 0.275862} +test entry-16.3 {EntryVisibleRange procedure} -constraints { + win +} -body { + entry .e -show . -width 10 -font {Helvetica -12} + pack .e + update .e insert 0 XXXXXXXXXXXXXXXXXXXXXXXXXXXXX .e xview -} {0 0.827586} -.e configure -show "" -test entry-15.4 {EntryVisibleRange procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {0 0.827586} +test entry-16.4 {EntryVisibleRange procedure} -body { + entry .e -show "" .e xview -} {0 1} +} -cleanup { + destroy .e +} -result {0 1} -catch {destroy .e} -entry .e -width 10 -xscrollcommand scroll -font $fixed -pack .e -update -test entry-17.1 {EntryUpdateScrollbar procedure} { + +test entry-17.1 {EntryUpdateScrollbar procedure} -body { + entry .e -width 10 -xscrollcommand scroll -font {Courier -12} + pack .e .e delete 0 end .e insert 0 123 update - set scrollInfo -} {0 1} -test entry-17.2 {EntryUpdateScrollbar procedure} { - .e delete 0 end + return $scrollInfo +} -cleanup { + destroy .e +} -result {0 1} +test entry-17.2 {EntryUpdateScrollbar procedure} -body { + entry .e -width 10 -xscrollcommand scroll -font {Courier -12} + pack .e .e insert 0 0123456789abcdef .e xview 3 update - set scrollInfo -} {0.1875 0.8125} -test entry-17.3 {EntryUpdateScrollbar procedure} { - .e delete 0 end + return $scrollInfo +} -cleanup { + destroy .e +} -result {0.1875 0.8125} +test entry-17.3 {EntryUpdateScrollbar procedure} -body { + entry .e -width 10 -xscrollcommand scroll -font {Courier -12} + pack .e .e insert 0 abcdefghijklmnopqrs .e xview 6 update - set scrollInfo -} {0.315789 0.842105} -test entry-17.4 {EntryUpdateScrollbar procedure} { + return $scrollInfo +} -cleanup { destroy .e +} -result {0.315789 0.842105} +test entry-17.4 {EntryUpdateScrollbar procedure} -setup { proc bgerror msg { global x set x $msg - } +} +} -body { entry .e -width 5 -xscrollcommand thisisnotacommand pack .e update - rename bgerror {} list $x $errorInfo -} {{invalid command name "thisisnotacommand"} {invalid command name "thisisnotacommand" +} -cleanup { + destroy .e + rename bgerror {} +} -result {{invalid command name "thisisnotacommand"} {invalid command name "thisisnotacommand" while executing "thisisnotacommand 0 1" (horizontal scrolling command executed by .e)}} -set l [interp hidden] -deleteWindows -test entry-18.1 {Entry widget vs hiding} { - destroy .e +test entry-18.1 {Entry widget vs hiding} -setup { entry .e +} -body { + set l [interp hidden] interp hide {} .e destroy .e - list [winfo children .] [interp hidden] -} [list {} $l] + set res1 [list [winfo children .] [interp hidden]] + set res2 [list {} $l] + expr {$res1 == $res2} +} -result {1} ## ## Entry widget VALIDATION tests ## - -destroy .e -catch {unset ::e} -catch {unset ::vVals} -entry .e -validate all \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white -pack .e -proc doval {W d i P s S v V} { - set ::vVals [list $W $d $i $P $s $S $v $V] - return 1 -} - # The validation tests build each one upon the previous, so cascading # failures aren't good # -test entry-19.1 {entry widget validation} { + +# 19.* test cases in previous version highly depended on the previous +# test cases. This was replaced by inserting recently set configurations +# that matters for the test case +test entry-19.1 {entry widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + entry .e -validate all \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e .e insert 0 a - set ::vVals -} {.e 1 0 a {} a all key} -test entry-19.2 {entry widget validation} { + return $::vVals +} -cleanup { + destroy .e +} -result {.e 1 0 a {} a all key} + +test entry-19.2 {entry widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + entry .e -validate all \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + .e insert 0 a ;# previous settings .e insert 1 b - set ::vVals -} {.e 1 1 ab a b all key} -test entry-19.3 {entry widget validation} { + return $::vVals +} -cleanup { + destroy .e +} -result {.e 1 1 ab a b all key} + +test entry-19.3 {entry widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + entry .e -validate all \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + .e insert 0 ab ;# previous settings .e insert end c - set ::vVals -} {.e 1 2 abc ab c all key} -test entry-19.4 {entry widget validation} { + return $::vVals +} -cleanup { + destroy .e +} -result {.e 1 2 abc ab c all key} + +test entry-19.4 {entry widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + entry .e -validate all \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + .e insert 0 abc ;# previous settings .e insert 1 123 list $::vVals $::e -} {{.e 1 1 a123bc abc 123 all key} a123bc} -test entry-19.5 {entry widget validation} { +} -cleanup { + destroy .e +} -result {{.e 1 1 a123bc abc 123 all key} a123bc} + +test entry-19.5 {entry widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + entry .e -validate all \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + .e insert 0 a123bc ;# previous settings .e delete 2 - set ::vVals -} {.e 0 2 a13bc a123bc 2 all key} -test entry-19.6 {entry widget validation} { + return $::vVals +} -cleanup { + destroy .e +} -result {.e 0 2 a13bc a123bc 2 all key} + +test entry-19.6 {entry widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + entry .e -validate all \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + .e insert 0 a13bc ;# previous settings .e configure -validate key .e delete 1 3 - set ::vVals -} {.e 0 1 abc a13bc 13 key key} -test entry-19.7 {entry widget validation} { + return $::vVals +} -cleanup { + destroy .e +} -result {.e 0 1 abc a13bc 13 key key} + +test entry-19.7 {entry widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + entry .e -validate focus \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + .e insert end abc ;# previous settings set ::vVals {} - .e configure -validate focus .e insert end d - set ::vVals -} {} -test entry-19.8 {entry widget validation} { + return $::vVals +} -cleanup { + destroy .e +} -result {} + +test entry-19.8 {entry widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + entry .e -validate all \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + .e configure -validate focus ;# previous settings + .e insert end abcd ;# previous settings focus -force .e - # update necessary to process FocusIn event +# update necessary to process FocusIn event update - set ::vVals -} {.e -1 -1 abcd abcd {} focus focusin} -test entry-19.9 {entry widget validation} { + return $::vVals +} -cleanup { + destroy .e +} -result {.e -1 -1 abcd abcd {} focus focusin} + +test entry-19.9 {entry widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + entry .e -validate focus \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + .e insert end abcd ;# previous settings + focus -force .e ;# previous settings + update ;# previous settings +# update necessary to process FocusIn event focus -force . - # update necessary to process FocusOut event +# update necessary to process FocusOut event update - set ::vVals -} {.e -1 -1 abcd abcd {} focus focusout} -.e configure -validate all -test entry-19.10 {entry widget validation} { + return $::vVals +} -cleanup { + destroy .e +} -result {.e -1 -1 abcd abcd {} focus focusout} + +test entry-19.10 {entry widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + entry .e -validate all \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + .e insert end abcd ;# previous settings focus -force .e - # update necessary to process FocusIn event +# update necessary to process FocusIn event update - set ::vVals -} {.e -1 -1 abcd abcd {} all focusin} -test entry-19.11 {entry widget validation} { + return $::vVals +} -cleanup { + destroy .e +} -result {.e -1 -1 abcd abcd {} all focusin} + +test entry-19.11 {entry widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + entry .e -validate all \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + .e insert end abcd ;# previous settings + focus -force .e ;# previous settings +# update necessary to process FocusIn event + update ;# previous settings focus -force . - # update necessary to process FocusOut event +# update necessary to process FocusOut event update - set ::vVals -} {.e -1 -1 abcd abcd {} all focusout} -.e configure -validate focusin -test entry-19.12 {entry widget validation} { + return $::vVals +} -cleanup { + destroy .e +} -result {.e -1 -1 abcd abcd {} all focusout} + +test entry-19.12 {entry widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + entry .e -validate focusin \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + .e insert 0 abcd ;# previous settings focus -force .e - # update necessary to process FocusIn event +# update necessary to process FocusIn event update - set ::vVals -} {.e -1 -1 abcd abcd {} focusin focusin} -test entry-19.13 {entry widget validation} { + return $::vVals +} -cleanup { + destroy .e +} -result {.e -1 -1 abcd abcd {} focusin focusin} + +test entry-19.13 {entry widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + entry .e -validate focusin \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + .e insert end abcd ;# previous settings set ::vVals {} focus -force . - # update necessary to process FocusOut event +# update necessary to process FocusOut event update - set ::vVals -} {} -.e configure -validate focuso -test entry-19.14 {entry widget validation} { + return $::vVals +} -cleanup { + destroy .e +} -result {} + +test entry-19.14 {entry widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + entry .e -validate focuso \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + .e insert end abcd ;# previous settings + set ::vVals {} ;# previous settings focus -force .e - # update necessary to process FocusIn event +# update necessary to process FocusIn event + update + return $::vVals +} -cleanup { + destroy .e +} -result {} + +test entry-19.15 {entry widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + entry .e -validate focuso \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + .e insert end abcd ;# previous settings + set ::vVals {} ;# previous settings + focus -force .e ;# previous settings +# update necessary to process FocusIn event + update ;# previous settings + focus -force . +# update necessary to process FocusOut event update - set ::vVals -} {} -test entry-19.15 {entry widget validation} { + return $::vVals +} -cleanup { + destroy .e +} -result {.e -1 -1 abcd abcd {} focusout focusout} + +# the same as 19.16 but added [.e validate] to returned list +test entry-19.16 {entry widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + entry .e -validate focuso \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + .e insert end abcd ;# previous settings + set ::vVals {} ;# previous settings + focus -force .e ;# previous settings +# update necessary to process FocusIn event + update ;# previous settings focus -force . - # update necessary to process FocusOut event +# update necessary to process FocusOut event update - set ::vVals -} {.e -1 -1 abcd abcd {} focusout focusout} -test entry-19.16 {entry widget validation} { list [.e validate] $::vVals -} {1 {.e -1 -1 abcd abcd {} all forced}} -test entry-19.17 {entry widget validation} { +} -cleanup { + destroy .e +} -result {1 {.e -1 -1 abcd abcd {} all forced}} + + +test entry-19.17 {entry widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + entry .e -validate focuso \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + .e insert end abcd ;# previous settings set ::e newdata list [.e cget -validate] $::vVals -} {focusout {.e -1 -1 newdata abcd {} focusout forced}} +} -cleanup { + destroy .e +} -result {focusout {.e -1 -1 newdata abcd {} focusout forced}} -proc doval {W d i P s S v V} { - set ::vVals [list $W $d $i $P $s $S $v $V] - return 0 -} -test entry-19.18 {entry widget validation} { +# proc doval changed - returns 0 +test entry-19.18 {entry widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + entry .e -validate all \ + -validatecommand [list doval3 %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + set ::e newdata ;# previous settings .e configure -validate all set ::e nextdata list [.e cget -validate] $::vVals -} {none {.e -1 -1 nextdata newdata {} all forced}} - -proc doval {W d i P s S v V} { - set ::vVals [list $W $d $i $P $s $S $v $V] - set ::e mydata - return 1 -} +} -cleanup { + destroy .e +} -result {none {.e -1 -1 nextdata newdata {} all forced}} ## This sets validate to none because it shows that we prevent a possible ## loop condition in the validation, when the entry textvar is also set -test entry-19.19 {entry widget validation} { - .e configure -validate all +# proc doval2 used +test entry-19.19 {entry widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + entry .e -validate all \ + -validatecommand [list doval3 %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + set ::e nextdata ;# previous settings + + .e configure -validatecommand [list doval2 %W %d %i %P %s %S %v %V] .e validate list [.e cget -validate] [.e get] $::vVals -} {none mydata {.e -1 -1 nextdata nextdata {} all forced}} +} -cleanup { + destroy .e +} -result {none mydata {.e -1 -1 nextdata nextdata {} all forced}} ## This leaves validate alone because we trigger validation through the ## textvar (a write trace), and the write during validation triggers ## nothing (by definition of avoiding loops on var traces). This is ## one of those "dangerous" conditions where the user will have a ## different value in the entry widget shown as is in the textvar. -test entry-19.20 {entry widget validation} { +test entry-19.20 {entry widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + entry .e -validate all \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + set ::e nextdata ;# previous settings + .e configure -validatecommand [list doval2 %W %d %i %P %s %S %v %V] ;# prev + .e validate ;# previous settings + .e configure -validate all set ::e testdata list [.e cget -validate] [.e get] $::e $::vVals -} {all testdata mydata {.e -1 -1 testdata mydata {} all forced}} - -destroy .e -catch {unset ::e ::vVals} - +} -cleanup { + destroy .e +} -result {all testdata mydata {.e -1 -1 testdata mydata {} all forced}} ## ## End validation tests ## -test entry-20.1 {widget deletion while active} { - destroy .e +test entry-20.1 {widget deletion while active} -body { entry .e -validate all \ -validatecommand { destroy %W ; return 1 } \ -invalidcommand bell update .e insert 0 abc winfo exists .e -} 0 -test entry-20.2 {widget deletion while active} { +} -cleanup { destroy .e +} -result {0} + +test entry-20.2 {widget deletion while active} -body { entry .e -validate all \ -validatecommand { return 0 } \ -invalidcommand { destroy %W } .e insert 0 abc winfo exists .e -} 0 -test entry-20.3 {widget deletion while active} { +} -cleanup { destroy .e +} -result {0} + +test entry-20.3 {widget deletion while active} -body { entry .e -validate all \ -validatecommand { rename .e {} ; return 1 } .e insert 0 abc winfo exists .e -} 0 -test entry-20.4 {widget deletion while active} { +} -cleanup { destroy .e +} -result {0} + +test entry-20.4 {widget deletion while active} -body { entry .e -validate all \ -validatecommand { return 0 } \ -invalidcommand { rename .e {} } .e insert 0 abc winfo exists .e -} 0 -test entry-20.5 {widget deletion while active} { +} -cleanup { destroy .e +} -result {0} + +test entry-20.5 {widget deletion while active} -body { entry .e -validatecommand { destroy .e ; return 0 } .e validate winfo exists .e -} 0 -test entry-20.6 {widget deletion while active} { +} -cleanup { destroy .e +} -result {0} + +test entry-20.6 {widget deletion while active} -body { pack [entry .e] update .e config -xscrollcommand { destroy .e } update idle winfo exists .e -} 0 -test entry-20.7 {widget deletion with textvariable active} { - # SF bugs 607390 and 617446 +} -cleanup { destroy .e +} -result {0} + +test entry-20.7 {widget deletion with textvariable active} -body { +# SF bugs 607390 and 617446 set FOO init entry .e -textvariable FOO -validate all \ -vcmd {%W configure -bg white; format 1} bind .e { set FOO hello } destroy .e winfo exists .e -} 0 - -test entry-21.1 {selection present while disabled, bug 637828} { +} -cleanup { destroy .e +} -result {0} + + +test entry-21.1 {selection present while disabled, bug 637828} -body { entry .e .e insert end 0123456789 .e select from 3 .e select to 6 set out [.e selection present] .e configure -state disabled - # still return 1 when disabled, because 'selection get' will work, - # but selection cannot be changed (new behavior since 8.4) +# still return 1 when disabled, because 'selection get' will work, +# but selection cannot be changed (new behavior since 8.4) .e select to 9 lappend out [.e selection present] [selection get] -} {1 1 345} - -test entry-22.1 {lost namespaced textvar} { +} -cleanup { destroy .e +} -result {1 1 345} + +test entry-22.1 {lost namespaced textvar} -body { namespace eval test { variable foo {a b} } entry .e -textvariable ::test::foo namespace delete test .e insert end "more stuff" .e delete 5 end - catch {set ::test::foo} result - list [.e get] [.e cget -textvar] $result -} [list "a bmo" ::test::foo \ - {can't read "::test::foo": no such variable}] - -destroy .e + set ::test::foo +} -cleanup { + destroy .e +} -returnCodes error -result {can't read "::test::foo": no such variable} +test entry-22.2 {lost namespaced textvar} -body { + namespace eval test { variable foo {a b} } + entry .e -textvariable ::test::foo + namespace delete test + .e insert end "more stuff" + .e delete 5 end + catch {set ::test::foo} + list [.e get] [.e cget -textvar] +} -cleanup { + destroy .e +} -result [list "a bmo" ::test::foo] +# Gathered comments about lacks # XXX Still need to write tests for EntryBlinkProc, EntryFocusProc, # and EntryTextVarProc. +# No tests for DisplayEntry. +# XXX Still need to write tests for EntryScanTo and EntrySelectTo. +# No tests for EventuallyRedraw -option clear - +# option clear # cleanup cleanupTests return + + + diff --git a/tests/spinbox.test b/tests/spinbox.test index ca84c5c..6a7cc2a 100644 --- a/tests/spinbox.test +++ b/tests/spinbox.test @@ -1,240 +1,1242 @@ # This file is a Tcl script to test spinbox widgets in Tk. It is # organized in the standard fashion for Tcl tests. # -# Copyright (c) 1998-2000 by Scriptics Corporation. +# Copyright (c) 1994 The Regents of the University of California. +# Copyright (c) 1994-1997 Sun Microsystems, Inc. +# Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: spinbox.test,v 1.9 2004/06/24 12:45:43 dkf Exp $ +# RCS: @(#) $Id: spinbox.test,v 1.10 2008/07/22 11:55:57 aniap Exp $ -package require tcltest 2.1 +package require tcltest 2.2 +namespace import ::tcltest::* eval tcltest::configure $argv tcltest::loadTestedCommands +# For xscrollcommand proc scroll args { - global scrollInfo - set scrollInfo $args + global scrollInfo + set scrollInfo $args +} +# For trace variable +proc override args { + global x + set x 12345 } -# Create additional widget that's used to hold the selection at times. - -spinbox .sel -.sel insert end "This is some sample text" - -# Font names - -set big -adobe-helvetica-medium-r-normal--24-240-75-75-p-*-iso8859-1 -set fixed -adobe-courier-medium-r-normal--12-120-75-75-m-*-iso8859-1 - -# Create entries in the option database to be sure that geometry options -# like border width have predictable values. - -option add *Spinbox.borderWidth 2 -option add *Spinbox.highlightThickness 2 -option add *Spinbox.font {Helvetica -12} - -spinbox .e -bd 2 -relief sunken -pack .e -update - -set i 1 -foreach test { - {-activebackground #ff0000 #ff0000 non-existent - {unknown color name "non-existent"}} - {-background #ff0000 #ff0000 non-existent - {unknown color name "non-existent"}} - {-bd 4 4 badValue {bad screen distance "badValue"}} - {-bg #ff0000 #ff0000 non-existent {unknown color name "non-existent"}} - {-borderwidth 1.3 1 badValue {bad screen distance "badValue"}} - {-buttonbackground #ff0000 #ff0000 non-existent - {unknown color name "non-existent"}} - {-buttoncursor arrow arrow badValue {bad cursor spec "badValue"}} - {-command {a command} {a command} {} {}} - {-cursor arrow arrow badValue {bad cursor spec "badValue"}} - {-disabledbackground green green non-existent - {unknown color name "non-existent"}} - {-disabledforeground #110022 #110022 bogus {unknown color name "bogus"}} - {-exportselection yes 1 xyzzy {expected boolean value but got "xyzzy"}} - {-fg #110022 #110022 bogus {unknown color name "bogus"}} - {-font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-* - -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-* {} - {font "" doesn't exist}} - {-foreground #110022 #110022 bogus {unknown color name "bogus"}} - {-format %0.5f %0.5f %d {bad spinbox format specifier "%d"}} - {-from -10 -10.0 bogus {expected floating-point number but got "bogus"}} - {-highlightbackground #123456 #123456 ugly {unknown color name "ugly"}} - {-highlightcolor #123456 #123456 bogus {unknown color name "bogus"}} - {-highlightthickness 6 6 bogus {bad screen distance "bogus"}} - {-highlightthickness -2 0 {} {}} - {-increment 1.0 1.0 bogus {expected floating-point number but got "bogus"}} - {-insertbackground #110022 #110022 bogus {unknown color name "bogus"}} - {-insertborderwidth 1.3 1 2.6x {bad screen distance "2.6x"}} - {-insertofftime 100 100 3.2 {expected integer but got "3.2"}} - {-insertontime 100 100 3.2 {expected integer but got "3.2"}} - {-invalidcommand "a command" "a command" {} {}} - {-invcmd "a command" "a command" {} {}} - {-justify right right bogus {bad justification "bogus": must be left, right, or center}} - {-readonlybackground green green non-existent - {unknown color name "non-existent"}} - {-relief groove groove 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}} - {-repeatdelay 500 500 3p {expected integer but got "3p"}} - {-repeatinterval -500 -500 3p {expected integer but got "3p"}} - {-selectbackground #110022 #110022 bogus {unknown color name "bogus"}} - {-selectborderwidth 1.3 1 badValue {bad screen distance "badValue"}} - {-selectforeground #654321 #654321 bogus {unknown color name "bogus"}} - {-state n normal bogus {bad state "bogus": must be disabled, normal, or readonly}} - {-takefocus "any string" "any string" {} {}} - {-textvariable i i {} {}} - {-to 14.9 14.9 bogus {expected floating-point number but got "bogus"}} - {-validate "key" "key" "bogus" {bad validate "bogus": must be all, key, focus, focusin, focusout, or none}} - {-validatecommand "a command" "a command" {} {}} - {-values {mon tue wed thur} {mon tue wed thur} {bad {}list} {list element in braces followed by "list" instead of space}} - {-vcmd "a command" "a command" {} {}} - {-width 402 402 3p {expected integer but got "3p"}} - {-wrap yes 1 xyzzy {expected boolean value but got "xyzzy"}} - {-xscrollcommand {Some command} {Some command} {} {}} -} { - set name [lindex $test 0] - test spinbox-1.$i {configuration options} { - .e configure $name [lindex $test 1] - list [lindex [.e configure $name] 4] [.e cget $name] - } [list [lindex $test 2] [lindex $test 2]] - incr i - if {[lindex $test 3] != ""} { - test spinbox-1.$i {configuration options} { - list [catch {.e configure $name [lindex $test 3]} msg] $msg - } [list 1 [lindex $test 4]] - } - .e configure $name [lindex [.e configure $name] 3] - incr i +# Procedures used in widget VALIDATION tests +proc doval {W d i P s S v V} { + set ::vVals [list $W $d $i $P $s $S $v $V] + return 1 +} +proc doval2 {W d i P s S v V} { + set ::vVals [list $W $d $i $P $s $S $v $V] + set ::e mydata + return 1 +} +proc doval3 {W d i P s S v V} { + set ::vVals [list $W $d $i $P $s $S $v $V] + return 0 } -test spinbox-2.1 {Tk_SpinboxCmd procedure} { - list [catch {spinbox} msg] $msg -} {1 {wrong # args: should be "spinbox pathName ?options?"}} -test spinbox-2.2 {Tk_SpinboxCmd procedure} { - list [catch {spinbox gorp} msg] $msg -} {1 {bad window path name "gorp"}} -test spinbox-2.3 {Tk_SpinboxCmd procedure} { - catch {destroy .e} +set cy [font metrics {Courier -12} -linespace] + +test spinbox-1.1 {configuration option: "activebackground"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -activebackground #ff0000 + .e cget -activebackground +} -cleanup { + destroy .e +} -result {#ff0000} +test spinbox-1.2 {configuration option: "activebackground" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -activebackground non-existent +} -cleanup { + destroy .e +} -returnCodes {error} -result {unknown color name "non-existent"} + +test spinbox-1.3 {configuration option: "background"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -background #ff0000 + .e cget -background +} -cleanup { + destroy .e +} -result {#ff0000} +test spinbox-1.4 {configuration option: "background" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -background non-existent +} -cleanup { + destroy .e +} -returnCodes {error} -result {unknown color name "non-existent"} + +test spinbox-1.5 {configuration option: "bd"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -bd 4 + .e cget -bd +} -cleanup { + destroy .e +} -result {4} +test spinbox-1.6 {configuration option: "bd" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -bd badValue +} -cleanup { + destroy .e +} -returnCodes {error} -result {bad screen distance "badValue"} + +test spinbox-1.7 {configuration option: "bg"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -bg #ff0000 + .e cget -bg +} -cleanup { + destroy .e +} -result {#ff0000} +test spinbox-1.8 {configuration option: "bg" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -bg non-existent +} -cleanup { + destroy .e +} -returnCodes {error} -result {unknown color name "non-existent"} + +test spinbox-1.9 {configuration option: "borderwidth"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -borderwidth 1.3 + .e cget -borderwidth +} -cleanup { + destroy .e +} -result {1} +test spinbox-1.10 {configuration option: "borderwidth" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -borderwidth badValue +} -cleanup { + destroy .e +} -returnCodes {error} -result {bad screen distance "badValue"} + +test spinbox-1.11 {configuration option: "buttonbackground"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -buttonbackground #ff0000 + .e cget -buttonbackground +} -cleanup { + destroy .e +} -result {#ff0000} +test spinbox-1.12 {configuration option: "buttonbackground" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -buttonbackground non-existent +} -cleanup { + destroy .e +} -returnCodes {error} -result {unknown color name "non-existent"} + +test spinbox-1.13 {configuration option: "buttoncursor"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -buttoncursor arrow + .e cget -buttoncursor +} -cleanup { + destroy .e +} -result {arrow} +test spinbox-1.14 {configuration option: "buttoncursor" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -buttoncursor badValue +} -cleanup { + destroy .e +} -returnCodes {error} -result {bad cursor spec "badValue"} + +test spinbox-1.15 {configuration option: "command"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -command {a command} + .e cget -command +} -cleanup { + destroy .e +} -result {a command} + +test spinbox-1.16 {configuration option: "cursor"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -cursor arrow + .e cget -cursor +} -cleanup { + destroy .e +} -result {arrow} +test spinbox-1.17 {configuration option: "cursor" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -cursor badValue +} -cleanup { + destroy .e +} -returnCodes {error} -result {bad cursor spec "badValue"} + +test spinbox-1.18 {configuration option: "disabledbackground"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -disabledbackground green + .e cget -disabledbackground +} -cleanup { + destroy .e +} -result {green} +test spinbox-1.19 {configuration option: "disabledbackground" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -disabledbackground non-existent +} -cleanup { + destroy .e +} -returnCodes {error} -result {unknown color name "non-existent"} + +test spinbox-1.20 {configuration option: "disabledforeground"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -disabledforeground #110022 + .e cget -disabledforeground +} -cleanup { + destroy .e +} -result {#110022} +test spinbox-1.21 {configuration option: "disabledforeground" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -disabledforeground bogus +} -cleanup { + destroy .e +} -returnCodes {error} -result {unknown color name "bogus"} + +test spinbox-1.22 {configuration option: "exportselection"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -exportselection yes + .e cget -exportselection +} -cleanup { + destroy .e +} -result {1} +test spinbox-1.23 {configuration option: "exportselection" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -exportselection xyzzy +} -cleanup { + destroy .e +} -returnCodes {error} -result {expected boolean value but got "xyzzy"} + +test spinbox-1.24 {configuration option: "fg"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -fg #110022 + .e cget -fg +} -cleanup { + destroy .e +} -result {#110022} +test spinbox-1.25 {configuration option: "fg" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -fg bogus +} -cleanup { + destroy .e +} -returnCodes {error} -result {unknown color name "bogus"} + +test spinbox-1.26 {configuration option: "font"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-* + .e cget -font +} -cleanup { + destroy .e +} -result {-Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*} +test spinbox-1.27 {configuration option: "font" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -font {} +} -cleanup { + destroy .e +} -returnCodes {error} -result {font "" doesn't exist} + +test spinbox-1.28 {configuration option: "foreground"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -foreground #110022 + .e cget -foreground +} -cleanup { + destroy .e +} -result {#110022} +test spinbox-1.29 {configuration option: "foreground" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -foreground bogus +} -cleanup { + destroy .e +} -returnCodes {error} -result {unknown color name "bogus"} + +test spinbox-1.30 {configuration option: "format"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -format %0.5f + .e cget -format +} -cleanup { + destroy .e +} -result {%0.5f} +test spinbox-1.31 {configuration option: "format" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -format %d +} -cleanup { + destroy .e +} -returnCodes {error} -result {bad spinbox format specifier "%d"} + +test spinbox-1.32 {configuration option: "from"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -from -10 + .e cget -from +} -cleanup { + destroy .e +} -result {-10.0} +test spinbox-1.33 {configuration option: "from" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -from bogus +} -cleanup { + destroy .e +} -returnCodes {error} -result {expected floating-point number but got "bogus"} + +test spinbox-1.34 {configuration option: "highlightbackground"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -highlightbackground #123456 + .e cget -highlightbackground +} -cleanup { + destroy .e +} -result {#123456} +test spinbox-1.35 {configuration option: "highlightbackground" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -highlightbackground ugly +} -cleanup { + destroy .e +} -returnCodes {error} -result {unknown color name "ugly"} + +test spinbox-1.36 {configuration option: "highlightcolor"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -highlightcolor #123456 + .e cget -highlightcolor +} -cleanup { + destroy .e +} -result {#123456} +test spinbox-1.37 {configuration option: "highlightcolor" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -highlightcolor bogus +} -cleanup { + destroy .e +} -returnCodes {error} -result {unknown color name "bogus"} + +test spinbox-1.38 {configuration option: "highlightthickness"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -highlightthickness 6 + .e cget -highlightthickness +} -cleanup { + destroy .e +} -result {6} +test spinbox-1.39 {configuration option: "highlightthickness" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -highlightthickness bogus +} -cleanup { + destroy .e +} -returnCodes {error} -result {bad screen distance "bogus"} + +test spinbox-1.40 {configuration option: "highlightthickness"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -highlightthickness -2 + .e cget -highlightthickness +} -cleanup { + destroy .e +} -result {0} + +test spinbox-1.41 {configuration option: "increment"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -increment 1.0 + .e cget -increment +} -cleanup { + destroy .e +} -result {1.0} +test spinbox-1.42 {configuration option: "increment" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -increment bogus +} -cleanup { + destroy .e +} -returnCodes {error} -result {expected floating-point number but got "bogus"} + +test spinbox-1.43 {configuration option: "insertbackground"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -insertbackground #110022 + .e cget -insertbackground +} -cleanup { + destroy .e +} -result {#110022} +test spinbox-1.44 {configuration option: "insertbackground" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -insertbackground bogus +} -cleanup { + destroy .e +} -returnCodes {error} -result {unknown color name "bogus"} + +test spinbox-1.45 {configuration option: "insertborderwidth"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -insertborderwidth 1.3 + .e cget -insertborderwidth +} -cleanup { + destroy .e +} -result {1} +test spinbox-1.46 {configuration option: "insertborderwidth" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -insertborderwidth 2.6x +} -cleanup { + destroy .e +} -returnCodes {error} -result {bad screen distance "2.6x"} + +test spinbox-1.47 {configuration option: "insertofftime"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -insertofftime 100 + .e cget -insertofftime +} -cleanup { + destroy .e +} -result {100} +test spinbox-1.48 {configuration option: "insertofftime" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -insertofftime 3.2 +} -cleanup { + destroy .e +} -returnCodes {error} -result {expected integer but got "3.2"} + +test spinbox-1.49 {configuration option: "insertontime"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -insertontime 100 + .e cget -insertontime +} -cleanup { + destroy .e +} -result {100} +test spinbox-1.50 {configuration option: "insertontime" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -insertontime 3.2 +} -cleanup { + destroy .e +} -returnCodes {error} -result {expected integer but got "3.2"} + +test spinbox-1.51 {configuration option: "invalidcommand"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -invalidcommand "a command" + .e cget -invalidcommand +} -cleanup { + destroy .e +} -result {a command} + +test spinbox-1.52 {configuration option: "invcmd"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -invcmd "a command" + .e cget -invcmd +} -cleanup { + destroy .e +} -result {a command} + +test spinbox-1.53 {configuration option: "justify"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -justify right + .e cget -justify +} -cleanup { + destroy .e +} -result {right} +test spinbox-1.54 {configuration option: "justify" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -justify bogus +} -cleanup { + destroy .e +} -returnCodes {error} -result {bad justification "bogus": must be left, right, or center} + +test spinbox-1.55 {configuration option: "readonlybackground"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -readonlybackground green + .e cget -readonlybackground +} -cleanup { + destroy .e +} -result {green} +test spinbox-1.56 {configuration option: "readonlybackground" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -readonlybackground non-existent +} -cleanup { + destroy .e +} -returnCodes {error} -result {unknown color name "non-existent"} + +test spinbox-1.57 {configuration option: "relief"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -relief groove + .e cget -relief +} -cleanup { + destroy .e +} -result {groove} +test spinbox-1.58 {configuration option: "relief" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -relief 1.5 +} -cleanup { + destroy .e +} -returnCodes {error} -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} + +test spinbox-1.59 {configuration option: "repeatdelay"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -repeatdelay 500 + .e cget -repeatdelay +} -cleanup { + destroy .e +} -result {500} +test spinbox-1.60 {configuration option: "repeatdelay" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -repeatdelay 3p +} -cleanup { + destroy .e +} -returnCodes {error} -result {expected integer but got "3p"} + +test spinbox-1.61 {configuration option: "repeatinterval"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -repeatinterval -500 + .e cget -repeatinterval +} -cleanup { + destroy .e +} -result {-500} +test spinbox-1.62 {configuration option: "repeatinterval" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -repeatinterval 3p +} -cleanup { + destroy .e +} -returnCodes {error} -result {expected integer but got "3p"} + +test spinbox-1.63 {configuration option: "selectbackground"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -selectbackground #110022 + .e cget -selectbackground +} -cleanup { + destroy .e +} -result {#110022} +test spinbox-1.64 {configuration option: "selectbackground" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -selectbackground bogus +} -cleanup { + destroy .e +} -returnCodes {error} -result {unknown color name "bogus"} + +test spinbox-1.65 {configuration option: "selectborderwidth"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -selectborderwidth 1.3 + .e cget -selectborderwidth +} -cleanup { + destroy .e +} -result {1} +test spinbox-1.66 {configuration option: "selectborderwidth" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -selectborderwidth badValue +} -cleanup { + destroy .e +} -returnCodes {error} -result {bad screen distance "badValue"} + +test spinbox-1.67 {configuration option: "selectforeground"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -selectforeground #654321 + .e cget -selectforeground +} -cleanup { + destroy .e +} -result {#654321} +test spinbox-1.68 {configuration option: "selectforeground" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -selectforeground bogus +} -cleanup { + destroy .e +} -returnCodes {error} -result {unknown color name "bogus"} + +test spinbox-1.69 {configuration option: "state"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -state n + .e cget -state +} -cleanup { + destroy .e +} -result {normal} +test spinbox-1.70 {configuration option: "state" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -state bogus +} -cleanup { + destroy .e +} -returnCodes {error} -result {bad state "bogus": must be disabled, normal, or readonly} + +test spinbox-1.71 {configuration option: "takefocus"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -takefocus "any string" + .e cget -takefocus +} -cleanup { + destroy .e +} -result {any string} + +test spinbox-1.72 {configuration option: "textvariable"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -textvariable i + .e cget -textvariable +} -cleanup { + destroy .e +} -result {i} + +test spinbox-1.73 {configuration option: "to"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -to 14.9 + .e cget -to +} -cleanup { + destroy .e +} -result {14.9} +test spinbox-1.74 {configuration option: "to" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -to bogus +} -cleanup { + destroy .e +} -returnCodes {error} -result {expected floating-point number but got "bogus"} + +test spinbox-1.75 {configuration option: "validate"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -validate "key" + .e cget -validate +} -cleanup { + destroy .e +} -result {key} +test spinbox-1.76 {configuration option: "validate" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -validate "bogus" +} -cleanup { + destroy .e +} -returnCodes {error} -result {bad validate "bogus": must be all, key, focus, focusin, focusout, or none} + +test spinbox-1.77 {configuration option: "validatecommand"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -validatecommand "a command" + .e cget -validatecommand +} -cleanup { + destroy .e +} -result {a command} + +test spinbox-1.78 {configuration option: "values"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -values {mon tue wed thur} + .e cget -values +} -cleanup { + destroy .e +} -result {mon tue wed thur} +test spinbox-1.79 {configuration option: "values" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -values {bad {}list} +} -cleanup { + destroy .e +} -returnCodes {error} -result {list element in braces followed by "list" instead of space} + +test spinbox-1.80 {configuration option: "vcmd"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -vcmd "a command" + .e cget -vcmd +} -cleanup { + destroy .e +} -result {a command} + +test spinbox-1.81 {configuration option: "width"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -width 402 + .e cget -width +} -cleanup { + destroy .e +} -result {402} +test spinbox-1.82 {configuration option: "width" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -width 3p +} -cleanup { + destroy .e +} -returnCodes {error} -result {expected integer but got "3p"} + +test spinbox-1.83 {configuration option: "wrap"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -wrap yes + .e cget -wrap +} -cleanup { + destroy .e +} -result {1} +test spinbox-1.84 {configuration option: "wrap" for spinbox} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -wrap xyzzy +} -cleanup { + destroy .e +} -returnCodes {error} -result {expected boolean value but got "xyzzy"} + +test spinbox-1.85 {configuration option: "xscrollcommand"} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + -relief sunken + pack .e + update +} -body { + .e configure -xscrollcommand {Some command} + .e cget -xscrollcommand +} -cleanup { + destroy .e +} -result {Some command} + + +test spinbox-2.1 {Tk_EntryCmd procedure} -body { + spinbox +} -returnCodes error -result {wrong # args: should be "spinbox pathName ?options?"} +test spinbox-2.2 {Tk_EntryCmd procedure} -body { + spinbox gorp +} -returnCodes error -result {bad window path name "gorp"} +test spinbox-2.3 {Tk_EntryCmd procedure} -body { spinbox .e + pack .e + update list [winfo exists .e] [winfo class .e] [info commands .e] -} {1 Spinbox .e} -test spinbox-2.4 {Tk_SpinboxCmd procedure} { - catch {destroy .e} - list [catch {spinbox .e -gorp foo} msg] $msg [winfo exists .e] \ - [info commands .e] -} {1 {unknown option "-gorp"} 0 {}} -test spinbox-2.5 {Tk_SpinboxCmd procedure} { - catch {destroy .e} +} -cleanup { + destroy .e +} -result {1 Spinbox .e} +test spinbox-2.4 {Tk_EntryCmd procedure} -body { + spinbox .e -gorp foo +} -cleanup { + destroy .e +} -returnCodes error -result {unknown option "-gorp"} +test spinbox-2.5 {Tk_EntryCmd procedure} -body { + catch {spinbox .e -gorp foo} + list [winfo exists .e] [info commands .e] +} -cleanup { + destroy .e +} -result {0 {}} +test spinbox-2.6 {Tk_EntryCmd procedure} -body { spinbox .e -} {.e} - -catch {destroy .e} -spinbox .e -font $fixed -pack .e -update - -set cx [font measure $fixed a] -set cy [font metrics $fixed -linespace] -set ux [font measure $fixed \u4e4e] - -test spinbox-3.1 {SpinboxWidgetCmd procedure} { - list [catch {.e} msg] $msg -} {1 {wrong # args: should be ".e option ?arg arg ...?"}} -test spinbox-3.2 {SpinboxWidgetCmd procedure, "bbox" widget command} { - list [catch {.e bbox} msg] $msg -} {1 {wrong # args: should be ".e bbox index"}} -test spinbox-3.3 {SpinboxWidgetCmd procedure, "bbox" widget command} { - list [catch {.e bbox a b} msg] $msg -} {1 {wrong # args: should be ".e bbox index"}} -test spinbox-3.4 {SpinboxWidgetCmd procedure, "bbox" widget command} { - list [catch {.e bbox bogus} msg] $msg -} {1 {bad spinbox index "bogus"}} -test spinbox-3.5 {SpinboxWidgetCmd procedure, "bbox" widget command} { - .e delete 0 end - .e bbox 0 -} [list 5 5 0 $cy] -test spinbox-3.6 {SpinboxWidgetCmd procedure, "bbox" widget command} { - # Tcl_UtfAtIndex(): no utf chars +} -cleanup { + destroy .e +} -result {.e} - .e delete 0 end + +test spinbox-3.1 {EntryWidgetCmd procedure} -setup { + spinbox .e + pack .e + update +} -body { + .e +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e option ?arg arg ...?"} +test spinbox-3.2 {EntryWidgetCmd procedure, "bbox" widget command} -setup { + spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { + .e bbox +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e bbox index"} +test spinbox-3.3 {EntryWidgetCmd procedure, "bbox" widget command} -setup { + spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { + .e bbox a b +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e bbox index"} +test spinbox-3.4 {EntryWidgetCmd procedure, "bbox" widget command} -setup { + spinbox .e + pack .e + update +} -body { + .e bbox bogus +} -cleanup { + destroy .e +} -returnCodes error -result {bad spinbox index "bogus"} +test spinbox-3.5 {EntryWidgetCmd procedure, "bbox" widget command} -setup { + spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { + .e bbox 0 +} -cleanup { + destroy .e +} -result [list 5 5 0 $cy] + +# Oryginaly the result was count using measurements +# and metrics. It was changed to less verbose solution - the result is the one +# that passes fonts constraint (this concerns tests 3.6, 3.7, 3.8, 3.10) +test spinbox-3.6 {EntryWidgetCmd procedure, "bbox" widget command} -constraints { + fonts +} -setup { + spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { +# Tcl_UtfAtIndex(): no utf chars .e insert 0 "abc" list [.e bbox 3] [.e bbox end] -} [list "[expr 5+2*$cx] 5 $cx $cy" "[expr 5+2*$cx] 5 $cx $cy"] -test spinbox-3.7 {SpinboxWidgetCmd procedure, "bbox" widget command} { - # Tcl_UtfAtIndex(): utf at end - .e delete 0 end +} -cleanup { + destroy .e +} -result {{19 5 7 13} {19 5 7 13}} +test spinbox-3.7 {EntryWidgetCmd procedure, "bbox" widget command} -constraints { + fonts +} -setup { + spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { +# Tcl_UtfAtIndex(): utf at end .e insert 0 "ab\u4e4e" .e bbox end -} "[expr 5+2*$cx] 5 $ux $cy" -test spinbox-3.8 {SpinboxWidgetCmd procedure, "bbox" widget command} { - # Tcl_UtfAtIndex(): utf before index - .e delete 0 end +} -cleanup { + destroy .e +} -result {19 5 12 13} +test spinbox-3.8 {EntryWidgetCmd procedure, "bbox" widget command} -constraints { + fonts +} -setup { + spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { +# Tcl_UtfAtIndex(): utf before index .e insert 0 "ab\u4e4ec" .e bbox 3 -} "[expr 5+2*$cx+$ux] 5 $cx $cy" -test spinbox-3.9 {SpinboxWidgetCmd procedure, "bbox" widget command} { - # Tcl_UtfAtIndex(): no chars - .e delete 0 end +} -cleanup { + destroy .e +} -result {31 5 7 13} +test spinbox-3.9 {EntryWidgetCmd procedure, "bbox" widget command} -setup { + spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { +# Tcl_UtfAtIndex(): no chars .e bbox end -} "5 5 0 $cy" -test spinbox-3.10 {SpinboxWidgetCmd procedure, "bbox" widget command} { - .e delete 0 end +} -cleanup { + destroy .e +} -result "5 5 0 $cy" +test spinbox-3.10 {EntryWidgetCmd procedure, "bbox" widget command} -constraints { + fonts +} -setup { + spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { .e insert 0 "abcdefghij\u4e4eklmnop" list [.e bbox 0] [.e bbox 1] [.e bbox 10] [.e bbox end] -} [list "5 5 $cx $cy" "[expr 5+$cx] 5 $cx $cy" "[expr 5+10*$cx] 5 $ux $cy" "[expr 5+$ux+15*$cx] 5 $cx $cy"] -test spinbox-3.11 {SpinboxWidgetCmd procedure, "cget" widget command} { - list [catch {.e cget} msg] $msg -} {1 {wrong # args: should be ".e cget option"}} -test spinbox-3.12 {SpinboxWidgetCmd procedure, "cget" widget command} { - list [catch {.e cget a b} msg] $msg -} {1 {wrong # args: should be ".e cget option"}} -test spinbox-3.13 {SpinboxWidgetCmd procedure, "cget" widget command} { - list [catch {.e cget -gorp} msg] $msg -} {1 {unknown option "-gorp"}} -test spinbox-3.14 {SpinboxWidgetCmd procedure, "cget" widget command} { +} -cleanup { + destroy .e +} -result {{5 5 7 13} {12 5 7 13} {75 5 12 13} {122 5 7 13}} +test spinbox-3.11 {EntryWidgetCmd procedure, "cget" widget command} -setup { + spinbox .e +} -body { + .e cget +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e cget option"} +test spinbox-3.12 {EntryWidgetCmd procedure, "cget" widget command} -setup { + spinbox .e +} -body { + .e cget a b +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e cget option"} +test spinbox-3.13 {EntryWidgetCmd procedure, "cget" widget command} -setup { + spinbox .e +} -body { + .e cget -gorp +} -cleanup { + destroy .e +} -returnCodes error -result {unknown option "-gorp"} +test spinbox-3.14 {EntryWidgetCmd procedure, "cget" widget command} -setup { + spinbox .e +} -body { .e configure -bd 4 .e cget -bd -} {4} -test spinbox-3.15 {SpinboxWidgetCmd procedure, "configure" widget command} { +} -cleanup { + destroy .e +} -result {4} +test spinbox-3.15 {EntryWidgetCmd procedure, "configure" widget command} -setup { + spinbox .e + pack .e + update +} -body { llength [.e configure] -} {49} -test spinbox-3.16 {SpinboxWidgetCmd procedure, "configure" widget command} { - list [catch {.e configure -foo} msg] $msg -} {1 {unknown option "-foo"}} -test spinbox-3.17 {SpinboxWidgetCmd procedure, "configure" widget command} { +} -cleanup { + destroy .e +} -result {49} +test spinbox-3.16 {EntryWidgetCmd procedure, "configure" widget command} -setup { + spinbox .e +} -body { + .e configure -foo +} -cleanup { + destroy .e +} -returnCodes error -result {unknown option "-foo"} +test spinbox-3.17 {EntryWidgetCmd procedure, "configure" widget command} -setup { + spinbox .e +} -body { .e configure -bd 4 .e configure -bg #ffffff lindex [.e configure -bd] 4 -} {4} -test spinbox-3.18 {SpinboxWidgetCmd procedure, "delete" widget command} { - list [catch {.e delete} msg] $msg -} {1 {wrong # args: should be ".e delete firstIndex ?lastIndex?"}} -test spinbox-3.19 {SpinboxWidgetCmd procedure, "delete" widget command} { - list [catch {.e delete a b c} msg] $msg -} {1 {wrong # args: should be ".e delete firstIndex ?lastIndex?"}} -test spinbox-3.20 {SpinboxWidgetCmd procedure, "delete" widget command} { - list [catch {.e delete foo} msg] $msg -} {1 {bad spinbox index "foo"}} -test spinbox-3.21 {SpinboxWidgetCmd procedure, "delete" widget command} { - list [catch {.e delete 0 bar} msg] $msg -} {1 {bad spinbox index "bar"}} -test spinbox-3.22 {SpinboxWidgetCmd procedure, "delete" widget command} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {4} +test spinbox-3.18 {EntryWidgetCmd procedure, "delete" widget command} -setup { + spinbox .e +} -body { + .e delete +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e delete firstIndex ?lastIndex?"} +test spinbox-3.19 {EntryWidgetCmd procedure, "delete" widget command} -setup { + spinbox .e +} -body { + .e delete a b c +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e delete firstIndex ?lastIndex?"} +test spinbox-3.20 {EntryWidgetCmd procedure, "delete" widget command} -setup { + spinbox .e +} -body { + .e delete foo +} -cleanup { + destroy .e +} -returnCodes error -result {bad spinbox index "foo"} +test spinbox-3.21 {EntryWidgetCmd procedure, "delete" widget command} -setup { + spinbox .e +} -body { + .e delete 0 bar +} -cleanup { + destroy .e +} -returnCodes error -result {bad spinbox index "bar"} +test spinbox-3.22 {EntryWidgetCmd procedure, "delete" widget command} -setup { + spinbox .e + pack .e + update +} -body { .e insert end "01234567890" .e delete 2 4 .e get -} {014567890} -test spinbox-3.23 {SpinboxWidgetCmd procedure, "delete" widget command} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {014567890} +test spinbox-3.23 {EntryWidgetCmd procedure, "delete" widget command} -setup { + spinbox .e +} -body { .e insert end "01234567890" .e delete 6 .e get -} {0123457890} -test spinbox-3.24 {SpinboxWidgetCmd procedure, "delete" widget command} { - # UTF +} -cleanup { + destroy .e +} -result {0123457890} +test spinbox-3.24 {EntryWidgetCmd procedure, "delete" widget command} -setup { + spinbox .e + pack .e + update set x {} - .e delete 0 end +} -body { +# UTF .e insert end "01234\u4e4e67890" .e delete 6 lappend x [.e get] @@ -246,277 +1248,659 @@ test spinbox-3.24 {SpinboxWidgetCmd procedure, "delete" widget command} { .e insert end "0123456\u4e4e890" .e delete 6 lappend x [.e get] -} [list "01234\u4e4e7890" "0123457890" "012345\u4e4e890"] -test spinbox-3.25 {SpinboxWidgetCmd procedure, "delete" widget command} { - .e delete 0 end +} -cleanup { + destroy .e +} -result [list "01234\u4e4e7890" "0123457890" "012345\u4e4e890"] +test spinbox-3.25 {EntryWidgetCmd procedure, "delete" widget command} -setup { + spinbox .e + pack .e + update +} -body { .e insert end "01234567890" .e delete 6 5 .e get -} {01234567890} -test spinbox-3.26 {SpinboxWidgetCmd procedure, "delete" widget command} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {01234567890} +test spinbox-3.26 {EntryWidgetCmd procedure, "delete" widget command} -setup { + spinbox .e + pack .e + update +} -body { .e insert end "01234567890" .e configure -state disabled .e delete 2 8 .e configure -state normal .e get -} {01234567890} -test spinbox-3.27 {SpinboxWidgetCmd procedure, "get" widget command} { - list [catch {.e get foo} msg] $msg -} {1 {wrong # args: should be ".e get"}} -test spinbox-3.28 {SpinboxWidgetCmd procedure, "icursor" widget command} { - list [catch {.e icursor} msg] $msg -} {1 {wrong # args: should be ".e icursor pos"}} -test spinbox-3.29 {SpinboxWidgetCmd procedure, "icursor" widget command} { - list [catch {.e icursor foo} msg] $msg -} {1 {bad spinbox index "foo"}} -test spinbox-3.30 {SpinboxWidgetCmd procedure, "icursor" widget command} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {01234567890} +test spinbox-3.27 {EntryWidgetCmd procedure, "delete" widget command} -setup { + spinbox .e + pack .e + update +} -body { + .e insert end "01234567890" + .e configure -state readonly + .e delete 2 8 + .e configure -state normal + .e get +} -cleanup { + destroy .e +} -result {01234567890} +test spinbox-3.28 {EntryWidgetCmd procedure, "get" widget command} -setup { + spinbox .e +} -body { + .e get foo +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e get"} +test spinbox-3.29 {EntryWidgetCmd procedure, "icursor" widget command} -setup { + spinbox .e +} -body { + .e icursor +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e icursor pos"} +test spinbox-3.30 {EntryWidgetCmd procedure, "icursor" widget command} -setup { + spinbox .e +} -body { + .e icursor foo +} -cleanup { + destroy .e +} -returnCodes error -result {bad spinbox index "foo"} +test spinbox-3.31 {EntryWidgetCmd procedure, "icursor" widget command} -setup { + spinbox .e +} -body { .e insert end "01234567890" .e icursor 4 .e index insert -} {4} -test spinbox-3.31 {SpinboxWidgetCmd procedure, "index" widget command} { - list [catch {.e in} msg] $msg -} {1 {ambiguous option "in": must be bbox, cget, configure, delete, get, icursor, identify, index, insert, invoke, scan, selection, set, validate, or xview}} -test spinbox-3.32 {SpinboxWidgetCmd procedure, "index" widget command} { - list [catch {.e index} msg] $msg -} {1 {wrong # args: should be ".e index string"}} -test spinbox-3.33 {SpinboxWidgetCmd procedure, "index" widget command} { - list [catch {.e index foo} msg] $msg -} {1 {bad spinbox index "foo"}} -test spinbox-3.34 {SpinboxWidgetCmd procedure, "index" widget command} { - list [catch {.e index 0} msg] $msg -} {0 0} -test spinbox-3.35 {SpinboxWidgetCmd procedure, "index" widget command} { - # UTF - .e delete 0 end +} -cleanup { + destroy .e +} -result {4} +test spinbox-3.32 {EntryWidgetCmd procedure, "index" widget command} -setup { + spinbox .e +} -body { + .e in +} -cleanup { + destroy .e +} -returnCodes error -result {ambiguous option "in": must be bbox, cget, configure, delete, get, icursor, identify, index, insert, invoke, scan, selection, set, validate, or xview} +test spinbox-3.33 {EntryWidgetCmd procedure, "index" widget command} -setup { + spinbox .e +} -body { + .e index +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e index string"} +test spinbox-3.34 {EntryWidgetCmd procedure, "index" widget command} -setup { + spinbox .e +} -body { + .e index foo +} -cleanup { + destroy .e +} -returnCodes error -result {bad spinbox index "foo"} +test spinbox-3.35 {EntryWidgetCmd procedure, "index" widget command} -setup { + spinbox .e + pack .e + update +} -body { + .e index 0 +} -cleanup { + destroy .e +} -returnCodes {ok} -match glob -result {*} +test spinbox-3.36 {EntryWidgetCmd procedure, "index" widget command} -setup { + spinbox .e + pack .e + update +} -body { +# UTF .e insert 0 abc\u4e4e\u0153def list [.e index 3] [.e index 4] [.e index end] -} {3 4 8} -test spinbox-3.36 {SpinboxWidgetCmd procedure, "insert" widget command} { - list [catch {.e insert a} msg] $msg -} {1 {wrong # args: should be ".e insert index text"}} -test spinbox-3.37 {SpinboxWidgetCmd procedure, "insert" widget command} { - list [catch {.e insert a b c} msg] $msg -} {1 {wrong # args: should be ".e insert index text"}} -test spinbox-3.38 {SpinboxWidgetCmd procedure, "insert" widget command} { - list [catch {.e insert foo Text} msg] $msg -} {1 {bad spinbox index "foo"}} -test spinbox-3.39 {SpinboxWidgetCmd procedure, "insert" widget command} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {3 4 8} +test spinbox-3.37 {EntryWidgetCmd procedure, "insert" widget command} -setup { + spinbox .e +} -body { + .e insert a +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e insert index text"} +test spinbox-3.38 {EntryWidgetCmd procedure, "insert" widget command} -setup { + spinbox .e +} -body { + .e insert a b c +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e insert index text"} +test spinbox-3.39 {EntryWidgetCmd procedure, "insert" widget command} -setup { + spinbox .e +} -body { + .e insert foo Text +} -cleanup { + destroy .e +} -returnCodes error -result {bad spinbox index "foo"} +test spinbox-3.40 {EntryWidgetCmd procedure, "insert" widget command} -setup { + spinbox .e + pack .e + update +} -body { .e insert end "01234567890" .e insert 3 xxx .e get -} {012xxx34567890} -test spinbox-3.40 {SpinboxWidgetCmd procedure, "insert" widget command} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {012xxx34567890} +test spinbox-3.41 {EntryWidgetCmd procedure, "insert" widget command} -setup { + spinbox .e + pack .e + update +} -body { .e insert end "01234567890" .e configure -state disabled .e insert 3 xxx .e configure -state normal .e get -} {01234567890} -test spinbox-3.41 {SpinboxWidgetCmd procedure, "insert" widget command} { - list [catch {.e insert a b c} msg] $msg -} {1 {wrong # args: should be ".e insert index text"}} -test spinbox-3.42 {SpinboxWidgetCmd procedure, "scan" widget command} { - list [catch {.e scan a} msg] $msg -} {1 {wrong # args: should be ".e scan mark|dragto x"}} -test spinbox-3.43 {SpinboxWidgetCmd procedure, "scan" widget command} { - list [catch {.e scan a b c} msg] $msg -} {1 {wrong # args: should be ".e scan mark|dragto x"}} -test spinbox-3.44 {SpinboxWidgetCmd procedure, "scan" widget command} { - list [catch {.e scan foobar 20} msg] $msg -} {1 {bad scan option "foobar": must be mark or dragto}} -test spinbox-3.45 {SpinboxWidgetCmd procedure, "scan" widget command} { - list [catch {.e scan mark 20.1} msg] $msg -} {1 {expected integer but got "20.1"}} -# This test is non-portable because character sizes vary. +} -cleanup { + destroy .e +} -result {01234567890} +test spinbox-3.42 {EntryWidgetCmd procedure, "insert" widget command} -setup { + spinbox .e + pack .e + update +} -body { + .e insert end "01234567890" + .e configure -state readonly + .e insert 3 xxx + .e configure -state normal + .e get +} -cleanup { + destroy .e +} -result {01234567890} +test spinbox-3.43 {EntryWidgetCmd procedure, "insert" widget command} -setup { + spinbox .e +} -body { + .e insert a b c +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e insert index text"} +test spinbox-3.44 {EntryWidgetCmd procedure, "scan" widget command} -setup { + spinbox .e + pack .e + update +} -body { + .e scan a +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e scan mark|dragto x"} +test spinbox-3.45 {EntryWidgetCmd procedure, "scan" widget command} -setup { + spinbox .e + pack .e + update +} -body { + .e scan a b c +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e scan mark|dragto x"} +test spinbox-3.46 {EntryWidgetCmd procedure, "scan" widget command} -setup { + spinbox .e + pack .e + update +} -body { + .e scan foobar 20 +} -cleanup { + destroy .e +} -returnCodes error -result {bad scan option "foobar": must be mark or dragto} +test spinbox-3.47 {EntryWidgetCmd procedure, "scan" widget command} -setup { + spinbox .e + pack .e + update +} -body { + .e scan mark 20.1 +} -cleanup { + destroy .e +} -returnCodes error -result {expected integer but got "20.1"} -test spinbox-3.46 {SpinboxWidgetCmd procedure, "scan" widget command} {fonts} { - .e delete 0 end +# This test is non-portable because character sizes vary. +test spinbox-3.48 {EntryWidgetCmd procedure, "scan" widget command} -constraints { + fonts +} -setup { + spinbox .e -font {Helvetica -12} -borderwidth 2 -highlightthickness 2 + pack .e update +} -body { .e insert end "This is quite a long string, in fact a " .e insert end "very very long string" .e scan mark 30 .e scan dragto 28 .e index @0 -} {2} -test spinbox-3.47 {SpinboxWidgetCmd procedure, "select" widget command} { - list [catch {.e select} msg] $msg -} {1 {wrong # args: should be ".e selection option ?index?"}} -test spinbox-3.48 {SpinboxWidgetCmd procedure, "select" widget command} { - list [catch {.e select foo} msg] $msg -} {1 {bad selection option "foo": must be adjust, clear, element, from, present, range, or to}} -test spinbox-3.49 {SpinboxWidgetCmd procedure, "select clear" widget command} { - list [catch {.e select clear gorp} msg] $msg -} {1 {wrong # args: should be ".e selection clear"}} -test spinbox-3.50 {SpinboxWidgetCmd procedure, "select clear" widget command} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {2} +test spinbox-3.49 {EntryWidgetCmd procedure, "select" widget command} -setup { + spinbox .e +} -body { + .e select +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e selection option ?index?"} +test spinbox-3.50 {EntryWidgetCmd procedure, "select" widget command} -setup { + spinbox .e +} -body { + .e select foo +} -cleanup { + destroy .e +} -returnCodes error -result {bad selection option "foo": must be adjust, clear, element, from, present, range, or to} + +test spinbox-3.51 {EntryWidgetCmd procedure, "select clear" widget command} -setup { + spinbox .e +} -body { + .e select clear gorp +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e selection clear"} +test spinbox-3.52 {EntryWidgetCmd procedure, "select clear" widget command} -setup { + spinbox .e +} -body { .e insert end "0123456789" .e select from 1 .e select to 4 update .e select clear - list [catch {selection get} msg] $msg [selection own] -} {1 {PRIMARY selection doesn't exist or form "STRING" not defined} .e} -test spinbox-3.51 {SpinboxWidgetCmd procedure, "selection present" widget command} { - list [catch {.e selection present foo} msg] $msg -} {1 {wrong # args: should be ".e selection present"}} -test spinbox-3.52 {SpinboxWidgetCmd procedure, "selection present" widget command} { - .e delete 0 end + selection get +} -cleanup { + destroy .e +} -returnCodes error -result {PRIMARY selection doesn't exist or form "STRING" not defined} +test spinbox-3.53 {EntryWidgetCmd procedure, "select clear" widget command} -setup { + spinbox .e + pack .e + update +} -body { + .e insert end "0123456789" + .e select from 1 + .e select to 4 + update + .e select clear + catch {selection get} + selection own +} -cleanup { + destroy .e +} -result {.e} + +test spinbox-3.54 {EntryWidgetCmd procedure, "selection present" widget command} -setup { + spinbox .e +} -body { + .e selection present foo +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e selection present"} +test spinbox-3.55 {EntryWidgetCmd procedure, "selection present" widget command} -setup { + spinbox .e + pack .e + update +} -body { .e insert end 0123456789 .e select from 3 .e select to 6 .e selection present -} {1} -test spinbox-3.53 {SpinboxWidgetCmd procedure, "selection present" widget command} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {1} +test spinbox-3.56 {EntryWidgetCmd procedure, "selection present" widget command} -setup { + spinbox .e + pack .e + update +} -body { .e insert end 0123456789 .e select from 3 .e select to 6 .e configure -exportselection false .e selection present -} {1} -.e configure -exportselection true -test spinbox-3.54 {SpinboxWidgetCmd procedure, "selection present" widget command} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {1} +test spinbox-3.57 {EntryWidgetCmd procedure, "selection present" widget command} -setup { + spinbox .e + pack .e + update +} -body { .e insert end 0123456789 .e select from 3 .e select to 6 .e delete 0 end .e selection present -} {0} -test spinbox-3.55 {SpinboxWidgetCmd procedure, "selection adjust" widget command} { - list [catch {.e select adjust x} msg] $msg -} {1 {bad spinbox index "x"}} -test spinbox-3.56 {SpinboxWidgetCmd procedure, "selection adjust" widget command} { - list [catch {.e select adjust 2 3} msg] $msg -} {1 {wrong # args: should be ".e selection adjust index"}} -test spinbox-3.57 {SpinboxWidgetCmd procedure, "selection adjust" widget command} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {0} +test spinbox-3.58 {EntryWidgetCmd procedure, "selection adjust" widget command} -setup { + spinbox .e +} -body { + .e select adjust x +} -cleanup { + destroy .e +} -returnCodes error -result {bad spinbox index "x"} +test spinbox-3.59 {EntryWidgetCmd procedure, "selection adjust" widget command} -setup { + spinbox .e +} -body { + .e select adjust 2 3 +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e selection adjust index"} +test spinbox-3.60 {EntryWidgetCmd procedure, "selection adjust" widget command} -setup { + spinbox .e + pack .e + update +} -body { .e insert end "0123456789" .e select from 1 .e select to 5 update .e select adjust 4 selection get -} {123} -test spinbox-3.58 {SpinboxWidgetCmd procedure, "selection adjust" widget command} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {123} +test spinbox-3.61 {EntryWidgetCmd procedure, "selection adjust" widget command} -setup { + spinbox .e + pack .e + update +} -body { .e insert end "0123456789" .e select from 1 .e select to 5 update .e select adjust 2 selection get -} {234} -test spinbox-3.59 {SpinboxWidgetCmd procedure, "selection from" widget command} { - list [catch {.e select from 2 3} msg] $msg -} {1 {wrong # args: should be ".e selection from index"}} -test spinbox-3.60 {SpinboxWidgetCmd procedure, "selection range" widget command} { - list [catch {.e select range 2} msg] $msg -} {1 {wrong # args: should be ".e selection range start end"}} -test spinbox-3.61 {SpinboxWidgetCmd procedure, "selection range" widget command} { - list [catch {.e selection range 2 3 4} msg] $msg -} {1 {wrong # args: should be ".e selection range start end"}} -test spinbox-3.62 {SpinboxWidgetCmd procedure, "selection range" widget command} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {234} +test spinbox-3.62 {EntryWidgetCmd procedure, "selection from" widget command} -setup { + spinbox .e +} -body { + .e select from 2 3 +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e selection from index"} + +test spinbox-3.63 {EntryWidgetCmd procedure, "selection range" widget command} -setup { + spinbox .e +} -body { + .e select range 2 +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e selection range start end"} +test spinbox-3.64 {EntryWidgetCmd procedure, "selection range" widget command} -setup { + spinbox .e +} -body { + .e selection range 2 3 4 +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e selection range start end"} +test spinbox-3.65 {EntryWidgetCmd procedure, "selection range" widget command} -setup { + spinbox .e +} -body { .e insert end 0123456789 .e select from 1 .e select to 5 .e select range 4 4 - list [catch {.e index sel.first} msg] $msg -} {1 {selection isn't in widget .e}} -test spinbox-3.63 {SpinboxWidgetCmd procedure, "selection range" widget command} { - .e delete 0 end + .e index sel.first +} -cleanup { + destroy .e +} -returnCodes error -result {selection isn't in widget .e} +test spinbox-3.66 {EntryWidgetCmd procedure, "selection range" widget command} -setup { + spinbox .e + pack .e + update +} -body { .e insert end 0123456789 .e select from 3 .e select to 7 .e select range 2 9 list [.e index sel.first] [.e index sel.last] [.e index anchor] -} {2 9 3} -.e delete 0 end -.e insert end "This is quite a long text string, so long that it " -.e insert end "runs off the end of the window quite a bit." -test spinbox-3.64 {SpinboxWidgetCmd procedure, "selection to" widget command} { - list [catch {.e select to 2 3} msg] $msg -} {1 {wrong # args: should be ".e selection to index"}} -test spinbox-3.65 {SpinboxWidgetCmd procedure, "xview" widget command} { +} -cleanup { + destroy .e +} -result {2 9 3} +test spinbox-3.67 {EntryWidgetCmd procedure, "selection" widget command} -setup { + spinbox .e + pack .e + update +} -body { + .e insert end 0123456789 + .e selection range 0 end + .e configure -state disabled + .e selection range 2 4 + .e configure -state normal + list [.e index sel.first] [.e index sel.last] +} -cleanup { + destroy .e +} -result {0 10} +test spinbox-3.68 {EntryWidgetCmd procedure, "selection" widget command} -setup { + spinbox .e + pack .e + update +} -body { + .e insert end 0123456789 + .e selection range 0 end + .e configure -state readonly + .e selection range 2 4 + .e configure -state normal + list [.e index sel.first] [.e index sel.last] +} -cleanup { + destroy .e +} -result {2 4} +test spinbox-3.69 {EntryWidgetCmd procedure, "selection to" widget command} -setup { + spinbox .e + pack .e + update + .e insert end "This is quite a long text string, so long that it " + .e insert end "runs off the end of the window quite a bit." +} -body { + .e select to 2 3 +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e selection to index"} + +test spinbox-3.70 {EntryWidgetCmd procedure, "xview" widget command} -setup { + spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { + .e insert end "This is quite a long text string, so long that it " + .e insert end "runs off the end of the window quite a bit." .e xview 5 .e xview -} {0.0537634 0.268817} -test spinbox-3.66 {SpinboxWidgetCmd procedure, "xview" widget command} { - list [catch {.e xview gorp} msg] $msg -} {1 {bad spinbox index "gorp"}} -test spinbox-3.67 {SpinboxWidgetCmd procedure, "xview" widget command} { +} -cleanup { + destroy .e +} -result {0.0537634 0.268817} +test spinbox-3.71 {EntryWidgetCmd procedure, "xview" widget command} -setup { + spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { + .e xview gorp +} -cleanup { + destroy .e +} -returnCodes error -result {bad spinbox index "gorp"} +test spinbox-3.72 {EntryWidgetCmd procedure, "xview" widget command} -setup { + spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { + .e insert end "This is quite a long text string, so long that it " + .e insert end "runs off the end of the window quite a bit." .e xview 0 .e icursor 10 .e xview insert .e xview -} {0.107527 0.322581} -test spinbox-3.68 {SpinboxWidgetCmd procedure, "xview" widget command} { - list [catch {.e xview moveto foo bar} msg] $msg -} {1 {wrong # args: should be ".e xview moveto fraction"}} -test spinbox-3.69 {SpinboxWidgetCmd procedure, "xview" widget command} { - list [catch {.e xview moveto foo} msg] $msg -} {1 {expected floating-point number but got "foo"}} -test spinbox-3.70 {SpinboxWidgetCmd procedure, "xview" widget command} { +} -cleanup { + destroy .e +} -result {0.107527 0.322581} +test spinbox-3.73 {EntryWidgetCmd procedure, "xview" widget command} -setup { + spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { + .e xview moveto foo bar +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e xview moveto fraction"} +test spinbox-3.74 {EntryWidgetCmd procedure, "xview" widget command} -setup { + spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { + .e xview moveto foo +} -cleanup { + destroy .e +} -returnCodes error -result {expected floating-point number but got "foo"} +test spinbox-3.75 {EntryWidgetCmd procedure, "xview" widget command} -setup { + spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { + .e insert end "This is quite a long text string, so long that it " + .e insert end "runs off the end of the window quite a bit." .e xview moveto 0.5 .e xview -} {0.505376 0.72043} -test spinbox-3.71 {SpinboxWidgetCmd procedure, "xview" widget command} { - list [catch {.e xview scroll 24} msg] $msg -} {1 {wrong # args: should be ".e xview scroll number units|pages"}} -test spinbox-3.72 {SpinboxWidgetCmd procedure, "xview" widget command} { - list [catch {.e xview scroll gorp units} msg] $msg -} {1 {expected integer but got "gorp"}} -test spinbox-3.73 {SpinboxWidgetCmd procedure, "xview" widget command} { +} -cleanup { + destroy .e +} -result {0.505376 0.72043} +test spinbox-3.76 {EntryWidgetCmd procedure, "xview" widget command} -setup { + spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { + .e insert end "This is quite a long text string, so long that it " + .e insert end "runs off the end of the window quite a bit." + .e xview scroll 24 +} -cleanup { + destroy .e +} -returnCodes error -result {wrong # args: should be ".e xview scroll number units|pages"} +test spinbox-3.77 {EntryWidgetCmd procedure, "xview" widget command} -setup { + spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e +} -body { + .e insert end "This is quite a long text string, so long that it " + .e insert end "runs off the end of the window quite a bit." + update + .e xview scroll gorp units +} -cleanup { + destroy .e +} -returnCodes error -result {expected integer but got "gorp"} +test spinbox-3.78 {EntryWidgetCmd procedure, "xview" widget command} -setup { + spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e +} -body { + .e insert end "This is quite a long text string, so long that it " + .e insert end "runs off the end of the window quite a bit." + update .e xview moveto 0 .e xview scroll 1 pages .e xview -} {0.193548 0.408602} -test spinbox-3.74 {SpinboxWidgetCmd procedure, "xview" widget command} { +} -cleanup { + destroy .e +} -result {0.193548 0.408602} +test spinbox-3.79 {EntryWidgetCmd procedure, "xview" widget command} -setup { + spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { + .e insert end "This is quite a long text string, so long that it " + .e insert end "runs off the end of the window quite a bit." .e xview moveto .9 update .e xview scroll -2 p .e xview -} {0.397849 0.612903} -test spinbox-3.75 {SpinboxWidgetCmd procedure, "xview" widget command} { +} -cleanup { + destroy .e +} -result {0.397849 0.612903} +test spinbox-3.80 {EntryWidgetCmd procedure, "xview" widget command} -setup { + spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e +} -body { + .e insert end "This is quite a long text string, so long that it " + .e insert end "runs off the end of the window quite a bit." + update .e xview 30 update .e xview scroll 2 units .e index @0 -} {32} -test spinbox-3.76 {SpinboxWidgetCmd procedure, "xview" widget command} { +} -cleanup { + destroy .e +} -result {32} +test spinbox-3.81 {EntryWidgetCmd procedure, "xview" widget command} -setup { + spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e +} -body { + .e insert end "This is quite a long text string, so long that it " + .e insert end "runs off the end of the window quite a bit." + update .e xview 30 update .e xview scroll -1 units .e index @0 -} {29} -test spinbox-3.77 {SpinboxWidgetCmd procedure, "xview" widget command} { - list [catch {.e xview scroll 23 foobars} msg] $msg -} {1 {bad argument "foobars": must be units or pages}} -test spinbox-3.78 {SpinboxWidgetCmd procedure, "xview" widget command} { - list [catch {.e xview eat 23 hamburgers} msg] $msg -} {1 {unknown option "eat": must be moveto or scroll}} -test spinbox-3.79 {SpinboxWidgetCmd procedure, "xview" widget command} { +} -cleanup { + destroy .e +} -result {29} +test spinbox-3.82 {EntryWidgetCmd procedure, "xview" widget command} -setup { + spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e +} -body { + .e insert end "This is quite a long text string, so long that it " + .e insert end "runs off the end of the window quite a bit." + update + .e xview scroll 23 foobars +} -cleanup { + destroy .e +} -returnCodes error -result {bad argument "foobars": must be units or pages} +test spinbox-3.83 {EntryWidgetCmd procedure, "xview" widget command} -setup { + spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e +} -body { + .e insert end "This is quite a long text string, so long that it " + .e insert end "runs off the end of the window quite a bit." + update + .e xview eat 23 hamburgers +} -cleanup { + destroy .e +} -returnCodes error -result {unknown option "eat": must be moveto or scroll} +test spinbox-3.84 {EntryWidgetCmd procedure, "xview" widget command} -setup { + spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { + .e insert end "This is quite a long text string, so long that it " + .e insert end "runs off the end of the window quite a bit." .e xview 0 update .e xview -4 .e index @0 -} {0} -test spinbox-3.80 {SpinboxWidgetCmd procedure, "xview" widget command} { +} -cleanup { + destroy .e +} -result {0} +test spinbox-3.85 {EntryWidgetCmd procedure, "xview" widget command} -setup { + spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e +} -body { + .e insert end "This is quite a long text string, so long that it " + .e insert end "runs off the end of the window quite a bit." + update .e xview 300 .e index @0 -} {73} -.e insert 10 \u4e4e -test spinbox-3.81 {SpinboxWidgetCmd procedure, "xview" widget command} { - # UTF - # If Tcl_NumUtfChars wasn't used, wrong answer would be: - # 0.106383 0.117021 0.117021 - +} -cleanup { + destroy .e +} -result {73} +test spinbox-3.86 {EntryWidgetCmd procedure, "xview" widget command} -setup { + spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e +} -body { + .e insert end "This is quite a long text string, so long that it " + .e insert end "runs off the end of the window quite a bit." + .e insert 10 \u4e4e + update +# UTF +# If Tcl_NumUtfChars wasn't used, wrong answer would be: +# 0.106383 0.117021 0.117021 set x {} .e xview moveto .1 lappend x [lindex [.e xview] 0] @@ -524,221 +1908,327 @@ test spinbox-3.81 {SpinboxWidgetCmd procedure, "xview" widget command} { lappend x [lindex [.e xview] 0] .e xview moveto .12 lappend x [lindex [.e xview] 0] -} {0.0957447 0.106383 0.117021} -test spinbox-3.82 {SpinboxWidgetCmd procedure} { - list [catch {.e gorp} msg] $msg -} {1 {bad option "gorp": must be bbox, cget, configure, delete, get, icursor, identify, index, insert, invoke, scan, selection, set, validate, or xview}} - -frame .f -width 200 -height 50 -relief raised -bd 2 -pack .f -side right -test spinbox-5.1 {ConfigureSpinbox procedure, -textvariable} { - catch {destroy .e} +} -cleanup { + destroy .e +} -result {0.0957447 0.106383 0.117021} + +test spinbox-3.87 {EntryWidgetCmd procedure} -setup { + spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 + pack .e + update +} -body { + .e gorp +} -cleanup { + destroy .e +} -returnCodes error -result {bad option "gorp": must be bbox, cget, configure, delete, get, icursor, identify, index, insert, invoke, scan, selection, set, validate, or xview} + +test spinbox-4.1 {ConfigureEntry procedure, -textvariable} -body { set x 12345 spinbox .e -textvariable x .e get -} {12345} -test spinbox-5.2 {ConfigureSpinbox procedure, -textvariable} { - catch {destroy .e} +} -cleanup { + destroy .e +} -result {12345} +test spinbox-4.1 {ConfigureEntry procedure, -textvariable} -body { set x 12345 spinbox .e -textvariable x set y abcde .e configure -textvariable y set x 54321 .e get -} {abcde} -test spinbox-5.3 {ConfigureSpinbox procedure, -textvariable} { - catch {destroy .e} - catch {unset x} +} -cleanup { + destroy .e +} -result {abcde} +test spinbox-4.2 {ConfigureEntry procedure, -textvariable} -setup { + unset -nocomplain x spinbox .e +} -body { .e insert 0 "Some text" .e configure -textvariable x - set x -} {Some text} -test spinbox-5.4 {ConfigureSpinbox procedure, -textvariable} { - proc override args { - global x - set x 12345 - } - catch {destroy .e} - catch {unset x} - trace variable x w override + return $x +} -cleanup { + destroy .e +} -result {Some text} +test spinbox-4.3 {ConfigureEntry procedure, -textvariable} -setup { + unset -nocomplain x spinbox .e +} -body { + trace variable x w override .e insert 0 "Some text" .e configure -textvariable x - set result [list $x [.e get]] - unset x; rename override {} - set result -} {12345 12345} -test spinbox-5.5 {ConfigureSpinbox procedure} { - catch {destroy .e} - spinbox .e -exportselection false - pack .e - .e insert end "0123456789" - .sel select from 0 - .sel select to 10 + list $x [.e get] +} -cleanup { + destroy .e + trace vdelete x w override +} -result {12345 12345} + +test spinbox-4.4 {ConfigureEntry procedure} -setup { set x {} + spinbox .e1 + spinbox .e2 +} -body { + .e2 insert end "This is some sample text" + .e1 configure -exportselection false + .e1 insert end "0123456789" + pack .e1 .e2 + .e2 select from 0 + .e2 select to 10 lappend x [selection get] - .e select from 1 - .e select to 5 + .e1 select from 1 + .e1 select to 5 lappend x [selection get] - .e configure -exportselection 1 + .e1 configure -exportselection 1 lappend x [selection get] - set x -} {{This is so} {This is so} 1234} -test spinbox-5.6 {ConfigureSpinbox procedure} { - catch {destroy .e} + return $x +} -cleanup { + destroy .e1 .e2 +} -result {{This is so} {This is so} 1234} +test spinbox-4.5 {ConfigureEntry procedure} -setup { + spinbox .e + pack .e +} -body { + .e insert end "0123456789" + .e select from 1 + .e select to 5 + .e configure -exportselection 0 + selection get +} -cleanup { + destroy .e +} -returnCodes error -result {PRIMARY selection doesn't exist or form "STRING" not defined} +test spinbox-4.6 {ConfigureEntry procedure} -setup { spinbox .e pack .e +} -body { .e insert end "0123456789" .e select from 1 .e select to 5 .e configure -exportselection 0 - list [catch {selection get} msg] $msg [.e index sel.first] \ - [.e index sel.last] -} {1 {PRIMARY selection doesn't exist or form "STRING" not defined} 1 5} -test spinbox-5.7 {ConfigureSpinbox procedure} { - catch {destroy .e} - spinbox .e -font $fixed -width 4 -xscrollcommand scroll + catch {selection get} + list [.e index sel.first] [.e index sel.last] +} -cleanup { + destroy .e +} -result {1 5} + +test spinbox-4.7 {ConfigureEntry procedure} -setup { + spinbox .e -font {Helvetica -12} -borderwidth 2 -highlightthickness 2 pack .e +} -body { + .e configure -font {Courier -12} -width 4 -xscrollcommand scroll .e insert end "01234567890" update .e configure -width 5 - set scrollInfo -} {0 0.363636} -test spinbox-5.8 {ConfigureSpinbox procedure} {fonts} { - catch {destroy .e} - spinbox .e -width 0 + return $scrollInfo +} -cleanup { + destroy .e +} -result {0 0.363636} + +test spinbox-4.8 {ConfigureEntry procedure} -constraints { + fonts +} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 pack .e +} -body { + .e configure -width 0 -font {Helvetica -12} .e insert end "0123" update - .e configure -font $big + .e configure -font {Helvetica -24} update winfo geom .e -} {79x37+0+0} -test spinbox-5.9 {ConfigureSpinbox procedure} {fonts} { - catch {destroy .e} - spinbox .e -font $fixed -bd 2 -relief raised +} -cleanup { + destroy .e +} -result {79x37+0+0} +test spinbox-4.9 {ConfigureEntry procedure} -constraints { + fonts +} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 pack .e +} -body { + .e configure -font {Courier -12} -bd 2 -relief raised .e insert end "0123" update list [.e index @10] [.e index @11] [.e index @12] [.e index @13] -} {0 0 1 1} -test spinbox-5.10 {ConfigureSpinbox procedure} {fonts} { - catch {destroy .e} - spinbox .e -font $fixed -bd 2 -relief flat +} -cleanup { + destroy .e +} -result {0 0 1 1} +test spinbox-4.10 {ConfigureEntry procedure} -constraints { + fonts +} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 pack .e +} -body { + .e configure -font {Courier -12} -bd 2 -relief flat .e insert end "0123" update list [.e index @10] [.e index @11] [.e index @12] [.e index @13] -} {0 0 1 1} -test spinbox-5.11 {ConfigureSpinbox procedure} { - # If "0" in selected font had 0 width, caused divide-by-zero error. - - catch {destroy .e} - pack [spinbox .e -font {{open look glyph}}] +} -cleanup { + destroy .e +} -result {0 0 1 1} +test spinbox-4.11 {ConfigureEntry procedure} -setup { + spinbox .e -borderwidth 2 -highlightthickness 2 + pack .e +} -body { +# If "0" in selected font had 0 width, caused divide-by-zero error. + .e configure -font {{open look glyph}} .e scan dragto 30 update -} {} +} -cleanup { + destroy .e +} -result {} -# No tests for DisplaySpinbox. +# No tests for DisplayEntry. -test spinbox-6.1 {SpinboxComputeGeometry procedure} {fonts} { - catch {destroy .e} - spinbox .e -font $fixed -bd 2 -relief raised -width 20 -highlightthickness 3 +test spinbox-5.1 {EntryComputeGeometry procedure} -constraints { + fonts +} -setup { + spinbox .e pack .e +} -body { + .e configure -font {Courier -12} -bd 2 -relief raised -width 20 -highlightthickness 3 .e insert end 012\t45 update list [.e index @61] [.e index @62] -} {3 4} -test spinbox-6.2 {SpinboxComputeGeometry procedure} {fonts} { - catch {destroy .e} - spinbox .e -font $fixed -bd 2 -relief raised -width 20 -justify center \ - -highlightthickness 3 +} -cleanup { + destroy .e +} -result {3 4} +test spinbox-5.2 {EntryComputeGeometry procedure} -constraints { + fonts +} -setup { + spinbox .e pack .e +} -body { + .e configure -font {Courier -12} -bd 2 -relief raised -width 20 -justify center \ + -highlightthickness 3 .e insert end 012\t45 update list [.e index @96] [.e index @97] -} {3 4} -test spinbox-6.3 {SpinboxComputeGeometry procedure} {fonts} { - catch {destroy .e} - spinbox .e -font $fixed -bd 2 -relief raised -width 20 -justify right \ - -highlightthickness 3 +} -cleanup { + destroy .e +} -result {3 4} +test spinbox-5.3 {EntryComputeGeometry procedure} -constraints { + fonts +} -setup { + spinbox .e pack .e +} -body { + .e configure -font {Courier -12} -bd 2 -relief raised -width 20 -justify right \ + -highlightthickness 3 .e insert end 012\t45 update list [.e index @131] [.e index @132] -} {3 4} -test spinbox-6.4 {SpinboxComputeGeometry procedure} { - catch {destroy .e} - spinbox .e -font $fixed -bd 2 -relief raised -width 5 +} -cleanup { + destroy .e +} -result {3 4} +test spinbox-5.4 {EntryComputeGeometry procedure} -setup { + spinbox .e pack .e +} -body { + .e configure -font {Courier -12} -bd 2 -relief raised -width 5 .e insert end "01234567890" update .e xview 6 .e index @0 -} {6} -test spinbox-6.5 {SpinboxComputeGeometry procedure} { - catch {destroy .e} - spinbox .e -font $fixed -bd 2 -relief raised -width 5 +} -cleanup { + destroy .e +} -result {6} +test spinbox-5.5 {EntryComputeGeometry procedure} -setup { + spinbox .e -highlightthickness 2 pack .e +} -body { + .e configure -font {Courier -12} -bd 2 -relief raised -width 5 .e insert end "01234567890" update .e xview 7 .e index @0 -} {6} -test spinbox-6.6 {SpinboxComputeGeometry procedure} {fonts} { - catch {destroy .e} - spinbox .e -font $fixed -bd 2 -relief raised -width 10 +} -cleanup { + destroy .e +} -result {6} +test spinbox-5.6 {EntryComputeGeometry procedure} -constraints { + fonts +} -setup { + spinbox .e -highlightthickness 2 pack .e +} -body { + .e configure -font {Courier -12} -bd 2 -relief raised -width 10 .e insert end "01234\t67890" update .e xview 3 list [.e index @39] [.e index @40] -} {5 6} -test spinbox-6.7 {SpinboxComputeGeometry procedure} {fonts} { - catch {destroy .e} - spinbox .e -font $big -bd 3 -relief raised -width 5 +} -cleanup { + destroy .e +} -result {5 6} +test spinbox-5.7 {EntryComputeGeometry procedure} -constraints { + fonts +} -setup { + spinbox .e -highlightthickness 2 pack .e +} -body { + .e configure -font {Helvetica -24} -bd 3 -relief raised -width 5 .e insert end "01234567" update list [winfo reqwidth .e] [winfo reqheight .e] -} {94 39} -test spinbox-6.8 {SpinboxComputeGeometry procedure} {fonts} { - catch {destroy .e} - spinbox .e -font $big -bd 3 -relief raised -width 0 +} -cleanup { + destroy .e +} -result {94 39} +test spinbox-5.8 {EntryComputeGeometry procedure} -constraints { + fonts +} -setup { + spinbox .e -highlightthickness 2 pack .e +} -body { + .e configure -font {Helvetica -24} -bd 3 -relief raised -width 0 .e insert end "01234567" update list [winfo reqwidth .e] [winfo reqheight .e] -} {133 39} -test spinbox-6.9 {SpinboxComputeGeometry procedure} {fonts} { - catch {destroy .e} - spinbox .e -font $big -bd 3 -relief raised -width 0 -highlightthickness 2 +} -cleanup { + destroy .e +} -result {133 39} +test spinbox-5.9 {EntryComputeGeometry procedure} -constraints { + fonts +} -setup { + spinbox .e -highlightthickness 2 pack .e +} -body { + .e configure -font {Helvetica -24} -bd 3 -relief raised -width 0 update list [winfo reqwidth .e] [winfo reqheight .e] -} {42 39} +} -cleanup { + destroy .e +} -result {42 39} -catch {destroy .e} -spinbox .e -width 10 -font $fixed -textvariable contents -xscrollcommand scroll -pack .e -focus .e -test spinbox-7.1 {InsertChars procedure} { - .e delete 0 end + +test spinbox-6.1 {InsertChars procedure} -setup { + unset -nocomplain contents + spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { + .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde .e insert 2 XXX update list [.e get] $contents $scrollInfo -} {abXXXcde abXXXcde {0 1}} -test spinbox-7.2 {InsertChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {abXXXcde abXXXcde {0 1}} + +test spinbox-6.2 {InsertChars procedure} -setup { + unset -nocomplain contents + spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { + .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde .e insert 500 XXX update list [.e get] $contents $scrollInfo -} {abcdeXXX abcdeXXX {0 1}} -test spinbox-7.3 {InsertChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {abcdeXXX abcdeXXX {0 1}} +test spinbox-6.3 {InsertChars procedure} -setup { + spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e +} -body { .e insert 0 0123456789 .e select from 2 .e select to 6 @@ -746,9 +2236,13 @@ test spinbox-7.3 {InsertChars procedure} { set x "[.e index sel.first] [.e index sel.last]" .e select to 8 lappend x [.e index sel.first] [.e index sel.last] -} {5 9 5 8} -test spinbox-7.4 {InsertChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {5 9 5 8} +test spinbox-6.4 {InsertChars procedure} -setup { + spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e +} -body { .e insert 0 0123456789 .e select from 2 .e select to 6 @@ -756,9 +2250,13 @@ test spinbox-7.4 {InsertChars procedure} { set x "[.e index sel.first] [.e index sel.last]" .e select to 8 lappend x [.e index sel.first] [.e index sel.last] -} {2 9 2 8} -test spinbox-7.5 {InsertChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {2 9 2 8} +test spinbox-6.5 {InsertChars procedure} -setup { + spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e +} -body { .e insert 0 0123456789 .e select from 2 .e select to 6 @@ -766,9 +2264,13 @@ test spinbox-7.5 {InsertChars procedure} { set x "[.e index sel.first] [.e index sel.last]" .e select to 8 lappend x [.e index sel.first] [.e index sel.last] -} {2 9 2 8} -test spinbox-7.6 {InsertChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {2 9 2 8} +test spinbox-6.6 {InsertChars procedure} -setup { + spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e +} -body { .e insert 0 0123456789 .e select from 2 .e select to 6 @@ -776,70 +2278,118 @@ test spinbox-7.6 {InsertChars procedure} { set x "[.e index sel.first] [.e index sel.last]" .e select to 5 lappend x [.e index sel.first] [.e index sel.last] -} {2 6 2 5} -test spinbox-7.7 {InsertChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {2 6 2 5} +test spinbox-6.7 {InsertChars procedure} -setup { + spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e +} -body { + .e configure -xscrollcommand scroll .e insert 0 0123456789 .e icursor 4 .e insert 4 XXX .e index insert -} {7} -test spinbox-7.8 {InsertChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {7} +test spinbox-6.8 {InsertChars procedure} -setup { + spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e +} -body { .e insert 0 0123456789 .e icursor 4 .e insert 5 XXX .e index insert -} {4} -test spinbox-7.9 {InsertChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {4} +test spinbox-6.9 {InsertChars procedure} -setup { + spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e +} -body { .e insert 0 "This is a very long string" update .e xview 4 .e insert 3 XXX .e index @0 -} {7} -test spinbox-7.10 {InsertChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {7} +test spinbox-6.10 {InsertChars procedure} -setup { + spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e +} -body { .e insert 0 "This is a very long string" update .e xview 4 .e insert 4 XXX .e index @0 -} {4} -.e configure -width 0 -test spinbox-7.11 {InsertChars procedure} {fonts} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {4} + +test spinbox-6.11 {InsertChars procedure} -constraints { + fonts +} -setup { + spinbox .e -width 0 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e +} -body { .e insert 0 "xyzzy" update .e insert 2 00 winfo reqwidth .e -} {70} +} -cleanup { + destroy .e +} -result {70} -.e configure -width 10 -test spinbox-8.1 {DeleteChars procedure} { - .e delete 0 end +test spinbox-7.1 {DeleteChars procedure} -setup { + unset -nocomplain contents + spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { + .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde .e delete 2 4 update list [.e get] $contents $scrollInfo -} {abe abe {0 1}} -test spinbox-8.2 {DeleteChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {abe abe {0 1}} +test spinbox-7.2 {DeleteChars procedure} -setup { + unset -nocomplain contents + spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { + .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde .e delete -2 2 update list [.e get] $contents $scrollInfo -} {cde cde {0 1}} -test spinbox-8.3 {DeleteChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {cde cde {0 1}} +test spinbox-7.3 {DeleteChars procedure} -setup { + unset -nocomplain contents + spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { + .e configure -textvariable contents -xscrollcommand scroll .e insert 0 abcde .e delete 3 1000 update list [.e get] $contents $scrollInfo -} {abc abc {0 1}} -test spinbox-8.4 {DeleteChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {abc abc {0 1}} +test spinbox-7.4 {DeleteChars procedure} -setup { + spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { .e insert 0 0123456789abcde .e select from 3 .e select to 8 @@ -848,9 +2398,14 @@ test spinbox-8.4 {DeleteChars procedure} { set x "[.e index sel.first] [.e index sel.last]" .e select to 5 lappend x [.e index sel.first] [.e index sel.last] -} {1 6 1 5} -test spinbox-8.5 {DeleteChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {1 6 1 5} +test spinbox-7.5 {DeleteChars procedure} -setup { + spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { .e insert 0 0123456789abcde .e select from 3 .e select to 8 @@ -859,9 +2414,14 @@ test spinbox-8.5 {DeleteChars procedure} { set x "[.e index sel.first] [.e index sel.last]" .e select to 4 lappend x [.e index sel.first] [.e index sel.last] -} {1 5 1 4} -test spinbox-8.6 {DeleteChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {1 5 1 4} +test spinbox-7.6 {DeleteChars procedure} -setup { + spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { .e insert 0 0123456789abcde .e select from 3 .e select to 8 @@ -870,17 +2430,28 @@ test spinbox-8.6 {DeleteChars procedure} { set x "[.e index sel.first] [.e index sel.last]" .e select to 5 lappend x [.e index sel.first] [.e index sel.last] -} {1 2 1 5} -test spinbox-8.7 {DeleteChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {1 2 1 5} +test spinbox-7.7 {DeleteChars procedure} -setup { + spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { .e insert 0 0123456789abcde .e select from 3 .e select to 8 .e delete 1 8 - list [catch {.e index sel.first} msg] $msg -} {1 {selection isn't in widget .e}} -test spinbox-8.8 {DeleteChars procedure} { - .e delete 0 end + update + .e index sel.first +} -cleanup { + destroy .e +} -returnCodes error -result {selection isn't in widget .e} +test spinbox-7.8 {DeleteChars procedure} -setup { + spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { .e insert 0 0123456789abcde .e select from 3 .e select to 8 @@ -889,17 +2460,27 @@ test spinbox-8.8 {DeleteChars procedure} { set x "[.e index sel.first] [.e index sel.last]" .e select to 8 lappend x [.e index sel.first] [.e index sel.last] -} {3 4 3 8} -test spinbox-8.9 {DeleteChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {3 4 3 8} +test spinbox-7.9 {DeleteChars procedure} -setup { + spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e +} -body { .e insert 0 0123456789abcde .e select from 3 .e select to 8 .e delete 3 8 - list [catch {.e index sel.first} msg] $msg -} {1 {selection isn't in widget .e}} -test spinbox-8.10 {DeleteChars procedure} { - .e delete 0 end + update + .e index sel.first +} -cleanup { + destroy .e +} -returnCodes error -result {selection isn't in widget .e} +test spinbox-7.10 {DeleteChars procedure} -setup { + spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { .e insert 0 0123456789abcde .e select from 8 .e select to 3 @@ -908,9 +2489,14 @@ test spinbox-8.10 {DeleteChars procedure} { set x "[.e index sel.first] [.e index sel.last]" .e select to 8 lappend x [.e index sel.first] [.e index sel.last] -} {3 5 5 8} -test spinbox-8.11 {DeleteChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {3 5 5 8} +test spinbox-7.11 {DeleteChars procedure} -setup { + spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { .e insert 0 0123456789abcde .e select from 8 .e select to 3 @@ -919,124 +2505,185 @@ test spinbox-8.11 {DeleteChars procedure} { set x "[.e index sel.first] [.e index sel.last]" .e select to 4 lappend x [.e index sel.first] [.e index sel.last] -} {3 8 4 8} -test spinbox-8.12 {DeleteChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {3 8 4 8} +test spinbox-7.12 {DeleteChars procedure} -setup { + spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { .e insert 0 0123456789abcde .e icursor 4 .e delete 1 4 + update .e index insert -} {1} -test spinbox-8.13 {DeleteChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {1} +test spinbox-7.13 {DeleteChars procedure} -setup { + spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { .e insert 0 0123456789abcde .e icursor 4 .e delete 1 5 + update .e index insert -} {1} -test spinbox-8.14 {DeleteChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {1} +test spinbox-7.14 {DeleteChars procedure} -setup { + spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { .e insert 0 0123456789abcde .e icursor 4 .e delete 4 6 + update .e index insert -} {4} -test spinbox-8.15 {DeleteChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {4} +test spinbox-7.15 {DeleteChars procedure} -setup { + spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { .e insert 0 "This is a very long string" .e xview 4 .e delete 1 4 + update .e index @0 -} {1} -test spinbox-8.16 {DeleteChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {1} +test spinbox-7.16 {DeleteChars procedure} -setup { + spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { .e insert 0 "This is a very long string" .e xview 4 .e delete 1 5 + update .e index @0 -} {1} -test spinbox-8.17 {DeleteChars procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {1} +test spinbox-7.17 {DeleteChars procedure} -setup { + spinbox .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { .e insert 0 "This is a very long string" .e xview 4 .e delete 4 6 + update .e index @0 -} {4} -.e configure -width 0 -test spinbox-8.18 {DeleteChars procedure} {fonts} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {4} +test spinbox-7.18 {DeleteChars procedure} -setup { + spinbox .e -width 0 -font {Courier -12} -highlightthickness 2 -bd 2 + pack .e + focus .e +} -body { .e insert 0 "xyzzy" update .e delete 2 4 winfo reqwidth .e -} {42} +} -cleanup { + destroy .e +} -result {42} -test spinbox-9.1 {SpinboxValueChanged procedure} { - catch {destroy .e} - proc override args { - global x - set x 12345 - } - catch {unset x} +test spinbox-8.1 {EntryValueChanged procedure} -setup { + unset -nocomplain x +} -body { trace variable x w override - spinbox .e -textvariable x + spinbox .e -textvariable x -width 0 .e insert 0 foo - set result [list $x [.e get]] - unset x; rename override {} - set result -} {12345 12345} - -catch {destroy .e} -spinbox .e -pack .e -.e configure -width 0 -test spinbox-10.1 {SpinboxSetValue procedure} {fonts} { + list $x [.e get] +} -cleanup { + destroy .e + trace vdelete x w override +} -result {12345 12345} + + +test spinbox-9.1 {EntrySetValue procedure} -constraints fonts -body { set x abcde set y ab - .e configure -textvariable x - update + spinbox .e -font {Helvetica -12} -highlightthickness 2 -bd 2 -width 0 + pack .e + .e configure -textvariable x .e configure -textvariable y update list [.e get] [winfo reqwidth .e] -} {ab 35} -test spinbox-10.2 {SpinboxSetValue procedure, updating selection} { - catch {destroy .e} - spinbox .e -textvariable x +} -cleanup { + destroy .e +} -result {ab 35} +test spinbox-9.2 {EntrySetValue procedure, updating selection} -setup { + unset -nocomplain x + spinbox .e -font {Helvetica -12} -highlightthickness 2 -bd 2 + pack .e +} -body { + .e configure -textvariable x .e insert 0 "abcdefghjklmnopqrstu" .e selection range 4 10 set x "a" - list [catch {.e index sel.first} msg] $msg -} {1 {selection isn't in widget .e}} -test spinbox-10.3 {SpinboxSetValue procedure, updating selection} { - catch {destroy .e} - spinbox .e -textvariable x + .e index sel.first +} -cleanup { + destroy .e +} -returnCodes error -result {selection isn't in widget .e} +test spinbox-9.3 {EntrySetValue procedure, updating selection} -setup { + unset -nocomplain x + spinbox .e -font {Helvetica -12} -highlightthickness 2 -bd 2 + pack .e +} -body { + .e configure -textvariable x .e insert 0 "abcdefghjklmnopqrstu" .e selection range 4 10 set x "abcdefg" list [.e index sel.first] [.e index sel.last] -} {4 7} -test spinbox-10.4 {SpinboxSetValue procedure, updating selection} { - catch {destroy .e} - spinbox .e -textvariable x +} -cleanup { + destroy .e +} -result {4 7} +test spinbox-9.4 {EntrySetValue procedure, updating selection} -setup { + unset -nocomplain x + spinbox .e -font {Helvetica -12} -highlightthickness 2 -bd 2 + pack .e +} -body { + .e configure -textvariable x .e insert 0 "abcdefghjklmnopqrstu" .e selection range 4 10 set x "abcdefghijklmn" list [.e index sel.first] [.e index sel.last] -} {4 10} -test spinbox-10.5 {SpinboxSetValue procedure, updating display position} { - catch {destroy .e} - spinbox .e -width 10 -font $fixed -textvariable x +} -cleanup { + destroy .e +} -result {4 10} +test spinbox-9.5 {EntrySetValue procedure, updating display position} -setup { + unset -nocomplain x + spinbox .e -highlightthickness 2 -bd 2 pack .e +} -body { + .e configure -width 10 -font {Courier -12} -textvariable x .e insert 0 "abcdefghjklmnopqrstuvwxyz" .e xview 10 update set x "abcdefg" update .e index @0 -} {0} -test spinbox-10.6 {SpinboxSetValue procedure, updating display position} { - catch {destroy .e} - spinbox .e -width 10 -font $fixed -textvariable x +} -cleanup { + destroy .e +} -result {0} +test spinbox-9.6 {EntrySetValue procedure, updating display position} -setup { + unset -nocomplain x + spinbox .e -highlightthickness 2 -bd 2 + pack .e +} -body { + .e configure -width 10 -font {Courier -12} -textvariable x pack .e .e insert 0 "abcdefghjklmnopqrstuvwxyz" .e xview 10 @@ -1044,177 +2691,440 @@ test spinbox-10.6 {SpinboxSetValue procedure, updating display position} { set x "1234567890123456789012" update .e index @0 -} {10} -test spinbox-10.7 {SpinboxSetValue procedure, updating insertion cursor} { - catch {destroy .e} - spinbox .e -width 10 -font $fixed -textvariable x +} -cleanup { + destroy .e +} -result {10} +test spinbox-9.7 {EntrySetValue procedure, updating insertion cursor} -setup { + unset -nocomplain x + spinbox .e -highlightthickness 2 -bd 2 + pack .e + update +} -body { + .e configure -width 10 -font {Courier -12} -textvariable x pack .e .e insert 0 "abcdefghjklmnopqrstuvwxyz" .e icursor 5 set x "123" .e index insert -} {3} -test spinbox-10.8 {SpinboxSetValue procedure, updating insertion cursor} { - catch {destroy .e} - spinbox .e -width 10 -font $fixed -textvariable x +} -cleanup { + destroy .e +} -result {3} +test spinbox-9.8 {EntrySetValue procedure, updating insertion cursor} -setup { + unset -nocomplain x + spinbox .e -highlightthickness 2 -bd 2 + pack .e +} -body { + .e configure -width 10 -font {Courier -12} -textvariable x pack .e .e insert 0 "abcdefghjklmnopqrstuvwxyz" .e icursor 5 set x "123456" .e index insert -} {5} +} -cleanup { + destroy .e +} -result {5} -test spinbox-11.1 {SpinboxEventProc procedure} { - catch {destroy .e} - spinbox .e +test spinbox-10.1 {EntryEventProc procedure} -setup { + spinbox .e -highlightthickness 2 -bd 2 -font {Helvetica -12} + pack .e +} -body { .e insert 0 abcdefg destroy .e update -} {} -test spinbox-11.2 {SpinboxEventProc procedure} { - deleteWindows +} -cleanup { + destroy .e +} -result {} +test spinbox-10.2 {EntryEventProc procedure} -setup { + set x {} +} -body { spinbox .e1 -fg #112233 rename .e1 .e2 - set x {} lappend x [winfo children .] lappend x [.e2 cget -fg] destroy .e1 lappend x [info command .e*] [winfo children .] -} {.e1 #112233 {} {}} - -test spinbox-12.1 {SpinboxCmdDeletedProc procedure} { - deleteWindows - button .e1 -text "xyz_123" - rename .e1 {} - list [info command .e*] [winfo children .] -} {{} {}} - -catch {destroy .e} -spinbox .e -font $fixed -width 5 -bd 2 -relief sunken -pack .e -.e insert 0 012345678901234567890 -.e xview 4 -update -test spinbox-13.1 {GetSpinboxIndex procedure} { +} -cleanup { + destroy .e1 +} -result {.e1 #112233 {} {}} + +test spinbox-11.1 {EntryCmdDeletedProc procedure} -body { + button .b -text "xyz_123" + rename .b {} + list [info command .b*] [winfo children .] +} -cleanup { + destroy .b +} -result {{} {}} + + +test spinbox-12.1 {GetEntryIndex procedure} -setup { + spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken + pack .e +} -body { + .e insert 0 012345678901234567890 + .e xview 4 + update .e index end -} {21} -test spinbox-13.2 {GetSpinboxIndex procedure} { - list [catch {.e index abogus} msg] $msg -} {1 {bad spinbox index "abogus"}} -test spinbox-13.3 {GetSpinboxIndex procedure} { +} -cleanup { + destroy .e +} -result {21} +test spinbox-12.2 {GetEntryIndex procedure} -body { + spinbox .e + .e index abogus +} -cleanup { + destroy .e +} -returnCodes error -result {bad spinbox index "abogus"} +test spinbox-12.3 {GetEntryIndex procedure} -setup { + spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken + pack .e +} -body { + .e insert 0 012345678901234567890 + .e xview 4 + update .e select from 1 .e select to 6 .e index anchor -} {1} -test spinbox-13.4 {GetSpinboxIndex procedure} { +} -cleanup { + destroy .e +} -result {1} +test spinbox-12.4 {GetEntryIndex procedure} -setup { + spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken + pack .e +} -body { + .e insert 0 012345678901234567890 + .e xview 4 + update .e select from 4 .e select to 1 .e index anchor -} {4} -test spinbox-13.5 {GetSpinboxIndex procedure} { +} -cleanup { + destroy .e +} -result {4} +test spinbox-12.5 {GetEntryIndex procedure} -setup { + spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken + pack .e +} -body { + .e insert 0 012345678901234567890 + .e xview 4 + update .e select from 3 .e select to 15 .e select adjust 4 .e index anchor -} {15} -test spinbox-13.6 {GetSpinboxIndex procedure} { - list [catch {.e index ebogus} msg] $msg -} {1 {bad spinbox index "ebogus"}} -test spinbox-13.7 {GetSpinboxIndex procedure} { +} -cleanup { + destroy .e +} -result {15} +test spinbox-12.6 {GetEntryIndex procedure} -setup { + spinbox .e +} -body { + .e index ebogus +} -cleanup { + destroy .e +} -returnCodes error -result {bad spinbox index "ebogus"} +test spinbox-12.7 {GetEntryIndex procedure} -setup { + spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken + pack .e +} -body { + .e insert 0 012345678901234567890 + .e xview 4 + update .e icursor 2 .e index insert -} {2} -test spinbox-13.8 {GetSpinboxIndex procedure} { - list [catch {.e index ibogus} msg] $msg -} {1 {bad spinbox index "ibogus"}} -test spinbox-13.9 {GetSpinboxIndex procedure} { +} -cleanup { + destroy .e +} -result {2} +test spinbox-12.8 {GetEntryIndex procedure} -setup { + spinbox .e +} -body { + .e index ibogus +} -cleanup { + destroy .e +} -returnCodes error -result {bad spinbox index "ibogus"} +test spinbox-12.9 {GetEntryIndex procedure} -setup { + spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken + pack .e +} -body { + .e insert 0 012345678901234567890 + .e xview 4 + update + .e select from 1 + .e select to 6 + list [.e index sel.first] [.e index sel.last] +} -cleanup { + destroy .e +} -result {1 6} + +test spinbox-12.10 {GetEntryIndex procedure} -constraints unix -body { +# On unix, when selection is cleared, spinbox widget's internal +# selection range is reset. +# Previous settings: + spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update + .e select from 1 + .e select to 6 + list [.e index sel.first] [.e index sel.last] +# Testing: + selection clear .e + .e index sel.first +} -cleanup { + destroy .e +} -returnCodes error -result {selection isn't in widget .e} +test spinbox-12.11 {GetEntryIndex procedure} -constraints unix -body { +# Previous settings: + spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update + .e select from 1 + .e select to 6 + list [.e index sel.first] [.e index sel.last] +# Testing: + selection clear .e + .e index sbogus +} -cleanup { + destroy .e +} -returnCodes error -result {selection isn't in widget .e} + +test spinbox-12.12 {GetEntryIndex procedure} -constraints unix -body { +# Previous settings: + spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update + .e select from 1 + .e select to 6 + list [.e index sel.first] [.e index sel.last] +# Testing: + selection clear .e + .e index bogus +} -cleanup { + destroy .e +} -returnCodes error -result {bad spinbox index "bogus"} + +test spinbox-12.13 {GetEntryIndex procedure} -constraints win -body { +# On mac and pc, when selection is cleared, spinbox widget remembers +# last selected range. When selection ownership is restored to +# spinbox, the old range will be rehighlighted. +# Previous settings: + spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update + .e select from 1 + .e select to 6 + list [.e index sel.first] [.e index sel.last] +# Testing: + selection clear .e + selection get +} -cleanup { + destroy .e +} -returnCodes error -match glob -result {*} +test spinbox-12.14 {GetEntryIndex procedure} -constraints win -body { +# On mac and pc, when selection is cleared, spinbox widget remembers +# last selected range. When selection ownership is restored to +# spinbox, the old range will be rehighlighted. +# Previous settings: + spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update + .e select from 1 + .e select to 6 + list [.e index sel.first] [.e index sel.last] +# Testing: + selection clear .e + catch {selection get} + .e index sel.first +} -cleanup { + destroy .e +} -result {1} +test spinbox-12.15 {GetEntryIndex procedure} -constraints win -body { +# On mac and pc, when selection is cleared, spinbox widget remembers +# last selected range. When selection ownership is restored to +# spinbox, the old range will be rehighlighted. +# Previous settings: + spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update + .e select from 1 + .e select to 6 + list [.e index sel.first] [.e index sel.last] +# Testing: + selection clear .e + catch {selection get} + .e index sbogus +} -cleanup { + destroy .e +} -returnCodes error -match glob -result {*} +test spinbox-12.16 {GetEntryIndex procedure} -constraints win -body { +# Previous settings: + spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update .e select from 1 .e select to 6 list [.e index sel.first] [.e index sel.last] -} {1 6} -selection clear .e -test spinbox-13.10 {GetSpinboxIndex procedure} unix { - # On unix, when selection is cleared, spinbox widget's internal - # selection range is reset. - - list [catch {.e index sel.first} msg] $msg -} {1 {selection isn't in widget .e}} -test spinbox-13.11 {GetSpinboxIndex procedure} win { - # On mac and pc, when selection is cleared, spinbox widget remembers - # last selected range. When selection ownership is restored to - # spinbox, the old range will be rehighlighted. - - list [catch {selection get}] [.e index sel.first] -} {1 1} -test spinbox-13.12 {GetSpinboxIndex procedure} unix { - list [catch {.e index sbogus} msg] $msg -} {1 {selection isn't in widget .e}} -test spinbox-13.13 {GetSpinboxIndex procedure} win { - list [catch {.e index sbogus} msg] $msg -} {1 {bad spinbox index "sbogus"}} -test spinbox-13.14 {GetSpinboxIndex procedure} win { - list [catch {selection get}] [catch {.e index sbogus}] -} {1 1} -test spinbox-13.15 {GetSpinboxIndex procedure} { - list [catch {.e index @xyz} msg] $msg -} {1 {bad spinbox index "@xyz"}} -test spinbox-13.16 {GetSpinboxIndex procedure} {fonts} { +# Testing: + selection clear .e + .e index sbogus +} -cleanup { + destroy .e +} -returnCodes error -result {bad spinbox index "sbogus"} + +test spinbox-12.17 {GetEntryIndex procedure} -body { + spinbox .e + selection clear .e + .e index @xyz +} -cleanup { + destroy .e +} -returnCodes error -result {bad spinbox index "@xyz"} + +test spinbox-12.18 {GetEntryIndex procedure} -constraints fonts -body { + spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \ + -font {Courier -12} + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update .e index @4 -} {4} -test spinbox-13.17 {GetSpinboxIndex procedure} {fonts} { +} -cleanup { + destroy .e +} -result {4} +test spinbox-12.19 {GetEntryIndex procedure} -constraints fonts -body { + spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \ + -font {Courier -12} + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update .e index @11 -} {4} -test spinbox-13.18 {GetSpinboxIndex procedure} {fonts} { +} -cleanup { + destroy .e +} -result {4} +test spinbox-12.20 {GetEntryIndex procedure} -constraints fonts -body { + spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \ + -font {Courier -12} + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update .e index @12 -} {5} -test spinbox-13.19 {GetSpinboxIndex procedure} {fonts} { - # 11 is the minimum button width - .e index @[expr [winfo width .e] - 6 - 11] -} {8} -test spinbox-13.20 {GetSpinboxIndex procedure} {fonts} { - .e index @[expr [winfo width .e] - 5] -} {9} -test spinbox-13.21 {GetSpinboxIndex procedure} { +} -cleanup { + destroy .e +} -result {5} +test spinbox-12.21 {GetEntryIndex procedure} -constraints fonts -body { + spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \ + -font {Courier -12} + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update + .e index @[expr {[winfo width .e] - 6-11}] +} -cleanup { + destroy .e +} -result {8} +test spinbox-12.22 {GetEntryIndex procedure} -constraints fonts -body { + spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \ + -font {Courier -12} + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update + .e index @[expr {[winfo width .e] - 5}] +} -cleanup { + destroy .e +} -result {9} +test spinbox-12.23 {GetEntryIndex procedure} -body { + spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \ + -font {Courier -12} + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update .e index @1000 -} {9} -test spinbox-13.22 {GetSpinboxIndex procedure} { - list [catch {.e index 1xyz} msg] $msg -} {1 {bad spinbox index "1xyz"}} -test spinbox-13.23 {GetSpinboxIndex procedure} { +} -cleanup { + destroy .e +} -result {9} +test spinbox-12.24 {GetEntryIndex procedure} -setup { + spinbox .e + pack .e + update +} -body { + .e index 1xyz +} -cleanup { + destroy .e +} -returnCodes error -result {bad spinbox index "1xyz"} +test spinbox-12.25 {GetEntryIndex procedure} -body { + spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \ + -font {Courier -12} + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update .e index -10 -} {0} -test spinbox-13.24 {GetSpinboxIndex procedure} { +} -cleanup { + destroy .e +} -result {0} +test spinbox-12.26 {GetEntryIndex procedure} -body { + spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \ + -font {Courier -12} + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update .e index 12 -} {12} -test spinbox-13.25 {GetSpinboxIndex procedure} { +} -cleanup { + destroy .e +} -result {12} +test spinbox-12.27 {GetEntryIndex procedure} -body { + spinbox .e -width 5 -relief sunken -highlightthickness 2 -bd 2 \ + -font {Courier -12} + pack .e + .e insert 0 012345678901234567890 + .e xview 4 + update .e index 49 -} {21} +} -cleanup { + destroy .e +} -result {21} -# XXX Still need to write tests for SpinboxScanTo and SpinboxSelectTo. +# XXX Still need to write tests for EntryScanTo and EntrySelectTo. -set x {} -for {set i 1} {$i <= 500} {incr i} { - append x "This is line $i, out of 500\n" -} -test spinbox-14.1 {SpinboxFetchSelection procedure} { - catch {destroy .e} +test spinbox-13.1 {EntryFetchSelection procedure} -body { spinbox .e .e insert end "This is a test string" .e select from 1 .e select to 18 selection get -} {his is a test str} -test spinbox-14.3 {SpinboxFetchSelection procedure} { - catch {destroy .e} +} -cleanup { + destroy .e +} -result {his is a test str} +test spinbox-13.2 {EntryFetchSelection procedure} -setup { + set x {} + for {set i 1} {$i <= 500} {incr i} { + append x "This is line $i, out of 500\n" +} +} -body { spinbox .e - .e insert end $x + .e insert end $x .e select from 0 .e select to end string compare [selection get] $x -} 0 +} -cleanup { + destroy .e +} -result {0} -test spinbox-15.1 {SpinboxLostSelection} { - catch {destroy .e} +test spinbox-14.1 {EntryLostSelection} -body { spinbox .e .e insert 0 "Text" .e select from 0 @@ -1224,265 +3134,546 @@ test spinbox-15.1 {SpinboxLostSelection} { .e select from 0 .e select to 4 lappend result [selection get] -} {Text Text} - -# No tests for EventuallyRedraw. +} -cleanup { + destroy .e +} -result {Text Text} -catch {destroy .e} -spinbox .e -width 10 -xscrollcommand scroll -pack .e -update -test spinbox-16.1 {SpinboxVisibleRange procedure} {fonts} { - .e delete 0 end - .e insert 0 ............................. +test spinbox-15.1 {EntryVisibleRange procedure} -constraints fonts -body { + spinbox .e -width 10 -font {Helvetica -12} + pack .e + update + .e insert 0 "............................." .e xview -} {0 0.827586} -test spinbox-15.4 {SpinboxVisibleRange procedure} { - .e delete 0 end +} -cleanup { + destroy .e +} -result {0 0.827586} +test spinbox-16.2 {EntryVisibleRange procedure} -body { + spinbox .e .e xview -} {0 1} +} -cleanup { + destroy .e +} -result {0 1} -catch {destroy .e} -spinbox .e -width 10 -xscrollcommand scroll -font $fixed -pack .e -update -test spinbox-17.1 {SpinboxUpdateScrollbar procedure} { + +test spinbox-16.1 {EntryUpdateScrollbar procedure} -body { + spinbox .e -width 10 -xscrollcommand scroll -font {Courier -12} + pack .e .e delete 0 end .e insert 0 123 update - set scrollInfo -} {0 1} -test spinbox-17.2 {SpinboxUpdateScrollbar procedure} { - .e delete 0 end + return $scrollInfo +} -cleanup { + destroy .e +} -result {0 1} +test spinbox-16.2 {EntryUpdateScrollbar procedure} -body { + spinbox .e -width 10 -xscrollcommand scroll -font {Courier -12} + pack .e .e insert 0 0123456789abcdef .e xview 3 update - set scrollInfo -} {0.1875 0.8125} -test spinbox-17.3 {SpinboxUpdateScrollbar procedure} { - .e delete 0 end + return $scrollInfo +} -cleanup { + destroy .e +} -result {0.1875 0.8125} +test spinbox-16.3 {EntryUpdateScrollbar procedure} -body { + spinbox .e -width 10 -xscrollcommand scroll -font {Courier -12} + pack .e .e insert 0 abcdefghijklmnopqrs .e xview 6 update - set scrollInfo -} {0.315789 0.842105} -test spinbox-17.4 {SpinboxUpdateScrollbar procedure} { + return $scrollInfo +} -cleanup { destroy .e - set x "Background error did not happen" +} -result {0.315789 0.842105} +test spinbox-16.4 {EntryUpdateScrollbar procedure} -setup { proc bgerror msg { global x set x $msg - } +} +} -body { spinbox .e -width 5 -xscrollcommand thisisnotacommand pack .e update - rename bgerror {} list $x $errorInfo -} {{invalid command name "thisisnotacommand"} {invalid command name "thisisnotacommand" +} -cleanup { + destroy .e + rename bgerror {} +} -result {{invalid command name "thisisnotacommand"} {invalid command name "thisisnotacommand" while executing "thisisnotacommand 0 1" (horizontal scrolling command executed by .e)}} -set l [interp hidden] -deleteWindows -test spinbox-18.1 {Spinbox widget vs hiding} { - destroy .e +test spinbox-17.1 {Entry widget vs hiding} -setup { spinbox .e +} -body { + set l [interp hidden] interp hide {} .e destroy .e - list [winfo children .] [interp hidden] -} [list {} $l] + set res1 [list [winfo children .] [interp hidden]] + set res2 [list {} $l] + expr {$res1 == $res2} +} -result {1} ## -## Spinbox widget VALIDATION tests +## Entry widget VALIDATION tests ## - -destroy .e -catch {unset ::e} -catch {unset ::vVals} -spinbox .e -validate all \ - -validatecommand [list doval %W %d %i %P %s %S %v %V] \ - -invalidcommand bell \ - -textvariable ::e \ - -background red -foreground white -pack .e -proc doval {W d i P s S v V} { - set ::vVals [list $W $d $i $P $s $S $v $V] - return 1 -} - # The validation tests build each one upon the previous, so cascading # failures aren't good # -test spinbox-19.1 {spinbox widget validation} { +# 18.* test cases in previous version highly depended on the previous +# test cases. This was replaced by inserting recently set configurations +# that matters for the test case +test spinbox-18.1 {spinbox widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + spinbox .e -validate all \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e .e insert 0 a - set ::vVals -} {.e 1 0 a {} a all key} -test spinbox-19.2 {spinbox widget validation} { + return $::vVals +} -cleanup { + destroy .e +} -result {.e 1 0 a {} a all key} + +test spinbox-18.2 {spinbox widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + spinbox .e -validate all \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + .e insert 0 a ;# previous settings .e insert 1 b - set ::vVals -} {.e 1 1 ab a b all key} -test spinbox-19.3 {spinbox widget validation} { + return $::vVals +} -cleanup { + destroy .e +} -result {.e 1 1 ab a b all key} + +test spinbox-18.3 {spinbox widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + spinbox .e -validate all \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + .e insert 0 ab ;# previous settings .e insert end c - set ::vVals -} {.e 1 2 abc ab c all key} -test spinbox-19.4 {spinbox widget validation} { + return $::vVals +} -cleanup { + destroy .e +} -result {.e 1 2 abc ab c all key} + +test spinbox-18.4 {spinbox widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + spinbox .e -validate all \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + .e insert 0 abc ;# previous settings .e insert 1 123 list $::vVals $::e -} {{.e 1 1 a123bc abc 123 all key} a123bc} -test spinbox-19.5 {spinbox widget validation} { +} -cleanup { + destroy .e +} -result {{.e 1 1 a123bc abc 123 all key} a123bc} + +test spinbox-18.5 {spinbox widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + spinbox .e -validate all \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + .e insert 0 a123bc ;# previous settings .e delete 2 - set ::vVals -} {.e 0 2 a13bc a123bc 2 all key} -test spinbox-19.6 {spinbox widget validation} { + return $::vVals +} -cleanup { + destroy .e +} -result {.e 0 2 a13bc a123bc 2 all key} + +test spinbox-18.6 {spinbox widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + spinbox .e -validate all \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + .e insert 0 a13bc ;# previous settings .e configure -validate key .e delete 1 3 - set ::vVals -} {.e 0 1 abc a13bc 13 key key} -test spinbox-19.7 {spinbox widget validation} { + return $::vVals +} -cleanup { + destroy .e +} -result {.e 0 1 abc a13bc 13 key key} + +test spinbox-18.7 {spinbox widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + spinbox .e -validate focus \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + .e insert end abc ;# previous settings set ::vVals {} - .e configure -validate focus .e insert end d - set ::vVals -} {} -test spinbox-19.8 {spinbox widget validation} { + return $::vVals +} -cleanup { + destroy .e +} -result {} + +test spinbox-18.8 {spinbox widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + spinbox .e -validate all \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + .e configure -validate focus ;# previous settings + .e insert end abcd ;# previous settings focus -force .e - # update necessary to process FocusIn event +# update necessary to process FocusIn event update - set ::vVals -} {.e -1 -1 abcd abcd {} focus focusin} -test spinbox-19.9 {spinbox widget validation} { + return $::vVals +} -cleanup { + destroy .e +} -result {.e -1 -1 abcd abcd {} focus focusin} + +test spinbox-18.9 {spinbox widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + spinbox .e -validate focus \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + .e insert end abcd ;# previous settings + focus -force .e ;# previous settings + update ;# previous settings +# update necessary to process FocusIn event focus -force . - # update necessary to process FocusOut event +# update necessary to process FocusOut event update - set ::vVals -} {.e -1 -1 abcd abcd {} focus focusout} -.e configure -validate all -test spinbox-19.10 {spinbox widget validation} { + return $::vVals +} -cleanup { + destroy .e +} -result {.e -1 -1 abcd abcd {} focus focusout} + +test spinbox-18.10 {spinbox widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + spinbox .e -validate all \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + .e insert end abcd ;# previous settings focus -force .e - # update necessary to process FocusIn event +# update necessary to process FocusIn event update - set ::vVals -} {.e -1 -1 abcd abcd {} all focusin} -test spinbox-19.11 {spinbox widget validation} { + return $::vVals +} -cleanup { + destroy .e +} -result {.e -1 -1 abcd abcd {} all focusin} + +test spinbox-18.11 {spinbox widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + spinbox .e -validate all \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + .e insert end abcd ;# previous settings + focus -force .e ;# previous settings +# update necessary to process FocusIn event + update ;# previous settings focus -force . - # update necessary to process FocusOut event +# update necessary to process FocusOut event update - set ::vVals -} {.e -1 -1 abcd abcd {} all focusout} -.e configure -validate focusin -test spinbox-19.12 {spinbox widget validation} { + return $::vVals +} -cleanup { + destroy .e +} -result {.e -1 -1 abcd abcd {} all focusout} + +test spinbox-18.12 {spinbox widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + spinbox .e -validate focusin \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + .e insert 0 abcd ;# previous settings focus -force .e - # update necessary to process FocusIn event +# update necessary to process FocusIn event update - set ::vVals -} {.e -1 -1 abcd abcd {} focusin focusin} -test spinbox-19.13 {spinbox widget validation} { + return $::vVals +} -cleanup { + destroy .e +} -result {.e -1 -1 abcd abcd {} focusin focusin} + +test spinbox-18.13 {spinbox widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + spinbox .e -validate focusin \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + .e insert end abcd ;# previous settings set ::vVals {} focus -force . - # update necessary to process FocusOut event +# update necessary to process FocusOut event update - set ::vVals -} {} -.e configure -validate focuso -test spinbox-19.14 {spinbox widget validation} { + return $::vVals +} -cleanup { + destroy .e +} -result {} + +test spinbox-18.14 {spinbox widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + spinbox .e -validate focuso \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + .e insert end abcd ;# previous settings + set ::vVals {} ;# previous settings focus -force .e - # update necessary to process FocusIn event +# update necessary to process FocusIn event + update + return $::vVals +} -cleanup { + destroy .e +} -result {} + +test spinbox-18.15 {spinbox widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + spinbox .e -validate focuso \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + .e insert end abcd ;# previous settings + set ::vVals {} ;# previous settings + focus -force .e ;# previous settings +# update necessary to process FocusIn event + update ;# previous settings + focus -force . +# update necessary to process FocusOut event update - set ::vVals -} {} -test spinbox-19.15 {spinbox widget validation} { + return $::vVals +} -cleanup { + destroy .e +} -result {.e -1 -1 abcd abcd {} focusout focusout} + +# the same as 19.16 but added [.e validate] to returned list +test spinbox-18.16 {spinbox widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + spinbox .e -validate focuso \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + .e insert end abcd ;# previous settings + set ::vVals {} ;# previous settings + focus -force .e ;# previous settings +# update necessary to process FocusIn event + update ;# previous settings focus -force . - # update necessary to process FocusOut event +# update necessary to process FocusOut event update - set ::vVals -} {.e -1 -1 abcd abcd {} focusout focusout} -test spinbox-19.16 {spinbox widget validation} { list [.e validate] $::vVals -} {1 {.e -1 -1 abcd abcd {} all forced}} -test spinbox-19.17 {spinbox widget validation} { +} -cleanup { + destroy .e +} -result {1 {.e -1 -1 abcd abcd {} all forced}} + + +test spinbox-18.17 {spinbox widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + spinbox .e -validate focuso \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + .e insert end abcd ;# previous settings set ::e newdata list [.e cget -validate] $::vVals -} {focusout {.e -1 -1 newdata abcd {} focusout forced}} +} -cleanup { + destroy .e +} -result {focusout {.e -1 -1 newdata abcd {} focusout forced}} -proc doval {W d i P s S v V} { - set ::vVals [list $W $d $i $P $s $S $v $V] - return 0 -} -.e configure -validate all -test spinbox-19.18 {spinbox widget validation} { +# proc doval changed - returns 0 +test spinbox-18.18 {spinbox widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + spinbox .e -validate all \ + -validatecommand [list doval3 %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + set ::e newdata ;# previous settings + .e configure -validate all set ::e nextdata list [.e cget -validate] $::vVals -} {none {.e -1 -1 nextdata newdata {} all forced}} +} -cleanup { + destroy .e +} -result {none {.e -1 -1 nextdata newdata {} all forced}} -proc doval {W d i P s S v V} { - set ::vVals [list $W $d $i $P $s $S $v $V] - set ::e mydata - return 1 -} -.e configure -validate all ## This sets validate to none because it shows that we prevent a possible ## loop condition in the validation, when the spinbox textvar is also set -test spinbox-19.19 {spinbox widget validation} { +# proc doval2 used +test spinbox-18.19 {spinbox widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + spinbox .e -validate all \ + -validatecommand [list doval3 %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + set ::e nextdata ;# previous settings + + .e configure -validatecommand [list doval2 %W %d %i %P %s %S %v %V] .e validate list [.e cget -validate] [.e get] $::vVals -} {none mydata {.e -1 -1 nextdata nextdata {} all forced}} - -.e configure -validate all +} -cleanup { + destroy .e +} -result {none mydata {.e -1 -1 nextdata nextdata {} all forced}} ## This leaves validate alone because we trigger validation through the ## textvar (a write trace), and the write during validation triggers ## nothing (by definition of avoiding loops on var traces). This is ## one of those "dangerous" conditions where the user will have a ## different value in the spinbox widget shown as is in the textvar. -test spinbox-19.20 {spinbox widget validation} { +test spinbox-18.20 {spinbox widget validation} -setup { + unset -nocomplain ::e ::vVals +} -body { + spinbox .e -validate all \ + -validatecommand [list doval %W %d %i %P %s %S %v %V] \ + -invalidcommand bell \ + -textvariable ::e \ + -background red -foreground white + pack .e + set ::e nextdata ;# previous settings + .e configure -validatecommand [list doval2 %W %d %i %P %s %S %v %V] ;# prev + .e validate ;# previous settings + + .e configure -validate all set ::e testdata list [.e cget -validate] [.e get] $::e $::vVals -} {all testdata mydata {.e -1 -1 testdata mydata {} all forced}} +} -cleanup { + destroy .e +} -result {all testdata mydata {.e -1 -1 testdata mydata {} all forced}} +## +## End validation tests +## -# A format specifier is allowed to be of the form %[-+ 0]{0,1}\d.?\d?f -# -destroy .e -spinbox .e -test spinbox-20.1 {spinbox config, -format specifier} { - list [catch {.e config -format %2f} msg] $msg -} {0 {}} -test spinbox-20.2 {spinbox config, -format specifier} { - list [catch {.e config -format %2.2f} msg] $msg -} {0 {}} -test spinbox-20.3 {spinbox config, -format specifier} { - list [catch {.e config -format %.2f} msg] $msg -} {0 {}} -test spinbox-20.4 {spinbox config, -format specifier} { - list [catch {.e config -format %2.f} msg] $msg -} {0 {}} -test spinbox-20.5 {spinbox config, -format specifier} { - list [catch {.e config -format %2e-1f} msg] $msg -} {1 {bad spinbox format specifier "%2e-1f"}} -test spinbox-20.6 {spinbox config, -format specifier} { - list [catch {.e config -format 2.2} msg] $msg -} {1 {bad spinbox format specifier "2.2"}} -test spinbox-20.7 {spinbox config, -format specifier} { - list [catch {.e config -format %2.-2f} msg] $msg -} {1 {bad spinbox format specifier "%2.-2f"}} -test spinbox-20.8 {spinbox config, -format specifier} { - list [catch {.e config -format %-2.02f} msg] $msg -} {0 {}} -test spinbox-20.9 {spinbox config, -format specifier} { - list [catch {.e config -format "% 2.02f"} msg] $msg -} {0 {}} -test spinbox-20.10 {spinbox config, -format specifier} { - list [catch {.e config -format "% -2.200f"} msg] $msg -} {0 {}} -test spinbox-20.11 {spinbox config, -format specifier} { - list [catch {.e config -format "%09.200f"} msg] $msg -} {0 {}} -test spinbox-20.12 {spinbox config, -format specifier does something} { +test spinbox-19.1 {spinbox config, -format specifier} -body { + spinbox .e + .e config -format %2f +} -cleanup { + destroy .e +} -returnCodes ok +test spinbox-19.2 {spinbox config, -format specifier} -body { + spinbox .e + .e config -format %2.2f +} -cleanup { + destroy .e +} -returnCodes ok +test spinbox-19.3 {spinbox config, -format specifier} -body { + spinbox .e + .e config -format %.2f +} -cleanup { + destroy .e +} -returnCodes ok +test spinbox-19.4 {spinbox config, -format specifier} -body { + spinbox .e + .e config -format %2.f +} -cleanup { + destroy .e +} -returnCodes ok +test spinbox-19.5 {spinbox config, -format specifier} -body { + spinbox .e + .e config -format %2e-1f +} -cleanup { + destroy .e +} -returnCodes {error} -result {bad spinbox format specifier "%2e-1f"} +test spinbox-19.6 {spinbox config, -format specifier} -body { + spinbox .e + .e config -format 2.2 +} -cleanup { + destroy .e +} -returnCodes {error} -result {bad spinbox format specifier "2.2"} +test spinbox-19.7 {spinbox config, -format specifier} -body { + spinbox .e + .e config -format %2.-2f +} -cleanup { + destroy .e +} -returnCodes {error} -result {bad spinbox format specifier "%2.-2f"} +test spinbox-19.8 {spinbox config, -format specifier} -body { + spinbox .e + .e config -format %-2.02f +} -cleanup { + destroy .e +} -returnCodes ok +test spinbox-19.9 {spinbox config, -format specifier} -body { + spinbox .e + .e config -format "% 2.02f" +} -cleanup { + destroy .e +} -returnCodes ok +test spinbox-19.10 {spinbox config, -format specifier} -body { + spinbox .e + .e config -format "% -2.200f" +} -cleanup { + destroy .e +} -returnCodes ok +test spinbox-19.11 {spinbox config, -format specifier} -body { + spinbox .e + .e config -format "%09.200f" +} -cleanup { + destroy .e +} -returnCodes ok +test spinbox-19.12 {spinbox config, -format specifier does something} -setup { + spinbox .e set out {} +} -body { .e config -format "%02.f" .e config -values {} -from 0 -to 10 -increment 1 lappend out [.e set 0]; # set currently doesn't force format @@ -1491,10 +3682,12 @@ test spinbox-20.12 {spinbox config, -format specifier does something} { lappend out [.e set 3]; # set currently doesn't force format .e config -format "%03.f" lappend out [.e set]; # changing -format should cause formatting -} {0 01 3 003} - -test spinbox-21.1 {spinbox button, out of range checking} { +} -cleanup { destroy .e +} -result {0 01 3 003} + + +test spinbox-20.1 {spinbox button, out of range checking} -body { spinbox .e -from -10 -to 20 -increment 2 set out {} lappend out [.e get]; # -10 @@ -1552,50 +3745,60 @@ test spinbox-21.1 {spinbox button, out of range checking} { lappend out [.e get]; # 18 .e invoke buttonup; # no wrap lappend out [.e get]; # 20 +} -cleanup { + destroy .e +} -result {-10 20 20 -10 -10 -10 20 20 18 -10 -10 -8 -10 -8 -10 20 18 20} -} {-10 20 20 -10 -10 -10 20 20 18 -10 -10 -8 -10 -8 -10 20 18 20} - -test spinbox-22.1 {spinbox config, -from changes SF bug 559078} { +test spinbox-21.1 {spinbox config, -from changes SF bug 559078} -body { + set val 5 + spinbox .e -from 1 -to 10 -textvariable val + return $val +} -cleanup { + destroy .e +} -result {5} +test spinbox-21.2 {spinbox config, -from changes SF bug 559078} -body { + set val 5 + spinbox .e -from 1 -to 10 -textvariable val + .e configure -from 3 -to 10 + return $val +} -cleanup { + destroy .e +} -result {5} +test spinbox-21.3 {spinbox config, -from changes SF bug 559078} -body { set val 5 - destroy .s - spinbox .s -from 1 -to 10 -textvariable val - set val -} {5} -test spinbox-22.2 {spinbox config, -from changes SF bug 559078} { - .s configure -from 3 -to 10 - set val -} {5} -test spinbox-22.3 {spinbox config, -from changes SF bug 559078} { - .s configure -from 6 -to 10 - set val -} {6} - -test entry-23.1 {selection present while disabled, bug 637828} { - destroy .e - entry .e + spinbox .e -from 3 -to 10 -textvariable val + .e configure -from 6 -to 10 + return $val +} -cleanup { + destroy .e +} -result {6} + +test spinbox-22.1 {selection present while disabled, bug 637828} -body { + spinbox .e .e insert end 0123456789 .e select from 3 .e select to 6 set out [.e selection present] .e configure -state disabled - # still return 1 when disabled, because 'selection get' will work, - # but selection cannot be changed (new behavior since 8.4) +# still return 1 when disabled, because 'selection get' will work, +# but selection cannot be changed (new behavior since 8.4) .e select to 9 lappend out [.e selection present] [selection get] -} {1 1 345} - -destroy .e -catch {unset ::e ::vVals} - -## -## End validation tests -## +} -cleanup { + destroy .e +} -result {1 1 345} -# XXX Still need to write tests for SpinboxBlinkProc, SpinboxFocusProc, -# and SpinboxTextVarProc. -option clear +# Collected comments about lacks from the test +# XXX Still need to write tests for EntryBlinkProc, EntryFocusProc, +# and EntryTextVarProc. +# No tests for DisplayEntry. +# XXX Still need to write tests for EntryScanTo and EntrySelectTo. +# No tests for EventuallyRedraw +# option clear # cleanup cleanupTests return + + -- cgit v0.12 From 2984299e0c3bf197c1fff393f0edc8522ac68172 Mon Sep 17 00:00:00 2001 From: aniap Date: Tue, 22 Jul 2008 13:17:26 +0000 Subject: Update to tcltest2 --- tests/button.test | 111 +++++++++++++++++++++++++----------------------------- 1 file changed, 51 insertions(+), 60 deletions(-) diff --git a/tests/button.test b/tests/button.test index abc9315..4bc0929 100644 --- a/tests/button.test +++ b/tests/button.test @@ -7,7 +7,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: button.test,v 1.21 2008/07/22 11:55:57 aniap Exp $ +# RCS: @(#) $Id: button.test,v 1.22 2008/07/22 13:17:26 aniap Exp $ package require tcltest 2.2 namespace import ::tcltest::* @@ -3265,7 +3265,7 @@ test button-5.5 {ConfigureButton - image handling} -constraints { image names } -cleanup { destroy .b - image delete image1 image2 + image delete image2 } -result {image2} test button-5.6 {ConfigureButton - default value for variable} -body { @@ -3725,7 +3725,7 @@ test button-10.2 {ButtonTextVarProc procedure} -setup { test button-11.1 {ButtonImageProc procedure} -constraints { testImageType } -setup { - label .l -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + label .l -highlightthickness 0 -font {Helvetica -12 bold} image create test image1 } -body { .l configure -image image1 -padx 0 -pady 0 -bd 0 @@ -3752,14 +3752,14 @@ test button-12.1 {button widget vs hidden commands} -body { } -result {1} test button-13.1 {size behaviouor: label} -setup { - option add *Button.borderwidth 2 - option add *Button.highlightThickness 2 - option add *Button.font {Helvetica -12 bold} + label .a -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + label .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + label .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} set result {} } -body { - label .a -text Hej - label .b -text Hej -width 10 -height 1 - label .c -text "" -width 10 -height 1 + .a configure -text Hej + .b configure -text Hej -width 10 -height 1 + .c configure -text "" -width 10 -height 1 # With -width, width should not be affected by text change lappend result [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}] @@ -3769,18 +3769,16 @@ test button-13.1 {size behaviouor: label} -setup { lappend result [expr {[winfo reqheight .a] == [winfo reqheight .b]}] } -cleanup { destroy .a .b .c - option clear } -result {1 1 1} - test button-13.2 {size behaviouor: label} -setup { - option add *Button.borderwidth 2 - option add *Button.highlightThickness 2 - option add *Button.font {Arial 20} + label .a -borderwidth 2 -highlightthickness 2 -font {Arial 20} + label .b -borderwidth 2 -highlightthickness 2 -font {Arial 20} + label .c -borderwidth 2 -highlightthickness 2 -font {Arial 20} set result {} } -body { - label .a -text Hej - label .b -text Hej -width 10 -height 1 - label .c -text "" -width 10 -height 1 + .a configure -text Hej + .b configure -text Hej -width 10 -height 1 + .c configure -text "" -width 10 -height 1 # With -width, width should not be affected by text change lappend result [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}] @@ -3790,18 +3788,17 @@ test button-13.2 {size behaviouor: label} -setup { lappend result [expr {[winfo reqheight .a] == [winfo reqheight .b]}] } -cleanup { destroy .a .b .c - option clear } -result {1 1 1} test button-13.3 {size behaviouor: button} -setup { - option add *Button.borderwidth 2 - option add *Button.highlightThickness 2 - option add *Button.font {Helvetica -12 bold} + button .a -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + button .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} set result {} } -body { - label .a -text Hej - label .b -text Hej -width 10 -height 1 - label .c -text "" -width 10 -height 1 + .a configure -text Hej + .b configure -text Hej -width 10 -height 1 + .c configure -text "" -width 10 -height 1 # With -width, width should not be affected by text change lappend result [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}] @@ -3811,17 +3808,16 @@ test button-13.3 {size behaviouor: button} -setup { lappend result [expr {[winfo reqheight .a] == [winfo reqheight .b]}] } -cleanup { destroy .a .b .c - option clear } -result {1 1 1} test button-13.4 {size behaviouor: button} -setup { - option add *Button.borderwidth 2 - option add *Button.highlightThickness 2 - option add *Button.font {Arial 20} + button .a -borderwidth 2 -highlightthickness 2 -font {Arial 20} + button .b -borderwidth 2 -highlightthickness 2 -font {Arial 20} + button .c -borderwidth 2 -highlightthickness 2 -font {Arial 20} set result {} } -body { - button .a -text Hej - button .b -text Hej -width 10 -height 1 - button .c -text "" -width 10 -height 1 + .a configure -text Hej + .b configure -text Hej -width 10 -height 1 + .c configure -text "" -width 10 -height 1 # With -width, width should not be affected by text change lappend result [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}] @@ -3831,18 +3827,17 @@ test button-13.4 {size behaviouor: button} -setup { lappend result [expr {[winfo reqheight .a] == [winfo reqheight .b]}] } -cleanup { destroy .a .b .c - option clear } -result {1 1 1} test button-13.5 {size behaviouor: radiobutton} -setup { - option add *Button.borderwidth 2 - option add *Button.highlightThickness 2 - option add *Button.font {Helvetica -12 bold} + radiobutton .a -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + radiobutton .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + radiobutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} set result {} } -body { - radiobutton .a -text Hej - radiobutton .b -text Hej -width 10 -height 1 - radiobutton .c -text "" -width 10 -height 1 + .a configure -text Hej + .b configure -text Hej -width 10 -height 1 + .c configure -text "" -width 10 -height 1 # With -width, width should not be affected by text change lappend result [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}] @@ -3852,18 +3847,17 @@ test button-13.5 {size behaviouor: radiobutton} -setup { lappend result [expr {[winfo reqheight .a] == [winfo reqheight .b]}] } -cleanup { destroy .a .b .c - option clear } -result {1 1 1} test button-13.6 {size behaviouor: radiobutton} -setup { - option add *Button.borderwidth 2 - option add *Button.highlightThickness 2 - option add *Button.font {Arial 20} + radiobutton .a -borderwidth 2 -highlightthickness 2 -font {Arial 20} + radiobutton .b -borderwidth 2 -highlightthickness 2 -font {Arial 20} + radiobutton .c -borderwidth 2 -highlightthickness 2 -font {Arial 20} set result {} } -body { - radiobutton .a -text Hej - radiobutton .b -text Hej -width 10 -height 1 - radiobutton .c -text "" -width 10 -height 1 + .a configure -text Hej + .b configure -text Hej -width 10 -height 1 + .c configure -text "" -width 10 -height 1 # With -width, width should not be affected by text change lappend result [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}] @@ -3873,18 +3867,17 @@ test button-13.6 {size behaviouor: radiobutton} -setup { lappend result [expr {[winfo reqheight .a] == [winfo reqheight .b]}] } -cleanup { destroy .a .b .c - option clear } -result {1 1 1} test button-13.7 {size behaviouor: checkbutton} -setup { - option add *Button.borderwidth 2 - option add *Button.highlightThickness 2 - option add *Button.font {Helvetica -12 bold} + checkbutton .a -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + checkbutton .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} set result {} } -body { - checkbutton .a -text Hej - checkbutton .b -text Hej -width 10 -height 1 - checkbutton .c -text "" -width 10 -height 1 + .a configure -text Hej + .b configure -text Hej -width 10 -height 1 + .c configure -text "" -width 10 -height 1 # With -width, width should not be affected by text change lappend result [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}] @@ -3894,18 +3887,17 @@ test button-13.7 {size behaviouor: checkbutton} -setup { lappend result [expr {[winfo reqheight .a] == [winfo reqheight .b]}] } -cleanup { destroy .a .b .c - option clear } -result {1 1 1} test button-13.8 {size behaviouor: checkbutton} -setup { - option add *Button.borderwidth 2 - option add *Button.highlightThickness 2 - option add *Button.font {Arial 20} + checkbutton .a -borderwidth 2 -highlightthickness 2 -font {Arial 20} + checkbutton .b -borderwidth 2 -highlightthickness 2 -font {Arial 20} + checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Arial 20} set result {} } -body { - checkbutton .a -text Hej - checkbutton .b -text Hej -width 10 -height 1 - checkbutton .c -text "" -width 10 -height 1 + .a configure -text Hej + .b configure -text Hej -width 10 -height 1 + .c configure -text "" -width 10 -height 1 # With -width, width should not be affected by text change lappend result [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}] @@ -3915,7 +3907,6 @@ test button-13.8 {size behaviouor: checkbutton} -setup { lappend result [expr {[winfo reqheight .a] == [winfo reqheight .b]}] } -cleanup { destroy .a .b .c - option clear } -result {1 1 1} -- cgit v0.12 From ca56021c3e7b6cebd5b0963cfb66f42c33453ac5 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 22 Jul 2008 14:35:23 +0000 Subject: remove duplicate test --- tests/imgPhoto.test | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test index c73df01..6cfaa4f 100644 --- a/tests/imgPhoto.test +++ b/tests/imgPhoto.test @@ -9,7 +9,7 @@ # # Author: Paul Mackerras (paulus@cs.anu.edu.au) # -# RCS: @(#) $Id: imgPhoto.test,v 1.28 2008/02/01 16:53:57 rmax Exp $ +# RCS: @(#) $Id: imgPhoto.test,v 1.29 2008/07/22 14:35:23 dgp Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -665,18 +665,6 @@ test imgPhoto-14.3 {GIF -index interleaving and small frames} -setup { image delete $i } -test imgPhoto-14.3 {GIF -index interleaving and small frames} -setup { - set i [image create photo] -} -body { - # Interleaved GIFs used to crash us when a smaller subsequent frame - # was accessed. - $i configure -format {GIF -index 1} -data { - R0lGODdhAQAFAPAAAP8AAAAAACwAAAAAAQAFAEACAoRdACwAAAAAAQAEAEACAoRRADs= - } -} -cleanup { - image delete $i -} - test imgPhoto-14.4 {GIF buffer overflow} -setup { set i [image create photo] } -body { -- cgit v0.12 From d3188c5ae3ead818ecd8dfdaa4f93bd100f1b8c8 Mon Sep 17 00:00:00 2001 From: das Date: Tue, 22 Jul 2008 17:00:20 +0000 Subject: * macosx/tkMacOSXHLEvents.c: factor out common code; formatting. --- macosx/tkMacOSXHLEvents.c | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/macosx/tkMacOSXHLEvents.c b/macosx/tkMacOSXHLEvents.c index fb2a111..bc85386 100644 --- a/macosx/tkMacOSXHLEvents.c +++ b/macosx/tkMacOSXHLEvents.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXHLEvents.c,v 1.16 2008/07/02 09:44:49 dkf Exp $ + * RCS: @(#) $Id: tkMacOSXHLEvents.c,v 1.17 2008/07/22 17:00:20 das Exp $ */ #include "tkMacOSXPrivate.h" @@ -497,7 +497,7 @@ ScriptHandler( strlen(errString)); } else if (MissedAnyParameters(event)) { /* - * Dude! Where's my parameter? + * Return error if parameter is missing. */ sprintf(errString, "AEDoScriptHandler: extra parameters"); @@ -573,20 +573,18 @@ ScriptHandler( * If we actually go to run Tcl code - put the result in the reply. */ - if (tclErr == TCL_OK) { + if (tclErr >= 0) { int reslen; const char *result = Tcl_GetStringFromObj(Tcl_GetObjResult(interp), &reslen); - AEPutParamPtr(reply, keyDirectObject, typeChar, result, reslen); - } else if (tclErr >= 0) { - int reslen; - const char *result = - Tcl_GetStringFromObj(Tcl_GetObjResult(interp), &reslen); - - AEPutParamPtr(reply, keyErrorString, typeChar, result, reslen); - AEPutParamPtr(reply, keyErrorNumber, typeInteger, (Ptr) &tclErr, - sizeof(int)); + if (tclErr == TCL_OK) { + AEPutParamPtr(reply, keyDirectObject, typeChar, result, reslen); + } else { + AEPutParamPtr(reply, keyErrorString, typeChar, result, reslen); + AEPutParamPtr(reply, keyErrorNumber, typeInteger, (Ptr) &tclErr, + sizeof(int)); + } } AEDisposeDesc(&theDesc); @@ -617,14 +615,9 @@ ReallyKillMe( { Tcl_Interp *interp = ((KillEvent *) eventPtr)->interp; Tcl_CmdInfo dummy; - int result; + int quit = Tcl_GetCommandInfo(interp, "::tk::mac::Quit", &dummy); - if (Tcl_GetCommandInfo(interp, "::tk::mac::Quit", &dummy)) { - result = Tcl_GlobalEval(interp, "::tk::mac::Quit"); - } else { - result = Tcl_GlobalEval(interp, "exit"); - } - if (result != TCL_OK) { + if (Tcl_GlobalEval(interp, quit ? "::tk::mac::Quit" : "exit") != TCL_OK) { /* * Should be never reached... */ @@ -656,7 +649,7 @@ MissedAnyParameters( { DescType returnedType; Size actualSize; - register OSStatus err; + OSStatus err; err = ChkErr(AEGetAttributePtr, theEvent, keyMissedKeywordAttr, typeWildCard, &returnedType, NULL, 0, &actualSize); @@ -686,11 +679,11 @@ FSRefToDString( Tcl_DString *ds) { UInt8 fileName[PATH_MAX+1]; - register OSStatus err; + OSStatus err; err = ChkErr(FSRefMakePath, fsref, fileName, sizeof(fileName)); if (err == noErr) { - Tcl_ExternalToUtfDString(NULL, (char *) fileName, -1, ds); + Tcl_ExternalToUtfDString(NULL, (char*) fileName, -1, ds); } return err; } -- cgit v0.12 From 8daba6660a12dce054485bf87cef227741ac76a0 Mon Sep 17 00:00:00 2001 From: das Date: Tue, 22 Jul 2008 17:01:45 +0000 Subject: * library/ttk/aquaTheme.tcl: Use system color names and TIP145 named font instead of hardcoded color values and deprecated native font name. --- ChangeLog | 15 ++++++++++----- library/ttk/aquaTheme.tcl | 34 ++++++++++++++++++---------------- 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8361c09..ab9c4e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-07-22 Daniel Steffen + + * library/ttk/aquaTheme.tcl: Use system color names and TIP145 named + font instead of hardcoded color values and deprecated native font name. + + * macosx/tkMacOSXHLEvents.c: factor out common code; formatting. + 2008-07-08 Pat Thoyts * doc/*.n: Fixed broken line endings from last doc commit. @@ -5,11 +12,9 @@ 2008-07-04 Joe English * generic/ttk/ttkDefaultTheme.c, generic/ttk/ttkClamTheme.c, - generic/ttk/ttkClassicTheme.c, generic/ttk/ttkElements.c: - Audit: ensure that output arguments to Tk_Get*FromObj() - are initialized, in case of erroneous style specifications - [Bug #2009213]. - + generic/ttk/ttkClassicTheme.c, generic/ttk/ttkElements.c: Audit: + ensure that output arguments to Tk_Get*FromObj() are initialized, in + case of erroneous style specifications. [Bug 2009213] 2008-07-02 Donal K. Fellows diff --git a/library/ttk/aquaTheme.tcl b/library/ttk/aquaTheme.tcl index ccb8bd3..85dcb04 100644 --- a/library/ttk/aquaTheme.tcl +++ b/library/ttk/aquaTheme.tcl @@ -1,5 +1,5 @@ # -# $Id: aquaTheme.tcl,v 1.12 2008/05/23 20:20:06 jenglish Exp $ +# $Id: aquaTheme.tcl,v 1.13 2008/07/22 17:01:46 das Exp $ # # Aqua theme (OSX native look and feel) # @@ -8,24 +8,25 @@ namespace eval ttk::theme::aqua { ttk::style theme settings aqua { ttk::style configure . \ - -font System \ - -background White \ - -foreground Black \ - -selectbackground SystemHighlight \ - -selectforeground SystemHighlightText \ + -font TkDefaultFont \ + -background systemWindowBody \ + -foreground systemModelessDialogActiveText \ + -selectbackground systemHighlight \ + -selectforeground systemModelessDialogActiveText \ -selectborderwidth 0 \ - -insertwidth 1 \ - ; + -insertwidth 1 + ttk::style map . \ - -foreground [list disabled "#7f7f7f" background "#7f7f7f"] \ - -selectbackground [list background "#c3c3c3" !focus "#c3c3c3"] \ - -selectforeground [list background "#a3a3a3" !focus "#000000"] \ - ; + -foreground {disabled systemModelessDialogInactiveText + background systemModelessDialogInactiveText} \ + -selectbackground {background systemHighlightSecondary + !focus systemHighlightSecondary} \ + -selectforeground {background systemModelessDialogInactiveText + !focus systemDialogActiveText} # Workaround for #1100117: # Actually, on Aqua we probably shouldn't stipple images in # disabled buttons even if it did work... - # ttk::style configure . -stipple {} ttk::style configure TButton -anchor center -width -6 @@ -40,8 +41,9 @@ namespace eval ttk::theme::aqua { # Treeview: ttk::style configure Heading -font TkHeadingFont ttk::style configure Treeview -rowheight 18 -background White - ttk::style map Treeview -background [list \ - {selected background} "#c3c3c3" selected SystemHighlight] ; + ttk::style map Treeview \ + -background {{selected background} systemHighlightSecondary + selected systemHighlight} # Enable animation for ttk::progressbar widget: ttk::style configure TProgressbar -period 100 -maxphase 255 @@ -50,7 +52,7 @@ namespace eval ttk::theme::aqua { # with a 14 pixel inset and 4 pixels spacing between border and label # (ref: Apple Human Interface Guidelines / Controls / Grouping Controls) # - ttk::style configure TLabelframe \ + ttk::style configure TLabelframe \ -labeloutside true -labelmargins {14 0 14 4} # TODO: panedwindow sashes should be 9 pixels (HIG:Controls:Split Views) -- cgit v0.12 From 535ee80de6d5c048f9a3ae7a5956b114e9a5e3f6 Mon Sep 17 00:00:00 2001 From: nijtmans Date: Wed, 23 Jul 2008 23:24:21 +0000 Subject: fix [2021443] inconsistant "wrong # args" messages (for Tk) --- ChangeLog | 9 +++++ generic/tkBind.c | 6 ++-- generic/tkButton.c | 6 ++-- generic/tkCanvas.c | 16 ++++----- generic/tkClipboard.c | 8 ++--- generic/tkEntry.c | 82 ++++++++++++++++++++++---------------------- generic/tkFont.c | 4 +-- generic/tkFrame.c | 6 ++-- generic/tkGrab.c | 8 ++--- generic/tkGrid.c | 6 ++-- generic/tkImage.c | 4 +-- generic/tkImgBmap.c | 4 +-- generic/tkImgPhoto.c | 14 ++++---- generic/tkListbox.c | 10 +++--- generic/tkMenu.c | 12 +++---- generic/tkMenubutton.c | 6 ++-- generic/tkMessage.c | 6 ++-- generic/tkOldTest.c | 4 +-- generic/tkPanedWindow.c | 4 +-- generic/tkScale.c | 6 ++-- generic/tkScrollbar.c | 6 ++-- generic/tkSelect.c | 12 +++---- generic/tkSquare.c | 4 +-- generic/tkTest.c | 6 ++-- generic/tkText.c | 16 ++++----- generic/tkTextImage.c | 8 ++--- generic/tkTextMark.c | 4 +-- generic/tkTextTag.c | 6 ++-- generic/tkTextWind.c | 8 ++--- generic/ttk/ttkNotebook.c | 10 +++--- generic/ttk/ttkPanedwindow.c | 16 ++++----- generic/ttk/ttkTheme.c | 26 +++++++------- generic/ttk/ttkTreeview.c | 8 ++--- generic/ttk/ttkWidget.c | 4 +-- macosx/tkMacOSXSend.c | 4 +-- macosx/tkMacOSXWm.c | 10 +++--- tests/bind.test | 6 ++-- tests/button.test | 6 ++-- tests/canvRect.test | 4 +-- tests/canvText.test | 4 +-- tests/canvas.test | 4 +-- tests/clipboard.test | 8 ++--- tests/entry.test | 6 ++-- tests/font.test | 4 +-- tests/frame.test | 6 ++-- tests/grab.test | 6 ++-- tests/grid.test | 8 ++--- tests/image.test | 4 +-- tests/imgBmap.test | 4 +-- tests/imgPhoto.test | 12 +++---- tests/listbox.test | 10 +++--- tests/menu.test | 12 +++---- tests/menubut.test | 6 ++-- tests/message.test | 6 ++-- tests/scale.test | 6 ++-- tests/scrollbar.test | 6 ++-- tests/select.test | 16 ++++----- tests/send.test | 6 ++-- tests/spinbox.test | 6 ++-- tests/text.test | 10 +++--- tests/textImage.test | 8 ++--- tests/textMark.test | 6 ++-- tests/textTag.test | 6 ++-- tests/textWind.test | 8 ++--- tests/ttk/ttk.test | 4 +-- tests/unixWm.test | 4 +-- tests/winSend.test | 4 +-- tests/winWm.test | 4 +-- tests/wm.test | 6 ++-- unix/tkUnixSend.c | 4 +-- unix/tkUnixWm.c | 14 ++++---- 71 files changed, 306 insertions(+), 297 deletions(-) diff --git a/ChangeLog b/ChangeLog index ab9c4e1..afcbf80 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-02-24 Jan Nijtmans + + * generic/*.c: fix [2021443] inconsistant "wrong # args" messages + * macosx/tkMacOSXSend.c + * macosx/tkMacOSXWm.c + * unix/tkUnixSend.c + * unix/tkUnixWm.c + * tests/*.test + 2008-07-22 Daniel Steffen * library/ttk/aquaTheme.tcl: Use system color names and TIP145 named diff --git a/generic/tkBind.c b/generic/tkBind.c index c86e1a8..b949e42 100644 --- a/generic/tkBind.c +++ b/generic/tkBind.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkBind.c,v 1.45 2007/12/13 15:24:13 dgp Exp $ + * RCS: @(#) $Id: tkBind.c,v 1.46 2008/07/23 23:24:23 nijtmans Exp $ */ #include "tkInt.h" @@ -2777,7 +2777,7 @@ Tk_EventObjCmd( if (objc < 3) { Tcl_WrongNumArgs(interp, 2, objv, - "virtual ?sequence sequence ...?"); + "virtual ?sequence ...?"); return TCL_ERROR; } name = Tcl_GetString(objv[2]); @@ -2794,7 +2794,7 @@ Tk_EventObjCmd( } case EVENT_GENERATE: if (objc < 4) { - Tcl_WrongNumArgs(interp, 2, objv, "window event ?options?"); + Tcl_WrongNumArgs(interp, 2, objv, "window event ?-option value ...?"); return TCL_ERROR; } return HandleEventGenerate(interp, tkwin, objc - 2, objv + 2); diff --git a/generic/tkButton.c b/generic/tkButton.c index 334a54b..9fbc387 100644 --- a/generic/tkButton.c +++ b/generic/tkButton.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkButton.c,v 1.28 2007/12/13 15:24:13 dgp Exp $ + * RCS: @(#) $Id: tkButton.c,v 1.29 2008/07/23 23:24:21 nijtmans Exp $ */ #include "tkInt.h" @@ -642,7 +642,7 @@ ButtonCreate( } if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?"); + Tcl_WrongNumArgs(interp, 1, objv, "pathName ?-option value ...?"); return TCL_ERROR; } @@ -789,7 +789,7 @@ ButtonWidgetObjCmd( Tcl_Obj *objPtr; if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?"); + Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); return TCL_ERROR; } result = Tcl_GetIndexFromObj(interp, objv[1], commandNames[butPtr->type], diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index 79c7345..e44c6fc 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCanvas.c,v 1.49 2008/05/03 19:53:02 das Exp $ + * RCS: @(#) $Id: tkCanvas.c,v 1.50 2008/07/23 23:24:21 nijtmans Exp $ */ /* #define USE_OLD_TAG_SEARCH 1 */ @@ -388,7 +388,7 @@ Tk_CanvasObjCmd( } if (argc < 2) { - Tcl_WrongNumArgs(interp, 1, argv, "pathName ?options?"); + Tcl_WrongNumArgs(interp, 1, argv, "pathName ?-option value ...?"); return TCL_ERROR; } @@ -564,7 +564,7 @@ CanvasWidgetCmd( }; if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?"); + Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0, @@ -577,7 +577,7 @@ CanvasWidgetCmd( switch ((enum options) index) { case CANV_ADDTAG: if (objc < 4) { - Tcl_WrongNumArgs(interp, 2, objv, "tag searchCommand ?arg arg ...?"); + Tcl_WrongNumArgs(interp, 2, objv, "tag searchCommand ?arg ...?"); result = TCL_ERROR; goto done; } @@ -926,7 +926,7 @@ CanvasWidgetCmd( int length; if (objc < 3) { - Tcl_WrongNumArgs(interp, 2, objv, "type coords ?arg arg ...?"); + Tcl_WrongNumArgs(interp, 2, objv, "type coords ?arg ...?"); result = TCL_ERROR; goto done; } @@ -960,7 +960,7 @@ CanvasWidgetCmd( /* * Allow more specific error return. */ - Tcl_WrongNumArgs(interp, 3, objv, "coords ?arg arg ...?"); + Tcl_WrongNumArgs(interp, 3, objv, "coords ?arg ...?"); result = TCL_ERROR; goto done; } @@ -1158,7 +1158,7 @@ CanvasWidgetCmd( } case CANV_FIND: if (objc < 3) { - Tcl_WrongNumArgs(interp, 2, objv, "searchCommand ?arg arg ...?"); + Tcl_WrongNumArgs(interp, 2, objv, "searchCommand ?arg ...?"); result = TCL_ERROR; goto done; } @@ -1355,7 +1355,7 @@ CanvasWidgetCmd( break; case CANV_ITEMCONFIGURE: if (objc < 3) { - Tcl_WrongNumArgs(interp, 2, objv, "tagOrId ?option value ...?"); + Tcl_WrongNumArgs(interp, 2, objv, "tagOrId ?-option value ...?"); result = TCL_ERROR; goto done; } diff --git a/generic/tkClipboard.c b/generic/tkClipboard.c index c4e6c23..6e0057b 100644 --- a/generic/tkClipboard.c +++ b/generic/tkClipboard.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkClipboard.c,v 1.19 2008/04/27 22:38:55 dkf Exp $ + * RCS: @(#) $Id: tkClipboard.c,v 1.20 2008/07/23 23:24:23 nijtmans Exp $ */ #include "tkInt.h" @@ -430,7 +430,7 @@ Tk_ClipboardObjCmd( int index, i; if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?"); + Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); return TCL_ERROR; } @@ -493,7 +493,7 @@ Tk_ClipboardObjCmd( } } if (objc - i != 1) { - Tcl_WrongNumArgs(interp, 2, objv, "?options? data"); + Tcl_WrongNumArgs(interp, 2, objv, "?-option value ...? data"); return TCL_ERROR; } if (path != NULL) { @@ -587,7 +587,7 @@ Tk_ClipboardObjCmd( selection = Tk_InternAtom(tkwin, "CLIPBOARD"); if (objc - i > 1) { - Tcl_WrongNumArgs(interp, 2, objv, "?options?"); + Tcl_WrongNumArgs(interp, 2, objv, "?-option value ...?"); return TCL_ERROR; } else if (objc - i == 1) { target = Tk_InternAtom(tkwin, Tcl_GetString(objv[i])); diff --git a/generic/tkEntry.c b/generic/tkEntry.c index 25126bc..26249d4 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkEntry.c,v 1.48 2008/04/27 22:38:56 dkf Exp $ + * RCS: @(#) $Id: tkEntry.c,v 1.49 2008/07/23 23:24:23 nijtmans Exp $ */ #include "tkInt.h" @@ -453,7 +453,7 @@ static Tk_ClassProcs entryClass = { EntryWorldChanged, /* worldChangedProc */ }; - + /* *-------------------------------------------------------------- * @@ -484,7 +484,7 @@ Tk_EntryObjCmd( char *tmp; if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?"); + Tcl_WrongNumArgs(interp, 1, objv, "pathName ?-option value ...?"); return TCL_ERROR; } @@ -563,7 +563,7 @@ Tk_EntryObjCmd( Tcl_SetResult(interp, Tk_PathName(entryPtr->tkwin), TCL_STATIC); return TCL_OK; } - + /* *-------------------------------------------------------------- * @@ -594,7 +594,7 @@ EntryWidgetObjCmd( Tcl_Obj *objPtr; if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?"); + Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); return TCL_ERROR; } @@ -987,7 +987,7 @@ EntryWidgetObjCmd( Tcl_Release(entryPtr); return TCL_ERROR; } - + /* *---------------------------------------------------------------------- * @@ -1053,7 +1053,7 @@ DestroyEntry( ckfree((char *) entryPtr); } - + /* *---------------------------------------------------------------------- * @@ -1368,7 +1368,7 @@ ConfigureEntry( return TCL_OK; } } - + /* *--------------------------------------------------------------------------- * @@ -1468,7 +1468,7 @@ EntryWorldChanged( entryPtr->flags |= UPDATE_SCROLLBAR; EventuallyRedraw(entryPtr); } - + #ifndef MAC_OSX_TK /* *-------------------------------------------------------------- @@ -1498,7 +1498,7 @@ TkpDrawEntryBorderAndFocus( { return 0; } - + /* *-------------------------------------------------------------- * @@ -1527,7 +1527,7 @@ TkpDrawSpinboxButtons( return 0; } #endif /* Not MAC_OSX_TK */ - + /* *-------------------------------------------------------------- * @@ -1653,7 +1653,7 @@ DisplayEntry( baseY - fm.ascent - entryPtr->selBorderWidth, (selEndX - selStartX) + 2*entryPtr->selBorderWidth, (fm.ascent + fm.descent) + 2*entryPtr->selBorderWidth, - entryPtr->selBorderWidth, + entryPtr->selBorderWidth, #ifndef MAC_OSX_TK TK_RELIEF_RAISED #else @@ -1846,7 +1846,7 @@ DisplayEntry( #endif /* TK_NO_DOUBLE_BUFFERING */ entryPtr->flags &= ~BORDER_NEEDED; } - + /* *---------------------------------------------------------------------- * @@ -1982,7 +1982,7 @@ EntryComputeGeometry( Tk_GeometryRequest(entryPtr->tkwin, width, height); } - + /* *---------------------------------------------------------------------- * @@ -2082,7 +2082,7 @@ InsertChars( } EntryValueChanged(entryPtr, NULL); } - + /* *---------------------------------------------------------------------- * @@ -2197,7 +2197,7 @@ DeleteChars( } EntryValueChanged(entryPtr, NULL); } - + /* *---------------------------------------------------------------------- * @@ -2253,7 +2253,7 @@ EntryValueChanged( EventuallyRedraw(entryPtr); } } - + /* *---------------------------------------------------------------------- * @@ -2363,7 +2363,7 @@ EntrySetValue( EntryComputeGeometry(entryPtr); EventuallyRedraw(entryPtr); } - + /* *-------------------------------------------------------------- * @@ -2445,7 +2445,7 @@ EntryEventProc( break; } } - + /* *---------------------------------------------------------------------- * @@ -2481,7 +2481,7 @@ EntryCmdDeletedProc( Tk_DestroyWindow(entryPtr->tkwin); } } - + /* *--------------------------------------------------------------------------- * @@ -2601,7 +2601,7 @@ GetEntryIndex( } return TCL_OK; } - + /* *---------------------------------------------------------------------- * @@ -2659,7 +2659,7 @@ EntryScanTo( EventuallyRedraw(entryPtr); } } - + /* *---------------------------------------------------------------------- * @@ -2720,7 +2720,7 @@ EntrySelectTo( entryPtr->selectLast = newLast; EventuallyRedraw(entryPtr); } - + /* *---------------------------------------------------------------------- * @@ -2774,7 +2774,7 @@ EntryFetchSelection( buffer[byteCount] = '\0'; return byteCount; } - + /* *---------------------------------------------------------------------- * @@ -2815,7 +2815,7 @@ EntryLostSelection( EventuallyRedraw(entryPtr); } } - + /* *---------------------------------------------------------------------- * @@ -2854,7 +2854,7 @@ EventuallyRedraw( Tcl_DoWhenIdle(DisplayEntry, entryPtr); } } - + /* *---------------------------------------------------------------------- * @@ -2903,7 +2903,7 @@ EntryVisibleRange( / entryPtr->numChars; } } - + /* *---------------------------------------------------------------------- * @@ -2952,7 +2952,7 @@ EntryUpdateScrollbar( Tcl_SetResult(interp, NULL, TCL_STATIC); Tcl_Release(interp); } - + /* *---------------------------------------------------------------------- * @@ -2993,7 +2993,7 @@ EntryBlinkProc( } EventuallyRedraw(entryPtr); } - + /* *---------------------------------------------------------------------- * @@ -3043,7 +3043,7 @@ EntryFocusProc( } EventuallyRedraw(entryPtr); } - + /* *-------------------------------------------------------------- * @@ -3110,7 +3110,7 @@ EntryTextVarProc( EntrySetValue(entryPtr, value); return NULL; } - + /* *-------------------------------------------------------------- * @@ -3171,7 +3171,7 @@ EntryValidate( Tcl_SetResult(interp, NULL, 0); return (bool ? TCL_OK : TCL_BREAK); } - + /* *-------------------------------------------------------------- * @@ -3308,7 +3308,7 @@ EntryValidateChange( return code; } - + /* *-------------------------------------------------------------- * @@ -3474,7 +3474,7 @@ ExpandPercents( Tcl_DStringSetLength(dsPtr, length + spaceNeeded); } } - + /* *-------------------------------------------------------------- * @@ -3506,7 +3506,7 @@ Tk_SpinboxObjCmd( char *tmp; if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?"); + Tcl_WrongNumArgs(interp, 1, objv, "pathName ?-option value ...?"); return TCL_ERROR; } @@ -3604,7 +3604,7 @@ Tk_SpinboxObjCmd( Tk_DestroyWindow(entryPtr->tkwin); return TCL_ERROR; } - + /* *-------------------------------------------------------------- * @@ -3636,7 +3636,7 @@ SpinboxWidgetObjCmd( Tcl_Obj *objPtr; if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?"); + Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); return TCL_ERROR; } @@ -4105,7 +4105,7 @@ SpinboxWidgetObjCmd( Tcl_Release(entryPtr); return TCL_ERROR; } - + /* *--------------------------------------------------------------------------- * @@ -4144,7 +4144,7 @@ GetSpinboxElement( } return SEL_ENTRY; } - + /* *-------------------------------------------------------------- * @@ -4310,7 +4310,7 @@ SpinboxInvoke( return TCL_OK; } - + /* *---------------------------------------------------------------------- * @@ -4399,7 +4399,7 @@ ComputeFormat( sbPtr->valueFormat = sbPtr->digitFormat; return TCL_OK; } - + /* * Local Variables: * mode: c diff --git a/generic/tkFont.c b/generic/tkFont.c index a168919..9326ddb 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkFont.c,v 1.43 2008/04/27 22:38:56 dkf Exp $ + * RCS: @(#) $Id: tkFont.c,v 1.44 2008/07/23 23:24:23 nijtmans Exp $ */ #include "tkInt.h" @@ -611,7 +611,7 @@ Tk_FontObjCmd( Tcl_HashEntry *namedHashPtr; if (objc < 3) { - Tcl_WrongNumArgs(interp, 2, objv, "fontname ?options?"); + Tcl_WrongNumArgs(interp, 2, objv, "fontname ?-option value ...?"); return TCL_ERROR; } string = Tcl_GetString(objv[2]); diff --git a/generic/tkFrame.c b/generic/tkFrame.c index 1a751ed..1ef67fa 100644 --- a/generic/tkFrame.c +++ b/generic/tkFrame.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkFrame.c,v 1.32 2008/04/27 22:38:56 dkf Exp $ + * RCS: @(#) $Id: tkFrame.c,v 1.33 2008/07/23 23:24:21 nijtmans Exp $ */ #include "default.h" @@ -467,7 +467,7 @@ CreateFrame( Visual *visual; if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?"); + Tcl_WrongNumArgs(interp, 1, objv, "pathName ?-option value ...?"); return TCL_ERROR; } @@ -714,7 +714,7 @@ FrameWidgetObjCmd( Tcl_Obj *objPtr; if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?"); + Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[1], frameOptions, "option", 0, diff --git a/generic/tkGrab.c b/generic/tkGrab.c index 17e5289..5ae15d3 100644 --- a/generic/tkGrab.c +++ b/generic/tkGrab.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkGrab.c,v 1.14 2008/04/27 22:38:56 dkf Exp $ + * RCS: @(#) $Id: tkGrab.c,v 1.15 2008/07/23 23:24:23 nijtmans Exp $ */ #include "tkInt.h" @@ -205,8 +205,8 @@ Tk_GrabObjCmd( /* * Can't use Tcl_WrongNumArgs here because we want the message to * read: - * wrong # args: should be "cmd ?-global window" or "cmd option - * ?arg arg ...?" + * wrong # args: should be "cmd ?-global? window" or "cmd option + * ?arg ...?" * We can fake it with Tcl_WrongNumArgs if we assume the command name * is "grab", but if it has been aliased, the message will be * incorrect. @@ -214,7 +214,7 @@ Tk_GrabObjCmd( Tcl_ResetResult(interp); Tcl_AppendResult(interp, "wrong # args: should be \"", Tcl_GetString(objv[0]), " ?-global? window\" or \"", - Tcl_GetString(objv[0]), " option ?arg arg ...?\"", NULL); + Tcl_GetString(objv[0]), " option ?arg ...?\"", NULL); return TCL_ERROR; } diff --git a/generic/tkGrid.c b/generic/tkGrid.c index 1400030..e11125e 100644 --- a/generic/tkGrid.c +++ b/generic/tkGrid.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkGrid.c,v 1.48 2008/04/27 22:38:56 dkf Exp $ + * RCS: @(#) $Id: tkGrid.c,v 1.49 2008/07/23 23:24:23 nijtmans Exp $ */ #include "tkInt.h" @@ -941,7 +941,7 @@ GridRowColumnConfigureCommand( Tcl_Obj *listCopy; if (((objc % 2 != 0) && (objc > 6)) || (objc < 4)) { - Tcl_WrongNumArgs(interp, 2, objv, "master index ?-option value...?"); + Tcl_WrongNumArgs(interp, 2, objv, "master index ?-option value ...?"); return TCL_ERROR; } @@ -1313,7 +1313,7 @@ GridSlavesCommand( Tcl_Obj *res; if ((objc < 3) || ((objc % 2) == 0)) { - Tcl_WrongNumArgs(interp, 2, objv, "window ?-option value...?"); + Tcl_WrongNumArgs(interp, 2, objv, "window ?-option value ...?"); return TCL_ERROR; } diff --git a/generic/tkImage.c b/generic/tkImage.c index f0f914d..8b389be 100644 --- a/generic/tkImage.c +++ b/generic/tkImage.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkImage.c,v 1.36 2008/04/27 22:38:56 dkf Exp $ + * RCS: @(#) $Id: tkImage.c,v 1.37 2008/07/23 23:24:21 nijtmans Exp $ */ #include "tkInt.h" @@ -191,7 +191,7 @@ Tk_ImageObjCmd( Tcl_Obj **args; int oldimage = 0; if (objc < 3) { - Tcl_WrongNumArgs(interp, 2, objv, "type ?name? ?options?"); + Tcl_WrongNumArgs(interp, 2, objv, "type ?name? ?-option value ...?"); return TCL_ERROR; } diff --git a/generic/tkImgBmap.c b/generic/tkImgBmap.c index 324ccc4..2540e66 100644 --- a/generic/tkImgBmap.c +++ b/generic/tkImgBmap.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkImgBmap.c,v 1.23 2008/04/27 22:38:56 dkf Exp $ + * RCS: @(#) $Id: tkImgBmap.c,v 1.24 2008/07/23 23:24:21 nijtmans Exp $ */ #include "tkInt.h" @@ -750,7 +750,7 @@ ImgBmapCmd( int index; if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?"); + Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[1], bmapOptions, "option", 0, diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 3d7b017..13b3a4c 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -17,7 +17,7 @@ * Department of Computer Science, * Australian National University. * - * RCS: @(#) $Id: tkImgPhoto.c,v 1.77 2008/04/27 22:38:56 dkf Exp $ + * RCS: @(#) $Id: tkImgPhoto.c,v 1.78 2008/07/23 23:24:21 nijtmans Exp $ */ #include "tkInt.h" @@ -667,7 +667,7 @@ ImgPhotoCmd( Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?"); + Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); return TCL_ERROR; } @@ -912,7 +912,7 @@ ImgPhotoCmd( return TCL_ERROR; } if ((options.name != NULL) || (index < objc)) { - Tcl_WrongNumArgs(interp, 2, objv, "?options?"); + Tcl_WrongNumArgs(interp, 2, objv, "?-option value ...?"); return TCL_ERROR; } if ((options.fromX > masterPtr->width) @@ -1056,7 +1056,7 @@ ImgPhotoCmd( return TCL_ERROR; } if ((options.name == NULL) || (index < objc)) { - Tcl_WrongNumArgs(interp, 2, objv, "data ?options?"); + Tcl_WrongNumArgs(interp, 2, objv, "data ?-option value ...?"); return TCL_ERROR; } @@ -1230,7 +1230,7 @@ ImgPhotoCmd( return TCL_ERROR; } if ((options.name == NULL) || (index < objc)) { - Tcl_WrongNumArgs(interp, 2, objv, "fileName ?options?"); + Tcl_WrongNumArgs(interp, 2, objv, "fileName ?-option value ...?"); return TCL_ERROR; } @@ -1367,7 +1367,7 @@ ImgPhotoCmd( }; if (objc < 3) { - Tcl_WrongNumArgs(interp, 2, objv, "option ?arg arg ...?"); + Tcl_WrongNumArgs(interp, 2, objv, "option ?arg ...?"); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[2], photoTransOptions, "option", @@ -1508,7 +1508,7 @@ ImgPhotoCmd( return TCL_ERROR; } if ((options.name == NULL) || (index < objc)) { - Tcl_WrongNumArgs(interp, 2, objv, "fileName ?options?"); + Tcl_WrongNumArgs(interp, 2, objv, "fileName ?-option value ...?"); return TCL_ERROR; } if ((options.fromX > masterPtr->width) diff --git a/generic/tkListbox.c b/generic/tkListbox.c index f3d5c65..5f52f64 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkListbox.c,v 1.44 2007/12/13 15:24:15 dgp Exp $ + * RCS: @(#) $Id: tkListbox.c,v 1.45 2008/07/23 23:24:21 nijtmans Exp $ */ #include "default.h" @@ -470,7 +470,7 @@ Tk_ListboxObjCmd( ListboxOptionTables *optionTables; if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?"); + Tcl_WrongNumArgs(interp, 1, objv, "pathName ?-option value ...?"); return TCL_ERROR; } @@ -602,7 +602,7 @@ ListboxWidgetObjCmd( int result = TCL_OK; if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?"); + Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); return TCL_ERROR; } @@ -843,7 +843,7 @@ ListboxWidgetObjCmd( case COMMAND_INSERT: if (objc < 3) { - Tcl_WrongNumArgs(interp, 2, objv, "index ?element element ...?"); + Tcl_WrongNumArgs(interp, 2, objv, "index ?element ...?"); result = TCL_ERROR; break; } @@ -901,7 +901,7 @@ ListboxWidgetObjCmd( if (objc < 3) { Tcl_WrongNumArgs(interp, 2, objv, - "index ?option? ?value? ?option value ...?"); + "index ?-option? ?value? ?-option value ...?"); result = TCL_ERROR; break; } diff --git a/generic/tkMenu.c b/generic/tkMenu.c index 1f18cc3..650f5d0 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMenu.c,v 1.42 2008/04/27 22:38:56 dkf Exp $ + * RCS: @(#) $Id: tkMenu.c,v 1.43 2008/07/23 23:24:23 nijtmans Exp $ */ /* @@ -459,7 +459,7 @@ MenuCmd( TkMenuOptionTables *optionTablesPtr = clientData; if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?"); + Tcl_WrongNumArgs(interp, 1, objv, "pathName ?-option value ...?"); return TCL_ERROR; } @@ -668,7 +668,7 @@ MenuWidgetObjCmd( int option; if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?"); + Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[1], menuOptions, "option", 0, @@ -700,7 +700,7 @@ MenuWidgetObjCmd( } case MENU_ADD: if (objc < 3) { - Tcl_WrongNumArgs(interp, 2, objv, "type ?options?"); + Tcl_WrongNumArgs(interp, 2, objv, "type ?-option value ...?"); goto error; } @@ -822,7 +822,7 @@ MenuWidgetObjCmd( Tcl_Obj *resultPtr; if (objc < 3) { - Tcl_WrongNumArgs(interp, 2, objv, "index ?option value ...?"); + Tcl_WrongNumArgs(interp, 2, objv, "index ?-option value ...?"); goto error; } if (TkGetMenuIndex(interp, menuPtr, objv[2], 0, &index) != TCL_OK) { @@ -877,7 +877,7 @@ MenuWidgetObjCmd( } case MENU_INSERT: if (objc < 4) { - Tcl_WrongNumArgs(interp, 2, objv, "index type ?options?"); + Tcl_WrongNumArgs(interp, 2, objv, "index type ?-option value ...?"); goto error; } if (MenuAddOrInsert(interp,menuPtr,objv[2],objc-3,objv+3) != TCL_OK) { diff --git a/generic/tkMenubutton.c b/generic/tkMenubutton.c index 2113f8c..2ae03a0 100644 --- a/generic/tkMenubutton.c +++ b/generic/tkMenubutton.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMenubutton.c,v 1.20 2008/04/27 22:38:56 dkf Exp $ + * RCS: @(#) $Id: tkMenubutton.c,v 1.21 2008/07/23 23:24:23 nijtmans Exp $ */ #include "tkInt.h" @@ -212,7 +212,7 @@ Tk_MenubuttonObjCmd( Tk_Window tkwin; if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?"); + Tcl_WrongNumArgs(interp, 1, objv, "pathName ?-option value ...?"); return TCL_ERROR; } @@ -342,7 +342,7 @@ MenuButtonWidgetObjCmd( Tcl_Obj *objPtr; if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?"); + Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); return TCL_ERROR; } result = Tcl_GetIndexFromObj(interp, objv[1], commandNames, "option", 0, diff --git a/generic/tkMessage.c b/generic/tkMessage.c index ff33d48..1db8e5d 100644 --- a/generic/tkMessage.c +++ b/generic/tkMessage.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMessage.c,v 1.20 2008/04/27 22:38:56 dkf Exp $ + * RCS: @(#) $Id: tkMessage.c,v 1.21 2008/07/23 23:24:23 nijtmans Exp $ */ #include "default.h" @@ -224,7 +224,7 @@ Tk_MessageObjCmd( Tk_Window tkwin; if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?"); + Tcl_WrongNumArgs(interp, 1, objv, "pathName ?-option value ...?"); return TCL_ERROR; } @@ -314,7 +314,7 @@ MessageWidgetObjCmd( Tcl_Obj *objPtr; if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?"); + Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); return TCL_ERROR; } diff --git a/generic/tkOldTest.c b/generic/tkOldTest.c index cd7ae5b..9697979 100644 --- a/generic/tkOldTest.c +++ b/generic/tkOldTest.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkOldTest.c,v 1.2 2008/04/27 22:38:56 dkf Exp $ + * RCS: @(#) $Id: tkOldTest.c,v 1.3 2008/07/23 23:24:21 nijtmans Exp $ */ #define USE_OLD_IMAGE @@ -207,7 +207,7 @@ ImageCmd( if (argc < 2) { Tcl_AppendResult(interp, "wrong # args: should be \"", - argv[0], "option ?arg arg ...?", NULL); + argv[0], "option ?arg ...?", NULL); return TCL_ERROR; } if (strcmp(argv[1], "changed") == 0) { diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index cffac53..9d4a4c2 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkPanedWindow.c,v 1.32 2008/05/14 08:29:07 dkf Exp $ + * RCS: @(#) $Id: tkPanedWindow.c,v 1.33 2008/07/23 23:24:21 nijtmans Exp $ */ #include "default.h" @@ -381,7 +381,7 @@ Tk_PanedWindowObjCmd( XSetWindowAttributes atts; if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?"); + Tcl_WrongNumArgs(interp, 1, objv, "pathName ?-option value ...?"); return TCL_ERROR; } diff --git a/generic/tkScale.c b/generic/tkScale.c index cb010c1..2519a8b 100644 --- a/generic/tkScale.c +++ b/generic/tkScale.c @@ -16,7 +16,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkScale.c,v 1.29 2008/04/27 22:38:58 dkf Exp $ + * RCS: @(#) $Id: tkScale.c,v 1.30 2008/07/23 23:24:23 nijtmans Exp $ */ #include "default.h" @@ -211,7 +211,7 @@ Tk_ScaleObjCmd( Tk_Window tkwin; if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?"); + Tcl_WrongNumArgs(interp, 1, objv, "pathName ?-option value ...?"); return TCL_ERROR; } @@ -337,7 +337,7 @@ ScaleWidgetObjCmd( int index, result; if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?"); + Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); return TCL_ERROR; } result = Tcl_GetIndexFromObj(interp, objv[1], commandNames, diff --git a/generic/tkScrollbar.c b/generic/tkScrollbar.c index 359e92c..d736539 100644 --- a/generic/tkScrollbar.c +++ b/generic/tkScrollbar.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkScrollbar.c,v 1.13 2008/04/27 22:38:58 dkf Exp $ + * RCS: @(#) $Id: tkScrollbar.c,v 1.14 2008/07/23 23:24:21 nijtmans Exp $ */ #include "tkInt.h" @@ -134,7 +134,7 @@ Tk_ScrollbarCmd( if (argc < 2) { Tcl_AppendResult(interp, "wrong # args: should be \"", - argv[0], " pathName ?options?\"", NULL); + argv[0], " pathName ?-option value ...?\"", NULL); return TCL_ERROR; } @@ -232,7 +232,7 @@ ScrollbarWidgetCmd( if (argc < 2) { Tcl_AppendResult(interp, "wrong # args: should be \"", - argv[0], " option ?arg arg ...?\"", NULL); + argv[0], " option ?arg ...?\"", NULL); return TCL_ERROR; } Tcl_Preserve(scrollPtr); diff --git a/generic/tkSelect.c b/generic/tkSelect.c index e02478f..7c42e60 100644 --- a/generic/tkSelect.c +++ b/generic/tkSelect.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkSelect.c,v 1.21 2008/04/27 22:38:58 dkf Exp $ + * RCS: @(#) $Id: tkSelect.c,v 1.22 2008/07/23 23:24:21 nijtmans Exp $ */ #include "tkInt.h" @@ -687,7 +687,7 @@ Tk_SelectionObjCmd( }; if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?"); + Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); return TCL_ERROR; } @@ -733,7 +733,7 @@ Tk_SelectionObjCmd( if (count == 1) { path = Tcl_GetString(objs[0]); } else if (count > 1) { - Tcl_WrongNumArgs(interp, 2, objv, "?options?"); + Tcl_WrongNumArgs(interp, 2, objv, "?-option value ...?"); return TCL_ERROR; } if (path != NULL) { @@ -805,7 +805,7 @@ Tk_SelectionObjCmd( selection = XA_PRIMARY; } if (count > 1) { - Tcl_WrongNumArgs(interp, 2, objv, "?options?"); + Tcl_WrongNumArgs(interp, 2, objv, "?-option value ...?"); return TCL_ERROR; } else if (count == 1) { target = Tk_InternAtom(tkwin, Tcl_GetString(objs[0])); @@ -871,7 +871,7 @@ Tk_SelectionObjCmd( } if ((count < 2) || (count > 4)) { - Tcl_WrongNumArgs(interp, 2, objv, "?options? window command"); + Tcl_WrongNumArgs(interp, 2, objv, "?-option value ...? window command"); return TCL_ERROR; } tkwin = Tk_NameToWindow(interp, Tcl_GetString(objs[0]), tkwin); @@ -957,7 +957,7 @@ Tk_SelectionObjCmd( } if (count > 2) { - Tcl_WrongNumArgs(interp, 2, objv, "?options? ?window?"); + Tcl_WrongNumArgs(interp, 2, objv, "?-option value ...? ?window?"); return TCL_ERROR; } if (selName != NULL) { diff --git a/generic/tkSquare.c b/generic/tkSquare.c index 29d9957..9a830f4 100644 --- a/generic/tkSquare.c +++ b/generic/tkSquare.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkSquare.c,v 1.11 2008/04/27 22:38:58 dkf Exp $ + * RCS: @(#) $Id: tkSquare.c,v 1.12 2008/07/23 23:24:21 nijtmans Exp $ */ #if 0 @@ -134,7 +134,7 @@ SquareObjCmd( Tk_OptionTable optionTable; if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?"); + Tcl_WrongNumArgs(interp, 1, objv, "pathName ?-option value ...?"); return TCL_ERROR; } diff --git a/generic/tkTest.c b/generic/tkTest.c index b294022..f4945eb 100644 --- a/generic/tkTest.c +++ b/generic/tkTest.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkTest.c,v 1.36 2008/04/27 22:38:58 dkf Exp $ + * RCS: @(#) $Id: tkTest.c,v 1.37 2008/07/23 23:24:23 nijtmans Exp $ */ #include "tkInt.h" @@ -1107,7 +1107,7 @@ TestobjconfigObjCmd( }; if (objc < 3) { - Tcl_WrongNumArgs(interp, 1, objv, "new name ?options?"); + Tcl_WrongNumArgs(interp, 1, objv, "new name ?-option value ...?"); return TCL_ERROR; } @@ -1565,7 +1565,7 @@ ImageCmd( if (argc < 2) { Tcl_AppendResult(interp, "wrong # args: should be \"", - argv[0], "option ?arg arg ...?", NULL); + argv[0], "option ?arg ...?", NULL); return TCL_ERROR; } if (strcmp(argv[1], "changed") == 0) { diff --git a/generic/tkText.c b/generic/tkText.c index 97ce974..13b3fae 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkText.c,v 1.80 2008/04/27 22:38:58 dkf Exp $ + * RCS: @(#) $Id: tkText.c,v 1.81 2008/07/23 23:24:22 nijtmans Exp $ */ #include "default.h" @@ -446,7 +446,7 @@ Tk_TextObjCmd( Tk_Window tkwin = (Tk_Window) clientData; if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?"); + Tcl_WrongNumArgs(interp, 1, objv, "pathName ?-option value ...?"); return TCL_ERROR; } @@ -700,7 +700,7 @@ TextWidgetObjCmd( }; if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?"); + Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); return TCL_ERROR; } @@ -823,7 +823,7 @@ TextWidgetObjCmd( Tcl_Obj *objPtr = NULL; if (objc < 4) { - Tcl_WrongNumArgs(interp, 2, objv, "?options? index1 index2"); + Tcl_WrongNumArgs(interp, 2, objv, "?-option value ...? index1 index2"); result = TCL_ERROR; goto done; } @@ -1544,7 +1544,7 @@ SharedTextObjCmd( }; if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?"); + Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); return TCL_ERROR; } @@ -1649,7 +1649,7 @@ TextPeerCmd( }; if (objc < 3) { - Tcl_WrongNumArgs(interp, 2, objv, "option ?arg arg ...?"); + Tcl_WrongNumArgs(interp, 2, objv, "option ?arg ...?"); return TCL_ERROR; } @@ -1661,7 +1661,7 @@ TextPeerCmd( switch ((enum peerOptions)index) { case PEER_CREATE: if (objc < 4) { - Tcl_WrongNumArgs(interp, 3, objv, "pathName ?options?"); + Tcl_WrongNumArgs(interp, 3, objv, "pathName ?-option value ...?"); return TCL_ERROR; } return CreateWidget(textPtr->sharedTextPtr, tkwin, interp, textPtr, @@ -4968,7 +4968,7 @@ TextEditCmd( }; if (objc < 3) { - Tcl_WrongNumArgs(interp, 2, objv, "option ?arg arg ...?"); + Tcl_WrongNumArgs(interp, 2, objv, "option ?arg ...?"); return TCL_ERROR; } diff --git a/generic/tkTextImage.c b/generic/tkTextImage.c index e63b909..ce786ed 100644 --- a/generic/tkTextImage.c +++ b/generic/tkTextImage.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkTextImage.c,v 1.22 2007/12/13 15:24:17 dgp Exp $ + * RCS: @(#) $Id: tkTextImage.c,v 1.23 2008/07/23 23:24:23 nijtmans Exp $ */ #include "tkPort.h" @@ -138,7 +138,7 @@ TkTextImageCmd( }; if (objc < 3) { - Tcl_WrongNumArgs(interp, 2, objv, "option ?arg arg ...?"); + Tcl_WrongNumArgs(interp, 2, objv, "option ?arg ...?"); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[2], optionStrings, "option", 0, @@ -173,7 +173,7 @@ TkTextImageCmd( } case CMD_CONF: if (objc < 4) { - Tcl_WrongNumArgs(interp, 3, objv, "index ?option value ...?"); + Tcl_WrongNumArgs(interp, 3, objv, "index ?-option value ...?"); return TCL_ERROR; } if (TkTextGetObjIndex(interp, textPtr, objv[3], &index) != TCL_OK) { @@ -217,7 +217,7 @@ TkTextImageCmd( */ if (objc < 4) { - Tcl_WrongNumArgs(interp, 3, objv, "index ?option value ...?"); + Tcl_WrongNumArgs(interp, 3, objv, "index ?-option value ...?"); return TCL_ERROR; } if (TkTextGetObjIndex(interp, textPtr, objv[3], &index) != TCL_OK) { diff --git a/generic/tkTextMark.c b/generic/tkTextMark.c index e1892b6..b53b755 100644 --- a/generic/tkTextMark.c +++ b/generic/tkTextMark.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkTextMark.c,v 1.20 2007/12/13 15:24:17 dgp Exp $ + * RCS: @(#) $Id: tkTextMark.c,v 1.21 2008/07/23 23:24:23 nijtmans Exp $ */ #include "tkInt.h" @@ -115,7 +115,7 @@ TkTextMarkCmd( }; if (objc < 3) { - Tcl_WrongNumArgs(interp, 2, objv, "option ?arg arg ...?"); + Tcl_WrongNumArgs(interp, 2, objv, "option ?arg ...?"); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[2], markOptionStrings, "mark option", diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index b54ae3f..c1e3e13 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkTextTag.c,v 1.28 2008/04/27 22:38:58 dkf Exp $ + * RCS: @(#) $Id: tkTextTag.c,v 1.29 2008/07/23 23:24:23 nijtmans Exp $ */ #include "default.h" @@ -146,7 +146,7 @@ TkTextTagCmd( TkTextIndex index1, index2; if (objc < 3) { - Tcl_WrongNumArgs(interp, 2, objv, "option ?arg arg ...?"); + Tcl_WrongNumArgs(interp, 2, objv, "option ?arg ...?"); return TCL_ERROR; } @@ -336,7 +336,7 @@ TkTextTagCmd( if (objc < 4) { Tcl_WrongNumArgs(interp, 3, objv, - "tagName ?option? ?value? ?option value ...?"); + "tagName ?-option? ?value? ?-option value ...?"); return TCL_ERROR; } tagPtr = TkTextCreateTag(textPtr, Tcl_GetString(objv[3]), &newTag); diff --git a/generic/tkTextWind.c b/generic/tkTextWind.c index 4f48b18..3f5f88f 100644 --- a/generic/tkTextWind.c +++ b/generic/tkTextWind.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkTextWind.c,v 1.23 2007/12/13 15:24:17 dgp Exp $ + * RCS: @(#) $Id: tkTextWind.c,v 1.24 2008/07/23 23:24:23 nijtmans Exp $ */ #include "tkPort.h" @@ -152,7 +152,7 @@ TkTextWindowCmd( register TkTextSegment *ewPtr; if (objc < 3) { - Tcl_WrongNumArgs(interp, 2, objv, "option ?arg arg ...?"); + Tcl_WrongNumArgs(interp, 2, objv, "option ?arg ...?"); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[2], windOptionStrings, @@ -204,7 +204,7 @@ TkTextWindowCmd( TkTextSegment *ewPtr; if (objc < 4) { - Tcl_WrongNumArgs(interp, 3, objv, "index ?option value ...?"); + Tcl_WrongNumArgs(interp, 3, objv, "index ?-option value ...?"); return TCL_ERROR; } if (TkTextGetObjIndex(interp, textPtr, objv[3], &index) != TCL_OK) { @@ -265,7 +265,7 @@ TkTextWindowCmd( */ if (objc < 4) { - Tcl_WrongNumArgs(interp, 3, objv, "index ?option value ...?"); + Tcl_WrongNumArgs(interp, 3, objv, "index ?-option value ...?"); return TCL_ERROR; } if (TkTextGetObjIndex(interp, textPtr, objv[3], &index) != TCL_OK) { diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index 7b10300..7018219 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -1,4 +1,4 @@ -/* $Id: ttkNotebook.c,v 1.14 2008/04/27 22:41:12 dkf Exp $ +/* $Id: ttkNotebook.c,v 1.15 2008/07/23 23:24:45 nijtmans Exp $ * Copyright (c) 2004, Joe English */ @@ -863,7 +863,7 @@ static int NotebookAddCommand( Tab *tab; if (objc <= 2 || objc % 2 != 1) { - Tcl_WrongNumArgs(interp, 2, objv, "window ?options...?"); + Tcl_WrongNumArgs(interp, 2, objv, "window ?-option value ...?"); return TCL_ERROR; } @@ -890,7 +890,7 @@ static int NotebookAddCommand( return TCL_OK; } -/* $nb insert $index $tab ?options...? +/* $nb insert $index $tab ?-option value ...? * Insert new tab, or move existing one. */ static int NotebookInsertCommand( @@ -902,7 +902,7 @@ static int NotebookInsertCommand( int srcIndex, destIndex; if (objc < 4) { - Tcl_WrongNumArgs(interp, 2,objv, "index slave ?options...?"); + Tcl_WrongNumArgs(interp, 2,objv, "index slave ?-option value ...?"); return TCL_ERROR; } @@ -1370,7 +1370,7 @@ TTK_END_LAYOUT * +++ Initialization. */ -MODULE_SCOPE +MODULE_SCOPE void TtkNotebook_Init(Tcl_Interp *interp) { Ttk_Theme themePtr = Ttk_GetDefaultTheme(interp); diff --git a/generic/ttk/ttkPanedwindow.c b/generic/ttk/ttkPanedwindow.c index bd9457c..9f83741 100644 --- a/generic/ttk/ttkPanedwindow.c +++ b/generic/ttk/ttkPanedwindow.c @@ -1,4 +1,4 @@ -/* $Id: ttkPanedwindow.c,v 1.15 2008/04/27 22:41:12 dkf Exp $ +/* $Id: ttkPanedwindow.c,v 1.16 2008/07/23 23:24:45 nijtmans Exp $ * * Copyright (c) 2005, Joe English. Freely redistributable. * @@ -529,7 +529,7 @@ static int PanedPostConfigure(Tcl_Interp *interp, void *clientData, int mask) * Recalculate sash positions based on requested size. */ Tk_Window tkwin = pw->core.tkwin; - PlaceSashes(pw, + PlaceSashes(pw, pw->paned.width > 0 ? pw->paned.width : Tk_Width(tkwin), pw->paned.height > 0 ? pw->paned.height : Tk_Height(tkwin)); } @@ -636,7 +636,7 @@ static int PanedAddCommand( objc - 3, objv + 3); } -/* $pw insert $index $slave ?options...? +/* $pw insert $index $slave ?-option value ...? * Insert new slave, or move existing one. */ static int PanedInsertCommand( @@ -648,7 +648,7 @@ static int PanedInsertCommand( Tk_Window slaveWindow; if (objc < 4) { - Tcl_WrongNumArgs(interp, 2,objv, "index slave ?options...?"); + Tcl_WrongNumArgs(interp, 2,objv, "index slave ?-option value ...?"); return TCL_ERROR; } @@ -661,7 +661,7 @@ static int PanedInsertCommand( if (!strcmp(Tcl_GetString(objv[2]), "end")) { destIndex = Ttk_NumberSlaves(pw->paned.mgr); } else if (TCL_OK != Ttk_GetSlaveIndexFromObj( - interp,pw->paned.mgr,objv[2],&destIndex)) + interp,pw->paned.mgr,objv[2],&destIndex)) { return TCL_ERROR; } @@ -696,7 +696,7 @@ static int PanedForgetCommand( } if (TCL_OK != Ttk_GetSlaveIndexFromObj( - interp, pw->paned.mgr, objv[2], &paneIndex)) + interp, pw->paned.mgr, objv[2], &paneIndex)) { return TCL_ERROR; } @@ -751,7 +751,7 @@ static int PanedPaneCommand( Pane *pane; if (objc < 3) { - Tcl_WrongNumArgs(interp, 2,objv, "pane ?-option value...?"); + Tcl_WrongNumArgs(interp, 2,objv, "pane ?-option value ...?"); return TCL_ERROR; } @@ -937,7 +937,7 @@ TTK_END_LAYOUT /*------------------------------------------------------------------------ * +++ Registration routine. */ -MODULE_SCOPE +MODULE_SCOPE void TtkPanedwindow_Init(Tcl_Interp *interp) { Ttk_Theme themePtr = Ttk_GetDefaultTheme(interp); diff --git a/generic/ttk/ttkTheme.c b/generic/ttk/ttkTheme.c index 252c082..33e6aab 100644 --- a/generic/ttk/ttkTheme.c +++ b/generic/ttk/ttkTheme.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * $Id: ttkTheme.c,v 1.14 2008/05/27 20:47:20 patthoyts Exp $ + * $Id: ttkTheme.c,v 1.15 2008/07/23 23:24:45 nijtmans Exp $ */ #include @@ -333,7 +333,7 @@ static Theme *NewTheme(Ttk_ResourceCache cache, Ttk_Theme parent) */ entryPtr = Tcl_CreateHashEntry(&themePtr->styleTable, ".", &unused); themePtr->rootStyle = NewStyle(); - themePtr->rootStyle->styleName = + themePtr->rootStyle->styleName = Tcl_GetHashKey(&themePtr->styleTable, entryPtr); themePtr->rootStyle->cache = themePtr->cache; Tcl_SetHashValue(entryPtr, (ClientData)themePtr->rootStyle); @@ -499,7 +499,7 @@ void Ttk_RegisterCleanup( pkgPtr->cleanupList = cleanup; } -/* ThemeChangedProc -- +/* ThemeChangedProc -- * Notify all widgets that the theme has been changed. * Scheduled as an idle callback; clientData is a StylePackageData *. * @@ -508,7 +508,7 @@ void Ttk_RegisterCleanup( * which in turn recreates the layout. * * The Tk C API doesn't doesn't provide an easy way to traverse - * the widget hierarchy, so this is done by evaluating a Tcl script. + * the widget hierarchy, so this is done by evaluating a Tcl script. */ static void ThemeChangedProc(ClientData clientData) @@ -587,7 +587,7 @@ void Ttk_SetThemeEnabledProc( /* * LookupTheme -- - * Retrieve a registered theme by name. If not found, + * Retrieve a registered theme by name. If not found, * returns NULL and leaves an error message in interp's result. */ @@ -867,7 +867,7 @@ static int Ttk_CloneElement( /* Ttk_RegisterElement-- * Register an element in the given theme. * Returns: Element handle if successful, NULL otherwise. - * On failure, leaves an error message in interp's result + * On failure, leaves an error message in interp's result * if interp is non-NULL. */ @@ -915,7 +915,7 @@ Ttk_ElementImpl Ttk_RegisterElement( int Ttk_RegisterElementSpec(Ttk_Theme theme, const char *name, Ttk_ElementSpec *specPtr, void *clientData) { - return Ttk_RegisterElement(NULL, theme, name, specPtr, clientData) + return Ttk_RegisterElement(NULL, theme, name, specPtr, clientData) ? TCL_OK : TCL_ERROR; } @@ -1144,7 +1144,7 @@ static int EnumerateHashTable(Tcl_Interp *interp, Tcl_HashTable *ht) } /* HashTableToDict -- - * Helper routine. Converts a TCL_STRING_KEYS Tcl_HashTable + * Helper routine. Converts a TCL_STRING_KEYS Tcl_HashTable * with Tcl_Obj * entries into a dictionary. */ static Tcl_Obj* HashTableToDict(Tcl_HashTable *ht) @@ -1199,7 +1199,7 @@ usage: return TCL_OK; } else if (objc == 4) { /* style map $styleName -option */ const char *optionName = Tcl_GetString(objv[3]); - Tcl_HashEntry *entryPtr = + Tcl_HashEntry *entryPtr = Tcl_FindHashEntry(&stylePtr->settingsTable, optionName); if (entryPtr) { Tcl_SetObjResult(interp, (Tcl_Obj*)Tcl_GetHashValue(entryPtr)); @@ -1260,7 +1260,7 @@ usage: return TCL_OK; } else if (objc == 4) { /* style default $styleName -option */ const char *optionName = Tcl_GetString(objv[3]); - Tcl_HashEntry *entryPtr = + Tcl_HashEntry *entryPtr = Tcl_FindHashEntry(&stylePtr->defaultsTable, optionName); if (entryPtr) { Tcl_SetObjResult(interp, (Tcl_Obj*)Tcl_GetHashValue(entryPtr)); @@ -1358,7 +1358,7 @@ static int StyleThemeCurrentCmd( } if (name == NULL) { - Tcl_SetObjResult(interp, + Tcl_SetObjResult(interp, Tcl_NewStringObj("error: failed to get theme name", -1)); return TCL_ERROR; } @@ -1382,7 +1382,7 @@ static int StyleThemeCreateCmd( int i; if (objc < 4 || objc % 2 != 0) { - Tcl_WrongNumArgs(interp, 3, objv, "name ?options?"); + Tcl_WrongNumArgs(interp, 3, objv, "name ?-option value ...?"); return TCL_ERROR; } @@ -1485,7 +1485,7 @@ static int StyleElementCreateCmd( FactoryRec *recPtr; if (objc < 5) { - Tcl_WrongNumArgs(interp, 3, objv, "name type ?options...?"); + Tcl_WrongNumArgs(interp, 3, objv, "name type ?-option value ...?"); return TCL_ERROR; } diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index e9ac22a..9284197 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -1,4 +1,4 @@ -/* $Id: ttkTreeview.c,v 1.28 2008/06/12 06:30:22 das Exp $ +/* $Id: ttkTreeview.c,v 1.29 2008/07/23 23:24:45 nijtmans Exp $ * Copyright (c) 2004, Joe English * * ttk::treeview widget implementation. @@ -1511,7 +1511,7 @@ static const char *regionStrings[] = { static TreeRegion IdentifyRegion(Treeview *tv, int x, int y) { int x1 = 0, colno; - + colno = IdentifyDisplayColumn(tv, x, &x1); if (Ttk_BoxContains(tv->tree.headingArea, x, y)) { if (colno < 0) { @@ -2531,7 +2531,7 @@ static int TreeviewSetCommand( * +++ Widget commands -- tree modification. */ -/* + $tv insert $parent $index ?-id id? ?-option value...? +/* + $tv insert $parent $index ?-id id? ?-option value ...? * Insert a new item. */ static int TreeviewInsertCommand( @@ -3306,7 +3306,7 @@ static Ttk_ElementSpec RowElementSpec = { * +++ Initialisation. */ -MODULE_SCOPE +MODULE_SCOPE void TtkTreeview_Init(Tcl_Interp *interp) { Ttk_Theme theme = Ttk_GetDefaultTheme(interp); diff --git a/generic/ttk/ttkWidget.c b/generic/ttk/ttkWidget.c index 43c6086..9362ff6 100644 --- a/generic/ttk/ttkWidget.c +++ b/generic/ttk/ttkWidget.c @@ -1,4 +1,4 @@ -/* $Id: ttkWidget.c,v 1.12 2008/04/27 22:41:12 dkf Exp $ +/* $Id: ttkWidget.c,v 1.13 2008/07/23 23:24:44 nijtmans Exp $ * Copyright (c) 2003, Joe English * * Core widget utilities. @@ -356,7 +356,7 @@ int TtkWidgetConstructorObjCmd( int i; if (objc < 2 || objc % 1 == 1) { - Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?"); + Tcl_WrongNumArgs(interp, 1, objv, "pathName ?-option value ...?"); return TCL_ERROR; } diff --git a/macosx/tkMacOSXSend.c b/macosx/tkMacOSXSend.c index 50526d3..39c6543 100644 --- a/macosx/tkMacOSXSend.c +++ b/macosx/tkMacOSXSend.c @@ -30,7 +30,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXSend.c,v 1.9 2008/04/27 22:39:12 dkf Exp $ + * RCS: @(#) $Id: tkMacOSXSend.c,v 1.10 2008/07/23 23:24:44 nijtmans Exp $ */ #include "tkMacOSXInt.h" @@ -357,7 +357,7 @@ Tk_SendObjCmd( if (objc < (i + 2)) { Tcl_WrongNumArgs(interp, 1, objv, - "?options? interpName arg ?arg ...?"); + "?-option value ...? interpName arg ?arg ...?"); return TCL_ERROR; } diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index d2c4a61..98b4a9a 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXWm.c,v 1.65 2008/05/03 21:12:55 das Exp $ + * RCS: @(#) $Id: tkMacOSXWm.c,v 1.66 2008/07/23 23:24:44 nijtmans Exp $ */ #include "tkMacOSXPrivate.h" @@ -1924,14 +1924,14 @@ WmIconphotoCmd( if (objc < 4) { Tcl_WrongNumArgs(interp, 2, objv, - "window ?-default? image1 ?image2 ...?"); + "window ?-default? image ?image ...?"); return TCL_ERROR; } if (strcmp(Tcl_GetString(objv[3]), "-default") == 0) { isDefault = 1; if (objc == 4) { Tcl_WrongNumArgs(interp, 2, objv, - "window ?-default? image1 ?image2 ...?"); + "window ?-default? image ?image ...?"); return TCL_ERROR; } } @@ -5298,7 +5298,7 @@ TkMacOSXMakeRealWindowExist( /* * Workaround GetWindowStructureWidths() Carbon bug: */ - + strWidths.top = 16; } wmPtr->xInParent = strWidths.left; @@ -6080,7 +6080,7 @@ WmGetWindowGroup( TkDisplay *dispPtr = TkGetDisplayList(); TkWindow *masterWinPtr = (TkWindow *) Tk_IdToWindow(dispPtr->display, wmPtr->master); - + if (masterWinPtr && masterWinPtr->window != None && TkMacOSXHostToplevelExists(masterWinPtr)) { WindowRef masterMacWin = diff --git a/tests/bind.test b/tests/bind.test index 7e0257c..77b8373 100644 --- a/tests/bind.test +++ b/tests/bind.test @@ -7,7 +7,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: bind.test,v 1.19 2007/05/16 15:23:44 dgp Exp $ +# RCS: @(#) $Id: bind.test,v 1.20 2008/07/23 23:24:26 nijtmans Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -1595,7 +1595,7 @@ test bind-17.6 {event command: add with error} { } {1 {bad event type or keysym "xyz"} { abc}} test bind-17.7 {event command: delete} { list [catch {event delete} msg] $msg -} {1 {wrong # args: should be "event delete virtual ?sequence sequence ...?"}} +} {1 {wrong # args: should be "event delete virtual ?sequence ...?"}} test bind-17.8 {event command: delete many} { setup event add <> <3> <1> <2> t @@ -1630,7 +1630,7 @@ test bind-17.13 {event command: info error} { } {1 {wrong # args: should be "event info ?virtual?"}} test bind-17.14 {event command: generate} { list [catch {event generate} msg] $msg -} {1 {wrong # args: should be "event generate window event ?options?"}} +} {1 {wrong # args: should be "event generate window event ?-option value ...?"}} test bind-17.15 {event command: generate} { setup bind .b.f <1> "lappend x 1" diff --git a/tests/button.test b/tests/button.test index 4bc0929..bfa621c 100644 --- a/tests/button.test +++ b/tests/button.test @@ -7,7 +7,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: button.test,v 1.22 2008/07/22 13:17:26 aniap Exp $ +# RCS: @(#) $Id: button.test,v 1.23 2008/07/23 23:24:25 nijtmans Exp $ package require tcltest 2.2 namespace import ::tcltest::* @@ -2673,7 +2673,7 @@ test button-1.270 {configuration options} -body { # ex-tests 3.* test button-2.1 {ButtonCreate - not enough arguments} -body { button -} -returnCodes {error} -result {wrong # args: should be "button pathName ?options?"} +} -returnCodes {error} -result {wrong # args: should be "button pathName ?-option value ...?"} test button-2.2 {ButtonCreate procedure - setting label class} -body { label .x @@ -2758,7 +2758,7 @@ test button-3.1 {ButtonWidgetCmd - too few arguments} -body { .b } -cleanup { destroy .b -} -returnCodes {error} -result {wrong # args: should be ".b option ?arg arg ...?"} +} -returnCodes {error} -result {wrong # args: should be ".b option ?arg ...?"} test button-3.2 {ButtonWidgetCmd - bad option name} -body { button .b .b c diff --git a/tests/canvRect.test b/tests/canvRect.test index 07f3e91..975c71a 100644 --- a/tests/canvRect.test +++ b/tests/canvRect.test @@ -6,7 +6,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: canvRect.test,v 1.8 2004/05/23 17:34:48 dkf Exp $ +# RCS: @(#) $Id: canvRect.test,v 1.9 2008/07/23 23:24:26 nijtmans Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -53,7 +53,7 @@ test canvRect-1.$i {configuration options} { test canvRect-2.1 {CreateRectOval procedure} { list [catch {.c create rect} msg] $msg -} {1 {wrong # args: should be ".c create rect coords ?arg arg ...?"}} +} {1 {wrong # args: should be ".c create rect coords ?arg ...?"}} test canvRect-2.2 {CreateRectOval procedure} { list [catch {.c create oval x y z} msg] $msg } {1 {wrong # coordinates: expected 0 or 4, got 3}} diff --git a/tests/canvText.test b/tests/canvText.test index 1650f62..5367681 100644 --- a/tests/canvText.test +++ b/tests/canvText.test @@ -6,7 +6,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: canvText.test,v 1.16 2006/01/12 13:38:22 dkf Exp $ +# RCS: @(#) $Id: canvText.test,v 1.17 2008/07/23 23:24:25 nijtmans Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -59,7 +59,7 @@ test canvText-1.$i {configuration options} { test canvText-2.1 {CreateText procedure: args} { list [catch {.c create text} msg] $msg -} {1 {wrong # args: should be ".c create text coords ?arg arg ...?"}} +} {1 {wrong # args: should be ".c create text coords ?arg ...?"}} test canvText-2.2 {CreateText procedure: args} { list [catch {.c create text xyz 0} msg] $msg } {1 {bad screen distance "xyz"}} diff --git a/tests/canvas.test b/tests/canvas.test index 489ba27..200fe55 100644 --- a/tests/canvas.test +++ b/tests/canvas.test @@ -6,7 +6,7 @@ # Copyright (c) 1998-2000 Ajuba Solutions. # All rights reserved. # -# RCS: @(#) $Id: canvas.test,v 1.23 2004/12/07 21:22:19 dgp Exp $ +# RCS: @(#) $Id: canvas.test,v 1.24 2008/07/23 23:24:26 nijtmans Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -491,7 +491,7 @@ foreach type {arc bitmap image line oval polygon rect text window} { canvas .c } -body { .c create $type - } -returnCodes error -result [format {wrong # args: should be ".c create %s coords ?arg arg ...?"} $type] + } -returnCodes error -result [format {wrong # args: should be ".c create %s coords ?arg ...?"} $type] incr i test canvas-15.$i "basic coords check: $type coords are paired" -setup { destroy .c diff --git a/tests/clipboard.test b/tests/clipboard.test index bca910b..5248cc9 100644 --- a/tests/clipboard.test +++ b/tests/clipboard.test @@ -6,7 +6,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: clipboard.test,v 1.9 2004/06/24 12:45:42 dkf Exp $ +# RCS: @(#) $Id: clipboard.test,v 1.10 2008/07/23 23:24:25 nijtmans Exp $ # # Note: Multiple display clipboard handling will only be tested if the @@ -181,7 +181,7 @@ test clipboard-6.3 {Tk_ClipboardAppend procedure} { test clipboard-7.1 {Tk_ClipboardCmd procedure} { list [catch {clipboard} msg] $msg -} {1 {wrong # args: should be "clipboard option ?arg arg ...?"}} +} {1 {wrong # args: should be "clipboard option ?arg ...?"}} test clipboard-7.2 {Tk_ClipboardCmd procedure} { clipboard clear list [catch {clipboard append --} msg] $msg \ @@ -197,7 +197,7 @@ test clipboard-7.4 {Tk_ClipboardCmd procedure} { } {1 {bad option "--x": must be -displayof, -format, or -type}} test clipboard-7.5 {Tk_ClipboardCmd procedure} { list [catch {clipboard append -- a b} msg] $msg -} {1 {wrong # args: should be "clipboard append ?options? data"}} +} {1 {wrong # args: should be "clipboard append ?-option value ...? data"}} test clipboard-7.6 {Tk_ClipboardCmd procedure} { clipboard clear list [catch {clipboard append -format} msg] $msg \ @@ -208,7 +208,7 @@ test clipboard-7.7 {Tk_ClipboardCmd procedure} { } {1 {bad option "-displayofoo": must be -displayof, -format, or -type}} test clipboard-7.8 {Tk_ClipboardCmd procedure} { list [catch {clipboard append -type TEST} msg] $msg -} {1 {wrong # args: should be "clipboard append ?options? data"}} +} {1 {wrong # args: should be "clipboard append ?-option value ...? data"}} test clipboard-7.9 {Tk_ClipboardCmd procedure} { list [catch {clipboard append -displayof foo "test"} msg] $msg } {1 {bad window path name "foo"}} diff --git a/tests/entry.test b/tests/entry.test index 83d16a0..51ff390 100644 --- a/tests/entry.test +++ b/tests/entry.test @@ -6,7 +6,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: entry.test,v 1.23 2008/07/22 11:55:57 aniap Exp $ +# RCS: @(#) $Id: entry.test,v 1.24 2008/07/23 23:24:25 nijtmans Exp $ package require tcltest 2.2 namespace import ::tcltest::* @@ -633,7 +633,7 @@ test entry-1.58 {configuration option: "xscrollcommand" for entry} -setup { test entry-2.1 {Tk_EntryCmd procedure} -body { entry -} -returnCodes error -result {wrong # args: should be "entry pathName ?options?"} +} -returnCodes error -result {wrong # args: should be "entry pathName ?-option value ...?"} test entry-2.2 {Tk_EntryCmd procedure} -body { entry gorp } -returnCodes error -result {bad window path name "gorp"} @@ -671,7 +671,7 @@ test entry-3.1 {EntryWidgetCmd procedure} -setup { .e } -cleanup { destroy .e -} -returnCodes error -result {wrong # args: should be ".e option ?arg arg ...?"} +} -returnCodes error -result {wrong # args: should be ".e option ?arg ...?"} test entry-3.2 {EntryWidgetCmd procedure, "bbox" widget command} -setup { entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 pack .e diff --git a/tests/font.test b/tests/font.test index cb06512..b31bf5a 100644 --- a/tests/font.test +++ b/tests/font.test @@ -6,7 +6,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: font.test,v 1.17 2007/12/13 15:27:54 dgp Exp $ +# RCS: @(#) $Id: font.test,v 1.18 2008/07/23 23:24:25 nijtmans Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -153,7 +153,7 @@ test font-4.11 {font command: bad option} { test font-5.1 {font command: configure} { # (objc < 3) list [catch {font configure} msg] $msg -} {1 {wrong # args: should be "font configure fontname ?options?"}} +} {1 {wrong # args: should be "font configure fontname ?-option value ...?"}} test font-5.2 {font command: configure: non-existent font} { # (namedHashPtr == NULL) list [catch {font configure xyz} msg] $msg diff --git a/tests/frame.test b/tests/frame.test index b7f9493..6eaa356 100644 --- a/tests/frame.test +++ b/tests/frame.test @@ -7,7 +7,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: frame.test,v 1.16 2007/05/11 12:36:04 patthoyts Exp $ +# RCS: @(#) $Id: frame.test,v 1.17 2008/07/23 23:24:25 nijtmans Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -259,7 +259,7 @@ foreach test { test frame-3.1 {TkCreateFrame procedure} -body { frame -} -returnCodes error -result {wrong # args: should be "frame pathName ?options?"} +} -returnCodes error -result {wrong # args: should be "frame pathName ?-option value ...?"} test frame-3.2 {TkCreateFrame procedure} -setup { catch {destroy .f} frame .f @@ -499,7 +499,7 @@ catch {destroy .f} frame .f -highlightcolor black test frame-5.1 {FrameWidgetCommand procedure} { list [catch .f msg] $msg -} {1 {wrong # args: should be ".f option ?arg arg ...?"}} +} {1 {wrong # args: should be ".f option ?arg ...?"}} test frame-5.2 {FrameWidgetCommand procedure, cget option} { list [catch {.f cget} msg] $msg } {1 {wrong # args: should be ".f cget option"}} diff --git a/tests/grab.test b/tests/grab.test index d2ee4b2..3baf7a5 100644 --- a/tests/grab.test +++ b/tests/grab.test @@ -7,7 +7,7 @@ # Copyright (c) 1998-2000 by Ajuba Solutions. # All rights reserved. # -# RCS: @(#) $Id: grab.test,v 1.3 2003/04/01 21:06:35 dgp Exp $ +# RCS: @(#) $Id: grab.test,v 1.4 2008/07/23 23:24:24 nijtmans Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -19,13 +19,13 @@ tcltest::loadTestedCommands test grab-1.1 {Tk_GrabObjCmd} { list [catch {grab} msg] $msg -} [list 1 "wrong # args: should be \"grab ?-global? window\" or \"grab option ?arg arg ...?\""] +} [list 1 "wrong # args: should be \"grab ?-global? window\" or \"grab option ?arg ...?\""] test grab-1.2 {Tk_GrabObjCmd} { rename grab grabTest1.2 set res [list [catch {grabTest1.2} msg] $msg] rename grabTest1.2 grab set res -} [list 1 "wrong # args: should be \"grabTest1.2 ?-global? window\" or \"grabTest1.2 option ?arg arg ...?\""] +} [list 1 "wrong # args: should be \"grabTest1.2 ?-global? window\" or \"grabTest1.2 option ?arg ...?\""] test grab-1.3 {Tk_GrabObjCmd, "grab ?-global? window"} { list [catch {grab .foo bar baz} msg] $msg diff --git a/tests/grid.test b/tests/grid.test index d6e3e88..a8b72cc 100644 --- a/tests/grid.test +++ b/tests/grid.test @@ -5,7 +5,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: grid.test,v 1.31 2007/03/09 00:46:17 jenglish Exp $ +# RCS: @(#) $Id: grid.test,v 1.32 2008/07/23 23:24:25 nijtmans Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -511,7 +511,7 @@ test grid-9.2 {slaves} { test grid-9.3 {slaves} { list [catch {grid slaves a b} msg] $msg -} {1 {wrong # args: should be "grid slaves window ?-option value...?"}} +} {1 {wrong # args: should be "grid slaves window ?-option value ...?"}} test grid-9.4 {slaves} { list [catch {grid slaves . a b} msg] $msg @@ -568,12 +568,12 @@ grid_reset 9.11 test grid-10.1 {column/row configure} { list [catch {grid columnconfigure .} msg] $msg -} {1 {wrong # args: should be "grid columnconfigure master index ?-option value...?"}} +} {1 {wrong # args: should be "grid columnconfigure master index ?-option value ...?"}} grid_reset 10.1 test grid-10.2 {column/row configure} { list [catch {grid columnconfigure . 0 -weight 0 -pad} msg] $msg -} {1 {wrong # args: should be "grid columnconfigure master index ?-option value...?"}} +} {1 {wrong # args: should be "grid columnconfigure master index ?-option value ...?"}} grid_reset 10.2 test grid-10.3 {column/row configure} { diff --git a/tests/image.test b/tests/image.test index 01951e3..b6f9ec7 100644 --- a/tests/image.test +++ b/tests/image.test @@ -7,7 +7,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: image.test,v 1.14 2007/05/14 20:58:27 dgp Exp $ +# RCS: @(#) $Id: image.test,v 1.15 2008/07/23 23:24:25 nijtmans Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -26,7 +26,7 @@ test image-1.2 {Tk_ImageCmd procedure, "create" option} { } {1 {bad option "gorp": must be create, delete, height, inuse, names, type, types, or width}} test image-1.3 {Tk_ImageCmd procedure, "create" option} { list [catch {image create} msg] $msg -} {1 {wrong # args: should be "image create type ?name? ?options?"}} +} {1 {wrong # args: should be "image create type ?name? ?-option value ...?"}} test image-1.4 {Tk_ImageCmd procedure, "create" option} { list [catch {image c bad_type} msg] $msg } {1 {image type "bad_type" doesn't exist}} diff --git a/tests/imgBmap.test b/tests/imgBmap.test index 8849f73..ffb8e29 100644 --- a/tests/imgBmap.test +++ b/tests/imgBmap.test @@ -7,7 +7,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: imgBmap.test,v 1.6 2004/05/23 17:34:48 dkf Exp $ +# RCS: @(#) $Id: imgBmap.test,v 1.7 2008/07/23 23:24:25 nijtmans Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -339,7 +339,7 @@ eval image delete [image names] image create bitmap i1 test imageBmap-7.1 {ImgBmapCmd procedure} { list [catch {i1} msg] $msg -} {1 {wrong # args: should be "i1 option ?arg arg ...?"}} +} {1 {wrong # args: should be "i1 option ?arg ...?"}} test imageBmap-7.2 {ImgBmapCmd procedure, "cget" option} { list [catch {i1 cget} msg] $msg } {1 {wrong # args: should be "i1 cget option"}} diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test index 6cfaa4f..d1f64b5 100644 --- a/tests/imgPhoto.test +++ b/tests/imgPhoto.test @@ -9,7 +9,7 @@ # # Author: Paul Mackerras (paulus@cs.anu.edu.au) # -# RCS: @(#) $Id: imgPhoto.test,v 1.29 2008/07/22 14:35:23 dgp Exp $ +# RCS: @(#) $Id: imgPhoto.test,v 1.30 2008/07/23 23:24:25 nijtmans Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -118,7 +118,7 @@ update test imgPhoto-4.1 {ImgPhotoCmd procedure} { list [catch {p1} err] $err -} {1 {wrong # args: should be "p1 option ?arg arg ...?"}} +} {1 {wrong # args: should be "p1 option ?arg ...?"}} test imgPhoto-4.2 {ImgPhotoCmd procedure} { list [catch {p1 blah} err] $err } {1 {bad option "blah": must be blank, cget, configure, copy, data, get, put, read, redither, transparency, or write}} @@ -220,7 +220,7 @@ test imgPhoto-4.25 {ImgPhotoCmd procedure: get option} { } {1 {wrong # args: should be "p1 get x y"}} test imgPhoto-4.26 {ImgPhotoCmd procedure: put option} { list [catch {p1 put} err] $err -} {1 {wrong # args: should be "p1 put data ?options?"}} +} {1 {wrong # args: should be "p1 put data ?-option value ...?"}} test imgPhoto-4.27 {ImgPhotoCmd procedure: put option} { list [catch {p1 put {{white} {white white}}} err] $err } {1 {all elements of color list must have the same number of elements}} @@ -233,7 +233,7 @@ test imgPhoto-4.29 {ImgPhotoCmd procedure: put option} { } {255 255 255} test imgPhoto-4.30 {ImgPhotoCmd procedure: read option} { list [catch {p1 read} err] $err -} {1 {wrong # args: should be "p1 read fileName ?options?"}} +} {1 {wrong # args: should be "p1 read fileName ?-option value ...?"}} test imgPhoto-4.31 {ImgPhotoCmd procedure: read option} hasTeapotPhoto { list [catch {p1 read $teapotPhotoFile -zoom 2} err] $err } {1 {unrecognized option "-zoom": must be -format, -from, -shrink, or -to}} @@ -260,7 +260,7 @@ test imgPhoto-4.37 {ImgPhotoCmd procedure: redither option} { } {1 {wrong # args: should be "p1 redither"}} test imgPhoto-4.38 {ImgPhotoCmd procedure: write option} { list [catch {p1 write} err] $err -} {1 {wrong # args: should be "p1 write fileName ?options?"}} +} {1 {wrong # args: should be "p1 write fileName ?-option value ...?"}} test imgPhoto-4.39 {ImgPhotoCmd procedure: write option} { list [catch {p1 write teapot.tmp -format bogus} err] $err } {1 {image file format "bogus" is unknown}} @@ -268,7 +268,7 @@ eval image delete [image names] image create photo p1 test imgPhoto-4.40 {ImgPhotoCmd procedure: transparency option} { list [catch {p1 transparency} err] $err -} {1 {wrong # args: should be "p1 transparency option ?arg arg ...?"}} +} {1 {wrong # args: should be "p1 transparency option ?arg ...?"}} test imgPhoto-4.41 {ImgPhotoCmd procedure: transparency get option} { list [catch {p1 transparency get} err] $err } {1 {wrong # args: should be "p1 transparency get x y"}} diff --git a/tests/listbox.test b/tests/listbox.test index e291735..92c4fda 100644 --- a/tests/listbox.test +++ b/tests/listbox.test @@ -6,7 +6,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: listbox.test,v 1.29 2008/05/13 13:17:26 patthoyts Exp $ +# RCS: @(#) $Id: listbox.test,v 1.30 2008/07/23 23:24:25 nijtmans Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -115,7 +115,7 @@ foreach test { test listbox-2.1 {Tk_ListboxCmd procedure} { list [catch {listbox} msg] $msg -} {1 {wrong # args: should be "listbox pathName ?options?"}} +} {1 {wrong # args: should be "listbox pathName ?-option value ...?"}} test listbox-2.2 {Tk_ListboxCmd procedure} { list [catch {listbox gorp} msg] $msg } {1 {bad window path name "gorp"}} @@ -142,7 +142,7 @@ pack .l update test listbox-3.1 {ListboxWidgetCmd procedure} { list [catch .l msg] $msg -} {1 {wrong # args: should be ".l option ?arg arg ...?"}} +} {1 {wrong # args: should be ".l option ?arg ...?"}} test listbox-3.2 {ListboxWidgetCmd procedure, "activate" option} { list [catch {.l activate} msg] $msg } {1 {wrong # args: should be ".l activate index"}} @@ -408,7 +408,7 @@ test listbox-3.63 {ListboxWidgetCmd procedure, "index" option} { } 34 test listbox-3.64 {ListboxWidgetCmd procedure, "insert" option} { list [catch {.l insert} msg] $msg -} {1 {wrong # args: should be ".l insert index ?element element ...?"}} +} {1 {wrong # args: should be ".l insert index ?element ...?"}} test listbox-3.65 {ListboxWidgetCmd procedure, "insert" option} { list [catch {.l insert badIndex} msg] $msg } {1 {bad listbox index "badIndex": must be active, anchor, end, @x,y, or a number}} @@ -1978,7 +1978,7 @@ test listbox-23.4 {ConfigureListboxItem, wrong num args} { .l insert end a catch {.l itemco} result set result -} {wrong # args: should be ".l itemconfigure index ?option? ?value? ?option value ...?"} +} {wrong # args: should be ".l itemconfigure index ?-option? ?value? ?-option value ...?"} test listbox-23.5 {ConfigureListboxItem, multiple calls} { catch {destroy .l} listbox .l diff --git a/tests/menu.test b/tests/menu.test index f67fcbe..4a2fccb 100644 --- a/tests/menu.test +++ b/tests/menu.test @@ -5,7 +5,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: menu.test,v 1.20 2006/12/04 15:16:31 dkf Exp $ +# RCS: @(#) $Id: menu.test,v 1.21 2008/07/23 23:24:23 nijtmans Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -17,7 +17,7 @@ testConstraint hasEarthPhoto [file exists $earthPhotoFile] test menu-1.1 {Tk_MenuCmd procedure} { list [catch menu msg] $msg -} {1 {wrong # args: should be "menu pathName ?options?"}} +} {1 {wrong # args: should be "menu pathName ?-option value ...?"}} test menu-1.2 {Tk_MenuCmd procedure} { list [catch "menu bogus" msg] $msg } {1 {bad window path name "bogus"}} @@ -519,7 +519,7 @@ test menu-3.1 {MenuWidgetCmd procedure} { catch {destroy .m1} menu .m1 list [catch {.m1} msg] $msg [destroy .m1] -} {1 {wrong # args: should be ".m1 option ?arg arg ...?"} {}} +} {1 {wrong # args: should be ".m1 option ?arg ...?"} {}} test menu-3.2 {MenuWidgetCmd, Tcl_Preserve and Tcl_Release} {nonUnixUserInteraction } { catch {destroy .m1} menu .m1 -postcommand "destroy .m1" @@ -561,7 +561,7 @@ test menu-3.8 {MenuWidgetCmd procedure, "add" option} { catch {destroy .m1} menu .m1 list [catch {.m1 add} msg] $msg [destroy .m1] -} {1 {wrong # args: should be ".m1 add type ?options?"} {}} +} {1 {wrong # args: should be ".m1 add type ?-option value ...?"} {}} test menu-3.9 {MenuWidgetCmd procedure, "add" option} { catch {destroy .m1} menu .m1 @@ -706,7 +706,7 @@ test menu-3.34 {MenuWidgetCmd procedure, "entryconfigure" option} { catch {destroy .m1} menu .m1 list [catch {.m1 entryconfigure} msg] $msg [destroy .m1] -} {1 {wrong # args: should be ".m1 entryconfigure index ?option value ...?"} {}} +} {1 {wrong # args: should be ".m1 entryconfigure index ?-option value ...?"} {}} test menu-3.35 {MenuWidgetCmd procedure, "entryconfigure" option} { catch {destroy .m1} menu .m1 @@ -751,7 +751,7 @@ test menu-3.42 {MenuWidgetCmd procedure, "insert" option} { catch {destroy .m1} menu .m1 list [catch {.m1 insert} msg] $msg [destroy .m1] -} {1 {wrong # args: should be ".m1 insert index type ?options?"} {}} +} {1 {wrong # args: should be ".m1 insert index type ?-option value ...?"} {}} test menu-3.43 {MenuWidgetCmd procedure, "insert" option} { catch {destroy .m1} menu .m1 diff --git a/tests/menubut.test b/tests/menubut.test index 7f4a210..6613af1 100644 --- a/tests/menubut.test +++ b/tests/menubut.test @@ -6,7 +6,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: menubut.test,v 1.10 2004/06/24 12:45:43 dkf Exp $ +# RCS: @(#) $Id: menubut.test,v 1.11 2008/07/23 23:24:25 nijtmans Exp $ # XXX This test file is woefully incomplete right now. If any part # XXX of a procedure has tests then the whole procedure has tests, @@ -88,7 +88,7 @@ foreach test { test menubutton-2.1 {Tk_MenubuttonCmd procedure} { list [catch {menubutton} msg] $msg -} {1 {wrong # args: should be "menubutton pathName ?options?"}} +} {1 {wrong # args: should be "menubutton pathName ?-option value ...?"}} test menubutton-2.2 {Tk_MenubuttonCmd procedure} { list [catch {menubutton foo} msg] $msg } {1 {bad window path name "foo"}} @@ -107,7 +107,7 @@ menubutton .mb -text "Test Menu" pack .mb test menubutton-3.1 {MenuButtonWidgetCmd procedure} { list [catch {.mb} msg] $msg -} {1 {wrong # args: should be ".mb option ?arg arg ...?"}} +} {1 {wrong # args: should be ".mb option ?arg ...?"}} test menubutton-3.2 {ButtonWidgetCmd procedure, "cget" option} { list [catch {.mb c} msg] $msg } {1 {ambiguous option "c": must be cget or configure}} diff --git a/tests/message.test b/tests/message.test index 40daf6e..c9ad03d 100644 --- a/tests/message.test +++ b/tests/message.test @@ -6,7 +6,7 @@ # Copyright (c) 1998-2000 by Ajuba Solutions. # All rights reserved. # -# RCS: @(#) $Id: message.test,v 1.3 2003/04/01 21:06:46 dgp Exp $ +# RCS: @(#) $Id: message.test,v 1.4 2008/07/23 23:24:25 nijtmans Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -63,7 +63,7 @@ destroy .m test message-2.1 {Tk_MessageObjCmd procedure} { list [catch {message} msg] $msg -} {1 {wrong # args: should be "message pathName ?options?"}} +} {1 {wrong # args: should be "message pathName ?-option value ...?"}} test message-2.2 {Tk_MessageObjCmd procedure} { list [catch {message foo} msg] $msg [winfo child .] } {1 {bad window path name "foo"} {}} @@ -76,7 +76,7 @@ test message-3.1 {MessageWidgetObjCmd procedure} { set result [list [catch {.m} msg] $msg] destroy .m set result -} {1 {wrong # args: should be ".m option ?arg arg ...?"}} +} {1 {wrong # args: should be ".m option ?arg ...?"}} test message-3.2 {MessageWidgetObjCmd procedure, "cget"} { message .m set result [list [catch {.m cget} msg] $msg] diff --git a/tests/scale.test b/tests/scale.test index ffc4101..5a2a26d 100644 --- a/tests/scale.test +++ b/tests/scale.test @@ -6,7 +6,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: scale.test,v 1.15 2004/05/23 17:34:49 dkf Exp $ +# RCS: @(#) $Id: scale.test,v 1.16 2008/07/23 23:24:24 nijtmans Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -90,7 +90,7 @@ destroy .s test scale-2.1 {Tk_ScaleCmd procedure} { list [catch {scale} msg] $msg -} {1 {wrong # args: should be "scale pathName ?options?"}} +} {1 {wrong # args: should be "scale pathName ?-option value ...?"}} test scale-2.2 {Tk_ScaleCmd procedure} { list [catch {scale foo} msg] $msg [winfo child .] } {1 {bad window path name "foo"} {}} @@ -103,7 +103,7 @@ pack .s update idletasks test scale-3.1 {ScaleWidgetCmd procedure} { list [catch {.s} msg] $msg -} {1 {wrong # args: should be ".s option ?arg arg ...?"}} +} {1 {wrong # args: should be ".s option ?arg ...?"}} test scale-3.2 {ScaleWidgetCmd procedure, cget option} { list [catch {.s cget} msg] $msg } {1 {wrong # args: should be ".s cget option"}} diff --git a/tests/scrollbar.test b/tests/scrollbar.test index 9ca586d..5c567c6 100644 --- a/tests/scrollbar.test +++ b/tests/scrollbar.test @@ -7,7 +7,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: scrollbar.test,v 1.20 2007/12/13 15:27:54 dgp Exp $ +# RCS: @(#) $Id: scrollbar.test,v 1.21 2008/07/23 23:24:26 nijtmans Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -101,7 +101,7 @@ foreach test { destroy .s test scrollbar-2.1 {Tk_ScrollbarCmd procedure} -returnCodes error -body { scrollbar -} -result {wrong # args: should be "scrollbar pathName ?options?"} +} -result {wrong # args: should be "scrollbar pathName ?-option value ...?"} test scrollbar-2.2 {Tk_ScrollbarCmd procedure} -body { scrollbar gorp } -returnCodes error -result {bad window path name "gorp"} @@ -129,7 +129,7 @@ pack .s -side right -fill y update test scrollbar-3.1 {ScrollbarWidgetCmd procedure} { list [catch {.s} msg] $msg -} {1 {wrong # args: should be ".s option ?arg arg ...?"}} +} {1 {wrong # args: should be ".s option ?arg ...?"}} test scrollbar-3.2 {ScrollbarWidgetCmd procedure, "cget" option} { list [catch {.s cget} msg] $msg } {1 {wrong # args: should be ".s cget option"}} diff --git a/tests/select.test b/tests/select.test index 1c072da..6c29e9f 100644 --- a/tests/select.test +++ b/tests/select.test @@ -6,7 +6,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: select.test,v 1.16 2005/11/13 21:58:16 dkf Exp $ +# RCS: @(#) $Id: select.test,v 1.17 2008/07/23 23:24:25 nijtmans Exp $ # # Note: Multiple display selection handling will only be tested if the @@ -567,7 +567,7 @@ test select-5.14 {Tk_GetSelection procedure} {unix altDisplay} { test select-6.1 {Tk_SelectionCmd procedure} { list [catch {selection} cmd] $cmd -} {1 {wrong # args: should be "selection option ?arg arg ...?"}} +} {1 {wrong # args: should be "selection option ?arg ...?"}} # selection clear test select-6.2 {Tk_SelectionCmd procedure} { list [catch {selection clear -selection} cmd] $cmd @@ -622,7 +622,7 @@ test select-6.11 {Tk_SelectionCmd procedure} { } {.f1 {}} test select-6.12 {Tk_SelectionCmd procedure} { list [catch {selection clear foo bar} cmd] $cmd -} {1 {wrong # args: should be "selection clear ?options?"}} +} {1 {wrong # args: should be "selection clear ?-option value ...?"}} # selection get test select-6.13 {Tk_SelectionCmd procedure} { list [catch {selection get -selection} cmd] $cmd @@ -666,7 +666,7 @@ test select-6.19 {Tk_SelectionCmd procedure} { } {1 {bad window path name ".f2"}} test select-6.20 {Tk_SelectionCmd procedure} { list [catch {selection get foo bar} cmd] $cmd -} {1 {wrong # args: should be "selection get ?options?"}} +} {1 {wrong # args: should be "selection get ?-option value ...?"}} test select-6.21 {Tk_SelectionCmd procedure} { global selValue selInfo setup @@ -696,13 +696,13 @@ test select-6.25 {Tk_SelectionCmd procedure} { } {1 {bad option "-selectionfoo": must be -format, -selection, or -type}} test select-6.26 {Tk_SelectionCmd procedure} { list [catch {selection handle} cmd] $cmd -} {1 {wrong # args: should be "selection handle ?options? window command"}} +} {1 {wrong # args: should be "selection handle ?-option value ...? window command"}} test select-6.27 {Tk_SelectionCmd procedure} { list [catch {selection handle .} cmd] $cmd -} {1 {wrong # args: should be "selection handle ?options? window command"}} +} {1 {wrong # args: should be "selection handle ?-option value ...? window command"}} test select-6.28 {Tk_SelectionCmd procedure} { list [catch {selection handle . foo bar baz blat} cmd] $cmd -} {1 {wrong # args: should be "selection handle ?options? window command"}} +} {1 {wrong # args: should be "selection handle ?-option value ...? window command"}} test select-6.29 {Tk_SelectionCmd procedure} { catch { destroy .f2 } list [catch {selection handle .f2 dummy} cmd] $cmd @@ -748,7 +748,7 @@ test select-6.37 {Tk_SelectionCmd procedure} { } {1 {bad window path name ".f2"}} test select-6.38 {Tk_SelectionCmd procedure} { list [catch {selection own foo bar baz} cmd] $cmd -} {1 {wrong # args: should be "selection own ?options? ?window?"}} +} {1 {wrong # args: should be "selection own ?-option value ...? ?window?"}} test select-6.39 {Tk_SelectionCmd procedure} { list [catch {selection foo} cmd] $cmd } {1 {bad option "foo": must be clear, get, handle, or own}} diff --git a/tests/send.test b/tests/send.test index bf1690e..0362474 100644 --- a/tests/send.test +++ b/tests/send.test @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: send.test,v 1.11 2004/06/17 22:38:57 dkf Exp $ +# RCS: @(#) $Id: send.test,v 1.12 2008/07/23 23:24:25 nijtmans Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -232,10 +232,10 @@ test send-8.4 {Tk_SendCmd procedure, options} {secureserver} { } {1 {bad option "-gorp": must be -async, -displayof, or --}} test send-8.5 {Tk_SendCmd procedure, options} {secureserver} { list [catch {send -async foo} msg] $msg -} {1 {wrong # args: should be "send ?options? interpName arg ?arg ...?"}} +} {1 {wrong # args: should be "send ?-option value ...? interpName arg ?arg ...?"}} test send-8.6 {Tk_SendCmd procedure, options} {secureserver} { list [catch {send foo} msg] $msg -} {1 {wrong # args: should be "send ?options? interpName arg ?arg ...?"}} +} {1 {wrong # args: should be "send ?-option value ...? interpName arg ?arg ...?"}} test send-8.7 {Tk_SendCmd procedure, local execution} {secureserver} { set a initial send [tk appname] {set a new} diff --git a/tests/spinbox.test b/tests/spinbox.test index 6a7cc2a..5393c4f 100644 --- a/tests/spinbox.test +++ b/tests/spinbox.test @@ -6,7 +6,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: spinbox.test,v 1.10 2008/07/22 11:55:57 aniap Exp $ +# RCS: @(#) $Id: spinbox.test,v 1.11 2008/07/23 23:24:25 nijtmans Exp $ package require tcltest 2.2 namespace import ::tcltest::* @@ -988,7 +988,7 @@ test spinbox-1.85 {configuration option: "xscrollcommand"} -setup { test spinbox-2.1 {Tk_EntryCmd procedure} -body { spinbox -} -returnCodes error -result {wrong # args: should be "spinbox pathName ?options?"} +} -returnCodes error -result {wrong # args: should be "spinbox pathName ?-option value ...?"} test spinbox-2.2 {Tk_EntryCmd procedure} -body { spinbox gorp } -returnCodes error -result {bad window path name "gorp"} @@ -1026,7 +1026,7 @@ test spinbox-3.1 {EntryWidgetCmd procedure} -setup { .e } -cleanup { destroy .e -} -returnCodes error -result {wrong # args: should be ".e option ?arg arg ...?"} +} -returnCodes error -result {wrong # args: should be ".e option ?arg ...?"} test spinbox-3.2 {EntryWidgetCmd procedure, "bbox" widget command} -setup { spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 pack .e diff --git a/tests/text.test b/tests/text.test index c195426..8957454 100644 --- a/tests/text.test +++ b/tests/text.test @@ -6,7 +6,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: text.test,v 1.49 2007/12/13 15:27:54 dgp Exp $ +# RCS: @(#) $Id: text.test,v 1.50 2008/07/23 23:24:25 nijtmans Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -120,7 +120,7 @@ test text-1.[incr i] {text options} { test text-2.1 {Tk_TextCmd procedure} { list [catch {text} msg] $msg -} {1 {wrong # args: should be "text pathName ?options?"}} +} {1 {wrong # args: should be "text pathName ?-option value ...?"}} test text-2.2 {Tk_TextCmd procedure} { list [catch {text foobar} msg] $msg } {1 {bad window path name "foobar"}} @@ -152,7 +152,7 @@ test text-2.6 {Tk_TextCmd procedure} { test text-3.1 {TextWidgetCmd procedure, basics} { list [catch {.t} msg] $msg -} {1 {wrong # args: should be ".t option ?arg arg ...?"}} +} {1 {wrong # args: should be ".t option ?arg ...?"}} test text-3.2 {TextWidgetCmd procedure} { list [catch {.t gorp 1.0 z 1.2} msg] $msg } {1 {bad option "gorp": must be bbox, cget, compare, configure, count, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, peer, replace, scan, search, see, tag, window, xview, or yview}} @@ -548,7 +548,7 @@ test text-9.27 {TextWidgetCmd procedure, "get" option} { .t mark unset c test text-9.2.1 {TextWidgetCmd procedure, "count" option} { list [catch {.t count} msg] $msg -} {1 {wrong # args: should be ".t count ?options? index1 index2"}} +} {1 {wrong # args: should be ".t count ?-option value ...? index1 index2"}} test text-9.2.2.1 {TextWidgetCmd procedure, "count" option} { list [catch {.t count blah 1.0 2.0} msg] $msg } {1 {bad option "blah" must be -chars, -displaychars, -displayindices, -displaylines, -indices, -lines, -update, -xpixels, or -ypixels}} @@ -2963,7 +2963,7 @@ test text-24.1 {bug fix - 1642} { test text-25.1 {TextEditCmd procedure, argument parsing} { list [catch {.t edit} msg] $msg -} {1 {wrong # args: should be ".t edit option ?arg arg ...?"}} +} {1 {wrong # args: should be ".t edit option ?arg ...?"}} test text-25.2 {TextEditCmd procedure, argument parsing} { list [catch {.t edit gorp} msg] $msg } {1 {bad edit option "gorp": must be modified, redo, reset, separator, or undo}} diff --git a/tests/textImage.test b/tests/textImage.test index 8ef5033..d78472a 100644 --- a/tests/textImage.test +++ b/tests/textImage.test @@ -7,7 +7,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: textImage.test,v 1.10 2004/09/10 12:13:43 vincentdarley Exp $ +# RCS: @(#) $Id: textImage.test,v 1.11 2008/07/23 23:24:25 nijtmans Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -25,7 +25,7 @@ test textImage-1.1 {basic argument checking} { text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0 pack .t list [catch {.t image} msg] $msg -} {1 {wrong # args: should be ".t image option ?arg arg ...?"}} +} {1 {wrong # args: should be ".t image option ?arg ...?"}} test textImage-1.2 {basic argument checking} { catch {destroy .t} @@ -60,7 +60,7 @@ test textImage-1.6 {configure argument checking} { text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0 pack .t list [catch {.t image configure } msg] $msg -} {1 {wrong # args: should be ".t image configure index ?option value ...?"}} +} {1 {wrong # args: should be ".t image configure index ?-option value ...?"}} test textImage-1.7 {configure argument checking} { catch {destroy .t} @@ -81,7 +81,7 @@ test textImage-1.9 {create argument checking} { text .t -font test_font -bd 0 -highlightthickness 0 -padx 0 -pady 0 pack .t list [catch {.t image create} msg] $msg -} {1 {wrong # args: should be ".t image create index ?option value ...?"}} +} {1 {wrong # args: should be ".t image create index ?-option value ...?"}} test textImage-1.10 {create argument checking} { catch {destroy .t} diff --git a/tests/textMark.test b/tests/textMark.test index 4cd3ea2..d08b037 100644 --- a/tests/textMark.test +++ b/tests/textMark.test @@ -6,7 +6,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: textMark.test,v 1.9 2004/06/17 22:38:57 dkf Exp $ +# RCS: @(#) $Id: textMark.test,v 1.10 2008/07/23 23:24:24 nijtmans Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -41,7 +41,7 @@ Line 7" test textMark-1.1 {TkTextMarkCmd - missing option} haveCourier12 { list [catch {.t mark} msg] $msg -} {1 {wrong # args: should be ".t mark option ?arg arg ...?"}} +} {1 {wrong # args: should be ".t mark option ?arg ...?"}} test textMark-1.2 {TkTextMarkCmd - bogus option} haveCourier12 { list [catch {.t mark gorp} msg] $msg } {1 {bad mark option "gorp": must be gravity, names, next, previous, set, or unset}} @@ -125,7 +125,7 @@ test textMark-4.3 {TkTextMarkCmd - "unset" option} haveCourier12 { test textMark-5.1 {TkTextMarkCmd - miscellaneous} haveCourier12 { list [catch {.t mark} msg] $msg -} {1 {wrong # args: should be ".t mark option ?arg arg ...?"}} +} {1 {wrong # args: should be ".t mark option ?arg ...?"}} test textMark-5.2 {TkTextMarkCmd - miscellaneous} haveCourier12 { list [catch {.t mark foo} msg] $msg } {1 {bad mark option "foo": must be gravity, names, next, previous, set, or unset}} diff --git a/tests/textTag.test b/tests/textTag.test index ac5101a..fa950fc 100644 --- a/tests/textTag.test +++ b/tests/textTag.test @@ -6,7 +6,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: textTag.test,v 1.12 2004/12/04 00:04:42 dkf Exp $ +# RCS: @(#) $Id: textTag.test,v 1.13 2008/07/23 23:24:26 nijtmans Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -99,7 +99,7 @@ foreach test { } test textTag-2.1 {TkTextTagCmd - "add" option} haveCourier12 { list [catch {.t tag} msg] $msg -} {1 {wrong # args: should be ".t tag option ?arg arg ...?"}} +} {1 {wrong # args: should be ".t tag option ?arg ...?"}} test textTag-2.2 {TkTextTagCmd - "add" option} haveCourier12 { list [catch {.t tag gorp} msg] $msg } {1 {bad tag option "gorp": must be add, bind, cget, configure, delete, lower, names, nextrange, prevrange, raise, ranges, or remove}} @@ -213,7 +213,7 @@ test textTag-4.5 {TkTextTagCmd - "cget" option} haveCourier12 { test textTag-5.1 {TkTextTagCmd - "configure" option} haveCourier12 { list [catch {.t tag configure} msg] $msg -} {1 {wrong # args: should be ".t tag configure tagName ?option? ?value? ?option value ...?"}} +} {1 {wrong # args: should be ".t tag configure tagName ?-option? ?value? ?-option value ...?"}} test textTag-5.2 {TkTextTagCmd - "configure" option} haveCourier12 { list [catch {.t tag configure x -foo} msg] $msg } {1 {unknown option "-foo"}} diff --git a/tests/textWind.test b/tests/textWind.test index b6739c2..a0a0858 100644 --- a/tests/textWind.test +++ b/tests/textWind.test @@ -6,7 +6,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: textWind.test,v 1.22 2006/10/17 10:21:50 patthoyts Exp $ +# RCS: @(#) $Id: textWind.test,v 1.23 2008/07/23 23:24:25 nijtmans Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -108,7 +108,7 @@ frame .f -width 10 -height 6 -bg $color .t window create 1.3 -window .f -padx 1 -pady 2 test textWind-2.1 {TkTextWindowCmd procedure} { list [catch {.t window} msg] $msg -} {1 {wrong # args: should be ".t window option ?arg arg ...?"}} +} {1 {wrong # args: should be ".t window option ?arg ...?"}} test textWind-2.2 {TkTextWindowCmd procedure, "cget" option} { list [catch {.t window cget} msg] $msg } {1 {wrong # args: should be ".t window cget index option"}} @@ -129,7 +129,7 @@ test textWind-2.7 {TkTextWindowCmd procedure, "cget" option} { } {0 2} test textWind-2.8 {TkTextWindowCmd procedure} { list [catch {.t window co} msg] $msg -} {1 {wrong # args: should be ".t window configure index ?option value ...?"}} +} {1 {wrong # args: should be ".t window configure index ?-option value ...?"}} test textWind-2.9 {TkTextWindowCmd procedure} { list [catch {.t window configure gorp} msg] $msg } {1 {bad text index "gorp"}} @@ -167,7 +167,7 @@ test textWind-2.13 {TkTextWindowCmd procedure} { } {{} {-padx {} {} 0 14} {-pady {} {} 0 15}} test textWind-2.14 {TkTextWindowCmd procedure} { list [catch {.t window create} msg] $msg -} {1 {wrong # args: should be ".t window create index ?option value ...?"}} +} {1 {wrong # args: should be ".t window create index ?-option value ...?"}} test textWind-2.15 {TkTextWindowCmd procedure} { list [catch {.t window create gorp} msg] $msg } {1 {bad text index "gorp"}} diff --git a/tests/ttk/ttk.test b/tests/ttk/ttk.test index a1430ff..315aea2 100644 --- a/tests/ttk/ttk.test +++ b/tests/ttk/ttk.test @@ -598,10 +598,10 @@ test ttk-14.3 "-textvariable in nonexistant namespace" -body { test ttk-15.1 "style element create: insufficient args" -body { ttk::style element create -} -returnCodes 1 -result "wrong # args: should be \"ttk::style element create name type ?options...?\"" +} -returnCodes 1 -result "wrong # args: should be \"ttk::style element create name type ?-option value ...?\"" test ttk-15.2 "style element create: insufficient args" -body { ttk::style element create plain.background -} -returnCodes 1 -result "wrong # args: should be \"ttk::style element create name type ?options...?\"" +} -returnCodes 1 -result "wrong # args: should be \"ttk::style element create name type ?-option value ...?\"" test ttk-15.3 "style element create: insufficient args" -body { ttk::style element create plain.background from } -returnCodes 1 -result "wrong # args: should be \"theme ?element?\"" diff --git a/tests/unixWm.test b/tests/unixWm.test index b7e78dc..2c7a781 100644 --- a/tests/unixWm.test +++ b/tests/unixWm.test @@ -7,7 +7,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: unixWm.test,v 1.44 2007/12/13 15:27:55 dgp Exp $ +# RCS: @(#) $Id: unixWm.test,v 1.45 2008/07/23 23:24:25 nijtmans Exp $ package require tcltest 2.2 eval tcltest::configure $argv @@ -2475,7 +2475,7 @@ test unixWm-60.5 {wm attributes - bad attribute} -constraints unix -body { test unixWm-61.1 {Tk_WmCmd procedure, "iconphoto" option} unix { list [catch {wm iconph .} msg] $msg -} {1 {wrong # args: should be "wm iconphoto window ?-default? image1 ?image2 ...?"}} +} {1 {wrong # args: should be "wm iconphoto window ?-default? image ?image ...?"}} test unixWm-61.2 {Tk_WmCmd procedure, "iconphoto" option} unix { destroy .t toplevel .t diff --git a/tests/winSend.test b/tests/winSend.test index 721dd8a..ee3990d 100644 --- a/tests/winSend.test +++ b/tests/winSend.test @@ -7,7 +7,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: winSend.test,v 1.7 2004/12/04 00:04:43 dkf Exp $ +# RCS: @(#) $Id: winSend.test,v 1.8 2008/07/23 23:24:24 nijtmans Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -98,7 +98,7 @@ test winSend-1.6 {Tk_SetAppName - safe interps} winSend { test winSend-2.1 {Tk_SendObjCmd - # of args} winSend { list [catch {send tktest} msg] $msg -} {1 {wrong # args: should be "send ?options? interpName arg ?arg ...?"}} +} {1 {wrong # args: should be "send ?-option value ...? interpName arg ?arg ...?"}} test winSend-2.1a {Tk_SendObjCmd: arguments} winSend { list [catch {send -bogus tktest} msg] $msg } {1 {bad option "-bogus": must be -async, -displayof, or --}} diff --git a/tests/winWm.test b/tests/winWm.test index 0b5592a..13ab984 100644 --- a/tests/winWm.test +++ b/tests/winWm.test @@ -9,7 +9,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: winWm.test,v 1.18 2006/12/01 19:48:00 hobbs Exp $ +# RCS: @(#) $Id: winWm.test,v 1.19 2008/07/23 23:24:24 nijtmans Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -359,7 +359,7 @@ test winWm-7.4 {UpdateWrapper must maintain focus} win { test winWm-8.1 {Tk_WmCmd procedure, "iconphoto" option} win { list [catch {wm iconph .} msg] $msg -} {1 {wrong # args: should be "wm iconphoto window ?-default? image1 ?image2 ...?"}} +} {1 {wrong # args: should be "wm iconphoto window ?-default? image ?image ...?"}} test winWm-8.2 {Tk_WmCmd procedure, "iconphoto" option} win { destroy .t toplevel .t diff --git a/tests/wm.test b/tests/wm.test index a5586bd..f797a43 100644 --- a/tests/wm.test +++ b/tests/wm.test @@ -7,7 +7,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: wm.test,v 1.39 2008/03/20 13:23:20 dkf Exp $ +# RCS: @(#) $Id: wm.test,v 1.40 2008/07/23 23:24:25 nijtmans Exp $ # This file tests window manager interactions that work across platforms. # Window manager tests that only work on a specific platform should be placed @@ -867,14 +867,14 @@ test wm-iconphoto-1.1 {usage} -returnCodes error -body { } -result {wrong # args: should be "wm option window ?arg ...?"} test wm-iconphoto-1.2 {usage} -returnCodes error -body { wm iconphoto . -} -result {wrong # args: should be "wm iconphoto window ?-default? image1 ?image2 ...?"} +} -result {wrong # args: should be "wm iconphoto window ?-default? image ?image ...?"} test wm-iconphoto-1.3 {usage} -returnCodes error -body { wm iconphoto . notanimage } -result {can't use "notanimage" as iconphoto: not a photo image} test wm-iconphoto-1.4 {usage} -returnCodes error -body { # we currently have no return info wm iconphoto . -default -} -result {wrong # args: should be "wm iconphoto window ?-default? image1 ?image2 ...?"} +} -result {wrong # args: should be "wm iconphoto window ?-default? image ?image ...?"} # All other iconphoto tests are platform specific diff --git a/unix/tkUnixSend.c b/unix/tkUnixSend.c index 9a0aacf..8427ee4 100644 --- a/unix/tkUnixSend.c +++ b/unix/tkUnixSend.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixSend.c,v 1.21 2008/04/27 22:39:13 dkf Exp $ + * RCS: @(#) $Id: tkUnixSend.c,v 1.22 2008/07/23 23:24:46 nijtmans Exp $ */ #include "tkUnixInt.h" @@ -931,7 +931,7 @@ Tk_SendCmd( if (argc < (i+2)) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ?options? interpName arg ?arg ...?\"", NULL); + " ?-option value ...? interpName arg ?arg ...?\"", NULL); return TCL_ERROR; } destName = argv[i]; diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c index e4c250c..11da8ac 100644 --- a/unix/tkUnixWm.c +++ b/unix/tkUnixWm.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixWm.c,v 1.59 2008/04/27 22:39:13 dkf Exp $ + * RCS: @(#) $Id: tkUnixWm.c,v 1.60 2008/07/23 23:24:45 nijtmans Exp $ */ #include "tkUnixInt.h" @@ -382,7 +382,7 @@ static int WmDeiconifyCmd(Tk_Window tkwin, TkWindow *winPtr, static int WmFocusmodelCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -static int WmForgetCmd(Tk_Window tkwin, TkWindow *winPtr, +static int WmForgetCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); static int WmFrameCmd(Tk_Window tkwin, TkWindow *winPtr, @@ -418,7 +418,7 @@ static int WmIconpositionCmd(Tk_Window tkwin, TkWindow *winPtr, static int WmIconwindowCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -static int WmManageCmd(Tk_Window tkwin, TkWindow *winPtr, +static int WmManageCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); static int WmMaxsizeCmd(Tk_Window tkwin, TkWindow *winPtr, @@ -987,7 +987,7 @@ TkWmSetClass( * * Tk_WmObjCmd -- * - * This function is invoked to process the "wm" Tcl command. + * This function is invoked to process the "wm" Tcl command. * *---------------------------------------------------------------------- */ @@ -2344,14 +2344,14 @@ WmIconphotoCmd( if (objc < 4) { Tcl_WrongNumArgs(interp, 2, objv, - "window ?-default? image1 ?image2 ...?"); + "window ?-default? image ?image ...?"); return TCL_ERROR; } if (strcmp(Tcl_GetString(objv[3]), "-default") == 0) { isDefault = 1; if (objc == 4) { Tcl_WrongNumArgs(interp, 2, objv, - "window ?-default? image1 ?image2 ...?"); + "window ?-default? image ?image ...?"); return TCL_ERROR; } } @@ -7142,7 +7142,7 @@ TkpWmSetState( *---------------------------------------------------------------------- */ -static void +static void RemapWindows(winPtr, parentPtr) TkWindow *winPtr; TkWindow *parentPtr; -- cgit v0.12 From c65a445e5417d6ff91c27f357f0862f3d229130f Mon Sep 17 00:00:00 2001 From: aniap Date: Fri, 25 Jul 2008 13:40:15 +0000 Subject: Update to tcltest2 --- tests/bind.test | 8284 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 5975 insertions(+), 2309 deletions(-) diff --git a/tests/bind.test b/tests/bind.test index 77b8373..9f0f941 100644 --- a/tests/bind.test +++ b/tests/bind.test @@ -7,2743 +7,6401 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: bind.test,v 1.20 2008/07/23 23:24:26 nijtmans Exp $ +# RCS: @(#) $Id: bind.test,v 1.21 2008/07/25 13:40:15 aniap Exp $ package require tcltest 2.1 eval tcltest::configure $argv tcltest::loadTestedCommands tk useinputmethods 0 -catch {destroy .b} -toplevel .b -width 100 -height 50 -wm geom .b +0+0 +toplevel .t -width 100 -height 50 +wm geom .t +0+0 update idletasks -proc setup {} { - catch {destroy .b.f} - frame .b.f -class Test -width 150 -height 100 - pack .b.f - focus -force .b.f - foreach p [event info] {event delete $p} - update +foreach p [event info] {event delete $p} +foreach event [bind Test] { + bind Test $event {} } -setup - -foreach i [bind Test] { - bind Test $i {} +foreach event [bind all] { + bind all $event {} } -foreach i [bind all] { - bind all $i {} + + +proc unsetBindings {} { + bind all {} + bind Test {} + bind Toplevel {} + bind xyz {} + bind {a b} {} + bind .t {} } -test bind-1.1 {bind command} { - list [catch {bind} msg] $msg -} {1 {wrong # args: should be "bind window ?pattern? ?command?"}} -test bind-1.2 {bind command} { - list [catch {bind a b c d} msg] $msg -} {1 {wrong # args: should be "bind window ?pattern? ?command?"}} -test bind-1.3 {bind command} { - list [catch {bind .gorp} msg] $msg -} {1 {bad window path name ".gorp"}} -test bind-1.4 {bind command} { - list [catch {bind foo} msg] $msg -} {0 {}} -test bind-1.5 {bind command} { - list [catch {bind .b {}} msg] $msg -} {0 {}} -test bind-1.6 {bind command} { - catch {destroy .b.f} - frame .b.f - bind .b.f {test script} - set result [bind .b.f ] - bind .b.f {} - list $result [bind .b.f ] -} {{test script} {}} -test bind-1.7 {bind command} { - catch {destroy .b.f} - frame .b.f - bind .b.f {test script} - bind .b.f {+more text} - bind .b.f -} {test script + +test bind-1.1 {bind command} -body { + bind +} -returnCodes error -result {wrong # args: should be "bind window ?pattern? ?command?"} +test bind-1.2 {bind command} -body { + bind a b c d +} -returnCodes error -result {wrong # args: should be "bind window ?pattern? ?command?"} +test bind-1.3 {bind command} -body { + bind .gorp +} -returnCodes error -result {bad window path name ".gorp"} +test bind-1.4 {bind command} -body { + bind foo +} -returnCodes ok -result {} +test bind-1.5 {bind command} -body { + bind .t {} +} -returnCodes ok -result {} +test bind-1.6 {bind command} -body { + frame .t.f + bind .t.f {test script} + set result [bind .t.f ] + bind .t.f {} + list $result [bind .t.f ] +} -cleanup { + destroy .t.f +} -result {{test script} {}} +test bind-1.7 {bind command} -body { + frame .t.f + bind .t.f {test script} + bind .t.f {+more text} + bind .t.f +} -cleanup { + destroy .t.f +} -result {test script more text} -test bind-1.8 {bind command} { - list [catch {bind .b {test script}} msg] $msg [bind .b] -} {1 {bad event type or keysym "gorp"} {}} -test bind-1.9 {bind command} { - list [catch {bind .b } msg] $msg -} {0 {}} -test bind-1.10 {bind command} { - catch {destroy .b.f} - frame .b.f - bind .b.f {script 1} - bind .b.f {script 2} - bind .b.f a {script for a} - bind .b.f b {script for b} - lsort [bind .b.f] -} { a b} - -test bind-2.1 {bindtags command} { - list [catch {bindtags} msg] $msg -} {1 {wrong # args: should be "bindtags window ?taglist?"}} -test bind-2.2 {bindtags command} { - list [catch {bindtags a b c} msg] $msg -} {1 {wrong # args: should be "bindtags window ?taglist?"}} -test bind-2.3 {bindtags command} { - list [catch {bindtags .foo} msg] $msg -} {1 {bad window path name ".foo"}} -test bind-2.4 {bindtags command} { - bindtags .b -} {.b Toplevel all} -test bind-2.5 {bindtags command} { - catch {destroy .b.f} - frame .b.f - bindtags .b.f -} {.b.f Frame .b all} -test bind-2.6 {bindtags command} { - catch {destroy .b.f} - frame .b.f - bindtags .b.f {{x y z} b c d} - bindtags .b.f -} {{x y z} b c d} -test bind-2.7 {bindtags command} { - catch {destroy .b.f} - frame .b.f - bindtags .b.f {x y z} - bindtags .b.f {} - bindtags .b.f -} {.b.f Frame .b all} -test bind-2.8 {bindtags command} { - catch {destroy .b.f} - frame .b.f - bindtags .b.f {x y z} - bindtags .b.f {a b c d} - bindtags .b.f -} {a b c d} -test bind-2.9 {bindtags command} { - catch {destroy .b.f} - frame .b.f - bindtags .b.f {a b c} - list [catch {bindtags .b.f "\{"} msg] $msg [bindtags .b.f] -} {1 {unmatched open brace in list} {.b.f Frame .b all}} -test bind-2.10 {bindtags command} { - catch {destroy .b.f} - frame .b.f - bindtags .b.f {a b c} - list [catch {bindtags .b.f "a .gorp b"} msg] $msg [bindtags .b.f] -} {0 {} {a .gorp b}} -test bind-3.1 {TkFreeBindingTags procedure} { - catch {destroy .b.f} - frame .b.f - bindtags .b.f "a b c d" - destroy .b.f -} {} -test bind-3.2 {TkFreeBindingTags procedure} { - catch {destroy .b.f} - frame .b.f - catch {bindtags .b.f "a .gorp b .b.f"} - destroy .b.f -} {} - -bind all {lappend x "%W enter all"} -bind Test {lappend x "%W enter frame"} -bind Toplevel {lappend x "%W enter toplevel"} -bind xyz {lappend x "%W enter xyz"} -bind {a b} {lappend x "%W enter {a b}"} -bind .b {lappend x "%W enter .b"} -test bind-4.1 {TkBindEventProc procedure} { - catch {destroy .b.f} - frame .b.f -class Test -width 150 -height 100 - pack .b.f - update - bind .b.f {lappend x "%W enter .b.f"} - set x {} - event gen .b.f - set x -} {{.b.f enter .b.f} {.b.f enter frame} {.b.f enter .b} {.b.f enter all}} -test bind-4.2 {TkBindEventProc procedure} { - catch {destroy .b.f} - frame .b.f -class Test -width 150 -height 100 - pack .b.f - update - bind .b.f {lappend x "%W enter .b.f"} - bindtags .b.f {.b.f {a b} xyz} - set x {} - event gen .b.f - set x -} {{.b.f enter .b.f} {.b.f enter {a b}} {.b.f enter xyz}} -test bind-4.3 {TkBindEventProc procedure} { - set x {} - event gen .b - set x -} {{.b enter .b} {.b enter toplevel} {.b enter all}} -test bind-4.4 {TkBindEventProc procedure} { - catch {destroy .b.f} - frame .b.f -class Test -width 150 -height 100 - pack .b.f - update - bindtags .b.f {.b.f .b.f2 .b.f3} - frame .b.f3 -width 50 -height 50 - pack .b.f3 - bind .b.f {lappend x "%W enter .b.f"} - bind .b.f3 {lappend x "%W enter .b.f3"} - set x {} - event gen .b.f - destroy .b.f3 - set x -} {{.b.f enter .b.f} {.b.f enter .b.f3}} -test bind-4.5 {TkBindEventProc procedure} { +test bind-1.8 {bind command} -body { + bind .t {test script} +} -returnCodes error -result {bad event type or keysym "gorp"} +test bind-1.9 {bind command} -body { + catch {bind .t {test script}} + bind .t +} -result {} +test bind-1.10 {bind command} -body { + bind .t +} -returnCodes ok -result {} +test bind-1.11 {bind command} -body { + frame .t.f + bind .t.f {script 1} + bind .t.f {script 2} + bind .t.f a {script for a} + bind .t.f b {script for b} + lsort [bind .t.f] +} -cleanup { + destroy .t.f +} -result { a b} + +test bind-2.1 {bindtags command} -body { + bindtags +} -returnCodes error -result {wrong # args: should be "bindtags window ?taglist?"} +test bind-2.2 {bindtags command} -body { + bindtags a b c +} -returnCodes error -result {wrong # args: should be "bindtags window ?taglist?"} +test bind-2.3 {bindtags command} -body { + bindtags .foo +} -returnCodes error -result {bad window path name ".foo"} +test bind-2.4 {bindtags command} -body { + bindtags .t +} -result {.t Toplevel all} +test bind-2.5 {bindtags command} -body { + frame .t.f + bindtags .t.f +} -cleanup { + destroy .t.f +} -result {.t.f Frame .t all} +test bind-2.6 {bindtags command} -body { + frame .t.f + bindtags .t.f {{x y z} b c d} + bindtags .t.f +} -cleanup { + destroy .t.f +} -result {{x y z} b c d} +test bind-2.7 {bindtags command} -body { + frame .t.f + bindtags .t.f {x y z} + bindtags .t.f {} + bindtags .t.f +} -cleanup { + destroy .t.f +} -result {.t.f Frame .t all} +test bind-2.8 {bindtags command} -body { + frame .t.f + bindtags .t.f {x y z} + bindtags .t.f {a b c d} + bindtags .t.f +} -cleanup { + destroy .t.f +} -result {a b c d} +test bind-2.9 {bindtags command} -body { + frame .t.f + bindtags .t.f {a b c} + bindtags .t.f "\{" +} -cleanup { + destroy .t.f +} -returnCodes error -result {unmatched open brace in list} +test bind-2.10 {bindtags command} -body { + frame .t.f + bindtags .t.f {a b c} + catch {bindtags .t.f "\{"} + bindtags .t.f +} -cleanup { + destroy .t.f +} -result {.t.f Frame .t all} +test bind-2.11 {bindtags command} -body { + frame .t.f + bindtags .t.f {a b c} + bindtags .t.f "a .gorp b" +} -cleanup { + destroy .t.f +} -returnCodes ok +test bind-2.12 {bindtags command} -body { + frame .t.f + bindtags .t.f {a b c} + catch {bindtags .t.f "a .gorp b"} + bindtags .t.f +} -cleanup { + destroy .t.f +} -result {a .gorp b} + + +test bind-3.1 {TkFreeBindingTags procedure} -body { + frame .t.f + bindtags .t.f "a b c d" + destroy .t.f +} -cleanup { + destroy .t.f +} -result {} +test bind-3.2 {TkFreeBindingTags procedure} -body { + frame .t.f + catch {bindtags .t.f "a .gorp b .t.f"} + destroy .t.f +} -cleanup { + destroy .t.f +} -result {} + + +test bind-4.1 {TkBindEventProc procedure} -setup { + frame .t.f -class Test -width 150 -height 100 + pack .t.f + update + set x {} +} -body { + bind all {lappend x "%W enter all"} + bind Test {lappend x "%W enter frame"} + bind Toplevel {lappend x "%W enter toplevel"} + bind xyz {lappend x "%W enter xyz"} + bind {a b} {lappend x "%W enter {a b}"} + bind .t {lappend x "%W enter .t"} + bind .t.f {lappend x "%W enter .t.f"} + + event gen .t.f + return $x +} -cleanup { + destroy .t.f + unsetBindings +} -result {{.t.f enter .t.f} {.t.f enter frame} {.t.f enter .t} {.t.f enter all}} +test bind-4.2 {TkBindEventProc procedure} -setup { + frame .t.f -class Test -width 150 -height 100 + pack .t.f + update + set x {} +} -body { + bind all {lappend x "%W enter all"} + bind Test {lappend x "%W enter frame"} + bind Toplevel {lappend x "%W enter toplevel"} + bind xyz {lappend x "%W enter xyz"} + bind {a b} {lappend x "%W enter {a b}"} + bind .t {lappend x "%W enter .t"} + bind .t.f {lappend x "%W enter .t.f"} + + bindtags .t.f {.t.f {a b} xyz} + event gen .t.f + return $x +} -cleanup { + destroy .t.f + unsetBindings +} -result {{.t.f enter .t.f} {.t.f enter {a b}} {.t.f enter xyz}} +test bind-4.3 {TkBindEventProc procedure} -body { + set x {} + bind all {lappend x "%W enter all"} + bind Test {lappend x "%W enter frame"} + bind Toplevel {lappend x "%W enter toplevel"} + bind xyz {lappend x "%W enter xyz"} + bind {a b} {lappend x "%W enter {a b}"} + bind .t {lappend x "%W enter .t"} + + event gen .t + return $x +} -cleanup { + unsetBindings +} -result {{.t enter .t} {.t enter toplevel} {.t enter all}} +test bind-4.4 {TkBindEventProc procedure} -setup { + frame .t.f -class Test -width 150 -height 100 + pack .t.f + frame .t.f3 -width 50 -height 50 + pack .t.f3 + update + set x {} +} -body { + bind all {lappend x "%W enter all"} + bind Test {lappend x "%W enter frame"} + bind Toplevel {lappend x "%W enter toplevel"} + bind xyz {lappend x "%W enter xyz"} + bind {a b} {lappend x "%W enter {a b}"} + bind .t {lappend x "%W enter .t"} + + bindtags .t.f {.t.f .t.f2 .t.f3} + bind .t.f {lappend x "%W enter .t.f"} + bind .t.f3 {lappend x "%W enter .t.f3"} + event gen .t.f + return $x +} -cleanup { + destroy .t.f .t.f3 + unsetBindings +} -result {{.t.f enter .t.f} {.t.f enter .t.f3}} +test bind-4.5 {TkBindEventProc procedure} -setup { # This tests memory allocation for objPtr; it won't serve any useful # purpose unless run with some sort of allocation checker turned on. - catch {destroy .b.f} - frame .b.f -class Test -width 150 -height 100 - pack .b.f - update - bindtags .b.f {a b c d e f g h i j k l m n o p q r s t u v w x y z} - event gen .b.f -} {} -bind all {} -bind Test {} -bind Toplevel {} -bind xyz {} -bind {a b} {} -bind .b {} - -test bind-5.1 {Tk_CreateBindingTable procedure} { - catch {destroy .b.c} - canvas .b.c - .b.c bind foo -} {} - -test bind-6.1 {Tk_DeleteBindTable procedure} { - catch {destroy .b.c} - canvas .b.c - .b.c bind foo <1> {string 1} - .b.c create rectangle 0 0 100 100 - .b.c bind 1 <2> {string 2} - destroy .b.c -} {} -test bind-6.2 {Tk_DeleteBindTable procedure: pending bindings deleted later} testcbind { + frame .t.f -class Test -width 150 -height 100 + pack .t.f + update +} -body { + bind all {lappend x "%W enter all"} + bind Test {lappend x "%W enter frame"} + bind Toplevel {lappend x "%W enter toplevel"} + bind xyz {lappend x "%W enter xyz"} + bind {a b} {lappend x "%W enter {a b}"} + bind .t {lappend x "%W enter .t"} + bindtags .t.f {a b c d e f g h i j k l m n o p q r s t u v w x y z} + + event gen .t.f +} -cleanup { + destroy .t.f + unsetBindings +} -result {} + + +test bind-5.1 {Tk_CreateBindingTable procedure} -body { + canvas .t.c + .t.c bind foo +} -cleanup { + destroy .t.c +} -result {} + + +test bind-6.1 {Tk_DeleteBindTable procedure} -body { + canvas .t.c + .t.c bind foo <1> {string 1} + .t.c create rectangle 0 0 100 100 + .t.c bind 1 <2> {string 2} + destroy .t.c +} -cleanup { + destroy .t.c +} -result {} +test bind-6.2 {Tk_DeleteBindTable procedure: pending bindings deleted later} -constraints { + testcbind +} -body { catch {interp delete foo} interp create foo foo eval { - load {} Tk - tk useinputmethods 0 - load {} Tktest - wm geometry . +0+0 - frame .t -width 50 -height 50 - bindtags .t {a b c d} - pack .t - update - set x {} - testcbind a <1> "lappend x a1; destroy ." "lappend x bye.a1" - bind b <1> "lappend x b1" - testcbind c <1> "lappend x c1" "lappend x bye.c1" - testcbind c <2> "lappend x all2" "lappend x bye.all2" - event gen .t <1> + load {} Tk + tk useinputmethods 0 + load {} Tktest + wm geometry . +0+0 + frame .g -width 50 -height 50 + bindtags .g {a b c d} + pack .g + update + set x {} + testcbind a <1> "lappend x a1; destroy ." "lappend x bye.a1" + bind b <1> "lappend x b1" + testcbind c <1> "lappend x c1" "lappend x bye.c1" + testcbind c <2> "lappend x all2" "lappend x bye.all2" + event gen .g <1> } set x [foo eval set x] + return $x +} -cleanup { interp delete foo - set x -} {a1 bye.all2 bye.a1 b1 bye.c1} - -test bind-7.1 {Tk_CreateBinding procedure: bad binding} { - catch {destroy .b.c} - canvas .b.c - list [catch {.b.c bind foo <} msg] $msg -} {1 {no event type or button # or keysym}} -test bind-7.2 {Tk_CreateBinding procedure: replace existing C binding} testcbind { - catch {destroy .b.f} - frame .b.f - testcbind .b.f <1> "xyz" "lappend x bye.1" - set x {} - bind .b.f <1> "abc" - destroy .b.f - set x -} {bye.1} -test bind-7.3 {Tk_CreateBinding procedure: append} { - catch {destroy .b.c} - canvas .b.c - .b.c bind foo <1> "button 1" - .b.c bind foo <1> "+more button 1" - .b.c bind foo <1> -} {button 1 + bind a <1> {} + bind b <1> {} + bind c <1> {} + bind c <2> {} + destroy .g +} -result {a1 bye.all2 bye.a1 b1 bye.c1} + +test bind-7.1 {Tk_CreateBinding procedure: bad binding} -body { + canvas .t.c + .t.c bind foo < +} -cleanup { + destroy .t.c +} -returnCodes error -result {no event type or button # or keysym} +test bind-7.2 {Tk_CreateBinding procedure: replace existing C binding} -constraints { + testcbind +} -body { + frame .t.f + set x {} + testcbind .t.f <1> "xyz" "lappend x bye.1" + bind .t.f <1> "abc" + return $x +} -cleanup { + destroy .t.f +} -result {bye.1} +test bind-7.3 {Tk_CreateBinding procedure: append} -body { + canvas .t.c + .t.c bind foo <1> "button 1" + .t.c bind foo <1> "+more button 1" + .t.c bind foo <1> +} -cleanup { + destroy .t.c +} -result {button 1 more button 1} -test bind-7.4 {Tk_CreateBinding procedure: append to non-existing} { - catch {destroy .b.c} - canvas .b.c - .b.c bind foo <1> "+button 1" - .b.c bind foo <1> -} {button 1} - -test bind-8.1 {TkCreateBindingProcedure: error} testcbind { - list [catch {testcbind . "xyz"} msg] $msg -} {1 {bad event type or keysym "xyz"}} -test bind-8.2 {TkCreateBindingProcedure: new binding} testcbind { - catch {destroy .b.f} - frame .b.f - testcbind .b.f <1> "lappend x 1" "lappend x bye.1" - set x {} - event gen .b.f <1> - destroy .b.f - set x -} {bye.1} -test bind-8.3 {TkCreateBindingProcedure: replace existing} testcbind { - catch {destroy .b.f} - frame .b.f - pack .b.f - set x {} - testcbind .b.f <1> "lappend x old1" "lappend x bye.old1" - testcbind .b.f <1> "lappend x new1" "lappend x bye.new1" - set x -} {bye.old1} -test bind-8.4 {TkCreateBindingProcedure: replace existing while pending} testcbind { - catch {destroy .b.f} - frame .b.f - pack .b.f - update - testcbind .b.f <1> "lappend x .b.f; testcbind Frame <1> {lappend x Frame}" - testcbind Frame <1> "lappend x never" +test bind-7.4 {Tk_CreateBinding procedure: append to non-existing} -body { + canvas .t.c + .t.c bind foo <1> "+button 1" + .t.c bind foo <1> +} -cleanup { + destroy .t.c +} -result {button 1} + +test bind-8.1 {TkCreateBindingProcedure: error} -constraints { + testcbind +} -body { + testcbind . "xyz" +} -returnCodes error -result {bad event type or keysym "xyz"} +test bind-8.2 {TkCreateBindingProcedure: new binding} -constraints { + testcbind +} -setup { + frame .t.f set x {} - event gen .b.f <1> - bind .b.f <1> {} - set x -} {.b.f Frame} +} -body { + testcbind .t.f <1> "lappend x 1" "lappend x bye.1" + event gen .t.f <1> + destroy .t.f + return $x +} -result {bye.1} +test bind-8.3 {TkCreateBindingProcedure: replace existing} -constraints { + testcbind +} -setup { + frame .t.f + pack .t.f + set x {} +} -body { + testcbind .t.f <1> "lappend x old1" "lappend x bye.old1" + testcbind .t.f <1> "lappend x new1" "lappend x bye.new1" + return $x +} -cleanup { + destroy .t.f +} -result {bye.old1} +test bind-8.4 {TkCreateBindingProcedure: replace existing while pending} -constraints { + testcbind +} -setup { + frame .t.f + pack .t.f + update + set x {} +} -body { + testcbind .t.f <1> "lappend x .t.f; testcbind Frame <1> {lappend x Frame}" + testcbind Frame <1> "lappend x never" + event gen .t.f <1> + bind .t.f <1> {} + return $x +} -cleanup { + destroy .t.f + bind Frame <1> {} +} -result {.t.f Frame} -test bind-9.1 {Tk_DeleteBinding procedure} { - catch {destroy .b.f} - frame .b.f -class Test -width 150 -height 100 - list [catch {bind .b.f <} msg] $msg -} {0 {}} -test bind-9.2 {Tk_DeleteBinding procedure} { - catch {destroy .b.f} - frame .b.f -class Test -width 150 -height 100 +test bind-9.1 {Tk_DeleteBinding procedure} -body { + frame .t.f -class Test -width 150 -height 100 + bind .t.f < +} -cleanup { + destroy .t.f +} -returnCodes ok +test bind-9.2 {Tk_DeleteBinding procedure} -setup { + set result {} +} -body { + frame .t.f -class Test -width 150 -height 100 foreach i {a b c d} { - bind .b.f $i "binding for $i" + bind .t.f $i "binding for $i" } - set result {} foreach i {b d a c} { - bind .b.f $i {} - lappend result [lsort [bind .b.f]] + bind .t.f $i {} + lappend result [lsort [bind .t.f]] } - set result -} {{a c d} {a c} c {}} -test bind-9.3 {Tk_DeleteBinding procedure} { - catch {destroy .b.f} - frame .b.f -class Test -width 150 -height 100 + return $result +} -cleanup { + destroy .t.f +} -result {{a c d} {a c} c {}} +test bind-9.3 {Tk_DeleteBinding procedure} -setup { + set result {} +} -body { + frame .t.f -class Test -width 150 -height 100 foreach i {<1> } { - bind .b.f $i "binding for $i" + bind .t.f $i "binding for $i" } - set result {} foreach i { <1> } { - bind .b.f $i {} - lappend result [lsort [bind .b.f]] + bind .t.f $i {} + lappend result [lsort [bind .t.f]] } - set result -} {{ } { } {}} -test bind-9.4 {Tk_DeleteBinding procedure: pending bindings delete later} testcbind { - catch {destroy .b.f} - frame .b.f - pack .b.f - update - bindtags .b.f {a b c} + return $result +} -cleanup { + destroy .t.f +} -result {{ } { } {}} +test bind-9.4 {Tk_DeleteBinding procedure: pending bindings delete later} -constraints { + testcbind +} -setup { + frame .t.f + pack .t.f + update + set x {} +} -body { + bindtags .t.f {a b c} testcbind a <1> {lappend x a1; bind c <1> {}; bind c <2> {}} {lappend x bye.a1} bind b <1> {lappend x b1} testcbind c <1> {lappend x c1} {lappend x bye.c1} testcbind c <2> {lappend x c2} {lappend x bye.c2} - set x {} - event gen .b.f <1> + event gen .t.f <1> bind a <1> {} bind b <1> {} - set x -} {a1 bye.c2 b1 bye.c1 bye.a1} - -test bind-10.1 {Tk_GetBinding procedure} { - catch {destroy .b.c} - canvas .b.c - list [catch {.b.c bind foo <} msg] $msg -} {1 {no event type or button # or keysym}} -test bind-10.2 {Tk_GetBinding procedure} { - catch {destroy .b.c} - canvas .b.c - .b.c bind foo a Test - .b.c bind foo a -} {Test} -test bind-10.3 {Tk_GetBinding procedure: C binding} testcbind { - catch {destroy .b.f} - frame .b.f - testcbind .b.f <1> "foo" - list [bind .b.f] [bind .b.f <1>] -} { {}} - -test bind-11.1 {Tk_GetAllBindings procedure} { - catch {destroy .b.f} - frame .b.f -class Test -width 150 -height 100 + return $x +} -cleanup { + destroy .t.f + bind c <1> {} + bind c <2> {} +} -result {a1 bye.c2 b1 bye.c1 bye.a1} + +test bind-10.1 {Tk_GetBinding procedure} -body { + canvas .t.c + .t.c bind foo < +} -cleanup { + destroy .t.c +} -returnCodes error -result {no event type or button # or keysym} +test bind-10.2 {Tk_GetBinding procedure} -body { + canvas .t.c + .t.c bind foo a Test + .t.c bind foo a +} -cleanup { + destroy .t.c +} -result {Test} +test bind-10.3 {Tk_GetBinding procedure: C binding} -constraints { + testcbind +} -body { + frame .t.f + testcbind .t.f <1> "foo" + list [bind .t.f] [bind .t.f <1>] +} -cleanup { + destroy .t.f +} -result { {}} + + +test bind-11.1 {Tk_GetAllBindings procedure} -body { + frame .t.f foreach i "! a \\\{ ~ <> " { - bind .b.f $i Test + bind .t.f $i Test } - lsort [bind .b.f] -} {! <> a \{ ~} -test bind-11.2 {Tk_GetAllBindings procedure} { - catch {destroy .b.f} - frame .b.f -class Test -width 150 -height 100 + lsort [bind .t.f] +} -cleanup { + destroy .t.f +} -result {! <> a \{ ~} +test bind-11.2 {Tk_GetAllBindings procedure} -body { + frame .t.f foreach i " <1>" { - bind .b.f $i Test + bind .t.f $i Test } - lsort [bind .b.f] -} { } -test bind-11.3 {Tk_GetAllBindings procedure} { - catch {destroy .b.f} - frame .b.f -class Test -width 150 -height 100 + lsort [bind .t.f] +} -cleanup { + destroy .t.f +} -result { } +test bind-11.3 {Tk_GetAllBindings procedure} -body { + frame .t.f foreach i " abcd ab" { - bind .b.f $i Test + bind .t.f $i Test } - lsort [bind .b.f] -} { ab abcd} - - -test bind-12.1 {Tk_DeleteAllBindings procedure} { - catch {destroy .b.f} - frame .b.f -class Test -width 150 -height 100 - destroy .b.f -} {} -test bind-12.2 {Tk_DeleteAllBindings procedure} { - catch {destroy .b.f} - frame .b.f -class Test -width 150 -height 100 + lsort [bind .t.f] +} -cleanup { + destroy .t.f +} -result { ab abcd} + + +test bind-12.1 {Tk_DeleteAllBindings procedure} -body { + frame .t.f -class Test -width 150 -height 100 + destroy .t.f +} -result {} +test bind-12.2 {Tk_DeleteAllBindings procedure} -body { + frame .t.f -class Test -width 150 -height 100 foreach i "a b c " { - bind .b.f $i x + bind .t.f $i x } - destroy .b.f -} {} -test bind-12.3 {Tk_DeleteAllBindings procedure: pending bindings deleted later} testcbind { - catch {destroy .b.f} - frame .b.f - pack .b.f + destroy .t.f +} -result {} +test bind-12.3 {Tk_DeleteAllBindings procedure: pending bindings deleted later} -constraints { + testcbind +} -setup { + frame .t.f + pack .t.f update - testcbind .b.f <1> {lappend x before; event gen .b.f <2>; lappend x after} {lappend x bye.f1} - testcbind .b.f <2> {destroy .b.f} {lappend x bye.f2} - bind .b.f {lappend x fDestroy} - testcbind .b.f <3> {foo} {lappend x bye.f3} set x {} - event gen .b.f <1> - set x -} {before fDestroy bye.f3 bye.f2 after bye.f1} - -bind Test {lappend x "%W %K Test press any"} -bind all {lappend x "%W %K all press any"} -bind Test a {lappend x "%W %K Test press a"} -bind all x {lappend x "%W %K all press x"} +} -body { + testcbind .t.f <1> {lappend x before; event gen .t.f <2>; lappend x after} {lappend x bye.f1} + testcbind .t.f <2> {destroy .t.f} {lappend x bye.f2} + bind .t.f {lappend x fDestroy} + testcbind .t.f <3> {foo} {lappend x bye.f3} + event gen .t.f <1> + return $x +} -cleanup { + destroy .t.f +} -result {before fDestroy bye.f3 bye.f2 after bye.f1} -test bind-13.1 {Tk_BindEvent procedure} { - setup - bind .b.f a {lappend x "%W %K .b.f press a"} +test bind-13.1 {Tk_BindEvent procedure} -setup { + frame .t.f -class Test -width 150 -height 100 + pack .t.f + focus -force .t.f + update set x {} - event gen .b.f - event gen .b.f - event gen .b.f - set x -} {{.b.f a .b.f press a} {.b.f a Test press a} {.b.f a all press any} {.b.f b Test press any} {.b.f b all press any} {.b.f x Test press any} {.b.f x all press x}} - -bind Test {lappend x "%W %K Test press any"; break} -bind all {continue; lappend x "%W %K all press any"} +} -body { + bind Test {lappend x "%W %K Test press any"} + bind all {lappend x "%W %K all press any"} + bind Test a {lappend x "%W %K Test press a"} + bind all x {lappend x "%W %K all press x"} + bind .t.f a {lappend x "%W %K .t.f press a"} + + event gen .t.f + event gen .t.f + event gen .t.f + return $x +} -cleanup { + destroy .t.f + bind all {} + bind Test {} + bind all x {} + bind Test a {} +} -result {{.t.f a .t.f press a} {.t.f a Test press a} {.t.f a all press any} {.t.f b Test press any} {.t.f b all press any} {.t.f x Test press any} {.t.f x all press x}} -test bind-13.2 {Tk_BindEvent procedure} { - setup - bind .b.f b {lappend x "%W %K .b.f press a"} +test bind-13.2 {Tk_BindEvent procedure} -setup { + frame .t.f -class Test -width 150 -height 100 + pack .t.f + focus -force .t.f + update set x {} - event gen .b.f - set x -} {{.b.f b .b.f press a} {.b.f b Test press any}} -if {[info procs bgerror] == "bgerror"} { - rename bgerror {} -} -proc bgerror args {} -bind Test {lappend x "%W %K Test press any"; error Test} -test bind-13.3 {Tk_BindEvent procedure} { - setup - bind .b.f b {lappend x "%W %K .b.f press a"} +} -body { + bind Test {lappend x "%W %K Test press any"; break} + bind all {continue; lappend x "%W %K all press any"} + bind .t.f b {lappend x "%W %K .t.f press a"} + + event gen .t.f + return $x +} -cleanup { + destroy .t.f + bind all {} + bind Test {} +} -result {{.t.f b .t.f press a} {.t.f b Test press any}} + +test bind-13.3 {Tk_BindEvent procedure} -setup { + proc bgerror args {} + frame .t.f -class Test -width 150 -height 100 + pack .t.f + focus -force .t.f + update set x {} - event gen .b.f +} -body { + bind Test {lappend x "%W %K Test press any"; error Test} + bind .t.f b {lappend x "%W %K .t.f press a"} + event gen .t.f update list $x $errorInfo -} {{{.b.f b .b.f press a} {.b.f b Test press any}} {Test +} -cleanup { + destroy .t.f + bind Test {} + rename bgerror {} +} -result {{{.t.f b .t.f press a} {.t.f b Test press any}} {Test while executing "error Test" (command bound to event)}} -rename bgerror {} -test bind-13.4 {Tk_BindEvent procedure} { +test bind-13.4 {Tk_BindEvent procedure} -setup { proc foo {} { - set x 44 - event gen .b.f + set x 44 + event gen .t.f } - setup - bind .b.f a {lappend x "%W %K .b.f press a"} + frame .t.f -class Test -width 150 -height 100 + pack .t.f + focus -force .t.f + update set x {} +} -body { + bind Test a {lappend x "%W %K Test press a"} + bind .t.f a {lappend x "%W %K .t.f press a"} foo - set x -} {{.b.f a .b.f press a} {.b.f a Test press a}} -test bind-13.5 {Tk_BindEvent procedure} { + return $x +} -cleanup { + destroy .t.f + bind Test a {} +} -result {{.t.f a .t.f press a} {.t.f a Test press a}} + +test bind-13.5 {Tk_BindEvent procedure} -body { bind all {lappend x "%W destroyed"} set x {} - list [catch {frame .b.g -gorp foo} msg] $msg $x -} {1 {unknown option "-gorp"} {{.b.g destroyed}}} -foreach i [bind all] { - bind all $i {} -} -foreach i [bind Test] { - bind Test $i {} -} -test bind-13.6 {Tk_BindEvent procedure} { - setup - bind .b.f z {lappend x "%W z (.b.f binding)"} - bind Test z {lappend x "%W z (.b.f binding)"} - bind all z {bind .b.f z {}; lappend x "%W z (.b.f binding)"} + frame .t.g -gorp foo +} -cleanup { + bind all {} +} -returnCodes error -result {unknown option "-gorp"} +test bind-13.6 {Tk_BindEvent procedure} -body { + bind all {lappend x "%W destroyed"} set x {} - event gen .b.f + catch {frame .t.g -gorp foo} + return $x +} -cleanup { + bind all {} +} -result {{.t.g destroyed}} + +test bind-13.7 {Tk_BindEvent procedure} -setup { + frame .t.f -class Test -width 150 -height 100 + pack .t.f + focus -force .t.f + update + set x {} +} -body { + bind .t.f z {lappend x "%W z (.t.f binding)"} + bind Test z {lappend x "%W z (.t.f binding)"} + bind all z {bind .t.f z {}; lappend x "%W z (.t.f binding)"} + event gen .t.f + return $x +} -cleanup { bind Test z {} bind all z {} - set x -} {{.b.f z (.b.f binding)} {.b.f z (.b.f binding)} {.b.f z (.b.f binding)}} -test bind-13.7 {Tk_BindEvent procedure} { - setup - bind .b.f z {lappend x "%W z (.b.f binding)"} - bind Test z {lappend x "%W z (.b.f binding)"} - bind all z {destroy .b.f; lappend x "%W z (.b.f binding)"} + destroy .t.f +} -result {{.t.f z (.t.f binding)} {.t.f z (.t.f binding)} {.t.f z (.t.f binding)}} +test bind-13.8 {Tk_BindEvent procedure} -setup { + frame .t.f -class Test -width 150 -height 100 + pack .t.f + focus -force .t.f + update set x {} - event gen .b.f +} -body { + bind .t.f z {lappend x "%W z (.t.f binding)"} + bind Test z {lappend x "%W z (.t.f binding)"} + bind all z {destroy .t.f; lappend x "%W z (.t.f binding)"} + event gen .t.f + return $x +} -cleanup { bind Test z {} bind all z {} + destroy .t.f +} -result {{.t.f z (.t.f binding)} {.t.f z (.t.f binding)} {.t.f z (.t.f binding)}} + +test bind-13.9 {Tk_BindEvent procedure} -setup { + frame .t.f -class Test -width 150 -height 100 + pack .t.f + focus -force .t.f + update + set x {} +} -body { + bind .t.f <1> {lappend x "%W z (.t.f <1> binding)"} + bind .t.f {lappend x "%W z (.t.f binding)"} + event gen .t.f + event gen .t.f + return $x +} -cleanup { + destroy .t.f +} -result {{.t.f z (.t.f <1> binding)} {.t.f z (.t.f binding)}} +test bind-13.10 {Tk_BindEvent procedure: ignore NotifyInferior} -setup { + frame .t.f -class Test -width 150 -height 100 + pack .t.f + focus -force .t.f + update + set x {} +} -body { + bind .t.f "lappend x Enter%#" + bind .t.f "lappend x Leave%#" + event gen .t.f -serial 100 -detail NotifyAncestor + event gen .t.f -serial 101 -detail NotifyInferior + event gen .t.f -serial 102 -detail NotifyAncestor + event gen .t.f -serial 103 -detail NotifyInferior + return $x +} -cleanup { + destroy .t.f +} -result {Enter100 Leave102} +test bind-13.11 {Tk_BindEvent procedure: collapse Motions} -setup { + frame .t.f -class Test -width 150 -height 100 + pack .t.f + focus -force .t.f + update + set x {} +} -body { + bind .t.f "lappend x Motion%#(%x,%y)" + event gen .t.f -serial 100 -x 100 -y 200 -when tail + update + event gen .t.f -serial 101 -x 200 -y 300 -when tail + event gen .t.f -serial 102 -x 300 -y 400 -when tail + update + return $x +} -cleanup { + destroy .t.f +} -result {Motion100(100,200) Motion102(300,400)} +test bind-13.12 {Tk_BindEvent procedure: collapse repeating modifiers} -setup { + frame .t.f -class Test -width 150 -height 100 + pack .t.f + focus -force .t.f + update +} -body { + bind .t.f "lappend x %K%#" + bind .t.f "lappend x %K%#" + event gen .t.f -serial 100 -when tail + event gen .t.f -serial 101 -when tail + event gen .t.f -serial 102 -when tail + event gen .t.f -serial 103 -when tail + update +} -cleanup { + destroy .t.f +} -result {} +test bind-13.13 {Tk_BindEvent procedure: valid key detail} -setup { + frame .t.f -class Test -width 150 -height 100 + pack .t.f + focus -force .t.f + update + set x {} +} -body { + bind .t.f "lappend x Key%K" + bind .t.f "lappend x Release%K" + event gen .t.f -keysym a + event gen .t.f -keysym a + return $x +} -cleanup { + destroy .t.f +} -result {Keya Releasea} +test bind-13.14 {Tk_BindEvent procedure: invalid key detail} -setup { + frame .t.f -class Test -width 150 -height 100 + pack .t.f + focus -force .t.f + update + set x {} +} -body { + bind .t.f "lappend x Key%K" + bind .t.f "lappend x Release%K" + event gen .t.f -keycode 0 + event gen .t.f -keycode 0 + return $x +} -cleanup { + destroy .t.f +} -result {Key?? Release??} +test bind-13.15 {Tk_BindEvent procedure: button detail} -setup { + frame .t.f -class Test -width 150 -height 100 + pack .t.f + focus -force .t.f + update + set x {} +} -body { + bind .t.f