Index: .github/workflows/linux-build.yml ================================================================== --- .github/workflows/linux-build.yml +++ .github/workflows/linux-build.yml @@ -37,11 +37,11 @@ path: tk - name: Checkout Tcl 8.6 uses: actions/checkout@v4 with: repository: tcltk/tcl - ref: main + ref: core-8-branch path: tcl - name: Setup Environment (compiler=${{ matrix.compiler }}) run: | sudo apt-get install libxss-dev libxft-dev mkdir "$HOME/install dir" @@ -141,11 +141,11 @@ path: tk - name: Checkout Tcl uses: actions/checkout@v4 with: repository: tcltk/tcl - ref: main + ref: core-8-branch path: tcl - name: Setup Environment (compiler=${{ matrix.compiler }}) run: | sudo apt-get install libxss-dev libxft-dev xvfb libicu-dev mkdir "$HOME/install dir" DELETED .github/workflows/linux-with-tcl8-build.yml Index: .github/workflows/linux-with-tcl8-build.yml ================================================================== --- .github/workflows/linux-with-tcl8-build.yml +++ /dev/null @@ -1,178 +0,0 @@ -name: Linux (with Tcl 8.7) -on: - push: - branches: - - "main" - - "core-8-branch" - - "core-8-6-branch" - tags: - - "core-**" -permissions: - contents: read -defaults: - run: - shell: bash - working-directory: tk/unix -env: - ERROR_ON_FAILURES: 1 -jobs: - build: - runs-on: ubuntu-22.04 - strategy: - matrix: - compiler: - - "gcc" - - "clang" - cfgopt: - - "" - - "CFLAGS=-DTK_NO_DEPRECATED=1" - - "--disable-shared" - - "--disable-xft" - - "--disable-xss" - - "--enable-symbols" - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - path: tk - - name: Checkout Tcl - uses: actions/checkout@v4 - with: - repository: tcltk/tcl - ref: core-8-branch - path: tcl - - name: Setup Environment (compiler=${{ matrix.compiler }}) - run: | - sudo apt-get install libxss-dev libxft-dev - mkdir "$HOME/install dir" - touch tk/doc/man.macros tk/generic/tkStubInit.c - echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV - echo "CC=$COMPILER" >> $GITHUB_ENV - echo "TOOL_DIR=$(cd tcl/tools;pwd)" >> $GITHUB_ENV - echo "BUILD_CONFIG_ID=$OPTS" >> $GITHUB_ENV - working-directory: "." - env: - CFGOPT: ${{ matrix.cfgopt }} - COMPILER: ${{ matrix.compiler }} - OPTS: ${{ matrix.compiler }}${{ matrix.cfgopt }} - - name: Configure and Build Tcl - run: | - ./configure $CFGOPT "--prefix=$HOME/install dir" || { - cat config.log - echo "::warning::Failure during Tcl Configure" - exit 1 - } - make all install || { - echo "::warning::Failure during Tcl Build" - exit 1 - } - echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV - working-directory: tcl/unix - - name: Configure (opts=${{ matrix.cfgopt }}) - run: | - ./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH "--prefix=$HOME/install dir" || { - cat config.log - echo "::error::Failure during Configure" - exit 1 - } - - name: Build - run: | - make binaries libraries || { - echo "::error::Failure during Build" - exit 1 - } - - name: Build Test Harness - run: | - make tktest || { - echo "::error::Failure during Build" - exit 1 - } - - name: Test-Drive Installation - run: | - make install || { - echo "::error::Failure during Install" - exit 1 - } - - name: Create Distribution Package - run: | - make dist || { - echo "::error::Failure during Distribute" - exit 1 - } - - name: Convert Documentation to HTML - run: | - make html-tk TOOL_DIR=$TOOL_DIR || { - echo "::error::Failure during Distribute" - exit 1 - } - test: - runs-on: ubuntu-22.04 - strategy: - matrix: - compiler: - - "gcc" - cfgopt: - - "" - - "--disable-xft" - - "--enable-symbols" - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - path: tk - - name: Checkout Tcl - uses: actions/checkout@v4 - with: - repository: tcltk/tcl - ref: core-8-branch - path: tcl - - name: Setup Environment (compiler=${{ matrix.compiler }}) - run: | - sudo apt-get install libxss-dev libxft-dev xvfb libicu-dev - mkdir "$HOME/install dir" - touch tk/doc/man.macros tk/generic/tkStubInit.c - echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV - echo "CC=$COMPILER" >> $GITHUB_ENV - working-directory: "." - env: - CFGOPT: ${{ matrix.cfgopt }} - COMPILER: ${{ matrix.compiler }} - - name: Configure and Build Tcl - run: | - ./configure $CFGOPT "--prefix=$HOME/install dir" || { - cat config.log - echo "::warning::Failure during Tcl Configure" - exit 1 - } - make all install || { - echo "::warning::Failure during Tcl Build" - exit 1 - } - echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV - working-directory: tcl/unix - - name: Configure ${{ matrix.cfgopt }} - run: | - ./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH "--prefix=$HOME/install dir" || { - cat config.log - echo "::error::Failure during Configure" - exit 1 - } - - name: Build - run: | - make binaries libraries tktest || { - echo "::error::Failure during Build" - exit 1 - } - - name: Run Tests - run: | - xvfb-run --auto-servernum make test-classic | tee out-classic.txt - xvfb-run --auto-servernum make test-ttk | tee out-ttk.txt - grep -q "Failed 0" out-classic.txt || { - echo "::error::Failure during Test" - exit 1 - } - grep -q "Failed 0" out-ttk.txt || { - echo "::error::Failure during Test" - exit 1 - } - timeout-minutes: 15 ADDED .github/workflows/linux-with-tcl86-build.yml Index: .github/workflows/linux-with-tcl86-build.yml ================================================================== --- /dev/null +++ .github/workflows/linux-with-tcl86-build.yml @@ -0,0 +1,177 @@ +name: Linux (with Tcl 8.6) +on: + push: + branches: + - "main" + - "core-8-branch" + - "core-8-6-branch" + tags: + - "core-**" +permissions: + contents: read +defaults: + run: + shell: bash + working-directory: tk/unix +env: + ERROR_ON_FAILURES: 1 +jobs: + build: + runs-on: ubuntu-22.04 + strategy: + matrix: + compiler: + - "gcc" + - "clang" + cfgopt: + - "" + - "CFLAGS=-DTK_NO_DEPRECATED=1" + - "--disable-xft" + - "--disable-xss" + - "--enable-symbols" + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + path: tk + - name: Checkout Tcl + uses: actions/checkout@v4 + with: + repository: tcltk/tcl + ref: core-8-6-branch + path: tcl + - name: Setup Environment (compiler=${{ matrix.compiler }}) + run: | + sudo apt-get install libxss-dev libxft-dev + mkdir "$HOME/install dir" + touch tk/doc/man.macros tk/generic/tkStubInit.c + echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV + echo "CC=$COMPILER" >> $GITHUB_ENV + echo "TOOL_DIR=$(cd tcl/tools;pwd)" >> $GITHUB_ENV + echo "BUILD_CONFIG_ID=$OPTS" >> $GITHUB_ENV + working-directory: "." + env: + CFGOPT: ${{ matrix.cfgopt }} + COMPILER: ${{ matrix.compiler }} + OPTS: ${{ matrix.compiler }}${{ matrix.cfgopt }} + - name: Configure and Build Tcl + run: | + ./configure $CFGOPT "--prefix=$HOME/install dir" || { + cat config.log + echo "::warning::Failure during Tcl Configure" + exit 1 + } + make all install || { + echo "::warning::Failure during Tcl Build" + exit 1 + } + echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV + working-directory: tcl/unix + - name: Configure (opts=${{ matrix.cfgopt }}) + run: | + ./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH --disable-zipfs "--prefix=$HOME/install dir" || { + cat config.log + echo "::error::Failure during Configure" + exit 1 + } + - name: Build + run: | + make binaries libraries || { + echo "::error::Failure during Build" + exit 1 + } + - name: Build Test Harness + run: | + make tktest || { + echo "::error::Failure during Build" + exit 1 + } + - name: Test-Drive Installation + run: | + make install || { + echo "::error::Failure during Install" + exit 1 + } + - name: Create Distribution Package + run: | + make dist || { + echo "::error::Failure during Distribute" + exit 1 + } + - name: Convert Documentation to HTML + run: | + make html-tk TOOL_DIR=$TOOL_DIR || { + echo "::error::Failure during Distribute" + exit 1 + } + test: + runs-on: ubuntu-22.04 + strategy: + matrix: + compiler: + - "gcc" + cfgopt: + - "" + - "--disable-xft" + - "--enable-symbols" + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + path: tk + - name: Checkout Tcl + uses: actions/checkout@v4 + with: + repository: tcltk/tcl + ref: core-8-6-branch + path: tcl + - name: Setup Environment (compiler=${{ matrix.compiler }}) + run: | + sudo apt-get install libxss-dev libxft-dev xvfb libicu-dev + mkdir "$HOME/install dir" + touch tk/doc/man.macros tk/generic/tkStubInit.c + echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV + echo "CC=$COMPILER" >> $GITHUB_ENV + working-directory: "." + env: + CFGOPT: ${{ matrix.cfgopt }} + COMPILER: ${{ matrix.compiler }} + - name: Configure and Build Tcl + run: | + ./configure $CFGOPT "--prefix=$HOME/install dir" || { + cat config.log + echo "::warning::Failure during Tcl Configure" + exit 1 + } + make all install || { + echo "::warning::Failure during Tcl Build" + exit 1 + } + echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV + working-directory: tcl/unix + - name: Configure ${{ matrix.cfgopt }} + run: | + ./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH "--prefix=$HOME/install dir" || { + cat config.log + echo "::error::Failure during Configure" + exit 1 + } + - name: Build + run: | + make binaries libraries tktest || { + echo "::error::Failure during Build" + exit 1 + } + - name: Run Tests + run: | + xvfb-run --auto-servernum make test-classic | tee out-classic.txt + xvfb-run --auto-servernum make test-ttk | tee out-ttk.txt + grep -q "Failed 0" out-classic.txt || { + echo "::error::Failure during Test" + exit 1 + } + grep -q "Failed 0" out-ttk.txt || { + echo "::error::Failure during Test" + exit 1 + } + timeout-minutes: 15 ADDED .github/workflows/linux-with-tcl9-build.yml Index: .github/workflows/linux-with-tcl9-build.yml ================================================================== --- /dev/null +++ .github/workflows/linux-with-tcl9-build.yml @@ -0,0 +1,177 @@ +name: Linux (with Tcl 9.0) +on: + push: + branches: + - "main" + - "core-8-branch" + - "core-8-6-branch" + tags: + - "core-**" +permissions: + contents: read +defaults: + run: + shell: bash + working-directory: tk/unix +env: + ERROR_ON_FAILURES: 1 +jobs: + build: + runs-on: ubuntu-22.04 + strategy: + matrix: + compiler: + - "gcc" + - "clang" + cfgopt: + - "" + - "CFLAGS=-DTK_NO_DEPRECATED=1" + - "--disable-xft" + - "--disable-xss" + - "--enable-symbols" + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + path: tk + - name: Checkout Tcl + uses: actions/checkout@v4 + with: + repository: tcltk/tcl + ref: main + path: tcl + - name: Setup Environment (compiler=${{ matrix.compiler }}) + run: | + sudo apt-get install libxss-dev libxft-dev + mkdir "$HOME/install dir" + touch tk/doc/man.macros tk/generic/tkStubInit.c + echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV + echo "CC=$COMPILER" >> $GITHUB_ENV + echo "TOOL_DIR=$(cd tcl/tools;pwd)" >> $GITHUB_ENV + echo "BUILD_CONFIG_ID=$OPTS" >> $GITHUB_ENV + working-directory: "." + env: + CFGOPT: ${{ matrix.cfgopt }} + COMPILER: ${{ matrix.compiler }} + OPTS: ${{ matrix.compiler }}${{ matrix.cfgopt }} + - name: Configure and Build Tcl + run: | + ./configure $CFGOPT "--prefix=$HOME/install dir" || { + cat config.log + echo "::warning::Failure during Tcl Configure" + exit 1 + } + make all install || { + echo "::warning::Failure during Tcl Build" + exit 1 + } + echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV + working-directory: tcl/unix + - name: Configure (opts=${{ matrix.cfgopt }}) + run: | + ./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH "--prefix=$HOME/install dir" || { + cat config.log + echo "::error::Failure during Configure" + exit 1 + } + - name: Build + run: | + make binaries libraries || { + echo "::error::Failure during Build" + exit 1 + } + - name: Build Test Harness + run: | + make tktest || { + echo "::error::Failure during Build" + exit 1 + } + - name: Test-Drive Installation + run: | + make install || { + echo "::error::Failure during Install" + exit 1 + } + - name: Create Distribution Package + run: | + make dist || { + echo "::error::Failure during Distribute" + exit 1 + } + - name: Convert Documentation to HTML + run: | + make html-tk TOOL_DIR=$TOOL_DIR || { + echo "::error::Failure during Distribute" + exit 1 + } + test: + runs-on: ubuntu-22.04 + strategy: + matrix: + compiler: + - "gcc" + cfgopt: + - "" + - "--disable-xft" + - "--enable-symbols" + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + path: tk + - name: Checkout Tcl + uses: actions/checkout@v4 + with: + repository: tcltk/tcl + ref: main + path: tcl + - name: Setup Environment (compiler=${{ matrix.compiler }}) + run: | + sudo apt-get install libxss-dev libxft-dev xvfb libicu-dev + mkdir "$HOME/install dir" + touch tk/doc/man.macros tk/generic/tkStubInit.c + echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV + echo "CC=$COMPILER" >> $GITHUB_ENV + working-directory: "." + env: + CFGOPT: ${{ matrix.cfgopt }} + COMPILER: ${{ matrix.compiler }} + - name: Configure and Build Tcl + run: | + ./configure $CFGOPT "--prefix=$HOME/install dir" || { + cat config.log + echo "::warning::Failure during Tcl Configure" + exit 1 + } + make all install || { + echo "::warning::Failure during Tcl Build" + exit 1 + } + echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV + working-directory: tcl/unix + - name: Configure ${{ matrix.cfgopt }} + run: | + ./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH "--prefix=$HOME/install dir" || { + cat config.log + echo "::error::Failure during Configure" + exit 1 + } + - name: Build + run: | + make binaries libraries tktest || { + echo "::error::Failure during Build" + exit 1 + } + - name: Run Tests + run: | + xvfb-run --auto-servernum make test-classic | tee out-classic.txt + xvfb-run --auto-servernum make test-ttk | tee out-ttk.txt + grep -q "Failed 0" out-classic.txt || { + echo "::error::Failure during Test" + exit 1 + } + grep -q "Failed 0" out-ttk.txt || { + echo "::error::Failure during Test" + exit 1 + } + timeout-minutes: 15 DELETED .github/workflows/linux-with-tcl91-build.yml Index: .github/workflows/linux-with-tcl91-build.yml ================================================================== --- .github/workflows/linux-with-tcl91-build.yml +++ /dev/null @@ -1,178 +0,0 @@ -name: Linux (with Tcl 9.1) -on: - push: - branches: - - "main" - - "core-8-branch" - - "core-8-6-branch" - tags: - - "core-**" -permissions: - contents: read -defaults: - run: - shell: bash - working-directory: tk/unix -env: - ERROR_ON_FAILURES: 1 -jobs: - build: - runs-on: ubuntu-22.04 - strategy: - matrix: - compiler: - - "gcc" - - "clang" - cfgopt: - - "" - - "CFLAGS=-DTK_NO_DEPRECATED=1" - - "--disable-shared" - - "--disable-xft" - - "--disable-xss" - - "--enable-symbols" - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - path: tk - - name: Checkout Tcl - uses: actions/checkout@v4 - with: - repository: tcltk/tcl - ref: tip-626 - path: tcl - - name: Setup Environment (compiler=${{ matrix.compiler }}) - run: | - sudo apt-get install libxss-dev libxft-dev - mkdir "$HOME/install dir" - touch tk/doc/man.macros tk/generic/tkStubInit.c - echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV - echo "CC=$COMPILER" >> $GITHUB_ENV - echo "TOOL_DIR=$(cd tcl/tools;pwd)" >> $GITHUB_ENV - echo "BUILD_CONFIG_ID=$OPTS" >> $GITHUB_ENV - working-directory: "." - env: - CFGOPT: ${{ matrix.cfgopt }} - COMPILER: ${{ matrix.compiler }} - OPTS: ${{ matrix.compiler }}${{ matrix.cfgopt }} - - name: Configure and Build Tcl - run: | - ./configure $CFGOPT "--prefix=$HOME/install dir" || { - cat config.log - echo "::warning::Failure during Tcl Configure" - exit 1 - } - make all install || { - echo "::warning::Failure during Tcl Build" - exit 1 - } - echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV - working-directory: tcl/unix - - name: Configure (opts=${{ matrix.cfgopt }}) - run: | - ./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH "--prefix=$HOME/install dir" || { - cat config.log - echo "::error::Failure during Configure" - exit 1 - } - - name: Build - run: | - make binaries libraries || { - echo "::error::Failure during Build" - exit 1 - } - - name: Build Test Harness - run: | - make tktest || { - echo "::error::Failure during Build" - exit 1 - } - - name: Test-Drive Installation - run: | - make install || { - echo "::error::Failure during Install" - exit 1 - } - - name: Create Distribution Package - run: | - make dist || { - echo "::error::Failure during Distribute" - exit 1 - } - - name: Convert Documentation to HTML - run: | - make html-tk TOOL_DIR=$TOOL_DIR || { - echo "::error::Failure during Distribute" - exit 1 - } - test: - runs-on: ubuntu-22.04 - strategy: - matrix: - compiler: - - "gcc" - cfgopt: - - "" - - "--disable-xft" - - "--enable-symbols" - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - path: tk - - name: Checkout Tcl - uses: actions/checkout@v4 - with: - repository: tcltk/tcl - ref: tip-626 - path: tcl - - name: Setup Environment (compiler=${{ matrix.compiler }}) - run: | - sudo apt-get install libxss-dev libxft-dev xvfb libicu-dev - mkdir "$HOME/install dir" - touch tk/doc/man.macros tk/generic/tkStubInit.c - echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV - echo "CC=$COMPILER" >> $GITHUB_ENV - working-directory: "." - env: - CFGOPT: ${{ matrix.cfgopt }} - COMPILER: ${{ matrix.compiler }} - - name: Configure and Build Tcl - run: | - ./configure $CFGOPT "--prefix=$HOME/install dir" || { - cat config.log - echo "::warning::Failure during Tcl Configure" - exit 1 - } - make all install || { - echo "::warning::Failure during Tcl Build" - exit 1 - } - echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV - working-directory: tcl/unix - - name: Configure ${{ matrix.cfgopt }} - run: | - ./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH "--prefix=$HOME/install dir" || { - cat config.log - echo "::error::Failure during Configure" - exit 1 - } - - name: Build - run: | - make binaries libraries tktest || { - echo "::error::Failure during Build" - exit 1 - } - - name: Run Tests - run: | - xvfb-run --auto-servernum make test-classic | tee out-classic.txt - xvfb-run --auto-servernum make test-ttk | tee out-ttk.txt - grep -q "Failed 0" out-classic.txt || { - echo "::error::Failure during Test" - exit 1 - } - grep -q "Failed 0" out-ttk.txt || { - echo "::error::Failure during Test" - exit 1 - } - timeout-minutes: 15 Index: .github/workflows/mac-build.yml ================================================================== --- .github/workflows/mac-build.yml +++ .github/workflows/mac-build.yml @@ -21,15 +21,15 @@ steps: - name: Checkout Tk uses: actions/checkout@v4 with: path: tk - - name: Check out Tcl 9.0 + - name: Checkout Tcl uses: actions/checkout@v4 with: repository: tcltk/tcl - ref: main + ref: core-8-branch path: tcl - name: Prepare checked out repositories run: | touch tk/generic/tkStubInit.c mkdir build @@ -73,15 +73,15 @@ steps: - name: Checkout Tk uses: actions/checkout@v4 with: path: tk - - name: Check out Tcl 9.0 + - name: Checkout Tcl uses: actions/checkout@v4 with: repository: tcltk/tcl - ref: main + ref: core-8-branch path: tcl - name: Prepare checked out repositories env: SET_DISPLAY: ${{ contains(matrix.options, '--disable-aqua') }} run: | Index: .github/workflows/onefiledist.yml ================================================================== --- .github/workflows/onefiledist.yml +++ .github/workflows/onefiledist.yml @@ -22,15 +22,15 @@ steps: - name: Checkout Tk uses: actions/checkout@v4 with: path: tk - - name: Checkout Tcl 9.0 + - name: Checkout Tcl 8.7 uses: actions/checkout@v4 with: repository: tcltk/tcl - ref: main + ref: core-8-branch path: tcl - name: Setup Environment run: | sudo apt-get install libxss-dev libxft-dev touch tcl/generic/tclStubInit.c tcl/generic/tclOOStubInit.c @@ -56,11 +56,11 @@ make binaries libraries install working-directory: tk/unix # TODO: need the Tk version separately for distro naming below - name: Package run: | - cp bin/wish9.0 ${BUILD_NAME} + cp bin/wish8.7 ${BUILD_NAME} chmod +x ${BUILD_NAME} tar -cf ${BUILD_NAME}.tar ${BUILD_NAME} working-directory: ${{ env.INST_DIR }} env: BUILD_NAME: wish${{ env.TCL_PATCHLEVEL }}_snapshot @@ -86,15 +86,15 @@ steps: - name: Checkout Tk uses: actions/checkout@v4 with: path: tk - - name: Checkout Tcl 9.0 + - name: Checkout Tcl 8.7 uses: actions/checkout@v4 with: repository: tcltk/tcl - ref: main + ref: core-8-branch path: tcl - name: Checkout create-dmg uses: actions/checkout@v4 with: repository: create-dmg/create-dmg @@ -174,15 +174,15 @@ install: git mingw-w64-x86_64-toolchain make zip - name: Checkout Tk uses: actions/checkout@v4 with: path: tk - - name: Checkout Tcl 9.0 + - name: Checkout Tcl 8.7 uses: actions/checkout@v4 with: repository: tcltk/tcl - ref: main + ref: core-8-branch path: tcl - name: Setup Environment run: | mkdir -p install/combined touch tcl/generic/tclStubInit.c tcl/generic/tclOOStubInit.c Index: .github/workflows/win-build.yml ================================================================== --- .github/workflows/win-build.yml +++ .github/workflows/win-build.yml @@ -22,21 +22,22 @@ strategy: matrix: config: - "" - "OPTS=symbols" + - "OPTS=symbols STATS=compdbg,memdbg" - "OPTS=static" steps: - name: Checkout Tk uses: actions/checkout@v4 with: path: tk - - name: Checkout Tcl 9.0 + - name: Checkout Tcl 8.7 uses: actions/checkout@v4 with: repository: tcltk/tcl - ref: main + ref: core-8-branch path: tcl - name: Init MSVC uses: ilammy/msvc-dev-cmd@v1 - name: Make Install Location working-directory: tcl @@ -118,15 +119,15 @@ with: msystem: MINGW64 install: git mingw-w64-x86_64-toolchain make zip - name: Checkout Tk uses: actions/checkout@v4 - - name: Checkout Tcl 9.0 + - name: Checkout Tcl 8.7 uses: actions/checkout@v4 with: repository: tcltk/tcl - ref: main + ref: core-8-branch path: tcl - name: Prepare run: | touch tkStubInit.c touch "${HOME}/forWinDialog-5.12.7" Index: .project ================================================================== --- .project +++ .project @@ -1,8 +1,8 @@ - tk9.0 + tk8.7 Index: README.md ================================================================== --- README.md +++ README.md @@ -1,8 +1,8 @@ # README: Tk -This is the **Tk 9.0.1** source distribution. +This is the **Tk 8.7b1** source distribution. You can get any source release of Tk from [our distribution site](https://sourceforge.net/projects/tcl/files/Tcl/). 9.0 (production release, daily build) @@ -19,11 +19,11 @@ This directory contains the sources and documentation for Tk, a cross-platform GUI toolkit implemented with the Tcl scripting language. For details on features, incompatibilities, and potential problems with -this release, see [the Tcl/Tk 9.0 Web page](https://www.tcl-lang.org/software/tcltk/9.0.html) +this release, see [the Tcl/Tk 8.7 Web page](https://www.tcl-lang.org/software/tcltk/8.7.html) or refer to the "changes" file in this directory, which contains a historical record of all changes to Tk. Tk is maintained, enhanced, and distributed freely by the Tcl community. Source code development and tracking of bug reports and feature requests Index: changes.md ================================================================== --- changes.md +++ changes.md @@ -2,32 +2,13 @@ The source code for Tk is managed by fossil. Tk developers coordinate all changes to the Tk source code at > [Tk Source Code](https://core.tcl-lang.org/tk/) -Release Tk 9.0.1 arises from the check-in with tag `core-9-0-1`. - -## Changes since Tk 9.0.0 - - [Canvas widget handles pixel objects incorrectly in Tk 9.0](https://core.tcl-lang.org/tk/tktview/610a73) - - [SIGABRT from Tk_DeleteErrorHandler()](https://core.tcl-lang.org/tk/tktview/f52986) - - [Tilde file syntax not available on 9.0 but used by "~/.Xdefaults"](https://core.tcl-lang.org/tk/tktview/fcfddc) - - [leftover use of tilde in filename string](https://core.tcl-lang.org/tk/tktview/767702) - - [build failure on macOS < 10.13](https://core.tcl-lang.org/tk/tktview/d48cbf) - - [Two potentially bogus binding scripts for ](https://core.tcl-lang.org/tk/tktview/73c5e3) - - [Aqua: canvas items are not always redrawn](https://core.tcl-lang.org/tk/tktview/5869c2) - - [Aqua: color rgb values do not behave as expected when appearance is changed](https://core.tcl-lang.org/tk/tktview/01f58b) - - [Aqua: winfo rgb . systemLabelColor returns a weird result on aqua](https://core.tcl-lang.org/tk/tktview/23b57a) - - [Aqua: background thread became slower](https://core.tcl-lang.org/tk/tktview/547cc6) - - [Use of Tcl_Obj vs char * in Widget storage](https://core.tcl-lang.org/tk/tktview/f91aa2) - - [cannot build .chm help file (Windows)](https://core.tcl-lang.org/tk/tktview/bb110c) - - [Tk intialization overwrites thread specific data](https://core.tcl-lang.org/tk/tktview/bcbf4c) - - [File clamTheme.tcl misses code related to the -indicatorforeground option](https://core.tcl-lang.org/tk/tktview/a69fd7) - - [Segfault when using menu(button) with the -font option](https://core.tcl-lang.org/tk/tktview/8ce672) - -Release Tk 9.0.0 arises from the check-in with tag `core-9-0-0`. - -Highlighted differences between Tk 9.0 and Tk 8.6 are summarized below, +Release Tk 8.7b1 arises from the check-in with tag core-8-7-b1. + +Highlighted differences between Tk 8.7 and Tk 8.6 are summarized below, with focus on changes important to programmers using the Tk library and writing Tcl scripts containing Tk commands. ## Many improvements to use of platform features and conventions. - Built-in widgets and themes are scaling-aware. @@ -51,16 +32,5 @@ ## Images - Partial SVG support - Read/write access to photo image metadata -## Known bugs - - [many PIXEL options don't keep their configured value](https://core.tcl-lang.org/tk/tktview/29ba53) - - [Inconsistent reporting of child geometry changes to grid container](https://core.tcl-lang.org/tk/tktview/beaa8e) - - [Inconsistency in whether widgets allow negative borderwidths](https://core.tcl-lang.org/tk/tktview/5f739d) - - [Enter key works differently in Windows and Linux](https://core.tcl-lang.org/tk/tktview/b3a1b9) - - [slow widget creation if default font is not used](https://core.tcl-lang.org/tk/tktview/8da7af) - - [The wm manage command does not work on current macOS versions](https://core.tcl-lang.org/tk/tktview/8a6012) - - [Slow processing irregular transparencies](https://core.tcl-lang.org/tk/tktview/919066) - - [text's cursor width on 0th column](https://core.tcl-lang.org/tk/tktview/47fbfc) - - [text widget breaks graphemes with combining diacritical marks](https://core.tcl-lang.org/tk/tktview/442208) - Index: doc/AddOption.3 ================================================================== --- doc/AddOption.3 +++ doc/AddOption.3 @@ -14,11 +14,10 @@ void \fBTk_AddOption\fR(\fItkwin, name, value, priority\fR) .sp Tcl_Obj * \fBTk_GetSystemDefault\fR(\fItkwin, dbName, className\fR) -.fi .SH ARGUMENTS .AP Tk_Window tkwin in Token for window. .AP "const char" *name in Multi-element name of option. Index: doc/BindTable.3 ================================================================== --- doc/BindTable.3 +++ doc/BindTable.3 @@ -13,29 +13,28 @@ .SH SYNOPSIS .nf \fB#include \fR .sp Tk_BindingTable -\fBTk_CreateBindingTable\fR(\fIinterp\fR) +\fBTk_CreateBindingTable(\fIinterp\fB)\fR .sp -\fBTk_DeleteBindingTable\fR(\fIbindingTable\fR) +\fBTk_DeleteBindingTable(\fIbindingTable\fB)\fR .sp unsigned long -\fBTk_CreateBinding\fR(\fIinterp, bindingTable, object, eventString, script, append\fR) +\fBTk_CreateBinding(\fIinterp, bindingTable, object, eventString, script, append\fB)\fR .sp int -\fBTk_DeleteBinding\fR(\fIinterp, bindingTable, object, eventString\fR) +\fBTk_DeleteBinding(\fIinterp, bindingTable, object, eventString\fB)\fR .sp const char * -\fBTk_GetBinding\fR(\fIinterp, bindingTable, object, eventString\fR) -.sp -\fBTk_GetAllBindings\fR(\fIinterp, bindingTable, object\fR) -.sp -\fBTk_DeleteAllBindings\fR(\fIbindingTable, object\fR) -.sp -\fBTk_BindEvent\fR(\fIbindingTable, eventPtr, tkwin, numObjects, objectPtr\fR) -.fi +\fBTk_GetBinding(\fIinterp, bindingTable, object, eventString\fB)\fR +.sp +\fBTk_GetAllBindings(\fIinterp, bindingTable, object\fB)\fR +.sp +\fBTk_DeleteAllBindings(\fIbindingTable, object\fB)\fR +.sp +\fBTk_BindEvent(\fIbindingTable, eventPtr, tkwin, numObjects, objectPtr\fB)\fR .SH ARGUMENTS .AS Tk_BindingTable bindingTable .AP Tcl_Interp *interp in Interpreter to use when invoking bindings in binding table. Also used for returning results and errors from binding procedures. @@ -54,11 +53,11 @@ .AP XEvent *eventPtr in X event to match against bindings in \fIbindingTable\fR. .AP Tk_Window tkwin in Identifier for any window on the display where the event occurred. Used to find display-related information such as key maps. -.AP Tcl_Size numObjects in +.AP int numObjects in Number of object identifiers pointed to by \fIobjectPtr\fR. .AP "void **" objectPtr in Points to an array of object identifiers: bindings will be considered for each of these objects in order from first to last. .BE Index: doc/CanvPsY.3 ================================================================== --- doc/CanvPsY.3 +++ doc/CanvPsY.3 @@ -27,13 +27,12 @@ .sp \fBTk_CanvasPsPath\fR(\fIinterp, canvas, coordPtr, numPoints\fR) .sp int \fBTk_CanvasPsStipple\fR(\fIinterp, canvas, bitmap\fR) -.fi .SH ARGUMENTS -.AS Tcl_Size "numPoints" +.AS 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. @@ -57,11 +56,11 @@ .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 Tcl_Size numPoints in +.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 Index: doc/CanvTkwin.3 ================================================================== --- doc/CanvTkwin.3 +++ doc/CanvTkwin.3 @@ -28,11 +28,10 @@ \fBTk_CanvasEventuallyRedraw\fR(\fIcanvas, x1, y1, x2, y2\fR) .sp Tk_OptionParseProc *\fBTk_CanvasTagsParseProc\fR; .sp Tk_OptionPrintProc *\fBTk_CanvasTagsPrintProc\fR; -.fi .SH ARGUMENTS .AS Tk_ItemType *drawableXPtr .AP Tk_Canvas canvas in A token that identifies a canvas widget. .AP Tcl_Interp *interp in/out @@ -148,12 +147,12 @@ Tk_CanvasTagsPrintProc, NULL }; static const Tk_ConfigSpec configSpecs[] = { ... - {TK_CONFIG_CUSTOM, "-tags", NULL, NULL, + {TK_CONFIG_CUSTOM, "\-tags", NULL, NULL, NULL, 0, TK_CONFIG_NULL_OK, &tagsOption}, ... }; .CE .SH KEYWORDS canvas, focus, item type, redisplay, selection, type manager Index: doc/CanvTxtInfo.3 ================================================================== --- doc/CanvTxtInfo.3 +++ doc/CanvTxtInfo.3 @@ -13,11 +13,10 @@ .nf \fB#include \fR .sp Tk_CanvasTextInfo * \fBTk_CanvasGetTextInfo\fR(\fIcanvas\fR) -.fi .SH ARGUMENTS .AS Tk_Canvas canvas .AP Tk_Canvas canvas in A token that identifies a particular canvas widget. .BE @@ -30,19 +29,19 @@ The return value from \fBTk_CanvasGetTextInfo\fR is a pointer to a structure that is shared between Tk and all the items that display text. The structure has the following form: .CS -typedef struct { +typedef struct Tk_CanvasTextInfo { Tk_3DBorder \fIselBorder\fR; int \fIselBorderWidth\fR; XColor *\fIselFgColorPtr\fR; Tk_Item *\fIselItemPtr\fR; - Tcl_Size \fIselectFirst\fR; - Tcl_Size \fIselectLast\fR; + int \fIselectFirst\fR; + int \fIselectLast\fR; Tk_Item *\fIanchorItemPtr\fR; - Tcl_Size \fIselectAnchor\fR; + int \fIselectAnchor\fR; Tk_3DBorder \fIinsertBorder\fR; int \fIinsertWidth\fR; int \fIinsertBorderWidth\fR; Tk_Item *\fIfocusItemPtr\fR; int \fIgotFocus\fR; Index: doc/Clipboard.3 ================================================================== --- doc/Clipboard.3 +++ doc/Clipboard.3 @@ -17,11 +17,10 @@ int \fBTk_ClipboardClear\fR(\fIinterp, tkwin\fR) .sp int \fBTk_ClipboardAppend\fR(\fIinterp, tkwin, target, format, buffer\fR) -.fi .SH ARGUMENTS .AS Tk_ClipboardClear tkwin .AP Tcl_Interp *interp in Interpreter to use for reporting errors. .AP Tk_Window tkwin in Index: doc/ClrSelect.3 ================================================================== --- doc/ClrSelect.3 +++ doc/ClrSelect.3 @@ -13,11 +13,10 @@ .SH SYNOPSIS .nf \fB#include \fR .sp \fBTk_ClearSelection\fR(\fItkwin, selection\fR) -.fi .SH ARGUMENTS .AS Tk_Window tkwin .AP Tk_Window tkwin in The selection will be cleared from the display containing this window. Index: doc/ConfigWidg.3 ================================================================== --- doc/ConfigWidg.3 +++ doc/ConfigWidg.3 @@ -13,11 +13,11 @@ .SH SYNOPSIS .nf \fB#include \fR .sp int -\fBTk_ConfigureWidget\fR(\fIinterp, tkwin, specs, objc, objv, widgRec, flags\fR) +\fBTk_ConfigureWidget\fR(\fIinterp, tkwin, specs, argc, argv, widgRec, flags\fR) .sp int \fBTk_ConfigureInfo\fR(\fIinterp, tkwin, specs, widgRec, argvName, flags\fR) .sp int @@ -32,13 +32,13 @@ .AP Tk_Window tkwin in Window used to represent widget (needed to set up X resources). .AP "const Tk_ConfigSpec" *specs in Pointer to table specifying legal configuration options for this widget. -.AP Tcl_Size objc in -Number of arguments in \fIobjv\fR. -.AP "Tcl_Obj *const *" objv in +.AP int argc in +Number of arguments in \fIargv\fR. +.AP "const char" **argv in Command-line options for configuring widget. .AP char *widgRec in/out Points to widget record structure. Fields in this structure get modified by \fBTk_ConfigureWidget\fR to hold configuration information. .AP int flags in @@ -74,20 +74,20 @@ handle configuration information. It is typically invoked when widgets are created, and again when the \fBconfigure\fR command is invoked for a widget. Although intended primarily for widgets, \fBTk_ConfigureWidget\fR -can be used in other situations where \fIobjc-objv\fR information +can be used in other situations where \fIargc-argv\fR information is to be used to fill in a record structure, such as configuring graphical elements for a canvas widget or entries of a menu. .PP \fBTk_ConfigureWidget\fR processes a table specifying the configuration options that are supported -(\fIspecs\fR) and a collection of command-line arguments (\fIobjc\fR and -\fIobjv\fR) to fill in fields of a record (\fIwidgRec\fR). +(\fIspecs\fR) and a collection of command-line arguments (\fIargc\fR and +\fIargv\fR) to fill in fields of a record (\fIwidgRec\fR). It uses the option database and defaults specified in \fIspecs\fR -to fill in fields of \fIwidgRec\fR that are not specified in \fIobjv\fR. +to fill in fields of \fIwidgRec\fR that are not specified in \fIargv\fR. \fBTk_ConfigureWidget\fR normally returns the value \fBTCL_OK\fR; in this case it does not modify \fIinterp\fR. If an error occurs then \fBTCL_ERROR\fR is returned and \fBTk_ConfigureWidget\fR will leave an error message in interpreter \fIinterp\fR's result in the standard Tcl @@ -106,11 +106,11 @@ int \fItype\fR; const char *\fIargvName\fR; const char *\fIdbName\fR; const char *\fIdbClass\fR; const char *\fIdefValue\fR; - size_t \fIoffset\fR; + int \fIoffset\fR; int \fIspecFlags\fR; const Tk_CustomOption *\fIcustomPtr\fR; } \fBTk_ConfigSpec\fR; .CE The \fItype\fR field indicates what type of configuration option this is @@ -119,40 +119,40 @@ value of the option (more on this below). The \fIargvName\fR field is a string such as .QW \-font or .QW \-bg , -which is compared with the values in \fIobjv\fR (if \fIargvName\fR is +which is compared with the values in \fIargv\fR (if \fIargvName\fR is NULL it means this is a grouped entry; see \fBGROUPED ENTRIES\fR below). The \fIdbName\fR and \fIdbClass\fR fields are used to look up a value for this option in the option database. The \fIdefValue\fR field specifies a default value for this configuration option if no -value is specified in either \fIobjv\fR or the option database. +value is specified in either \fIargv\fR or the option database. \fIOffset\fR indicates where in \fIwidgRec\fR to store information about this option, and \fIspecFlags\fR contains additional information to control the processing of this configuration option (see FLAGS below). The last field, \fIcustomPtr\fR, is only used if \fItype\fR is \fBTK_CONFIG_CUSTOM\fR; see CUSTOM OPTION TYPES below. .PP -\fBTk_ConfigureWidget\fR first processes \fIobjv\fR to see which +\fBTk_ConfigureWidget\fR first processes \fIargv\fR to see which (if any) configuration options are specified there. \fIArgv\fR must contain an even number of fields; the first of each pair of fields must match the \fIargvName\fR of some entry in \fIspecs\fR (unique abbreviations are acceptable), and the second field of the pair contains the value for that configuration option. If there are entries in \fIspec\fR for which -there were no matching entries in \fIobjv\fR, +there were no matching entries in \fIargv\fR, \fBTk_ConfigureWidget\fR uses the \fIdbName\fR and \fIdbClass\fR fields of the \fIspecs\fR entry to probe the option database; if a value is found, then it is used as the value for the option. Finally, if no entry is found in the option database, the \fIdefValue\fR field of the \fIspecs\fR entry is used as the value for the configuration option. If the \fIdefValue\fR is NULL, or if the \fBTK_CONFIG_DONT_SET_DEFAULT\fR bit is set in \fIflags\fR, then there is no default value and this \fIspecs\fR entry -will be ignored if no value is specified in \fIobjv\fR or the +will be ignored if no value is specified in \fIargv\fR or the option database. .PP Once a string value has been determined for a configuration option, \fBTk_ConfigureWidget\fR translates the string value into a more useful form, such as a color if \fItype\fR is \fBTK_CONFIG_COLOR\fR or an integer @@ -351,17 +351,17 @@ freed by passing it to \fBTcl_Free\fR. .TP \fBTK_CONFIG_SYNONYM\fR . This \fItype\fR value identifies special entries in \fIspecs\fR that -are synonyms for other entries. If an \fIobjv\fR value matches the +are synonyms for other entries. If an \fIargv\fR value matches the \fIargvName\fR of a \fBTK_CONFIG_SYNONYM\fR entry, the entry is not used directly. Instead, \fBTk_ConfigureWidget\fR searches \fIspecs\fR for another entry whose \fIargvName\fR is the same as the \fIdbName\fR field in the \fBTK_CONFIG_SYNONYM\fR entry; this new entry is used just -as if its \fIargvName\fR had matched the \fIobjv\fR value. The -synonym mechanism allows multiple \fIobjv\fR values to be used for +as if its \fIargvName\fR had matched the \fIargv\fR value. The +synonym mechanism allows multiple \fIargv\fR values to be used for a single configuration option, such as .QW \-background and .QW \-bg . .TP @@ -405,11 +405,11 @@ First, if the \fIflags\fR argument to \fBTk_ConfigureWidget\fR has the \fBTK_CONFIG_ARGV_ONLY\fR bit set (i.e., \fIflags\fR | \fBTK_CONFIG_ARGV_ONLY\fR != 0), then the option database and \fIdefValue\fR fields are not used. In this case, if an entry in -\fIspecs\fR does not match a field in \fIobjv\fR then nothing happens: +\fIspecs\fR does not match a field in \fIargv\fR then nothing happens: the corresponding target is not modified. This feature is useful when the goal is to modify certain configuration options while leaving others in their current state, such as when a \fBconfigure\fR widget command is being processed. .PP @@ -453,10 +453,18 @@ caller has already supplied a default value in the target location. This flag provides a performance optimization where it is expensive to process the default string: the client can compute the default once, save the value, and provide it before calling \fBTk_ConfigureWidget\fR. +.TP +\fBTK_CONFIG_OPTION_SPECIFIED\fR +This bit is +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. .PP The \fBTK_CONFIG_MONO_ONLY\fR and \fBTK_CONFIG_COLOR_ONLY\fR flags are typically used to specify different default values for monochrome and color displays. This is done by creating two entries in \fIspecs\fR that are identical except for their @@ -550,29 +558,29 @@ .PP Applications can extend the built-in configuration types with additional configuration types by writing procedures to parse and print options of the a type and creating a structure pointing to those procedures: .CS -typedef struct { +typedef struct Tk_CustomOption { Tk_OptionParseProc *\fIparseProc\fR; Tk_OptionPrintProc *\fIprintProc\fR; void *\fIclientData\fR; } \fBTk_CustomOption\fR; typedef int \fBTk_OptionParseProc\fR( void *\fIclientData\fR, Tcl_Interp *\fIinterp\fR, Tk_Window \fItkwin\fR, - char *\fIvalue\fR, + const char *\fIvalue\fR, char *\fIwidgRec\fR, - Tcl_Size \fIoffset\fR); + int \fIoffset\fR); typedef const char *\fBTk_OptionPrintProc\fR( void *\fIclientData\fR, Tk_Window \fItkwin\fR, char *\fIwidgRec\fR, - Tcl_Size \fIoffset\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 procedures when they are invoked. The \fIclientData\fR value typically Index: doc/ConfigWind.3 ================================================================== --- doc/ConfigWind.3 +++ doc/ConfigWind.3 @@ -37,11 +37,10 @@ \fBTk_SetWindowColormap\fR(\fItkwin, colormap\fR) .sp \fBTk_DefineCursor\fR(\fItkwin, cursor\fR) .sp \fBTk_UndefineCursor\fR(\fItkwin\fR) -.fi .SH ARGUMENTS .AS XSetWindowAttributes borderWidth .AP Tk_Window tkwin in Token for window. .AP "unsigned int" valueMask in Index: doc/CoordToWin.3 ================================================================== --- doc/CoordToWin.3 +++ doc/CoordToWin.3 @@ -14,11 +14,10 @@ .nf \fB#include \fR .sp Tk_Window \fBTk_CoordsToWindow\fR(\fIrootX, rootY, tkwin\fR) -.fi .SH ARGUMENTS .AS Tk_Window tkwin .AP int rootX in X-coordinate (in root window coordinates). .AP int rootY in Index: doc/CrtCmHdlr.3 ================================================================== --- doc/CrtCmHdlr.3 +++ doc/CrtCmHdlr.3 @@ -14,11 +14,10 @@ \fB#include \fR .sp \fBTk_CreateClientMessageHandler\fR(\fIproc\fR) .sp \fBTk_DeleteClientMessageHandler\fR(\fIproc\fR) -.fi .SH ARGUMENTS .AP Tk_ClientMessageProc *proc in Procedure to invoke whenever a ClientMessage X event occurs on any display. .BE .SH DESCRIPTION Index: doc/CrtConsoleChan.3 ================================================================== --- doc/CrtConsoleChan.3 +++ doc/CrtConsoleChan.3 @@ -12,11 +12,10 @@ .SH SYNOPSIS .nf \fB#include \fR .sp \fBTk_InitConsoleChannels\fR(\fIinterp\fR) -.fi .SH ARGUMENTS .AS Tcl_Interp *interp in .AP Tcl_Interp *interp in Interpreter in which the console channels are created. .BE Index: doc/CrtErrHdlr.3 ================================================================== --- doc/CrtErrHdlr.3 +++ doc/CrtErrHdlr.3 @@ -16,11 +16,10 @@ .sp Tk_ErrorHandler \fBTk_CreateErrorHandler\fR(\fIdisplay, error, request, minor, proc, clientData\fR) .sp \fBTk_DeleteErrorHandler\fR(\fIhandler\fR) -.fi .SH ARGUMENTS .AS "Tk_ErrorHandler" clientData .AP Display *display in Display whose errors are to be handled. .AP int error in Index: doc/CrtGenHdlr.3 ================================================================== --- doc/CrtGenHdlr.3 +++ doc/CrtGenHdlr.3 @@ -15,11 +15,10 @@ \fB#include \fR .sp \fBTk_CreateGenericHandler\fR(\fIproc, clientData\fR) .sp \fBTk_DeleteGenericHandler\fR(\fIproc, clientData\fR) -.fi .SH ARGUMENTS .AS "Tk_GenericProc" clientData .AP Tk_GenericProc *proc in Procedure to invoke whenever any X event occurs on any display. .AP void *clientData in Index: doc/CrtImgType.3 ================================================================== --- doc/CrtImgType.3 +++ doc/CrtImgType.3 @@ -7,20 +7,21 @@ '\" .TH Tk_CreateImageType 3 8.5 Tk "Tk Library Procedures" .so man.macros .BS .SH NAME -Tk_CreateImageType, Tk_GetImageModelData \- define new kind of image +Tk_CreateImageType, Tk_GetImageModelData, Tk_InitImageArgs \- define new kind of image .SH SYNOPSIS .nf \fB#include \fR .sp \fBTk_CreateImageType\fR(\fItypePtr\fR) .sp void * \fBTk_GetImageModelData\fR(\fIinterp, name, typePtrPtr\fR) -.fi +.sp +\fBTk_InitImageArgs\fR(\fIinterp, argc, argvPtr\fR) .SH ARGUMENTS .AS "const Tk_ImageType" *typePtrPtr .AP "const Tk_ImageType" *typePtr in Structure that defines the new type of image. For Tk 8.4 and earlier this must be static: a @@ -31,10 +32,12 @@ .AP "const char" *name in Name of existing image. .AP Tk_ImageType **typePtrPtr out Points to word in which to store a pointer to type information for the given image, if it exists. +.AP int argc in +Number of arguments .AP char ***argvPtr in/out Pointer to argument list .BE .SH DESCRIPTION .PP @@ -53,11 +56,11 @@ kinds of data structures. The first data structure is a Tk_ImageType structure, which contains the name of the image type and pointers to five procedures provided by the image manager to deal with images of this type: .CS -typedef struct { +typedef struct Tk_ImageType { const char *\fIname\fR; Tk_ImageCreateProc *\fIcreateProc\fR; Tk_ImageGetProc *\fIgetProc\fR; Tk_ImageDisplayProc *\fIdisplayProc\fR; Tk_ImageFreeProc *\fIfreeProc\fR; @@ -236,9 +239,45 @@ passed to \fBTk_CreateImageType\fR when the image type was registered) 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 model 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 \fBTk_ImageCreateProc\fR( + Tcl_Interp *\fIinterp\fR, + char *\fIname\fR, + int \fIargc\fR, + char **\fIargv\fR, + Tk_ImageType *\fItypePtr\fR, + Tk_ImageModel \fImodel\fR, + void **\fImodelDataPtr\fR); +.CE +Legacy programs and libraries dating from those days may still +contain code that defines extended Tk image types using the old +interface. The Tk header file will still support this legacy +interface if the code is compiled with the macro \fBUSE_OLD_IMAGE\fR +defined. +.PP +When the \fBUSE_OLD_IMAGE\fR legacy support is enabled, you may +see the routine \fBTk_InitImageArgs\fR in use. This was a migration +tool used to create stub-enabled extensions that could be loaded +into interps containing all versions of Tk 8.1 and later. Tk 8.5 no longer +provides this routine, but uses a macro to convert any attempted +calls of this routine into an empty comment. Any stub-enabled +extension providing an extended image type via the legacy interface +that is compiled against Tk 8.5 headers and linked against the +Tk 8.5 stub library will produce a file that can be loaded only +into interps with Tk 8.5 or later; that is, the normal stub-compatibility +rules. If a developer needs to generate from such code a file +that is loadable into interps with Tk 8.4 or earlier, they must +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, model Index: doc/CrtItemType.3 ================================================================== --- doc/CrtItemType.3 +++ doc/CrtItemType.3 @@ -15,16 +15,14 @@ .sp \fBTk_CreateItemType\fR(\fItypePtr\fR) .sp Tk_ItemType * \fBTk_GetItemTypes\fR() -.fi .SH ARGUMENTS .AS Tk_ItemType *typePtr .AP Tk_ItemType *typePtr in Structure that defines the new type of canvas item. -Note that this is not \fIconst\fR; Tk may write to these structures. .BE .SH INTRODUCTION .PP \fBTk_CreateItemType\fR is invoked to define a new kind of canvas item described by the \fItypePtr\fR argument. @@ -71,11 +69,11 @@ const Tk_ConfigSpec *\fIconfigSpecs\fR; Tk_ItemConfigureProc *\fIconfigProc\fR; Tk_ItemCoordProc *\fIcoordProc\fR; Tk_ItemDeleteProc *\fIdeleteProc\fR; Tk_ItemDisplayProc *\fIdisplayProc\fR; - int \fIflags\fR; + int \fIalwaysRedraw\fR; Tk_ItemPointProc *\fIpointProc\fR; Tk_ItemAreaProc *\fIareaProc\fR; Tk_ItemPostscriptProc *\fIpostscriptProc\fR; Tk_ItemScaleProc *\fIscaleProc\fR; Tk_ItemTranslateProc *\fItranslateProc\fR; @@ -82,11 +80,11 @@ Tk_ItemIndexProc *\fIindexProc\fR; Tk_ItemCursorProc *\fIicursorProc\fR; Tk_ItemSelectionProc *\fIselectionProc\fR; Tk_ItemInsertProc *\fIinsertProc\fR; Tk_ItemDCharsProc *\fIdCharsProc\fR; - struct Tk_ItemType *\fInextPtr\fR; + Tk_ItemType *\fInextPtr\fR; .VS "8.7, TIP164" Tk_ItemRotateProc *\fIrotateProc\fR; .VE "8.7, TIP164" } \fBTk_ItemType\fR; .CE @@ -113,11 +111,11 @@ A type manager must define its item records with a Tk_Item as the first field. For example, the item record for bitmap items is defined as follows: .PP .CS -typedef struct { +typedef struct BitmapItem { Tk_Item \fIheader\fR; double \fIx\fR, \fIy\fR; Tk_Anchor \fIanchor\fR; Pixmap \fIbitmap\fR; XColor *\fIfgColor\fR; @@ -169,20 +167,28 @@ type. If there already existed an item type by this name then the new item type replaces the old one. .SS "FLAGS (IN ALWAYSREDRAW)" .PP -The \fItypePtr\->flags\fR field +The \fItypePtr\->alwaysRedraw\fR field (so named for historic reasons) contains a collection of flag bits that modify how the canvas core interacts with the item. The following bits are defined: .TP \fBTK_ALWAYS_REDRAW\fR . Indicates that the item should always be redrawn when any part of the canvas is redrawn, rather than only when the bounding box of the item overlaps the area being redrawn. This is used by window items, for example, which need to unmap subwindows that are not on the screen. +.TP +\fBTK_CONFIG_OBJS\fR +. +Indicates that operations which would otherwise take a string (or array of +strings) actually take a Tcl_Obj reference (or an array of such references). +The operations to which this applies are the \fIconfigProc\fR, the +\fIcoordProc\fR, the \fIcreateProc\fR, the \fIindexProc\fR and the +\fIinsertProc\fR. .TP \fBTK_MOVABLE_POINTS\fR .VS 8.6 Indicates that the item supports the \fIdCharsProc\fR, \fIindexProc\fR and \fIinsertProc\fR with the same semantics as Tk's built-in line and polygon @@ -221,10 +227,13 @@ Tk has already initialized the item's header (the first \fBsizeof(Tk_ItemType)\fR bytes). The \fIobjc\fR and \fIobjv\fR arguments describe all of the arguments to the \fBcreate\fR command after the \fItype\fR argument. +Note that if \fBTK_CONFIG_OBJS\fR is not set in the +\fItypePtr\->alwaysRedraw\fR field, the \fIobjv\fR parameter will actually +contain a pointer to an array of constant strings. For example, in the widget command: .PP .CS \fB\&.c create rectangle 10 20 50 50 \-fill black\fR .CE @@ -250,12 +259,11 @@ and \fItypePtr\->configProc\fR, but Tk also uses it directly to retrieve option information in the \fBitemcget\fR and \fBitemconfigure\fR widget commands. \fItypePtr\->configSpecs\fR must point to the configuration table for this type. -.PP -Note that Tk provides a custom option type \fBtk_CanvasTagsOption\fR +Note: Tk provides a custom option type \fBtk_CanvasTagsOption\fR for implementing the \fB\-tags\fR option; see an existing type manager for an example of how to use it in \fIconfigSpecs\fR. .SS CONFIGPROC .PP \fItypePtr\->configProc\fR is called by Tk whenever the @@ -275,10 +283,13 @@ .PP The \fIinterp\fR argument identifies the interpreter in which the widget command was invoked, \fIcanvas\fR is a handle for the canvas widget, and \fIitemPtr\fR is a pointer to the item being configured. \fIobjc\fR and \fIobjv\fR contain the configuration options. +Note that if \fBTK_CONFIG_OBJS\fR is not set in the +\fItypePtr\->alwaysRedraw\fR field, the \fIobjv\fR parameter will actually +contain a pointer to an array of constant strings. For example, if the following command is invoked: .PP .CS \fB\&.c itemconfigure 2 \-fill red \-outline black\fR .CE @@ -311,10 +322,13 @@ .CE .PP The arguments \fIinterp\fR, \fIcanvas\fR, and \fIitemPtr\fR all have the standard meanings, and \fIobjc\fR and \fIobjv\fR describe the coordinate arguments. +Note that if \fBTK_CONFIG_OBJS\fR is not set in the +\fItypePtr\->alwaysRedraw\fR field, the \fIobjv\fR parameter will actually +contain a pointer to an array of constant strings. For example, if the following widget command is invoked: .PP .CS \fB\&.c coords 2 30 90\fR .CE @@ -385,13 +399,13 @@ to transform coordinates from those of the canvas to those of \fIdst\fR. .PP Normally an item's \fIdisplayProc\fR is only invoked if the item overlaps the area being displayed. -However, if bit zero of \fItypePtr\->flags\fR is 1, +However, if bit zero of \fItypePtr\->alwaysRedraw\fR is 1, (i.e.\| -.QW "\fItypePtr\->flags & 1 == 1\fR" ) +.QW "\fItypePtr\->alwaysRedraw & 1 == 1\fR" ) then \fIdisplayProc\fR is invoked during every redisplay operation, even if the item does not overlap the area of redisplay; this is useful for cases such as window items, where the subwindow needs to be unmapped when it is off the screen. .SS POINTPROC @@ -561,12 +575,12 @@ The item should adjust the coordinates of its control points so that where they used to have coordinates \fIx\fR and \fIy\fR, they will have new coordinates \fIx\(fm\fR and \fIy\(fm\fR, where .PP .CS -\fIrelX\fR = \fIx\fR \(mi \fIoriginX\fR -\fIrelY\fR = \fIy\fR \(mi \fIoriginY\fR +\fIrelX\fR = \fIx\fR - \fIoriginX\fR +\fIrelY\fR = \fIy\fR - \fIoriginY\fR \fIx\(fm\fR = \fIoriginX\fR + \fIrelX\fR \(mu cos(\fIangleRad\fR) + \fIrelY\fR \(mu sin(\fIangleRad\fR) \fIy\(fm\fR = \fIoriginY\fR \(mi \fIrelX\fR \(mu sin(\fIangleRad\fR) + \fIrelY\fR \(mu cos(\fIangleRad\fR) .CE .PP The control points for an item are not necessarily the coordinates provided to @@ -600,10 +614,13 @@ The \fIinterp\fR, \fIcanvas\fR, and \fIitemPtr\fR arguments all have the usual meaning. \fIindexObj\fR contains a textual description of an index, and \fIindexPtr\fR points to an integer value that should be filled in with a numerical index. +Note that if \fBTK_CONFIG_OBJS\fR is not set in the +\fItypePtr\->alwaysRedraw\fR field, the \fIindexObj\fR parameter will +actually contain a pointer to a constant string. It is up to the type manager to decide what forms of index are supported (e.g., numbers, \fBinsert\fR, \fBsel.first\fR, \fBend\fR, etc.). \fIindexProc\fR should return a Tcl completion code and set the interpreter result in the event of an error. @@ -683,10 +700,13 @@ \fIcanvas\fR and \fIitemPtr\fR have the usual meanings. \fIindex\fR is an index into the item's text, as returned by a previous call to \fItypePtr\->insertProc\fR, and \fIobj\fR contains new text to insert just before the character given by \fIindex\fR. +Note that if \fBTK_CONFIG_OBJS\fR is not set in the +\fItypePtr\->alwaysRedraw\fR field, the \fIobj\fR parameter will +actually contain a pointer to a constant string to be inserted. If the item supports modification of the coordinates list by this .PP The type manager should insert the text and recompute the bounding box in the item's header. .SS DCHARSPROC Index: doc/CrtPhImgFmt.3 ================================================================== --- doc/CrtPhImgFmt.3 +++ doc/CrtPhImgFmt.3 @@ -7,11 +7,11 @@ '\" '\" Author: Paul Mackerras (paulus@cs.anu.edu.au), '\" Department of Computer Science, '\" Australian National University. '\" -.TH Tk_CreatePhotoImageFormat 3 9.0 Tk "Tk Library Procedures" +.TH Tk_CreatePhotoImageFormat 3 8.7 Tk "Tk Library Procedures" .so man.macros .BS .SH NAME Tk_CreatePhotoImageFormat \- define new file format for photo images .SH SYNOPSIS @@ -56,11 +56,11 @@ name of the image file format and pointers to six procedures provided by the handler to deal with files and strings in this format. The Tk_PhotoImageFormatVersion3 structure contains the following fields: .VS 8.7 .CS -typedef struct { +typedef struct Tk_PhotoImageFormatVersion3 { const char *\fIname\fR; Tk_ImageFileMatchProcVersion3 *\fIfileMatchProc\fR; Tk_ImageStringMatchProcVersion3 *\fIstringMatchProc\fR; Tk_ImageFileReadProcVersion3 *\fIfileReadProc\fR; Tk_ImageStringReadProcVersion3 *\fIstringReadProc\fR; @@ -149,11 +149,11 @@ .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 \fBTk_ImageFileReadProcVersion3\fR( +typedef int \fBTk_ImageFileReadProc\fR( Tcl_Interp *\fIinterp\fR, Tcl_Channel \fIchan\fR, const char *\fIfileName\fR, Tcl_Obj *\fIformat\fR, Tcl_Obj *\fImetadataIn\fR, @@ -182,11 +182,11 @@ .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 \fBTk_ImageStringReadProcVersion3\fR( +typedef int \fBTk_ImageStringReadProc\fR( Tcl_Interp *\fIinterp\fR, Tcl_Obj *\fIdata\fR, Tcl_Obj *\fIformat\fR, Tcl_Obj *\fImetadataIn\fR, PhotoHandle \fIimageHandle\fR, @@ -214,11 +214,11 @@ .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 \fBTk_ImageFileWriteProcVersion3\fR( +typedef int \fBTk_ImageFileWriteProc\fR( Tcl_Interp *\fIinterp\fR, const char *\fIfileName\fR, Tcl_Obj *\fIformat\fR, Tcl_Obj *\fImetadataIn\fR, Tk_PhotoImageBlock *\fIblockPtr\fR); @@ -243,11 +243,11 @@ \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 \fBTk_ImageStringWriteProcVersion3\fR( +typedef int \fBTk_ImageStringWriteProc\fR( Tcl_Interp *\fIinterp\fR, Tcl_Obj *\fIformat\fR, Tcl_Obj *\fImetadataIn\fR, Tk_PhotoImageBlock *\fIblockPtr\fR); .CE @@ -273,26 +273,30 @@ contain additional information like image resolution or comments. Image metadata may be read from image files and passed to the script level by including dictionary keys into the metadata property of the image. Image metadata may be written to image data on file write or image data output. +.PP .PP .SS "METADATA KEYS" .PP The metadata may contain any key. A driver will handle only a set of dictionary keys documented in the documentation. See the photo image manual page for currently defined keys for the system drivers. .PP The following rules may give guidance to name metadata keys: -.IP \(bu -Abbreviations are in upper case. -.IP \(bu +.RS +Abreviation are in upper case +.RE +.RS Words are in US English in small case (except proper nouns) -.IP \(bu +.RE +.RS Vertical DPI is expressed as DPI/aspect. The reason is, that some image formats may feature aspect and no resolution value. +.RE .SS "METADATA INPUT" .PP Each driver function gets a Tcl object pointer \fBmetadataIn\fR as parameter. This parameter serves to input a metadata dict to the driver function. @@ -300,24 +304,21 @@ .PP A typical driver code snipped to check for a metadata key is: .CS if (NULL != metadataIn) { Tcl_Obj *itemData; - Tcl_DictObjGet(interp, metadataIn, Tcl_NewStringObj("Comment",-1), - &itemData)); - // use value reference in itemData -} + Tcl_DictObjGet(interp, metadataIn, Tcl_NewStringObj("Comment",-1), &itemData)); .CE .PP -The \fB\-metadata\fR command option data of the following commands is passed +The \-metadata command option data of the following commands is passed to the driver: \fBimage create\fR, \fBconfigure\fR, \fBput\fR, \fBread\fR, \fBdata\fR and \fBwrite\fR. -If no \fB\-metadata\fR command option available or not given, the metadata +If no \-metadata command option available or not given, the metadata property of the image is passed to the driver using the following commands: \fBcget\fR, \fBconfigure\fR, \fBdata\fR and \fBwrite\fR. .PP -Note that setting the \fB\-metadata\fR property of an image using +Note that setting the \-metadata property of an image using \fBconfigure\fR without any other option does not invoke any driver function. .PP The metadata dictionary is not suited to pass options to the driver related to the bitmap representation, as the image bitmap is not @@ -325,28 +326,26 @@ this purpose. .PP .SS "METADATA OUTPUT" .PP The image match and read driver functions may set keys in a prepared -metadata dict to return them. -Those functions get a Tcl object pointer \fImetadataOut\fR as +matadata dict to return them. +Those functions get a Tcl object pointer \fBmetadataOut\fR as parameter. -\fImetadataOut\fR may be NULL to indicate, that no metadata return is -required (\fBput\fR, \fBread\fR subcommands). The variable pointed to -by \fImetadataOut\fR is initialized to an empty unshared dict object if +metadataOut may be NULL to indicate, that no metadata return is +attended(\fBput\fR, \fBread\fR subcommands). +\fBmetadataOut\fR is initialized to an empty unshared dict object if metadata return is attended (\fBimage create\fR command, \fBconfigure\fR subcommand). The driver may set dict keys in this object to return metadata. If a match function succeeds, the metadataOut pointer is passed to the corresponding read function. .PP A sample driver code snippet is: .CS if (NULL != metadataOut) { - Tcl_DictObjPut(NULL, metadataOut, Tcl_NewStringObj("XMP",-1), - Tcl_NewStringObj(xmpMetadata)); -} + Tcl_DictObjPut(NULL, metadataOut, Tcl_NewStringObj("XMP",-1), Tcl_NewStringObj(xmpMetadata); .CE .PP The metadata keys returned by the driver are merged into the present metadata property of the image or into the metadata dict given by the \fB\-metadata\fR command line option. @@ -375,11 +374,11 @@ .SS DESCRIPTION A driver using the version 2 interface invokes \fBTk_CreatePhotoImageFormat\fR for driver registration. The Tk_PhotoImageFormat structure contains the following fields: .CS -typedef struct { +typedef struct Tk_PhotoImageFormat { const char *\fIname\fR; Tk_ImageFileMatchProc *\fIfileMatchProc\fR; Tk_ImageStringMatchProc *\fIstringMatchProc\fR; Tk_ImageFileReadProc *\fIfileReadProc\fR; Tk_ImageStringReadProc *\fIstringReadProc\fR; @@ -456,9 +455,48 @@ typedef int \fBTk_ImageStringWriteProc\fR( Tcl_Interp *\fIinterp\fR, Tcl_Obj *\fIformat\fR, Tk_PhotoImageBlock *\fIblockPtr\fR); .CE +.PP +.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 +those days may still contain code that defines extended Tk photo image +formats using the old interface. The Tk header file will still support +this legacy interface if the code is compiled with the +macro \fBUSE_OLD_IMAGE\fR defined. Alternatively, the legacy interfaces +are used if the first character of \fIformatPtr->name\fR is an +uppercase ASCII character (\fBA\fR-\fBZ\fR), and explicit casts +are used to forgive the type mismatch. For example, +.CS +static Tk_PhotoImageFormat myFormat = { + "MyFormat", + (Tk_ImageFileMatchProc *) FileMatch, + NULL, + (Tk_ImageFileReadProc *) FileRead, + NULL, + NULL, + NULL +}; +.CE +would define a minimal \fBTk_PhotoImageFormat\fR that operates provide +only file reading capability, where \fBFileMatch\fR and \fBFileRead\fR +are written according to the legacy interfaces of Tk 8.2 or earlier. +.PP +Any stub-enabled extension providing an extended photo image format +via the legacy interface enabled by the \fBUSE_OLD_IMAGE\fR macro +that is compiled against Tk 8.5 headers and linked against the +Tk 8.5 stub library will produce a file that can be loaded only +into interps with Tk 8.5 or later; that is, the normal stub-compatibility +rules. If a developer needs to generate from such code a file +that is loadable into interps with Tk 8.4 or earlier, they must +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 Index: doc/CrtSelHdlr.3 ================================================================== --- doc/CrtSelHdlr.3 +++ doc/CrtSelHdlr.3 @@ -15,11 +15,10 @@ \fB#include \fR .sp \fBTk_CreateSelHandler\fR(\fItkwin, selection, target, proc, clientData, format\fR) .sp \fBTk_DeleteSelHandler\fR(\fItkwin, selection, target\fR) -.fi .SH ARGUMENTS .AS Tk_SelectionProc clientData .AP Tk_Window tkwin in Window for which \fIproc\fR will provide selection information. .AP Atom selection in @@ -53,15 +52,15 @@ the selection. The most common form is STRING. .PP \fIProc\fR should have arguments and result that match the type \fBTk_SelectionProc\fR: .CS -typedef Tcl_Size \fBTk_SelectionProc\fR( +typedef int \fBTk_SelectionProc\fR( void *\fIclientData\fR, - Tcl_Size \fIoffset\fR, + int \fIoffset\fR, char *\fIbuffer\fR, - Tcl_Size \fImaxBytes\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. Typically, \fIclientData\fR points to a data structure containing application-specific information that is Index: doc/CrtWindow.3 ================================================================== --- doc/CrtWindow.3 +++ doc/CrtWindow.3 @@ -24,11 +24,10 @@ \fBTk_CreateWindowFromPath\fR(\fIinterp, tkwin, pathName, topLevScreen\fR) .sp \fBTk_DestroyWindow\fR(\fItkwin\fR) .sp \fBTk_MakeWindowExist\fR(\fItkwin\fR) -.fi .SH ARGUMENTS .AS Tcl_Interp *topLevScreen .AP Tcl_Interp *interp out Tcl interpreter to use for error reporting. If no error occurs, then \fI*interp\fR is not modified. Index: doc/DeleteImg.3 ================================================================== --- doc/DeleteImg.3 +++ doc/DeleteImg.3 @@ -12,11 +12,10 @@ .SH SYNOPSIS .nf \fB#include \fR .sp \fBTk_DeleteImage\fR(\fIinterp, name\fR) -.fi .SH ARGUMENTS .AS Tcl_Interp *interp .AP Tcl_Interp *interp in Interpreter for which the image was created. .AP "const char" *name in Index: doc/DrawFocHlt.3 ================================================================== --- doc/DrawFocHlt.3 +++ doc/DrawFocHlt.3 @@ -11,12 +11,11 @@ Tk_DrawFocusHighlight \- draw the traversal highlight ring for a widget .SH SYNOPSIS .nf \fB#include \fR .sp -\fBTk_DrawFocusHighlight\fR(\fItkwin, gc, width, drawable\fR) -.fi +\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. Index: doc/EventHndlr.3 ================================================================== --- doc/EventHndlr.3 +++ doc/EventHndlr.3 @@ -27,11 +27,11 @@ .AP unsigned button in Button number. .AP "const char" *eventName in The name of the virtual event. .AP Tcl_Obj *detail in -Detail information for the virtual event. +Detail information for the virtual event. May be NULL. .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. Index: doc/FindPhoto.3 ================================================================== --- doc/FindPhoto.3 +++ doc/FindPhoto.3 @@ -30,20 +30,21 @@ zoomX, zoomY, subsampleX, subsampleY, compRule\fR) .sp int \fBTk_PhotoGetImage\fR(\fIhandle, blockPtr\fR) .sp +void \fBTk_PhotoBlank\fR(\fIhandle\fR) .sp int \fBTk_PhotoExpand\fR(\fIinterp, handle, width, height\fR) .sp +void \fBTk_PhotoGetSize\fR(\fIhandle, widthPtr, heightPtr\fR) .sp int \fBTk_PhotoSetSize\fR(\fIinterp. handle, width, height\fR) -.fi .SH ARGUMENTS .AS Tk_PhotoImageBlock window_path .AP Tcl_Interp *interp in Interpreter in which image was created and in which error reporting is to be done. Index: doc/FontId.3 ================================================================== --- doc/FontId.3 +++ doc/FontId.3 @@ -13,17 +13,16 @@ .SH SYNOPSIS .nf \fB#include \fR .sp Font -\fBTk_FontId\fR(\fItkfont\fR) +\fBTk_FontId(\fItkfont\fB)\fR .sp -\fBTk_GetFontMetrics\fR(\fItkfont, fmPtr\fR) +\fBTk_GetFontMetrics(\fItkfont, fmPtr\fB)\fR .sp int -\fBTk_PostscriptFontName\fR(\fItkfont, dsPtr\fR) -.fi +\fBTk_PostscriptFontName(\fItkfont, dsPtr\fB)\fR .SH ARGUMENTS .AS Tk_FontMetrics *dsPtr .AP Tk_Font tkfont in Opaque font token being queried. Must have been returned by a previous call to \fBTk_GetFont\fR. @@ -68,11 +67,11 @@ .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 -typedef struct { +typedef struct Tk_FontMetrics { int \fIascent\fR; int \fIdescent\fR; int \fIlinespace\fR; } \fBTk_FontMetrics\fR; .CE ADDED doc/FreeXId.3 Index: doc/FreeXId.3 ================================================================== --- /dev/null +++ doc/FreeXId.3 @@ -0,0 +1,30 @@ +'\" +'\" 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. +'\" +.TH Tk_FreeXId 3 4.0 Tk "Tk Library Procedures" +.so man.macros +.BS +.SH NAME +Tk_FreeXId \- make X resource identifier available for reuse +.SH SYNOPSIS +.nf +\fB#include \fR +.sp +\fBTk_FreeXId(\fIdisplay, id\fB)\fR +.SH ARGUMENTS +.AS Display *display out +.AP Display *display in +Display for which \fIid\fR was allocated. +.AP XID id in +Identifier of X resource (window, font, pixmap, cursor, graphics +context, or colormap) that is no longer in use. +.BE +.SH DESCRIPTION +.PP +This function is deprecated, it doesn't do anything since 2008-08-19. +.SH KEYWORDS +resource identifier Index: doc/GeomReq.3 ================================================================== --- doc/GeomReq.3 +++ doc/GeomReq.3 @@ -19,11 +19,10 @@ \fBTk_SetMinimumRequestSize\fR(\fItkwin, minWidth, minHeight\fR) .sp \fBTk_SetInternalBorder\fR(\fItkwin, width\fR) .sp \fBTk_SetInternalBorderEx\fR(\fItkwin, left, right, top, bottom\fR) -.fi .SH ARGUMENTS .AS baseHeight clientData .AP Tk_Window tkwin in Window for which geometry is being requested. .AP int reqWidth in @@ -35,21 +34,17 @@ .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. +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. +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. +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. +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 Index: doc/GetAnchor.3 ================================================================== --- doc/GetAnchor.3 +++ doc/GetAnchor.3 @@ -13,18 +13,17 @@ .SH SYNOPSIS .nf \fB#include \fR .sp int -\fBTk_GetAnchorFromObj\fR(\fIinterp, objPtr, anchorPtr\fR) +\fBTk_GetAnchorFromObj(\fIinterp, objPtr, anchorPtr\fB)\fR .sp int -\fBTk_GetAnchor\fR(\fIinterp, string, anchorPtr\fR) +\fBTk_GetAnchor(\fIinterp, string, anchorPtr\fB)\fR .sp const char * -\fBTk_NameOfAnchor\fR(\fIanchor\fR) -.fi +\fBTk_NameOfAnchor(\fIanchor\fB)\fR .SH ARGUMENTS .AS "Tk_Anchor" *anchorPtr .AP Tcl_Interp *interp in Interpreter to use for error reporting, or NULL. .AP Tcl_Obj *objPtr in/out Index: doc/GetBitmap.3 ================================================================== --- doc/GetBitmap.3 +++ doc/GetBitmap.3 @@ -13,30 +13,29 @@ .SH SYNOPSIS .nf \fB#include \fR .sp Pixmap -\fBTk_AllocBitmapFromObj\fR(\fIinterp, tkwin, objPtr\fR) +\fBTk_AllocBitmapFromObj(\fIinterp, tkwin, objPtr\fB)\fR .sp Pixmap -\fBTk_GetBitmap\fR(\fIinterp, tkwin, info\fR) +\fBTk_GetBitmap(\fIinterp, tkwin, info\fB)\fR .sp Pixmap -\fBTk_GetBitmapFromObj\fR(\fItkwin, objPtr\fR) +\fBTk_GetBitmapFromObj(\fItkwin, objPtr\fB)\fR .sp int -\fBTk_DefineBitmap\fR(\fIinterp, name, source, width, height\fR) +\fBTk_DefineBitmap(\fIinterp, name, source, width, height\fB)\fR .sp const char * -\fBTk_NameOfBitmap\fR(\fIdisplay, bitmap\fR) -.sp -\fBTk_SizeOfBitmap\fR(\fIdisplay, bitmap, widthPtr, heightPtr\fR) -.sp -\fBTk_FreeBitmapFromObj\fR(\fItkwin, objPtr\fR) -.sp -\fBTk_FreeBitmap\fR(\fIdisplay, bitmap\fR) -.fi +\fBTk_NameOfBitmap(\fIdisplay, bitmap\fB)\fR +.sp +\fBTk_SizeOfBitmap(\fIdisplay, bitmap, widthPtr, heightPtr\fB)\fR +.sp +\fBTk_FreeBitmapFromObj(\fItkwin, objPtr\fB)\fR +.sp +\fBTk_FreeBitmap(\fIdisplay, bitmap\fB)\fR .SH ARGUMENTS .AS "unsigned long" *pixelPtr .AP Tcl_Interp *interp in Interpreter to use for error reporting; if NULL then no error message is left after errors. @@ -79,78 +78,102 @@ in \fItkwin\fR. It re-uses an existing bitmap, if possible, and creates a new one otherwise. \fIObjPtr\fR's value must have one of the following forms: .TP 20 \fB@\fIfileName\fR -. \fIFileName\fR must be the name of a file containing a bitmap description in the standard X11 format. .TP 20 \fIname\fR -. \fIName\fR must be the name of a bitmap defined previously with a call to \fBTk_DefineBitmap\fR. The following names are pre-defined by Tk: .RS -.IP \fBerror\fR 12 +.TP 12 +\fBerror\fR The international .QW don't symbol: a circle with a diagonal line across it. -.IP \fBgray75\fR 12 +.TP 12 +\fBgray75\fR 75% gray: a checkerboard pattern where three out of four bits are on. -.IP \fBgray50\fR 12 +.TP 12 +\fBgray50\fR 50% gray: a checkerboard pattern where every other bit is on. -.IP \fBgray25\fR 12 +.TP 12 +\fBgray25\fR 25% gray: a checkerboard pattern where one out of every four bits is on. -.IP \fBgray12\fR 12 +.TP 12 +\fBgray12\fR 12.5% gray: a pattern where one-eighth of the bits are on, consisting of every fourth pixel in every other row. -.IP \fBhourglass\fR 12 +.TP 12 +\fBhourglass\fR An hourglass symbol. -.IP \fBinfo\fR 12 +.TP 12 +\fBinfo\fR A large letter .QW i . -.IP \fBquesthead\fR 12 +.TP 12 +\fBquesthead\fR The silhouette of a human head, with a question mark in it. -.IP \fBquestion\fR 12 +.TP 12 +\fBquestion\fR A large question-mark. -.IP \fBwarning\fR 12 +.TP 12 +\fBwarning\fR A large exclamation point. .PP In addition, the following pre-defined names are available only on the \fBMacintosh\fR platform: -.IP \fBdocument\fR 12 +.TP 12 +\fBdocument\fR A generic document. -.IP \fBstationery\fR 12 +.TP 12 +\fBstationery\fR Document stationery. -.IP \fBedition\fR 12 +.TP 12 +\fBedition\fR The \fIedition\fR symbol. -.IP \fBapplication\fR 12 +.TP 12 +\fBapplication\fR Generic application icon. -.IP \fBaccessory\fR 12 +.TP 12 +\fBaccessory\fR A desk accessory. -.IP \fBfolder\fR 12 +.TP 12 +\fBfolder\fR Generic folder icon. -.IP \fBpfolder\fR 12 +.TP 12 +\fBpfolder\fR A locked folder. -.IP \fBtrash\fR 12 +.TP 12 +\fBtrash\fR A trash can. -.IP \fBfloppy\fR 12 +.TP 12 +\fBfloppy\fR A floppy disk. -.IP \fBramdisk\fR 12 +.TP 12 +\fBramdisk\fR A floppy disk with chip. -.IP \fBcdrom\fR 12 +.TP 12 +\fBcdrom\fR A cd disk icon. -.IP \fBpreferences\fR 12 +.TP 12 +\fBpreferences\fR A folder with prefs symbol. -.IP \fBquerydoc\fR 12 +.TP 12 +\fBquerydoc\fR A database document icon. -.IP \fBstop\fR 12 +.TP 12 +\fBstop\fR A stop sign. -.IP \fBnote\fR 12 +.TP 12 +\fBnote\fR A face with balloon words. -.IP \fBcaution\fR 12 +.TP 12 +\fBcaution\fR A triangle with an exclamation point. .RE .LP Under normal conditions, \fBTk_AllocBitmapFromObj\fR returns an identifier for the requested bitmap. If an error @@ -185,11 +208,11 @@ describe the bitmap. \fBTk_DefineBitmap\fR normally returns \fBTCL_OK\fR; if an error occurs (e.g. a bitmap named \fInameId\fR has already been defined) then \fBTCL_ERROR\fR is returned and an error message is left in interpreter \fIinterp\fR's result. -Note that \fBTk_DefineBitmap\fR expects the memory pointed to by +Note: \fBTk_DefineBitmap\fR expects the memory pointed to by \fIsource\fR to be static: \fBTk_DefineBitmap\fR does not make a private copy of this memory, but uses the bytes pointed to by \fIsource\fR later in calls to \fBTk_AllocBitmapFromObj\fR or \fBTk_GetBitmap\fR. .PP Index: doc/GetCapStyl.3 ================================================================== --- doc/GetCapStyl.3 +++ doc/GetCapStyl.3 @@ -13,15 +13,14 @@ .SH SYNOPSIS .nf \fB#include \fR .sp int -\fBTk_GetCapStyle\fR(\fIinterp, string, capPtr\fR) +\fBTk_GetCapStyle(\fIinterp, string, capPtr\fB)\fR .sp const char * -\fBTk_NameOfCapStyle\fR(\fIcap\fR) -.fi +\fBTk_NameOfCapStyle(\fIcap\fB)\fR .SH ARGUMENTS .AS "Tcl_Interp" *capPtr .AP Tcl_Interp *interp in Interpreter to use for error reporting. .AP "const char" *string in Index: doc/GetClrmap.3 ================================================================== --- doc/GetClrmap.3 +++ doc/GetClrmap.3 @@ -13,16 +13,15 @@ .SH SYNOPSIS .nf \fB#include \fR .sp Colormap -\fBTk_GetColormap\fR(\fIinterp, tkwin, string\fR) +\fBTk_GetColormap(\fIinterp, tkwin, string\fB)\fR .sp -\fBTk_PreserveColormap\fR(\fIdisplay, colormap\fR) +\fBTk_PreserveColormap(\fIdisplay, colormap\fB)\fR .sp -\fBTk_FreeColormap\fR(\fIdisplay, colormap\fR) -.fi +\fBTk_FreeColormap(\fIdisplay, colormap\fB)\fR .SH ARGUMENTS .AS "Colormap" colormap .AP Tcl_Interp *interp in Interpreter to use for error reporting. .AP Tk_Window tkwin in Index: doc/GetCursor.3 ================================================================== --- doc/GetCursor.3 +++ doc/GetCursor.3 @@ -55,13 +55,13 @@ Height of \fIsource\fR and \fImask\fR. .AP "int" xHot in X-location of cursor hot-spot. .AP "int" yHot in Y-location of cursor hot-spot. -.AP "const char" *fg in +.AP Tk_Uid fg in Textual description of foreground color for cursor. -.AP "const char" *bg in +.AP Tk_Uid bg in Textual description of background color for cursor. .AP Display *display in Display for which \fIcursor\fR was allocated. .AP Tk_Cursor cursor in Opaque Tk identifier for cursor. If passed to \fBTk_FreeCursor\fR, must @@ -172,11 +172,11 @@ Tk_Cursor cursor; #include "source.cursor" #include "mask.cursor" cursor = Tk_GetCursorFromData(interp, tkwin, source_bits, mask_bits, source_width, source_height, source_x_hot, - source_y_hot, "red", "blue"); + source_y_hot, Tk_GetUid("red"), Tk_GetUid("blue")); .CE .PP Under normal conditions \fBTk_GetCursorFromData\fR will return an identifier for the requested cursor. If an error occurs in creating the cursor then \fBNone\fR is returned and an error Index: doc/GetFont.3 ================================================================== --- doc/GetFont.3 +++ doc/GetFont.3 @@ -13,29 +13,29 @@ .SH SYNOPSIS .nf \fB#include \fR .sp Tk_Font -\fBTk_AllocFontFromObj\fR(\fIinterp, tkwin, objPtr\fR) +\fBTk_AllocFontFromObj(\fIinterp, tkwin, objPtr\fB)\fR .sp Tk_Font -\fBTk_GetFont\fR(\fIinterp, tkwin, string\fR) +\fBTk_GetFont(\fIinterp, tkwin, string\fB)\fR .sp Tk_Font -\fBTk_GetFontFromObj\fR(\fItkwin, objPtr\fR) +\fBTk_GetFontFromObj(\fItkwin, objPtr\fB)\fR .sp Tcl_Obj * -\fBTk_FontGetDescription\fR(\fItkfont\fR) +\fBTk_FontGetDescription(\fItkfont\fB)\fR .sp const char * -\fBTk_NameOfFont\fR(\fItkfont\fR) +\fBTk_NameOfFont(\fItkfont\fB)\fR .sp Tk_Font -\fBTk_FreeFontFromObj\fR(\fItkwin, objPtr\fR) +\fBTk_FreeFontFromObj(\fItkwin, objPtr\fB)\fR .sp -\fBTk_FreeFont\fR(\fItkfont\fR) -.fi +void +\fBTk_FreeFont(\fItkfont\fB)\fR .SH ARGUMENTS .AS "const char" *tkfont .AP "Tcl_Interp" *interp in Interpreter to use for error reporting. If \fBNULL\fR, then no error messages are left after errors. @@ -90,12 +90,11 @@ windows or for different purposes), then a single Tk_Font will be shared for all uses. The underlying resources will be freed automatically when no-one is using the font anymore. .PP The procedure \fBTk_FontGetDescription\fR returns information about the font -description as a Tcl list. One possible result is -.QW "{{DejaVu Sans} -16 bold underline}" . +description as a Tcl list. One possible result is "{{DejaVu Sans} -16 bold underline}". .PP The procedure \fBTk_NameOfFont\fR is roughly the inverse of \fBTk_GetFont\fR. Given a \fItkfont\fR that was created by \fBTk_GetFont\fR (or \fBTk_AllocFontFromObj\fR), the return value is the \fIstring\fR argument that was Index: doc/GetGC.3 ================================================================== --- doc/GetGC.3 +++ doc/GetGC.3 @@ -15,12 +15,11 @@ \fB#include \fR .sp GC \fBTk_GetGC\fR(\fItkwin, valueMask, valuePtr\fR) .sp -\fBTk_FreeGC\fR(\fIdisplay, gc\fR) -.fi +\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 Index: doc/GetHINSTANCE.3 ================================================================== --- doc/GetHINSTANCE.3 +++ doc/GetHINSTANCE.3 @@ -11,11 +11,10 @@ .nf \fB#include \fR .sp HINSTANCE \fBTk_GetHINSTANCE\fR() -.fi .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. Index: doc/GetHWND.3 ================================================================== --- doc/GetHWND.3 +++ doc/GetHWND.3 @@ -14,11 +14,10 @@ HWND \fBTk_GetHWND\fR(\fIwindow\fR) .sp Window \fBTk_AttachHWND\fR(\fItkwin, hwnd\fR) -.fi .SH ARGUMENTS .AP Window window in X token for window. .AP Tk_Window tkwin in Tk window for window. Index: doc/GetImage.3 ================================================================== --- doc/GetImage.3 +++ doc/GetImage.3 @@ -20,11 +20,10 @@ \fBTk_RedrawImage\fR(\fIimage, imageX, imageY, width, height, drawable, drawableX, drawableY\fR) .sp \fBTk_SizeOfImage\fR(\fIimage, widthPtr, heightPtr\fR) .sp \fBTk_FreeImage\fR(\fIimage\fR) -.fi .SH ARGUMENTS .AS Tk_ImageChangedProc *changeProc .AP Tcl_Interp *interp in Place to leave error message. .AP Tk_Window tkwin in Index: doc/GetJoinStl.3 ================================================================== --- doc/GetJoinStl.3 +++ doc/GetJoinStl.3 @@ -13,15 +13,14 @@ .SH SYNOPSIS .nf \fB#include \fR .sp int -\fBTk_GetJoinStyle\fR(\fIinterp, string, joinPtr\fR) +\fBTk_GetJoinStyle(\fIinterp, string, joinPtr\fB)\fR .sp const char * -\fBTk_NameOfJoinStyle\fR(\fIjoin\fR) -.fi +\fBTk_NameOfJoinStyle(\fIjoin\fB)\fR .SH ARGUMENTS .AS "Tcl_Interp" *joinPtr .AP Tcl_Interp *interp in Interpreter to use for error reporting. .AP "const char" *string in Index: doc/GetJustify.3 ================================================================== --- doc/GetJustify.3 +++ doc/GetJustify.3 @@ -13,18 +13,17 @@ .SH SYNOPSIS .nf \fB#include \fR .sp int -\fBTk_GetJustifyFromObj\fR(\fIinterp, objPtr, justifyPtr\fR) +\fBTk_GetJustifyFromObj(\fIinterp, objPtr, justifyPtr\fB)\fR .sp int -\fBTk_GetJustify\fR(\fIinterp, string, justifyPtr\fR) +\fBTk_GetJustify(\fIinterp, string, justifyPtr\fB)\fR .sp const char * -\fBTk_NameOfJustify\fR(\fIjustify\fR) -.fi +\fBTk_NameOfJustify(\fIjustify\fB)\fR .SH ARGUMENTS .AS "Tk_Justify" *justifyPtr .AP Tcl_Interp *interp in Interpreter to use for error reporting, or NULL. .AP Tcl_Obj *objPtr in/out @@ -47,17 +46,20 @@ .SH DESCRIPTION .PP \fBTk_GetJustifyFromObj\fR places in \fI*justifyPtr\fR the justify value corresponding to \fIobjPtr\fR's value. This value will be one of the following: -.IP \fBTK_JUSTIFY_LEFT\fR +.TP +\fBTK_JUSTIFY_LEFT\fR Means that the text on each line should start at the left edge of the line; as a result, the right edges of lines may be ragged. -.IP \fBTK_JUSTIFY_RIGHT\fR +.TP +\fBTK_JUSTIFY_RIGHT\fR Means that the text on each line should end at the right edge of the line; as a result, the left edges of lines may be ragged. -.IP \fBTK_JUSTIFY_CENTER\fR +.TP +\fBTK_JUSTIFY_CENTER\fR Means that the text on each line should be centered; as a result, both the left and right edges of lines may be ragged. .PP Under normal circumstances the return value is \fBTCL_OK\fR and \fIinterp\fR is unused. Index: doc/GetOption.3 ================================================================== --- doc/GetOption.3 +++ doc/GetOption.3 @@ -14,11 +14,10 @@ .nf \fB#include \fR .sp Tk_Uid \fBTk_GetOption\fR(\fItkwin, name, class\fR) -.fi .SH ARGUMENTS .AS Tk_Window *class .AP Tk_Window tkwin in Token for window. .AP "const char" *name in Index: doc/GetPixels.3 ================================================================== --- doc/GetPixels.3 +++ doc/GetPixels.3 @@ -13,24 +13,23 @@ .SH SYNOPSIS .nf \fB#include \fR .sp int -\fBTk_GetPixelsFromObj\fR(\fIinterp, tkwin, objPtr, intPtr\fR) +\fBTk_GetPixelsFromObj(\fIinterp, tkwin, objPtr, intPtr\fB)\fR +.sp +int +\fBTk_GetDoublePixelsFromObj(\fIinterp, tkwin, objPtr, doublePtr\fB)\fR .sp int -\fBTk_GetDoublePixelsFromObj\fR(\fIinterp, tkwin, objPtr, doublePtr\fR) +\fBTk_GetPixels(\fIinterp, tkwin, string, intPtr\fB)\fR .sp int -\fBTk_GetPixels\fR(\fIinterp, tkwin, string, intPtr\fR) +\fBTk_GetMMFromObj(\fIinterp, tkwin, objPtr, doublePtr\fB)\fR .sp int -\fBTk_GetMMFromObj\fR(\fIinterp, tkwin, objPtr, doublePtr\fR) -.sp -int -\fBTk_GetScreenMM\fR(\fIinterp, tkwin, string, doublePtr\fR) -.fi +\fBTk_GetScreenMM(\fIinterp, tkwin, string, doublePtr\fB)\fR .SH ARGUMENTS .AS "Tcl_Interp" *joinPtr .AP Tcl_Interp *interp in Interpreter to use for error reporting. .AP Tk_Window tkwin in @@ -55,19 +54,24 @@ In either case, \fIobjPtr\fR or \fIstring\fR specifies a screen distance as a floating-point number followed by one of the following characters that indicates units: -.IP +.TP + The number specifies a distance in pixels. -.IP \fBc\fR +.TP +\fBc\fR The number specifies a distance in centimeters on the screen. -.IP \fBi\fR +.TP +\fBi\fR The number specifies a distance in inches on the screen. -.IP \fBm\fR +.TP +\fBm\fR The number specifies a distance in millimeters on the screen. -.IP \fBp\fR +.TP +\fBp\fR The number specifies a distance in printer's points (1/72 inch) on the screen. .PP \fBTk_GetPixelsFromObj\fR converts the value of \fIobjPtr\fR to the nearest even number of pixels and stores that value at \fI*intPtr\fR. Index: doc/GetPixmap.3 ================================================================== --- doc/GetPixmap.3 +++ doc/GetPixmap.3 @@ -13,14 +13,13 @@ .SH SYNOPSIS .nf \fB#include \fR .sp Pixmap -\fBTk_GetPixmap\fR(\fIdisplay, d, width, height, depth\fR) +\fBTk_GetPixmap(\fIdisplay, d, width, height, depth\fB)\fR .sp -\fBTk_FreePixmap\fR(\fIdisplay, pixmap\fR) -.fi +\fBTk_FreePixmap(\fIdisplay, pixmap\fB)\fR .SH ARGUMENTS .AS "Drawable" *pixelPtr .AP Display *display in X display for the pixmap. .AP Drawable d in Index: doc/GetRootCrd.3 ================================================================== --- doc/GetRootCrd.3 +++ doc/GetRootCrd.3 @@ -13,11 +13,10 @@ .SH SYNOPSIS .nf \fB#include \fR .sp \fBTk_GetRootCoords\fR(\fItkwin, xPtr, yPtr\fR) -.fi .SH ARGUMENTS .AS Tk_Window tkwin .AP Tk_Window tkwin in Token for window. .AP int *xPtr out Index: doc/GetScroll.3 ================================================================== --- doc/GetScroll.3 +++ doc/GetScroll.3 @@ -13,20 +13,19 @@ .SH SYNOPSIS .nf \fB#include \fR .sp int -\fBTk_GetScrollInfoObj\fR(\fIinterp, objc, objv, fractionPtr, stepsPtr\fR) +\fBTk_GetScrollInfoObj(\fIinterp, objc, objv, fractionPtr, stepsPtr\fB)\fR .sp int -\fBTk_GetScrollInfo\fR(\fIinterp, argc, argv, fractionPtr, stepsPtr\fR) -.fi +\fBTk_GetScrollInfo(\fIinterp, argc, argv, fractionPtr, stepsPtr\fB)\fR .SH ARGUMENTS .AS "Tcl_Interp" *fractionPtr .AP Tcl_Interp *interp in Interpreter to use for error reporting. -.AP Tcl_Size objc in +.AP int objc in Number of Tcl_Obj's in \fIobjv\fR array. .AP "Tcl_Obj *const *" objv in Argument objects. These represent the entire widget command, of which the first word is typically the widget name and the second word is typically \fBxview\fR or \fByview\fR. Index: doc/GetSelect.3 ================================================================== --- doc/GetSelect.3 +++ doc/GetSelect.3 @@ -14,11 +14,10 @@ .nf \fB#include \fR .sp int \fBTk_GetSelection\fR(\fIinterp, tkwin, selection, target, proc, clientData\fR) -.fi .SH ARGUMENTS .AS Tk_GetSelProc clientData .AP Tcl_Interp *interp in Interpreter to use for reporting errors. .AP Tk_Window tkwin in Index: doc/GetUid.3 ================================================================== --- doc/GetUid.3 +++ doc/GetUid.3 @@ -14,11 +14,10 @@ .nf \fB#include \fR .sp Tk_Uid \fBTk_GetUid\fR(\fIstring\fR) -.fi .SH ARGUMENTS .AP char *string in String for which the corresponding unique identifier is desired. .BE Index: doc/GetVRoot.3 ================================================================== --- doc/GetVRoot.3 +++ doc/GetVRoot.3 @@ -12,12 +12,11 @@ Tk_GetVRootGeometry \- Get location and size of virtual root for window .SH SYNOPSIS .nf \fB#include \fR .sp -\fBTk_GetVRootGeometry\fR(\fItkwin, xPtr, yPtr, widthPtr, heightPtr\fR) -.fi +\fBTk_GetVRootGeometry(\fItkwin, xPtr, yPtr, widthPtr, heightPtr\fB)\fR .SH ARGUMENTS .AS Tk_Window heightPtr .AP Tk_Window tkwin in Token for window whose virtual root is to be queried. .AP int xPtr out Index: doc/GetVisual.3 ================================================================== --- doc/GetVisual.3 +++ doc/GetVisual.3 @@ -13,12 +13,11 @@ .SH SYNOPSIS .nf \fB#include \fR .sp Visual * -\fBTk_GetVisual\fR(\fIinterp, tkwin, string, depthPtr, colormapPtr\fR) -.fi +\fBTk_GetVisual(\fIinterp, tkwin, string, depthPtr, colormapPtr\fB)\fR .SH ARGUMENTS .AS "Tcl_Interp" *colormapPtr .AP Tcl_Interp *interp in Interpreter to use for error reporting. .AP Tk_Window tkwin in @@ -47,11 +46,10 @@ .PP The \fIstring\fR argument specifies the desired visual in one of the following ways: .TP 15 \fIclass depth\fR -. The string consists of a class name followed by an integer depth, with any amount of white space (including none) in between. \fIclass\fR selects what sort of visual is desired and must be one of \fBdirectcolor\fR, \fBgrayscale\fR, \fBgreyscale\fR, \fBpseudocolor\fR, \fBstaticcolor\fR, \fBstaticgray\fR, \fBstaticgrey\fR, or @@ -62,25 +60,21 @@ if there is no visual of the desired depth then \fBTk_GetVisual\fR looks first for a visual with greater depth, then one with less depth. .TP 15 \fBdefault\fR -. Use the default visual for \fItkwin\fR's screen. .TP 15 \fIpathName\fR -. Use the visual for the window given by \fIpathName\fR. \fIpathName\fR must be the name of a window on the same screen as \fItkwin\fR. .TP 15 \fInumber\fR -. Use the visual whose X identifier is \fInumber\fR. .TP 15 \fBbest\fR ?\fIdepth\fR? -. Choose the .QW "best possible" visual, using the following rules, in decreasing order of priority: .RS .IP (a) Index: doc/Grab.3 ================================================================== --- doc/Grab.3 +++ doc/Grab.3 @@ -12,12 +12,12 @@ \fB#include \fR .sp int \fBTk_Grab\fR(\fIinterp, tkwin, grabGlobal\fR) .sp +void \fBTk_Ungrab\fR(\fItkwin\fR) -.fi .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 Index: doc/HWNDToWindow.3 ================================================================== --- doc/HWNDToWindow.3 +++ doc/HWNDToWindow.3 @@ -11,11 +11,10 @@ .nf \fB#include \fR .sp Tk_Window \fBTk_HWNDToWindow\fR(\fIhwnd\fR) -.fi .SH ARGUMENTS .AP HWND hwnd in Windows handle for the window. .BE .SH DESCRIPTION Index: doc/HandleEvent.3 ================================================================== --- doc/HandleEvent.3 +++ doc/HandleEvent.3 @@ -13,11 +13,10 @@ .SH SYNOPSIS .nf \fB#include \fR .sp \fBTk_HandleEvent\fR(\fIeventPtr\fR) -.fi .SH ARGUMENTS .AS XEvent *eventPtr .AP XEvent *eventPtr in Pointer to X event to dispatch to relevant handler(s). It is important that all unused fields of the structure be set to zero. Index: doc/IdToWindow.3 ================================================================== --- doc/IdToWindow.3 +++ doc/IdToWindow.3 @@ -13,11 +13,10 @@ .nf \fB#include \fR .sp Tk_Window \fBTk_IdToWindow\fR(\fIdisplay, window\fR) -.fi .SH ARGUMENTS .AS Tk_Window display .AP Display *display in X display containing the window. .AP Window window in Index: doc/ImgChanged.3 ================================================================== --- doc/ImgChanged.3 +++ doc/ImgChanged.3 @@ -13,11 +13,10 @@ .SH SYNOPSIS .nf \fB#include \fR .sp \fBTk_ImageChanged\fR(\fImodel, x, y, width, height, imageWidth, imageHeight\fR) -.fi .SH ARGUMENTS .AS Tk_ImageModel imageHeight .AP Tk_ImageModel model in Token for image, which was passed to image's \fIcreateProc\fR when the image was created. Index: doc/Inactive.3 ================================================================== --- doc/Inactive.3 +++ doc/Inactive.3 @@ -10,14 +10,13 @@ .SH SYNOPSIS .nf \fB#include \fR .sp long -\fBTk_GetUserInactiveTime\fR(\fIdisplay\fR) +\fBTk_GetUserInactiveTime(\fIdisplay\fB)\fR .sp -\fBTk_ResetUserInactiveTime\fR(\fIdisplay\fR) -.fi +\fBTk_ResetUserInactiveTime(\fIdisplay\fB)\fR .SH ARGUMENTS .AS Display *display .AP Display *display in The display on which the user inactivity timer is to be queried or reset. Index: doc/InternAtom.3 ================================================================== --- doc/InternAtom.3 +++ doc/InternAtom.3 @@ -13,15 +13,14 @@ .SH SYNOPSIS .nf \fB#include \fR .sp Atom -\fBTk_InternAtom\fR(\fItkwin, name\fR) +\fBTk_InternAtom(\fItkwin, name\fR) .sp const char * -\fBTk_GetAtomName\fR(\fItkwin, atom\fR) -.fi +\fBTk_GetAtomName(\fItkwin, atom\fR) .SH ARGUMENTS .AS Tk_Window parent .AP Tk_Window tkwin in Token for window. Used to map atom or name relative to a particular display. .AP "const char" *name in Index: doc/MainLoop.3 ================================================================== --- doc/MainLoop.3 +++ doc/MainLoop.3 @@ -13,11 +13,10 @@ .SH SYNOPSIS .nf \fB#include \fR .sp \fBTk_MainLoop\fR() -.fi .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 Index: doc/MainWin.3 ================================================================== --- doc/MainWin.3 +++ doc/MainWin.3 @@ -15,17 +15,18 @@ \fB#include \fR .sp Tk_Window \fBTk_MainWindow\fR(\fIinterp\fR) .sp +void \fBTk_SetMainMenubar\fR(\fIinterp, tkwin, menuName\fR) .sp +void \fBTk_SetWindowMenubar\fR(\fIinterp, tkwin, oldMenuName, menuName\fR) .sp int \fBTk_GetNumMainWindows\fR() -.fi .SH ARGUMENTS .AS Tcl_Interp *pathName .AP Tcl_Interp *interp in/out Interpreter associated with the application. .AP Tk_Window tkwin in @@ -49,12 +50,12 @@ .PP \fBTk_GetNumMainWindows\fR returns a count of the number of main windows currently open in the current thread. \fBTk_SetMainMenubar\fR Called when a toplevel widget is brought to front. On the Macintosh, -sets up the menubar that goes across the top of the main monitor. On +sets up the menubar that goes accross the top of the main monitor. On other platforms, nothing is necessary. \fBTk_SetWindowMenubar\fR associates a menu with a window. The old menu clones for the menubar are thrown away, and a handler is set up to allocate the new ones. .SH KEYWORDS application, main window Index: doc/MaintGeom.3 ================================================================== --- doc/MaintGeom.3 +++ doc/MaintGeom.3 @@ -15,11 +15,10 @@ \fB#include \fR .sp \fBTk_MaintainGeometry\fR(\fIwindow, container, x, y, width, height\fR) .sp \fBTk_UnmaintainGeometry\fR(\fIwindow, container\fR) -.fi .SH ARGUMENTS .AS Tk_Window container .AP Tk_Window window in Window whose geometry is to be controlled. .AP Tk_Window container in Index: doc/ManageGeom.3 ================================================================== --- doc/ManageGeom.3 +++ doc/ManageGeom.3 @@ -13,11 +13,10 @@ .SH SYNOPSIS .nf \fB#include \fR .sp \fBTk_ManageGeometry\fR(\fItkwin, mgrPtr, clientData\fR) -.fi .SH ARGUMENTS .AS Tk_GeometryProc clientData .AP Tk_Window tkwin in Token for window to be managed. .AP "const Tk_GeomMgr" *mgrPtr in Index: doc/MapWindow.3 ================================================================== --- doc/MapWindow.3 +++ doc/MapWindow.3 @@ -16,11 +16,10 @@ .sp Tk_Window \fBTk_MapWindow\fR(\fItkwin\fR) .sp \fBTk_UnmapWindow\fR(\fItkwin\fR) -.fi .SH ARGUMENTS .AS Tk_Window parent .AP Tk_Window tkwin in Token for window. .BE Index: doc/MeasureChar.3 ================================================================== --- doc/MeasureChar.3 +++ doc/MeasureChar.3 @@ -6,24 +6,32 @@ '\" .TH Tk_MeasureChars 3 8.1 Tk "Tk Library Procedures" .so man.macros .BS .SH NAME -Tk_MeasureChars, Tk_TextWidth, Tk_DrawChars, Tk_UnderlineChars \- routines to measure and display simple single-line strings. +Tk_MeasureChars, Tk_MeasureCharsInContext, Tk_TextWidth, Tk_DrawChars, Tk_DrawCharsInContext, +Tk_UnderlineChars, Tk_UnderlineCharsInContext \- routines to measure and display simple single-line strings. .SH SYNOPSIS .nf \fB#include \fR .sp int \fBTk_MeasureChars\fR(\fItkfont, string, numBytes, maxPixels, flags, lengthPtr\fR) .sp +int +\fBTk_MeasureCharsInContext\fR(\fItkfont, string, numBytes, rangeStart, rangeLength, maxPixels, flags, lengthPtr\fR) +.sp int \fBTk_TextWidth\fR(\fItkfont, string, numBytes\fR) .sp \fBTk_DrawChars\fR(\fIdisplay, drawable, gc, tkfont, string, numBytes, x, y\fR) .sp +\fBTk_DrawCharsInContext\fR(\fIdisplay, drawable, gc, tkfont, string, numBytes, rangeStart, rangeLength, x, y\fR) +.sp \fBTk_UnderlineChars\fR(\fIdisplay, drawable, gc, tkfont, string, x, y, firstByte, lastByte\fR) +.sp +\fBTk_UnderlineCharsInContext\fR(\fIdisplay, drawable, gc, tkfont, string, numBytes, x, y, firstByte, lastByte\fR) .fi .SH ARGUMENTS .AS "const char" firstChar .AP Tk_Font tkfont in Token for font in which text is to be drawn or measured. Must have been @@ -31,11 +39,11 @@ .AP "const char" *string in Text to be measured or displayed. Need not be null terminated. Any non-printing meta-characters in the string (such as tabs, newlines, and other control characters) will be measured or displayed in a platform-dependent manner. -.AP Tcl_Size numBytes in +.AP int numBytes in The maximum number of bytes to consider when measuring or drawing \fIstring\fR. Must be greater than or equal to 0. .AP int maxPixels in If \fImaxPixels\fR is >= 0, it specifies the longest permissible line length in pixels. Characters from \fIstring\fR are processed only @@ -50,10 +58,13 @@ characters could fit in the length given by \fImaxPixels\fR. If \fBTK_AT_LEAST_ONE\fR is set and \fBTK_WHOLE_WORDS\fR is also set, it means that if not even one word fits on the line, return the first few letters of the word that did fit; if not even one letter of the word fit, then the first letter will still be returned. +\fBTK_ISOLATE_END\fR means that the last character should not be considered in +context with the rest of the string (used for breaking lines, with the +Tk_*InContext variants of the functions only). .AP int *lengthPtr out Filled with the number of pixels occupied by the number of characters returned as the result of \fBTk_MeasureChars\fR. .AP Display *display in Display on which to draw. @@ -70,10 +81,14 @@ \fIstring\fR. Underlining begins at the left edge of this character. .AP int lastByte in The index of the first byte of the last character up to which the underline will be drawn. The character specified by \fIlastByte\fR will not itself be underlined. +.AP int rangeStart in +Index of first byte to draw or to measure. +.AP int rangeLength in +Length of range to draw or to measure, in bytes. .BE .SH DESCRIPTION .PP These routines are for measuring and displaying simple single-font, single-line strings. To measure and display single-font, multi-line, @@ -119,9 +134,16 @@ given \fIstring\fR. It does not draw the characters (which are assumed to have been displayed previously by \fBTk_DrawChars\fR); it just draws the underline. This procedure is used to underline a few characters without having to construct an underlined font. To produce natively underlined text, the appropriate underlined font should be constructed and used. +.PP +\fBTk_MeasureCharsInContext\fR, \fBTk_DrawCharsInContext\fR, +\fBTk_UnderlineCharsInContext\fR are variants of respectively +\fBTk_MeasureChars\fR, \fBTk_DrawChars\fR and \fBTk_UnderlineChars\fR, +but with access to all the characters on the line for context. Except +on macOS, this context isn't actually consulted (meaning the out of +context variants are called). .SH "SEE ALSO" font(n), FontId(3) .SH KEYWORDS font, measurement Index: doc/MoveToplev.3 ================================================================== --- doc/MoveToplev.3 +++ doc/MoveToplev.3 @@ -12,12 +12,11 @@ Tk_MoveToplevelWindow \- Adjust the position of a top-level window .SH SYNOPSIS .nf \fB#include \fR .sp -\fBTk_MoveToplevelWindow\fR(\fItkwin, x, y\fR) -.fi +\fBTk_MoveToplevelWindow(\fItkwin, x, y\fB)\fR .SH ARGUMENTS .AS Tk_Window tkwin .AP Tk_Window tkwin in Token for top-level window to move. .AP int x in Index: doc/Name.3 ================================================================== --- doc/Name.3 +++ doc/Name.3 @@ -20,11 +20,10 @@ char * \fBTk_PathName\fR(\fItkwin\fR) .sp Tk_Window \fBTk_NameToWindow\fR(\fIinterp, pathName, tkwin\fR) -.fi .SH ARGUMENTS .AS Tcl_Interp *pathName .AP Tk_Window tkwin in Token for window. .AP Tcl_Interp *interp out Index: doc/NameOfImg.3 ================================================================== --- doc/NameOfImg.3 +++ doc/NameOfImg.3 @@ -13,11 +13,10 @@ .nf \fB#include \fR .sp const char * \fBTk_NameOfImage\fR(\fIimageModel\fR) -.fi .SH ARGUMENTS .AS Tk_ImageModel imageModel .AP Tk_ImageModel imageModel in Token for image, which was passed to image manager's \fIcreateProc\fR when the image was created. Index: doc/OwnSelect.3 ================================================================== --- doc/OwnSelect.3 +++ doc/OwnSelect.3 @@ -13,11 +13,10 @@ .SH SYNOPSIS .nf \fB#include \fR .sp \fBTk_OwnSelection\fR(\fItkwin, selection, proc, clientData\fR) -.fi .SH ARGUMENTS .AS Tk_LostSelProc clientData .AP Tk_Window tkwin in Window that is to become new selection owner. .AP Atom selection in Index: doc/ParseArgv.3 ================================================================== --- doc/ParseArgv.3 +++ doc/ParseArgv.3 @@ -14,11 +14,10 @@ .nf \fB#include \fR .sp int \fBTk_ParseArgv\fR(\fIinterp, tkwin, argcPtr, argv, argTable, flags\fR) -.fi .SH ARGUMENTS .AS Tk_ArgvInfo *argTable .AP Tcl_Interp *interp in Interpreter to use for returning error messages. .AP Tk_Window tkwin in @@ -112,19 +111,22 @@ \fBTk_ParseArgv\fR may also use the next argument in \fIargv\fR after the matching argument, which is called .QW "the following argument" . The legal values for \fItype\fR, and the processing that they cause, are as follows: -.IP \fBTK_ARGV_END\fR +.TP +\fBTK_ARGV_END\fR Marks the end of the table. The last entry in \fIargTable\fR must have this type; all of its other fields are ignored and it will never match any arguments. -.IP \fBTK_ARGV_CONSTANT\fR +.TP +\fBTK_ARGV_CONSTANT\fR \fISrc\fR is treated as an integer and \fIdst\fR is treated as a pointer to an integer. \fISrc\fR is stored at \fI*dst\fR. The matching argument is discarded. -.IP \fBTK_ARGV_INT\fR +.TP +\fBTK_ARGV_INT\fR The following argument must contain an integer string in the format accepted by \fBstrtol\fR (e.g. .QW 0 and .QW 0x @@ -131,52 +133,59 @@ prefixes may be used to specify octal or hexadecimal numbers, respectively). \fIDst\fR is treated as a pointer to an integer; the following argument is converted to an integer value and stored at \fI*dst\fR. \fISrc\fR is ignored. The matching and following arguments are discarded from \fIargv\fR. -.IP \fBTK_ARGV_FLOAT\fR +.TP +\fBTK_ARGV_FLOAT\fR The following argument must contain a floating-point number in the format accepted by \fBstrtol\fR. \fIDst\fR is treated as the address of a double-precision floating point value; the following argument is converted to a double-precision value and stored at \fI*dst\fR. The matching and following arguments are discarded from \fIargv\fR. -.IP \fBTK_ARGV_STRING\fR +.TP +\fBTK_ARGV_STRING\fR In this form, \fIdst\fR is treated as a pointer to a (char *); \fBTk_ParseArgv\fR stores at \fI*dst\fR a pointer to the following argument, and discards the matching and following arguments from \fIargv\fR. \fISrc\fR is ignored. -.IP \fBTK_ARGV_UID\fR +.TP +\fBTK_ARGV_UID\fR This form is similar to \fBTK_ARGV_STRING\fR, except that the argument is turned into a Tk_Uid by calling \fBTk_GetUid\fR. \fIDst\fR is treated as a pointer to a Tk_Uid; \fBTk_ParseArgv\fR stores at \fI*dst\fR the Tk_Uid corresponding to the following argument, and discards the matching and following arguments from \fIargv\fR. \fISrc\fR is ignored. -.IP \fBTK_ARGV_CONST_OPTION\fR +.TP +\fBTK_ARGV_CONST_OPTION\fR This form causes a Tk option to be set (as if the \fBoption\fR command had been invoked). The \fIsrc\fR field is treated as a pointer to a string giving the value of an option, and \fIdst\fR is treated as a pointer to the name of the option. The matching argument is discarded. If \fItkwin\fR is NULL, then argument specifiers of this type are ignored (as if they did not exist). -.IP \fBTK_ARGV_OPTION_VALUE\fR +.TP +\fBTK_ARGV_OPTION_VALUE\fR This form is similar to \fBTK_ARGV_CONST_OPTION\fR, except that the value of the option is taken from the following argument instead of from \fIsrc\fR. \fIDst\fR is used as the name of the option. \fISrc\fR is ignored. The matching and following arguments are discarded. If \fItkwin\fR is NULL, then argument specifiers of this type are ignored (as if they did not exist). -.IP \fBTK_ARGV_OPTION_NAME_VALUE\fR +.TP +\fBTK_ARGV_OPTION_NAME_VALUE\fR In this case the following argument is taken as the name of a Tk option and the argument after that is taken as the value for that option. Both \fIsrc\fR and \fIdst\fR are ignored. All three arguments are discarded from \fIargv\fR. If \fItkwin\fR is NULL, then argument specifiers of this type are ignored (as if they did not exist). -.IP \fBTK_ARGV_HELP\fR +.TP +\fBTK_ARGV_HELP\fR When this kind of option is encountered, \fBTk_ParseArgv\fR uses the \fIhelp\fR fields of \fIargTable\fR to format a message describing all the valid arguments. The message is placed in interpreter \fIinterp\fR's result and \fBTk_ParseArgv\fR returns \fBTCL_ERROR\fR. When this happens, the @@ -183,11 +192,12 @@ caller normally prints the help message and aborts. If the \fIkey\fR field of a \fBTK_ARGV_HELP\fR specifier is NULL, then the specifier will never match any arguments; in this case the specifier simply provides extra documentation, which will be included when some other \fBTK_ARGV_HELP\fR entry causes help information to be returned. -.IP \fBTK_ARGV_REST\fR +.TP +\fBTK_ARGV_REST\fR This option is used by programs or commands that allow the last several of their options to be the name and/or options for some other program. If a \fBTK_ARGV_REST\fR argument is found, then \fBTk_ParseArgv\fR does not process any of the remaining arguments; it returns them all at @@ -195,11 +205,12 @@ In addition, \fBTk_ParseArgv\fR treats \fIdst\fR as the address of an integer value, and stores at \fI*dst\fR the index of the first of the \fBTK_ARGV_REST\fR options in the returned \fIargv\fR. This allows the program to distinguish the \fBTK_ARGV_REST\fR options from other unprocessed options that preceded the \fBTK_ARGV_REST\fR. -.IP \fBTK_ARGV_FUNC\fR +.TP +\fBTK_ARGV_FUNC\fR For this kind of argument, \fIsrc\fR is treated as the address of a procedure, which is invoked to process the following argument. The procedure should have the following structure: .RS .CS @@ -219,11 +230,12 @@ \fBTk_ParseArgv\fR should discard it), then it should return 1. Otherwise it should return 0 and \fBTkParseArgv\fR will process the following argument in the normal fashion. In either event the matching argument is discarded. .RE -.IP \fBTK_ARGV_GENFUNC\fR +.TP +\fBTK_ARGV_GENFUNC\fR This form provides a more general procedural escape. It treats \fIsrc\fR as the address of a procedure, and passes that procedure all of the remaining arguments. The procedure should have the following form: .RS @@ -252,27 +264,31 @@ \fIinterp\fR's result, in the usual Tcl fashion, and return \-1; when this happens \fBTk_ParseArgv\fR will abort its processing and return \fBTCL_ERROR\fR. .RE .SS "FLAGS" -.IP \fBTK_ARGV_DONT_SKIP_FIRST_ARG\fR +.TP +\fBTK_ARGV_DONT_SKIP_FIRST_ARG\fR \fBTk_ParseArgv\fR normally treats \fIargv[0]\fR as a program or command name, and returns it to the caller just as if it had not matched \fIargTable\fR. If this flag is given, then \fIargv[0]\fR is not given special treatment. -.IP \fBTK_ARGV_NO_ABBREV\fR +.TP +\fBTK_ARGV_NO_ABBREV\fR Normally, \fBTk_ParseArgv\fR accepts unique abbreviations for \fIkey\fR values in \fIargTable\fR. If this flag is given then only exact matches will be acceptable. -.IP \fBTK_ARGV_NO_LEFTOVERS\fR +.TP +\fBTK_ARGV_NO_LEFTOVERS\fR Normally, \fBTk_ParseArgv\fR returns unrecognized arguments to the caller. If this bit is set in \fIflags\fR then \fBTk_ParseArgv\fR will return an error if it encounters any argument that does not match \fIargTable\fR. The only exception to this rule is \fIargv[0]\fR, which will be returned to the caller with no errors as long as \fBTK_ARGV_DONT_SKIP_FIRST_ARG\fR is not specified. -.IP \fBTK_ARGV_NO_DEFAULTS\fR +.TP +\fBTK_ARGV_NO_DEFAULTS\fR Normally, \fBTk_ParseArgv\fR searches an internal table of standard argument specifiers in addition to \fIargTable\fR. If this bit is set in \fIflags\fR, then \fBTk_ParseArgv\fR will use only \fIargTable\fR and not its default table. .SH EXAMPLE @@ -294,23 +310,25 @@ /* * Define option descriptions. */ Tk_ArgvInfo argTable[] = { - {"-X", TK_ARGV_CONSTANT, (char *) 1, &debugFlag, + {"\-X", TK_ARGV_CONSTANT, (char *) 1, &debugFlag, "Turn on debugging printfs"}, - {"-N", TK_ARGV_INT, NULL, &numReps, + {"\-N", TK_ARGV_INT, NULL, &numReps, "Number of repetitions"}, - {"-of", TK_ARGV_STRING, NULL, &fileName, + {"\-of", TK_ARGV_STRING, NULL, &fileName, "Name of file for output"}, {"x", TK_ARGV_REST, NULL, &exec, "File to exec, followed by any arguments (must be last argument)."}, {NULL, TK_ARGV_END, NULL, NULL, NULL} }; -int main(int argc, char *argv[]) +main(argc, argv) + int argc; + char *argv[]; { \&... if (Tk_ParseArgv(interp, tkwin, &argc, argv, argTable, 0) != TCL_OK) { fprintf(stderr, "%s\en", Tcl_GetString(Tcl_GetObjResult(interp))); @@ -326,17 +344,17 @@ Note that default values can be assigned to variables named in \fIargTable\fR: the variables will only be overwritten if the particular arguments are present in \fIargv\fR. Here are some example command lines and their effects. .CS -prog -N 200 infile # just sets the numReps variable to 200 -prog -of out200 infile # sets fileName to reference "out200" -prog -XN 10 infile # sets the debug flag, also sets numReps +prog \-N 200 infile # just sets the numReps variable to 200 +prog \-of out200 infile # sets fileName to reference "out200" +prog \-XN 10 infile # sets the debug flag, also sets numReps .CE In all of the above examples, \fIargc\fR will be set by \fBTk_ParseArgv\fR to 2, \fIargv\fR[0] will be .QW prog , \fIargv\fR[1] will be .QW infile , and \fIargv\fR[2] will be NULL. .SH KEYWORDS arguments, command line, options Index: doc/QWinEvent.3 ================================================================== --- doc/QWinEvent.3 +++ doc/QWinEvent.3 @@ -15,11 +15,10 @@ .sp int \fBTk_CollapseMotionEvents\fR(\fIdisplay, collapse\fR) .sp \fBTk_QueueWindowEvent\fR(\fIeventPtr, position\fR) -.fi .SH ARGUMENTS .AS Tcl_QueuePosition position .AP Display *display in Display for which to control motion event collapsing. .AP int collapse in Index: doc/Restack.3 ================================================================== --- doc/Restack.3 +++ doc/Restack.3 @@ -14,11 +14,10 @@ .nf \fB#include \fR .sp int \fBTk_RestackWindow\fR(\fItkwin, aboveBelow, other\fR) -.fi .SH ARGUMENTS .AS Tk_Window aboveBelow .AP Tk_Window tkwin in Token for window to restack. .AP int aboveBelow in Index: doc/RestrictEv.3 ================================================================== --- doc/RestrictEv.3 +++ doc/RestrictEv.3 @@ -14,11 +14,10 @@ .nf \fB#include \fR .sp Tk_RestrictProc * \fBTk_RestrictEvents\fR(\fIproc, arg, prevArgPtr\fR) -.fi .SH ARGUMENTS .AS Tk_RestrictProc **prevArgPtr .AP Tk_RestrictProc *proc in Predicate procedure to call to filter incoming X events. NULL means do not restrict events at all. Index: doc/SetAppName.3 ================================================================== --- doc/SetAppName.3 +++ doc/SetAppName.3 @@ -14,11 +14,10 @@ .nf \fB#include \fR .sp const char * \fBTk_SetAppName\fR(\fItkwin, name\fR) -.fi .SH ARGUMENTS .AS Tk_Window parent .AP Tk_Window tkwin in Token for window in application. Used only to select a particular application. Index: doc/SetCaret.3 ================================================================== --- doc/SetCaret.3 +++ doc/SetCaret.3 @@ -13,11 +13,10 @@ .nf \fB#include \fR .sp int \fBTk_SetCaretPos\fR(\fItkwin, x, y, height\fR) -.fi .SH ARGUMENTS .AP Tk_Window tkwin in Token for window. .AP int x in Window-relative x coordinate. Index: doc/SetClass.3 ================================================================== --- doc/SetClass.3 +++ doc/SetClass.3 @@ -16,11 +16,10 @@ .sp \fBTk_SetClass\fR(\fItkwin, class\fR) .sp Tk_Uid \fBTk_Class\fR(\fItkwin\fR) -.fi .SH ARGUMENTS .AS Tk_Window parent .AP Tk_Window tkwin in Token for window. .AP char *class in Index: doc/SetClassProcs.3 ================================================================== --- doc/SetClassProcs.3 +++ doc/SetClassProcs.3 @@ -12,11 +12,10 @@ .SH SYNOPSIS .nf \fB#include \fR .sp \fBTk_SetClassProcs\fR(\fItkwin, procs, instanceData\fR) -.fi .SH ARGUMENTS .AS Tk_ClassProc instanceData .AP Tk_Window tkwin in Token for window to modify. .AP "const Tk_ClassProcs" *procs in @@ -31,11 +30,11 @@ \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 { +typedef struct Tk_ClassProcs { size_t \fIsize\fR; Tk_ClassWorldChangedProc *\fIworldChangedProc\fR; Tk_ClassCreateProc *\fIcreateProc\fR; Tk_ClassModalProc *\fImodalProc\fR; } \fBTk_ClassProcs\fR; Index: doc/SetGrid.3 ================================================================== --- doc/SetGrid.3 +++ doc/SetGrid.3 @@ -15,11 +15,10 @@ \fB#include \fR .sp \fBTk_SetGrid\fR(\fItkwin, reqWidth, reqHeight, widthInc, heightInc\fR) .sp \fBTk_UnsetGrid\fR(\fItkwin\fR) -.fi .SH ARGUMENTS .AS Tk_Window heightInc .AP Tk_Window tkwin in Token for window. .AP int reqWidth in Index: doc/SetOptions.3 ================================================================== --- doc/SetOptions.3 +++ doc/SetOptions.3 @@ -57,11 +57,11 @@ .AP Tk_Window tkwin in For options such as \fBTK_OPTION_COLOR\fR, this argument indicates the window in which the option will be used. If \fIoptionTable\fR uses no window-dependent options, then a NULL value may be supplied for this argument. -.AP Tcl_Size objc in +.AP int objc in Number of values in \fIobjv\fR. .AP Tcl_Obj "*const *objv" in Command-line arguments for setting configuring options. .AP Tk_SavedOptions *savePtr out If not NULL, the structure pointed to by this argument is filled @@ -529,11 +529,11 @@ Applications can extend the built-in configuration types with additional configuration types by writing procedures to parse, print, free, and restore saved copies of the type and creating a structure pointing to those procedures: .CS -typedef struct { +typedef struct Tk_ObjCustomOption { const char *\fIname\fR; Tk_CustomOptionSetProc *\fIsetProc\fR; Tk_CustomOptionGetProc *\fIgetProc\fR; Tk_CustomOptionRestoreProc *\fIrestoreProc\fR; Tk_CustomOptionFreeProc *\fIfreeProc\fR; Index: doc/SetVisual.3 ================================================================== --- doc/SetVisual.3 +++ doc/SetVisual.3 @@ -14,11 +14,10 @@ .nf \fB#include \fR .sp int \fBTk_SetWindowVisual\fR(\fItkwin, visual, depth, colormap\fR) -.fi .SH ARGUMENTS .AS "Tk_Window int" colormap .AP Tk_Window tkwin in Token for window. .AP Visual *visual in @@ -42,10 +41,10 @@ If \fItkwin\fR has already been created before \fBTk_SetWindowVisual\fR is called then it returns 0 and does not make any changes; otherwise it returns 1 to signify that the operation completed successfully. .PP -Note that \fBTk_SetWindowVisual\fR should not be called if you just want +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 Index: doc/StrictMotif.3 ================================================================== --- doc/StrictMotif.3 +++ doc/StrictMotif.3 @@ -13,11 +13,10 @@ .nf \fB#include \fR .sp int \fBTk_StrictMotif\fR(\fItkwin\fR) -.fi .SH ARGUMENTS .AS Tk_Window tkwin .AP Tk_Window tkwin in Token for window. .BE Index: doc/TextLayout.3 ================================================================== --- doc/TextLayout.3 +++ doc/TextLayout.3 @@ -12,32 +12,35 @@ .SH SYNOPSIS .nf \fB#include \fR .sp Tk_TextLayout -\fBTk_ComputeTextLayout\fR(\fItkfont, string, numChars, wrapLength, justify, flags, widthPtr, heightPtr\fR) -.sp -\fBTk_FreeTextLayout\fR(\fIlayout\fR) -.sp -\fBTk_DrawTextLayout\fR(\fIdisplay, drawable, gc, layout, x, y, firstChar, lastChar\fR) -.sp -\fBTk_UnderlineTextLayout\fR(\fIdisplay, drawable, gc, layout, x, y, underline\fR) -.sp -int -\fBTk_PointToChar\fR(\fIlayout, x, y\fR) -.sp -int -\fBTk_CharBbox\fR(\fIlayout, index, xPtr, yPtr, widthPtr, heightPtr\fR) -.sp -int -\fBTk_DistanceToTextLayout\fR(\fIlayout, x, y\fR) -.sp -int -\fBTk_IntersectTextLayout\fR(\fIlayout, x, y, width, height\fR) -.sp -\fBTk_TextLayoutToPostscript\fR(\fIinterp, layout\fR) -.fi +\fBTk_ComputeTextLayout(\fItkfont, string, numChars, wrapLength, justify, flags, widthPtr, heightPtr\fB)\fR +.sp +void +\fBTk_FreeTextLayout(\fIlayout\fB)\fR +.sp +void +\fBTk_DrawTextLayout(\fIdisplay, drawable, gc, layout, x, y, firstChar, lastChar\fB)\fR +.sp +void +\fBTk_UnderlineTextLayout(\fIdisplay, drawable, gc, layout, x, y, underline\fB)\fR +.sp +int +\fBTk_PointToChar(\fIlayout, x, y\fB)\fR +.sp +int +\fBTk_CharBbox(\fIlayout, index, xPtr, yPtr, widthPtr, heightPtr\fB)\fR +.sp +int +\fBTk_DistanceToTextLayout(\fIlayout, x, y\fB)\fR +.sp +int +\fBTk_IntersectTextLayout(\fIlayout, x, y, width, height\fB)\fR +.sp +void +\fBTk_TextLayoutToPostscript(\fIinterp, layout\fB)\fR .SH ARGUMENTS .AS Tk_TextLayout "*xPtr, *yPtr" .AP Tk_Font tkfont in Font to use when constructing and displaying a text layout. The \fItkfont\fR must remain valid for the lifetime of the text layout. Must @@ -95,22 +98,22 @@ .AP int "x, y" in Point, in pixels, at which to place the upper-left hand corner of the text layout when it is being drawn, or the coordinates of a point (with respect to the upper-left hand corner of the text layout) to check against the text layout. -.AP Tcl_Size firstChar in +.AP int firstChar in The index of the first character to draw from the given text layout. The number 0 means to draw from the beginning. -.AP Tcl_Size lastChar in +.AP int lastChar in The index of the last character up to which to draw. The character specified by \fIlastChar\fR itself will not be drawn. A number less than 0 means to draw all characters in the text layout. .AP int underline in Index of the single character to underline in the text layout, or a negative number counting backwards from the end of the string. Any out-of-range number (e.g. INT_MIN) means no underline. -.AP Tcl_Size index in +.AP int index in The index of the character whose bounding box is desired. The bounding box is computed with respect to the upper-left hand corner of the text layout. .AP int "*xPtr, *yPtr" out Filled with the upper-left hand corner, in pixels, of the bounding box for the character specified by \fIindex\fR. Either or both \fIxPtr\fR Index: doc/TkInitStubs.3 ================================================================== --- doc/TkInitStubs.3 +++ doc/TkInitStubs.3 @@ -13,11 +13,10 @@ .nf \fB#include \fR .sp const char * \fBTk_InitStubs\fR(\fIinterp, version, exact\fR) -.fi .SH ARGUMENTS .AS Tcl_Interp *interp in .AP Tcl_Interp *interp in Tcl interpreter handle. .AP char *version in Index: doc/Tk_Init.3 ================================================================== --- doc/Tk_Init.3 +++ doc/Tk_Init.3 @@ -45,51 +45,41 @@ \fBTk_SafeInit\fR is identical to \fBTk_Init\fR except that it removes all Tk commands that are considered unsafe. Those commands and the reasons for their exclusion are: .TP \fBbell\fR -. Continuous ringing of the bell is a nuisance. .TP \fBclipboard\fR -. A malicious script could replace the contents of the clipboard with the string .QW "\fBrm \-r *\fR" and lead to surprises when the contents of the clipboard are pasted. .TP \fBgrab\fR -. Grab can be used to block the user from using any other applications. .TP \fBmenu\fR -. Menus can be used to cover the entire screen and to steal input from the user. .TP \fBselection\fR -. See clipboard. .TP \fBsend\fR -. Send can be used to cause unsafe interpreters to execute commands. .TP \fBtk\fR -. The tk command recreates the send command, which is unsafe. .TP \fBtkwait\fR -. Tkwait can block the containing process forever .TP \fBtoplevel\fR -. Toplevels can be used to cover the entire screen and to steal input from the user. .TP \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 Index: doc/Tk_Main.3 ================================================================== --- doc/Tk_Main.3 +++ doc/Tk_Main.3 @@ -15,11 +15,11 @@ \fB#include \fR .sp \fBTk_Main\fR(\fIargc, argv, appInitProc\fR) .SH ARGUMENTS .AS Tcl_AppInitProc *appInitProc -.AP Tcl_Size argc in +.AP int argc in Number of elements in \fIargv\fR. .AP char *argv[] in Array of strings containing command-line arguments. On Windows, when using -DUNICODE, the parameter type changes to wchar_t *. .AP Tcl_AppInitProc *appInitProc in Index: doc/WinUtil.3 ================================================================== --- doc/WinUtil.3 +++ doc/WinUtil.3 @@ -13,19 +13,18 @@ .SH SYNOPSIS .nf \fB#include \fR .sp Tk_Window -\fBTk_GetOtherWindow\fR(\fItkwin\fR) +\fBTk_GetOtherWindow(\fItkwin\fB)\fR .sp -\fBTk_MakeContainer\fR(\fItkwin\fR) +\fBTk_MakeContainer(\fItkwin\fB)\fR .sp -\fBTk_MakeWindow\fR(\fItkwin, parent\fR) +\fBTk_MakeWindow(\fItkwin, parent\fB)\fR .sp int -\fBTk_UseWindow\fR(\fIinterp, tkwin, string\fR) -.fi +\fBTk_UseWindow(\fIinterp, tkwin, string\fB)\fR .SH ARGUMENTS .AS XSetWindowAttributes borderWidth .AP Tcl_Interp * interp in Interpreter associated with the application. .AP Tk_Window tkwin in Index: doc/WindowId.3 ================================================================== --- doc/WindowId.3 +++ doc/WindowId.3 @@ -101,11 +101,10 @@ Tcl_Interp * \fBTk_Interp\fR(\fItkwin\fR) .sp Tcl_Obj * \fBTk_NewWindowObj\fR(\fItkwin\fR) -.fi .SH ARGUMENTS .AS Tk_Window tkwin .AP Tk_Window tkwin in Token for window. .BE @@ -146,11 +145,11 @@ returns a pointer to a structure containing all of the above information plus a few other fields. \fBTk_Attributes\fR returns a pointer to an XSetWindowAttributes structure describing all of the attributes of the \fItkwin\fR's window, such as background pixmap, event mask, and so on (Tk keeps track of all this information -as it is changed by the application). Note that it is essential that +as it is changed by the application). Note: it is essential that applications use Tk procedures like \fBTk_ResizeWindow\fR instead of X procedures like \fBXResizeWindow\fR, so that Tk can keep its data structures up-to-date. .PP \fBTk_IsContainer\fR returns a non-zero value if \fItkwin\fR Index: doc/bind.n ================================================================== --- doc/bind.n +++ doc/bind.n @@ -147,13 +147,12 @@ pattern, all of the events must occur close together in time and without substantial mouse motion in between. For example, \fB\fR is equivalent to \fB\fR with the extra time and space requirement. .PP -The \fBCommand\fR, \fBOption\fR, \fBNum\fR and \fBFn\fRmodifiers are -equivalents of \fBMod1\fR up to \fBMod4\fR; they correspond to -Macintosh-specific modifier keys. +The \fBCommand\fR, \fBOption\fR, \fBNum\fR and \fBFn\fRmodifiers are equivalents +of \fBMod1\fR up to \fBMod4\fR, they correspond to Macintosh-specific modifier keys. .PP 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" . On a US keyboard, the extended keys include the \fBAlt\fR @@ -648,13 +647,13 @@ If the \fBbreak\fR command is invoked within a binding script, then that script terminates and no other scripts will be invoked for the event. .PP Within a script called from the binding script, \fBreturn\fR -\fB\-code ok\fR may be used to continue processing (including +\fB-code ok\fR may be used to continue processing (including .QW + -appended scripts), or \fBreturn\fR \fB\-code break\fR may be used to +appended scripts), or \fBreturn\fR \fB-code break\fR may be used to stop processing all other binding scripts. .PP If more than one binding matches a particular event and they have the same \fItag\fR, then the most specific binding is chosen and its script is evaluated. @@ -738,20 +737,20 @@ .SH "EXAMPLES" .PP Arrange for a string describing the motion of the mouse to be printed out when the mouse is double-clicked: .CS -\fBbind\fR . { +\fBbind\fR . { puts "hi from (%x,%y)" } .CE .PP A little GUI that displays what the keysym name of the last key pressed is: .CS set keysym "Press any key" -pack [label .l -textvariable keysym -padx 2m -pady 1m] +pack [label .l \-textvariable keysym \-padx 2m \-pady 1m] \fBbind\fR . { set keysym "You pressed %K" } .CE .SH "SEE ALSO" Index: doc/bitmap.n ================================================================== --- doc/bitmap.n +++ doc/bitmap.n @@ -13,11 +13,11 @@ bitmap \- Images that display two colors .SH SYNOPSIS .nf \fBimage create bitmap \fR?\fIname\fR? ?\fIoptions\fR? -\fIimageName \fBcget\fI option\fR +\fIimageName \fBcget\fR \fIoption\fR \fIimageName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? .fi .BE .SH DESCRIPTION .PP @@ -37,52 +37,46 @@ .SH "CREATING BITMAPS" .PP Like all images, bitmaps are created using the \fBimage create\fR command. Bitmaps support the following \fIoptions\fR: -.\" OPTION: -background .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. -.\" OPTION: -data .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. -.\" OPTION: -file .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). -.\" OPTION: -foreground .TP \fB\-foreground \fIcolor\fR . Specifies a foreground color for the image in any of the standard ways accepted by Tk. -.\" OPTION: -maskdata .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. -.\" OPTION: -maskfile .TP \fB\-maskfile \fIname\fR . \fIname\fR gives the name of a file whose contents define the mask. @@ -99,19 +93,17 @@ \fIimageName option \fR?\fIarg ...\fR? .CE \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for bitmap images: -.\" METHOD: cget .TP -\fIimageName \fBcget\fI option\fR +\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\fR \fBbitmap\fR command. -.\" METHOD: configure .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 Index: doc/canvas.n ================================================================== --- doc/canvas.n +++ doc/canvas.n @@ -11,11 +11,11 @@ .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME canvas \- Create and manipulate 'canvas' hypergraphics drawing surface widgets .SH SYNOPSIS -\fBcanvas\fI pathName \fR?\fIoptions\fR? +\fBcanvas\fR \fIpathName \fR?\fIoptions\fR? .SO \-background \-borderwidth \-cursor \-highlightbackground \-highlightcolor \-highlightthickness \-insertbackground \-insertborderwidth \-insertofftime \-insertontime \-insertwidth \-relief @@ -254,11 +254,13 @@ the last one in the text item; this is necessary for such tasks as inserting new text at the end of the item. Lines and Polygons do not support the insertion cursor and the selection. Their indices are supposed to be even always, because coordinates always appear in pairs. -.IP \fInumber\fR 10 +.TP 10 +\fInumber\fR +. A decimal number giving the position of the desired character within the text item. 0 refers to the first character, 1 to the next character, and so on. If indexes are odd for lines and polygons, they will be automatically decremented by one. @@ -267,24 +269,34 @@ as if it were equal to the length of the text item. For polygons, negative numbers or numbers greater than the length of the coordinate list will be adjusted by adding or subtracting the length until the result is between zero and the length, inclusive. -.IP \fBend\fR 10 +.TP 10 +\fBend\fR +. Refers to the character or coordinate just after the last one in the item (same as the number of characters or coordinates in the item). -.IP \fBinsert\fR 10 +.TP 10 +\fBinsert\fR +. Refers to the character just before which the insertion cursor is drawn in this item. Not valid for lines and polygons. -.IP \fBsel.first\fR 10 +.TP 10 +\fBsel.first\fR +. Refers to the first selected character in the item. If the selection is not in this item then this form is illegal. -.IP \fBsel.last\fR 10 +.TP 10 +\fBsel.last\fR +. Refers to the last selected character in the item. If the selection is not in this item then this form is illegal. -.IP \fB@\fIx,y\fR 10 +.TP 10 +\fB@\fIx,y\fR +. Refers to the character or coordinate at the point given by \fIx\fR and \fIy\fR, where \fIx\fR and \fIy\fR are specified in the coordinate system of the canvas. If \fIx\fR and \fIy\fR lie outside the coordinates covered by the text item, then they refer to the first or last character in the @@ -339,11 +351,10 @@ \fIpathName option \fR?\fIarg ...\fR? .CE \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following widget commands are possible for canvas widgets: -.\" METHOD: addtag .TP \fIpathName \fBaddtag \fItag searchSpec \fR?\fIarg ...\fR? . For each item that meets the constraints specified by \fIsearchSpec\fR and the \fIarg\fRs, add @@ -354,23 +365,31 @@ command has no effect. This command returns an empty string as result. \fISearchSpec\fR and \fIarg\fR's may take any of the following forms: .RS -.IP "\fBabove \fItagOrId\fR" +.TP +\fBabove \fItagOrId\fR +. Selects the item just after (above) the one given by \fItagOrId\fR in the display list. If \fItagOrId\fR denotes more than one item, then the last (topmost) of these items in the display list is used. -.IP \fBall\fR +.TP +\fBall\fR +. Selects all the items in the canvas. -.IP "\fBbelow \fItagOrId\fR" +.TP +\fBbelow \fItagOrId\fR +. Selects the item just before (below) the one given by \fItagOrId\fR in the display list. If \fItagOrId\fR denotes more than one item, then the first (lowest) of these items in the display list is used. -.IP "\fBclosest \fIx y \fR?\fIhalo\fR? ?\fIstart\fR?" +.TP +\fBclosest \fIx y \fR?\fIhalo\fR? ?\fIstart\fR? +. Selects the item closest to the point given by \fIx\fR and \fIy\fR. If more than one item is at the same closest distance (e.g. two items overlap the point), then the top-most of these items (the last one in the display list) is used. If \fIhalo\fR is specified, then it must be a non-negative @@ -384,25 +403,30 @@ the given tag). Instead of selecting the topmost closest item, this form will select the topmost closest item that is below \fIstart\fR in the display list; if no such item exists, then the selection behaves as if the \fIstart\fR argument had not been specified. -.IP "\fBenclosed\fI x1 y1 x2 y2\fR" +.TP +\fBenclosed\fR \fIx1\fR \fIy1\fR \fIx2\fR \fIy2\fR +. Selects all the items completely enclosed within the rectangular region given by \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR. \fIX1\fR must be no greater than \fIx2\fR and \fIy1\fR must be no greater than \fIy2\fR. -.IP "\fBoverlapping\fI x1 y1 x2 y2\fR" +.TP +\fBoverlapping\fR \fIx1\fR \fIy1\fR \fIx2\fR \fIy2\fR +. Selects all the items that overlap or are enclosed within the rectangular region given by \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR. \fIX1\fR must be no greater than \fIx2\fR and \fIy1\fR must be no greater than \fIy2\fR. -.IP "\fBwithtag \fItagOrId\fR" +.TP +\fBwithtag \fItagOrId\fR +. Selects all the items given by \fItagOrId\fR. .RE -.\" METHOD: bbox .TP \fIpathName \fBbbox \fItagOrId\fR ?\fItagOrId tagOrId ...\fR? . Returns a list with four elements giving an approximate bounding box for all the items named by the \fItagOrId\fR arguments. @@ -416,11 +440,10 @@ a few pixels. If no items match any of the \fItagOrId\fR arguments or if the matching items have empty bounding boxes (i.e. they have nothing to display) then an empty string is returned. -.\" METHOD: bind .TP \fIpathName \fBbind \fItagOrId\fR ?\fIsequence\fR? ?\fIcommand\fR? . This command associates \fIcommand\fR with all the items given by \fItagOrId\fR such that whenever the event sequence given by @@ -478,35 +501,31 @@ command, then they are invoked in addition to bindings created for the canvas's items using the \fBbind\fR widget command. The bindings for items will be invoked before any of the bindings for the window as a whole. .RE -.\" METHOD: canvasx .TP \fIpathName \fBcanvasx \fIscreenx\fR ?\fIgridspacing\fR? . Given a window x-coordinate in the canvas \fIscreenx\fR, this command returns the canvas x-coordinate that is displayed at that location. If \fIgridspacing\fR is specified, then the canvas coordinate is rounded to the nearest multiple of \fIgridspacing\fR units. -.\" METHOD: canvasy .TP \fIpathName \fBcanvasy \fIscreeny\fR ?\fIgridspacing\fR? . Given a window y-coordinate in the canvas \fIscreeny\fR this command returns the canvas y-coordinate that is displayed at that location. If \fIgridspacing\fR is specified, then the canvas coordinate is rounded to the nearest multiple of \fIgridspacing\fR units. -.\" METHOD: cget .TP -\fIpathName \fBcget\fI option\fR +\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 \fBcanvas\fR command. -.\" METHOD: configure .TP \fIpathName \fBconfigure ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR? . Query or modify the configuration options of the widget. If no \fIoption\fR is specified, returns a list describing all of @@ -518,15 +537,14 @@ 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 \fBcanvas\fR command. -.\" METHOD: coords .TP -\fIpathName \fBcoords \fItagOrId \fR?\fIx0 y0 ...\fR? +\fIpathName\fR \fBcoords \fItagOrId \fR?\fIx0 y0 ...\fR? .TP -\fIpathName \fBcoords \fItagOrId \fR?\fIcoordList\fR? +\fIpathName\fR \fBcoords \fItagOrId \fR?\fIcoordList\fR? . Query or modify the coordinates that define an item. If no coordinates are specified, this command returns a list whose elements are the coordinates of the item named by \fItagOrId\fR. @@ -541,11 +559,10 @@ which may not be the order originally given. Also the coordinates are always returned in screen units with no units (that is, in pixels). So if the original coordinates were specified for instance in centimeters or inches, the returned values will nevertheless be in pixels. .RE -.\" METHOD: create .TP \fIpathName \fBcreate \fItype x y \fR?\fIx y ...\fR? ?\fIoption value ...\fR? .TP \fIpathName \fBcreate \fItype coordList \fR?\fIoption value ...\fR? . @@ -555,11 +572,10 @@ one or more points, followed by specifications for zero or more item options. See the subsections on individual item types below for more on the syntax of this command. This command returns the id for the new item. -.\" METHOD: dchars .TP \fIpathName \fBdchars \fItagOrId first \fR?\fIlast\fR? . For each item given by \fItagOrId\fR, delete the characters, or coordinates, in the range given by \fIfirst\fR and \fIlast\fR, inclusive. @@ -568,17 +584,15 @@ Text items interpret \fIfirst\fR and \fIlast\fR as indices to a character, line and polygon items interpret them as indices to a coordinate (an x,y pair). Indices are described in \fBINDICES\fR above. If \fIlast\fR is omitted, it defaults to \fIfirst\fR. This command returns an empty string. -.\" METHOD: delete .TP \fIpathName \fBdelete \fR?\fItagOrId tagOrId ...\fR? . Delete each of the items given by each \fItagOrId\fR, and return an empty string. -.\" METHOD: dtag .TP \fIpathName \fBdtag \fItagOrId \fR?\fItagToDelete\fR? . For each of the items given by \fItagOrId\fR, delete the tag given by \fItagToDelete\fR from the list of those @@ -585,21 +599,19 @@ associated with the item. If an item does not have the tag \fItagToDelete\fR then the item is unaffected by the command. If \fItagToDelete\fR is omitted then it defaults to \fItagOrId\fR. This command returns an empty string. -.\" METHOD: find .TP \fIpathName \fBfind \fIsearchCommand \fR?\fIarg ...\fR? . This command returns a list consisting of all the items that meet the constraints specified by \fIsearchCommand\fR and \fIarg\fR's. \fISearchCommand\fR and \fIargs\fR have any of the forms accepted by the \fBaddtag\fR command. The items are returned in stacking order, with the lowest item first. -.\" METHOD: focus .TP \fIpathName \fBfocus \fR?\fItagOrId\fR? . Set the keyboard focus for the canvas widget to the item given by \fItagOrId\fR. @@ -625,70 +637,55 @@ within the canvas. In most cases it is advisable to follow the \fBfocus\fR widget command with the \fBfocus\fR command to set the focus window to the canvas (if it was not there already). .RE -.\" METHOD: gettags .TP -\fIpathName \fBgettags\fI tagOrId\fR +\fIpathName \fBgettags\fR \fItagOrId\fR . Return a list whose elements are the tags associated with the item given by \fItagOrId\fR. If \fItagOrId\fR refers to more than one item, then the tags are returned from the first such item in the display list. If \fItagOrId\fR does not refer to any items, or if the item contains no tags, then an empty string is returned. -.\" METHOD: icursor .TP \fIpathName \fBicursor \fItagOrId index\fR . Set the position of the insertion cursor for the item(s) given by \fItagOrId\fR to just before the character whose position is given by \fIindex\fR. If some or all of the items given by \fItagOrId\fR do not support an insertion cursor then this command has no effect on them. See \fBINDICES\fR above for a description of the legal forms for \fIindex\fR. -.RS -.PP -Note that the insertion cursor is only displayed in an item if +Note: the insertion cursor is only displayed in an item if that item currently has the keyboard focus (see the \fBfocus\fR widget command, above), but the cursor position may be set even when the item does not have the focus. -.PP This command returns an empty string. -.RE -.\" METHOD: image .TP \fIpathName \fBimage \fIimagename\fR ?\fIsubsample\fR? ?\fIzoom\fR? . -Draw the canvas into the Tk photo image named \fIimagename\fR. -If a \fB\-scrollregion\fR has been defined then this will be the boundaries -of the canvas region drawn and the final size of the photo image. Otherwise -the widget width and height with an origin of 0,0 will be the size of the -canvas region drawn and the final size of the photo image. Optionally an -integer \fIsubsample\fR factor may be given and the photo image -will be reduced in size. -.RS -.PP -In addition to the \fIsubsample\fR an integer \fIzoom\fR factor can also -be given and the photo image will be enlarged. The image background will -be filled with the canvas background colour. The canvas widget does not -need to be mapped for this widget command to work, but at least one of -it's ancestors must be mapped. -.PP +Draw the canvas into the Tk photo image named \fIimagename\fR. If a \fB-scrollregion\fR +has been defined then this will be the boundaries of the canvas region drawn and the +final size of the photo image. Otherwise the widget width and height with an origin +of 0,0 will be the size of the canvas region drawn and the final size of the photo +image. Optionally an integer \fIsubsample\fR factor may be given and the photo image +will be reduced in size. In addition to the \fIsubsample\fR an integer \fIzoom\fR +factor can also be given and the photo image will be enlarged. The image background +will be filled with the canvas background colour. The canvas widget does not need to +be mapped for this widget command to work, but at least one of it's ancestors must be +mapped. This command returns an empty string. -.RE -.\" METHOD: imove .TP \fIpathName \fBimove \fItagOrId index x y\fR . This command causes the \fIindex\fR'th coordinate of each of the items indicated by \fItagOrId\fR to be relocated to the location (\fIx\fR,\fIy\fR). Each item interprets \fIindex\fR independently according to the rules described in \fBINDICES\fR above. Out of the standard set of items, only line and polygon items may have their coordinates relocated this way. -.\" METHOD: index .TP \fIpathName \fBindex \fItagOrId index\fR . This command returns a decimal string giving the numerical index within \fItagOrId\fR corresponding to \fIindex\fR. @@ -699,11 +696,10 @@ The return value is guaranteed to lie between 0 and the number of characters, or coordinates, within the item, inclusive. If \fItagOrId\fR refers to multiple items, then the index is processed in the first of these items that supports indexing operations (in display list order). -.\" METHOD: insert .TP \fIpathName \fBinsert \fItagOrId beforeThis string\fR . For each of the items given by \fItagOrId\fR, if the item supports text or coordinate, insertion then \fIstring\fR is inserted into the item's @@ -710,30 +706,24 @@ text just before the character, or coordinate, whose index is \fIbeforeThis\fR. Text items interpret \fIbeforeThis\fR as an index to a character, line and polygon items interpret it as an index to a coordinate (an x,y pair). For lines and polygons the \fIstring\fR must be a valid coordinate sequence. -.RS -.PP See \fBINDICES\fR above for information about the forms allowed for \fIbeforeThis\fR. -.PP This command returns an empty string. -.RE -.\" METHOD: itemcget .TP -\fIpathName \fBitemcget\fI tagOrId option\fR +\fIpathName \fBitemcget\fR \fItagOrId\fR \fIoption\fR . Returns the current value of the configuration option for the item given by \fItagOrId\fR whose name is \fIoption\fR. This command is similar to the \fBcget\fR widget command except that it applies to a particular item rather than the widget as a whole. \fIOption\fR may have any of the values accepted by the \fBcreate\fR widget command when the item was created. If \fItagOrId\fR is a tag that refers to more than one item, the first (lowest) such item is used. -.\" METHOD: itemconfigure .TP \fIpathName \fBitemconfigure \fItagOrId\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR? . This command is similar to the \fBconfigure\fR widget command except that it modifies item-specific options for the items given by @@ -752,11 +742,10 @@ this case the command returns an empty string. The \fIoption\fRs and \fIvalue\fRs are the same as those permissible in the \fBcreate\fR widget command when the item(s) were created; see the sections describing individual item types below for details on the legal options. -.\" METHOD: lower .TP \fIpathName \fBlower \fItagOrId \fR?\fIbelowThis\fR? . Move all of the items given by \fItagOrId\fR to a new position in the display list just before the item given by \fIbelowThis\fR. @@ -763,25 +752,23 @@ If \fItagOrId\fR refers to more than one item then all are moved but the relative order of the moved items will not be changed. \fIBelowThis\fR is a tag or id; if it refers to more than one item then the first (lowest) of these items in the display list is used as the destination location for the moved items. -Note that this command has no effect on window items. Window items always +Note: this command has no effect on window items. Window items always obscure other item types, and the stacking order of window items is determined by the \fBraise\fR command and \fBlower\fR command, not the \fBraise\fR widget command and \fBlower\fR widget command for canvases. This command returns an empty string. -.\" METHOD: move .TP \fIpathName \fBmove \fItagOrId xAmount yAmount\fR . Move each of the items given by \fItagOrId\fR in the canvas coordinate space by adding \fIxAmount\fR to the x-coordinate of each point associated with the item and \fIyAmount\fR to the y-coordinate of each point associated with the item. This command returns an empty string. -.\" METHOD: moveto .TP \fIpathName \fBmoveto \fItagOrId xPos yPos\fR . Move the items given by \fItagOrId\fR in the canvas coordinate space so that the first coordinate pair (the upper-left corner of the @@ -790,11 +777,10 @@ position (\fIxPos\fR,\fIyPos\fR). \fIxPos\fR and \fIyPos\fR may be the empty string, in which case the corresponding coordinate will be unchanged. All items matching \fItagOrId\fR remain in the same positions relative to each other. This command returns an empty string. -.\" METHOD: postscript .TP \fIpathName \fBpostscript \fR?\fIoption value option value ...\fR? . Generate a Postscript representation for part or all of the canvas. If the \fB\-file\fR option is specified then the Postscript is written @@ -817,19 +803,17 @@ options to specify the area of the canvas to print. The \fIoption\fR\-\fIvalue\fR argument pairs provide additional information to control the generation of Postscript. The following options are supported: .RS -.\" OPTION: -channel .TP \fB\-channel \fIchannelName\fR . Specifies the name of the channel to which to write the Postscript. If this option and the \fB\-file\fR option are not specified then the Postscript is returned as the result of the command. -.\" OPTION: -colormap .TP \fB\-colormap \fIvarName\fR . \fIVarName\fR must be the name of an array variable that specifies a color mapping to use in the Postscript. @@ -839,33 +823,27 @@ When outputting color information in the Postscript, Tk checks to see if there is an element of \fIvarName\fR with the same name as the color. If so, Tk uses the value of the element as the Postscript command to set the color. -.RS -.PP If this option has not been specified, or if there is no entry in \fIvarName\fR for a given color, then Tk uses the red, green, and blue intensities from the X color. -.RE -.\" OPTION: -colormode .TP \fB\-colormode \fImode\fR . Specifies how to output color information. \fIMode\fR must be either \fBcolor\fR (for full color output), \fBgray\fR (convert all colors to their gray-scale equivalents) or \fBmono\fR (convert all colors to black or white). -.\" OPTION: -file .TP \fB\-file \fIfileName\fR . Specifies the name of the file in which to write the Postscript. If this option and the \fB\-channel\fR option are not specified then the Postscript is returned as the result of the command. -.\" OPTION: -fontmap .TP \fB\-fontmap \fIvarName\fR . \fIVarName\fR must be the name of an array variable that specifies a font mapping to use in the Postscript. @@ -878,36 +856,27 @@ that element is used in the Postscript. Otherwise Tk attempts to guess what Postscript font to use. Tk's guesses generally only work for well-known fonts such as Times and Helvetica and Courier, and only if the X font name does not omit any dashes up through the point size. -.RS -.PP For example, \fB\-*\-Courier\-Bold\-R\-Normal\-\-*\-120\-*\fR will work but \fB*Courier\-Bold\-R\-Normal*120*\fR will not; Tk needs the dashes to parse the font name). -.RE -.\" OPTION: -height .TP \fB\-height \fIsize\fR . Specifies the height of the area of the canvas to print. Defaults to the height of the canvas window. -.\" OPTION: -pageanchor .TP \fB\-pageanchor \fIanchor\fR . Specifies which point of the printed area of the canvas should appear over the positioning point on the page (which is given by the \fB\-pagex\fR and \fB\-pagey\fR options). -.RS -.PP For example, \fB\-pageanchor n\fR means that the top center of the area of the canvas being printed (as it appears in the canvas window) should be over the positioning point. Defaults to \fBcenter\fR. -.RE -.\" OPTION: -pageheight .TP \fB\-pageheight \fIsize\fR . Specifies that the Postscript should be scaled in both x and y so that the printed area is \fIsize\fR high on the Postscript page. @@ -916,11 +885,10 @@ or \fBp\fR or nothing for printer's points (1/72 inch). Defaults to the height of the printed area on the screen. If both \fB\-pageheight\fR and \fB\-pagewidth\fR are specified then the scale factor from \fB\-pagewidth\fR is used (non-uniform scaling is not implemented). -.\" OPTION: -pagewidth .TP \fB\-pagewidth \fIsize\fR . Specifies that the Postscript should be scaled in both x and y so that the printed area is \fIsize\fR wide on the Postscript page. @@ -927,29 +895,26 @@ \fISize\fR has the same form as for \fB\-pageheight\fR. Defaults to the width of the printed area on the screen. If both \fB\-pageheight\fR and \fB\-pagewidth\fR are specified then the scale factor from \fB\-pagewidth\fR is used (non-uniform scaling is not implemented). -.\" OPTION: -pagex .TP \fB\-pagex \fIposition\fR . \fIPosition\fR gives the x-coordinate of the positioning point on the Postscript page, using any of the forms allowed for \fB\-pageheight\fR. Used in conjunction with the \fB\-pagey\fR and \fB\-pageanchor\fR options to determine where the printed area appears on the Postscript page. Defaults to the center of the page. -.\" OPTION: -pagey .TP \fB\-pagey \fIposition\fR . \fIPosition\fR gives the y-coordinate of the positioning point on the Postscript page, using any of the forms allowed for \fB\-pageheight\fR. Used in conjunction with the \fB\-pagex\fR and \fB\-pageanchor\fR options to determine where the printed area appears on the Postscript page. Defaults to the center of the page. -.\" OPTION: -rotate .TP \fB\-rotate \fIboolean\fR . \fIBoolean\fR specifies whether the printed area is to be rotated 90 degrees. @@ -957,34 +922,30 @@ the short dimension of the page .PQ portrait " orientation" ; in rotated output the x-axis runs along the long dimension of the page .PQ landscape " orientation" . Defaults to non-rotated. -.\" OPTION: -width .TP \fB\-width \fIsize\fR . Specifies the width of the area of the canvas to print. Defaults to the width of the canvas window. -.\" OPTION: -x .TP \fB\-x \fIposition\fR . Specifies the x-coordinate of the left edge of the area of the canvas that is to be printed, in canvas coordinates, not window coordinates. Defaults to the coordinate of the left edge of the window. -.\" OPTION: -y .TP \fB\-y \fIposition\fR . Specifies the y-coordinate of the top edge of the area of the canvas that is to be printed, in canvas coordinates, not window coordinates. Defaults to the coordinate of the top edge of the window. .RE -.\" METHOD: raise .TP \fIpathName \fBraise \fItagOrId \fR?\fIaboveThis\fR? . Move all of the items given by \fItagOrId\fR to a new position in the display list just after the item given by \fIaboveThis\fR. @@ -994,16 +955,15 @@ item then the last (topmost) of these items in the display list is used as the destination location for the moved items. This command returns an empty string. .RS .PP -Note this this command has no effect on window items. Window items always +Note: this command has no effect on window items. Window items always obscure other item types, and the stacking order of window items is determined by the \fBraise\fR command and \fBlower\fR command, not the \fBraise\fR widget command and \fBlower\fR widget command for canvases. .RE -.\" METHOD: rchars .TP \fIpathName \fBrchars \fItagOrId first last string\fR . This command causes the text or coordinates between \fIfirst\fR and \fIlast\fR for each of the items indicated by \fItagOrId\fR to be replaced by @@ -1011,11 +971,10 @@ according to the rules described in \fBINDICES\fR above. Out of the standard set of items, text items support this operation by altering their text as directed, and line and polygon items support this operation by altering their coordinate list (in which case \fIstring\fR should be a list of coordinates to use as a replacement). The other items ignore this operation. -.\" METHOD: rotate .TP \fIpathName \fBrotate \fItagOrId xOrigin yOrigin angle\fR .VS "8.7, TIP164" Rotate the coordinates of all of the items given by \fItagOrId\fR in canvas coordinate space. @@ -1033,11 +992,10 @@ .PP Some items (currently \fBarc\fR and\fB text\fR) have angles in their options; this command \fIdoes not\fR affect those options. .RE .VE "8.7, TIP164" -.\" METHOD: scale .TP \fIpathName \fBscale \fItagOrId xOrigin yOrigin xScale yScale\fR . Rescale the coordinates of all of the items given by \fItagOrId\fR in canvas coordinate space. @@ -1055,13 +1013,12 @@ .PP Note that some items have only a single pair of coordinates (e.g., text, images and windows) and so scaling of them by this command can only move them around. .RE -.\" METHOD: scan .TP -\fIpathName \fBscan\fI option args\fR +\fIpathName \fBscan\fR \fIoption args\fR . This command is used to implement scanning on canvases. It has two forms, depending on \fIoption\fR: .RS .TP @@ -1083,11 +1040,10 @@ This command is typically associated with mouse motion events in the widget, to produce the effect of dragging the canvas at high speed through its window. The return value is an empty string. .RE -.\" METHOD: select .TP \fIpathName \fBselect \fIoption\fR ?\fItagOrId arg\fR? . Manipulates the selection in one of several ways, depending on \fIoption\fR. @@ -1150,21 +1106,19 @@ If the selection anchor point for the widget is not currently in \fItagOrId\fR, then it is set to the same character given by \fIindex\fR. Returns an empty string. .RE -.\" METHOD: type .TP \fIpathName \fBtype\fI tagOrId\fR . Returns the type of the item given by \fItagOrId\fR, such as \fBrectangle\fR or \fBtext\fR. If \fItagOrId\fR refers to more than one item, then the type of the first item in the display list is returned. If \fItagOrId\fR does not refer to any items at all then an empty string is returned. -.\" METHOD: xview .TP \fIpathName \fBxview \fR?\fIargs\fR? . This command is used to query and change the horizontal position of the information displayed in the canvas's window. @@ -1204,11 +1158,10 @@ becomes visible. If \fIwhat\fR is \fBunits\fR, the view adjusts left or right in units of the \fBxScrollIncrement\fR option, if it is greater than zero, or in units of one-tenth the window's width otherwise. .RE -.\" METHOD: yview .TP \fIpathName \fByview ?\fIargs\fR? . This command is used to query and change the vertical position of the information displayed in the canvas's window. @@ -1265,11 +1218,10 @@ the coordinates of the item. .SS "COMMON ITEM OPTIONS" .PP Many items share a common set of options. These options are explained here, and then referred to be each widget type for brevity. -.\" OPTION: -anchor .TP \fB\-anchor \fIanchorPos\fR . \fIAnchorPos\fR tells how to position the item relative to the positioning point for the item; it may have any of the forms @@ -1276,67 +1228,56 @@ accepted by \fBTk_GetAnchor\fR. For example, if \fIanchorPos\fR is \fBcenter\fR then the item is centered on the point; if \fIanchorPos\fR is \fBn\fR then the item will be drawn so that its top center point is at the positioning point. This option defaults to \fBcenter\fR. -.\" OPTION: -dash .TP \fB\-dash \fIpattern\fR -.\" OPTION: -activedash .TP \fB\-activedash \fIpattern\fR -.\" OPTION: -disableddash .TP \fB\-disableddash \fIpattern\fR . -These options specify dash patterns for the normal, active +This option specifies dash patterns for the normal, active state, and disabled state of an item. \fIpattern\fR may have any of the forms accepted by \fBTk_GetDash\fR. If the dash options are omitted then the default is a solid outline. See \fBDASH PATTERNS\fR for more information. -.\" OPTION: -dashoffset .TP \fB\-dashoffset \fIoffset\fR . The starting \fIoffset\fR in pixels into the pattern provided by the \fB\-dash\fR option. \fB\-dashoffset\fR is ignored if there is no \fB\-dash\fR pattern. The \fIoffset\fR may have any of the forms described in the \fBCOORDINATES\fR section above. -.\" OPTION: -fill .TP \fB\-fill \fIcolor\fR -.\" OPTION: -activefill .TP \fB\-activefill \fIcolor\fR -.\" OPTION: -disabledfill .TP \fB\-disabledfill \fIcolor\fR . -These options specify the color to be used to fill item's area. +Specifies the color to be used to fill item's area. in its normal, active, and disabled states. The even-odd fill rule is used. \fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR. For the line item, it specifies the color of the line drawn. For the text item, it specifies the foreground color of the text. If \fIcolor\fR is an empty string (the default for all canvas items except line and text), then the item will not be filled. -.\" OPTION: -outline .TP \fB\-outline \fIcolor\fR -.\" OPTION: -activeoutline .TP \fB\-activeoutline \fIcolor\fR -.\" OPTION: -disabledoutline .TP \fB\-disabledoutline \fIcolor\fR . -These options specify the color that should be used to draw the +This option specifies the color that should be used to draw the outline of the item in its normal, active and disabled states. \fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR is specified as an empty string then no outline is drawn for the item. -.\" OPTION: -offset .TP \fB\-offset \fIoffset\fR . Specifies the offset of stipples. The offset value can be of the form \fBx,y\fR or \fIside\fR, where side can be \fBn\fR, \fBne\fR, \fBe\fR, @@ -1347,21 +1288,18 @@ toplevel origin instead. For canvas objects, the \fB\-offset\fR option is used for stippling as well. For the line and polygon canvas items you can also specify an index as argument, which connects the stipple origin to one of the coordinate points of the line/polygon. Note that stipple offsets are \fIonly supported on X11\fR; they are silently ignored on other platforms. -.\" OPTION: -outlinestipple .TP \fB\-outlinestipple \fIbitmap\fR -.\" OPTION: -activeoutlinestipple .TP \fB\-activeoutlinestipple \fIbitmap\fR -.\" OPTION: -disabledoutlinestipple .TP \fB\-disabledoutlinestipple \fIbitmap\fR . -These options specify stipple patterns that should be used to draw the +This option specifies stipple patterns that should be used to draw the outline of the item in its normal, active and disabled states. Indicates that the outline for the item should be drawn with a stipple pattern; \fIbitmap\fR specifies the stipple pattern to use, in any of the forms accepted by \fBTk_GetBitmap\fR. If the \fB\-outline\fR option has not been specified then this option @@ -1368,28 +1306,24 @@ has no effect. If \fIbitmap\fR is an empty string (the default), then the outline is drawn in a solid fashion. \fINote that stipples are not well supported on platforms that do not use X11 as their drawing API.\fR -.\" OPTION: -outlineoffset .TP \fB\-outlineoffset \fIoffset\fR . Specifies the offset of the stipple pattern used for outlines, in the same way that the \fB\-outline\fR option controls fill stipples. (See the \fB\-outline\fR option for a description of the syntax of \fIoffset\fR.) -.\" OPTION: -stipple .TP \fB\-stipple \fIbitmap\fR -.\" OPTION: -activestipple .TP \fB\-activestipple \fIbitmap\fR -.\" OPTION: -disabledstipple .TP \fB\-disabledstipple \fIbitmap\fR . -These options specify stipple patterns that should be used to fill +This option specifies stipple patterns that should be used to fill the item in its normal, active and disabled states. \fIbitmap\fR specifies the stipple pattern to use, in any of the forms accepted by \fBTk_GetBitmap\fR. If the \fB\-fill\fR option has not been specified then this option has no effect. @@ -1396,35 +1330,30 @@ If \fIbitmap\fR is an empty string (the default), then filling is done in a solid fashion. For the text item, it affects the actual text. \fINote that stipples are not well supported on platforms that do not use X11 as their drawing API.\fR -.\" OPTION: -state .TP \fB\-state \fIstate\fR . This allows an item to override the canvas widget's global \fIstate\fR option. It takes the same values: \fInormal\fR, \fIdisabled\fR or \fIhidden\fR. -.\" OPTION: -tags .TP \fB\-tags \fItagList\fR . Specifies a set of tags to apply to the item. \fITagList\fR consists of a list of tag names, which replace any existing tags for the item. \fITagList\fR may be an empty list. -.\" OPTION: -width .TP \fB\-width \fIoutlineWidth\fR -.\" OPTION: -activewidth .TP \fB\-activewidth \fIoutlineWidth\fR -.\" OPTION: -disabledwidth .TP \fB\-disabledwidth \fIoutlineWidth\fR . -These options specify the width of the outline to be drawn around +Specifies the width of the outline to be drawn around the item's region, in its normal, active and disabled states. \fIoutlineWidth\fR may be in any of the forms described in the \fBCOORDINATES\fR section above. If the \fB\-outline\fR option has been specified as an empty string then this option has no effect. This option defaults to 1.0. @@ -1433,13 +1362,12 @@ .SH "STANDARD ITEM TYPES" .SS "ARC ITEMS" .PP Items of type \fBarc\fR appear on the display as arc-shaped regions. An arc is a section of an oval delimited by two angles (specified -by either the \fB\-start\fR and \fB\-extent\fR options or the \fB\-height\fR -option) and displayed in one of several ways (specified by the \fB\-style\fR -option). +by either the \fB\-start\fR and \fB\-extent\fR options or the \fB\-height\fR option) +and displayed in one of several ways (specified by the \fB\-style\fR option). Arcs are created with widget commands of the following form: .CS \fIpathName \fBcreate arc \fIx1 y1 x2 y2 \fR?\fIoption value ...\fR? \fIpathName \fBcreate arc \fIcoordList\fR ?\fIoption value ...\fR? .CE @@ -1471,36 +1399,30 @@ \fB\-state\fR \fB\-tags\fR \fB\-width\fR \fB\-activewidth\fR \fB\-disabledwidth\fR .DE The following extra options are supported for arcs: -.\" OPTION: -extent .TP \fB\-extent \fIdegrees\fR -. Specifies the size of the angular range occupied by the arc. The arc's range extends for \fIdegrees\fR degrees counter-clockwise from the starting angle given by the \fB\-start\fR option. \fIDegrees\fR may be negative. If it is greater than 360 or less than \-360, then \fIdegrees\fR modulo 360 is used as the extent. -.\" OPTION: -start .TP \fB\-start \fIdegrees\fR -. Specifies the beginning of the angular range occupied by the arc. \fIDegrees\fR is given in units of degrees measured counter-clockwise from the 3-o'clock position; it may be either positive or negative. -.\" OPTION: -height .TP \fB\-height \fIdistance\fR -. Provides a shortcut for creating a circular arc segment by defining the distance of the mid-point of the arc from its chord. When this option is used the coordinates are interpreted as the start and end coordinates -of the chord, and the options \fB\-start\fR and \fB\-extent\fR are ignored. +of the chord, and the options \fB\-start\fR and \fB-extent\fR are ignored. The value of \fIdistance\fR has the following meaning: .RS .PP .RS \fIdistance\fR > 0 creates a clockwise arc @@ -1519,14 +1441,12 @@ choosing the minus sign for the minor arc and the plus sign for the major arc. .PP Note that \fBitemcget \-height\fR always returns 0 so that introspection code can be kept simple. .RE -.\" OPTION: -style .TP \fB\-style \fItype\fR -. Specifies how to draw the arc. If \fItype\fR is \fBpieslice\fR (the default) then the arc's region is defined by a section of the oval's perimeter plus two line segments, one between the center of the oval and each end of the perimeter section. If \fItype\fR is \fBchord\fR then the arc's region is defined @@ -1560,51 +1480,39 @@ .ta 3i \fB\-anchor\fR \fB\-state\fR \fB\-tags\fR .DE The following extra options are supported for bitmaps: -.\" OPTION: -background .TP \fB\-background \fIcolor\fR -.\" OPTION: -activebackground .TP \fB\-activebackground \fIcolor\fR -.\" OPTION: -disabledbackground .TP \fB\-disabledbackground \fIcolor\fR -. Specifies the color to use for each of the bitmap's .QW 0 valued pixels in its normal, active and disabled states. \fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR. If this option is not specified, or if it is specified as an empty string, then nothing is displayed where the bitmap pixels are 0; this produces a transparent effect. -.\" OPTION: -bitmap .TP \fB\-bitmap \fIbitmap\fR -.\" OPTION: -activebitmap .TP \fB\-activebitmap \fIbitmap\fR -.\" OPTION: -disabledbitmap .TP \fB\-disabledbitmap \fIbitmap\fR -. -These options specify the bitmaps to display in the item in its normal, -active and disabled states. +Specifies the bitmaps to display in the item in its normal, active and +disabled states. \fIBitmap\fR may have any of the forms accepted by \fBTk_GetBitmap\fR. -.\" OPTION: -foreground .TP \fB\-foreground \fIcolor\fR -.\" OPTION: -activeforeground .TP \fB\-activeforeground \fIcolor\fR -.\" OPTION: -disabledforeground .TP \fB\-disabledforeground \fIcolor\fR -. -These options specify the color to use for each of the bitmap's +Specifies the color to use for each of the bitmap's .QW 1 valued pixels in its normal, active and disabled states. \fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR. .SS "IMAGE ITEMS" .PP @@ -1630,20 +1538,16 @@ .ta 3i \fB\-anchor\fR \fB\-state\fR \fB\-tags\fR .DE The following extra options are supported for images: -.\" OPTION: -image .TP \fB\-image \fIname\fR -.\" OPTION: -activeimage .TP \fB\-activeimage \fIname\fR -.\" OPTION: -disabledimage .TP \fB\-disabledimage \fIname\fR -. Specifies the name of the images to display in the item in is normal, active and disabled states. This image must have been created previously with the \fBimage create\fR command. .SS "LINE ITEMS" @@ -1679,14 +1583,12 @@ \fB\-state\fR \fB\-tags\fR \fB\-width\fR \fB\-activewidth\fR \fB\-disabledwidth\fR .DE The following extra options are supported for lines: -.\" OPTION: -arrow .TP \fB\-arrow \fIwhere\fR -. Indicates whether or not arrowheads are to be drawn at one or both ends of the line. \fIWhere\fR must have one of the values \fBnone\fR (for no arrowheads), \fBfirst\fR (for an arrowhead at the first point of the line), \fBlast\fR (for an arrowhead at the last point of the line), or @@ -1696,14 +1598,12 @@ line end point so that the rendered line ends at the neck of the arrowhead rather than at its tip so that the line doesn't extend past the edge of the arrowhead. This may trigger a \fBLeave\fR event if the mouse is hovering this line end. Conversely, when removing an arrowhead Tk adjusts the corresponding line point the other way round, which may trigger an \fBEnter\fR event. -.\" OPTION: -arrowshape .TP \fB\-arrowshape \fIshape\fR -. This option indicates how to draw arrowheads. The \fIshape\fR argument must be a list with three elements, each specifying a distance in any of the forms described in the \fBCOORDINATES\fR section above. The first element of the list gives the distance along the line @@ -1713,40 +1613,33 @@ element gives the distance from the outside edge of the line to the trailing points. If this option is not specified then Tk picks a .QW reasonable shape. -.\" OPTION: -capstyle .TP \fB\-capstyle \fIstyle\fR -. Specifies the ways in which caps are to be drawn at the endpoints of the line. \fIStyle\fR may have any of the forms accepted by \fBTk_GetCapStyle\fR (\fBbutt\fR, \fBprojecting\fR, or \fBround\fR). If this option is not specified then it defaults to \fBbutt\fR. Where arrowheads are drawn the cap style is ignored. -.\" OPTION: -joinstyle .TP \fB\-joinstyle \fIstyle\fR -. Specifies the ways in which joints are to be drawn at the vertices of the line. \fIStyle\fR may have any of the forms accepted by \fBTk_GetJoinStyle\fR (\fBbevel\fR, \fBmiter\fR, or \fBround\fR). If this option is not specified then it defaults to \fBround\fR. If the line only contains two points then this option is irrelevant. -.\" OPTION: -smooth .TP \fB\-smooth \fIsmoothMethod\fR -. \fIsmoothMethod\fR must have one of the forms accepted by \fBTcl_GetBoolean\fR 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 +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 truth value assumes \fBtrue\fR smoothing. If the smoothing method is \fBtrue\fR, this indicates that the line should be drawn as a curve, rendered as a set of quadratic splines: one spline is drawn for the first and second line segments, one for the second @@ -1759,14 +1652,12 @@ coordinates are control points on the cubic Bezier curve. Straight 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. -.\" OPTION: -splinesteps .TP \fB\-splinesteps \fInumber\fR -. Specifies the degree of smoothness desired for curves: each spline will be approximated with \fInumber\fR line segments. This option is ignored unless the \fB\-smooth\fR option is true or \fBraw\fR. .SS "OVAL ITEMS" .PP @@ -1819,12 +1710,12 @@ Polygons are created with widget commands of the following form: .CS \fIpathName \fBcreate polygon \fIx1 y1 ... xn yn \fR?\fIoption value ...\fR? \fIpathName \fBcreate polygon \fIcoordList\fR ?\fIoption value ...\fR? .CE -The arguments \fIx1\fR through \fIyn\fR or \fIcoordList\fR specify the -coordinates for three or more points that define a polygon. +The arguments \fIx1\fR through \fIyn\fR or \fIcoordList\fR specify the coordinates for +three or more points that define a polygon. The first point should not be repeated as the last to close the shape; Tk will automatically close the periphery between the first and last points. After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR pairs, each of which sets one of the configuration options @@ -1849,27 +1740,22 @@ \fB\-state\fR \fB\-tags\fR \fB\-width\fR \fB\-activewidth\fR \fB\-disabledwidth\fR .DE The following extra options are supported for polygons: -.\" OPTION: -joinstyle .TP \fB\-joinstyle \fIstyle\fR -. Specifies the ways in which joints are to be drawn at the vertices of the outline. \fIStyle\fR may have any of the forms accepted by \fBTk_GetJoinStyle\fR (\fBbevel\fR, \fBmiter\fR, or \fBround\fR). If this option is not specified then it defaults to \fBround\fR. -.\" OPTION: -smooth .TP \fB\-smooth \fIboolean\fR -. \fIBoolean\fR must have one of the forms accepted by \fBTcl_GetBoolean\fR 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 +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 truth value assumes \fBtrue\fR smoothing. If the smoothing method is \fBtrue\fR, this indicates that the polygon should be drawn as a curve, rendered as a set of quadratic splines: one spline is drawn for the first and second line segments, one for the second @@ -1883,14 +1769,12 @@ line segments can be generated within a curve by making control points 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). -.\" OPTION: -splinesteps .TP \fB\-splinesteps \fInumber\fR -. Specifies the degree of smoothness desired for curves: each spline will be approximated with \fInumber\fR line segments. This option is ignored unless the \fB\-smooth\fR option is true or \fBraw\fR. .PP Polygon items are different from other items such as rectangles, ovals @@ -1977,59 +1861,48 @@ \fB\-stipple\fR \fB\-activestipple\fR \fB\-disabledstipple\fR \fB\-state\fR \fB\-tags\fR .DE The following extra options are supported for text items: -.\" OPTION: -angle .TP \fB\-angle \fIrotationDegrees\fR . \fIRotationDegrees\fR tells how many degrees to rotate the text anticlockwise about the positioning point for the text; it may have any floating-point value from 0.0 to 360.0. For example, if \fIrotationDegrees\fR is \fB90\fR, then the text will be drawn vertically from bottom to top. This option defaults to \fB0.0\fR. -.\" OPTION: -font .TP \fB\-font \fIfontName\fR -. Specifies the font to use for the text item. \fIFontName\fR may be any string acceptable to \fBTk_GetFont\fR. If this option is not specified, it defaults to a system-dependent font. -.\" OPTION: -justify .TP \fB\-justify \fIhow\fR -. Specifies how to justify the text within its bounding region. \fIHow\fR must be one of the values \fBleft\fR, \fBright\fR, or \fBcenter\fR. This option will only matter if the text is displayed as multiple lines. If the option is omitted, it defaults to \fBleft\fR. -.\" OPTION: -text .TP \fB\-text \fIstring\fR -. \fIString\fR specifies the characters to be displayed in the text item. 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. -.\" OPTION: -underline .TP -\fB\-underline \fInumber\fR -. +\fB\-underline \fI\fR Specifies the integer index of a character within the text to be 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). -.\" OPTION: -width .TP \fB\-width \fIlineLength\fR -. Specifies a maximum line length for the text, in any of the forms described in the \fBCOORDINATES\fR section above. If this option is zero (the default) the text is broken into lines only at newline characters. However, if this option is non-zero then any line that would @@ -2064,38 +1937,35 @@ .ta 3i \fB\-anchor\fR \fB\-state\fR \fB\-tags\fR .DE The following extra options are supported for window items: -.\" OPTION: -height .TP \fB\-height \fIpixels\fR . Specifies the height to assign to the item's window. \fIPixels\fR may have any of the forms described in the \fBCOORDINATES\fR section above. If this option is not specified, or if it is specified as zero, then the window is given whatever height it requests internally. -.\" OPTION: -width .TP \fB\-width \fIpixels\fR . Specifies the width to assign to the item's window. \fIPixels\fR may have any of the forms described in the \fBCOORDINATES\fR section above. If this option is not specified, or if it is specified as zero, then the window is given whatever width it requests internally. -.\" OPTION: -window .TP \fB\-window \fIpathName\fR . Specifies the window to associate with this item. The window specified by \fIpathName\fR must either be a child of the canvas widget or a child of some ancestor of the canvas widget. \fIPathName\fR may not refer to a top-level window. .PP -Note that, due to restrictions in the ways that windows are managed, it is not +Note: due to restrictions in the ways that windows are managed, it is not possible to draw other graphical items (such as lines and images) on top of window items. A window item always obscures any graphics that overlap it, regardless of their order in the display list. Also note that window items, unlike other canvas items, are not clipped for display by their containing canvas's border, and are instead clipped by the parent widget of Index: doc/checkbutton.n ================================================================== --- doc/checkbutton.n +++ doc/checkbutton.n @@ -195,22 +195,18 @@ \fIpathName option \fR?\fIarg ...\fR? .CE \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for checkbutton widgets: -.\" METHOD: cget .TP -\fIpathName \fBcget\fI option\fR -. +\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 \fBcheckbutton\fR command. -.\" METHOD: configure .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue 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 @@ -219,47 +215,37 @@ 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 \fBcheckbutton\fR command. -.\" METHOD: deselect .TP \fIpathName \fBdeselect\fR -. Deselects the checkbutton and sets the associated variable to its .QW off value. -.\" METHOD: flash .TP \fIpathName \fBflash\fR -. Flashes the checkbutton. This is accomplished by redisplaying the checkbutton several times, alternating between active and normal colors. At the end of the flash the checkbutton is left in the same normal/active state as when the command was invoked. This command is ignored if the checkbutton's state is \fBdisabled\fR. -.\" METHOD: invoke .TP \fIpathName \fBinvoke\fR -. Does just what would have happened if the user invoked the checkbutton with the mouse: toggle the selection state of the button and invoke the Tcl command associated with the checkbutton, 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 checkbutton. This command is ignored if the checkbutton's state is \fBdisabled\fR. -.\" METHOD: select .TP \fIpathName \fBselect\fR -. Selects the checkbutton and sets the associated variable to its .QW on value. -.\" METHOD: toggle .TP \fIpathName \fBtoggle\fR -. Toggles the selection state of the button, redisplaying it and modifying its associated variable to reflect the new state. .SH BINDINGS .PP Tk automatically creates class bindings for checkbuttons that give them @@ -289,19 +275,19 @@ .SH EXAMPLE .PP This example shows a group of uncoupled checkbuttons. .PP .CS -labelframe .lbl -text "Steps:" -\fBcheckbutton\fR .c1 -text Lights -variable lights -\fBcheckbutton\fR .c2 -text Cameras -variable cameras -\fBcheckbutton\fR .c3 -text Action! -variable action -pack .c1 .c2 .c3 -in .lbl +labelframe .lbl \-text "Steps:" +\fBcheckbutton\fR .c1 \-text Lights \-variable lights +\fBcheckbutton\fR .c2 \-text Cameras \-variable cameras +\fBcheckbutton\fR .c3 \-text Action! \-variable action +pack .c1 .c2 .c3 \-in .lbl pack .lbl .CE .SH "SEE ALSO" button(n), options(n), radiobutton(n), ttk::checkbutton(n) .SH KEYWORDS checkbutton, widget '\" Local Variables: '\" mode: nroff '\" End: Index: doc/chooseColor.n ================================================================== --- doc/chooseColor.n +++ doc/chooseColor.n @@ -16,27 +16,21 @@ .SH DESCRIPTION .PP The procedure \fBtk_chooseColor\fR pops up a dialog box for the user to select a color. The following \fIoption\-value\fR pairs are possible as command line arguments: -.\" OPTION: -initialcolor .TP -\fB\-initialcolor\fI color\fR -. +\fB\-initialcolor\fR \fIcolor\fR Specifies the color to display in the color dialog when it pops up. \fIcolor\fR must be in a form acceptable to the \fBTk_GetColor\fR function. -.\" OPTION: -parent .TP -\fB\-parent\fI window\fR -. +\fB\-parent\fR \fIwindow\fR Makes \fIwindow\fR the logical parent of the color dialog. The color dialog is displayed on top of its parent window. -.\" OPTION: -title .TP -\fB\-title\fI titleString\fR -. +\fB\-title\fR \fItitleString\fR 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. .LP If the user selects a color, \fBtk_chooseColor\fR will return the name of the color in a form acceptable to \fBTk_GetColor\fR. If the @@ -43,12 +37,12 @@ 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"] +button .b \-bg [tk_chooseColor \-initialcolor gray \-title "Choose color"] .CE .SH KEYWORDS color, color selection, dialog '\" Local Variables: '\" mode: nroff '\" End: Index: doc/clipboard.n ================================================================== --- doc/clipboard.n +++ doc/clipboard.n @@ -25,13 +25,12 @@ appends should be completed before returning to the event loop. .PP The first argument to \fBclipboard\fR determines the format of the rest of the arguments and the behavior of the command. The following forms are currently supported: -.\" METHOD: append .TP -\fBclipboard append\fR ?\fB\-displayof\fI window\fR? ?\fB\-format\fI format\fR? ?\fB\-type\fI type\fR? ?\fB\-\|\-\fR? \fIdata\fR +\fBclipboard append\fR ?\fB\-displayof\fR \fIwindow\fR? ?\fB\-format\fR \fIformat\fR? ?\fB\-type\fR \fItype\fR? ?\fB\-\|\-\fR? \fIdata\fR . Appends \fIdata\fR to the clipboard on \fIwindow\fR's display in the form given by \fItype\fR with the representation given by \fIformat\fR and claims ownership of the clipboard on \fIwindow\fR's display. @@ -70,21 +69,19 @@ A \fB\-\|\-\fR argument may be specified to mark the end of options: the next argument will always be used as \fIdata\fR. This feature may be convenient if, for example, \fIdata\fR starts with a \fB\-\fR. .RE -.\" METHOD: clear .TP -\fBclipboard clear\fR ?\fB\-displayof\fI window\fR? +\fBclipboard clear\fR ?\fB\-displayof\fR \fIwindow\fR? . Claims ownership of the clipboard on \fIwindow\fR's display and removes any previous contents. \fIWindow\fR defaults to .QW . . Returns an empty string. -.\" METHOD: get .TP -\fBclipboard get\fR ?\fB\-displayof\fI window\fR? ?\fB\-type\fI type\fR? +\fBclipboard get\fR ?\fB\-displayof\fR \fIwindow\fR? ?\fB\-type\fR \fItype\fR? . Retrieve data from the clipboard on \fIwindow\fR's display. \fIWindow\fR defaults to .QW . . \fIType\fR specifies the form in which @@ -123,11 +120,11 @@ set script {} foreach item [$canvas find withtag $tag] { append script {$canvas create } [$canvas type $item] append script { } [$canvas coords $item] { } foreach config [$canvas itemconf $item] { - lassign $config name - - - value + lassign $config name \- \- \- value append script [list $name $value] { } } append script \en } return [string trim $script] @@ -134,22 +131,22 @@ } # Set up a binding on a canvas to cut and paste an item set c [canvas .c] pack $c -$c create text 150 30 -text "cut and paste me" +$c create text 150 30 \-text "cut and paste me" bind $c <> { \fBclipboard clear\fR - \fBclipboard append -type\fR TkCanvasItem \e + \fBclipboard append \-type\fR TkCanvasItem \e [getItemConfig %W current] # Delete because this is cut, not copy. %W delete current } bind $c <> { catch { set canvas %W - eval [\fBclipboard get -type\fR TkCanvasItem] + eval [\fBclipboard get \-type\fR TkCanvasItem] } } .CE .SH "SEE ALSO" interp(n), selection(n) Index: doc/console.n ================================================================== --- doc/console.n +++ doc/console.n @@ -9,11 +9,11 @@ .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME console \- Control the console on systems without a real console .SH SYNOPSIS -\fBconsole\fI subcommand\fR ?\fIarg ...\fR? +\fBconsole\fR \fIsubcommand\fR ?\fIarg ...\fR? .BE .SH DESCRIPTION .PP The console window is a replacement for a real console to allow input and output on the standard I/O channels on platforms that do not have @@ -21,43 +21,34 @@ Tk toolkit loaded, and control over this interpreter is given through the \fBconsole\fR command. The behaviour of the console window is defined mainly through the contents of the \fIconsole.tcl\fR file in the Tk library. Except for TkAqua, this command is not available when Tk is loaded into a tclsh interpreter with -.QW "\fBpackage require Tk\fR" , +.QW "\fBpackage require tk\fR" , as a conventional terminal is expected to be present in that case. In TkAqua, this command is disabled when there is a startup script and stdin is \fB/dev/null\fR (as is the case e.g. when a bundled application embedding Tk is started by the macOS Launcher). To enable the command in that case, define the environment variable \fBTK_CONSOLE\fR. This can be done by modifying the Info.plist file by adding the LSEnvironment key -to the main dict and setting its value to be a dict with the key -\fBTK_CONSOLE\fR. +to the main dict and setting its value to be a dict with the key \fBTK_CONSOLE\fR. .PP -.\" METHOD: eval .TP \fBconsole eval \fIscript\fR -. Evaluate the \fIscript\fR argument as a Tcl script in the console interpreter. The normal interpreter is accessed through the \fBconsoleinterp\fR command in the console interpreter. -.\" METHOD: hide .TP \fBconsole hide\fR -. Hide the console window from view. Precisely equivalent to withdrawing the \fB.\fR window in the console interpreter. -.\" METHOD: show .TP \fBconsole show\fR -. Display the console window. Precisely equivalent to deiconifying the \fB.\fR window in the console interpreter. -.\" METHOD: title .TP \fBconsole title \fR?\fIstring\fR? -. Query or modify the title of the console window. If \fIstring\fR is not specified, queries the title of the console window, and sets the title of the console window to \fIstring\fR otherwise. Precisely equivalent to using the \fBwm title\fR command in the console interpreter. @@ -65,20 +56,16 @@ .PP The \fBconsoleinterp\fR command in the console interpreter allows scripts to be evaluated in the main interpreter. It supports two subcommands: \fBeval\fR and \fBrecord\fR. .PP -.\" METHOD: eval .TP \fBconsoleinterp eval \fIscript\fR -. Evaluates \fIscript\fR as a Tcl script at the global level in the main interpreter. -.\" METHOD: record .TP \fBconsoleinterp record \fIscript\fR -. Records and evaluates \fIscript\fR as a Tcl script at the global level in the main interpreter as if \fIscript\fR had been typed in at the console. .SH "ADDITIONAL TRAP CALLS" .PP Index: doc/dialog.n ================================================================== --- doc/dialog.n +++ doc/dialog.n @@ -17,29 +17,35 @@ .SH DESCRIPTION .PP This procedure is part of the Tk script library. It is largely \fIdeprecated\fR by the \fBtk_messageBox\fR. Its arguments describe a dialog box: -.IP \fIwindow\fR +.TP +\fIwindow\fR Name of top-level window to use for dialog. Any existing window by this name is destroyed. -.IP \fItitle\fR +.TP +\fItitle\fR Text to appear in the window manager's title bar for the dialog. -.IP \fItext\fR +.TP +\fItext\fR Message to appear in the top portion of the dialog box. -.IP \fIbitmap\fR +.TP +\fIbitmap\fR If non-empty, specifies a bitmap (in a form suitable for Tk_GetBitmap) to display in the top portion of the dialog, to the left of the text. If this is an empty string then no bitmap is displayed in the dialog. -.IP \fIdefault\fR +.TP +\fIdefault\fR If this is an integer greater than or equal to zero, then it gives the index of the button that is to be the default button for the dialog (0 for the leftmost button, and so on). If negative or an empty string then there will not be any default button. -.IP \fIstring\fR +.TP +\fIstring\fR There will be one button for each of these arguments. Each \fIstring\fR specifies text to display in a button, in order from left to right. .PP After creating a dialog box, \fBtk_dialog\fR waits for the user to Index: doc/entry.n ================================================================== --- doc/entry.n +++ doc/entry.n @@ -11,11 +11,11 @@ .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME entry \- Create and manipulate 'entry' one-line text entry widgets .SH SYNOPSIS -\fBentry\fI pathName \fR?\fIoptions\fR? +\fBentry\fR \fIpathName \fR?\fIoptions\fR? .SO \-background \-highlightthickness \-selectbackground \-borderwidth \-insertbackground \-selectborderwidth \-cursor \-insertborderwidth \-selectforeground \-exportselection \-insertofftime \-takefocus @@ -174,13 +174,13 @@ \fB\-validate\fR option will also set itself to \fBnone\fR when you edit the entry widget from within either the \fB\-validatecommand\fR or the \fB\-invalidcommand\fR. Such editions will override the one that was being validated. If you wish to edit the entry widget (for example set it to {}) during validation and still have the \fB\-validate\fR option set, you should -include the command: +include the command .CS -after idle {%W config -validate %v} +after idle {%W config \-validate %v} .CE in the \fB\-validatecommand\fR or \fB\-invalidcommand\fR (whichever one you were editing the entry widget from). It is also recommended to not set an associated \fB\-textvariable\fR during validation, as that can cause the entry widget to become out of sync with the \fB\-textvariable\fR. @@ -199,43 +199,36 @@ Many of the widget commands for entries take one or more indices as arguments. An index specifies a particular character in the entry's string, in any of the following ways: .TP 12 \fInumber\fR -. Specifies the character as a numerical index, where 0 corresponds to the first character in the string. .TP 12 \fBanchor\fR -. Indicates the anchor point for the selection, which is set with the \fBselect from\fR and \fBselect adjust\fR widget commands. .TP 12 \fBend\fR -. Indicates the character just after the last one in the entry's string. This is equivalent to specifying a numerical index equal to the length of the entry's string. .TP 12 \fBinsert\fR -. Indicates the character adjacent to and immediately following the insertion cursor. .TP 12 \fBsel.first\fR -. Indicates the first character in the selection. It is an error to use this form if the selection is not in the entry window. .TP 12 \fBsel.last\fR -. Indicates the character just after the last one in the selection. It is an error to use this form if the selection is not in the entry window. .TP 12 \fB@\fInumber\fR -. In this form, \fInumber\fR is treated as an x-coordinate in the entry's window; the character spanning that x-coordinate is used. For example, .QW \fB@0\fR indicates the left-most character in the window. @@ -250,34 +243,28 @@ for the command \fBstring index\fR, with simple integer index arithmetic and indexing relative to \fBend\fR. .SS SUBCOMMANDS .PP The following commands are possible for entry widgets: -.\" METHOD: bbox .TP \fIpathName \fBbbox \fIindex\fR -. Returns a list of four numbers describing the bounding box 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 screen area covered by the character (in pixels relative to the widget) and the last two elements give the width and height of the character, in pixels. The bounding box may refer to a region outside the visible area of the window. -.\" METHOD: cget .TP -\fIpathName \fBcget\fI option\fR -. +\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 \fBentry\fR command. -.\" METHOD: configure .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue 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 @@ -286,78 +273,61 @@ 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 \fBentry\fR command. -.\" METHOD: delete .TP \fIpathName \fBdelete \fIfirst \fR?\fIlast\fR? -. Delete one or more elements of the entry. \fIFirst\fR is the index of the first character to delete, and \fIlast\fR is the index of the character just after the last one to delete. If \fIlast\fR is not specified it defaults to \fIfirst\fR+1, i.e. a single character is deleted. This command returns an empty string. -.\" METHOD: get .TP \fIpathName \fBget\fR -. Returns the entry's string. -.\" METHOD: icursor .TP \fIpathName \fBicursor \fIindex\fR -. Arrange for the insertion cursor to be displayed just before the character given by \fIindex\fR. Returns an empty string. -.\" METHOD: index .TP \fIpathName \fBindex\fI index\fR -. Returns the numerical index corresponding to \fIindex\fR. -.\" METHOD: insert .TP \fIpathName \fBinsert \fIindex string\fR -. Insert the characters of \fIstring\fR just before the character indicated by \fIindex\fR. Returns an empty string. -.\" METHOD: scan .TP -\fIpathName \fBscan\fI option args\fR -. +\fIpathName \fBscan\fR \fIoption args\fR This command is used to implement scanning on entries. It has two forms, depending on \fIoption\fR: .RS .TP \fIpathName \fBscan mark \fIx\fR -. Records \fIx\fR and the current view in the entry window; used in conjunction with later \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\fR -. This command computes the difference between its \fIx\fR argument and the \fIx\fR argument to the last \fBscan mark\fR command for the widget. It then adjusts the view left or right by 10 times the difference in x-coordinates. This command is typically associated with mouse motion events in the widget, to produce the effect of dragging the entry at high speed through the window. The return value is an empty string. .RE -.\" METHOD: selection .TP \fIpathName \fBselection \fIoption arg\fR -. This command is used to adjust the selection within an entry. It has several forms, depending on \fIoption\fR: .RS .TP \fIpathName \fBselection adjust \fIindex\fR -. Locate the end of the selection nearest to the character given by \fIindex\fR, and adjust that end of the selection to be at \fIindex\fR (i.e. including but not going beyond \fIindex\fR). The other end of the selection is made the anchor point for future \fBselect to\fR commands. If the selection @@ -365,36 +335,31 @@ include the characters between \fIindex\fR and the most recent selection anchor point, inclusive. Returns an empty string. .TP \fIpathName \fBselection clear\fR -. Clear the selection if it is currently in this widget. If the selection is not in this widget then the command has no effect. Returns an empty string. .TP \fIpathName \fBselection from \fIindex\fR -. Set the selection anchor point to just before the character given by \fIindex\fR. Does not change the selection. Returns an empty string. .TP \fIpathName \fBselection present\fR -. Returns 1 if there is are characters selected in the entry, 0 if nothing is selected. .TP -\fIpathName \fBselection range \fIstart end\fR -. +\fIpathName \fBselection range \fIstart\fR \fIend\fR Sets the selection to include the characters starting with the one indexed by \fIstart\fR and ending with the one just before \fIend\fR. If \fIend\fR refers to the same character as \fIstart\fR or an earlier one, then the entry's selection is cleared. .TP \fIpathName \fBselection to \fIindex\fR -. If \fIindex\fR is before the anchor point, set the selection to the characters from \fIindex\fR up to but not including the anchor point. If \fIindex\fR is the same as the anchor point, do nothing. If \fIindex\fR is after the anchor point, set the selection @@ -404,51 +369,43 @@ or \fBselect adjust\fR command in this widget. If the selection is not in this widget then a new selection is created using the most recent anchor point specified for the widget. Returns an empty string. .RE -.\" METHOD: validate .TP \fIpathName \fBvalidate\fR -. This command is used to force an evaluation of the \fB\-validatecommand\fR independent of the conditions specified by the \fB\-validate\fR option. This is done by temporarily setting the \fB\-validate\fR option to \fBall\fR. It returns 0 or 1. -.\" METHOD: xview .TP \fIpathName \fBxview \fIargs\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: .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 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 entry's 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. These are the same values passed to scrollbars via the \fB\-xscrollcommand\fR option. .TP -\fIpathName \fBxview\fI index\fR -. +\fIpathName \fBxview\fR \fIindex\fR Adjusts the view in the window so that the character given by \fIindex\fR is displayed at the left edge of the window. .TP \fIpathName \fBxview moveto\fI fraction\fR -. Adjusts the view in the window so that the character \fIfraction\fR of the way through the text appears at the left edge of the window. \fIFraction\fR must be 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. \fINumber\fR must be an integer or a float, but if it is a float then it is converted to an integer, rounded away from 0. \fIWhat\fR must be either \fBpages\fR or \fBunits\fR or an abbreviation Index: doc/event.n ================================================================== --- doc/event.n +++ doc/event.n @@ -18,27 +18,23 @@ .PP The \fBevent\fR command provides several facilities for dealing with window system events, such as defining virtual events and synthesizing events. The command has several different forms, determined by the first argument. The following forms are currently supported: -.\" METHOD: add .TP \fBevent add <<\fIvirtual\fB>>\fI sequence \fR?\fIsequence ...\fR? -. Associates the virtual event \fIvirtual\fR with the physical event sequence(s) given by the \fIsequence\fR arguments, so that the virtual event will trigger whenever any one of the \fIsequence\fRs occurs. \fIVirtual\fR may be any string value and \fIsequence\fR may have any of the values allowed for the \fIsequence\fR argument to the \fBbind\fR command. If \fIvirtual\fR is already defined, the new physical event sequences add to the existing sequences for the event. -.\" METHOD: delete .TP -\fBevent delete <<\fIvirtual\fB>> \fR?\fIsequence sequence ...\fR? -. +\fBevent delete <<\fIvirtual\fB>> \fR?\fIsequence\fR \fIsequence ...\fR? Deletes each of the \fIsequence\fRs from those associated with the virtual event given by \fIvirtual\fR. \fIVirtual\fR may be any string value and \fIsequence\fR may have any of the values allowed for the \fIsequence\fR argument to the \fBbind\fR command. @@ -45,14 +41,12 @@ Any \fIsequence\fRs not currently associated with \fIvirtual\fR are ignored. If no \fIsequence\fR argument is provided, all physical event sequences are removed for \fIvirtual\fR, so that the virtual event will not trigger anymore. -.\" METHOD: generate .TP \fBevent generate \fIwindow event \fR?\fIoption value option value ...\fR? -. Generates a window event and arranges for it to be processed just as if it had come from the window system. \fIWindow\fR gives the path name of the window for which the event will be generated; it may also be an identifier (such as returned by \fBwinfo id\fR) as long as it is for a window in the current application. @@ -69,14 +63,12 @@ event is processed immediately: all of the handlers for the event will complete before the \fBevent generate\fR command returns. If the \fB\-when\fR option is specified then it determines when the event is processed. Certain events, such as key events, require that the window has focus to receive the event properly. -.\" METHOD: info .TP \fBevent info \fR?\fB<<\fIvirtual\fB>>\fR? -. Returns information about virtual events. If the \fB<<\fIvirtual\fB>>\fR argument is omitted, the return value is a list of all the virtual events that are currently defined. If \fB<<\fIvirtual\fB>>\fR is specified then the return value is a list whose elements are the physical event sequences currently @@ -91,65 +83,51 @@ .PP The following options are supported for the \fBevent generate\fR command. These correspond to the .QW % expansions allowed in binding scripts for the \fBbind\fR command. -.\" OPTION: -above .TP \fB\-above\fI window\fR -. \fIWindow\fR specifies the \fIabove\fR field for the event, either as a window path name or as an integer window id. Valid for \fBConfigure\fR events. Corresponds to the \fB%a\fR substitution for binding scripts. -.\" OPTION: -borderwidth .TP \fB\-borderwidth\fI size\fR -. \fISize\fR must be a screen distance; it specifies the \fIborder_width\fR field for the event. Valid for \fBConfigure\fR events. Corresponds to the \fB%B\fR substitution for binding scripts. -.\" OPTION: -button .TP \fB\-button\fI number\fR -. \fINumber\fR must be an integer; it specifies the \fIdetail\fR field for a \fBButton\fR or \fBButtonRelease\fR event, overriding any button number provided in the base \fIevent\fR argument. Corresponds to the \fB%b\fR substitution for binding scripts. -.\" OPTION: -count .TP \fB\-count\fI number\fR -. \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. -.\" OPTION: -data .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. -.\" OPTION: -delta .TP \fB\-delta\fI number\fR -. \fINumber\fR must be an integer; it specifies the \fIdelta\fR field for the \fBMouseWheel\fR event. The \fIdelta\fR refers to the direction and magnitude the mouse wheel was rotated. Note the value is not a screen distance but are units of motion in the mouse wheel. Typically these values are multiples of 120. For example, 120 should scroll the text widget up 4 lines and \-240 would scroll the text widget down 8 lines. Of course, other widgets may define different behaviors for mouse wheel motion. This field corresponds to the \fB%D\fR substitution for binding scripts. -.\" OPTION: -detail .TP \fB\-detail\fI detail\fR -. \fIDetail\fR specifies the \fIdetail\fR field for the event and must be one of the following: .RS .DS .ta 6c @@ -160,166 +138,130 @@ .DE Valid for \fBEnter\fR, \fBLeave\fR, \fBFocusIn\fR and \fBFocusOut\fR events. Corresponds to the \fB%d\fR substitution for binding scripts. .RE -.\" OPTION: -focus .TP \fB\-focus\fI boolean\fR -. \fIBoolean\fR must be a boolean value; it specifies the \fIfocus\fR field for the event. Valid for \fBEnter\fR and \fBLeave\fR events. Corresponds to the \fB%f\fR substitution for binding scripts. -.\" OPTION: -height .TP \fB\-height\fI size\fR -. \fISize\fR must be a screen distance; it specifies the \fIheight\fR field for the event. Valid for \fBConfigure\fR events. Corresponds to the \fB%h\fR substitution for binding scripts. -.\" OPTION: -keycode .TP \fB\-keycode\fI number\fR -. \fINumber\fR must be an integer; it specifies the \fIkeycode\fR field for the event. Valid for \fBKey\fR and \fBKeyRelease\fR events. Corresponds to the \fB%k\fR substitution for binding scripts. -.\" OPTION: -keysym .TP \fB\-keysym\fI name\fR -. \fIName\fR must be the name of a valid keysym, such as \fBg\fR, \fBspace\fR, or \fBReturn\fR; its corresponding keycode value is used as the \fIkeycode\fR field for event, overriding any detail specified in the base \fIevent\fR argument. Valid for \fBKey\fR and \fBKeyRelease\fR events. Corresponds to the \fB%K\fR substitution for binding scripts. -.\" OPTION: -mode .TP \fB\-mode\fI notify\fR -. \fINotify\fR specifies the \fImode\fR field for the event and must be one of \fBNotifyNormal\fR, \fBNotifyGrab\fR, \fBNotifyUngrab\fR, or \fBNotifyWhileGrabbed\fR. Valid for \fBEnter\fR, \fBLeave\fR, \fBFocusIn\fR, and \fBFocusOut\fR events. Corresponds to the \fB%m\fR substitution for binding scripts. -.\" OPTION: -override .TP \fB\-override\fI boolean\fR -. \fIBoolean\fR must be a boolean value; it specifies the \fIoverride_redirect\fR field for the event. Valid for \fBMap\fR, \fBReparent\fR, and \fBConfigure\fR events. Corresponds to the \fB%o\fR substitution for binding scripts. -.\" OPTION: -place .TP \fB\-place\fI where\fR -. \fIWhere\fR specifies the \fIplace\fR field for the event; it must be either \fBPlaceOnTop\fR or \fBPlaceOnBottom\fR. Valid for \fBCirculate\fR events. Corresponds to the \fB%p\fR substitution for binding scripts. -.\" OPTION: -root .TP \fB\-root\fI window\fR -. \fIWindow\fR must be either a window path name or an integer window identifier; it specifies the \fIroot\fR field for the event. Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR, \fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, and \fBMotion\fR events. Corresponds to the \fB%R\fR substitution for binding scripts. -.\" OPTION: -rootx .TP \fB\-rootx\fI coord\fR -. \fICoord\fR must be a screen distance; it specifies the \fIx_root\fR field for the event. Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR, \fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, and \fBMotion\fR events. Corresponds to the \fB%X\fR substitution for binding scripts. -.\" OPTION: -rooty .TP \fB\-rooty\fI coord\fR -. \fICoord\fR must be a screen distance; it specifies the \fIy_root\fR field for the event. Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR, \fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, and \fBMotion\fR events. Corresponds to the \fB%Y\fR substitution for binding scripts. -.\" OPTION: -sendevent .TP \fB\-sendevent\fI boolean\fR -. \fIBoolean\fR must be a boolean value; it specifies the \fIsend_event\fR field for the event. Valid for all events. Corresponds to the \fB%E\fR substitution for binding scripts. -.\" OPTION: -serial .TP \fB\-serial\fI number\fR -. \fINumber\fR must be an integer; it specifies the \fIserial\fR field for the event. Valid for all events. Corresponds to the \fB%#\fR substitution for binding scripts. -.\" OPTION: -state .TP \fB\-state\fI state\fR -. \fIState\fR specifies the \fIstate\fR field for the event. For \fBKey\fR, \fBKeyRelease\fR, \fBButtons\fR, \fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, and \fBMotion\fR events it must be an integer value. For \fBVisibility\fR events it must be one of \fBVisibilityUnobscured\fR, \fBVisibilityPartiallyObscured\fR, or \fBVisibilityFullyObscured\fR. This option overrides any modifiers such as \fBMeta\fR or \fBControl\fR specified in the base \fIevent\fR. Corresponds to the \fB%s\fR substitution for binding scripts. -.\" OPTION: -subwindow .TP \fB\-subwindow\fI window\fR -. \fIWindow\fR specifies the \fIsubwindow\fR field for the event, either as a path name for a Tk widget or as an integer window identifier. Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR, \fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, and \fBMotion\fR events. Similar to \fB%S\fR substitution for binding scripts. -.\" OPTION: -time .TP \fB\-time\fI integer\fR -. \fIInteger\fR must be an integer value; it specifies the \fItime\fR field -for the event. Additionally, the special value \fBcurrent\fR is allowed; +for the event. Additonally the special value \fBcurrent\fR is allowed, this value will be substituted by the current event time. Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR, \fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, \fBMotion\fR, and \fBProperty\fR events. Corresponds to the \fB%t\fR substitution for binding scripts. -.\" OPTION: -warp .TP \fB\-warp\fI boolean\fR -. \fIboolean\fR must be a boolean value; it specifies whether the screen pointer should be warped as well. Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR, \fBButtonRelease\fR, and \fBMotion\fR events. The pointer will only warp to a window if it is mapped. -.\" OPTION: -width .TP \fB\-width\fI size\fR -. \fISize\fR must be a screen distance; it specifies the \fIwidth\fR field for the event. Valid for \fBConfigure\fR events. Corresponds to the \fB%w\fR substitution for binding scripts. -.\" OPTION: -when .TP \fB\-when\fI when\fR -. \fIWhen\fR determines when the event will be processed; it must have one of the following values: .RS .IP \fBnow\fR 10 Process the event immediately, before the command returns. @@ -334,14 +276,12 @@ Place the event at the front of Tcl's event queue but behind any other events already queued with \fB\-when mark\fR. This option is useful when generating a series of events that should be processed in order but at the front of the queue. .RE -.\" OPTION: -x .TP \fB\-x\fI coord\fR -. \fICoord\fR must be a screen distance; it specifies the \fIx\fR field for the event. Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR, \fBButtonRelease\fR, \fBMotion\fR, \fBEnter\fR, \fBLeave\fR, \fBExpose\fR, \fBConfigure\fR, \fBGravity\fR, and \fBReparent\fR @@ -348,14 +288,12 @@ events. Corresponds to the \fB%x\fR substitution for binding scripts. If \fIWindow\fR is empty the coordinate is relative to the screen, and this option corresponds to the \fB%X\fR substitution for binding scripts. -.\" OPTION: -y .TP \fB\-y\fI coord\fR -. \fICoord\fR must be a screen distance; it specifies the \fIy\fR field for the event. Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR, \fBButtonRelease\fR, \fBMotion\fR, \fBEnter\fR, \fBLeave\fR, \fBExpose\fR, \fBConfigure\fR, \fBGravity\fR, and \fBReparent\fR @@ -372,44 +310,37 @@ .PP Tk defines the following virtual events for the purposes of notification: .TP \fB<>\fR -. This is sent to widget to notify it that the letter it has underlined (as an accelerator indicator) with the \fB\-underline\fR option has been pressed in combination with the Alt key. The usual response to this is to either focus into the widget (or some related widget) or to invoke the widget. .TP \fB<>\fR -. This can be sent to some widgets (e.g. button, listbox, menu) as an alternative to . .TP \fB<>\fR -. This is sent to a listbox when the set of selected item(s) in the listbox is updated. .TP \fB<>\fR -. This is sent to a menu when the currently selected item in the menu changes. It is intended for use with context-sensitive help systems. .TP \fB<>\fR -. This is sent to a text widget when the contents of the widget are changed. .TP \fB<>\fR -. This is sent to a text widget when the selection in the widget is changed. .TP \fB<>\fR -. This is sent to all widgets when the ttk theme changed. The ttk widgets listen to this event and redisplay themselves when it fires. The legacy widgets ignore this event. .TP \fB<>\fR @@ -420,30 +351,26 @@ be sent to all widgets, and the user_data field will indicate the cause of the change. NOTE: all tk and ttk widgets already handle this event internally. .TP \fB<>\fR -. This is sent to a widget when the focus enters the widget because of a user-driven .QW "tab to widget" action. .TP \fB<>\fR -. This is sent to a widget when the focus leaves the widget because of a user-driven .QW "tab to widget" action. .TP \fB<>\fR -. This is sent to a text widget when its undo stack or redo stack becomes empty or unempty. .TP \fB<>\fR -. This is sent to a text widget when its internal data become obsolete, and again when these internal data are back in sync with the widget view. The detail field (%d substitution) is either true (when the widget is in sync) or false (when it is not). .PP @@ -450,19 +377,16 @@ Tk defines the following virtual events for the purposes of unifying bindings across multiple platforms. Users expect them to behave in the following way: .TP \fB<>\fR -. Delete the currently selected widget contents. .TP \fB<>\fR -. Copy the currently selected widget contents to the clipboard. .TP \fB<>\fR -. Move the currently selected widget contents to the clipboard. .TP \fB<>\fR . Move to the end of the line in the current widget while deselecting any @@ -492,16 +416,14 @@ . Move to the next group of items (i.e., visible word) in the current widget while deselecting any selected contents. .TP \fB<>\fR -. Replace the currently selected widget contents with the contents of the clipboard. .TP \fB<>\fR -. Insert the contents of the selection at the mouse location. (This event has meaningful \fB%x\fR and \fB%y\fR substitutions). .TP \fB<>\fR . @@ -517,20 +439,18 @@ . Move to the previous paragraph in the current widget while deselecting any selected contents. .TP \fB<>\fR -. Traverse to the previous window. .TP \fB<>\fR . Move to the previous group of items (i.e., visible word) in the current widget while deselecting any selected contents. .TP \fB<>\fR -. Redo one undone action. .TP \fB<>\fR . Set the range of selected contents to the complete widget. Index: doc/focus.n ================================================================== --- doc/focus.n +++ doc/focus.n @@ -53,47 +53,42 @@ things. .PP The \fBfocus\fR command can take any of the following forms: .TP \fBfocus\fR -. Returns the path name of the focus window on the display containing the application's main window, or an empty string if no window in this application has the focus on that display. Note: it is better to specify the display explicitly using \fB\-displayof\fR (see below) so that the code will work in applications using multiple displays. .TP \fBfocus \fIwindow\fR -. If the application currently has the input focus on \fIwindow\fR's display, this command resets the input focus for \fIwindow\fR's display to \fIwindow\fR and returns an empty string. If the application does not currently have the input focus on \fIwindow\fR's display, \fIwindow\fR will be remembered as the focus for its top-level; the next time the focus arrives at the top-level, Tk will redirect it to \fIwindow\fR. If \fIwindow\fR is an empty string then the command does nothing. .TP -\fBfocus \-displayof \fIwindow\fR -. +\fBfocus \-displayof\fR \fIwindow\fR Returns the name of the focus window on the display containing \fIwindow\fR. If the focus window for \fIwindow\fR's display is not in this application, the return value is an empty string. .TP \fBfocus \-force \fIwindow\fR -. Sets the focus of \fIwindow\fR's display to \fIwindow\fR, even if the application does not currently have the input focus for the display. This command should be used sparingly, if at all. In normal usage, an application should not claim the focus for itself; instead, it should wait for the window manager to give it the focus. If \fIwindow\fR is an empty string then the command does nothing. .TP -\fBfocus \-lastfor \fIwindow\fR -. +\fBfocus \-lastfor\fR \fIwindow\fR Returns the name of the most recent window to have the input focus among all the windows in the same top-level as \fIwindow\fR. If no window in that top-level has ever had the input focus, or if the most recent focus window has been deleted, then the name of the top-level is returned. The return value is the window that @@ -112,25 +107,24 @@ .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: -.PP .CS -button .before -text "Before" -button .middle -text "Middle" -button .after -text "After" -checkbutton .flag -variable traverseToMiddle -takefocus 0 -pack .flag -side left +button .before \-text "Before" +button .middle \-text "Middle" +button .after \-text "After" +checkbutton .flag \-variable traverseToMiddle \-takefocus 0 +pack .flag \-side left pack .before .middle .after bind .before { if {!$traverseToMiddle} { \fBfocus\fR .after break } } -bind .after { +bind .after { if {!$traverseToMiddle} { \fBfocus\fR .before break } } Index: doc/focusNext.n ================================================================== --- doc/focusNext.n +++ doc/focusNext.n @@ -10,15 +10,15 @@ .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME tk_focusNext, tk_focusPrev, tk_focusFollowsMouse \- Utility procedures for managing the input focus. .SH SYNOPSIS -.nf \fBtk_focusNext \fIwindow\fR +.sp \fBtk_focusPrev \fIwindow\fR +.sp \fBtk_focusFollowsMouse\fR -.fi .BE .SH DESCRIPTION .PP \fBtk_focusNext\fR is a utility procedure used for keyboard traversal. It returns the @@ -47,15 +47,14 @@ After this procedure is called, whenever the mouse enters a window Tk will automatically give it the input focus. The \fBfocus\fR command may be used to move the focus to a window other than the one under the mouse, but as soon as the mouse moves into a new window the focus will jump to that window. -.PP -Note that at present there is no built-in support for returning the +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 '\" Local Variables: '\" mode: nroff '\" End: Index: doc/frame.n ================================================================== --- doc/frame.n +++ doc/frame.n @@ -10,11 +10,11 @@ .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME frame \- Create and manipulate 'frame' simple container widgets .SH SYNOPSIS -\fBframe\fI pathName\fR ?\fIoptions\fR? +\fBframe\fR \fIpathName\fR ?\fIoptions\fR? .SO \-borderwidth \-highlightcolor \-pady \-cursor \-highlightthickness \-relief \-highlightbackground \-padx \-takefocus .SE @@ -125,19 +125,17 @@ .PP \fIPathName\fR is the name of the command, which is the same as the frame widget's path name. \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for frame widgets: -.\" METHOD: cget .TP -\fIpathName \fBcget\fI option\fR +\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 \fBframe\fR command. -.\" METHOD: configure .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . Query or modify the configuration options of the widget. If no \fIoption\fR is specified, returns a list describing all of Index: doc/grab.n ================================================================== --- doc/grab.n +++ doc/grab.n @@ -10,14 +10,13 @@ .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME grab \- Confine pointer and keyboard events to a window sub-tree .SH SYNOPSIS -.nf \fBgrab \fR?\fB\-global\fR? \fIwindow\fR +.sp \fBgrab \fIoption \fR?\fIarg \fR...? -.fi .BE .SH DESCRIPTION .PP This command implements simple pointer and keyboard grabs for Tk. Tk's grabs are different than the grabs @@ -82,43 +81,34 @@ grab on a given display at once. .PP The \fBgrab\fR command can take any of the following forms: .TP \fBgrab \fR?\fB\-global\fR? \fIwindow\fR -. Same as \fBgrab set\fR, described below. -.\" METHOD: current .TP \fBgrab current \fR?\fIwindow\fR? -. If \fIwindow\fR is specified, returns the name of the current grab window in this application for \fIwindow\fR's display, or an empty string if there is no such window. If \fIwindow\fR is omitted, the command returns a list whose elements are all of the windows grabbed by this application for all displays, or an empty string if the application has no grabs. -.\" METHOD: release .TP \fBgrab release \fIwindow\fR -. Releases the grab on \fIwindow\fR if there is one, otherwise does nothing. Returns an empty string. -.\" METHOD: set .TP \fBgrab set \fR?\fB\-global\fR? \fIwindow\fR -. Sets a grab on \fIwindow\fR. If \fB\-global\fR is specified then the grab is global, otherwise it is local. If a grab was already in effect for this application on \fIwindow\fR's display then it is automatically released. If there is already a grab on \fIwindow\fR and it has the same global/local form as the requested grab, then the command does nothing. Returns an empty string. -.\" METHOD: status .TP \fBgrab status \fIwindow\fR -. 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 @@ -144,17 +134,17 @@ .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. .CS -pack [button .b1 -text "Click me! #1" -command {destroy .b1}] -pack [button .b2 -text "Click me! #2" -command {destroy .b2}] -pack [button .b3 -text "Click me! #3" -command {destroy .b3}] +pack [button .b1 \-text "Click me! #1" \-command {destroy .b1}] +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 "SEE ALSO" busy(n) .SH KEYWORDS grab, keyboard events, pointer events, window '\" Local Variables: '\" mode: nroff '\" End: Index: doc/grid.n ================================================================== --- doc/grid.n +++ doc/grid.n @@ -26,18 +26,16 @@ If the first argument to \fBgrid\fR is suitable as the first window 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 (see the \fBRELATIVE PLACEMENT\fR section below), then the command is processed in the same way as \fBgrid configure\fR. -.\" METHOD: anchor .TP \fBgrid anchor \fIwindow\fR ?\fIanchor\fR? . The anchor value controls how to place the grid within the container window when no row/column has any weight. See \fBTHE GRID ALGORITHM\fR below for further details. The default \fIanchor\fR is \fInw\fR. -.\" METHOD: bbox .TP \fBgrid bbox \fIwindow\fR ?\fIcolumn row\fR? ?\fIcolumn2 row2\fR? . With no arguments, the bounding box (in pixels) of the grid is returned. @@ -47,11 +45,10 @@ 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. -.\" METHOD: columnconfigure .TP \fBgrid columnconfigure \fIwindow index \fR?\fI\-option value...\fR? . Query or set the column properties of the \fIindex\fR column of the geometry container, \fIwindow\fR. @@ -83,13 +80,12 @@ grid geometry manager requests a size from the containing window. If only an option is specified, with no value, the current value of that option is returned. If only the container window and index is specified, all the current settings are returned in a list of -.QW "\fI\-option value\fR" +.QW "\-option value" pairs. -.\" METHOD: configure .TP \fBgrid configure \fIwindow \fR?\fIwindow ...\fR? ?\fIoptions\fR? . The arguments consist of the names of one or more content windows followed by pairs of arguments that specify how @@ -98,11 +94,10 @@ can be specified instead of a window name to alter the default location of a \fIwindow\fR, as described in the \fBRELATIVE PLACEMENT\fR section, below. The following options are supported: .RS -.\" OPTION: -column .TP \fB\-column \fIn\fR . Insert the window so that it occupies the \fIn\fRth column in the grid. Column numbers start with 0. If this option is not supplied, then the @@ -111,81 +106,72 @@ .QW 0 if it is the first window. For each \fBx\fR that immediately precedes the \fIwindow\fR, the column position is incremented by one. Thus the \fBx\fR represents a blank column for this row in the grid. -.\" OPTION: -columnspan .TP \fB\-columnspan \fIn\fR . Insert the window so that it occupies \fIn\fR columns in the grid. The default is one column, unless the window name is followed by a \fB\-\fR, in which case the columnspan is incremented once for each immediately following \fB\-\fR. -.\" OPTION: -in .TP \fB\-in \fIcontainer\fR . Insert the window(s) in the container window given by \fIcontainer\fR. The default is the first window's parent window. -.\" OPTION: -ipadx .TP \fB\-ipadx \fIamount\fR . The \fIamount\fR specifies how much horizontal internal padding to leave on each side of the content. This is space is added inside the content border. The \fIamount\fR must be a valid screen distance, such as \fB2\fR or \fB.5c\fR. It defaults to 0. -.\" OPTION: -ipady .TP \fB\-ipady \fIamount\fR . The \fIamount\fR specifies how much vertical internal padding to leave on the top and bottom of the content. This space is added inside the content border. The \fIamount\fR defaults to 0. -.\" OPTION: -padx .TP \fB\-padx \fIamount\fR . The \fIamount\fR specifies how much horizontal external padding to leave on each side of the content, in screen units. \fIAmount\fR may be a list of two values to specify padding for left and right separately. The \fIamount\fR defaults to 0. This space is added outside the content border. -.\" OPTION: -pady .TP \fB\-pady \fIamount\fR . The \fIamount\fR specifies how much vertical external padding to leave on the top and bottom of the content, in screen units. \fIAmount\fR may be a list of two values to specify padding for top and bottom separately. The \fIamount\fR defaults to 0. This space is added outside the content border. -.\" OPTION: -row .TP \fB\-row \fIn\fR . Insert the content so that it occupies the \fIn\fRth row in the grid. Row numbers start with 0. If this option is not supplied, then the content is arranged on the same row as the previous content specified on this call to \fBgrid\fR, or the next row after the highest occupied row if this is the first content. -.\" OPTION: -rowspan .TP \fB\-rowspan \fIn\fR . Insert the content so that it occupies \fIn\fR rows in the grid. The default is one row. If the next \fBgrid\fR command contains \fB^\fR characters instead of \fIcontent\fR that line up with the columns of this \fIcontent\fR, then the \fBrowspan\fR of this \fIcontent\fR is extended by one. -.\" OPTION: -sticky .TP \fB\-sticky \fIstyle\fR . If a content's cell is larger than its requested dimensions, this option may be used to position (or stretch) the content within its cell. @@ -205,20 +191,10 @@ .LP If any of the content is already managed by the geometry manager then any unspecified options for them retain their previous values rather than receiving default values. .RE -.\" METHOD: content -.TP -\fBgrid content \fIwindow\fR ?\fI\-option value\fR? -. -If no options are supplied, a list of all of the content in \fIwindow\fR -is returned, most recently managed first. -\fIOption\fR can be either \fB\-row\fR or \fB\-column\fR which -causes only the content in the row (or column) specified by \fIvalue\fR -to be returned. -.\" METHOD: forget .TP \fBgrid forget \fIwindow \fR?\fIwindow ...\fR? . Removes each of the \fIwindow\fRs from grid for its container and unmaps their windows. @@ -227,34 +203,31 @@ window is managed once more by the grid geometry manager, the initial default settings are used. .RS .PP .VS "TIP 518" -If the last content window of the container becomes unmanaged, this will also -send the virtual event \fB<>\fR to the container; the container +If the last content window of the container becomes unmanaged, this will also send +the virtual event \fB<>\fR to the container; the container may choose to resize itself (or otherwise respond) to such a change. .VE "TIP 518" .RE -.\" METHOD: info .TP \fBgrid info \fIwindow\fR . Returns a list whose elements are the current configuration state of the content given by \fIwindow\fR in the same option-value form that might be specified to \fBgrid configure\fR. The first two elements of the list are .QW "\fB\-in \fIcontainer\fR" where \fIcontainer\fR is the windows's container window. -.\" METHOD: location .TP \fBgrid location \fIwindow x y\fR . -Given \fIx\fR and \fIy\fR values in screen units relative to the container -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. -.\" METHOD: propagate +Given \fIx\fR and \fIy\fR values in screen units relative to the container 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. .TP \fBgrid propagate \fIwindow\fR ?\fIboolean\fR? . If \fIboolean\fR has a true boolean value such as \fB1\fR or \fBon\fR then propagation is enabled for \fIwindow\fR, which must be a window @@ -263,15 +236,11 @@ disabled for \fIwindow\fR. In either of these cases an empty string is returned. If \fIboolean\fR is omitted then the command returns \fB0\fR or \fB1\fR to indicate whether propagation is currently enabled for \fIwindow\fR. -.RS -.PP Propagation is enabled by default. -.RE -.\" METHOD: rowconfigure .TP \fBgrid rowconfigure \fIwindow index \fR?\fI\-option value...\fR? . Query or set the row properties of the \fIindex\fR row of the geometry container, \fIwindow\fR. @@ -278,13 +247,13 @@ 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 a list of row indices to which the configuration options will operate on. Indices may be integers, window names or the keyword \fIall\fR. For \fIall\fR -the options apply to all rows currently occupied by content windows. For a -window name, that window must be a content window of this container and the -options apply to all rows currently occupied by the container window. +the options apply to all rows currently occupied by content windows. For +a window name, that window must be a content window of this container and the options +apply to all rows currently occupied by the container window. 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) sets the relative weight for apportioning any extra spaces among @@ -305,11 +274,10 @@ the current value of that option is returned. If only the container window and index is specified, all the current settings are returned in a list of .QW "-option value" pairs. -.\" METHOD: remove .TP \fBgrid remove \fIwindow \fR?\fIwindow ...\fR? . Removes each of the \fIwindow\fRs from grid for its container and unmaps their windows. @@ -318,24 +286,30 @@ so that if the content window is managed once more by the grid geometry manager, the previous values are retained. .RS .PP .VS "TIP 518" -If the last content window of the container becomes unmanaged, this will also -send the virtual event \fB<>\fR to the container; the -container may choose to resize itself (or otherwise respond) to such a change. +If the last content window of the container becomes unmanaged, this will also send +the virtual event \fB<>\fR to the container; the container +may choose to resize itself (or otherwise respond) to such a change. .VE "TIP 518" .RE -.\" METHOD: size .TP \fBgrid size \fIcontainer\fR . Returns the size of the grid (in columns then rows) for \fIcontainer\fR. The size is determined either by the \fIcontent\fR occupying the largest row or column, or the largest column or row with a \fB\-minsize\fR, \fB\-weight\fR, or \fB\-pad\fR that is non-zero. -.\" METHOD: slaves +.TP +\fBgrid content \fIwindow\fR ?\fI\-option value\fR? +. +If no options are supplied, a list of all of the content in \fIwindow\fR +is returned, most recently managed first. +\fIOption\fR can be either \fB\-row\fR or \fB\-column\fR which +causes only the content in the row (or column) specified by \fIvalue\fR +to be returned. .TP \fBgrid slaves \fIwindow\fR ?\fI\-option value\fR? . Synonym for \fBgrid content \fIwindow\fR ?\fI\-option value\fR?. .SH "RELATIVE PLACEMENT" @@ -352,19 +326,25 @@ based upon the current layout of the grid, the position of the \fIcontent\fR relative to other \fIcontent\fRs in the same grid command, and the presence of the characters \fB\-\fR, \fBx\fR, and \fB^\fR in \fBgrid\fR command where \fIcontent\fR names are normally expected. .RS -.IP \fB\-\fR +.TP +\fB\-\fR +. This increases the \fB\-columnspan\fR of the \fIcontent\fR to the left. Several -\fB\-\fR's in a row will successively increase the number of columns spanned. -A \fB\-\fR may not follow a \fB^\fR or a \fBx\fR, nor may it be the first -\fIcontent\fR argument to \fBgrid configure\fR. -.IP \fBx\fR +\fB\-\fR's in a row will successively increase the number of columns spanned. A \fB\-\fR +may not follow a \fB^\fR or a \fBx\fR, nor may it be the first \fIcontent\fR +argument to \fBgrid configure\fR. +.TP +\fBx\fR +. This leaves an empty column between the \fIcontent\fR on the left and the \fIcontent\fR on the right. -.IP \fB^\fR +.TP +\fB^\fR +. This extends the \fB\-rowspan\fR of the \fIcontent\fR above the \fB^\fR's in the grid. The number of \fB^\fR's in a row must match the number of columns spanned by the \fIcontent\fR above it. .RE .SH "THE GRID ALGORITHM" @@ -377,12 +357,12 @@ of the container. If the sizes are different, then spaces is added to or taken away from the layout as needed. For the final step, each content is positioned in its row(s) and column(s) based on the setting of its \fIsticky\fR flag. .PP -To compute the minimum size of a layout, the grid geometry manager first looks -at all content whose \fB\-columnspan\fR and \fB\-rowspan\fR values are one, +To compute the minimum size of a layout, the grid geometry manager +first looks at all content whose \fB\-columnspan\fR and \fB\-rowspan\fR values are one, and computes the nominal size of each row or column to be either the \fIminsize\fR for that row or column, or the sum of the \fIpad\fRding plus the size of the largest content, whichever is greater. After that the rows or columns in each uniform group adapt to each other. Then the content whose row-spans or column-spans are greater than one are @@ -459,37 +439,37 @@ A toplevel window containing a text widget and two scrollbars: .PP .CS # Make the widgets toplevel .t -text .t.txt -wrap none -xscroll {.t.h set} -yscroll {.t.v set} -scrollbar .t.v -orient vertical -command {.t.txt yview} -scrollbar .t.h -orient horizontal -command {.t.txt xview} +text .t.txt \-wrap none \-xscroll {.t.h set} \-yscroll {.t.v set} +scrollbar .t.v \-orient vertical \-command {.t.txt yview} +scrollbar .t.h \-orient horizontal \-command {.t.txt xview} # Lay them out -\fBgrid\fR .t.txt .t.v -sticky nsew -\fBgrid\fR .t.h -sticky nsew +\fBgrid\fR .t.txt .t.v \-sticky nsew +\fBgrid\fR .t.h \-sticky nsew # Tell the text widget to take all the extra room -\fBgrid rowconfigure\fR .t .t.txt -weight 1 -\fBgrid columnconfigure\fR .t .t.txt -weight 1 +\fBgrid rowconfigure\fR .t .t.txt \-weight 1 +\fBgrid columnconfigure\fR .t .t.txt \-weight 1 .CE .PP Three widgets of equal width, despite their different .QW natural widths: .PP .CS -button .b -text "Foo" -entry .e -textvariable foo ; set foo "Hello World!" -label .l -text "This is a fairly long piece of text" +button .b \-text "Foo" +entry .e \-textvariable foo ; set foo "Hello World!" +label .l \-text "This is a fairly long piece of text" -\fBgrid\fR .b .e .l -sticky ew -\fBgrid columnconfigure\fR . "all" -uniform allTheSame +\fBgrid\fR .b .e .l \-sticky ew +\fBgrid columnconfigure\fR . "all" \-uniform allTheSame .CE .SH "SEE ALSO" pack(n), place(n) .SH KEYWORDS geometry manager, location, grid, cell, propagation, size, pack '\" Local Variables: '\" mode: nroff '\" End: Index: doc/image.n ================================================================== --- doc/image.n +++ doc/image.n @@ -10,21 +10,19 @@ .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME image \- Create and manipulate images .SH SYNOPSIS -\fBimage\fI option \fR?\fIarg ...\fR? +\fBimage\fR \fIoption \fR?\fIarg ...\fR? .BE .SH DESCRIPTION .PP The \fBimage\fR command is used to create, delete, and query images. It can take several different forms, depending on the \fIoption\fR argument. The legal forms are: -.\" METHOD: create .TP \fBimage create \fItype \fR?\fIname\fR? ?\fIoption value ...\fR? -. Creates a new image and a command with the same name and returns its name. \fItype\fR specifies the type of the image, which must be one of the types currently defined (e.g., \fBbitmap\fR). \fIname\fR specifies the name for the image; if it is omitted then Tk picks a name of the form \fBimage\fIx\fR, where \fIx\fR is @@ -38,14 +36,12 @@ with the new contents. It is important to note that the image command will silently overwrite any procedure that may currently be defined by the given name, so choose the name wisely. It is recommended to use a separate namespace for image names (e.g., \fB::img::logo\fR, \fB::img::large\fR). -.\" METHOD: delete .TP \fBimage delete \fR?\fIname name\fR ...? -. Deletes each of the named images and returns an empty string. If there are instances of the images displayed in widgets, the images will not actually be deleted until all of the instances are released. However, the association between the instances and the image @@ -52,44 +48,32 @@ manager will be dropped. Existing instances will retain their sizes but redisplay as empty areas. If a deleted image is recreated with another call to \fBimage create\fR, the existing instances will use the new image. -.\" METHOD: height .TP \fBimage height \fIname\fR -. Returns a decimal string giving the height of image \fIname\fR in pixels. -.\" METHOD: inuse .TP \fBimage inuse \fIname\fR -. Returns a boolean value indicating whether or not the image given by \fIname\fR is in use by any widgets. -.\" METHOD: names .TP \fBimage names\fR -. Returns a list containing the names of all existing images. -.\" METHOD: type .TP \fBimage type \fIname\fR -. Returns the type of image \fIname\fR (the value of the \fItype\fR argument to \fBimage create\fR when the image was created). -.\" METHOD: types .TP \fBimage types\fR -. Returns a list whose elements are all of the valid image types (i.e., all of the values that may be supplied for the \fItype\fR argument to \fBimage create\fR). -.\" METHOD: width .TP \fBimage width \fIname\fR -. Returns a decimal string giving the width of image \fIname\fR in pixels. .PP Additional operations (e.g. writing the image to a file) may be available as subcommands of the image instance command. See the manual @@ -97,19 +81,22 @@ .SH "BUILT-IN IMAGE TYPES" .PP The following image types are defined by Tk so they will be available in any Tk application. Individual applications or extensions may define additional types. -.IP \fBbitmap\fR +.TP +\fBbitmap\fR Each pixel in the image displays a foreground color, a background color, or nothing. See the \fBbitmap\fR manual entry for more information. -.IP \fBphoto\fR +.TP +\fBphoto\fR 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. -.IP \fBnsimage\fR +.TP +\fBnsimage\fR This type is only available in the Aqua platform. It is a full-color image which may be created from a named system image. It has options designed to facilitate the use of these images in buttons. An \fBnsimage\fR can be based on an a \fItemplate image\fR, which is an anti-aliased 2-color image format that automatically interchanges Index: doc/keysyms.n ================================================================== --- doc/keysyms.n +++ doc/keysyms.n @@ -571,11 +571,11 @@ Greek_ZETA 1990 0x7C6 Greek_ETA 1991 0x7C7 Greek_THETA 1992 0x7C8 Greek_IOTA 1993 0x7C9 Greek_KAPPA 1994 0x7CA -Greek_LAMBDA 1995 0x7CB +Greek_LAMDA 1995 0x7CB Greek_MU 1996 0x7CC Greek_NU 1997 0x7CD Greek_XI 1998 0x7CE Greek_OMICRON 1999 0x7CF Greek_PI 2000 0x7D0 @@ -595,11 +595,11 @@ Greek_zeta 2022 0x7E6 Greek_eta 2023 0x7E7 Greek_theta 2024 0x7E8 Greek_iota 2025 0x7E9 Greek_kappa 2026 0x7EA -Greek_lambda 2027 0x7EB +Greek_lamda 2027 0x7EB Greek_mu 2028 0x7EC Greek_nu 2029 0x7ED Greek_xi 2030 0x7EE Greek_omicron 2031 0x7EF Greek_pi 2032 0x7F0 @@ -1154,11 +1154,11 @@ Sys_Req 65301 0xFF15 Escape 65307 0xFF1B Multi_key 65312 0xFF20 Kanji 65313 0xFF21 Muhenkan 65314 0xFF22 -Henkan 65315 0xFF23 +Henkan_Mode 65315 0xFF23 Romaji 65316 0xFF24 Hiragana 65317 0xFF25 Katakana 65318 0xFF26 Hiragana_Katakana 65319 0xFF27 Zenkaku 65320 0xFF28 Index: doc/label.n ================================================================== --- doc/label.n +++ doc/label.n @@ -10,11 +10,11 @@ .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME label \- Create and manipulate 'label' non-interactive text or image widgets .SH SYNOPSIS -\fBlabel\fI pathName \fR?\fIoptions\fR? +\fBlabel\fR \fIpathName \fR?\fIoptions\fR? .SO \-activebackground \-disabledforeground \-padx \-activeforeground \-font \-pady \-anchor \-foreground \-relief \-background \-highlightbackground \-takefocus @@ -78,22 +78,18 @@ \fIpathName option \fR?\fIarg ...\fR? .CE \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for label widgets: -.\" METHOD: cget .TP -\fIpathName \fBcget\fI option\fR -. +\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 \fBlabel\fR command. -.\" METHOD: configure .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue 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 @@ -110,25 +106,25 @@ 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 -\fBlabel\fR .b -text "This widget is at the bottom" -bg green -\fBlabel\fR .l -text "Left\enHand\enSide" -\fBlabel\fR .r -text "Right\enHand\enSide" +\fBlabel\fR .t \-text "This widget is at the top" \-bg red +\fBlabel\fR .b \-text "This widget is at the bottom" \-bg green +\fBlabel\fR .l \-text "Left\enHand\enSide" +\fBlabel\fR .r \-text "Right\enHand\enSide" text .mid \&.mid insert end "This layout is like Java's BorderLayout" # Lay them out -pack .t -side top -fill x -pack .b -side bottom -fill x -pack .l -side left -fill y -pack .r -side right -fill y -pack .mid -expand 1 -fill both +pack .t \-side top \-fill x +pack .b \-side bottom \-fill x +pack .l \-side left \-fill y +pack .r \-side right \-fill y +pack .mid \-expand 1 \-fill both .CE .SH "SEE ALSO" labelframe(n), button(n), ttk::label(n) .SH KEYWORDS label, widget '\" Local Variables: '\" mode: nroff '\" End: Index: doc/labelframe.n ================================================================== --- doc/labelframe.n +++ doc/labelframe.n @@ -10,11 +10,11 @@ .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME labelframe \- Create and manipulate 'labelframe' labelled container widgets .SH SYNOPSIS -\fBlabelframe\fI pathName\fR ?\fIoptions\fR? +\fBlabelframe\fR \fIpathName\fR ?\fIoptions\fR? .SO \-borderwidth \-highlightbackground \-pady \-cursor \-highlightcolor \-relief \-font \-highlightthickness \-takefocus \-foreground \-padx \-text @@ -99,22 +99,18 @@ .CE \fIPathName\fR is the name of the command, which is the same as the labelframe widget's path name. \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for frame widgets: -.\" METHOD: cget .TP -\fIpathName \fBcget\fI option\fR -. +\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 \fBlabelframe\fR command. -.\" METHOD: configure .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue 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 @@ -134,14 +130,14 @@ 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. .PP .CS -grid [\fBlabelframe\fR .burger -text "Burger"] \e - [\fBlabelframe\fR .bun -text "Bun"] -sticky news -grid [\fBlabelframe\fR .cheese -text "Cheese Option"] \e - [\fBlabelframe\fR .pickle -text "Pickle Option"] -sticky news +grid [\fBlabelframe\fR .burger \-text "Burger"] \e + [\fBlabelframe\fR .bun \-text "Bun"] \-sticky news +grid [\fBlabelframe\fR .cheese \-text "Cheese Option"] \e + [\fBlabelframe\fR .pickle \-text "Pickle Option"] \-sticky news foreach {type name val} { burger Beef beef burger Lamb lamb burger Vegetarian beans @@ -159,13 +155,13 @@ pickle None none pickle Gherkins gherkins pickle Onions onion pickle Chili chili } { - set w [radiobutton .$type.$val -text $name -anchor w \e - -variable $type -value $val] - pack $w -side top -fill x + set w [radiobutton .$type.$val \-text $name \-anchor w \e + \-variable $type \-value $val] + pack $w \-side top \-fill x } set burger beef set bun white set cheese none set pickle none Index: doc/listbox.n ================================================================== --- doc/listbox.n +++ doc/listbox.n @@ -10,11 +10,11 @@ .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME listbox \- Create and manipulate 'listbox' item list widgets .SH SYNOPSIS -\fBlistbox\fI pathName \fR?\fIoptions\fR? +\fBlistbox\fR \fIpathName \fR?\fIoptions\fR? .SO \-background \-borderwidth \-cursor \-disabledforeground \-exportselection \-font \-foreground \-highlightbackground \-highlightcolor \-highlightthickness \-justify \-relief @@ -93,32 +93,41 @@ .PP Many of the widget commands for listboxes take one or more indices as arguments. An index specifies a particular element of the listbox, in any of the following ways: -.IP \fInumber\fR 12 +.TP 12 +\fInumber\fR +. Specifies the element as a numerical index, where 0 corresponds to the first element in the listbox. -.IP \fBactive\fR 12 +.TP 12 +\fBactive\fR +. Indicates the element that has the location cursor. This element will be displayed as specified by \fB\-activestyle\fR when the listbox has the keyboard focus, and it is specified with the \fBactivate\fR widget command. -.IP \fBanchor\fR 12 +.TP 12 +\fBanchor\fR +. Indicates the anchor point for the selection, which is set with the \fBselection anchor\fR widget command. -.IP \fBend\fR 12 +.TP 12 +\fBend\fR +. Indicates the end of the listbox. For most commands this refers to the last element in the listbox, but for a few commands such as \fBindex\fR and \fBinsert\fR it refers to the element just after the last one. -.IP \fB@\fIx\fB,\fIy\fR 12 +.TP 12 +\fB@\fIx\fB,\fIy\fR Indicates the element that covers the point in the listbox window specified by \fIx\fR and \fIy\fR (in pixel coordinates). If no element covers that point, then the closest element to that point is used. -.PP +.LP Indexes support the same simple interpretation as for the command \fBstring index\fR, with simple integer index arithmetic and indexing relative to \fBend\fR. In the widget command descriptions below, arguments named \fIindex\fR, \fIfirst\fR, and \fIlast\fR always contain text indices in one of @@ -133,23 +142,21 @@ \fIpathName option \fR?\fIarg ...\fR? .CE \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for listbox widgets: -.\" METHOD: activate .TP -\fIpathName \fBactivate\fI index\fR +\fIpathName \fBactivate\fR \fIindex\fR . Sets the active element to the one indicated by \fIindex\fR. If \fIindex\fR is outside the range of elements in the listbox then the closest element is activated. The active element is drawn as specified by \fB\-activestyle\fR when the widget has the input focus, and its index may be retrieved with the index \fBactive\fR. -.\" METHOD: bbox .TP -\fIpathName \fBbbox\fI index\fR +\fIpathName \fBbbox\fR \fIindex\fR . Returns a list of four numbers describing the bounding box of the text in the element given by \fIindex\fR. The first two elements of the list give the x and y coordinates of the upper-left corner of the screen area covered by the text @@ -159,19 +166,17 @@ screen, or if \fIindex\fR refers to a non-existent element, then the result is an empty string; if the element is partially visible, the result gives the full area of the element, including any parts that are not visible. -.\" METHOD: cget .TP -\fIpathName \fBcget\fI option\fR +\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 \fBlistbox\fR command. -.\" METHOD: configure .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . Query or modify the configuration options of the widget. If no \fIoption\fR is specified, returns a list describing all of @@ -183,27 +188,24 @@ 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 \fBlistbox\fR command. -.\" METHOD: curselection .TP \fIpathName \fBcurselection\fR . Returns a list containing the numerical indices of all of the elements in the listbox that are currently selected. If there are no elements selected in the listbox then an empty string is returned. -.\" METHOD: delete .TP \fIpathName \fBdelete \fIfirst \fR?\fIlast\fR? . Deletes one or more elements of the listbox. \fIFirst\fR and \fIlast\fR are indices specifying the first and last elements in the range to delete. If \fIlast\fR is not specified it defaults to \fIfirst\fR, i.e. a single element is deleted. -.\" METHOD: get .TP \fIpathName \fBget \fIfirst\fR ?\fIlast\fR? . If \fIlast\fR is omitted, returns the contents of the listbox element indicated by \fIfirst\fR, @@ -211,33 +213,29 @@ If \fIlast\fR is specified, the command returns a list whose elements are all of the listbox elements between \fIfirst\fR and \fIlast\fR, inclusive. Both \fIfirst\fR and \fIlast\fR may have any of the standard forms for indices. -.\" METHOD: index .TP \fIpathName \fBindex \fIindex\fR . Returns the integer index value that corresponds to \fIindex\fR. If \fIindex\fR is \fBend\fR the return value is a count of the number of elements in the listbox (not the index of the last element). -.\" METHOD: insert .TP \fIpathName \fBinsert \fIindex \fR?\fIelement element ...\fR? . Inserts zero or more new elements in the list just before the element given by \fIindex\fR. If \fIindex\fR is specified as \fBend\fR then the new elements are added to the end of the list. Returns an empty string. -.\" METHOD: itemcget .TP \fIpathName \fBitemcget \fIindex option\fR . Returns the current value of the item configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBitemconfigure\fR command. -.\" METHOD: itemconfigure .TP \fIpathName \fBitemconfigure \fIindex\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR? . Query or modify the configuration options of an item in the listbox. If no \fIoption\fR is specified, returns a list describing all of @@ -249,46 +247,40 @@ 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. The following options are currently supported for items: .RS -.\" OPTION: -background .TP \fB\-background \fIcolor\fR . \fIColor\fR specifies the background color to use when displaying the item. It may have any of the forms accepted by \fBTk_GetColor\fR. -.\" OPTION: -foreground .TP \fB\-foreground \fIcolor\fR . \fIColor\fR specifies the foreground color to use when displaying the item. It may have any of the forms accepted by \fBTk_GetColor\fR. -.\" OPTION: -selectbackground .TP \fB\-selectbackground \fIcolor\fR . \fIcolor\fR specifies the background color to use when displaying the item while it is selected. It may have any of the forms accepted by \fBTk_GetColor\fR. -.\" OPTION: -selectforeground .TP \fB\-selectforeground \fIcolor\fR . \fIcolor\fR specifies the foreground color to use when displaying the item while it is selected. It may have any of the forms accepted by \fBTk_GetColor\fR. .RE -.\" METHOD: nearest .TP \fIpathName \fBnearest \fIy\fR . Given a y-coordinate within the listbox window, this command returns the index of the (visible) listbox element nearest to that y-coordinate. -.\" METHOD: scan .TP -\fIpathName \fBscan\fI option args\fR +\fIpathName \fBscan\fR \fIoption args\fR . This command is used to implement scanning on listboxes. It has two forms, depending on \fIoption\fR: .RS .TP @@ -308,21 +300,19 @@ difference in coordinates. This command is typically associated with mouse motion events in the widget, to produce the effect of dragging the list at high speed through the window. The return value is an empty string. .RE -.\" METHOD: see .TP \fIpathName \fBsee \fIindex\fR . Adjust the view in the listbox so that the element given by \fIindex\fR is visible. If the element is already visible then the command has no effect; if the element is near one edge of the window then the listbox scrolls to bring the element into view at the edge; otherwise the listbox scrolls to center the element. -.\" METHOD: selection .TP \fIpathName \fBselection \fIoption arg\fR . This command is used to adjust the selection within a listbox. It has several forms, depending on \fIoption\fR: @@ -354,17 +344,15 @@ . Selects all of the elements in the range between \fIfirst\fR and \fIlast\fR, inclusive, without affecting the selection state of elements outside that range. .RE -.\" METHOD: size .TP \fIpathName \fBsize\fR . Returns a decimal string indicating the total number of elements in the listbox. -.\" METHOD: xview .TP \fIpathName \fBxview \fR?\fIargs\fR . This command is used to query and change the horizontal position of the information in the widget's window. It can take any of the following @@ -409,21 +397,19 @@ become visible. If \fIwhat\fR is \fBunits\fR, the view adjusts left or right by \fInumber\fR character units (the width of the \fB0\fR character) on the display. .RE -.\" METHOD: yview .TP \fIpathName \fByview \fR?\fIargs\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: .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 listbox element at the top of the window, relative to the listbox as a whole (0.5 means it is halfway through the listbox, for example). Index: doc/loadTk.n ================================================================== --- doc/loadTk.n +++ doc/loadTk.n @@ -9,11 +9,11 @@ .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME safe::loadTk \- Load Tk into a safe interpreter. .SH SYNOPSIS -\fBsafe::loadTk \fIchild\fR ?\fB\-use\fI windowId\fR? ?\fB\-display\fI displayName\fR? +\fBsafe::loadTk \fIchild\fR ?\fB\-use\fR \fIwindowId\fR? ?\fB\-display\fR \fIdisplayName\fR? .BE .SH DESCRIPTION .PP Safe Tk is based on Safe Tcl, which provides a mechanism that allows restricted and mediated access to auto-loading and packages for safe @@ -30,11 +30,11 @@ window of the safe interpreter; it can be any valid id, eventually referencing a window belonging to another application. As a convenience, if the window you plan to use is a Tk Window of the application you can use the window name (e.g., .QW \fB.x.y\fR ) -instead of its window Id (e.g., from \fBwinfo id\fI .x.y\fR). +instead of its window Id (e.g., from \fBwinfo id\fR \fB.x.y\fR). When \fB\-use\fR is not specified, a new toplevel window is created for the .QW . window of 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. @@ -49,11 +49,11 @@ .PP Tk initialization is now safe with respect to not trusting the child's state for startup. \fBsafe::loadTk\fR registers the child's name so when the Tk initialization (\fBTk_SafeInit\fR) is called and in turn calls the parent's \fBsafe::InitTk\fR it will return the desired \fBargv\fR equivalent -(\fB\-use\fI windowId\fR, correct \fB\-display\fR, etc.) +(\fB\-use\fR \fIwindowId\fR, correct \fB\-display\fR, etc.) .PP When \fB\-use\fR is not used, the new toplevel created is specially decorated so the user is always aware that the user interface presented comes from a potentially unsafe code and can easily delete the corresponding interpreter. .PP Index: doc/menu.n ================================================================== --- doc/menu.n +++ doc/menu.n @@ -283,11 +283,12 @@ system menu. .PP When Tk sees a Help menu on X Windows and Motif menu compatibility is enabled the menu is moved to be last in the menubar and is right justified. Motif menu compatibility is enabled by setting the Tk option -\fB*Menu.useMotifHelp\fR to true. +\fB*Menu.useMotifHelp\fR to true or by calling +\fBtk::classic::restore menu\fR. .SH "CLONES" .PP When a menu is set as a menubar for a toplevel window, or when a menu is torn off, a clone of the menu is made. This clone is a menu widget in its own right, but it is a child of the original. Changes in the @@ -327,10 +328,15 @@ .QW "no entry at all" ; this is used most commonly with the \fBactivate\fR option to deactivate all the entries in the menu. In most cases the specification of \fB{}\fR causes nothing to happen in the widget command. +.TP 12 +\fBnone\fR +. +Same as \fB{}\fR +This form is deprecated and may not be abbreviated. .IP \fB@\fIx\fB,\fIy\fR 12 Indicates the entry that covers the point in the menu's window specified by \fIx\fR and \fIy\fR (in pixel coordinates). If no entry covers that point, then this form is equivalent to \fB{}\fR. If only a single number is specified, it is treated as the y-coordinate. @@ -360,11 +366,11 @@ \fIpathName \fBactivate \fIindex\fR . Change the state of the entry indicated by \fIindex\fR to \fBactive\fR and redisplay it using its active colors. Any previously-active entry is deactivated. If \fIindex\fR -is specified as \fB{}\fR, or if the specified entry is +is specified as \fB{}\fR or \fBnone\fR, or if the specified entry is disabled, then the menu ends up with no active entry. Returns an empty string. .\" METHOD: add .TP \fIpathName \fBadd \fItype \fR?\fIid\fR? ?\fIoption value option value ...\fR? @@ -456,11 +462,11 @@ .\" METHOD: index .TP \fIpathName \fBindex \fIindex\fR . Returns the numerical index corresponding to \fIindex\fR, or -\fB{}\fR if \fIindex\fR was specified as \fB{}\fR. +\fB{}\fR if \fIindex\fR was specified as \fB{}\fR or \fBnone\fR. .\" METHOD: insert .TP \fIpathName \fBinsert \fIindex type \fR?\fIid\fR? ?\fIoption value option value ...\fR? . Same as the \fBadd\fR widget command except that it inserts the new @@ -557,10 +563,11 @@ . Specifies a foreground color to use for displaying this entry when it is active. This option is ignored on Aqua/macOS. If this option is specified as an empty string (the default), then the \fB\-activeforeground\fR option for the overall menu is used. +This option is not available for separator or tear-off entries. .\" OPTION: -accelerator .TP \fB\-accelerator \fIvalue\fR . Specifies a string to display at the right side of the menu entry. Index: doc/message.n ================================================================== --- doc/message.n +++ doc/message.n @@ -10,11 +10,11 @@ .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME message \- Create and manipulate 'message' non-interactive text widgets .SH SYNOPSIS -\fBmessage\fI pathName \fR?\fIoptions\fR? +\fBmessage\fR \fIpathName \fR?\fIoptions\fR? .SO \-anchor \-background \-borderwidth \-cursor \-font \-foreground \-highlightbackground \-highlightcolor \-highlightthickness \-padx \-pady \-relief @@ -109,19 +109,17 @@ \fIpathName option \fR?\fIarg ...\fR? .CE \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for message widgets: -.\" METHOD: cget .TP \fIpathName \fBcget \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 \fBmessage\fR command. -.\" METHOD: configure .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . Query or modify the configuration options of the widget. If no \fIoption\fR is specified, returns a list describing all of Index: doc/messageBox.n ================================================================== --- doc/messageBox.n +++ doc/messageBox.n @@ -21,96 +21,99 @@ 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: -.\" OPTION: -command .TP -\fB\-command\fI string\fR -. +\fB\-command\fR \fIstring\fR Specifies the prefix of a Tcl command to invoke when the user closes the dialog. The actual command consists of \fIstring\fR followed by a space and the name of the button clicked by the user to close the dialog. This is only available on macOS. -.\" OPTION: -default .TP -\fB\-default\fI name\fR +\fB\-default\fR \fIname\fR . \fIName\fR gives the symbolic name of the default button for this message window ( .QW ok , .QW cancel , 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. -.\" OPTION: -detail .TP -\fB\-detail\fI string\fR +\fB\-detail\fR \fIstring\fR . Specifies an auxiliary message to the main message given by the \fB\-message\fR option. The message detail will be presented beneath the main message and, where supported by the OS, in a less emphasized font than the main message. -.\" OPTION: -icon .TP -\fB\-icon\fI iconImage\fR +\fB\-icon\fR \fIiconImage\fR . Specifies an icon to display. \fIIconImage\fR must be one of the following: \fBerror\fR, \fBinfo\fR, \fBquestion\fR or \fBwarning\fR. If this option is not specified, then the info icon will be displayed. -.\" OPTION: -message .TP -\fB\-message\fI string\fR +\fB\-message\fR \fIstring\fR . Specifies the message to display in this message box. The default value is an empty string. -.\" OPTION: -parent .TP -\fB\-parent\fI window\fR +\fB\-parent\fR \fIwindow\fR . Makes \fIwindow\fR the logical parent of the message box. The message box is displayed on top of its parent window. -.\" OPTION: -title .TP -\fB\-title\fI titleString\fR +\fB\-title\fR \fItitleString\fR . Specifies a string to display as the title of the message box. The default value is an empty string. -.\" OPTION: -type .TP -\fB\-type\fI predefinedType\fR +\fB\-type\fR \fIpredefinedType\fR . Arranges for a predefined set of buttons to be displayed. The following values are possible for \fIpredefinedType\fR: .RS -.IP \fBabortretryignore\fR 18 +.TP 18 +\fBabortretryignore\fR +. Displays three buttons whose symbolic names are \fBabort\fR, \fBretry\fR and \fBignore\fR. -.IP \fBok\fR 18 +.TP 18 +\fBok\fR +. Displays one button whose symbolic name is \fBok\fR. This is the default. -.IP \fBokcancel\fR 18 +.TP 18 +\fBokcancel\fR +. Displays two buttons whose symbolic names are \fBok\fR and \fBcancel\fR. -.IP \fBretrycancel\fR 18 +.TP 18 +\fBretrycancel\fR +. Displays two buttons whose symbolic names are \fBretry\fR and \fBcancel\fR. -.IP \fByesno\fR 18 +.TP 18 +\fByesno\fR +. Displays two buttons whose symbolic names are \fByes\fR and \fBno\fR. -.IP \fByesnocancel\fR 18 +.TP 18 +\fByesnocancel\fR +. Displays three buttons whose symbolic names are \fByes\fR, \fBno\fR and \fBcancel\fR. .RE .PP .SH EXAMPLE .PP .CS -set answer [\fBtk_messageBox\fR -message "Really quit?" \e - -icon question -type yesno \e - -detail "Select \e"Yes\e" to make the application exit"] -switch -- $answer { +set answer [\fBtk_messageBox\fR \-message "Really quit?" \e + \-icon question \-type yesno \e + \-detail "Select \e"Yes\e" to make the application exit"] +switch \-\- $answer { yes exit - no {\fBtk_messageBox\fR -message "I know you like this application!" \e - -type ok} + no {\fBtk_messageBox\fR \-message "I know you like this application!" \e + \-type ok} } .CE .SH KEYWORDS message box '\" Local Variables: Index: doc/nsimage.n ================================================================== --- doc/nsimage.n +++ doc/nsimage.n @@ -2,11 +2,11 @@ '\" Copyright (c) 2022 Marc Culler '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -.TH nsimage n 9.0 Tk "Tk Built-In Commands" +.TH nsimage n 8.7 Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME nsimage \- A Tk image type for macOS based on the NSImage class. @@ -24,101 +24,97 @@ creates a new nsimage and a command with the same name and returns its name. .SH OPTIONS .PP Valid \fIoptions\fR are: -.\" OPTION: -source .TP -\fB\-source\fI string\fR +\fB\-source\fR .PP The value of the \fB\-source\fR option is a string describing an NSimage. There are several ways to interpret this string, and the interpretation is determined by the value of the \fB\-as\fR option. This option is required. .PP -.\" OPTION: -as .TP -\fB\-as\fI type\fR +\fB\-as\fR .PP -There are four possible values for the \fB\-as\fR option which specify +There are four possible values for the \fB-as\fR option which specify how the source string should be interpreted. The allowed values and their meanings are: -.RS -.IP \fBname\fR +.IP +\fBname\fR +.IP The source should be interpreted as the name of a named NSImage -provided by the system. -This is the default if the \fB\-as\fR option is not specified. -.IP \fBfile\fR +provided by the system. This is the default if the -as option is not specified. +.IP +\fBfile\fR +.IP The source should be interpreted as a path to an image file in one of the formats understood by the NSImage class. -.IP \fBpath\fR +.IP +\fBpath\fR +.IP The source should be interpreted as a path to an arbitrary file. The type of the file will be examined and the resulting image will be the system icon for files of that type. -.IP \fBfiletype\fR +.IP +\fBfiletype\fR +.IP The source is interpreted as a string identifying a particular file type. It may be a filename extension, an Apple Uniform Type Identifier or a 4-character OSType value as used in the HFS filesystem. -.RE -.\" OPTION: -width .TP -\fB\-width\fI pixels\fR +\fB\-width\fR .PP The value of the \fIwidth\fR option is an integer specifying the width in pixels of the nsimage. If the width is not specified it will be computed from the height so as to preserve the aspect ration. If neither width nor height are specified then the width and height of the underlying NSImage will be used. -.\" OPTION: -height .TP -\fB\-height\fI pixels\fR +\fB\-height\fR .PP The value of the \fIheight\fR option is an integer specifying the height in pixels of the nsimage. If the height is not specified it will be computed from the height so as to preserve the aspect ration. If neither width nor height are specified then the width and height of the underlying NSImage will be used. -.\" OPTION: -radius .TP -\fB\-radius\fI pixels\fR +\fB\-radius\fR .PP The value of the \fIradius\fR option is an integer. If non-zero the image will be clipped to a rounded rectangle with the same width and height as the image, but with circular arcs of the specified radius cutting off the corners of the rectangle. -.\" OPTION: -ring .TP -\fB\-ring\fI pixels\fR +\fB\-ring\fR .PP The value of the \fIring\fR option is an integer. If non-zero then it specifies the thickness of a focus ring which will be drawn around the image using the control accent color specified in the System Preferences. The image is resized to reduce its width and height by twice the thickness of the ring. Note that this may create a small amount of distortion. The aspect ration of a non-square image will change slightly. -.\" OPTION: -alpha .TP -\fB\-alpha\fI float\fR +\fB\-alpha\fR .PP The value of the \fIalpha\fR option should be a floating point number between 0.0 and 1.0. This alpha value will be applied to each pixel of the nsimage, producing a partially transparent image. The default value -is 1.0, which makes the image opaque. -.\" OPTION: -pressed +is 1,0, which makes the image opaque. .TP -\fB\-pressed\fI boolean\fR +\fB\-pressed\fR .PP The \fIpressed\fR option takes a boolean value. If the value is true or 1 then the image will be algorithmically modified to become darker in light mode or lighter in dark mode. The default is false. For an image button, the primary image should use the value false while the pressed image should be the same image but with the \fIpressed\fR option set to true. -.\" OPTION: -template .TP -\fB\-template\fI boolean\fR +\fB\-template\fR .PP The \fItemplate\fR option takes a boolean value. If the value is true or 1 then the image will be marked as being a template image. This means that the system will algorithmically convert the image to a light colored image when in dark mode. For the algorithm to work Index: doc/option.n ================================================================== --- doc/option.n +++ doc/option.n @@ -20,13 +20,12 @@ .fi .BE .SH DESCRIPTION .PP The \fBoption\fR command allows you to add entries to the Tk option -database or to retrieve options from the database. -.\" METHOD: add -The \fBadd\fR form of the command adds a new option to the database. +database or to retrieve options from the database. The \fBadd\fR +form of the command adds a new option to the database. \fIPattern\fR contains the option being specified, and consists of names and/or classes separated by asterisks or dots, in the usual X format (see \fBPATTERN FORMAT\fR). \fIValue\fR contains a text string to associate with \fIpattern\fR; this is the @@ -34,19 +33,17 @@ invocations of the \fBoption get\fR command. If \fIpriority\fR is specified, it indicates the priority level for this option (see below for legal values); it defaults to \fBinteractive\fR. This command always returns an empty string. .PP -.\" METHOD: clear The \fBoption clear\fR command clears the option database. Default options (from the \fBRESOURCE_MANAGER\fR property or the \fB.Xdefaults\fR file) will be reloaded automatically the next time an option is added to the database or removed from it. This command always returns an empty string. .PP -.\" METHOD: get The \fBoption get\fR command returns the value of the option specified for \fIwindow\fR under \fIname\fR and \fIclass\fR. If several entries in the option database match \fIwindow\fR, \fIname\fR, and \fIclass\fR, then the command returns whichever was created with highest @@ -53,11 +50,10 @@ \fIpriority\fR level. If there are several matching entries at the same priority level, then it returns whichever entry was most recently entered into the option database. If there are no matching entries, then the empty string is returned. .PP -.\" METHOD: readfile The \fBreadfile\fR form of the command reads \fIfileName\fR, which should have the standard format for an X resource database such as \fB.Xdefaults\fR, and adds all the options specified in that file to the option database. If \fIpriority\fR is specified, it indicates the priority level at which to enter the @@ -69,20 +65,24 @@ probability will work as well, but this cannot be guaranteed. This cannot be changed, setting the [encoding system] has no effect. .PP The \fIpriority\fR arguments to the \fBoption\fR command are normally specified symbolically using one of the following values: -.IP \fBwidgetDefault\fR3 +.TP +\fBwidgetDefault\fR Level 20. Used for default values hard-coded into widgets. -.IP \fBstartupFile\fR +.TP +\fBstartupFile\fR Level 40. Used for options specified in application-specific startup files. -.IP \fBuserDefault\fR +.TP +\fBuserDefault\fR Level 60. Used for options specified in user-specific defaults files, such as \fB.Xdefaults\fR, resource databases loaded into the X server, or user-specific startup files. -.IP \fBinteractive\fR +.TP +\fBinteractive\fR Level 80. Used for options specified interactively after the application starts running. If \fIpriority\fR is not specified, it defaults to this level. .PP Any of the above keywords may be abbreviated. In addition, priorities Index: doc/options.n ================================================================== --- doc/options.n +++ doc/options.n @@ -58,11 +58,11 @@ .OP \-activeforeground activeForeground Background Specifies foreground color to use when drawing active elements. See above for definition of active elements. .OP \-activerelief activeRelief Relief Specifies the 3-D effect desired for the active item of the widget. -See the \fB\-relief\fR option for details. +See the \fB-relief\fR option for details. .OP \-anchor anchor Anchor Specifies how the information in a widget (e.g. text or a bitmap) is to be displayed in the widget. Must be one of the values \fBn\fR, \fBne\fR, \fBe\fR, \fBse\fR, \fBs\fR, \fBsw\fR, \fBw\fR, \fBnw\fR, or \fBcenter\fR. @@ -290,11 +290,11 @@ and evaluate the resulting string as a Tcl script. The script must return \fB0\fR, \fB1\fR, or an empty string: a \fB0\fR or \fB1\fR value specifies whether the window will receive the input focus, and an empty string results in the default decision described above. -Note that this interpretation of the option is defined entirely by +Note: this interpretation of the option is defined entirely by the Tcl scripts that implement traversal: the widget implementations ignore the option entirely, so you can change its meaning if you redefine the keyboard traversal scripts. .OP \-text text Text Specifies a string to be displayed inside the widget. The way in which Index: doc/pack.n ================================================================== --- doc/pack.n +++ doc/pack.n @@ -21,118 +21,97 @@ packing them in order around the edges of the parent. The \fBpack\fR command can have any of several forms, depending on the \fIoption\fR argument: .TP \fBpack \fIwindow \fR?\fIwindow ...\fR? ?\fIoptions\fR? -. If the first argument to \fBpack\fR is a window name (any value starting with .QW . ), then the command is processed in the same way as \fBpack configure\fR. -.\" METHOD: configure .TP \fBpack configure \fIwindow \fR?\fIwindow ...\fR? ?\fIoptions\fR? -. The arguments consist of the names of one or more content windows followed by pairs of arguments that specify how to manage the content. See \fBTHE PACKER ALGORITHM\fR below for details on how the options are used by the packer. The following options are supported: .RS -.\" OPTION: -after .TP \fB\-after \fIother\fR -. \fIOther\fR must the name of another window. Use its container as the container for the content, and insert the content just after \fIother\fR in the packing order. -.\" OPTION: -anchor .TP \fB\-anchor \fIanchor\fR -. \fIAnchor\fR must be a valid anchor position such as \fBn\fR or \fBsw\fR; it specifies where to position each content in its parcel. Defaults to \fBcenter\fR. -.\" OPTION: -before .TP \fB\-before \fIother\fR -. \fIOther\fR must the name of another window. Use its container as the container for the content, and insert the content just before \fIother\fR in the packing order. -.\" OPTION: -expand .TP \fB\-expand \fIboolean\fR -. Specifies whether the content should be expanded to consume extra space in their container. \fIBoolean\fR may have any proper boolean value, such as \fB1\fR or \fBno\fR. Defaults to 0. -.\" OPTION: -fill .TP \fB\-fill \fIstyle\fR -. If a content's parcel is larger than its requested dimensions, this option may be used to stretch the content. \fIStyle\fR must have one of the following values: .RS -.IP \fBnone\fR +.TP +\fBnone\fR Give the content its requested dimensions plus any internal padding requested with \fB\-ipadx\fR or \fB\-ipady\fR. This is the default. -.IP \fBx\fR +.TP +\fBx\fR Stretch the content horizontally to fill the entire width of its parcel (except leave external padding as specified by \fB\-padx\fR). -.IP \fBy\fR +.TP +\fBy\fR Stretch the content vertically to fill the entire height of its parcel (except leave external padding as specified by \fB\-pady\fR). -.IP \fBboth\fR +.TP +\fBboth\fR Stretch the content both horizontally and vertically. .RE -.\" OPTION: -in .TP \fB\-in \fIcontainer\fR -. Insert the window at the end of the packing order for the container window given by \fIcontainer\fR. -.\" OPTION: -ipadx .TP \fB\-ipadx \fIamount\fR -. \fIAmount\fR specifies how much horizontal internal padding to leave on each side of the content. \fIAmount\fR must be a valid screen distance, such as \fB2\fR or \fB.5c\fR. It defaults to 0. -.\" OPTION: -ipady .TP \fB\-ipady \fIamount\fR -. \fIAmount\fR specifies how much vertical internal padding to leave on each side of the content. \fIAmount\fR defaults to 0. -.\" OPTION: -padx .TP \fB\-padx \fIamount\fR -. \fIAmount\fR specifies how much horizontal external padding to leave on each side of the content. \fIAmount\fR may be a list of two values to specify padding for left and right separately. \fIAmount\fR defaults to 0. -.\" OPTION: -pady .TP \fB\-pady \fIamount\fR -. \fIAmount\fR specifies how much vertical external padding to leave on each side of the content. \fIAmount\fR may be a list of two values to specify padding for top and bottom separately. \fIAmount\fR defaults to 0. -.\" OPTION: -side .TP \fB\-side \fIside\fR -. Specifies which side of the container the content will be packed against. Must be \fBleft\fR, \fBright\fR, \fBtop\fR, or \fBbottom\fR. Defaults to \fBtop\fR. .LP If no \fB\-in\fR, \fB\-after\fR or \fB\-before\fR option is specified @@ -143,47 +122,33 @@ inserted at the specified point. If any of the content are already managed by the geometry manager then any unspecified options for them retain their previous values rather than receiving default values. .RE -.\" METHOD: content -.TP -\fBpack content \fIwindow\fR -. -Returns a list of all of the content windows in the packing order for -\fIwindow\fR. The order of the content windows in the list is the same as -their order in the packing order. -If \fIwindow\fR has no content then an empty string is returned. -.\" METHOD: forget .TP \fBpack forget \fIwindow \fR?\fIwindow ...\fR? -. Removes each of the \fIwindow\fRs from the packing order for its container and unmaps their windows. The content will no longer be managed by the packer. .RS .PP .VS "TIP 518" -If the last content window of the container becomes unmanaged, this will -also send the virtual event \fB<>\fR to the container; the -container may choose to resize itself (or otherwise respond) to such a change. +If the last content window of the container becomes unmanaged, this will also send +the virtual event \fB<>\fR to the container; the container +may choose to resize itself (or otherwise respond) to such a change. .VE "TIP 518" .RE -.\" METHOD: info .TP \fBpack info \fIwindow\fR -. Returns a list whose elements are the current configuration state of the window given by \fIwindow\fR in the same option-value form that might be specified to \fBpack configure\fR. The first two elements of the list are .QW "\fB\-in \fIcontainer\fR" where \fIcontainer\fR is the window's container. -.\" METHOD: propagate .TP \fBpack propagate \fIcontainer\fR ?\fIboolean\fR? -. If \fIboolean\fR has a true boolean value such as \fB1\fR or \fBon\fR then propagation is enabled for \fIcontainer\fR, which must be a window name (see \fBGEOMETRY PROPAGATION\fR below). If \fIboolean\fR has a false boolean value then propagation is disabled for \fIcontainer\fR. @@ -190,11 +155,16 @@ In either of these cases an empty string is returned. If \fIboolean\fR is omitted then the command returns \fB0\fR or \fB1\fR to indicate whether propagation is currently enabled for \fIcontainer\fR. Propagation is enabled by default. -.\" METHOD: slaves +.TP +\fBpack content \fIwindow\fR +Returns a list of all of the content windows in the packing order for \fIwindow\fR. +The order of the content windows in the list is the same as their order in +the packing order. +If \fIwindow\fR has no content then an empty string is returned. .TP \fBpack slaves \fIwindow\fR . Synonym for \fBpack content \fIwindow\fR. .SH "THE PACKER ALGORITHM" @@ -301,25 +271,25 @@ the stacking order of either the container or the content. .SH EXAMPLE .PP .CS # Make the widgets -label .t -text "This widget is at the top" -bg red -label .b -text "This widget is at the bottom" -bg green -label .l -text "Left\enHand\enSide" -label .r -text "Right\enHand\enSide" +label .t \-text "This widget is at the top" \-bg red +label .b \-text "This widget is at the bottom" \-bg green +label .l \-text "Left\enHand\enSide" +label .r \-text "Right\enHand\enSide" text .mid \&.mid insert end "This layout is like Java's BorderLayout" # Lay them out -\fBpack\fR .t -side top -fill x -\fBpack\fR .b -side bottom -fill x -\fBpack\fR .l -side left -fill y -\fBpack\fR .r -side right -fill y -\fBpack\fR .mid -expand 1 -fill both +\fBpack\fR .t \-side top \-fill x +\fBpack\fR .b \-side bottom \-fill x +\fBpack\fR .l \-side left \-fill y +\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 '\" Local Variables: '\" mode: nroff '\" End: Index: doc/palette.n ================================================================== --- doc/palette.n +++ doc/palette.n @@ -9,15 +9,15 @@ .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME tk_setPalette, tk_bisque \- Modify the Tk color palette .SH SYNOPSIS -.nf \fBtk_setPalette \fIbackground\fR +.sp \fBtk_setPalette \fIname value \fR?\fIname value ...\fR? +.sp \fBtk_bisque\fR -.fi .BE .SH DESCRIPTION .PP The \fBtk_setPalette\fR procedure changes the color scheme for Tk. It does this by modifying the colors of existing widgets and by changing Index: doc/panedwindow.n ================================================================== --- doc/panedwindow.n +++ doc/panedwindow.n @@ -10,11 +10,11 @@ .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME panedwindow \- Create and manipulate 'panedwindow' split container widgets .SH SYNOPSIS -\fBpanedwindow\fI pathName \fR?\fIoptions\fR? +\fBpanedwindow\fR \fIpathName \fR?\fIoptions\fR? .SO \-background \-borderwidth \-cursor \-orient \-relief .SE .SH "WIDGET-SPECIFIC OPTIONS" @@ -36,21 +36,21 @@ .QW ghost version of the sash is displayed during the resizing to show where the panes will be resized to when releasing the mouse button. This .QW ghost version of the sash is the proxy. It's rendering can be configured -using the \fB\-proxybackground\fR, \fB\-proxyborderwidth\fR and -\fB\-proxyrelief\fR options. +using the \fB-proxybackground\fR, \fB-proxyborderwidth\fR and +\fB-proxyrelief\fR options. .OP \-proxybackground proxyBackground ProxyBackground Background color to use when drawing the proxy. If an empty string, the -value of the \fB\-background\fR option will be used. +value of the \fB-background\fR option will be used. .OP \-proxyborderwidth proxyBorderWidth ProxyBorderWidth Specifies the borderwidth of the proxy. May be any value accepted by \fBTk_GetPixels\fR. .OP \-proxyrelief proxyRelief ProxyRelief Relief to use when drawing the proxy. May be any of the standard Tk -relief values. If an empty string, the value of the \fB\-sashrelief\fR +relief values. If an empty string, the value of the \fB-sashrelief\fR option will be used. .OP \-sashcursor sashCursor SashCursor Mouse cursor to use when over a sash. If null, \fBsb_h_double_arrow\fR will be used for horizontal panedwindows, and \fBsb_v_double_arrow\fR will be used for vertical panedwindows. @@ -96,27 +96,24 @@ .CE \fIPathName\fR is the name of the command, which is the same as the panedwindow widget's path name. \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for panedwindow widgets: -.\" METHOD: add .TP \fIpathName \fBadd \fIwindow \fR?\fIwindow ...\fR? ?\fIoption value ...\fR? . Add one or more windows to the panedwindow, each in a separate pane. The arguments consist of the names of one or more windows followed by pairs of arguments that specify how to manage the windows. \fIOption\fR may have any of the values accepted by the \fBconfigure\fR subcommand. -.\" METHOD: cget .TP \fIpathName \fBcget \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 \fBpanedwindow\fR command. -.\" METHOD: configure .TP \fIpathName \fBconfigure \fR?\fIoption\fR? ?\fIvalue 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 @@ -127,33 +124,29 @@ 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 \fBpanedwindow\fR command. -.\" METHOD: forget .TP \fIpathName \fBforget \fIwindow \fR?\fIwindow ...\fR? . Remove the pane containing \fIwindow\fR from the panedwindow. All geometry management options for \fIwindow\fR will be forgotten. -.\" METHOD: identify .TP \fIpathName \fBidentify \fIx y\fR . Identify the panedwindow component underneath the point given by \fIx\fR and \fIy\fR, in window coordinates. If the point is over a sash or a sash handle, the result is a two element list containing the index of the sash or handle, and a word indicating whether it is over a sash or a handle, such as {0 sash} or {2 handle}. If the point is over any other part of the panedwindow, the result is an empty list. -.\" METHOD: panecget .TP \fIpathName \fBpanecget \fIwindow option\fR . Query a management option for \fIwindow\fR. \fIOption\fR may be any value allowed by the \fBpaneconfigure\fR subcommand. -.\" METHOD: paneconfigure .TP \fIpathName \fBpaneconfigure \fIwindow \fR?\fIoption\fR? ?\fIvalue option value ...\fR? . Query or modify the management options for \fIwindow\fR. If no \fIoption\fR is specified, returns a list describing all of the @@ -165,63 +158,55 @@ 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. The following options are supported: .RS -.\" OPTION: -after .TP \fB\-after \fIwindow\fR . Insert the window after the window specified. \fIwindow\fR should be the name of a window already managed by \fIpathName\fR. -.\" OPTION: -before .TP \fB\-before \fIwindow\fR . Insert the window before the window specified. \fIwindow\fR should be the name of a window already managed by \fIpathName\fR. -.\" OPTION: -height .TP \fB\-height \fIsize\fR . Specify a height for the window. The height will be the outer dimension of the window including its border, if any. If \fIsize\fR is an empty string, or if \fB\-height\fR is not specified, then the height requested internally by the window will be used initially; the height may later be adjusted by the movement of sashes in the panedwindow. \fISize\fR may be any value accepted by \fBTk_GetPixels\fR. -.\" OPTION: -hide .TP \fB\-hide \fIboolean\fR . 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. -.\" OPTION: -minsize .TP \fB\-minsize \fIn\fR . Specifies that the size of the window cannot be made less than \fIn\fR. This constraint only affects the size of the widget in the paned dimension \(em the x dimension for horizontal panedwindows, the y dimension for vertical panedwindows. May be any value accepted by \fBTk_GetPixels\fR. -.\" OPTION: -padx .TP \fB\-padx \fIn\fR . Specifies a non-negative value indicating how much extra space to leave on each side of the window in the X-direction. The value may have any of the forms accepted by \fBTk_GetPixels\fR. -.\" OPTION: -pady .TP \fB\-pady \fIn\fR . Specifies a non-negative value indicating how much extra space to leave on each side of the window in the Y-direction. The value may have any of the forms accepted by \fBTk_GetPixels\fR. -.\" OPTION: -sticky .TP \fB\-sticky \fIstyle\fR . If a window's pane is larger than the requested dimensions of the window, this option may be used to position (or stretch) the window @@ -232,11 +217,10 @@ will .QW stick to. If both \fBn\fR and \fBs\fR (or \fBe\fR and \fBw\fR) are specified, the window will be stretched to fill the entire height (or width) of its cavity. -.\" OPTION: -stretch .TP \fB\-stretch \fIwhen\fR . Controls how extra space is allocated to each of the panes. \fIWhen\fR is one of \fBalways\fR, \fBfirst\fR, \fBlast\fR, @@ -245,24 +229,33 @@ remaining (or deficit) space will be distributed to those panes marked for stretching. The space will be distributed based on each panes current ratio of the whole. The \fIwhen\fR values have the following definition: .RS -.IP \fBalways\fR +.TP +\fBalways\fR +. This pane will always stretch. -.IP \fBfirst\fR +.TP +\fBfirst\fR +. Only if this pane is the first pane (left-most or top-most) will it stretch. -.IP \fBlast\fR +.TP +\fBlast\fR +. Only if this pane is the last pane (right-most or bottom-most) will it stretch. This is the default value. -.IP \fBmiddle\fR +.TP +\fBmiddle\fR +. Only if this pane is not the first or last pane will it stretch. -.IP \fBnever\fR +.TP +\fBnever\fR +. This pane will never stretch. .RE -.\" OPTION: -width .TP \fB\-width \fIsize\fR . Specify a width for the window. The width will be the outer dimension of the window including its border, if any. If \fIsize\fR @@ -269,16 +262,14 @@ is an empty string, or if \fB\-width\fR is not specified, then the width requested internally by the window will be used initially; the width may later be adjusted by the movement of sashes in the panedwindow. \fISize\fR may be any value accepted by \fBTk_GetPixels\fR. .RE -.\" METHOD: panes .TP \fIpathName \fBpanes\fR . Returns an ordered list of the widgets managed by \fIpathName\fR. -.\" METHOD: proxy .TP \fIpathName \fBproxy \fR?\fIargs\fR? . This command is used to query and change the position of the sash proxy, used for rubberband-style pane resizing. It can take any of @@ -296,14 +287,12 @@ .TP \fIpathName \fBproxy place \fIx y\fR . Place the proxy at the given \fIx\fR and \fIy\fR coordinates. .RE -.\" METHOD: sash .TP \fIpathName \fBsash \fR?\fIargs\fR? -. This command is used to query and change the position of sashes in the panedwindow. It can take any of the following forms: .RS .TP \fIpathName \fBsash coord \fIindex\fR Index: doc/photo.n ================================================================== --- doc/photo.n +++ doc/photo.n @@ -41,26 +41,21 @@ from a file or a string, or it can be supplied from C code through a procedural interface. At present, only .VS 8.6 PNG, .VE 8.6 -GIF, PPM/PGM, -.VS 8.7 -and (read-only) SVG -.VE 8.7 -formats are supported, but an interface exists to +GIF and PPM/PGM formats are supported, but an interface exists to allow additional image file formats to be added easily. A photo image is (semi)transparent if the image data it was obtained from had -transparency information. In regions where no image data has been +transparency informaton. In regions where no image data has been supplied, it is fully transparent. Transparency may also be modified with the \fBtransparency set\fR subcommand. .SH "CREATING PHOTOS" .PP Like all images, photos are created using the \fBimage create\fR command. Photos support the following \fIoptions\fR: -.\" OPTION: -data .TP \fB\-data \fIstring\fR . Specifies the contents of the image as a string. .VS 8.7 @@ -71,27 +66,24 @@ currently guaranteed to be supported for PNG and GIF images). The format of the string must be one of those for which there is an image file format handler that will accept string data. If both the \fB\-data\fR and \fB\-file\fR options are specified, the \fB\-file\fR option takes precedence. -.\" OPTION: -format .TP \fB\-format\fR {\fIformat-name\fR ?\fIoption value ...\fR?} . Specifies the name of the file format for the data specified with the \fB\-data\fR or \fB\-file\fR option and optional arguments passed to -the format handler. Note that the value of this option must be a Tcl list. +the format handler. Note: the value of this option must be a Tcl list. This means that the braces may be omitted if the argument has only one word. Also, instead of braces, double quotes may be used for quoting. -.\" OPTION: -file .TP \fB\-file \fIname\fR . \fIname\fR gives the name of a file that is to be read to supply data for the photo image. The file format must be one of those for which there is an image file format handler that can read data. -.\" OPTION: -gamma .TP \fB\-gamma \fIvalue\fR . Specifies that the colors allocated for displaying this image in a window should be corrected for a non-linear display with the specified @@ -100,30 +92,27 @@ approximation; gamma is the exponent and is typically around 2). The value specified must be greater than zero. The default value is one (no correction). In general, values greater than one will make the image lighter, and values less than one will make it darker. -.\" OPTION: -height .TP \fB\-height \fInumber\fR . Specifies the height of the image, in pixels. This option is useful primarily in situations where the user wishes to build up the contents of the image piece by piece. A value of zero (the default) allows the image to expand or shrink vertically to fit the data stored in it. .VS 8.7 -.\" OPTION: -metadata .TP \fB\-metadata \fImetadata\fR . Set the metadata dictionary of the image. Additional keys may be set within the metadata dictionary of the image, if image data is processed due to a \fB\-file\fR or \fB\-data\fR options and the driver outputs any metadata keys. See section \fBMETADATA DICTIONARY\fR below. .VE 8.7 -.\" OPTION: -palette .TP \fB\-palette \fIpalette-spec\fR . Specifies the resolution of the color cube to be allocated for displaying this image, and thus the number of colors used from the @@ -132,11 +121,10 @@ specifying the number of shades of gray to use, or three decimal numbers separated by slashes (/), specifying the number of shades of red, green and blue to use, respectively. If the first form (a single number) is used, the image will be displayed in monochrome (i.e., grayscale). -.\" OPTION: -width .TP \fB\-width \fInumber\fR . Specifies the width of the image, in pixels. This option is useful primarily in situations where the user wishes to build up the contents @@ -161,27 +149,23 @@ \fB\-width\fR and/or \fB\-height\fR configuration options, in which case the width and/or height, respectively, of the image will not be changed. .PP The following commands are possible for photo images: -.\" METHOD: blank .TP \fIimageName \fBblank\fR . Blank the image; that is, set the entire image to have no data, so it will be displayed as transparent, and the background of whatever -window it is displayed in will show through. The metadata dict of the -image is not changed. -.\" METHOD: cget +window it is displayed in will show through. The metadata dict of the image is not changed. .TP -\fIimageName \fBcget\fI option\fR +\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\fR \fBphoto\fR command. -.\" METHOD: configure .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 @@ -194,25 +178,23 @@ 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\fR \fBphoto\fR command. .VS 8.7 -Note that setting the \fB\-metadata\fR option without any other option +Note: setting the \fB\-metadata\fR option without any other option will not invoke the image format driver to recreate the bitmap. .VE 8.7 -.\" METHOD: copy .TP -\fIimageName \fBcopy\fI sourceImage\fR ?\fIoption value(s) ...\fR? +\fIimageName \fBcopy\fR \fIsourceImage\fR ?\fIoption value(s) ...\fR? . Copies a region from the image called \fIsourceImage\fR (which must be a photo image) to the image called \fIimageName\fR, possibly with pixel zooming and/or subsampling. If no options are specified, this command copies the whole of \fIsourceImage\fR into \fIimageName\fR, starting at coordinates (0,0) in \fIimageName\fR. The following options may be specified: .RS -.\" OPTION: -from .TP \fB\-from \fIx1 y1 x2 y2\fR . Specifies a rectangular sub-region of the source image to be copied. (\fIx1,y1\fR) and (\fIx2,y2\fR) specify diagonally opposite corners of @@ -219,11 +201,10 @@ the rectangle. If \fIx2\fR and \fIy2\fR are not specified, the default value is the bottom-right corner of the source image. The pixels copied will include the left and top edges of the specified rectangle but not the bottom or right edges. If the \fB\-from\fR option is not given, the default is the whole source image. -.\" OPTION: -to .TP \fB\-to \fIx1 y1 x2 y2\fR . Specifies a rectangular sub-region of the destination image to be affected. (\fIx1,y1\fR) and (\fIx2,y2\fR) specify diagonally opposite @@ -230,39 +211,35 @@ corners of the rectangle. If \fIx2\fR and \fIy2\fR are not specified, the default value is (\fIx1,y1\fR) plus the size of the source region (after subsampling and zooming, if specified). If \fIx2\fR and \fIy2\fR are specified, the source region will be replicated if necessary to fill the destination region in a tiled fashion. -.\" OPTION: -shrink .TP \fB\-shrink\fR . Specifies that the size of the destination image should be reduced, if necessary, so that the region being copied into is at the bottom-right corner of the image. This option will not affect the width or height of the image if the user has specified a non-zero value for the \fB\-width\fR or \fB\-height\fR configuration option, respectively. -.\" OPTION: -zoom .TP \fB\-zoom \fIx y\fR . Specifies that the source region should be magnified by a factor of \fIx\fR in the X direction and \fIy\fR in the Y direction. If \fIy\fR is not given, the default value is the same as \fIx\fR. With this option, each pixel in the source image will be expanded into a block of \fIx\fR x \fIy\fR pixels in the destination image, all the same color. \fIx\fR and \fIy\fR must be greater than 0. -.\" OPTION: -subsample .TP \fB\-subsample \fIx y\fR . Specifies that the source image should be reduced in size by using only every \fIx\fRth pixel in the X direction and \fIy\fRth pixel in the Y direction. Negative values will cause the image to be flipped about the Y or X axes, respectively. If \fIy\fR is not given, the default value is the same as \fIx\fR. -.\" OPTION: -compositingrule .TP \fB\-compositingrule \fIrule\fR . Specifies how transparent pixels in the source image are combined with the destination image. When a compositing rule of \fIoverlay\fR is @@ -271,31 +248,28 @@ over the top of the destination. When a compositing rule of \fIset\fR is set, the old contents of the destination image are discarded and the source image is used as-is. The default compositing rule is \fIoverlay\fR. .RE -.\" METHOD: data .TP \fIimageName \fBdata\fR ?\fIoption value(s) ...\fR? . Returns image data in the form of a string. .VS 8.7 The format of the string depends on the format handler. By default, a human readable format as a list of lists of pixel data is used, other -formats can be chosen with the \fB\-format\fR option. +formats can be chosen with the \fB-format\fR option. See \fBIMAGE FORMATS\fR below for details. .VE 8.7 The following options may be specified: .RS -.\" OPTION: -background .TP \fB\-background\fI color\fR . If the color is specified, the data will not contain any transparency information. In all transparent pixels the color will be replaced by the specified color. -.\" OPTION: -format .TP \fB\-format\fR {\fIformat-name\fR ?\fIoption value ...\fR?} . Specifies the name of the image file format handler to use and, optionally, arguments to the format handler. Specifically, this @@ -307,14 +281,13 @@ that consists of a list (one element per row) of lists (one element per pixel/column) of colors in .QW \fB#\fIrrggbb\fR format (see \fBIMAGE FORMATS\fR below). .VE 8.7 -Note that the value of this option must be a Tcl list. +Note: the value of this option must be a Tcl list. This means that the braces may be omitted if the argument has only one word. Also, instead of braces, double quotes may be used for quoting. -.\" OPTION: -from .TP \fB\-from \fIx1 y1 x2 y2\fR . Specifies a rectangular region of \fIimageName\fR to be returned. If only \fIx1\fR and \fIy1\fR are specified, the region @@ -321,42 +294,38 @@ extends from \fI(x1,y1)\fR to the bottom-right corner of \fIimageName\fR. If all four coordinates are given, they specify diagonally opposite corners of the rectangular region, including x1,y1 and excluding x2,y2. The default, if this option is not given, is the whole image. -.\" OPTION: -grayscale .TP \fB\-grayscale\fR . If this options is specified, the data will not contain color information. All pixel data will be transformed into grayscale. .VS 8.7 -.\" OPTION: -metadata .TP -\fB\-metadata\fI metadata\fR +\fB\-metadata\fR \fImetadata\fR . Image format handler may use metadata to be included in the returned data string. The specified \fImetadata\fR is passed to the driver for inclusion in the data. If no \fB\-metadata\fR option is given, the current metadata of the image is used. .VE 8.7 .RE -.\" METHOD: get -.TP -\fIimageName \fBget\fI x y\fR ?\fB\-withalpha\fR? +\fIimageName \fBget\fR \fIx y\fR ?\fB-withalpha\fR? . Returns the color of the pixel at coordinates (\fIx\fR,\fIy\fR) in the image as a list of three integers between 0 and 255, representing the -red, green and blue components respectively. If the \fB\-withalpha\fR +red, green and blue components respectively. If the \fB-withalpha\fR option is specified, the returned list will have a fourth element representing the alpha value of the pixel as an integer between 0 and 255. -.\" METHOD: put +.VE 8.7 .TP -\fIimageName \fBput\fI data\fR ?\fIoption value(s) ...\fR? +\fIimageName \fBput\fR \fIdata\fR ?\fIoption value(s) ...\fR? . Sets pixels in \fI imageName\fR to the data specified in \fIdata\fR. .VS 8.7 This command searches the list of image file format handlers for a handler that can interpret the data in \fIdata\fR, and then reads @@ -363,71 +332,65 @@ the image encoded within into \fIimageName\fR (the destination image). See \fBIMAGE FORMATS\fR below for details on formats for image data. .VE 8.7 The following options may be specified: .RS -.\" OPTION: -format .TP \fB\-format\fR {\fIformat-name\fR ?\fIoption value ..\fR?} . Specifies the format of the image data in \fIdata\fR and, optionally, arguments to be passed to the format handler. Specifically, only image file format handlers whose names begin with \fIformat-name\fR will be used while searching for an image data format handler to read the data. -Note that the value of this option must be a Tcl list. +Note: the value of this option must be a Tcl list. This means that the braces may be omitted if the argument has only one word. Also, instead of braces, double quotes may be used for quoting. .VS 8.7 -.\" OPTION: -metadata .TP -\fB\-metadata\fI metadata\fR +\fB\-metadata\fR \fImetadata\fR . A specified \fImetadata\fR is passed to the image format driver when interpreting the data. -Note that the current metadata of the image is not passed to the format driver +Note: The current metadata of the image is not passed to the format driver and is not changed by the command. .VE 8.7 -.\" OPTION: -to .TP \fB\-to \fIx1 y1\fR ?\fIx2 y2\fR? . Specifies the coordinates of the top-left corner (\fIx1\fR,\fIy1\fR) of the region of \fIimageName\fR into which the image data will be copied. The default position is (0,0). If \fIx2\fR,\fIy2\fR is given and \fIdata\fR is not large enough to cover the rectangle specified by this option, the image data extracted will be tiled so it covers the -entire destination rectangle. If the region specified with this option +entire destination rectangle. If the region specified with this opion is smaller than the supplied \fIdata\fR, the exceeding data is silently discarded. Note that if \fIdata\fR specifies a single color value, then a region extending to the bottom-right corner represented by (\fIx2\fR,\fIy2\fR) will be filled with that color. .RE -.\" METHOD: read .TP -\fIimageName \fBread\fI filename\fR ?\fIoption value(s) ...\fR? +\fIimageName \fBread\fR \fIfilename\fR ?\fIoption value(s) ...\fR? . Reads image data from the file named \fIfilename\fR into the image. This command first searches the list of image file format handlers for a handler that can interpret the data in \fIfilename\fR, and then reads the image in \fIfilename\fR into \fIimageName\fR (the destination image). The following options may be specified: .RS -.\" OPTION: -format .TP \fB\-format {\fIformat-name\fR ?\fIoption value ..\fR?} . Specifies the format of the image data in \fIfilename\fR and, optionally, additional options to the format handler. Specifically, only image file format handlers whose names begin with \fIformat-name\fR will be used while searching for an image data format handler to read the data. -Note that the value of this option must be a Tcl list. +Note: the value of this option must be a Tcl list. This means that the braces may be omitted if the argument has only one word. Also, instead of braces, double quotes may be used for quoting. -.\" OPTION: -from .TP \fB\-from \fIx1 y1 x2 y2\fR . Specifies a rectangular sub-region of the image file data to be copied to the destination image. If only \fIx1\fR and \fIy1\fR are @@ -435,38 +398,34 @@ corner of the image in the image file. If all four coordinates are specified, they specify diagonally opposite corners or the region. The default, if this option is not specified, is the whole of the image in the image file. .VS 8.7 -.\" OPTION: -metadata .TP -\fB\-metadata\fI metadata\fR +\fB\-metadata\fR \fImetadata\fR . A specified \fImetadata\fR is passed to the image format driver when interpreting the data. -Note that the current metadata of the image is not passed to the format driver +Note: The current metadata of the image is not passed to the format driver and is not changed by the command. .VE 8.7 -.\" OPTION: -shrink .TP \fB\-shrink\fR . If this option, the size of \fIimageName\fR will be reduced, if necessary, so that the region into which the image file data are read is at the bottom-right corner of the \fIimageName\fR. This option will not affect the width or height of the image if the user has specified a non-zero value for the \fB\-width\fR or \fB\-height\fR configuration option, respectively. -.\" OPTION: -to .TP \fB\-to \fIx y\fR . Specifies the coordinates of the top-left corner of the region of \fIimageName\fR into which data from \fIfilename\fR are to be read. The default is (0,0). .RE -.\" METHOD: redither .TP \fIimageName \fBredither\fR . The dithering algorithm used in displaying photo images propagates quantization errors from one pixel to its neighbors. @@ -473,50 +432,49 @@ If the image data for \fIimageName\fR is supplied in pieces, the dithered image may not be exactly correct. Normally the difference is not noticeable, but if it is a problem, this command can be used to recalculate the dithered image in each window where the image is displayed. -.\" METHOD: transparency .TP \fIimageName \fBtransparency \fIsubcommand \fR?\fIarg ...\fR? . Allows examination and manipulation of the transparency information in the photo image. Several subcommands are available: .RS -.TP -\fIimageName \fBtransparency get \fIx y\fR ?\fB\-alpha\fR? .VS 8.7 +.TP +\fIimageName \fBtransparency get \fIx y\fR ?\fB-alpha\fR? +. Returns true if the pixel at (\fIx\fR,\fIy\fR) is fully transparent, -false otherwise. If the option \fB\-alpha\fR is passed, returns the +false otherwise. If the option \fB-alpha\fR is passed, returns the alpha value of the pixel instead, as an integer in the range 0 to 255. .VE 8.7 -.TP -\fIimageName \fBtransparency set \fIx y newVal\fR ?\fB\-alpha\fR? + .VS 8.7 +.TP +\fIimageName \fBtransparency set \fIx y\fR \fInewVal\fR ?\fB-alpha\fR? +. Change the transparency of the pixel at (\fIx\fR,\fIy\fR) to \fInewVal.\fR If no additional option is passed, \fInewVal\fR is interpreted as a boolean and the pixel is made fully transparent if -that value is true, fully opaque otherwise. If the \fB\-alpha\fR +that value is true, fully opaque otherwise. If the \fB-alpha\fR option is passed, \fInewVal\fR is interpreted as an integral alpha value for the pixel, which must be in the range 0 to 255. .VE 8.7 .RE -.\" METHOD: write .TP \fIimageName \fBwrite \fIfilename\fR ?\fIoption value(s) ...\fR? . Writes image data from \fIimageName\fR to a file named \fIfilename\fR. The following options may be specified: .RS -.\" OPTION: -background .TP \fB\-background\fI color\fR . If the color is specified, the data will not contain any transparency information. In all transparent pixels the color will be replaced by the specified color. -.\" OPTION: -format .TP \fB\-format\fR {\fIformat-name\fR ?\fIoption value ...\fR?} . Specifies the name of the image file format handler to be used to write the data to the file and, optionally, options to pass to the @@ -524,33 +482,30 @@ handler whose name matches an initial substring of \fIformat-name\fR and which has the capability to write an image file. If this option is not given, the format is guessed from the file extension. If that cannot be determined, this subcommand uses the first handler that has the capability to write an image file. -Note that the value of this option must be a Tcl list. +Note: the value of this option must be a Tcl list. This means that the braces may be omitted if the argument has only one word. Also, instead of braces, double quotes may be used for quoting. -.\" OPTION: -from .TP \fB\-from \fIx1 y1 x2 y2\fR . Specifies a rectangular region of \fIimageName\fR to be written to the image file. If only \fIx1\fR and \fIy1\fR are specified, the region extends from \fI(x1,y1)\fR to the bottom-right corner of \fIimageName\fR. If all four coordinates are given, they specify diagonally opposite corners of the rectangular region. The default, if this option is not given, is the whole image. -.\" OPTION: -grayscale .TP \fB\-grayscale\fR . If this options is specified, the data will not contain color information. All pixel data will be transformed into grayscale. .VS 8.7 -.\" OPTION: -metadata .TP -\fB\-metadata\fI metadata\fR +\fB\-metadata\fR \fBmetadata\fR . Image format handler may use metadata to be included in the written file. The specified \fImetadata\fR is passed to the driver for inclusion in the file. If no \fB\-metadata\fR option is given, the current metadata of the @@ -561,12 +516,12 @@ .PP The photo image code is structured to allow handlers for additional image file formats to be added easily. The photo image code maintains a list of these handlers. Handlers are added to the list by registering them with a call to \fBTk_CreatePhotoImageFormat\fR. The -standard Tk distribution comes with handlers for PPM/PGM, PNG, GIF and -(read-only) SVG formats, +standard Tk distribution comes with handlers for PPM/PGM, PNG and GIF +formats, .VS 8.7 as well as the \fBdefault\fR handler to encode/decode image data in a human readable form. .VE 8.7 These handlers are automatically registered on initialization. @@ -598,11 +553,11 @@ The \fBdefault\fR image handler cannot be used to read or write data from/to a file. Its sole purpose is to encode and decode image data in string form in a clear text, human readable, form. The \fIimageName\fR \fBdata\fR subcommand uses this handler when no other format is specified. When reading image data from a string with \fIimageName\fR -\fBput\fR or the \fB\-data\fR option, the default handler is treated +\fBput\fR or the \fB-data\fR option, the default handler is treated as the other handlers. .PP Image data in the \fBdefault\fR string format is a (top-to-bottom) list of scan-lines, with each scan-line being a (left-to-right) list of pixel data. Every scan-line has the same length. The color @@ -611,128 +566,98 @@ .VE 8.7 .SS "FORMAT SUBOPTIONS" .PP .VS 8.6 -Image formats may support sub-options, which are specified using +Image formats may support sub-options, wich ahre specified using additional words in the value to the \fB\-format\fR option. These suboptions can affect how image data is read or written to file or string. The nature and values of these options is up to the format handler. The built-in handlers support these suboptions: -.\" OPTION -colorformat .VS 8.7 .TP \fBdefault \-colorformat\fI formatType\fR . The option is allowed when writing image data to a string with -\fIimageName \fBdata\fR. Specifies the format to use for the color +\fIimageName\fR \fBdata\fR. Specifies the format to use for the color string of each pixel. \fIformatType\fR may be one of: \fBrgb\fR to encode pixel data in the form \fB#\fIRRGGBB\fR, \fBrgba\fR to encode pixel data in the form \fB#\fIRRGGBBAA\fR or \fBlist\fR to encode pixel data as a list with four elements. See \fBCOLOR FORMATS\fR below for details. The default is \fBrgb\fR. .VE 8.7 -.\" OPTION -index .TP \fBgif \-index\fI indexValue\fR . The option has effect when reading image data from a file. When parsing a multi-part GIF image, Tk normally only accesses the first image. By giving the \fB\-index\fR sub-option, the \fIindexValue\fR'th value may be used instead. The \fIindexValue\fR must be an integer from 0 up to the number of image parts in the GIF data. -.\" OPTION -alpha .TP \fBpng \-alpha\fI alphaValue\fR . The option has effect when reading image data from a file. Specifies an additional alpha filtering for the overall image, which allows the background on which the image is displayed to show through. This usually also has the effect of desaturating the image. The \fIalphaValue\fR must be between 0.0 and 1.0. -.\" OPTION -dpi -.\" OPTION -scale -.\" OPTION -scaletowidth -.\" OPTION -scaletoheight .TP -\fBsvg \-dpi\fI dpiValue \fB\-scale\fI scaleValue \fB\-scaletowidth\fI width \fB\-scaletoheight\fI height\fR +\fBsvg \-dpi\fI dpiValue\fB \-scale\fI scaleValue\fB \-scaletowidth \fI width\fB \-scaletoheight\fI height\fR . \fIdpiValue\fR is used in conversion between given coordinates and screen resolution. The value must be greater than 0 and the default value is 96. -.PP -.RS \fIscaleValue\fR is used to scale the resulting image. The value must be greater than 0 and the default value is 1. \fIwidth\fR and \fIheight\fR are the width or height that the image will be adjusted to. Only one parameter among \fB\-scale\fR, \fB\-scaletowidth\fR and \fB\-scaletoheight\fR can be given at a time and the aspect ratio of the original image is always preserved. -The \fBsvg\fR format supports a wide range of SVG features, but the +The svg format supports a wide range of SVG features, but the full SVG standard is not available, for instance the 'text' feature is missing and silently ignored when reading the SVG data. The supported SVG features are: -.TP -\fBelements:\fR . -g, path, rect, circle, ellipse, line, polyline, polygon, +.RS +\fB elements:\fR g, path, rect, circle, ellipse, line, polyline, polygon, linearGradient, radialGradient, stop, defs, svg, style -.TP -\fBattributes:\fR -. -width, height, viewBox, +.PP +\fB attributes:\fR width, height, viewBox, preserveAspectRatio with none, xMin, xMid, xMax, yMin, yMid, yMax, slice -.TP -\fBgradient attributes:\fR -. -gradientUnits with objectBoundingBox, +.PP +\fB gradient attributes:\fR gradientUnits with objectBoundingBox, gradientTransform, cx, cy, r fx, fy x1, y1, x2, y2 spreadMethod with pad, reflect or repeat, xlink:href -.TP -\fBpoly attributes:\fR -. -points -.TP -\fBline attributes:\fR -. -x1, y1, x2, y2 -.TP -\fBellipse attributes:\fR -. -cx, cy, rx, ry -.TP -\fBcircle attributes:\fR -. -cx, cy, r -.TP -\fBrectangle attributes:\fR -. -x, y, width, height, rx, ry -.TP -\fBpath attributes:\fR -. -d with m, M, l, L, h, H, v, V, c, C, s, S, q, Q, t, T, a, A, z, Z -.TP -\fBstyle attributes:\fR -. -display with none, visibility, hidden, visible, +.PP +\fB poly attributes: \fR points +.PP +\fB line attributes: \fR x1, y1, x2, y2 +.PP +\fB ellipse attributes: \fR cx, cy, rx, ry +.PP +\fB circle attributes: \fR cx, cy, r +.PP +\fB rectangle attributes: \fR x, y, width, height, rx, ry +.PP +\fB path attributes: \fR d with m, M, l, L, h, H, v, V, c, C, s, S, q, Q, t, T, a, A, z, Z +.PP +\fB style attributes: \fR display with none, visibility, hidden, visible, fill with nonzero and evenodd, opacity, fill-opacity, stroke, stroke-width, stroke-dasharray, stroke-dashoffset, stroke-opacity, stroke-linecap with butt, round and square, stroke-linejoin with miter, round and bevel, stroke-miterlimit fill-rule, font-size, transform with matrix, translate, scale, rotate, skewX and skewY, stop-color, stop-opacity, offset, id, class .RE -.PP -.RS +. Currently only SVG images reading and conversion into (pixel-based format) photos is supported: Tk does not (yet) support bundling photo images in SVG vector graphics. -.RE .VE 8.6 .VS 8.7 .SH "COLOR FORMATS" .PP The default image handler can represent/parse color and alpha values @@ -819,46 +744,50 @@ parsed, or may use metadata to be included in image files or formats. .SS "METADATA KEYS (MULTIPLE FORMATS)" .PP Each image format driver supports an individual set of metadata dictionary keys. Predefined keys are: -.IP \fBDPI\fR +.TP +DPI +. Horizontal image resolution in DPI as a double value. Supported by format \fBpng\fR. -.IP \fBaspect\fR +.TP +aspect +. Aspect ratio horizontal divided by vertical as double value. Supported by formats \fBgif\fR and \fBpng\fR. -.IP \fBcomment\fR +.TP +comment +. Image text comment. Supported by formats \fBgif\fR and \fBpng\fR. .PP It is valid to set any key in the metadata dict. -A format driver will ignore keys that it does not handle. +A format driver will ignore keys it does not handle. .SS "METADATA KEYS FOR ANIMATED GIF INFORMATION" .PP The following metadata keys are reported when reading a \fBgif\fR format file. -They are typically used in conjunction with the \fB\-index\fR option of an -animated \fBgif\fR file to properly display the subimage sequence. -The options are linked to each subimage selected by \fB\-index\fR. -.TP -\fBdelay time\fI time\fR -. -Update delay time in 10ms units. -This key is only present if the delay time is not 0. -.TP -\fBdisposal method\fI method\fR +They are typically used in conjunction with the \fI-index\fR option of an +animated \fBgif\fR file to properly display the subimage sequence. +The options are linked to each subimage selected by \fI-index\fR. +.TP +\fBdelay time\fR \fItime\fR +. +Update delay time in 10ms unit. This key is only present, if delay time is not 0. +.TP +\fBdisposal method\fR \fImethod\fR . Disposal method of the preceeding image, if given for the current image. -Possible values are: \fBdo not dispose\fR, \fBrestore to background color\fR, -\fBrestore to previous\fR. +Possible values are: \fIdo not dispose\fR, \fIrestore to background color\fR, \fIrestore to previous\fR. .TP -\fBuser interaction\fI bool\fR +\fBuser interaction\fR \fIbool\fR . The key is present with a value of 1, if user interaction is specified. Otherwise, the key is not present. .TP -\fBupdate region\fI X0\fR, \fIY0\fR, \fIwidth\fR, \fIheight\fR +\fBupdate region\fR \fIX0\fR, \fIY0\fR, \fIwidth\fR, \fIheight\fR . Update region of the current subimage, if subimage has not the same size as the full image. The pixel outside of this box are all fully transparent. .PP .VE 8.7 @@ -872,30 +801,30 @@ Load an image from a file and tile it to the size of a window, which is useful for producing a tiled background: .PP .CS # These lines should be called once -\fBimage create photo\fR untiled -file "theFile.ppm" +\fBimage create photo\fR untiled \-file "theFile.ppm" \fBimage create photo\fR tiled # These lines should be called whenever .someWidget changes # size; a binding is useful here set width [winfo width .someWidget] set height [winfo height .someWidget] -tiled \fBcopy\fR untiled -to 0 0 $width $height -shrink +tiled \fBcopy\fR untiled \-to 0 0 $width $height \-shrink .CE .PP .VS 8.6 The PNG image loader allows the application of an additional alpha factor during loading, which is useful for generating images suitable for disabled buttons: .PP .CS -\fBimage create photo\fR icon -file "icon.png" -\fBimage create photo\fR iconDisabled -file "icon.png" \e - -format "png -alpha 0.5" -button .b -image icon -disabledimage iconDisabled +\fBimage create photo\fR icon \-file "icon.png" +\fBimage create photo\fR iconDisabled \-file "icon.png" \e + \-format "png \-alpha 0.5" +button .b \-image icon \-disabledimage iconDisabled .CE .VE 8.6 .PP .VS 8.7 Create a green box with a simple shadow effect Index: doc/place.n ================================================================== --- doc/place.n +++ doc/place.n @@ -28,20 +28,17 @@ that, for example, the content has a fixed width and height but is centered inside the container. .PP .TP \fBplace \fIwindow option value \fR?\fIoption value ...\fR? -. Arrange for the placer to manage the geometry of a content whose pathName is \fIwindow\fR. The remaining arguments consist of one or more \fIoption\-value\fR pairs that specify the way in which \fIwindow\fR's geometry is managed. \fIOption\fR may have any of the values accepted by the \fBplace configure\fR command. -.\" METHOD: configure .TP \fBplace configure \fIwindow \fR?\fIoption\fR? ?\fIvalue option value ...\fR? -. Query or modify the geometry options of the content given by \fIwindow\fR. If no \fIoption\fR is specified, this command returns a list describing the available options (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 @@ -51,27 +48,23 @@ modifies the given option(s) to have the given value(s); in this case the command returns an empty string. .RS .PP The following \fIoption\-value\fR pairs are supported: -.\" OPTION: -anchor .TP \fB\-anchor \fIwhere\fR -. \fIWhere\fR specifies which point of \fIwindow\fR is to be positioned at the (x,y) location selected by the \fB\-x\fR, \fB\-y\fR, \fB\-relx\fR, and \fB\-rely\fR options. The anchor point is in terms of the outer area of \fIwindow\fR including its border, if any. Thus if \fIwhere\fR is \fBse\fR then the lower-right corner of \fIwindow\fR's border will appear at the given (x,y) location in the container. The anchor position defaults to \fBnw\fR. -.\" OPTION: -bordermode .TP \fB\-bordermode \fImode\fR -. \fIMode\fR determines the degree to which borders within the container are used in determining the placement of the content. The default and most common value is \fBinside\fR. In this case the placer considers the area of the container to be the innermost area of the container, inside any border: @@ -89,25 +82,21 @@ case borders are ignored: the area of the container 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 -.\" OPTION: -height .TP \fB\-height \fIsize\fR -. \fISize\fR specifies the height for \fIwindow\fR in screen units (i.e. any of the forms accepted by \fBTk_GetPixels\fR). The height will be the outer dimension of \fIwindow\fR including its border, if any. If \fIsize\fR is an empty string, or if no \fB\-height\fR or \fB\-relheight\fR option is specified, then the height requested internally by the window will be used. -.\" OPTION: -in .TP \fB\-in \fIcontainer\fR -. \fIContainer\fR specifies the path name of the window relative to which \fIwindow\fR is to be placed. \fIContainer\fR must either be \fIwindow\fR's parent or a descendant of \fIwindow\fR's parent. In addition, \fIcontainer\fR and \fIwindow\fR must both be descendants @@ -114,38 +103,32 @@ of the same top-level window. These restrictions are necessary to guarantee that \fIwindow\fR is visible whenever \fIcontainer\fR is visible. If this option is not specified then the other window defaults to \fIwindow\fR's parent. -.\" OPTION: -relheight .TP \fB\-relheight \fIsize\fR -. \fISize\fR specifies the height for \fIwindow\fR. In this case the height is specified as a floating-point number relative to the height of the container: 0.5 means \fIwindow\fR will be half as high as the container, 1.0 means \fIwindow\fR will have the same height as the container, and so on. If both \fB\-height\fR and \fB\-relheight\fR are specified for a content, their values are summed. For example, \fB\-relheight 1.0 \-height \-2\fR makes the content 2 pixels shorter than the container. -.\" OPTION: -relwidth .TP \fB\-relwidth \fIsize\fR -. \fISize\fR specifies the width for \fIwindow\fR. In this case the width is specified as a floating-point number relative to the width of the container: 0.5 means \fIwindow\fR will be half as wide as the container, 1.0 means \fIwindow\fR will have the same width as the container, and so on. If both \fB\-width\fR and \fB\-relwidth\fR are specified for a content, their values are summed. For example, \fB\-relwidth 1.0 \-width 5\fR makes the content 5 pixels wider than the container. -.\" OPTION: -relx .TP \fB\-relx \fIlocation\fR -. \fILocation\fR specifies the x-coordinate within the container window of the anchor point for \fIwindow\fR. In this case the location is specified in a relative fashion as a floating-point number: 0.0 corresponds to the left edge of the container and 1.0 corresponds to the right edge of the container. @@ -152,14 +135,12 @@ \fILocation\fR need not be in the range 0.0\-1.0. If both \fB\-x\fR and \fB\-relx\fR are specified for a content then their values are summed. For example, \fB\-relx 0.5 \-x \-2\fR positions the left edge of the content 2 pixels to the left of the center of its container. -.\" OPTION: -rely .TP \fB\-rely \fIlocation\fR -. \fILocation\fR specifies the y-coordinate within the container window of the anchor point for \fIwindow\fR. In this case the value is specified in a relative fashion as a floating-point number: 0.0 corresponds to the top edge of the container and 1.0 corresponds to the bottom edge of the container. @@ -166,34 +147,28 @@ \fILocation\fR need not be in the range 0.0\-1.0. If both \fB\-y\fR and \fB\-rely\fR are specified for a content then their values are summed. For example, \fB\-rely 0.5 \-x 3\fR positions the top edge of the content 3 pixels below the center of its container. -.\" OPTION: -width .TP \fB\-width \fIsize\fR -. \fISize\fR specifies the width for \fIwindow\fR in screen units (i.e. any of the forms accepted by \fBTk_GetPixels\fR). The width will be the outer width of \fIwindow\fR including its border, if any. If \fIsize\fR is an empty string, or if no \fB\-width\fR or \fB\-relwidth\fR option is specified, then the width requested internally by the window will be used. -.\" OPTION: -x .TP \fB\-x \fIlocation\fR -. \fILocation\fR specifies the x-coordinate within the container window of the anchor point for \fIwindow\fR. The location is specified in screen units (i.e. any of the forms accepted by \fBTk_GetPixels\fR) and need not lie within the bounds of the container window. -.\" OPTION: -y .TP \fB\-y \fIlocation\fR -. \fILocation\fR specifies the y-coordinate within the container window of the anchor point for \fIwindow\fR. The location is specified in screen units (i.e. any of the forms accepted by \fBTk_GetPixels\fR) and need not lie within the bounds of the container window. @@ -200,35 +175,27 @@ .PP If the same value is specified separately with two different options, such as \fB\-x\fR and \fB\-relx\fR, then the most recent option is used and the older one is ignored. .RE -.\" METHOD: content -.TP -\fBplace content \fIwindow\fR -. -Returns a list of all the content windows for which \fIwindow\fR is the -container. If there is no content for \fIwindow\fR then an empty string -is returned. -.\" METHOD: forget .TP \fBplace forget \fIwindow\fR -. Causes the placer to stop managing the geometry of \fIwindow\fR. As a side effect of this command \fIwindow\fR will be unmapped so that it does not appear on the screen. If \fIwindow\fR is not currently managed by the placer then the command has no effect. This command returns an empty string. -.\" METHOD: info .TP \fBplace info \fIwindow\fR -. Returns a list giving the current configuration of \fIwindow\fR. The list consists of \fIoption\-value\fR pairs in exactly the same form as might be specified to the \fBplace configure\fR command. -.\" METHOD: slaves +.TP +\fBplace content \fIwindow\fR +Returns a list of all the content windows for which \fIwindow\fR is the container. +If there is no content for \fIwindow\fR then an empty string is returned. .TP \fBplace slaves \fIwindow\fR . Synonym for \fBplace content \fIwindow\fR. .PP @@ -278,16 +245,15 @@ .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 +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, container, place, rubber sheet, -content, width +geometry manager, height, location, container, place, rubber sheet, content, width '\" Local Variables: '\" mode: nroff '\" End: Index: doc/popup.n ================================================================== --- doc/popup.n +++ doc/popup.n @@ -29,15 +29,15 @@ .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 +$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!"] +pack [label .l \-text "Click me!"] # Arrange for the menu to pop up when the label is clicked bind .l {\fBtk_popup\fR .popupMenu %X %Y} .CE .SH "SEE ALSO" Index: doc/radiobutton.n ================================================================== --- doc/radiobutton.n +++ doc/radiobutton.n @@ -10,11 +10,11 @@ .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME radiobutton \- Create and manipulate 'radiobutton' pick-one widgets .SH SYNOPSIS -\fBradiobutton\fI pathName \fR?\fIoptions\fR? +\fBradiobutton\fR \fIpathName \fR?\fIoptions\fR? .SO \-activebackground \-disabledforeground \-padx \-activeforeground \-font \-pady \-anchor \-foreground \-relief \-background \-highlightbackground \-takefocus @@ -63,12 +63,12 @@ The empty string is the default value. .OP \-selectcolor selectColor Background Specifies a background color to use when the button is selected. If \fBindicatorOn\fR is true then the color is used as the background for the indicator regardless of the select state. -If \fB\-indicatoron\fR is false, this color is used as the background for the -entire widget, in place of \fB\-background\fR or \fB\-activeBackground\fR, +If \fB\-indicatoron\fR is false, this color is used as the background +for the entire widget, in place of \fB\-background\fR or \fB\-activeBackground\fR, whenever the widget is selected. If specified as an empty string then no special color is used for displaying when the widget is selected. .OP \-selectimage selectImage SelectImage Specifies an image to display (in place of the \fB\-image\fR option) @@ -179,19 +179,17 @@ \fIpathName option \fR?\fIarg ...\fR? .CE \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for radiobutton widgets: -.\" METHOD: cget .TP -\fIpathName \fBcget\fI option\fR +\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 \fBradiobutton\fR command. -.\" METHOD: configure .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . Query or modify the configuration options of the widget. If no \fIoption\fR is specified, returns a list describing all of @@ -203,38 +201,34 @@ one or more \fIoption\-value\fR pairs are specified, 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 \fBradiobutton\fR command. -.\" METHOD: deselect .TP \fIpathName \fBdeselect\fR . Deselects the radiobutton and sets the associated variable to an empty string. If this radiobutton was not currently selected, the command has no effect. -.\" METHOD: flash .TP \fIpathName \fBflash\fR . Flashes the radiobutton. This is accomplished by redisplaying the radiobutton several times, alternating between active and normal colors. At the end of the flash the radiobutton is left in the same normal/active state as when the command was invoked. This command is ignored if the radiobutton's state is \fBdisabled\fR. -.\" METHOD: invoke .TP \fIpathName \fBinvoke\fR . Does just what would have happened if the user invoked the radiobutton with the mouse: selects the button and invokes its associated Tcl command, 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 radiobutton. This command is ignored if the radiobutton's state is \fBdisabled\fR. -.\" METHOD: select .TP \fIpathName \fBselect\fR . Selects the radiobutton and sets the associated variable to the value corresponding to this widget. @@ -261,12 +255,11 @@ actions occur: the radiobutton is completely non-responsive. .PP The behavior of radiobuttons can be changed by defining new bindings for individual widgets or by redefining the class bindings. .SH "SEE ALSO" -checkbutton(n), labelframe(n), listbox(n), options(n), scale(n), -ttk::radiobutton(n) +checkbutton(n), labelframe(n), listbox(n), options(n), scale(n), ttk::radiobutton(n) .SH KEYWORDS radiobutton, widget '\" Local Variables: '\" mode: nroff '\" End: Index: doc/raise.n ================================================================== --- doc/raise.n +++ doc/raise.n @@ -39,15 +39,15 @@ 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 display: .CS -button .b -text "Hi there!" -pack [frame .f -background blue] -pack [label .f.l1 -text "This is above"] -pack .b -in .f -pack [label .f.l2 -text "This is below"] +button .b \-text "Hi there!" +pack [frame .f \-background blue] +pack [label .f.l1 \-text "This is above"] +pack .b \-in .f +pack [label .f.l2 \-text "This is below"] \fBraise\fR .b .CE .SH "SEE ALSO" lower(n) .SH KEYWORDS Index: doc/scale.n ================================================================== --- doc/scale.n +++ doc/scale.n @@ -10,11 +10,11 @@ .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME scale \- Create and manipulate 'scale' value-controlled slider widgets .SH SYNOPSIS -\fBscale\fI pathName \fR?\fIoptions\fR? +\fBscale\fR \fIpathName \fR?\fIoptions\fR? .SO \-activebackground \-foreground \-relief \-background \-highlightbackground \-repeatdelay \-borderwidth \-highlightcolor \-repeatinterval \-cursor \-highlightthickness \-takefocus @@ -76,13 +76,11 @@ If the scale is active, the slider is displayed using the color specified by the \fB\-activebackground\fR option. .OP \-tickinterval tickInterval TickInterval Must be a real value. Determines the spacing between numerical -tick marks displayed below or to the left of the slider. The values will all -be displayed with the same number of decimal places, which will be enough to -ensure they are all accurate to within 20% of a tick interval. +tick marks displayed below or to the left of the slider. The values will all be displayed with the same number of decimal places, which will be enough to ensure they are all accurate to within 20% of a tick interval. If 0, no tick marks will be displayed. .OP \-to to To Specifies a real value corresponding to the right or bottom end of the scale. This value may be either less than or greater than the \fB\-from\fR option. @@ -143,19 +141,17 @@ \fIpathName option \fR?\fIarg ...\fR? .CE \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for scale widgets: -.\" METHOD: cget .TP -\fIpathName \fBcget\fI option\fR +\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 \fBscale\fR command. -.\" METHOD: configure .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . Query or modify the configuration options of the widget. If no \fIoption\fR is specified, returns a list describing all of @@ -167,29 +163,26 @@ 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 \fBscale\fR command. -.\" METHOD: coords .TP \fIpathName \fBcoords \fR?\fIvalue\fR? . Returns a list whose elements are the x and y coordinates of the point along the centerline of the trough that corresponds to \fIvalue\fR. If \fIvalue\fR is omitted then the scale's current value is used. -.\" METHOD: get .TP \fIpathName \fBget\fR ?\fIx y\fR? . If \fIx\fR and \fIy\fR are omitted, returns the current value of the scale. If \fIx\fR and \fIy\fR are specified, they give pixel coordinates within the widget; the command returns the scale value corresponding to the given pixel. Only one of \fIx\fR or \fIy\fR is used: for horizontal scales \fIy\fR is ignored, and for vertical scales \fIx\fR is ignored. -.\" METHOD: identify .TP \fIpathName \fBidentify \fIx y\fR . Returns a string indicating what part of the scale lies under the coordinates given by \fIx\fR and \fIy\fR. @@ -198,11 +191,10 @@ portion of the slider above or to the left of the slider; and \fBtrough2\fR means that the point is over the portion of the slider below or to the right of the slider. If the point is not over one of these elements, an empty string is returned. -.\" METHOD: set .TP \fIpathName \fBset \fIvalue\fR . This command is invoked to change the current value of the scale, and hence the position at which the slider is displayed. \fIValue\fR Index: doc/scrollbar.n ================================================================== --- doc/scrollbar.n +++ doc/scrollbar.n @@ -40,11 +40,11 @@ as described in \fBSCROLLING COMMANDS\fR below. .OP \-elementborderwidth elementBorderWidth BorderWidth Specifies the width of borders drawn around the internal elements of the scrollbar (the two arrows and the slider). The value may have any of the forms acceptable to \fBTk_GetPixels\fR. -If this value is the empty string (the default), the value of +If this value is negative (the default is -1), the value of the \fB\-borderwidth\fR option is used in its place. .OP \-width width Width Specifies the desired narrow dimension of the scrollbar window, not including 3-D border, if any. For vertical scrollbars this will be the width and for horizontal scrollbars Index: doc/selection.n ================================================================== --- doc/selection.n +++ doc/selection.n @@ -24,25 +24,23 @@ \fBclipboard\fR command may also be used. .PP The first argument to \fBselection\fR determines the format of the rest of the arguments and the behavior of the command. The following forms are currently supported: -.\" METHOD: clear .TP -\fBselection clear\fR ?\fB\-displayof\fI window\fR? ?\fB\-selection\fI selection\fR? +\fBselection clear\fR ?\fB\-displayof\fR \fIwindow\fR? ?\fB\-selection\fR \fIselection\fR? . If \fIselection\fR exists anywhere on \fIwindow\fR's display, clear it so that no window owns the selection anymore. \fISelection\fR specifies the X selection that should be cleared, and should be an atom name such as \fBPRIMARY\fR or \fBCLIPBOARD\fR; see the Inter-Client Communication Conventions Manual for complete details. \fISelection\fR defaults to \fBPRIMARY\fR and \fIwindow\fR defaults to .QW . . Returns an empty string. -.\" METHOD: get .TP -\fBselection get\fR ?\fB\-displayof\fI window\fR? ?\fB\-selection\fI selection\fR? ?\fB\-type\fI type\fR? +\fBselection get\fR ?\fB\-displayof\fR \fIwindow\fR? ?\fB\-selection\fR \fIselection\fR? ?\fB\-type\fR \fItype\fR? . Retrieves the value of \fIselection\fR from \fIwindow\fR's display and returns it as a result. \fISelection\fR defaults to \fBPRIMARY\fR and \fIwindow\fR defaults to .QW . . @@ -61,13 +59,12 @@ or \fBATOM\fR, the \fBselection\fR command converts it to string format as a collection of fields separated by spaces: atoms are converted to their textual names, and anything else is converted to hexadecimal integers. Note that \fBselection get\fR does not retrieve the selection in the \fBUTF8_STRING\fR format unless told to. -.\" METHOD: handle .TP -\fBselection handle\fR ?\fB\-selection\fI s\fR? ?\fB\-type\fI t\fR? ?\fB\-format\fI f\fR? \fIwindow command\fR +\fBselection handle\fR ?\fB\-selection\fR \fIs\fR? ?\fB\-type\fR \fIt\fR? ?\fB\-format\fR \fIf\fR? \fIwindow command\fR . Creates a handler for selection requests, such that \fIcommand\fR will be executed whenever selection \fIs\fR is owned by \fIwindow\fR and someone attempts to retrieve it in the form given by type \fIt\fR (e.g. \fIt\fR is specified in the \fBselection get\fR command). @@ -120,15 +117,14 @@ selection requesters that do not use Tk. If Tk is being used to retrieve the selection then the value is converted back to a string at the requesting end, so \fIformat\fR is irrelevant. .RE -.\" METHOD: own +.TP +\fBselection own\fR ?\fB\-displayof\fR \fIwindow\fR? ?\fB\-selection\fR \fIselection\fR? .TP -\fBselection own\fR ?\fB\-displayof\fI window\fR? ?\fB\-selection\fI selection\fR? -.TP -\fBselection own\fR ?\fB\-command\fI command\fR? ?\fB\-selection\fI selection\fR? \fIwindow\fR +\fBselection own\fR ?\fB\-command\fR \fIcommand\fR? ?\fB\-selection\fR \fIselection\fR? \fIwindow\fR . The first form of \fBselection own\fR returns the path name of the window in this application that owns \fIselection\fR on the display containing \fIwindow\fR, or an empty string if no window in this application owns the selection. \fISelection\fR defaults to \fBPRIMARY\fR and @@ -144,80 +140,61 @@ some other window claims ownership of the selection away from \fIwindow\fR. \fISelection\fR defaults to PRIMARY. .RE .SH WIDGET FACILITIES .PP -The \fBtext\fR, \fBentry\fR, \fBttk::entry\fR, \fBlistbox\fR, \fBspinbox\fR -and \fBttk::spinbox\fR widgets have the option \fB\-exportselection\fR. If a -widget has this option set to boolean \fBtrue\fR, then (in an unsafe -interpreter) a selection made in the widget is automatically written to the -\fBPRIMARY\fR selection. +The \fBtext\fR, \fBentry\fR, \fBttk::entry\fR, \fBlistbox\fR, \fBspinbox\fR and \fBttk::spinbox\fR widgets have the option \fB\-exportselection\fR. If a widget has this option set to boolean \fBtrue\fR, then (in an unsafe interpreter) a selection made in the widget is automatically written to the \fBPRIMARY\fR selection. .PP -A GUI event, for example \fB<>\fR, can copy the \fBPRIMARY\fR -selection to certain widgets. This copy is implemented by a widget binding to -the event. The binding script makes appropriate calls to the \fBselection\fR -command. +A GUI event, for example \fB<>\fR, can copy the \fBPRIMARY\fR selection to certain widgets. This copy is implemented by a widget binding to the event. The binding script makes appropriate calls to the \fBselection\fR command. .PP .SH PORTABILITY ISSUES .PP -On X11, the \fBPRIMARY\fR selection is a system-wide feature of the X server, -allowing communication between different processes that are X11 clients. +On X11, the \fBPRIMARY\fR selection is a system-wide feature of the X server, allowing communication between different processes that are X11 clients. .PP -On Windows, the \fBPRIMARY\fR selection is not provided by the system, but -only by Tk, and so it is shared only between windows of a parent interpreter -and its child interpreters. It is not shared between interpreters in -different processes or different threads. Each parent interpreter has a -separate \fBPRIMARY\fR selection that is shared only with its child -interpreters which are not safe interpreters. +On Windows, the \fBPRIMARY\fR selection is not provided by the system, but only by Tk, and so it is shared only between windows of a parent interpreter and its child interpreters. It is not shared between interpreters in different processes or different threads. Each parent interpreter has a separate \fBPRIMARY\fR selection that is shared only with its child interpreters which are not safe interpreters. .PP .SH SECURITY .PP -A safe interpreter cannot read from the \fBPRIMARY\fR selection because its -\fBselection\fR command is hidden. For this reason the \fBPRIMARY\fR -selection cannot be written to the Tk widgets of a safe interpreter. -.PP -A Tk widget can have its option \fB\-exportselection\fR set to boolean -\fBtrue\fR, but in a safe interpreter this option has no effect: writing -from the widget to the \fBPRIMARY\fR selection is disabled. -.PP -These are security features. A safe interpreter may run untrusted code, and -it is a security risk if this untrusted code can read or write the -\fBPRIMARY\fR selection used by other interpreters. +A safe interpreter cannot read from the \fBPRIMARY\fR selection because its \fBselection\fR command is hidden. For this reason the \fBPRIMARY\fR selection cannot be written to the Tk widgets of a safe interpreter. +.PP +A Tk widget can have its option \fB\-exportselection\fR set to boolean \fBtrue\fR, but in a safe interpreter this option has no effect: writing from the widget to the \fBPRIMARY\fR selection is disabled. +.PP +These are security features. A safe interpreter may run untrusted code, and it is a security risk if this untrusted code can read or write the \fBPRIMARY\fR selection used by other interpreters. .PP .SH EXAMPLES .PP On X11 platforms, one of the standard selections available is the \fBSECONDARY\fR selection. Hardly anything uses it, but here is how to read it using Tk: .PP .CS -set selContents [\fBselection get\fR -selection SECONDARY] +set selContents [\fBselection get\fR \-selection SECONDARY] .CE .PP Many different types of data may be available for a selection; the special type \fBTARGETS\fR allows you to get a list of available types: .PP .CS -foreach type [\fBselection get\fR -type TARGETS] { +foreach type [\fBselection get\fR \-type TARGETS] { puts "Selection PRIMARY supports type $type" } .CE .PP To claim the selection, you must first set up a handler to supply the data for the selection. Then you have to claim the selection... .CS # Set up the data handler ready for incoming requests set foo "This is a string with some data in it... blah blah" -\fBselection handle\fR -selection SECONDARY . getData +\fBselection handle\fR \-selection SECONDARY . getData proc getData {offset maxChars} { puts "Retrieving selection starting at $offset" return [string range $::foo $offset [expr {$offset+$maxChars-1}]] } # Now we grab the selection itself puts "Claiming selection" -\fBselection own\fR -command lost -selection SECONDARY . +\fBselection own\fR \-command lost \-selection SECONDARY . proc lost {} { puts "Lost selection" } .CE .SH "SEE ALSO" Index: doc/send.n ================================================================== --- doc/send.n +++ doc/send.n @@ -28,31 +28,25 @@ command to be executed, just as for the \fBeval\fR command. .PP If the initial arguments of the command begin with .QW \- they are treated as options. The following options are currently defined: -.\" OPTION: -async .TP \fB\-async\fR -. Requests asynchronous invocation. In this case the \fBsend\fR command will complete immediately without waiting for \fIcmd\fR to complete in the target application; no result will be available and errors in the sent command will be ignored. If the target application is in the same process as the sending application then the \fB\-async\fR option is ignored. -.\" OPTION: -displayof .TP -\fB\-displayof\fI pathName\fR -. +\fB\-displayof\fR \fIpathName\fR Specifies that the target application's main window is on the display of the window given by \fIpathName\fR, instead of the display containing the application's main window. -.\" OPTION: -- .TP \fB\-\|\-\fR -. 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" @@ -94,11 +88,11 @@ .PP This script fragment can be used to make an application that only runs once on a particular display. .CS if {[tk appname FoobarApp] ne "FoobarApp"} { - \fBsend\fR -async FoobarApp RemoteStart $argv + \fBsend\fR \-async FoobarApp RemoteStart $argv exit } # The command that will be called remotely, which raises # the application main window and opens the requested files proc RemoteStart args { Index: doc/spinbox.n ================================================================== --- doc/spinbox.n +++ doc/spinbox.n @@ -10,11 +10,11 @@ .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME spinbox \- Create and manipulate 'spinbox' value spinner widgets .SH SYNOPSIS -\fBspinbox\fI pathName \fR?\fIoptions\fR? +\fBspinbox\fR \fIpathName \fR?\fIoptions\fR? .SO \-activebackground \-highlightthickness \-repeatinterval \-background \-insertbackground \-selectbackground \-borderwidth \-insertborderwidth \-selectborderwidth \-cursor \-insertontime \-selectforeground @@ -166,12 +166,12 @@ The \fB\-validatecommand\fR will be called when the spinbox is edited. .IP \fBall\fR 10 The \fB\-validatecommand\fR will be called for all above conditions. .PP It is possible to perform percent substitutions on the \fB\-validatecommand\fR -and \fB\-invalidcommand\fR scripts, just as you would in a \fBbind\fR script. -The following substitutions are recognized: +and \fB\-invalidcommand\fR scripts, just as you would in a \fBbind\fR script. The +following substitutions are recognized: .PP .IP \fB%d\fR 5 Type of action: 1 for \fBinsert\fR, 0 for \fBdelete\fR, or \-1 for focus, forced or textvariable validation. .IP \fB%i\fR 5 @@ -211,30 +211,30 @@ \fB\-invalidcommand\fR. Such editions will override the one that was being validated. If you wish to edit the value of the widget during validation and still have the \fB\-validate\fR option set, you should include the command .CS - \fI%W config -validate %v\fR + \fI%W config \-validate %v\fR .CE in the \fB\-validatecommand\fR or \fB\-invalidcommand\fR (whichever one you were editing the spinbox widget from). It is also recommended to not set an associated \fB\-textvariable\fR during validation, as that can cause the spinbox widget to become out of sync with the \fB\-textvariable\fR. .PP -Also, the \fB\-validate\fR option will set itself to \fBnone\fR when the -spinbox value gets changed because of adjustment of \fB\-from\fR or \fB\-to\fR -and the \fB\-validatecommand\fR returns false. For instance +Also, the \fB-validate\fR option will set itself to \fBnone\fR when the +spinbox value gets changed because of adjustment of \fB-from\fR or \fB-to\fR +and the \fB-validatecommand\fR returns false. For instance .CS - \fIspinbox pathName -from 1 -to 10 -validate all -validatecommand {return 0}\fR + \fIspinbox pathName \-from 1 \-to 10 \-validate all \-validatecommand {return 0}\fR .CE -will in fact set the \fB\-validate\fR option to \fBnone\fR because the default -value for the spinbox gets changed (due to the \fB\-from\fR and \fB\-to\fR +will in fact set the \fB-validate\fR option to \fBnone\fR because the default +value for the spinbox gets changed (due to the \fB-from\fR and \fB-to\fR options) to a value not accepted by the validation script. .PP Moreover, forced validation is performed when invoking any spinbutton of the spinbox. If the validation script returns false in this situation, -then the \fB\-validate\fR option will be automatically set to \fBnone\fR. +then the \fB-validate\fR option will be automatically set to \fBnone\fR. .SH "WIDGET COMMAND" .PP The \fBspinbox\fR command creates a new Tcl command whose name is \fIpathName\fR. This command may be used to invoke various operations on the widget. It has the following general form: @@ -248,43 +248,36 @@ Many of the widget commands for spinboxes take one or more indices as arguments. An index specifies a particular character in the spinbox's string, in any of the following ways: .TP 12 \fInumber\fR -. Specifies the character as a numerical index, where 0 corresponds to the first character in the string. .TP 12 \fBanchor\fR -. Indicates the anchor point for the selection, which is set with the \fBselect from\fR and \fBselect adjust\fR widget commands. .TP 12 \fBend\fR -. Indicates the character just after the last one in the spinbox's string. This is equivalent to specifying a numerical index equal to the length of the spinbox's string. .TP 12 \fBinsert\fR -. Indicates the character adjacent to and immediately following the insertion cursor. .TP 12 \fBsel.first\fR -. Indicates the first character in the selection. It is an error to use this form if the selection is not in the spinbox window. .TP 12 \fBsel.last\fR -. Indicates the character just after the last one in the selection. It is an error to use this form if the selection is not in the spinbox window. .TP 12 \fB@\fInumber\fR -. In this form, \fInumber\fR is treated as an x-coordinate in the spinbox's window; the character spanning that x-coordinate is used. For example, .QW \fB@0\fR indicates the left-most character in the window. @@ -299,34 +292,28 @@ for the command \fBstring index\fR, with simple integer index arithmetic and indexing relative to \fBend\fR. .SS SUBCOMMANDS .PP The following commands are possible for spinbox widgets: -.\" METHOD: bbox .TP \fIpathName \fBbbox \fIindex\fR -. Returns a list of four numbers describing the bounding box 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 screen area covered by the character (in pixels relative to the widget) and the last two elements give the width and height of the character, in pixels. The bounding box may refer to a region outside the visible area of the window. -.\" METHOD: cget .TP -\fIpathName \fBcget\fI option\fR -. +\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 \fBspinbox\fR command. -.\" METHOD: configure .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue 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 @@ -335,91 +322,70 @@ 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 \fBspinbox\fR command. -.\" METHOD: delete .TP \fIpathName \fBdelete \fIfirst \fR?\fIlast\fR? -. Delete one or more elements of the spinbox. \fIFirst\fR is the index of the first character to delete, and \fIlast\fR is the index of the character just after the last one to delete. If \fIlast\fR is not specified it defaults to \fIfirst\fR+1, i.e. a single character is deleted. This command returns an empty string. -.\" METHOD: get .TP \fIpathName \fBget\fR -. Returns the spinbox's string. -.\" METHOD: icursor .TP \fIpathName \fBicursor \fIindex\fR -. Arrange for the insertion cursor to be displayed just before the character given by \fIindex\fR. Returns an empty string. -.\" METHOD: identify .TP \fIpathName \fBidentify\fI x y\fR -. Returns the name of the window element corresponding to coordinates \fIx\fR and \fIy\fR in the spinbox. Return value is one of: \fBnone\fR, \fBbuttondown\fR, \fBbuttonup\fR, \fBentry\fR. -.\" METHOD: index .TP \fIpathName \fBindex\fI index\fR -. Returns the numerical index corresponding to \fIindex\fR. -.\" METHOD: insert .TP \fIpathName \fBinsert \fIindex string\fR -. Insert the characters of \fIstring\fR just before the character indicated by \fIindex\fR. Returns an empty string. -.\" METHOD: invoke .TP \fIpathName \fBinvoke\fI element\fR -. Causes the specified element, either \fBbuttondown\fR or \fBbuttonup\fR, to be invoked, triggering the action associated with it. -.\" METHOD: scan .TP -\fIpathName \fBscan\fI option args\fR -. +\fIpathName \fBscan\fR \fIoption args\fR This command is used to implement scanning on spinboxes. It has two forms, depending on \fIoption\fR: .RS .TP \fIpathName \fBscan mark \fIx\fR -. Records \fIx\fR and the current view in the spinbox window; used in conjunction with later \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\fR -. This command computes the difference between its \fIx\fR argument and the \fIx\fR argument to the last \fBscan mark\fR command for the widget. It then adjusts the view left or right by 10 times the difference in x-coordinates. This command is typically associated with mouse motion events in the widget, to produce the effect of dragging the spinbox at high speed through the window. The return value is an empty string. .RE -.\" METHOD: selection .TP \fIpathName \fBselection \fIoption arg\fR -. This command is used to adjust the selection within a spinbox. It has several forms, depending on \fIoption\fR: .RS .TP \fIpathName \fBselection adjust \fIindex\fR -. Locate the end of the selection nearest to the character given by \fIindex\fR, and adjust that end of the selection to be at \fIindex\fR (i.e. including but not going beyond \fIindex\fR). The other end of the selection is made the anchor point for future \fBselect to\fR commands. If the selection @@ -427,41 +393,35 @@ include the characters between \fIindex\fR and the most recent selection anchor point, inclusive. Returns an empty string. .TP \fIpathName \fBselection clear\fR -. Clear the selection if it is currently in this widget. If the selection is not in this widget then the command has no effect. Returns an empty string. .TP \fIpathName \fBselection element\fR ?\fIelement\fR? -. Sets or gets the currently selected element. If a spinbutton element is specified, it will be displayed depressed. .TP \fIpathName \fBselection from \fIindex\fR -. Set the selection anchor point to just before the character given by \fIindex\fR. Does not change the selection. Returns an empty string. .TP \fIpathName \fBselection present\fR -. Returns 1 if there is are characters selected in the spinbox, 0 if nothing is selected. .TP \fIpathName \fBselection range \fIstart end\fR -. Sets the selection to include the characters starting with the one indexed by \fIstart\fR and ending with the one just before \fIend\fR. If \fIend\fR refers to the same character as \fIstart\fR or an earlier one, then the spinbox's selection is cleared. .TP \fIpathName \fBselection to \fIindex\fR -. If \fIindex\fR is before the anchor point, set the selection to the characters from \fIindex\fR up to but not including the anchor point. If \fIindex\fR is the same as the anchor point, do nothing. If \fIindex\fR is after the anchor point, set the selection @@ -471,36 +431,29 @@ or \fBselect adjust\fR command in this widget. If the selection is not in this widget then a new selection is created using the most recent anchor point specified for the widget. Returns an empty string. .RE -.\" METHOD: set .TP \fIpathName \fBset\fR ?\fIstring\fR? -. If \fIstring\fR is specified, the spinbox will try and set it to this value, otherwise it just returns the spinbox's string. If validation is on, it will occur when setting the string. -.\" METHOD: validate .TP \fIpathName \fBvalidate\fR -. This command is used to force an evaluation of the \fB\-validatecommand\fR independent of the conditions specified by the \fB\-validate\fR option. This is done by temporarily setting the \fB\-validate\fR option to \fBall\fR. It returns 0 or 1. -.\" METHOD: xview .TP \fIpathName \fBxview \fIargs\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: .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 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 spinbox's text is off-screen to the left, the middle 40% is visible @@ -507,22 +460,19 @@ in the window, and 40% of the text is off-screen to the right. These are the same values passed to scrollbars via the \fB\-xscrollcommand\fR option. .TP \fIpathName \fBxview \fIindex\fR -. Adjusts the view in the window so that the character given by \fIindex\fR is displayed at the left edge of the window. .TP \fIpathName \fBxview moveto\fI fraction\fR -. Adjusts the view in the window so that the character \fIfraction\fR of the way through the text appears at the left edge of the window. \fIFraction\fR must be 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. \fINumber\fR must be an integer or a float, but if it is a float then it is converted to an integer, rounded away from 0. \fIWhat\fR must be either \fBpages\fR or \fBunits\fR or an abbreviation Index: doc/sysnotify.n ================================================================== --- doc/sysnotify.n +++ doc/sysnotify.n @@ -5,21 +5,18 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" .TH tk sysnotify n "" Tk "Tk Built-In Commands" .so man.macros -.BS .SH NAME sysnotify \- Creates a notification window with a title and message. .SH SYNOPSIS -\fBtk sysnotify\fI title message\fR +\fBtk sysnotify\fR \fItitle\fR \fImessage\fR .BE .SH DESCRIPTION .PP -The \fBtk sysnotify\fR command creates a platform-specific system notification -alert. Its intent is to provide a brief, unobtrusive notification to the user -by popping up a window that briefly appears in a corner of the screen. +The \fBtk sysnotify\fR command creates a platform-specific system notification alert. Its intent is to provide a brief, unobtrusive notification to the user by popping up a window that briefly appears in a corner of the screen. .SH EXAMPLE .PP Here is an example of the \fBtk sysnotify\fR code: .PP .CS Index: doc/systray.n ================================================================== --- doc/systray.n +++ doc/systray.n @@ -5,20 +5,21 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" .TH tk systray n "" Tk "Tk Built-In Commands" .so man.macros -.BS .SH NAME systray \- Creates an icon display in the platform-specific system tray. .SH SYNOPSIS -.nf -\fBtk systray create \-image \fIimage\fR ?\fB\-text \fItext\fR? ?\fB\-button1 \fIcallback\fR? ?\fB\-button3 \fIcallback\fR? +\fBtk systray create \fI\-image image\fR \fI?\-text text\fR? \fI?\-button1 callback?\fR \fI?\-button3 callback?\fR +.sp \fBtk systray configure \fI?option? ?value option value ...?\fR +.sp \fBtk systray exists\fR +.sp \fBtk systray destroy\fR -.fi +.BE .BE .SH DESCRIPTION .PP .\" METHOD: create The \fBtk systray create\fR command creates an icon in the platform-specific Index: doc/text.n ================================================================== --- doc/text.n +++ doc/text.n @@ -11,15 +11,14 @@ '\" Note: do not modify the .SH NAME line immediately below! .SH NAME text, tk_textCopy, tk_textCut, tk_textPaste \- Create and manipulate 'text' hypertext editing widgets .SH SYNOPSIS .nf -\fBtext\fI pathName \fR?\fIoptions\fR? -\fBtk_textCopy\fI pathName\fR -\fBtk_textCut\fI pathName\fR -\fBtk_textPaste\fI pathName\fR -.fi +\fBtext\fR \fIpathName \fR?\fIoptions\fR? +\fBtk_textCopy\fR \fIpathName\fR +\fBtk_textCut\fR \fIpathName\fR +\fBtk_textPaste\fR \fIpathName\fR .SO \-background \-highlightthickness \-relief \-borderwidth \-insertbackground \-selectbackground \-cursor \-insertborderwidth \-selectborderwidth \-exportselection \-insertofftime \-selectforeground @@ -415,80 +414,70 @@ 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: -.\" OPTION: -background .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. -.\" OPTION: -bgstipple .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. -.\" OPTION: -borderwidth .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 conjunction with the \fB\-relief\fR option to provide the desired border. -.\" OPTION: -elide .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. -.\" OPTION: -fgstipple .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. -.\" OPTION: -font .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. -.\" OPTION: -foreground .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. -.\" OPTION: -justify .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: -lmargin1 .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: -lmargin2 .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 @@ -495,54 +484,48 @@ 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: -lmargincolor .TP \fB\-lmargincolor \fIcolor\fR . \fIColor\fR specifies the background color to use in regions that do not contain characters because they are indented by \fB\-lmargin1\fR or \fB\-lmargin2\fR. It may have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR has not been specified, or if it is specified as an empty string, then the color used is specified by the -\fB\-background\fR tag option (or, if this is also unspecified, by the -\fB\-background\fR widget option). -.\" OPTION: -offset +\fB-background\fR tag option (or, if this is also unspecified, by the +\fB-background\fR widget option). .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 distances. -.\" OPTION: -overstrike .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. -.\" OPTION: -overstrikefg .TP \fB\-overstrikefg \fIcolor\fR . \fIColor\fR specifies the color to use when displaying the overstrike. It may have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR has not been specified, or if it is specified as an empty string, then the color specified by the \fB\-foreground\fR tag option is used. -.\" OPTION: -relief .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. -.\" OPTION: -rmargin .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 @@ -549,60 +532,51 @@ 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: -rmargincolor .TP \fB\-rmargincolor \fIcolor\fR . \fIColor\fR specifies the background color to use in regions that do not contain characters because they are indented by \fB\-rmargin\fR. It may have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR has not been specified, or if it is specified as an empty string, then the color -used is specified by the \fB\-background\fR tag option (or, if this is also -unspecified, by the \fB\-background\fR widget option). -.\" OPTION: -selectbackground +used is specified by the \fB-background\fR tag option (or, if this is also +unspecified, by the \fB-background\fR widget option). .TP \fB\-selectbackground \fIcolor\fR -. \fIColor\fR specifies the background color to use when displaying selected items. It may have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR has not been specified, or if it is specified as an empty string, then the color specified by the \fB\-background\fR tag option is used. -.\" OPTION: -selectforeground .TP \fB\-selectforeground \fIcolor\fR -. \fIColor\fR specifies the foreground color to use when displaying selected items. It may have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR has not been specified, or if it is specified as an empty string, then the color specified by the \fB\-foreground\fR tag option is used. -.\" OPTION: -spacing1 .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. -.\" OPTION: -spacing2 .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. -.\" OPTION: -spacing3 .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. -.\" OPTION: -tabs .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 @@ -610,34 +584,30 @@ 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. -.\" OPTION: -tabstyle .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). -.\" OPTION: -underline .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. -.\" OPTION: -underlinefg .TP \fB\-underlinefg \fIcolor\fR . \fIColor\fR specifies the color to use when displaying the underline. It may have any of the forms accepted by \fBTk_GetColor\fR. If \fIcolor\fR has not been specified, or if it is specified as an empty string, then the color specified by the \fB\-foreground\fR tag option is used. -.\" OPTION: -wrap .TP \fB\-wrap \fImode\fR . \fIMode\fR specifies how to handle lines that are wider than the text's window. This option only applies to a display line if it applies to the @@ -724,22 +694,21 @@ 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 Eliding an embedded window immediately after scheduling it for creation via -\fIpathName \fBwindow create \fIindex \fB\-create\fR will prevent it from being +\fIpathName \fBwindow create \fIindex \fB-create\fR will prevent it from being effectively created. Uneliding an elided embedded window scheduled for creation -via \fIpathName \fBwindow create \fIindex \fB\-create\fR will automatically +via \fIpathName \fBwindow create \fIindex \fB-create\fR will automatically trigger the associated creation script. After destroying an elided embedded window, the latter won't get automatically recreated. .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: -.\" OPTION: -align .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 @@ -746,11 +715,10 @@ 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). -.\" OPTION: -create .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 @@ -759,34 +727,30 @@ 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. -.\" OPTION: -padx .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. -.\" OPTION: -pady .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. -.\" OPTION: -stretch .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. -.\" OPTION: -window .TP \fB\-window \fIpathName\fR . 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 @@ -809,13 +773,13 @@ 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 Eliding an embedded image immediately after scheduling it for creation via -\fIpathName \fBimage create \fIindex \fB\-create\fR will prevent it from being +\fIpathName \fBimage create \fIindex \fB-create\fR will prevent it from being effectively created. Uneliding an elided embedded image scheduled for creation -via \fIpathName \fBimage create \fIindex \fB\-create\fR will automatically +via \fIpathName \fBimage create \fIindex \fB-create\fR will automatically trigger the associated creation script. After destroying an elided embedded image, the latter won't get automatically recreated. .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 @@ -831,42 +795,37 @@ .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: -.\" OPTION: -align .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). -.\" OPTION: -image .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. -.\" OPTION: -name .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. -.\" OPTION: -padx .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. -.\" OPTION: -pady .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 @@ -1018,11 +977,11 @@ .PP In order to maintain a responsive user-experience, the text widget calculates lines metrics (line heights in pixels) asynchronously. Because of this, some commands of the text widget may return wrong results if the asynchronous calculations are not finished at the time of calling. This applies to -\fIpathName \fBcount \-ypixels\fR and \fIpathName \fByview\fR. +\fIpathName \fBcount -ypixels\fR and \fIpathName \fByview\fR. .PP Again for performance reasons, it would not be appropriate to let these commands always wait for the end of the update calculation each time they are called. In most use cases of these commands a more or less inaccurate result does not really matter compared to execution speed. @@ -1100,11 +1059,10 @@ \fIpathName option \fR?\fIarg ...\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: -.\" METHOD: bbox .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 @@ -1111,27 +1069,24 @@ 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. -.\" METHOD: cget .TP -\fIpathName \fBcget\fI option\fR +\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. -.\" METHOD: compare .TP -\fIpathName \fBcompare\fI index1 op index2\fR +\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. -.\" METHOD: configure .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue 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 @@ -1141,11 +1096,10 @@ 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. -.\" METHOD: count .TP \fIpathName \fBcount\fR ?\fIoptions\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 @@ -1205,11 +1159,10 @@ 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 -.\" METHOD: debug .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 @@ -1226,11 +1179,10 @@ 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 -.\" METHOD: delete .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 @@ -1254,11 +1206,10 @@ first range so 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. -.\" METHOD: dlineinfo .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 @@ -1271,11 +1222,10 @@ 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. -.\" METHOD: dump .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, @@ -1290,60 +1240,52 @@ \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: -.\" OPTION: -all .TP \fB\-all\fR . Return information about all elements: text, marks, tags, images and windows. This is the default. -.\" OPTION: -command .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. -.\" OPTION: -image .TP \fB\-image\fR . Include information about images in the dump results. -.\" OPTION: -mark .TP \fB\-mark\fR . Include information about marks in the dump results. -.\" OPTION: -tag .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. -.\" OPTION: -text .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. -.\" OPTION: -window .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. .RE -.\" METHOD: edit .TP \fIpathName \fBedit \fIoption \fR?\fIarg ...\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 @@ -1390,11 +1332,10 @@ list of indices indicating what ranges were changed by the undo operation. 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 -.\" METHOD: get .TP \fIpathName \fBget\fR ?\fB\-displaychars\fR? ?\fB\-\-\fR? \fIindex1\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 @@ -1409,11 +1350,10 @@ 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. -.\" METHOD: image .TP \fIpathName \fBimage \fIoption \fR?\fIarg ...\fR? . This command is used to manipulate embedded images. The behavior of the command depends on the \fIoption\fR argument that follows the \fBimage\fR @@ -1452,18 +1392,16 @@ \fIpathName \fBimage names\fR . Returns a list whose elements are the names of all image instances currently embedded in \fIwindow\fR. .RE -.\" METHOD: index .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. \fIIndex\fR may have any of the forms described under \fBINDICES\fR above. -.\" METHOD: insert .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 @@ -1477,11 +1415,10 @@ 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. -.\" METHOD: mark .TP \fIpathName \fBmark \fIoption \fR?\fIarg ...\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 @@ -1508,11 +1445,11 @@ 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 \fBend\fR with respect to +\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 . @@ -1540,11 +1477,10 @@ 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 -.\" METHOD: peer .TP \fIpathName \fBpeer \fIoption args\fR . This command is used to create and query widget peers. It has two forms, depending on \fIoption\fR: @@ -1560,19 +1496,15 @@ \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. .RE -.\" METHOD: pendingsync .TP \fIpathName \fBpendingsync\fR -. Returns 1 if the line heights calculations are not up-to-date, 0 otherwise. -.\" METHOD: replace .TP -\fIpathName \fBreplace\fI index1 index2 chars\fR ?\fItagList chars tagList ...\fR? -. +\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 @@ -1583,11 +1515,10 @@ 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 -.\" METHOD: scan .TP \fIpathName \fBscan \fIoption args\fR . This command is used to implement scanning on texts. It has two forms, depending on \fIoption\fR: @@ -1607,44 +1538,39 @@ 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 -.\" METHOD: search .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) may be specified to control the search: .RS -.\" OPTION: -forwards .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. -.\" OPTION: -backwards .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 (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. -.\" OPTION: -exact .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. -.\" OPTION: -regexp .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 @@ -1652,25 +1578,22 @@ 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. -.\" OPTION: -nolinestop .TP \fB\-nolinestop\fR . 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" . -.\" OPTION: -nocase .TP \fB\-nocase\fR . Ignore case differences between the pattern and the text. -.\" OPTION: -count .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 @@ -1677,11 +1600,10 @@ 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. -.\" OPTION: -all .TP \fB\-all\fR . 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, @@ -1697,11 +1619,10 @@ will just match twice, once for each word, and matching .QW "Z[a\-z]+Z" against .QW ZooZooZoo will just match once. -.\" OPTION: -overlap .TP \fB\-overlap\fR . 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 @@ -1715,24 +1636,21 @@ .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. -.\" OPTION: -strictlimits .TP \fB\-strictlimits\fR . 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. -.\" OPTION: -elide .TP \fB\-elide\fR . Find elided (hidden) text as well. By default only displayed text is searched. -.\" OPTION: -- .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. @@ -1751,42 +1669,36 @@ 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 -.\" METHOD: see .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. -.\" METHOD: sync .TP -\fIpathName \fBsync\fR ?\fB\-command \fIcommand\fR? -. +\fIpathName \fBsync\fR ?\fB-command \fIcommand\fR? Controls the synchronization of the view of the text widget. .RS .TP \fIpathName \fBsync\fR -. Immediately brings the line metrics up-to-date by forcing computation of any outdated line heights. The command returns immediately if there is no such outdated line heights, otherwise it returns only at the end of the computation. The command returns an empty string. .TP -\fIpathName \fBsync \-command \fIcommand\fR -. +\fIpathName \fBsync -command \fIcommand\fR Schedules \fIcommand\fR to be executed (by the event loop) exactly once as soon as all line heights are up-to-date. If there are no pending line metrics calculations, the scheduling is immediate. The command returns the empty string. \fBbgerror\fR is called on \fIcommand\fR failure. .RE -.\" METHOD: tag .TP \fIpathName \fBtag \fIoption \fR?\fIarg ...\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 @@ -1924,11 +1836,11 @@ 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 \fBtag raise \fItagName \fR?\fIaboveThis\fR? +\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. @@ -1952,11 +1864,10 @@ 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 -.\" METHOD: window .TP \fIpathName \fBwindow \fIoption \fR?\fIarg ...\fR? . This command is used to manipulate embedded windows. The behavior of the command depends on the \fIoption\fR argument that follows the \fBwindow\fR @@ -1993,11 +1904,10 @@ \fIpathName \fBwindow names\fR . Returns a list whose elements are the names of all windows currently embedded in \fIwindow\fR. .RE -.\" METHOD: xview .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: @@ -2039,11 +1949,10 @@ \fInumber\fR pixels; if it is \fBunits\fR, the view adjusts left or right by \fInumber\fR average-width characters on the display. 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 -.\" METHOD: yview .TP \fIpathName \fByview \fR?\fIargs\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: @@ -2344,11 +2253,11 @@ 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 [\fBtext\fR .t] \&.t insert 1.0 "aaaa\enbbbb\encccc\enbbbb\enaaaa\en" -\&.t search -regexp -- {(a+|b+\enc+\enb+)+\ena+} 1.0 +\&.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 .QW b . .PP Whenever one possible match is fully enclosed in another, the search command @@ -2360,11 +2269,11 @@ not look back arbitrarily far for a possible match which might cover large portions of the widget. For example: .CS pack [\fBtext\fR .t] \&.t insert 1.0 "aaaa\enbbbb\enbbbb\enbbbb\enbbbb\\n" -\&.t search -regexp -backward -- {b+\en|a+\en(b+\en)+} end +\&.t search \-regexp \-backward \-\- {b+\en|a+\en(b+\en)+} end .CE matches at .QW 5.0 when a true greedy match would match at .QW 1.0 . Index: doc/tkerror.n ================================================================== --- doc/tkerror.n +++ doc/tkerror.n @@ -16,19 +16,17 @@ .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. Using the \fBtkerror\fR name is deprecated. -.PP -For backward compatibility +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 future. If that call fails, \fBbgerror\fR +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. Index: doc/tkvars.n ================================================================== --- doc/tkvars.n +++ doc/tkvars.n @@ -14,11 +14,10 @@ .BE .SH DESCRIPTION .PP The following Tcl variables are either set or used by Tk at various times in its execution: -.\" VARIABLE: tk_library .TP 15 \fBtk_library\fR . This variable holds the file name for a directory containing a library of Tcl scripts related to Tk. These scripts include an initialization @@ -39,11 +38,10 @@ working directory. .PP The variable can be modified by an application to switch to a different library. .RE -.\" VARIABLE: tk_patchLevel .TP \fBtk_patchLevel\fR . Contains a dot-separated sequence of decimal integers giving the current patch level for Tk. @@ -52,11 +50,10 @@ .RS .PP This value is normally the same as the result of .QW "\fBpackage require\fR \fBtk\fR" . .RE -.\" VARIABLE: scalingPct .TP \fBtk::scalingPct\fR . Tk sets this variable at initialization time to the scaling percentage corresponding to the display's DPI scaling level. This value is at least @@ -88,21 +85,19 @@ exclusively) from the value of the X resource Xft.dpi, and, as an additional step, Tk synchronizes the scaling factor used to convert between physical units and pixels with the scaling percentage, with the aid of the \fBtk scaling\fR command. .RE -.\" VARIABLE: tk_strictMotif .TP \fBtk_strictMotif\fR . This variable is set to zero by default. If an application sets it to one, then Tk attempts to adhere as closely as possible to Motif look-and-feel standards. For example, active elements such as buttons and scrollbar sliders will not change color when the pointer passes over them. Modern applications should not normally set this variable. -.\" VARIABLE: svgFmt .TP \fBtk::svgFmt\fR . This variable is set at Tk initialization time to .RS @@ -122,11 +117,10 @@ Note that any access to this variable is supposed to be strictly read-only! Note also that whenever the scaling factor used to convert between physical units and pixels is changed via \fBtk scaling\fR, the value of the variable \fBtk::svgFmt\fR is automatically updated. .RE -.\" VARIABLE: tk_version .TP \fBtk_version\fR . Tk sets this variable in the interpreter for each application. The variable holds the current version number of the Tk @@ -138,20 +132,17 @@ each new release of Tk, except that it resets to zero whenever the major version number changes. .SS "INTERNAL AND DEBUGGING VARIABLES" .PP These variables should not normally be set by user code. -.\" VARIABLE: Priv .TP \fBtk::Priv\fR . This variable is an array containing several pieces of information that are private to Tk. The elements of \fBtk::Priv\fR are used by Tk library procedures and default bindings. They should not be accessed by any code outside Tk. -.\" VARIABLE: tk_textRedraw -.\" VARIABLE: tk_textRelayout .TP \fBtk_textRedraw\fR .TP \fBtk_textRelayout\fR . @@ -161,11 +152,10 @@ used by Tk's test suite. .SH "OTHER GLOBAL VARIABLES" The following variables are only guaranteed to exist in \fBwish\fR executables; the Tk library does not define them itself but many Tk environments do. -.\" VARIABLE: geometry .TP \fBgeometry\fR . If set, contains the user-supplied geometry specification to use for the main Tk window. Index: doc/tkwait.n ================================================================== --- doc/tkwait.n +++ doc/tkwait.n @@ -10,33 +10,30 @@ .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 -.nf \fBtkwait variable \fIname\fR +.sp \fBtkwait visibility \fIname\fR +.sp \fBtkwait window \fIname\fR -.fi .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. -.\" METHOD: variable 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. -.\" METHOD: visibility 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. -.\" METHOD: window 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. Index: doc/toplevel.n ================================================================== --- doc/toplevel.n +++ doc/toplevel.n @@ -10,11 +10,11 @@ .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME toplevel \- Create and manipulate 'toplevel' main and popup window widgets .SH SYNOPSIS -\fBtoplevel\fI pathName \fR?\fIoptions\fR? +\fBtoplevel\fR \fIpathName \fR?\fIoptions\fR? .SO \-borderwidth \-highlightcolor \-pady \-cursor \-highlightthickness \-relief \-highlightbackground \-padx \-takefocus .SE @@ -146,19 +146,17 @@ .PP \fIPathName\fR is the name of the command, which is the same as the toplevel widget's path name. \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for toplevel widgets: -.\" METHOD: cget .TP \fIpathName \fBcget \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 \fBtoplevel\fR command. -.\" METHOD: configure .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . Query or modify the configuration options of the widget. If no \fIoption\fR is specified, returns a list describing all of Index: doc/ttk_panedwindow.n ================================================================== --- doc/ttk_panedwindow.n +++ doc/ttk_panedwindow.n @@ -144,11 +144,11 @@ .PP \fB\-background\fP \fIcolor\fP .br \fB\-bordercolor\fP \fIcolor\fP .br -\fB\-gripsize\fP \fIsize\fP (number of screen units) +\fB\-gripcount\fP \fIcount\fP .br \fB\-handlepad\fP \fIamount\fP .br \fB\-handlesize\fP \fIamount\fP .br Index: doc/ttk_scrollbar.n ================================================================== --- doc/ttk_scrollbar.n +++ doc/ttk_scrollbar.n @@ -175,11 +175,11 @@ .br \fB\-darkcolor\fP \fIcolor\fP (color of the dark part of the 3D relief) .br \fB\-foreground\fP \fIcolor\fP .br -\fB\-gripsize\fP \fIsize\fP (number of screen units) +\fB\-gripcount\fP \fIcount\fP (number of lines on the thumb) .br \fB\-lightcolor\fP \fIcolor\fP (color of the light part of the 3D relief) .br \fB\-troughcolor\fP \fIcolor\fP .PP Index: doc/ttk_treeview.n ================================================================== --- doc/ttk_treeview.n +++ doc/ttk_treeview.n @@ -323,12 +323,10 @@ \fIpathname \fBidentify \fIcomponent x y\fR . Returns a description of the specified \fIcomponent\fR under the point given by \fIx\fR and \fIy\fR, or the empty string if no such \fIcomponent\fR is present at that position. -The values \fIx\fR and \fIy\fR may have any of the forms acceptable to -\fBTk_GetPixels\fR. The following subcommands are supported: .RS .TP \fIpathname \fBidentify region \fIx y\fR .RS @@ -717,24 +715,18 @@ .br \fB\-foreground\fP \fIcolor\fP .br \fB\-indent\fP \fIamount\fP .RS -Specifies how far items are indented from their parents. Defaults to 20 pixels. -The value may have any of the forms acceptable to \fBTk_GetPixels\fR. +Specifies how many pixels items are indented from their parents. Defaults to 20. .RE .br -\fB\-columnseparatorwidth\fP \fIamount\fP -.RS -Specifies the width of column separators. Defaults to 1 pixel. -The value may have any of the forms acceptable to \fBTk_GetPixels\fR. -.RE -.br -\fB\-rowheight\fP \fIamount\fP -.RS -This is the standard height for an item. Defaults to 20 pixels. -The value may have any of the forms acceptable to \fBTk_GetPixels\fR. +\fB\-columnseparatorwidth\fP \fIpixels\fP +.br +\fB\-rowheight\fP \fIpixels\fP +.RS +This is the standard height for an item. If \fB\-rowheight\fP is not set by the style, it is set by measuring an item and a cell layout with the style's settings. This thus picks up the font and any focus ring or padding from the theme's layout. The \fB\-rowheight\fP may need to be set to make sure that a row Index: doc/winfo.n ================================================================== --- doc/winfo.n +++ doc/winfo.n @@ -10,74 +10,60 @@ .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME winfo \- Return window-related information .SH SYNOPSIS -\fBwinfo\fI option \fR?\fIarg ...\fR? +\fBwinfo\fR \fIoption \fR?\fIarg ...\fR? .BE .SH DESCRIPTION .PP The \fBwinfo\fR command is used to retrieve information about windows managed by Tk. It can take any of a number of different forms, depending on the \fIoption\fR argument. The legal forms are: -.\" METHOD: atom .TP \fBwinfo atom \fR?\fB\-displayof \fIwindow\fR? \fIname\fR -. Returns a decimal string giving the integer identifier for the atom whose name is \fIname\fR. If no atom exists with the name \fIname\fR then a new one is created. If the \fB\-displayof\fR option is given then the atom is looked up on the display of \fIwindow\fR; otherwise it is looked up on the display of the application's main window. -.\" METHOD: atomname .TP \fBwinfo atomname \fR?\fB\-displayof \fIwindow\fR? \fIid\fR -. Returns the textual name for the atom whose integer identifier is \fIid\fR. If the \fB\-displayof\fR option is given then the identifier is looked up on the display of \fIwindow\fR; otherwise it is looked up on the display of the application's main window. This command is the inverse of the \fBwinfo atom\fR command. It generates an error if no such atom exists. -.\" METHOD: cells .TP \fBwinfo cells \fIwindow\fR -. Returns a decimal string giving the number of cells in the color map for \fIwindow\fR. -.\" METHOD: children .TP \fBwinfo children \fIwindow\fR -. Returns a list containing the path names of all the children of \fIwindow\fR. Top-level windows are returned as children of their logical parents. The list is in stacking order, with the lowest window first, except for Top-level windows which are not returned in stacking order. Use the \fBwm stackorder\fR command to query the stacking order of Top-level windows. -.\" METHOD: class .TP \fBwinfo class \fIwindow\fR -. Returns the class name for \fIwindow\fR. -.\" METHOD: colormapfull .TP \fBwinfo colormapfull \fIwindow\fR -. Returns 1 if the colormap for \fIwindow\fR is known to be full, 0 otherwise. The colormap for a window is .QW known to be full if the last attempt to allocate a new color on that window failed and this application has not freed any colors in the colormap since the failed allocation. -.\" METHOD: containing .TP \fBwinfo containing \fR?\fB\-displayof \fIwindow\fR? \fIrootX rootY\fR -. Returns the path name for the window containing the point given by \fIrootX\fR and \fIrootY\fR. \fIRootX\fR and \fIrootY\fR are specified in screen units (i.e. any form acceptable to \fBTk_GetPixels\fR) in the coordinate system of the root window (if a virtual-root window manager is in @@ -91,357 +77,273 @@ or border of its highest containing toplevel in this application. (Note that with some window managers the borders may be invisible.) In selecting the containing window, children are given higher priority than parents and among siblings the highest one in the stacking order is chosen. -.\" METHOD: depth .TP \fBwinfo depth \fIwindow\fR -. Returns a decimal string giving the depth of \fIwindow\fR (number of bits per pixel). -.\" METHOD: exists .TP \fBwinfo exists \fIwindow\fR -. Returns 1 if there exists a window named \fIwindow\fR, 0 if no such window exists. -.\" METHOD: fpixels .TP -\fBwinfo fpixels \fIwindow number\fR -. +\fBwinfo fpixels \fIwindow\fR \fInumber\fR Returns a floating-point value giving the number of pixels in \fIwindow\fR corresponding to the distance given by \fInumber\fR. \fINumber\fR may be specified in any of the forms acceptable to \fBTk_GetScreenMM\fR, such as .QW 2.0c or .QW 1i . The return value may be fractional; for an integer value, use \fBwinfo pixels\fR. -.\" METHOD: geometry .TP \fBwinfo geometry \fIwindow\fR -. Returns the geometry for \fIwindow\fR, in the form \fIwidth\fBx\fIheight\fB+\fIx\fB+\fIy\fR. All dimensions are in pixels. -.\" METHOD: height .TP \fBwinfo height \fIwindow\fR -. Returns a decimal string giving \fIwindow\fR's height in pixels. When a window is first created its height will be 1 pixel; the height will eventually be changed by a geometry manager to fulfil the window's needs. If you need the true height immediately after creating a widget, invoke \fBupdate\fR to force the geometry manager to arrange it, or use \fBwinfo reqheight\fR to get the window's requested height instead of its actual height. -.\" METHOD: id .TP \fBwinfo id \fIwindow\fR -. Returns a hexadecimal string giving a low-level platform-specific identifier for \fIwindow\fR. On Unix platforms, this is the X window identifier. Under Windows, this is the Windows HWND. On the Macintosh the value has no meaning outside Tk. -.\" METHOD: interps .TP \fBwinfo interps \fR?\fB\-displayof \fIwindow\fR? -. Returns a list whose members are the names of all Tcl interpreters (e.g. all Tk-based applications) currently registered for a particular display. If the \fB\-displayof\fR option is given then the return value refers to the display of \fIwindow\fR; otherwise it refers to the display of the application's main window. -.\" METHOD: ismapped .TP \fBwinfo ismapped \fIwindow\fR -. Returns \fB1\fR if \fIwindow\fR is currently mapped, \fB0\fR otherwise. -.\" METHOD: manager .TP \fBwinfo manager \fIwindow\fR -. Returns the name of the geometry manager currently responsible for \fIwindow\fR, or an empty string if \fIwindow\fR is not managed by any geometry manager. The name is usually the name of the Tcl command for the geometry manager, such as \fBpack\fR or \fBplace\fR. If the geometry manager is a widget, such as canvases or text, the name is the widget's class command, such as \fBcanvas\fR. -.\" METHOD: name .TP \fBwinfo name \fIwindow\fR -. Returns \fIwindow\fR's name (i.e. its name within its parent, as opposed to its full path name). The command \fBwinfo name .\fR will return the name of the application. -.\" METHOD: parent .TP \fBwinfo parent \fIwindow\fR -. Returns the path name of \fIwindow\fR's parent, or an empty string if \fIwindow\fR is the main window of the application. -.\" METHOD: pathname .TP \fBwinfo pathname \fR?\fB\-displayof \fIwindow\fR? \fIid\fR -. Returns the path name of the window whose X identifier is \fIid\fR. \fIId\fR must be a decimal, hexadecimal, or octal integer and must correspond to a window in the invoking application. If the \fB\-displayof\fR option is given then the identifier is looked up on the display of \fIwindow\fR; otherwise it is looked up on the display of the application's main window. -.\" METHOD: pixels .TP -\fBwinfo pixels \fIwindow number\fR -. +\fBwinfo pixels \fIwindow\fR \fInumber\fR Returns the number of pixels in \fIwindow\fR corresponding to the distance given by \fInumber\fR. \fINumber\fR 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; for a fractional result, use \fBwinfo fpixels\fR. -.\" METHOD: pointerx .TP \fBwinfo pointerx \fIwindow\fR -. If the mouse pointer is on the same screen as \fIwindow\fR, returns the pointer's x coordinate, measured in pixels in the screen's root window. If a virtual root window is in use on the screen, the position is measured in the virtual root. If the mouse pointer is not on the same screen as \fIwindow\fR then -1 is returned. -.\" METHOD: pointerxy .TP \fBwinfo pointerxy \fIwindow\fR -. If the mouse pointer is on the same screen as \fIwindow\fR, returns a list with two elements, which are the pointer's x and y coordinates measured in pixels in the screen's root window. If a virtual root window is in use on the screen, the position is computed in the virtual root. If the mouse pointer is not on the same screen as \fIwindow\fR then both of the returned coordinates are \-1. -.\" METHOD: pointery .TP \fBwinfo pointery \fIwindow\fR -. If the mouse pointer is on the same screen as \fIwindow\fR, returns the pointer's y coordinate, measured in pixels in the screen's root window. If a virtual root window is in use on the screen, the position is computed in the virtual root. If the mouse pointer is not on the same screen as \fIwindow\fR then -1 is returned. -.\" METHOD: reqheight .TP \fBwinfo reqheight \fIwindow\fR -. Returns a decimal string giving \fIwindow\fR's requested height, in pixels. This is the value used by \fIwindow\fR's geometry manager to compute its geometry. -.\" METHOD: reqwidth .TP \fBwinfo reqwidth \fIwindow\fR -. Returns a decimal string giving \fIwindow\fR's requested width, in pixels. This is the value used by \fIwindow\fR's geometry manager to compute its geometry. -.\" METHOD: rgb .TP \fBwinfo rgb \fIwindow color\fR -. Returns a list containing three decimal values in the range 0 to 65535, which are the red, green, and blue intensities that correspond to \fIcolor\fR in the window given by \fIwindow\fR. \fIColor\fR may be specified in any of the forms acceptable for a color option. -.\" METHOD: rootx .TP \fBwinfo rootx \fIwindow\fR -. Returns a decimal string giving the x-coordinate, in the root window of the screen, of the upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it has no border). -.\" METHOD: rooty .TP \fBwinfo rooty \fIwindow\fR -. Returns a decimal string giving the y-coordinate, in the root window of the screen, of the upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it has no border). -.\" METHOD: screen .TP \fBwinfo screen \fIwindow\fR -. Returns the name of the screen associated with \fIwindow\fR, in the form \fIdisplayName\fR.\fIscreenIndex\fR. -.\" METHOD: screencells .TP \fBwinfo screencells \fIwindow\fR -. Returns a decimal string giving the number of cells in the default color map for \fIwindow\fR's screen. -.\" METHOD: screendepth .TP \fBwinfo screendepth \fIwindow\fR -. Returns a decimal string giving the depth of the root window of \fIwindow\fR's screen (number of bits per pixel). -.\" METHOD: screenheight .TP \fBwinfo screenheight \fIwindow\fR -. -Returns a decimal string giving the height of \fIwindow\fR's screen, -in pixels. -.\" METHOD: screenmmheight -.TP -\fBwinfo screenmmheight \fIwindow\fR -. -Returns a decimal string giving the height of \fIwindow\fR's screen, -in millimeters. -.\" METHOD: screenmmwidth -.TP -\fBwinfo screenmmwidth \fIwindow\fR -. -Returns a decimal string giving the width of \fIwindow\fR's screen, -in millimeters. -.\" METHOD: screenvisual -.TP -\fBwinfo screenvisual \fIwindow\fR -. +Returns a decimal string giving the height of \fIwindow\fR's screen, +in pixels. +.TP +\fBwinfo screenmmheight \fIwindow\fR +Returns a decimal string giving the height of \fIwindow\fR's screen, +in millimeters. +.TP +\fBwinfo screenmmwidth \fIwindow\fR +Returns a decimal string giving the width of \fIwindow\fR's screen, +in millimeters. +.TP +\fBwinfo screenvisual \fIwindow\fR Returns one of the following strings to indicate the default visual class for \fIwindow\fR's screen: \fBdirectcolor\fR, \fBgrayscale\fR, \fBpseudocolor\fR, \fBstaticcolor\fR, \fBstaticgray\fR, or \fBtruecolor\fR. -.\" METHOD: screenwidth .TP \fBwinfo screenwidth \fIwindow\fR -. Returns a decimal string giving the width of \fIwindow\fR's screen, in pixels. -.\" METHOD: server .TP \fBwinfo server \fIwindow\fR -. Returns a string containing information about the server for \fIwindow\fR's display. The exact format of this string may vary from platform to platform. For X servers the string has the form .QW "\fBX\fImajor\fBR\fIminor vendor vendorVersion\fR" where \fImajor\fR and \fIminor\fR are the version and revision numbers provided by the server (e.g., \fBX11R5\fR), \fIvendor\fR is the name of the vendor for the server, and \fIvendorRelease\fR is an integer release number provided by the server. -.\" METHOD: toplevel .TP \fBwinfo toplevel \fIwindow\fR -. Returns the path name of the top-of-hierarchy window containing \fIwindow\fR. In standard Tk this will always be a \fBtoplevel\fR widget, but extensions may create other kinds of top-of-hierarchy widgets. -.\" METHOD: viewable .TP \fBwinfo viewable \fIwindow\fR -. Returns 1 if \fIwindow\fR and all of its ancestors up through the nearest toplevel window are mapped. Returns 0 if any of these windows are not mapped. -.\" METHOD: visual .TP \fBwinfo visual \fIwindow\fR -. Returns one of the following strings to indicate the visual class for \fIwindow\fR: \fBdirectcolor\fR, \fBgrayscale\fR, \fBpseudocolor\fR, \fBstaticcolor\fR, \fBstaticgray\fR, or \fBtruecolor\fR. -.\" METHOD: visualid .TP \fBwinfo visualid \fIwindow\fR -. Returns the X identifier for the visual for \fIwindow\fR. -.\" METHOD: visualsavailable .TP \fBwinfo visualsavailable \fIwindow\fR ?\fBincludeids\fR? -. Returns a list whose elements describe the visuals available for \fIwindow\fR's screen. Each element consists of a visual class followed by an integer depth. The class has the same form as returned by \fBwinfo visual\fR. The depth gives the number of bits per pixel in the visual. In addition, if the \fBincludeids\fR argument is provided, then the depth is followed by the X identifier for the visual. -.\" METHOD: vrootheight .TP \fBwinfo vrootheight \fIwindow\fR -. Returns the height of the virtual root window associated with \fIwindow\fR if there is one; otherwise returns the height of \fIwindow\fR's screen. -.\" METHOD: vrootwidth .TP \fBwinfo vrootwidth \fIwindow\fR -. Returns the width of the virtual root window associated with \fIwindow\fR if there is one; otherwise returns the width of \fIwindow\fR's screen. -.\" METHOD: vrootx .TP \fBwinfo vrootx \fIwindow\fR -. Returns the x-offset of the virtual root window associated with \fIwindow\fR, relative to the root window of its screen. This is normally either zero or negative. Returns 0 if there is no virtual root window for \fIwindow\fR. -.\" METHOD: vrooty .TP \fBwinfo vrooty \fIwindow\fR -. Returns the y-offset of the virtual root window associated with \fIwindow\fR, relative to the root window of its screen. This is normally either zero or negative. Returns 0 if there is no virtual root window for \fIwindow\fR. -.\" METHOD: width .TP \fBwinfo width \fIwindow\fR -. Returns a decimal string giving \fIwindow\fR's width in pixels. When a window is first created its width will be 1 pixel; the width will eventually be changed by a geometry manager to fulfil the window's needs. If you need the true width immediately after creating a widget, invoke \fBupdate\fR to force the geometry manager to arrange it, or use \fBwinfo reqwidth\fR to get the window's requested width instead of its actual width. -.\" METHOD: x .TP \fBwinfo x \fIwindow\fR -. Returns a decimal string giving the x-coordinate, in \fIwindow\fR's parent, of the upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it has no border). -.\" METHOD: y .TP \fBwinfo y \fIwindow\fR -. Returns a decimal string giving the y-coordinate, in \fIwindow\fR's 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 -puts -nonewline "Mouse pointer at ($x,$y) which is " +puts \-nonewline "Mouse pointer at ($x,$y) which is " set win [\fBwinfo containing\fR $x $y] if {$win eq ""} { puts "over no window" } else { puts "over $win" Index: doc/wish.1 ================================================================== --- doc/wish.1 +++ doc/wish.1 @@ -12,36 +12,29 @@ .SH NAME wish \- Simple windowing shell .SH SYNOPSIS \fBwish\fR ?\fB\-encoding \fIname\fR? ?\fIfileName arg ...\fR? .SH OPTIONS -.\" OPTION: -encoding .IP "\fB\-encoding \fIname\fR" 20 Specifies the encoding of the text stored in \fIfileName\fR. This option is only recognized prior to the \fIfileName\fR argument. -.\" OPTION: -colormap .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. -.\" OPTION: -display .IP "\fB\-display \fIdisplay\fR" 20 Display (and screen) on which to display window. -.\" OPTION: -geometry .IP "\fB\-geometry \fIgeometry\fR" 20 Initial geometry to use for window. If this option is specified, its value is stored in the \fBgeometry\fR global variable of the application's Tcl interpreter. -.\" OPTION: -name .IP "\fB\-name \fIname\fR" 20 Use \fIname\fR as the title to be displayed in the window, and as the name of the interpreter for \fBsend\fR commands. -.\" OPTION: -sync .IP "\fB\-sync\fR" 20 Execute all X server commands synchronously, so that errors are reported immediately. This will result in much slower execution, but it is useful for debugging. -.\" OPTION: -use .IP "\fB\-use\fR \fIid\fR" 20 Specifies that the main window for the application is to be embedded in the window whose identifier is \fIid\fR, instead of being created as an independent toplevel window. \fIId\fR must be specified in the same way as the value for the \fB\-use\fR option for toplevel widgets (i.e. @@ -49,16 +42,14 @@ .RS Note that on some platforms this will only work correctly if \fIid\fR refers to a Tk \fBframe\fR or \fBtoplevel\fR that has its \fB\-container\fR option enabled. .RE -.\" OPTION: -visual .IP "\fB\-visual \fIvisual\fR" 20 Specifies the visual to use for the window. \fIVisual\fR may have any of the forms supported by the \fBTk_GetVisual\fR procedure. -.\" OPTION: -- .IP "\fB\-\|\-\fR" 20 Pass all remaining arguments through to the script's \fBargv\fR variable without interpreting them. This provides a mechanism for passing arguments such as \fB\-name\fR to a script instead of having \fBwish\fR interpret them. @@ -124,44 +115,34 @@ specifying options with a \fBRESOURCE_MANAGER\fR property or .Xdefaults file, is the same as its name except that the first letter is capitalized. .SH "VARIABLES" .PP -\fBWish\fR sets the following global Tcl variables: -.\" VARIABLE: argc +\fBWish\fR sets the following Tcl variables: .TP 15 \fBargc\fR -. Contains a count of the number of \fIarg\fR arguments (0 if none), not including the options described above. -.\" VARIABLE: argv .TP 15 \fBargv\fR -. Contains a Tcl list whose elements are the \fIarg\fR arguments that follow a \fB\-\|\-\fR option or do not match any of the options described in \fBOPTIONS\fR above, in order, or an empty string if there are no such arguments. -.\" VARIABLE: argv0 .TP 15 \fBargv0\fR -. Contains \fIfileName\fR if it was specified. Otherwise, contains the name by which \fBwish\fR was invoked. -.\" VARIABLE: geometry .TP 15 \fBgeometry\fR -. If the \fB\-geometry\fR option is specified, \fBwish\fR copies its value into this variable. If the variable still exists after \fIfileName\fR has been evaluated, \fBwish\fR uses the value of the variable in a \fBwm geometry\fR command to set the main window's geometry. -.\" VARIABLE: tcl_interactive .TP 15 \fBtcl_interactive\fR -. Contains 1 if \fBwish\fR is reading commands interactively (\fIfileName\fR was not specified and standard input is a terminal-like device), 0 otherwise. .SH "SCRIPT FILES" .PP @@ -228,26 +209,10 @@ will evaluate the script in \fBtcl_prompt1\fR. The variable \fBtcl_prompt2\fR is used in a similar way when a newline is typed but the current command is not yet complete; if \fBtcl_prompt2\fR is not set then no prompt is output for incomplete commands. -.SH ZIPVFS -.PP -When a zipfile is concatenated to the end of \fBwish\fR, on startup -the contents of the zip archive will be mounted under the virtual file -system \fB//zipfs:/\fR. If a top level directory \fBtk_library\fR is -present in the zip archive, it will become the directory loaded as -env(TK_LIBRARY). If a file named \fBmain.tcl\fR is present in the top -level directory of the zip archive, it will be sourced instead of the -shell's normal command line handing. -.PP -Only one zipfile can be concatenated to the end of executable image -(tclsh, or wish). However, if multiple zipfiles are -concatenated, only the last one is used. - -This filesystem is read-only. Files cannot be added or modified within -this mounted file system. See zipfs(n) for complete details. .SH "SEE ALSO" -tclsh(1), toplevel(n), zipfs(n), Tk_Main(3), Tk_MainLoop(3), Tk_MainWindow(3) +tclsh(1), toplevel(n), Tk_Main(3), Tk_MainLoop(3), Tk_MainWindow(3) .SH KEYWORDS application, argument, interpreter, prompt, script file, shell, toolkit, toplevel Index: generic/ks_names.h ================================================================== --- generic/ks_names.h +++ generic/ks_names.h @@ -21,12 +21,12 @@ { "Sys_Req", 0xFF15 }, { "Escape", 0xFF1B }, { "Multi_key", 0xFF20 }, { "Kanji", 0xFF21 }, { "Muhenkan", 0xFF22 }, -{ "Henkan", 0xFF23 }, { "Henkan_Mode", 0xFF23 }, +{ "Henkan", 0xFF23 }, { "Romaji", 0xFF24 }, { "Hiragana", 0xFF25 }, { "Katakana", 0xFF26 }, { "Hiragana_Katakana", 0xFF27 }, { "Zenkaku", 0xFF28 }, @@ -1065,12 +1065,12 @@ { "Greek_ZETA", 0x7C6 }, { "Greek_ETA", 0x7C7 }, { "Greek_THETA", 0x7C8 }, { "Greek_IOTA", 0x7C9 }, { "Greek_KAPPA", 0x7CA }, -{ "Greek_LAMBDA", 0x7CB }, { "Greek_LAMDA", 0x7CB }, +{ "Greek_LAMBDA", 0x7CB }, { "Greek_MU", 0x7CC }, { "Greek_NU", 0x7CD }, { "Greek_XI", 0x7CE }, { "Greek_OMICRON", 0x7CF }, { "Greek_PI", 0x7D0 }, @@ -1090,12 +1090,12 @@ { "Greek_zeta", 0x7E6 }, { "Greek_eta", 0x7E7 }, { "Greek_theta", 0x7E8 }, { "Greek_iota", 0x7E9 }, { "Greek_kappa", 0x7EA }, -{ "Greek_lambda", 0x7EB }, { "Greek_lamda", 0x7EB }, +{ "Greek_lambda", 0x7EB }, { "Greek_mu", 0x7EC }, { "Greek_nu", 0x7ED }, { "Greek_xi", 0x7EE }, { "Greek_omicron", 0x7EF }, { "Greek_pi", 0x7F0 }, Index: generic/nanosvg.h ================================================================== --- generic/nanosvg.h +++ generic/nanosvg.h @@ -1339,11 +1339,11 @@ str++; if (!nsvg__isdigit(*str)) break; /* error: no digit after '.' */ while (*str && nsvg__isdigit(*str)) str++; /* skip fractional part */ } if (*str == '%') str++; else break; - while (nsvg__isspace(*str)) str++; + while (*str && nsvg__isspace(*str)) str++; if (*str == delimiter[i]) str++; else break; } if (i == 3) { rgbi[0] = roundf(rgbf[0] * 2.55f); Index: generic/tk.decls ================================================================== --- generic/tk.decls +++ generic/tk.decls @@ -144,11 +144,11 @@ void *widgRec, const char *argvName, int flags) } declare 29 { int Tk_ConfigureWidget(Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, - Tcl_Size objc, Tcl_Obj *const *objv, void *widgRec, + Tcl_Size argc, const char **argv, void *widgRec, int flags) } declare 30 { void Tk_ConfigureWindow(Tk_Window tkwin, unsigned int valueMask, XWindowChanges *valuePtr) @@ -324,10 +324,13 @@ void Tk_FreePixmap(Display *display, Pixmap pixmap) } declare 76 { void Tk_FreeTextLayout(Tk_TextLayout textLayout) } +declare 77 {deprecated {function does nothing, call can be removed}} { + void Tk_FreeXId(Display *display, XID xid) +} declare 78 { GC Tk_GCForColor(XColor *colorPtr, Drawable drawable) } declare 79 { void Tk_GeometryRequest(Tk_Window tkwin, int reqWidth, int reqHeight) @@ -378,11 +381,11 @@ } declare 92 { Tk_Cursor Tk_GetCursorFromData(Tcl_Interp *interp, Tk_Window tkwin, const char *source, const char *mask, int width, int height, int xHot, int yHot, - const char *fg, const char *bg) + Tk_Uid fg, Tk_Uid bg) } declare 93 { Tk_Font Tk_GetFont(Tcl_Interp *interp, Tk_Window tkwin, const char *str) } @@ -470,10 +473,13 @@ } declare 117 { void Tk_ImageChanged(Tk_ImageModel model, int x, int y, int width, int height, int imageWidth, int imageHeight) } +declare 118 { + int Tk_Init(Tcl_Interp *interp) +} declare 119 { Atom Tk_InternAtom(Tk_Window tkwin, const char *name) } declare 120 { int Tk_IntersectTextLayout(Tk_TextLayout layout, int x, int y, @@ -556,19 +562,36 @@ declare 143 { int Tk_ParseArgv(Tcl_Interp *interp, Tk_Window tkwin, int *argcPtr, const char **argv, const Tk_ArgvInfo *argTable, int flags) } +declare 144 {deprecated {function signature changed}} { + void Tk_PhotoPutBlock_NoComposite(Tk_PhotoHandle handle, + Tk_PhotoImageBlock *blockPtr, int x, int y, + int width, int height) +} +declare 145 {deprecated {function signature changed}} { + void Tk_PhotoPutZoomedBlock_NoComposite(Tk_PhotoHandle handle, + Tk_PhotoImageBlock *blockPtr, int x, int y, + int width, int height, int zoomX, int zoomY, + int subsampleX, int subsampleY) +} declare 146 { int Tk_PhotoGetImage(Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr) } declare 147 { void Tk_PhotoBlank(Tk_PhotoHandle handle) } +declare 148 {deprecated {function signature changed}} { + void Tk_PhotoExpand_Panic(Tk_PhotoHandle handle, int width, int height ) +} declare 149 { void Tk_PhotoGetSize(Tk_PhotoHandle handle, int *widthPtr, int *heightPtr) } +declare 150 {deprecated {function signature changed}} { + void Tk_PhotoSetSize_Panic(Tk_PhotoHandle handle, int width, int height) +} declare 151 { int Tk_PointToChar(Tk_TextLayout layout, int x, int y) } declare 152 { int Tk_PostscriptFontName(Tk_Font tkfont, Tcl_DString *dsPtr) @@ -592,10 +615,13 @@ } declare 158 { Tk_RestrictProc *Tk_RestrictEvents(Tk_RestrictProc *proc, void *arg, void **prevArgPtr) } +declare 159 { + int Tk_SafeInit(Tcl_Interp *interp) +} declare 160 { const char *Tk_SetAppName(Tk_Window tkwin, const char *name) } declare 161 { void Tk_SetBackgroundFromBorder(Tk_Window tkwin, Tk_3DBorder border) @@ -777,10 +803,14 @@ } declare 211 { int Tk_InitOptions(Tcl_Interp *interp, void *recordPtr, Tk_OptionTable optionToken, Tk_Window tkwin) } +declare 212 {nostub {Don't use this function in a stub-enabled extension}} { + void Tk_MainEx(Tcl_Size argc, char **argv, Tcl_AppInitProc *appInitProc, + Tcl_Interp *interp) +} declare 213 { void Tk_RestoreSavedOptions(Tk_SavedOptions *savePtr) } declare 214 { int Tk_SetOptions(Tcl_Interp *interp, void *recordPtr, @@ -789,10 +819,13 @@ Tk_SavedOptions *savePtr, int *maskPtr) } declare 215 { void Tk_InitConsoleChannels(Tcl_Interp *interp) } +declare 216 { + int Tk_CreateConsoleWindow(Tcl_Interp *interp) +} declare 217 { void Tk_CreateSmoothMethod(Tcl_Interp *interp, const Tk_SmoothMethod *method) } #declare 218 { # void Tk_CreateCanvasVisitor(Tcl_Interp *interp, void *typePtr) @@ -908,10 +941,21 @@ # New in 8.4a5 # declare 245 { void Tk_SetCaretPos(Tk_Window tkwin, int x, int y, int height) } +declare 246 {deprecated {function signature changed}} { + void Tk_PhotoPutBlock_Panic(Tk_PhotoHandle handle, + Tk_PhotoImageBlock *blockPtr, int x, int y, + int width, int height, int compRule) +} +declare 247 {deprecated {function signature changed}} { + void Tk_PhotoPutZoomedBlock_Panic(Tk_PhotoHandle handle, + Tk_PhotoImageBlock *blockPtr, int x, int y, + int width, int height, int zoomX, int zoomY, + int subsampleX, int subsampleY, int compRule) +} declare 248 { int Tk_CollapseMotionEvents(Display *display, int collapse) } # Style engine @@ -943,10 +987,16 @@ const char *Tk_NameOfStyle(Tk_Style style) } declare 257 { Tk_Style Tk_AllocStyleFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr) } +declare 258 { + Tk_Style Tk_GetStyleFromObj(Tcl_Obj *objPtr) +} +declare 259 { + void Tk_FreeStyleFromObj(Tcl_Obj *objPtr) +} declare 260 { Tk_StyledElement Tk_GetStyledElement(Tk_Style style, Tcl_Size elementId, Tk_OptionTable optionTable) } declare 261 { @@ -999,10 +1049,30 @@ # TIP #264 declare 271 { Tcl_Interp *Tk_Interp(Tk_Window tkwin) } + +# Now that the Tk 8.2 -> 8.3 transition is long past, use more conventional +# means to continue support for extensions using the USE_OLD_IMAGE to +# continue use of their string-based Tcl_ImageTypes and Tcl_PhotoImageFormats. +# +# Note that this restores the usual rules for stub compatibility. Stub-enabled +# extensions compiled against 8.5 headers and linked to the 8.5 stub library +# will produce a file [load]able into an interp with Tk 8.X, for X >= 5. +# It will *not* be [load]able into interps with Tk 8.4 (or Tk 8.2!). +# Developers who need to produce a file [load]able into legacy interps must +# build against legacy sources. +declare 272 { + void Tk_CreateOldImageType(const Tk_ImageType *typePtr) +} +declare 273 { + void Tk_CreateOldPhotoImageFormat(const Tk_PhotoImageFormat *formatPtr) +} + +# ----- BASELINE -- FOR -- 8.6.0 ----- # + # TIP#580 declare 274 { int Tk_AlwaysShowSelection(Tk_Window tkwin) } @@ -1065,10 +1135,37 @@ } declare 290 { Window Tk_MakeWindow(Tk_Window tkwin, Window parent) } +# ----- BASELINE -- FOR -- 9.0.0 ----- # + +# TIP#706 +declare 291 { + void Tk_UnderlineCharsInContext(Display *display, + Drawable drawable, GC gc, Tk_Font tkfont, + const char *string, Tcl_Size numBytes, int x, int y, + Tcl_Size firstByte, Tcl_Size lastByte) +} +declare 292 { + void Tk_DrawCharsInContext(Display * display, + Drawable drawable, GC gc, Tk_Font tkfont, + const char *string, Tcl_Size numBytes, Tcl_Size rangeStart, + Tcl_Size rangeLength, int x, int y) +} +declare 293 { + int Tk_MeasureCharsInContext(Tk_Font tkfont, + const char *string, Tcl_Size numBytes, Tcl_Size rangeStart, + Tcl_Size rangeLength, int maxPixels, int flags, + int *lengthPtr) +} + +# ----- BASELINE -- FOR -- 8.7.0 / 9.0.1 ----- # + +declare 294 { + void TkUnusedStubEntry(void) +} # Define the platform specific public Tk interface. These functions are # only available on the designated platform. interface tkPlat @@ -1086,16 +1183,31 @@ HWND Tk_GetHWND(Window window) } declare 3 win { Tk_Window Tk_HWNDToWindow(HWND hwnd) } +declare 4 win { + void Tk_PointerEvent(HWND hwnd, int x, int y) +} +declare 5 win { + int Tk_TranslateWinEvent(HWND hwnd, + UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result) +} ################################ # Aqua specific functions +# Stub removed because the function no longer exists. +#declare 3 aqua { +# void TkMacOSXInitMenus(Tcl_Interp *interp) +#} declare 4 aqua { void TkMacOSXInitAppleEvents(Tcl_Interp *interp) } +declare 5 aqua { + void TkGenWMConfigureEvent_(Tk_Window tkwin, int x, int y, int width, + int height, int flags) +} declare 6 aqua { void TkMacOSXInvalClipRgns(Tk_Window tkwin) } # Stub removed because it just returned NULL. #declare 7 aqua { Index: generic/tk.h ================================================================== --- generic/tk.h +++ generic/tk.h @@ -15,12 +15,12 @@ #ifndef _TK #define _TK #include -#if (TCL_MAJOR_VERSION < 9) && defined(TCL_MINOR_VERSION) && (TCL_MINOR_VERSION < 7) -# error Tk 9.0 must be compiled with tcl.h from Tcl 8.7 or better +#if (TCL_MAJOR_VERSION < 8) || (defined(TCL_MINOR_VERSION) && (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 6)) +# error Tk 8.7 must be compiled with tcl.h from Tcl 8.6 or better #endif #ifndef EXTERN # define EXTERN extern TCL_STORAGE_CLASS #endif @@ -63,20 +63,21 @@ * You may also need to update some of these files when the numbers change for * the version of Tcl that this release of Tk is compiled against. */ #ifndef TK_MAJOR_VERSION -# define TK_MAJOR_VERSION 9 +# define TK_MAJOR_VERSION 8 +#endif +#if TK_MAJOR_VERSION != 8 +# error "This header-file is for Tk 8 only" #endif -#if TK_MAJOR_VERSION == 9 -# define TK_MINOR_VERSION 0 -# define TK_RELEASE_LEVEL TCL_FINAL_RELEASE -# define TK_RELEASE_SERIAL 1 - -# define TK_VERSION "9.0" -# define TK_PATCH_LEVEL "9.0.1" -#endif /* TK_MAJOR_VERSION */ +#define TK_MINOR_VERSION 7 +#define TK_RELEASE_LEVEL TCL_BETA_RELEASE +#define TK_RELEASE_SERIAL 1 + +#define TK_VERSION "8.7" +#define TK_PATCH_LEVEL "8.7b1" /* * A special definition used to allow this header file to be included from * windows or mac resource files so that they can obtain version information. * RC_INVOKED is defined by default by the windows RC tool and manually set @@ -142,10 +143,19 @@ /* * Additional types exported to clients. */ typedef const char *Tk_Uid; + +#if (TCL_MAJOR_VERSION < 9) && defined(TCL_MINOR_VERSION) && (TCL_MINOR_VERSION < 7) +# ifndef Tcl_Size +# define Tcl_Size int +# endif +# define TCL_SIZE_MAX INT_MAX +# define TCL_SIZE_MODIFIER "" +# define TCL_ENCODING_PROFILE_TCL8 0x01000000 +#endif /* *---------------------------------------------------------------------- * * The enum below defines the valid types for Tk configuration options as @@ -268,10 +278,19 @@ * representation of an option. */ void *clientData; /* Arbitrary one-word value passed to the * handling procs. */ } Tk_ObjCustomOption; +/* + * Macro to use to fill in "offset" fields of the Tk_OptionSpec structure. + * Computes number of bytes from beginning of structure to a given field. + */ + +#if !defined(TK_NO_DEPRECATED) && (TK_MAJOR_VERSION < 9) && !defined(BUILD_tk) +# define Tk_Offset(type, field) ((int) offsetof(type, field)) +#endif + /* * The following two structures are used for error handling. When config * options are being modified, the old values are saved in a Tk_SavedOptions * structure. If an error occurs, then the contents of the structure can be * used to restore all of the old values. The contents of this structure are @@ -283,12 +302,12 @@ struct TkOption *optionPtr; /* Points to information that describes the * option. */ Tcl_Obj *valuePtr; /* The old value of the option, in the form of * a Tcl object; may be NULL if the value was * not saved as an object. */ -#if TCL_MAJOR_VERSION > 8 - long double internalForm; /* The old value of the option, in some +#if TCL_MAJOR_VERSION < 9 + double internalForm; /* The old value of the option, in some * internal representation such as an int or * (XColor *). Valid only if the field * optionPtr->specPtr->objOffset is -1. The * space must be large enough to accommodate a * long double, a double, a long, or a pointer; @@ -295,11 +314,11 @@ * right now it looks like a long double (i.e., 16 * bytes) is big enough. Also, using a long double * guarantees that the field is properly aligned * for storing large values. */ #else - double internalForm; + long double internalForm; #endif } Tk_SavedOption; #ifdef TCL_MEM_DEBUG # define TK_NUM_SAVED_OPTIONS 2 @@ -413,10 +432,13 @@ */ #define TK_CONFIG_COLOR_ONLY (1 << 1) #define TK_CONFIG_MONO_ONLY (1 << 2) #define TK_CONFIG_DONT_SET_DEFAULT (1 << 3) +#ifndef TK_NO_DEPRECATED +# define TK_CONFIG_OPTION_SPECIFIED (1 << 4) +#endif /* !TK_NO_DEPRECATED */ #if TCL_MAJOR_VERSION > 8 # define TK_CONFIG_NULL_OK TCL_NULL_OK #else # define TK_CONFIG_NULL_OK (1 << 0) #endif @@ -561,10 +583,11 @@ */ #define TK_WHOLE_WORDS 1 #define TK_AT_LEAST_ONE 2 #define TK_PARTIAL_OK 4 +#define TK_ISOLATE_END 32 /* * Flags passed to Tk_ComputeTextLayout: */ @@ -754,10 +777,14 @@ (((Tk_FakeWin *) (tkwin))->flags & TK_TOP_HIERARCHY) #define Tk_IsManageable(tkwin) \ (((Tk_FakeWin *) (tkwin))->flags & TK_WM_MANAGEABLE) #define Tk_ReqWidth(tkwin) (((Tk_FakeWin *) (tkwin))->reqWidth) #define Tk_ReqHeight(tkwin) (((Tk_FakeWin *) (tkwin))->reqHeight) +#ifndef TK_NO_DEPRECATED +#define Tk_InternalBorderWidth(tkwin) \ + (((Tk_FakeWin *) (tkwin))->internalBorderLeft) +#endif /* !TK_NO_DEPRECATED */ #define Tk_InternalBorderLeft(tkwin) \ (((Tk_FakeWin *) (tkwin))->internalBorderLeft) #define Tk_InternalBorderRight(tkwin) \ (((Tk_FakeWin *) (tkwin))->internalBorderRight) #define Tk_InternalBorderTop(tkwin) \ @@ -1006,10 +1033,22 @@ /* * Records of the following type are used to describe a type of item (e.g. * lines, circles, etc.) that can form part of a canvas widget. */ +#if defined(USE_OLD_CANVAS) && TCL_MAJOR_VERSION < 9 +typedef int (Tk_ItemCreateProc)(Tcl_Interp *interp, Tk_Canvas canvas, + Tk_Item *itemPtr, Tcl_Size argc, char **argv); +typedef int (Tk_ItemConfigureProc)(Tcl_Interp *interp, Tk_Canvas canvas, + Tk_Item *itemPtr, Tcl_Size argc, char **argv, int flags); +typedef int (Tk_ItemCoordProc)(Tcl_Interp *interp, Tk_Canvas canvas, + Tk_Item *itemPtr, Tcl_Size argc, char **argv); +typedef void (Tk_ItemInsertProc)(Tk_Canvas canvas, Tk_Item *itemPtr, + int beforeThis, char *string); +typedef int (Tk_ItemIndexProc)(Tcl_Interp *interp, Tk_Canvas canvas, + Tk_Item *itemPtr, char *indexString, int *indexPtr); +#else typedef int (Tk_ItemCreateProc)(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, Tcl_Size objc, Tcl_Obj *const objv[]); typedef int (Tk_ItemConfigureProc)(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, Tcl_Size objc, Tcl_Obj *const objv[], int flags); @@ -1017,10 +1056,11 @@ Tk_Item *itemPtr, Tcl_Size objc, Tcl_Obj *const objv[]); typedef void (Tk_ItemInsertProc)(Tk_Canvas canvas, Tk_Item *itemPtr, Tcl_Size beforeThis, Tcl_Obj *string); typedef int (Tk_ItemIndexProc)(Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, Tcl_Obj *indexString, Tcl_Size *indexPtr); +#endif /* USE_OLD_CANVAS */ typedef void (Tk_ItemDeleteProc)(Tk_Canvas canvas, Tk_Item *itemPtr, Display *display); typedef void (Tk_ItemDisplayProc)(Tk_Canvas canvas, Tk_Item *itemPtr, Display *display, Drawable dst, int x, int y, int width, int height); @@ -1065,11 +1105,13 @@ Tk_ItemDeleteProc *deleteProc; /* Procedure to delete existing item of this * type. */ Tk_ItemDisplayProc *displayProc; /* Procedure to display items of this type. */ - int flags; /* Combination of TK_ALWAYS_REDRAW/TK_MOVABLE_POINTS */ + int alwaysRedraw; /* Non-zero means displayProc should be called + * even when the item has been moved + * off-screen. */ Tk_ItemPointProc *pointProc;/* Computes distance from item to a given * point. */ Tk_ItemAreaProc *areaProc; /* Computes whether item is inside, outside, * or overlapping an area. */ Tk_ItemPostscriptProc *postscriptProc; @@ -1102,11 +1144,12 @@ char *reserved3; /* Jan Nijtmans dash patch */ char *reserved4; } Tk_ItemType; /* - * Possible flags for 'flags' field. + * Flag (used in the alwaysRedraw field) to say whether an item supports + * point-level manipulation like the line and polygon items. */ #define TK_ALWAYS_REDRAW 1 /* item should be redrawn always*/ #define TK_MOVABLE_POINTS 2 /* item supports point-level manipulation */ @@ -1152,15 +1195,10 @@ int gotFocus; /* Non-zero means that the canvas widget has * the input focus. Read-only to items.*/ int cursorOn; /* Non-zero means that an insertion cursor * should be displayed in focusItemPtr. * Read-only to items.*/ -#if TK_MAJOR_VERSION > 8 - void *reserved1; /* reserved for future use */ - void *reserved2; - void *reserved3; -#endif } Tk_CanvasTextInfo; /* * Structures used for Dashing and Outline. */ @@ -1222,13 +1260,19 @@ * *---------------------------------------------------------------------- */ typedef struct Tk_ImageType Tk_ImageType; +#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 && defined(USE_OLD_IMAGE) +typedef int (Tk_ImageCreateProc) (Tcl_Interp *interp, char *name, Tcl_Size argc, + char **argv, Tk_ImageType *typePtr, Tk_ImageModel model, + void **clientDataPtr); +#else typedef int (Tk_ImageCreateProc) (Tcl_Interp *interp, const char *name, Tcl_Size objc, Tcl_Obj *const objv[], const Tk_ImageType *typePtr, Tk_ImageModel model, void **clientDataPtr); +#endif /* USE_OLD_IMAGE */ typedef void *(Tk_ImageGetProc) (Tk_Window tkwin, void *clientData); typedef void (Tk_ImageDisplayProc) (void *clientData, Display *display, Drawable drawable, int imageX, int imageY, int width, int height, int drawableX, int drawableY); typedef void (Tk_ImageFreeProc) (void *clientData, Display *display); @@ -1319,10 +1363,26 @@ * Procedure prototypes and structures used in reading and writing photo * images: */ typedef struct Tk_PhotoImageFormat Tk_PhotoImageFormat; +#ifdef USE_OLD_IMAGE +typedef int (Tk_ImageFileMatchProc) (Tcl_Channel chan, char *fileName, + char *formatString, int *widthPtr, int *heightPtr); +typedef int (Tk_ImageStringMatchProc) (char *string, char *formatString, + int *widthPtr, int *heightPtr); +typedef int (Tk_ImageFileReadProc) (Tcl_Interp *interp, Tcl_Channel chan, + char *fileName, char *formatString, Tk_PhotoHandle imageHandle, + int destX, int destY, int width, int height, int srcX, int srcY); +typedef int (Tk_ImageStringReadProc) (Tcl_Interp *interp, char *string, + char *formatString, Tk_PhotoHandle imageHandle, int destX, int destY, + int width, int height, int srcX, int srcY); +typedef int (Tk_ImageFileWriteProc) (Tcl_Interp *interp, char *fileName, + char *formatString, Tk_PhotoImageBlock *blockPtr); +typedef int (Tk_ImageStringWriteProc) (Tcl_Interp *interp, + Tcl_DString *dataPtr, char *formatString, Tk_PhotoImageBlock *blockPtr); +#else typedef int (Tk_ImageFileMatchProc) (Tcl_Channel chan, const char *fileName, Tcl_Obj *format, int *widthPtr, int *heightPtr, Tcl_Interp *interp); typedef int (Tk_ImageStringMatchProc) (Tcl_Obj *dataObj, Tcl_Obj *format, int *widthPtr, int *heightPtr, Tcl_Interp *interp); typedef int (Tk_ImageFileReadProc) (Tcl_Interp *interp, Tcl_Channel chan, @@ -1333,10 +1393,11 @@ int width, int height, int srcX, int srcY); typedef int (Tk_ImageFileWriteProc) (Tcl_Interp *interp, const char *fileName, Tcl_Obj *format, Tk_PhotoImageBlock *blockPtr); typedef int (Tk_ImageStringWriteProc) (Tcl_Interp *interp, Tcl_Obj *format, Tk_PhotoImageBlock *blockPtr); +#endif /* USE_OLD_IMAGE */ /* * The following alternate definitions are used with the Tk8.7 file format * supporting a metadata dict, internal dstring and close file flag */ @@ -1505,10 +1566,50 @@ * The definitions below provide backward compatibility for functions and * types that used to be in Tk but have moved to Tcl. * *---------------------------------------------------------------------- */ + +#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 +#define TK_READABLE TCL_READABLE +#define TK_WRITABLE TCL_WRITABLE +#define TK_EXCEPTION TCL_EXCEPTION + +#define TK_DONT_WAIT TCL_DONT_WAIT +#define TK_X_EVENTS TCL_WINDOW_EVENTS +#define TK_WINDOW_EVENTS TCL_WINDOW_EVENTS +#define TK_FILE_EVENTS TCL_FILE_EVENTS +#define TK_TIMER_EVENTS TCL_TIMER_EVENTS +#define TK_IDLE_EVENTS TCL_IDLE_EVENTS +#define TK_ALL_EVENTS TCL_ALL_EVENTS + +#define Tk_IdleProc Tcl_IdleProc +#define Tk_FileProc Tcl_FileProc +#define Tk_TimerProc Tcl_TimerProc +#define Tk_TimerToken Tcl_TimerToken + +#define Tk_BackgroundError Tcl_BackgroundError +#define Tk_CancelIdleCall Tcl_CancelIdleCall +#define Tk_CreateFileHandler Tcl_CreateFileHandler +#define Tk_CreateTimerHandler Tcl_CreateTimerHandler +#define Tk_DeleteFileHandler Tcl_DeleteFileHandler +#define Tk_DeleteTimerHandler Tcl_DeleteTimerHandler +#define Tk_DoOneEvent Tcl_DoOneEvent +#define Tk_DoWhenIdle Tcl_DoWhenIdle +#define Tk_Sleep Tcl_Sleep + +/* Additional stuff that has moved to Tcl: */ + +#define Tk_EventuallyFree Tcl_EventuallyFree +#define Tk_FreeProc Tcl_FreeProc +#define Tk_Preserve Tcl_Preserve +#define Tk_Release Tcl_Release + +/* Related to USE_OLD_IMAGE: */ + +#define Tk_InitImageArgs(interp, argc, argv) /**/ +#endif /* Removed Tk_Main, use macro instead */ #if defined(_WIN32) || defined(__CYGWIN__) #define Tk_Main(argc, argv, proc) Tk_MainEx(argc, argv, proc, \ (Tcl_FindExecutable(0), (Tcl_CreateInterp)())) @@ -1554,10 +1655,62 @@ *---------------------------------------------------------------------- */ #include "tkDecls.h" +#ifdef USE_OLD_IMAGE +#undef Tk_CreateImageType +#define Tk_CreateImageType Tk_CreateOldImageType +#undef Tk_CreatePhotoImageFormat +#define Tk_CreatePhotoImageFormat Tk_CreateOldPhotoImageFormat +#endif /* USE_OLD_IMAGE */ + +/* + *---------------------------------------------------------------------- + * + * Allow users to say that they don't want to alter their source to add extra + * arguments to Tk_PhotoPutBlock() et al. + * + * This goes after the inclusion of the stubbed-decls so that the declarations + * of what is actually there can be correct. + */ + +#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 +#ifdef USE_COMPOSITELESS_PHOTO_PUT_BLOCK +# ifdef Tk_PhotoPutBlock +# undef Tk_PhotoPutBlock +# endif +# define Tk_PhotoPutBlock Tk_PhotoPutBlock_NoComposite +# ifdef Tk_PhotoPutZoomedBlock +# undef Tk_PhotoPutZoomedBlock +# endif +# define Tk_PhotoPutZoomedBlock Tk_PhotoPutZoomedBlock_NoComposite +# define USE_PANIC_ON_PHOTO_ALLOC_FAILURE +#else /* !USE_COMPOSITELESS_PHOTO_PUT_BLOCK */ +# ifdef USE_PANIC_ON_PHOTO_ALLOC_FAILURE +# ifdef Tk_PhotoPutBlock +# undef Tk_PhotoPutBlock +# endif +# define Tk_PhotoPutBlock Tk_PhotoPutBlock_Panic +# ifdef Tk_PhotoPutZoomedBlock +# undef Tk_PhotoPutZoomedBlock +# endif +# define Tk_PhotoPutZoomedBlock Tk_PhotoPutZoomedBlock_Panic +# endif /* USE_PANIC_ON_PHOTO_ALLOC_FAILURE */ +#endif /* USE_COMPOSITELESS_PHOTO_PUT_BLOCK */ +#ifdef USE_PANIC_ON_PHOTO_ALLOC_FAILURE +# ifdef Tk_PhotoExpand +# undef Tk_PhotoExpand +# endif +# define Tk_PhotoExpand Tk_PhotoExpand_Panic +# ifdef Tk_PhotoSetSize +# undef Tk_PhotoSetSize +# endif +# define Tk_PhotoSetSize Tk_PhotoSetSize_Panic +#endif /* USE_PANIC_ON_PHOTO_ALLOC_FAILURE */ +#endif /* !TK_NO_DEPRECATED */ + #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT #endif /* RC_INVOKED */ Index: generic/tk3d.c ================================================================== --- generic/tk3d.c +++ generic/tk3d.c @@ -182,11 +182,11 @@ Tk_3DBorder Tk_Get3DBorder( Tcl_Interp *interp, /* Place to store an error message. */ Tk_Window tkwin, /* Token for window in which border will be * drawn. */ - const char *colorName) /* String giving name of color for window + const char *colorName) /* String giving name of color for window * background. */ { Tcl_HashEntry *hashPtr; TkBorder *borderPtr, *existingBorderPtr; int isNew; Index: generic/tkBind.c ================================================================== --- generic/tkBind.c +++ generic/tkBind.c @@ -47,32 +47,10 @@ * Package-specific common helpers. * * Non-package-specific helpers. */ -/* - * In old implementation (the one that used an event ring), and <1><1> were - * equivalent sequences. However it is logical to give higher precedence - * since it is more specific. Indeed includes time and space requirements, - * which is not the case for <1><1>. - * This is achieved by setting PREFER_MOST_SPECIALIZED_EVENT to 1. - */ - -#ifndef PREFER_MOST_SPECIALIZED_EVENT -# define PREFER_MOST_SPECIALIZED_EVENT 1 -#endif - -/* - * Traditionally motion events can be combined with buttons in this way: . - * However it should be allowed to express this as in addition. This is achieved - * by setting SUPPORT_ADDITIONAL_MOTION_SYNTAX to 1. - */ - -#ifndef SUPPORT_ADDITIONAL_MOTION_SYNTAX -# define SUPPORT_ADDITIONAL_MOTION_SYNTAX 1 -#endif - /* * The output for motion events is of the type . This can be changed to become * instead by setting PRINT_SHORT_MOTION_SYNTAX to 1, however this would be a * backwards incompatibility. */ @@ -79,15 +57,10 @@ #ifndef PRINT_SHORT_MOTION_SYNTAX # define PRINT_SHORT_MOTION_SYNTAX 0 /* set to 1 if wanted */ #endif -#if !SUPPORT_ADDITIONAL_MOTION_SYNTAX -# undef PRINT_SHORT_MOTION_SYNTAX -# define PRINT_SHORT_MOTION_SYNTAX 0 -#endif - /* * For debugging only, normally set to zero. */ #ifdef SUPPORT_DEBUGGING @@ -2129,17 +2102,16 @@ diff = CountSpecialized(fstMatchPtr, sndMatchPtr); if (diff > 0) { return 1; } if (diff < 0) { return 0; } -#if PREFER_MOST_SPECIALIZED_EVENT { /* local scope */ -#define M (Tcl_WideUInt)1000000 - static const Tcl_WideUInt weight[5] = { 0, 1, M, M*M, M*M*M }; +#define M 1000000ULL + static const unsigned long long weight[5] = { 0, 1, M, M*M, M*M*M }; #undef M - Tcl_WideUInt fstCount = 0; - Tcl_WideUInt sndCount = 0; + unsigned long long fstCount = 0; + unsigned long long sndCount = 0; unsigned i; /* * Count the most high-ordered patterns. * @@ -2157,11 +2129,10 @@ sndCount += weight[GetCount(sndMatchPtr, i)]; } if (sndCount > fstCount) { return 1; } if (sndCount < fstCount) { return 0; } } -#endif return sndMatchPtr->number > fstMatchPtr->number; } void @@ -3027,11 +2998,11 @@ */ for (string = before; *string && *string != '%'; ++string) ; if (string != before) { - Tcl_DStringAppend(dsPtr, before, (Tcl_Size)(string - before)); + Tcl_DStringAppend(dsPtr, before, string - before); before = string; } if (!*before) { break; } @@ -5003,10 +4974,11 @@ } eventFlags = 0; if ((hPtr = Tcl_FindHashEntry(&eventTable, field))) { const EventInfo *eiPtr = (const EventInfo *)Tcl_GetHashValue(hPtr); + patPtr->eventType = eiPtr->type; eventFlags = flagArray[eiPtr->type]; eventMask = eiPtr->eventMask; p = GetField(SkipFieldDelims(p), field, sizeof(field)); } @@ -5013,11 +4985,11 @@ if (*field) { unsigned button = GetButtonNumber(field); if ((eventFlags & BUTTON) || (button && eventFlags == 0) - || (SUPPORT_ADDITIONAL_MOTION_SYNTAX && (eventFlags & MOTION) && button == 0)) { + || ((eventFlags & MOTION) && button == 0)) { /* This must be a button (or bad motion) event. */ if (button == 0) { return FinalizeParseEventDescription( interp, patPtr, 0, @@ -5040,18 +5012,17 @@ if (!(eventFlags & KEY)) { patPtr->eventType = KeyPress; eventMask = KeyPressMask; } } else if (button) { - if (!SUPPORT_ADDITIONAL_MOTION_SYNTAX || patPtr->eventType != MotionNotify) { + if (patPtr->eventType != MotionNotify) { return FinalizeParseEventDescription( interp, patPtr, 0, Tcl_ObjPrintf("specified button \"%s\" for non-button event", field), "NON_BUTTON"); } -#if SUPPORT_ADDITIONAL_MOTION_SYNTAX patPtr->modMask |= Tk_GetButtonMask(button); p = SkipFieldDelims(p); while (*p && *p != '>') { p = SkipFieldDelims(GetField(p, field, sizeof(field))); if ((button = GetButtonNumber(field)) == 0) { @@ -5061,11 +5032,10 @@ Tcl_ObjPrintf("bad button number \"%s\"", field), "BUTTON"); } patPtr->modMask |= Tk_GetButtonMask(button); } patPtr->info = ButtonNumberFromState(patPtr->modMask); -#endif } else { return FinalizeParseEventDescription( interp, patPtr, 0, Tcl_ObjPrintf("specified keysym \"%s\" for non-key event", field), @@ -5207,11 +5177,11 @@ } modMask = patPtr->modMask; #if PRINT_SHORT_MOTION_SYNTAX if (patPtr->eventType == MotionNotify) { - modMask &= ~(ModMask)ALL_BUTTONS; + modMask &= ~(unsigned)ALL_BUTTONS; } #endif for (modPtr = modArray; modMask; ++modPtr) { if (modPtr->mask & modMask) { @@ -5285,11 +5255,11 @@ #ifdef REDO_KEYSYM_LOOKUP Tcl_HashEntry *hPtr; #endif /* REDO_KEYSYM_LOOKUP */ int keysym; - size_t len = Tcl_UtfToUniChar(name, &keysym); + size_t len = TkUtfToUniChar(name, &keysym); if (name[len] == '\0') { if (!Tcl_UniCharIsPrint(keysym)) { /* This form not supported */ } else if ((unsigned)(keysym - 0x21) <= 0x5D) { return (KeySym)keysym; @@ -5369,11 +5339,11 @@ } if ((keysym >= 0x1000020) && (keysym <= 0x110FFFF) && ((unsigned)(keysym - 0x100007F) > 0x20)) { char buf[10]; if (Tcl_UniCharIsPrint(keysym-0x1000000)) { - buf[Tcl_UniCharToUtf(keysym - 0x1000000, buf)] = '\0'; + buf[TkUniCharToUtf(keysym - 0x1000000, buf)] = '\0'; } else if (keysym >= 0x1010000) { snprintf(buf, sizeof(buf), "U%08X", (int)(keysym - 0x1000000)); } else { snprintf(buf, sizeof(buf), "U%04X", (int)(keysym - 0x1000000)); } Index: generic/tkButton.c ================================================================== --- generic/tkButton.c +++ generic/tkButton.c @@ -77,12 +77,12 @@ NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap", DEF_BUTTON_BITMAP, TCL_INDEX_NONE, offsetof(TkButton, bitmap), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - tkDefButtonBorderWidth, offsetof(TkButton, borderWidthObj), - TCL_INDEX_NONE, 0, 0, 0}, + tkDefButtonBorderWidth, offsetof(TkButton, borderWidthPtr), + offsetof(TkButton, borderWidth), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", DEF_BUTTON_COMPOUND, TCL_INDEX_NONE, offsetof(TkButton, compound), 0, tkCompoundStrings, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", DEF_BUTTON_CURSOR, TCL_INDEX_NONE, offsetof(TkButton, cursor), @@ -96,33 +96,33 @@ {TK_OPTION_FONT, "-font", "font", "Font", DEF_BUTTON_FONT, TCL_INDEX_NONE, offsetof(TkButton, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", DEF_LABEL_FG, TCL_INDEX_NONE, offsetof(TkButton, normalFg), 0, 0, 0}, {TK_OPTION_STRING, "-height", "height", "Height", - DEF_BUTTON_HEIGHT, offsetof(TkButton, heightObj), TCL_INDEX_NONE, 0, 0, 0}, + DEF_BUTTON_HEIGHT, offsetof(TkButton, heightPtr), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_BORDER, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_BUTTON_HIGHLIGHT_BG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, highlightBorder), 0, DEF_BUTTON_HIGHLIGHT_BG_MONO, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", DEF_BUTTON_HIGHLIGHT, TCL_INDEX_NONE, offsetof(TkButton, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", tkDefLabelHighlightWidth, - offsetof(TkButton, highlightWidthObj), - TCL_INDEX_NONE, 0, 0, 0}, + offsetof(TkButton, highlightWidthPtr), + offsetof(TkButton, highlightWidth), 0, 0, 0}, {TK_OPTION_STRING, "-image", "image", "Image", DEF_BUTTON_IMAGE, offsetof(TkButton, imagePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", DEF_BUTTON_JUSTIFY, TCL_INDEX_NONE, offsetof(TkButton, justify), TK_OPTION_ENUM_VAR, 0, 0}, {TK_OPTION_PIXELS, "-padx", "padX", "Pad", - tkDefLabelPadx, offsetof(TkButton, padXObj), - TCL_INDEX_NONE, 0, 0, 0}, + tkDefLabelPadx, offsetof(TkButton, padXPtr), + offsetof(TkButton, padX), 0, 0, 0}, {TK_OPTION_PIXELS, "-pady", "padY", "Pad", - tkDefLabelPady, offsetof(TkButton, padYObj), - TCL_INDEX_NONE, 0, 0, 0}, + tkDefLabelPady, offsetof(TkButton, padYPtr), + offsetof(TkButton, padY), 0, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", DEF_LABCHKRAD_RELIEF, TCL_INDEX_NONE, offsetof(TkButton, relief), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", DEF_BUTTON_STATE, TCL_INDEX_NONE, offsetof(TkButton, state), TK_OPTION_ENUM_VAR, tkStateStrings, 0}, @@ -135,14 +135,14 @@ DEF_BUTTON_TEXT_VARIABLE, offsetof(TkButton, textVarNamePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_INDEX, "-underline", "underline", "Underline", TK_OPTION_UNDERLINE_DEF(TkButton, underline), 0}, {TK_OPTION_STRING, "-width", "width", "Width", - DEF_BUTTON_WIDTH, offsetof(TkButton, widthObj), TCL_INDEX_NONE, 0, 0, 0}, + DEF_BUTTON_WIDTH, offsetof(TkButton, widthPtr), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength", - DEF_BUTTON_WRAP_LENGTH, offsetof(TkButton, wrapLengthObj), - TCL_INDEX_NONE, 0, 0, 0}, + DEF_BUTTON_WRAP_LENGTH, offsetof(TkButton, wrapLengthPtr), + offsetof(TkButton, wrapLength), 0, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; static const Tk_OptionSpec buttonOptionSpecs[] = { {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground", @@ -162,12 +162,12 @@ NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap", DEF_BUTTON_BITMAP, TCL_INDEX_NONE, offsetof(TkButton, bitmap), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - tkDefButtonBorderWidth, offsetof(TkButton, borderWidthObj), - TCL_INDEX_NONE, 0, 0, 0}, + tkDefButtonBorderWidth, offsetof(TkButton, borderWidthPtr), + offsetof(TkButton, borderWidth), 0, 0, 0}, {TK_OPTION_STRING, "-command", "command", "Command", DEF_BUTTON_COMMAND, offsetof(TkButton, commandPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", DEF_BUTTON_COMPOUND, TCL_INDEX_NONE, offsetof(TkButton, compound), @@ -187,36 +187,36 @@ {TK_OPTION_FONT, "-font", "font", "Font", DEF_BUTTON_FONT, TCL_INDEX_NONE, offsetof(TkButton, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", DEF_BUTTON_FG, TCL_INDEX_NONE, offsetof(TkButton, normalFg), 0, 0, 0}, {TK_OPTION_STRING, "-height", "height", "Height", - DEF_BUTTON_HEIGHT, offsetof(TkButton, heightObj), TCL_INDEX_NONE, 0, 0, 0}, + DEF_BUTTON_HEIGHT, offsetof(TkButton, heightPtr), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_BORDER, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_BUTTON_HIGHLIGHT_BG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, highlightBorder), 0, DEF_BUTTON_HIGHLIGHT_BG_MONO, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", DEF_BUTTON_HIGHLIGHT, TCL_INDEX_NONE, offsetof(TkButton, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", tkDefButtonHighlightWidth, - offsetof(TkButton, highlightWidthObj), - TCL_INDEX_NONE, 0, 0, 0}, + offsetof(TkButton, highlightWidthPtr), + offsetof(TkButton, highlightWidth), 0, 0, 0}, {TK_OPTION_STRING, "-image", "image", "Image", DEF_BUTTON_IMAGE, offsetof(TkButton, imagePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", DEF_BUTTON_JUSTIFY, TCL_INDEX_NONE, offsetof(TkButton, justify), TK_OPTION_ENUM_VAR, 0, 0}, {TK_OPTION_RELIEF, "-overrelief", "overRelief", "OverRelief", DEF_BUTTON_OVER_RELIEF, TCL_INDEX_NONE, offsetof(TkButton, overRelief), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-padx", "padX", "Pad", - tkDefButtonPadx, offsetof(TkButton, padXObj), - TCL_INDEX_NONE, 0, 0, 0}, + tkDefButtonPadx, offsetof(TkButton, padXPtr), + offsetof(TkButton, padX), 0, 0, 0}, {TK_OPTION_PIXELS, "-pady", "padY", "Pad", - tkDefButtonPady, offsetof(TkButton, padYObj), - TCL_INDEX_NONE, 0, 0, 0}, + tkDefButtonPady, offsetof(TkButton, padYPtr), + offsetof(TkButton, padY), 0, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", DEF_BUTTON_RELIEF, TCL_INDEX_NONE, offsetof(TkButton, relief), 0, 0, 0}, {TK_OPTION_INT, "-repeatdelay", "repeatDelay", "RepeatDelay", DEF_BUTTON_REPEAT_DELAY, TCL_INDEX_NONE, offsetof(TkButton, repeatDelay), @@ -236,14 +236,14 @@ DEF_BUTTON_TEXT_VARIABLE, offsetof(TkButton, textVarNamePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_INDEX, "-underline", "underline", "Underline", TK_OPTION_UNDERLINE_DEF(TkButton, underline), 0}, {TK_OPTION_STRING, "-width", "width", "Width", - DEF_BUTTON_WIDTH, offsetof(TkButton, widthObj), TCL_INDEX_NONE, 0, 0, 0}, + DEF_BUTTON_WIDTH, offsetof(TkButton, widthPtr), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength", - DEF_BUTTON_WRAP_LENGTH, offsetof(TkButton, wrapLengthObj), - TCL_INDEX_NONE, 0, 0, 0}, + DEF_BUTTON_WRAP_LENGTH, offsetof(TkButton, wrapLengthPtr), + offsetof(TkButton, wrapLength), 0, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, 0, 0} }; static const Tk_OptionSpec checkbuttonOptionSpecs[] = { {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground", @@ -263,12 +263,12 @@ NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap", DEF_BUTTON_BITMAP, TCL_INDEX_NONE, offsetof(TkButton, bitmap), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - tkDefButtonBorderWidth, offsetof(TkButton, borderWidthObj), - TCL_INDEX_NONE, 0, 0, 0}, + tkDefButtonBorderWidth, offsetof(TkButton, borderWidthPtr), + offsetof(TkButton, borderWidth), 0, 0, 0}, {TK_OPTION_STRING, "-command", "command", "Command", DEF_BUTTON_COMMAND, offsetof(TkButton, commandPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", DEF_BUTTON_COMPOUND, TCL_INDEX_NONE, offsetof(TkButton, compound), @@ -285,22 +285,22 @@ {TK_OPTION_FONT, "-font", "font", "Font", DEF_BUTTON_FONT, TCL_INDEX_NONE, offsetof(TkButton, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", DEF_CHKRAD_FG, TCL_INDEX_NONE, offsetof(TkButton, normalFg), 0, 0, 0}, {TK_OPTION_STRING, "-height", "height", "Height", - DEF_BUTTON_HEIGHT, offsetof(TkButton, heightObj), TCL_INDEX_NONE, 0, 0, 0}, + DEF_BUTTON_HEIGHT, offsetof(TkButton, heightPtr), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_BORDER, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_BUTTON_HIGHLIGHT_BG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, highlightBorder), 0, DEF_BUTTON_HIGHLIGHT_BG_MONO, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", DEF_BUTTON_HIGHLIGHT, TCL_INDEX_NONE, offsetof(TkButton, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", tkDefButtonHighlightWidth, - offsetof(TkButton, highlightWidthObj), - TCL_INDEX_NONE, 0, 0, 0}, + offsetof(TkButton, highlightWidthPtr), + offsetof(TkButton, highlightWidth), 0, 0, 0}, {TK_OPTION_STRING, "-image", "image", "Image", DEF_BUTTON_IMAGE, offsetof(TkButton, imagePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-indicatoron", "indicatorOn", "IndicatorOn", DEF_BUTTON_INDICATOR, TCL_INDEX_NONE, offsetof(TkButton, indicatorOn), 0, 0, 0}, @@ -314,15 +314,15 @@ DEF_BUTTON_ON_VALUE, offsetof(TkButton, onValuePtr), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_RELIEF, "-overrelief", "overRelief", "OverRelief", DEF_BUTTON_OVER_RELIEF, TCL_INDEX_NONE, offsetof(TkButton, overRelief), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-padx", "padX", "Pad", - tkDefLabelPadx, offsetof(TkButton, padXObj), - TCL_INDEX_NONE, 0, 0, 0}, + tkDefLabelPadx, offsetof(TkButton, padXPtr), + offsetof(TkButton, padX), 0, 0, 0}, {TK_OPTION_PIXELS, "-pady", "padY", "Pad", - tkDefLabelPady, offsetof(TkButton, padYObj), - TCL_INDEX_NONE, 0, 0, 0}, + tkDefLabelPady, offsetof(TkButton, padYPtr), + offsetof(TkButton, padY), 0, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", DEF_LABCHKRAD_RELIEF, TCL_INDEX_NONE, offsetof(TkButton, relief), 0, 0, 0}, {TK_OPTION_BORDER, "-selectcolor", "selectColor", "Background", DEF_BUTTON_SELECT_COLOR, TCL_INDEX_NONE, offsetof(TkButton, selectBorder), TK_OPTION_NULL_OK, DEF_BUTTON_SELECT_MONO, 0}, @@ -349,14 +349,14 @@ TK_OPTION_UNDERLINE_DEF(TkButton, underline), 0}, {TK_OPTION_STRING, "-variable", "variable", "Variable", DEF_CHECKBUTTON_VARIABLE, offsetof(TkButton, selVarNamePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-width", "width", "Width", - DEF_BUTTON_WIDTH, offsetof(TkButton, widthObj), TCL_INDEX_NONE, 0, 0, 0}, + DEF_BUTTON_WIDTH, offsetof(TkButton, widthPtr), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength", - DEF_BUTTON_WRAP_LENGTH, offsetof(TkButton, wrapLengthObj), - TCL_INDEX_NONE, 0, 0, 0}, + DEF_BUTTON_WRAP_LENGTH, offsetof(TkButton, wrapLengthPtr), + offsetof(TkButton, wrapLength), 0, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, 0, 0} }; static const Tk_OptionSpec radiobuttonOptionSpecs[] = { {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground", @@ -376,12 +376,12 @@ NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap", DEF_BUTTON_BITMAP, TCL_INDEX_NONE, offsetof(TkButton, bitmap), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - tkDefButtonBorderWidth, offsetof(TkButton, borderWidthObj), - TCL_INDEX_NONE, 0, 0, 0}, + tkDefButtonBorderWidth, offsetof(TkButton, borderWidthPtr), + offsetof(TkButton, borderWidth), 0, 0, 0}, {TK_OPTION_STRING, "-command", "command", "Command", DEF_BUTTON_COMMAND, offsetof(TkButton, commandPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", DEF_BUTTON_COMPOUND, TCL_INDEX_NONE, offsetof(TkButton, compound), @@ -398,22 +398,22 @@ {TK_OPTION_FONT, "-font", "font", "Font", DEF_BUTTON_FONT, TCL_INDEX_NONE, offsetof(TkButton, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", DEF_CHKRAD_FG, TCL_INDEX_NONE, offsetof(TkButton, normalFg), 0, 0, 0}, {TK_OPTION_STRING, "-height", "height", "Height", - DEF_BUTTON_HEIGHT, offsetof(TkButton, heightObj), TCL_INDEX_NONE, 0, 0, 0}, + DEF_BUTTON_HEIGHT, offsetof(TkButton, heightPtr), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_BORDER, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_BUTTON_HIGHLIGHT_BG_COLOR, TCL_INDEX_NONE, offsetof(TkButton, highlightBorder), 0, DEF_BUTTON_HIGHLIGHT_BG_MONO, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", DEF_BUTTON_HIGHLIGHT, TCL_INDEX_NONE, offsetof(TkButton, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", tkDefButtonHighlightWidth, - offsetof(TkButton, highlightWidthObj), - TCL_INDEX_NONE, 0, 0, 0}, + offsetof(TkButton, highlightWidthPtr), + offsetof(TkButton, highlightWidth), 0, 0, 0}, {TK_OPTION_STRING, "-image", "image", "Image", DEF_BUTTON_IMAGE, offsetof(TkButton, imagePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-indicatoron", "indicatorOn", "IndicatorOn", DEF_BUTTON_INDICATOR, TCL_INDEX_NONE, offsetof(TkButton, indicatorOn), @@ -424,15 +424,15 @@ DEF_BUTTON_RELIEF, TCL_INDEX_NONE, offsetof(TkButton, offRelief), 0, 0, 0}, {TK_OPTION_RELIEF, "-overrelief", "overRelief", "OverRelief", DEF_BUTTON_OVER_RELIEF, TCL_INDEX_NONE, offsetof(TkButton, overRelief), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-padx", "padX", "Pad", - tkDefLabelPadx, offsetof(TkButton, padXObj), - TCL_INDEX_NONE, 0, 0, 0}, + tkDefLabelPadx, offsetof(TkButton, padXPtr), + offsetof(TkButton, padX), 0, 0, 0}, {TK_OPTION_PIXELS, "-pady", "padY", "Pad", - tkDefLabelPady, offsetof(TkButton, padYObj), - TCL_INDEX_NONE, 0, 0, 0}, + tkDefLabelPady, offsetof(TkButton, padYPtr), + offsetof(TkButton, padY), 0, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", DEF_LABCHKRAD_RELIEF, TCL_INDEX_NONE, offsetof(TkButton, relief), 0, 0, 0}, {TK_OPTION_BORDER, "-selectcolor", "selectColor", "Background", DEF_BUTTON_SELECT_COLOR, TCL_INDEX_NONE, offsetof(TkButton, selectBorder), TK_OPTION_NULL_OK, DEF_BUTTON_SELECT_MONO, 0}, @@ -461,14 +461,14 @@ DEF_BUTTON_VALUE, offsetof(TkButton, onValuePtr), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_STRING, "-variable", "variable", "Variable", DEF_RADIOBUTTON_VARIABLE, offsetof(TkButton, selVarNamePtr), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_STRING, "-width", "width", "Width", - DEF_BUTTON_WIDTH, offsetof(TkButton, widthObj), TCL_INDEX_NONE, 0, 0, 0}, + DEF_BUTTON_WIDTH, offsetof(TkButton, widthPtr), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength", - DEF_BUTTON_WRAP_LENGTH, offsetof(TkButton, wrapLengthObj), - TCL_INDEX_NONE, 0, 0, 0}, + DEF_BUTTON_WRAP_LENGTH, offsetof(TkButton, wrapLengthPtr), + offsetof(TkButton, wrapLength), 0, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, 0, 0} }; /* * The following table maps from one of the type values defined in tkButton.h, @@ -685,13 +685,15 @@ butPtr->tristateImagePtr = NULL; butPtr->tristateImage = NULL; butPtr->state = STATE_NORMAL; butPtr->normalBorder = NULL; butPtr->activeBorder = NULL; - butPtr->borderWidthObj = NULL; + butPtr->borderWidthPtr = NULL; + butPtr->borderWidth = 0; butPtr->relief = TK_RELIEF_FLAT; - butPtr->highlightWidthObj = NULL; + butPtr->highlightWidthPtr = NULL; + butPtr->highlightWidth = 0; butPtr->highlightBorder = NULL; butPtr->highlightColorPtr = NULL; butPtr->inset = 0; butPtr->tkfont = NULL; butPtr->normalFg = NULL; @@ -701,15 +703,20 @@ butPtr->activeTextGC = NULL; butPtr->disabledGC = NULL; butPtr->stippleGC = NULL; butPtr->gray = None; butPtr->copyGC = NULL; - butPtr->widthObj = NULL; - butPtr->heightObj = NULL; - butPtr->wrapLengthObj = NULL; - butPtr->padXObj = NULL; - butPtr->padYObj = NULL; + butPtr->widthPtr = NULL; + butPtr->width = 0; + butPtr->heightPtr = NULL; + butPtr->height = 0; + butPtr->wrapLengthPtr = NULL; + butPtr->wrapLength = 0; + butPtr->padXPtr = NULL; + butPtr->padX = 0; + butPtr->padYPtr = NULL; + butPtr->padY = 0; butPtr->anchor = TK_ANCHOR_CENTER; butPtr->justify = TK_JUSTIFY_CENTER; butPtr->indicatorOn = 0; butPtr->selectBorder = NULL; butPtr->textWidth = 0; @@ -1025,12 +1032,10 @@ { Tk_SavedOptions savedOptions; Tcl_Obj *errorResult = NULL; int error, haveImage; Tk_Image image; - int wrapLength, borderWidth, highlightWidth, padX, padY; - int butPtrWidth, butPtrHeight; /* * Eliminate any existing trace on variables monitored by the button. */ @@ -1090,44 +1095,39 @@ && !Tk_StrictMotif(butPtr->tkwin)) { Tk_SetBackgroundFromBorder(butPtr->tkwin, butPtr->activeBorder); } else { Tk_SetBackgroundFromBorder(butPtr->tkwin, butPtr->normalBorder); } - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->wrapLengthObj, &wrapLength); - if (wrapLength < 0) { - wrapLength = 0; - Tcl_DecrRefCount(butPtr->wrapLengthObj); - butPtr->wrapLengthObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(butPtr->wrapLengthObj); - } - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->borderWidthObj, &borderWidth); - if (borderWidth < 0) { - borderWidth = 0; - Tcl_DecrRefCount(butPtr->borderWidthObj); - butPtr->borderWidthObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(butPtr->borderWidthObj); - } - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->highlightWidthObj, &highlightWidth); - if (highlightWidth < 0) { - highlightWidth = 0; - Tcl_DecrRefCount(butPtr->highlightWidthObj); - butPtr->highlightWidthObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(butPtr->highlightWidthObj); - } - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padXObj, &padX); - if (padX < 0) { - padX = 0; - Tcl_DecrRefCount(butPtr->padXObj); - butPtr->padXObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(butPtr->padXObj); - } - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padYObj, &padY); - if (padY < 0) { - padY = 0; - Tcl_DecrRefCount(butPtr->padYObj); - butPtr->padYObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(butPtr->padYObj); + if (butPtr->wrapLength < 0) { + butPtr->wrapLength = 0; + Tcl_DecrRefCount(butPtr->wrapLengthPtr); + butPtr->wrapLengthPtr = Tcl_NewIntObj(0); + Tcl_IncrRefCount(butPtr->wrapLengthPtr); + } + if (butPtr->borderWidth < 0) { + butPtr->borderWidth = 0; + Tcl_DecrRefCount(butPtr->borderWidthPtr); + butPtr->borderWidthPtr = Tcl_NewIntObj(0); + Tcl_IncrRefCount(butPtr->borderWidthPtr); + } + if (butPtr->highlightWidth < 0) { + butPtr->highlightWidth = 0; + Tcl_DecrRefCount(butPtr->highlightWidthPtr); + butPtr->highlightWidthPtr = Tcl_NewIntObj(0); + Tcl_IncrRefCount(butPtr->highlightWidthPtr); + } + if (butPtr->padX < 0) { + butPtr->padX = 0; + Tcl_DecrRefCount(butPtr->padXPtr); + butPtr->padXPtr = Tcl_NewIntObj(0); + Tcl_IncrRefCount(butPtr->padXPtr); + } + if (butPtr->padY < 0) { + butPtr->padY = 0; + Tcl_DecrRefCount(butPtr->padYPtr); + butPtr->padYPtr = Tcl_NewIntObj(0); + Tcl_IncrRefCount(butPtr->padYPtr); } if (butPtr->type >= TYPE_CHECK_BUTTON) { Tcl_Obj *valuePtr, *namePtr; @@ -1271,32 +1271,32 @@ if ((butPtr->bitmap != None) || (butPtr->imagePtr != NULL)) { /* * The button must display the contents of an image or bitmap. */ - if (Tk_GetPixelsFromObj(interp, butPtr->tkwin, butPtr->widthObj, - &butPtrWidth) != TCL_OK) { + if (Tk_GetPixelsFromObj(interp, butPtr->tkwin, butPtr->widthPtr, + &butPtr->width) != TCL_OK) { widthError: Tcl_AddErrorInfo(interp, "\n (processing \"-width\" option)"); continue; } - if (Tk_GetPixelsFromObj(interp, butPtr->tkwin, butPtr->heightObj, - &butPtrHeight) != TCL_OK) { + if (Tk_GetPixelsFromObj(interp, butPtr->tkwin, butPtr->heightPtr, + &butPtr->height) != TCL_OK) { heightError: Tcl_AddErrorInfo(interp, "\n (processing \"-height\" option)"); continue; } } else { /* * The button displays an ordinary text string. */ - if (Tcl_GetIntFromObj(interp, butPtr->widthObj, &butPtrWidth) + if (Tcl_GetIntFromObj(interp, butPtr->widthPtr, &butPtr->width) != TCL_OK) { goto widthError; } - if (Tcl_GetIntFromObj(interp, butPtr->heightObj, &butPtrHeight) + if (Tcl_GetIntFromObj(interp, butPtr->heightPtr, &butPtr->height) != TCL_OK) { goto heightError; } } break; @@ -1465,12 +1465,10 @@ ButtonEventProc( void *clientData, /* Information about window. */ XEvent *eventPtr) /* Information about event. */ { TkButton *butPtr = (TkButton *)clientData; - int highlightWidth; - if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) { goto redraw; } else if (eventPtr->type == ConfigureNotify) { /* * Must redraw after size changes, since layout could have changed and @@ -1481,20 +1479,20 @@ } else if (eventPtr->type == DestroyNotify) { DestroyButton(butPtr); } else if (eventPtr->type == FocusIn) { if (eventPtr->xfocus.detail != NotifyInferior) { butPtr->flags |= GOT_FOCUS; - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->highlightWidthObj, &highlightWidth); - if (highlightWidth > 0) { + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); + if (butPtr->highlightWidth > 0) { goto redraw; } } } else if (eventPtr->type == FocusOut) { if (eventPtr->xfocus.detail != NotifyInferior) { butPtr->flags &= ~GOT_FOCUS; - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->highlightWidthObj, &highlightWidth); - if (highlightWidth > 0) { + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); + if (butPtr->highlightWidth > 0) { goto redraw; } } } return; Index: generic/tkCanvArc.c ================================================================== --- generic/tkCanvArc.c +++ generic/tkCanvArc.c @@ -128,11 +128,11 @@ TK_CONFIG_DONT_SET_DEFAULT, &pixelOption}, {TK_CONFIG_CUSTOM, "-dash", NULL, NULL, NULL, offsetof(ArcItem, outline.dash), TK_CONFIG_NULL_OK, &dashOption}, {TK_CONFIG_PIXELS, "-dashoffset", NULL, NULL, - "0", offsetof(ArcItem, outline.offsetObj), TK_CONFIG_OBJS, NULL}, + "0", offsetof(ArcItem, outline.offset), TK_CONFIG_DONT_SET_DEFAULT, NULL}, {TK_CONFIG_CUSTOM, "-disableddash", NULL, NULL, NULL, offsetof(ArcItem, outline.disabledDash), TK_CONFIG_NULL_OK, &dashOption}, {TK_CONFIG_COLOR, "-disabledfill", NULL, NULL, NULL, offsetof(ArcItem, disabledFillColor), TK_CONFIG_NULL_OK, NULL}, @@ -232,11 +232,11 @@ configSpecs, /* configSpecs */ ConfigureArc, /* configureProc */ ArcCoords, /* coordProc */ DeleteArc, /* deleteProc */ DisplayArc, /* displayProc */ - 0, /* flags */ + TK_CONFIG_OBJS, /* flags */ ArcToPoint, /* pointProc */ ArcToArea, /* areaProc */ ArcToPostscript, /* postscriptProc */ ScaleArc, /* scaleProc */ TranslateArc, /* translateProc */ @@ -450,11 +450,11 @@ Pixmap stipple; Tk_State state; tkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, - objv, arcPtr, flags)) { + (const char **) objv, (char *) arcPtr, flags|TK_CONFIG_OBJS)) { return TCL_ERROR; } state = itemPtr->state; Index: generic/tkCanvBmap.c ================================================================== --- generic/tkCanvBmap.c +++ generic/tkCanvBmap.c @@ -126,11 +126,11 @@ configSpecs, /* configSpecs */ ConfigureBitmap, /* configureProc */ BitmapCoords, /* coordProc */ DeleteBitmap, /* deleteProc */ DisplayBitmap, /* displayProc */ - 0, /* flags */ + TK_CONFIG_OBJS, /* flags */ BitmapToPoint, /* pointProc */ BitmapToArea, /* areaProc */ BitmapToPostscript, /* postscriptProc */ ScaleBitmap, /* scaleProc */ TranslateBitmap, /* translateProc */ @@ -322,11 +322,11 @@ Pixmap bitmap; Tk_State state; tkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, - objv, bmapPtr, flags)) { + (const char **) objv, (char *) bmapPtr, flags|TK_CONFIG_OBJS)) { return TCL_ERROR; } /* * A few of the options require additional processing, such as those that Index: generic/tkCanvImg.c ================================================================== --- generic/tkCanvImg.c +++ generic/tkCanvImg.c @@ -113,11 +113,11 @@ configSpecs, /* configSpecs */ ConfigureImage, /* configureProc */ ImageCoords, /* coordProc */ DeleteImage, /* deleteProc */ DisplayImage, /* displayProc */ - 0, /* flags */ + TK_CONFIG_OBJS, /* flags */ ImageToPoint, /* pointProc */ ImageToArea, /* areaProc */ ImageToPostscript, /* postscriptProc */ ScaleImage, /* scaleProc */ TranslateImage, /* translateProc */ @@ -299,11 +299,11 @@ Tk_Window tkwin; Tk_Image image; tkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, - objv, imgPtr, flags)) { + (const char **)objv, (char *)imgPtr, flags|TK_CONFIG_OBJS)) { return TCL_ERROR; } /* * Create the image. Save the old image around and don't free it until Index: generic/tkCanvLine.c ================================================================== --- generic/tkCanvLine.c +++ generic/tkCanvLine.c @@ -185,11 +185,11 @@ DEF_CANVITEM_OUTLINE, offsetof(LineItem, outline.color), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_CUSTOM, "-dash", NULL, NULL, NULL, offsetof(LineItem, outline.dash), TK_CONFIG_NULL_OK, &dashOption}, {TK_CONFIG_PIXELS, "-dashoffset", NULL, NULL, - "0", offsetof(LineItem, outline.offsetObj), TK_CONFIG_OBJS, NULL}, + "0", offsetof(LineItem, outline.offset), TK_CONFIG_DONT_SET_DEFAULT, NULL}, {TK_CONFIG_CUSTOM, "-disableddash", NULL, NULL, NULL, offsetof(LineItem, outline.disabledDash), TK_CONFIG_NULL_OK, &dashOption}, {TK_CONFIG_COLOR, "-disabledfill", NULL, NULL, NULL, offsetof(LineItem, outline.disabledColor), TK_CONFIG_NULL_OK, NULL}, @@ -232,11 +232,11 @@ configSpecs, /* configSpecs */ ConfigureLine, /* configureProc */ LineCoords, /* coordProc */ DeleteLine, /* deleteProc */ DisplayLine, /* displayProc */ - TK_MOVABLE_POINTS, /* flags */ + TK_CONFIG_OBJS | TK_MOVABLE_POINTS, /* flags */ LineToPoint, /* pointProc */ LineToArea, /* areaProc */ LineToPostscript, /* postscriptProc */ ScaleLine, /* scaleProc */ TranslateLine, /* translateProc */ @@ -483,11 +483,11 @@ Tk_Window tkwin; Tk_State state; tkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, - objv, linePtr, flags)) { + (const char **)objv, (char *)linePtr, flags|TK_CONFIG_OBJS)) { return TCL_ERROR; } /* * A few of the options require additional processing, such as graphics Index: generic/tkCanvPoly.c ================================================================== --- generic/tkCanvPoly.c +++ generic/tkCanvPoly.c @@ -93,11 +93,12 @@ TK_CONFIG_DONT_SET_DEFAULT, &pixelOption}, {TK_CONFIG_CUSTOM, "-dash", NULL, NULL, NULL, offsetof(PolygonItem, outline.dash), TK_CONFIG_NULL_OK, &dashOption}, {TK_CONFIG_PIXELS, "-dashoffset", NULL, NULL, - "0", offsetof(PolygonItem, outline.offsetObj), TK_CONFIG_OBJS, NULL}, + "0", offsetof(PolygonItem, outline.offset), + TK_CONFIG_DONT_SET_DEFAULT, NULL}, {TK_CONFIG_CUSTOM, "-disableddash", NULL, NULL, NULL, offsetof(PolygonItem, outline.disabledDash), TK_CONFIG_NULL_OK, &dashOption}, {TK_CONFIG_COLOR, "-disabledfill", NULL, NULL, NULL, offsetof(PolygonItem, disabledFillColor), TK_CONFIG_NULL_OK, NULL}, @@ -196,11 +197,11 @@ configSpecs, /* configSpecs */ ConfigurePolygon, /* configureProc */ PolygonCoords, /* coordProc */ DeletePolygon, /* deleteProc */ DisplayPolygon, /* displayProc */ - TK_MOVABLE_POINTS, /* flags */ + TK_CONFIG_OBJS | TK_MOVABLE_POINTS, /* flags */ PolygonToPoint, /* pointProc */ PolygonToArea, /* areaProc */ PolygonToPostscript, /* postscriptProc */ ScalePolygon, /* scaleProc */ TranslatePolygon, /* translateProc */ @@ -443,11 +444,11 @@ Pixmap stipple; Tk_State state; tkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, - objv, polyPtr, flags)) { + (const char **) objv, (char *) polyPtr, flags|TK_CONFIG_OBJS)) { return TCL_ERROR; } /* * A few of the options require additional processing, such as graphics Index: generic/tkCanvPs.c ================================================================== --- generic/tkCanvPs.c +++ generic/tkCanvPs.c @@ -231,12 +231,12 @@ psInfo.chan = NULL; psInfo.prepass = 0; psInfo.prolog = 1; psInfo.tkwin = tkwin; Tcl_InitHashTable(&psInfo.fontTable, TCL_STRING_KEYS); - result = Tk_ConfigureWidget(interp, tkwin, configSpecs, objc-2, objv+2, - &psInfo, TK_CONFIG_ARGV_ONLY); + result = Tk_ConfigureWidget(interp, tkwin, configSpecs, objc-2, (const char **)objv+2, + (char *)&psInfo, TK_CONFIG_ARGV_ONLY|TK_CONFIG_OBJS); if (result != TCL_OK) { goto cleanup; } if (psInfo.width == -1) { Index: generic/tkCanvText.c ================================================================== --- generic/tkCanvText.c +++ generic/tkCanvText.c @@ -51,12 +51,12 @@ Tk_Font tkfont; /* Font for drawing text. */ Tk_Justify justify; /* Justification mode for text. */ Pixmap stipple; /* Stipple bitmap for text, or None. */ Pixmap activeStipple; /* Stipple bitmap for text, or None. */ Pixmap disabledStipple; /* Stipple bitmap for text, or None. */ - Tcl_Obj *textObj; /* Text for item (malloc-ed). */ - Tcl_Obj *widthObj; /* Width of lines for word-wrap, pixels. Zero + char *text; /* Text for item (malloc-ed). */ + int width; /* Width of lines for word-wrap, pixels. Zero * means no word-wrap. */ int underline; /* Index of character to put underline beneath * or INT_MIN for no underlining. */ double angle; /* What angle, in degrees, to draw the text * at. */ @@ -64,10 +64,12 @@ /* * Fields whose values are derived from the current values of the * configuration settings above. */ + Tcl_Size numChars; /* Length of text in characters. */ + Tcl_Size numBytes; /* Length of text in bytes. */ Tk_TextLayout textLayout; /* Cached text layout information. */ int actualWidth; /* Width of text as computed. Used to make * selections of wrapped text display * right. */ double drawOrigin[2]; /* Where we start drawing from. */ @@ -146,11 +148,15 @@ { int underline = *(int *)(widgRec + offset); char *p; if (underline == INT_MIN) { +#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 + p = (char *)"-1"; +#else p = (char *)""; +#endif *freeProcPtr = TCL_STATIC; return p; } else if (underline == INT_MAX) { p = (char *)"end+1"; *freeProcPtr = TCL_STATIC; @@ -201,15 +207,15 @@ {TK_CONFIG_BITMAP, "-stipple", NULL, NULL, NULL, offsetof(TextItem, stipple), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_CUSTOM, "-tags", NULL, NULL, NULL, 0, TK_CONFIG_NULL_OK, &tagsOption}, {TK_CONFIG_STRING, "-text", NULL, NULL, - "", offsetof(TextItem, textObj), TK_CONFIG_OBJS|TK_CONFIG_NULL_OK, NULL}, + "", offsetof(TextItem, text), 0, NULL}, {TK_CONFIG_CUSTOM, "-underline", NULL, NULL, NULL, offsetof(TextItem, underline), TK_CONFIG_NULL_OK, &underlineOption}, {TK_CONFIG_PIXELS, "-width", NULL, NULL, - "0", offsetof(TextItem, widthObj), TK_CONFIG_OBJS, NULL}, + "0", offsetof(TextItem, width), TK_CONFIG_DONT_SET_DEFAULT, NULL}, {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL} }; /* * Prototypes for functions defined in this file: @@ -268,11 +274,11 @@ configSpecs, /* configSpecs */ ConfigureText, /* configureProc */ TextCoords, /* coordProc */ DeleteText, /* deleteProc */ DisplayCanvText, /* displayProc */ - 0, /* flags */ + TK_CONFIG_OBJS, /* flags */ TextToPoint, /* pointProc */ TextToArea, /* areaProc */ TextToPostscript, /* postscriptProc */ ScaleText, /* scaleProc */ TranslateText, /* translateProc */ @@ -341,15 +347,17 @@ textPtr->tkfont = NULL; textPtr->justify = TK_JUSTIFY_LEFT; textPtr->stipple = None; textPtr->activeStipple = None; textPtr->disabledStipple = None; - textPtr->textObj = NULL; - textPtr->widthObj = NULL; + textPtr->text = NULL; + textPtr->width = 0; textPtr->underline = INT_MIN; textPtr->angle = 0.0; + textPtr->numChars = 0; + textPtr->numBytes = 0; textPtr->textLayout = NULL; textPtr->actualWidth = 0; textPtr->drawOrigin[0] = textPtr->drawOrigin[1] = 0.0; textPtr->gc = NULL; textPtr->selTextGC = NULL; @@ -488,11 +496,11 @@ Pixmap stipple; Tk_State state; tkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, - objv, textPtr, flags)) { + (const char **) objv, (char *) textPtr, flags|TK_CONFIG_OBJS)) { return TCL_ERROR; } /* * A few of the options require additional processing, such as graphics @@ -583,27 +591,28 @@ /* * If the text was changed, move the selection and insertion indices to * keep them inside the item. */ - Tcl_Size numChars = textPtr->textObj ? Tcl_GetCharLength(textPtr->textObj) : 0; + textPtr->numBytes = strlen(textPtr->text); + textPtr->numChars = TkNumUtfChars(textPtr->text, textPtr->numBytes); if (textInfoPtr->selItemPtr == itemPtr) { - if (textInfoPtr->selectFirst >= numChars) { + if (textInfoPtr->selectFirst >= textPtr->numChars) { textInfoPtr->selItemPtr = NULL; } else { - if (textInfoPtr->selectLast >= numChars) { - textInfoPtr->selectLast = numChars - 1; + if (textInfoPtr->selectLast >= textPtr->numChars) { + textInfoPtr->selectLast = textPtr->numChars - 1; } if ((textInfoPtr->anchorItemPtr == itemPtr) - && (textInfoPtr->selectAnchor >= numChars)) { - textInfoPtr->selectAnchor = numChars - 1; + && (textInfoPtr->selectAnchor >= textPtr->numChars)) { + textInfoPtr->selectAnchor = textPtr->numChars - 1; } } } - if (textPtr->insertPos >= numChars) { - textPtr->insertPos = numChars; + if (textPtr->insertPos >= textPtr->numChars) { + textPtr->insertPos = textPtr->numChars; } /* * Restrict so that 0.0 <= angle < 360.0, and then recompute the cached * sine and cosine of the angle. Note that fmod() can produce negative @@ -666,12 +675,12 @@ Tk_FreeBitmap(display, textPtr->activeStipple); } if (textPtr->disabledStipple != None) { Tk_FreeBitmap(display, textPtr->disabledStipple); } - if (textPtr->textObj != NULL) { - Tcl_DecrRefCount(textPtr->textObj); + if (textPtr->text != NULL) { + ckfree(textPtr->text); } Tk_FreeTextLayout(textPtr->textLayout); if (textPtr->gc != NULL) { Tk_FreeGC(display, textPtr->gc); @@ -717,17 +726,12 @@ if (state == TK_STATE_NULL) { state = Canvas(canvas)->canvas_state; } Tk_FreeTextLayout(textPtr->textLayout); - width = 0; - if (textPtr->widthObj) { - Tk_GetPixelsFromObj(NULL, Tk_CanvasTkwin(canvas), textPtr->widthObj, &width); - } - Tcl_Size numChars = textPtr->textObj ? Tcl_GetCharLength(textPtr->textObj) : 0; textPtr->textLayout = Tk_ComputeTextLayout(textPtr->tkfont, - (textPtr->textObj ? Tcl_GetString(textPtr->textObj) : ""), numChars, width, + textPtr->text, textPtr->numChars, textPtr->width, textPtr->justify, 0, &width, &height); if (state == TK_STATE_HIDDEN || textPtr->color == NULL) { width = height = 0; } @@ -793,12 +797,10 @@ * box includes the bounding box of all its lines, plus an extra fudge * factor for the cursor border (which could potentially be quite large). */ textInfoPtr = textPtr->textInfoPtr; - Tk_GetPixelsFromObj(NULL, Tk_CanvasTkwin(canvas), (Tcl_Obj *)textInfoPtr->reserved2, &textInfoPtr->insertWidth); - Tk_GetPixelsFromObj(NULL, Tk_CanvasTkwin(canvas), (Tcl_Obj *)textInfoPtr->reserved3, &textInfoPtr->selBorderWidth); fudge = (textInfoPtr->insertWidth + 1) / 2; if (textInfoPtr->selBorderWidth > fudge) { fudge = textInfoPtr->selBorderWidth; } @@ -915,16 +917,15 @@ selFirstChar = TCL_INDEX_NONE; selLastChar = 0; Tk_CanvasDrawableCoords(canvas, textPtr->drawOrigin[0], textPtr->drawOrigin[1], &drawableX, &drawableY); - Tcl_Size numChars = textPtr->textObj ? Tcl_GetCharLength(textPtr->textObj) : 0; if (textInfoPtr->selItemPtr == itemPtr) { selFirstChar = textInfoPtr->selectFirst; selLastChar = textInfoPtr->selectLast; - if (selLastChar > numChars) { - selLastChar = numChars - 1; + if (selLastChar > textPtr->numChars) { + selLastChar = textPtr->numChars - 1; } if ((selFirstChar >= 0) && (selFirstChar <= selLastChar)) { int xFirst, yFirst, hFirst; int xLast, yLast, wLast; @@ -944,11 +945,10 @@ * last character, not the end of the line. */ x = xFirst; height = hFirst; - Tk_GetPixelsFromObj(NULL, Tk_CanvasTkwin(canvas), (Tcl_Obj *)textInfoPtr->reserved3, &textInfoPtr->selBorderWidth); for (y = yFirst ; y <= yLast; y += height) { int dx1, dy1, dx2, dy2; double s = textPtr->sine, c = textPtr->cosine; XPoint points[4]; @@ -991,11 +991,10 @@ &x, &y, NULL, &height)) { int dx1, dy1, dx2, dy2; double s = textPtr->sine, c = textPtr->cosine; XPoint points[4]; - Tk_GetPixelsFromObj(NULL, Tk_CanvasTkwin(canvas), (Tcl_Obj *)textInfoPtr->reserved2, &textInfoPtr->insertWidth); dx1 = x - (textInfoPtr->insertWidth / 2); dy1 = y; dx2 = textInfoPtr->insertWidth; dy2 = height; points[0].x = (short)(drawableX + dx1*c + dy1*s); @@ -1008,11 +1007,10 @@ points[3].y = (short)(drawableY + (dy1+dy2)*c - dx1*s); Tk_SetCaretPos(Tk_CanvasTkwin(canvas), points[0].x, points[0].y, height); if (textInfoPtr->cursorOn) { - Tk_GetPixelsFromObj(NULL, Tk_CanvasTkwin(canvas), (Tcl_Obj *)textInfoPtr->reserved1, &textInfoPtr->insertBorderWidth); Tk_Fill3DPolygon(Tk_CanvasTkwin(canvas), drawable, textInfoPtr->insertBorder, points, 4, textInfoPtr->insertBorderWidth, TK_RELIEF_RAISED); } else if (textPtr->cursorOffGC != NULL) { /* @@ -1045,19 +1043,19 @@ 0, selFirstChar); } TkDrawAngledTextLayout(display, drawable, textPtr->selTextGC, textPtr->textLayout, drawableX, drawableY, textPtr->angle, selFirstChar, selLastChar + 1); - if (selLastChar + 1 < numChars) { + if (selLastChar + 1 < textPtr->numChars) { TkDrawAngledTextLayout(display, drawable, textPtr->gc, textPtr->textLayout, drawableX, drawableY, textPtr->angle, - selLastChar + 1, numChars); + selLastChar + 1, textPtr->numChars); } } else { TkDrawAngledTextLayout(display, drawable, textPtr->gc, textPtr->textLayout, drawableX, drawableY, textPtr->angle, - 0, numChars); + 0, textPtr->numChars); } TkUnderlineAngledTextLayout(display, drawable, textPtr->gc, textPtr->textLayout, drawableX, drawableY, textPtr->angle, textPtr->underline); @@ -1092,40 +1090,40 @@ Tcl_Obj *obj) /* New characters to be inserted. */ { TextItem *textPtr = (TextItem *) itemPtr; int byteIndex, charsAdded; Tcl_Size byteCount; - const char *string, *text; + char *newStr, *text; + const char *string; Tk_CanvasTextInfo *textInfoPtr = textPtr->textInfoPtr; string = Tcl_GetStringFromObj(obj, &byteCount); + + text = textPtr->text; if (index < 0) { index = 0; } - Tcl_Size numChars = textPtr->textObj ? Tcl_GetCharLength(textPtr->textObj) : 0; - text = textPtr->textObj ? Tcl_GetString(textPtr->textObj) : ""; - if (index > numChars) { - index = numChars; + if (index > textPtr->numChars) { + index = textPtr->numChars; } byteIndex = Tcl_UtfAtIndex(text, index) - text; byteCount = strlen(string); if (byteCount == 0) { return; } - Tcl_DString ds; - Tcl_DStringInit(&ds); - Tcl_DStringAppend(&ds, text, byteIndex); - Tcl_DStringAppend(&ds, string, byteCount); - Tcl_DStringAppend(&ds, text + byteIndex, TCL_INDEX_NONE); - if (textPtr->textObj) { - Tcl_DecrRefCount(textPtr->textObj); - } - textPtr->textObj = Tcl_DStringToObj(&ds); - Tcl_IncrRefCount(textPtr->textObj); - charsAdded = Tcl_GetCharLength(obj); + newStr = (char *)ckalloc(textPtr->numBytes + byteCount + 1); + memcpy(newStr, text, byteIndex); + strcpy(newStr + byteIndex, string); + strcpy(newStr + byteIndex + byteCount, text + byteIndex); + + ckfree(text); + textPtr->text = newStr; + charsAdded = TkNumUtfChars(string, byteCount); + textPtr->numChars += charsAdded; + textPtr->numBytes += byteCount; /* * Inserting characters invalidates indices such as those for the * selection and cursor. Update the indices appropriately. */ @@ -1174,36 +1172,37 @@ Tcl_Size last) /* Character index of last character to delete * (inclusive). */ { TextItem *textPtr = (TextItem *) itemPtr; int byteIndex, byteCount, charsRemoved; - const char *text; + char *newStr, *text; Tk_CanvasTextInfo *textInfoPtr = textPtr->textInfoPtr; + text = textPtr->text; if (first < 0) { first = 0; } - Tcl_Size numChars = textPtr->textObj ? Tcl_GetCharLength(textPtr->textObj) : 0; - if (last >= numChars) { - last = numChars - 1; + if (last >= textPtr->numChars) { + last = textPtr->numChars - 1; } if (first > last) { return; } charsRemoved = last + 1 - first; - text = Tcl_GetString(textPtr->textObj); - byteIndex = Tcl_UtfAtIndex(text, first) - text; - byteCount = Tcl_UtfAtIndex(text + byteIndex, charsRemoved) - (text + byteIndex); - - Tcl_DString ds; - Tcl_DStringInit(&ds); - Tcl_DStringAppend(&ds, text, byteIndex); - Tcl_DStringAppend(&ds, text + byteIndex + byteCount, TCL_INDEX_NONE); - Tcl_DecrRefCount(textPtr->textObj); - textPtr->textObj = Tcl_DStringToObj(&ds); - Tcl_IncrRefCount(textPtr->textObj); + byteIndex = TkUtfAtIndex(text, first) - text; + byteCount = TkUtfAtIndex(text + byteIndex, charsRemoved) + - (text + byteIndex); + + newStr = (char *)ckalloc(textPtr->numBytes + 1 - byteCount); + memcpy(newStr, text, byteIndex); + strcpy(newStr + byteIndex, text + byteIndex + byteCount); + + ckfree(text); + textPtr->text = newStr; + textPtr->numChars -= charsRemoved; + textPtr->numBytes -= byteCount; /* * Update indexes for the selection and cursor to reflect the renumbering * of the remaining characters. */ @@ -1281,11 +1280,11 @@ value = (double) Tk_DistanceToTextLayout(textPtr->textLayout, (int) (px*textPtr->cosine - py*textPtr->sine), (int) (py*textPtr->cosine + px*textPtr->sine)); if ((state == TK_STATE_HIDDEN) || (textPtr->color == NULL) || - (textPtr->textObj == NULL)) { + (textPtr->text == NULL) || (*textPtr->text == 0)) { value = 1.0e36; } return value; } @@ -1464,16 +1463,15 @@ Tcl_Size length, idx; int c; Tk_CanvasTextInfo *textInfoPtr = textPtr->textInfoPtr; const char *string; - Tcl_Size numChars = textPtr->textObj ? Tcl_GetCharLength(textPtr->textObj) : 0; - if (TCL_OK == TkGetIntForIndex(obj, numChars - 1, 1, &idx)) { + if (TCL_OK == TkGetIntForIndex(obj, textPtr->numChars - 1, 1, &idx)) { if (idx < 0) { idx = 0; - } else if (idx > numChars) { - idx = numChars; + } else if (idx > textPtr->numChars) { + idx = textPtr->numChars; } *indexPtr = idx; return TCL_OK; } @@ -1561,15 +1559,14 @@ Tcl_Size index) /* Character index of character just before * which cursor is to be positioned. */ { TextItem *textPtr = (TextItem *) itemPtr; - Tcl_Size numChars = textPtr->textObj ? Tcl_GetCharLength(textPtr->textObj) : 0; if (index < 0) { textPtr->insertPos = 0; - } else if (index > numChars) { - textPtr->insertPos = numChars; + } else if (index > textPtr->numChars) { + textPtr->insertPos = textPtr->numChars; } else { textPtr->insertPos = index; } } @@ -1604,19 +1601,21 @@ * not including terminating NULL * character. */ { TextItem *textPtr = (TextItem *) itemPtr; Tcl_Size byteCount; + char *text; const char *selStart, *selEnd; Tk_CanvasTextInfo *textInfoPtr = textPtr->textInfoPtr; if ((textInfoPtr->selectFirst < 0) || (textInfoPtr->selectFirst > textInfoPtr->selectLast)) { return 0; } - selStart = Tcl_UtfAtIndex(textPtr->textObj ? Tcl_GetString(textPtr->textObj) : "", textInfoPtr->selectFirst); - selEnd = Tcl_UtfAtIndex(selStart, + text = textPtr->text; + selStart = TkUtfAtIndex(text, textInfoPtr->selectFirst); + selEnd = TkUtfAtIndex(selStart, textInfoPtr->selectLast + 1 - textInfoPtr->selectFirst); if (selEnd <= selStart + offset) { return 0; } byteCount = selEnd - selStart - offset; @@ -1670,11 +1669,11 @@ state = Canvas(canvas)->canvas_state; } color = textPtr->color; stipple = textPtr->stipple; if (state == TK_STATE_HIDDEN || textPtr->color == NULL || - textPtr->textObj == NULL) { + textPtr->text == NULL || *textPtr->text == 0) { return TCL_OK; } else if (Canvas(canvas)->currentItemPtr == itemPtr) { if (textPtr->activeColor != NULL) { color = textPtr->activeColor; } Index: generic/tkCanvUtil.c ================================================================== --- generic/tkCanvUtil.c +++ generic/tkCanvUtil.c @@ -1193,14 +1193,14 @@ width = outline->width; if (width < 1.0) { width = 1.0; } - if (outline->offsetObj && Tk_GetPixelsFromObj(NULL, Canvas(canvas)->tkwin, - outline->offsetObj, &outline->offset) != TCL_OK) { - outline->offset = 0; - } + if (outline->offsetObj && Tk_GetPixelsFromObj(NULL, Canvas(canvas)->tkwin, + outline->offsetObj, &outline->offset) != TCL_OK) { + outline->offset = 0; + } dash = &(outline->dash); color = outline->color; stipple = outline->stipple; if (state == TK_STATE_NULL) { state = Canvas(canvas)->canvas_state; Index: generic/tkCanvWind.c ================================================================== --- generic/tkCanvWind.c +++ generic/tkCanvWind.c @@ -118,11 +118,11 @@ configSpecs, /* configSpecs */ ConfigureWinItem, /* configureProc */ WinItemCoords, /* coordProc */ DeleteWinItem, /* deleteProc */ DisplayWinItem, /* displayProc */ - TK_ALWAYS_REDRAW, /* flags */ + TK_ALWAYS_REDRAW|TK_CONFIG_OBJS, /* flags */ WinItemToPoint, /* pointProc */ WinItemToArea, /* areaProc */ WinItemToPostscript, /* postscriptProc */ ScaleWinItem, /* scaleProc */ TranslateWinItem, /* translateProc */ @@ -314,11 +314,11 @@ Tk_Window canvasTkwin; oldWindow = winItemPtr->tkwin; canvasTkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, canvasTkwin, configSpecs, objc, - objv, winItemPtr, flags)) { + (const char **) objv, (char *) winItemPtr, flags|TK_CONFIG_OBJS)) { return TCL_ERROR; } /* * A few of the options require additional processing. Index: generic/tkCanvas.c ================================================================== --- generic/tkCanvas.c +++ generic/tkCanvas.c @@ -99,41 +99,41 @@ DEF_CANVAS_BG_MONO, offsetof(TkCanvas, bgBorder), TK_CONFIG_MONO_ONLY, NULL}, {TK_CONFIG_SYNONYM, "-bd", "borderWidth", NULL, NULL, 0, 0, NULL}, {TK_CONFIG_SYNONYM, "-bg", "background", NULL, NULL, 0, 0, NULL}, {TK_CONFIG_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_CANVAS_BORDER_WIDTH, offsetof(TkCanvas, borderWidthObj), TK_CONFIG_OBJS, NULL}, + DEF_CANVAS_BORDER_WIDTH, offsetof(TkCanvas, borderWidth), 0, NULL}, {TK_CONFIG_DOUBLE, "-closeenough", "closeEnough", "CloseEnough", DEF_CANVAS_CLOSE_ENOUGH, offsetof(TkCanvas, closeEnough), 0, NULL}, {TK_CONFIG_BOOLEAN, "-confine", "confine", "Confine", DEF_CANVAS_CONFINE, offsetof(TkCanvas, confine), 0, NULL}, {TK_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor", DEF_CANVAS_CURSOR, offsetof(TkCanvas, cursor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_PIXELS, "-height", "height", "Height", - DEF_CANVAS_HEIGHT, offsetof(TkCanvas, heightObj), TK_CONFIG_OBJS, NULL}, + DEF_CANVAS_HEIGHT, offsetof(TkCanvas, height), 0, NULL}, {TK_CONFIG_COLOR, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_CANVAS_HIGHLIGHT_BG, offsetof(TkCanvas, highlightBgColorPtr), 0, NULL}, {TK_CONFIG_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", DEF_CANVAS_HIGHLIGHT, offsetof(TkCanvas, highlightColorPtr), 0, NULL}, {TK_CONFIG_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", - DEF_CANVAS_HIGHLIGHT_WIDTH, offsetof(TkCanvas, highlightWidthObj), TK_CONFIG_OBJS, NULL}, + DEF_CANVAS_HIGHLIGHT_WIDTH, offsetof(TkCanvas, highlightWidth), 0, NULL}, {TK_CONFIG_BORDER, "-insertbackground", "insertBackground", "Foreground", DEF_CANVAS_INSERT_BG, offsetof(TkCanvas, textInfo.insertBorder), 0, NULL}, {TK_CONFIG_PIXELS, "-insertborderwidth", "insertBorderWidth", "BorderWidth", - DEF_CANVAS_INSERT_BD_COLOR, offsetof(TkCanvas, textInfo.reserved1), - TK_CONFIG_OBJS|TK_CONFIG_COLOR_ONLY, NULL}, + DEF_CANVAS_INSERT_BD_COLOR, + offsetof(TkCanvas, textInfo.insertBorderWidth), TK_CONFIG_COLOR_ONLY, NULL}, {TK_CONFIG_PIXELS, "-insertborderwidth", "insertBorderWidth", "BorderWidth", - DEF_CANVAS_INSERT_BD_MONO, offsetof(TkCanvas, textInfo.reserved1), - TK_CONFIG_OBJS|TK_CONFIG_MONO_ONLY, NULL}, + DEF_CANVAS_INSERT_BD_MONO, + offsetof(TkCanvas, textInfo.insertBorderWidth), TK_CONFIG_MONO_ONLY, NULL}, {TK_CONFIG_INT, "-insertofftime", "insertOffTime", "OffTime", DEF_CANVAS_INSERT_OFF_TIME, offsetof(TkCanvas, insertOffTime), 0, NULL}, {TK_CONFIG_INT, "-insertontime", "insertOnTime", "OnTime", DEF_CANVAS_INSERT_ON_TIME, offsetof(TkCanvas, insertOnTime), 0, NULL}, {TK_CONFIG_PIXELS, "-insertwidth", "insertWidth", "InsertWidth", - DEF_CANVAS_INSERT_WIDTH, offsetof(TkCanvas, textInfo.reserved2), TK_CONFIG_OBJS, NULL}, + DEF_CANVAS_INSERT_WIDTH, offsetof(TkCanvas, textInfo.insertWidth), 0, NULL}, {TK_CONFIG_CUSTOM, "-offset", "offset", "Offset", "0,0", offsetof(TkCanvas, tsoffset),TK_CONFIG_DONT_SET_DEFAULT, &offsetOption}, {TK_CONFIG_RELIEF, "-relief", "relief", "Relief", DEF_CANVAS_RELIEF, offsetof(TkCanvas, relief), 0, NULL}, @@ -145,15 +145,15 @@ TK_CONFIG_COLOR_ONLY, NULL}, {TK_CONFIG_BORDER, "-selectbackground", "selectBackground", "Foreground", DEF_CANVAS_SELECT_MONO, offsetof(TkCanvas, textInfo.selBorder), TK_CONFIG_MONO_ONLY, NULL}, {TK_CONFIG_PIXELS, "-selectborderwidth", "selectBorderWidth", "BorderWidth", - DEF_CANVAS_SELECT_BD_COLOR, offsetof(TkCanvas, textInfo.reserved3), - TK_CONFIG_OBJS|TK_CONFIG_COLOR_ONLY, NULL}, + DEF_CANVAS_SELECT_BD_COLOR, + offsetof(TkCanvas, textInfo.selBorderWidth), TK_CONFIG_COLOR_ONLY, NULL}, {TK_CONFIG_PIXELS, "-selectborderwidth", "selectBorderWidth", "BorderWidth", - DEF_CANVAS_SELECT_BD_MONO, offsetof(TkCanvas, textInfo.reserved3), - TK_CONFIG_OBJS|TK_CONFIG_MONO_ONLY, NULL}, + DEF_CANVAS_SELECT_BD_MONO, offsetof(TkCanvas, textInfo.selBorderWidth), + TK_CONFIG_MONO_ONLY, NULL}, {TK_CONFIG_COLOR, "-selectforeground", "selectForeground", "Background", DEF_CANVAS_SELECT_FG_COLOR, offsetof(TkCanvas, textInfo.selFgColorPtr), TK_CONFIG_COLOR_ONLY|TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_COLOR, "-selectforeground", "selectForeground", "Background", DEF_CANVAS_SELECT_FG_MONO, offsetof(TkCanvas, textInfo.selFgColorPtr), @@ -163,25 +163,25 @@ &stateOption}, {TK_CONFIG_STRING, "-takefocus", "takeFocus", "TakeFocus", DEF_CANVAS_TAKE_FOCUS, offsetof(TkCanvas, takeFocusObj), TK_CONFIG_OBJS|TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_PIXELS, "-width", "width", "Width", - DEF_CANVAS_WIDTH, offsetof(TkCanvas, widthObj), TK_CONFIG_OBJS, NULL}, + DEF_CANVAS_WIDTH, offsetof(TkCanvas, width), 0, NULL}, {TK_CONFIG_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand", DEF_CANVAS_X_SCROLL_CMD, offsetof(TkCanvas, xScrollCmdObj), TK_CONFIG_OBJS|TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_PIXELS, "-xscrollincrement", "xScrollIncrement", "ScrollIncrement", - DEF_CANVAS_X_SCROLL_INCREMENT, offsetof(TkCanvas, xScrollIncrementObj), - TK_CONFIG_OBJS, NULL}, + DEF_CANVAS_X_SCROLL_INCREMENT, offsetof(TkCanvas, xScrollIncrement), + 0, NULL}, {TK_CONFIG_STRING, "-yscrollcommand", "yScrollCommand", "ScrollCommand", DEF_CANVAS_Y_SCROLL_CMD, offsetof(TkCanvas, yScrollCmdObj), TK_CONFIG_OBJS|TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_PIXELS, "-yscrollincrement", "yScrollIncrement", "ScrollIncrement", - DEF_CANVAS_Y_SCROLL_INCREMENT, offsetof(TkCanvas, yScrollIncrementObj), - TK_CONFIG_OBJS, NULL}, + DEF_CANVAS_Y_SCROLL_INCREMENT, offsetof(TkCanvas, yScrollIncrement), + 0, NULL}, {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL} }; /* * List of all the item types known at present. This is *global* and is @@ -258,10 +258,13 @@ Tcl_Obj *newTagObj, Tcl_Size first, TagSearch **searchPtrPtr); static int FindArea(Tcl_Interp *interp, TkCanvas *canvasPtr, Tcl_Obj *const *objv, Tk_Uid uid, int enclosed); static double GridAlign(double coord, double spacing); +#if !defined(TK_NO_DEPRECATED) && (TK_MAJOR_VERSION < 9) +static const char** TkGetStringsFromObjs(Tcl_Size objc, Tcl_Obj *const *objv); +#endif static void InitCanvas(void); static void PickCurrentItem(TkCanvas *canvasPtr, XEvent *eventPtr); static Tcl_Obj * ScrollFractions(int screen1, int screen2, int object1, int object2); static int RelinkItems(TkCanvas *canvasPtr, Tcl_Obj *tag, @@ -323,11 +326,11 @@ static inline int AlwaysRedraw( Tk_Item *itemPtr) { - return itemPtr->typePtr->flags & TK_ALWAYS_REDRAW; + return itemPtr->typePtr->alwaysRedraw & 1; } static inline int ItemConfigure( TkCanvas *canvasPtr, @@ -334,13 +337,29 @@ Tk_Item *itemPtr, Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Interp *interp = canvasPtr->interp; + int result; - return itemPtr->typePtr->configProc(interp, (Tk_Canvas) canvasPtr, - itemPtr, objc, objv, TK_CONFIG_ARGV_ONLY); + if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) { + result = itemPtr->typePtr->configProc(interp, (Tk_Canvas) canvasPtr, + itemPtr, objc, objv, TK_CONFIG_ARGV_ONLY); + } else { +#if defined(TK_NO_DEPRECATED) || (TK_MAJOR_VERSION > 8) + Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory"); +#else + const char **args = TkGetStringsFromObjs(objc, objv); + + result = itemPtr->typePtr->configProc(interp, (Tk_Canvas) canvasPtr, + itemPtr, objc, (Tcl_Obj **) args, TK_CONFIG_ARGV_ONLY); + if (args != NULL) { + ckfree(args); + } +#endif + } + return result; } static inline int ItemConfigInfo( TkCanvas *canvasPtr, @@ -373,13 +392,25 @@ Tcl_Interp *interp = canvasPtr->interp; int result; if (itemPtr->typePtr->coordProc == NULL) { result = TCL_OK; - } else { + } else if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) { result = itemPtr->typePtr->coordProc(interp, (Tk_Canvas) canvasPtr, itemPtr, objc, objv); + } else { +#if defined(TK_NO_DEPRECATED) || (TK_MAJOR_VERSION > 8) + Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory"); +#else + const char **args = TkGetStringsFromObjs(objc, objv); + + result = itemPtr->typePtr->coordProc(interp, (Tk_Canvas) canvasPtr, + itemPtr, objc, (Tcl_Obj **) args); + if (args != NULL) { + ckfree(args); + } +#endif } return result; } static inline int @@ -389,13 +420,29 @@ * set by this point. */ Tcl_Size objc, Tcl_Obj *const objv[]) { Tcl_Interp *interp = canvasPtr->interp; + int result; - return itemPtr->typePtr->createProc(interp, (Tk_Canvas) canvasPtr, + if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) { + result = itemPtr->typePtr->createProc(interp, (Tk_Canvas) canvasPtr, itemPtr, objc-3, objv+3); + } else { +#if defined(TK_NO_DEPRECATED) || (TK_MAJOR_VERSION > 8) + Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory"); +#else + const char **args = TkGetStringsFromObjs(objc-3, objv+3); + + result = itemPtr->typePtr->createProc(interp, (Tk_Canvas) canvasPtr, + itemPtr, objc-3, (Tcl_Obj **) args); + if (args != NULL) { + ckfree(args); + } +#endif + } + return result; } static inline void ItemCursor( TkCanvas *canvasPtr, @@ -445,24 +492,42 @@ { Tcl_Interp *interp = canvasPtr->interp; if (itemPtr->typePtr->indexProc == NULL) { return TCL_OK; + } else if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) { + return itemPtr->typePtr->indexProc(interp, (Tk_Canvas) canvasPtr, + itemPtr, objPtr, indexPtr); + } else { +#if defined(TK_NO_DEPRECATED) + Tcl_AppendResult(interp, "Flag TK_CONFIG_OBJS is mandatory", (char *)NULL); + return TCL_ERROR; +#else + return itemPtr->typePtr->indexProc(interp, (Tk_Canvas) canvasPtr, + itemPtr, (Tcl_Obj *) Tcl_GetString(objPtr), indexPtr); +#endif } - return itemPtr->typePtr->indexProc(interp, (Tk_Canvas) canvasPtr, - itemPtr, objPtr, indexPtr); } static inline void ItemInsert( TkCanvas *canvasPtr, Tk_Item *itemPtr, int beforeThis, Tcl_Obj *toInsert) { - itemPtr->typePtr->insertProc((Tk_Canvas) canvasPtr, itemPtr, - beforeThis, toInsert); + if (itemPtr->typePtr->alwaysRedraw & TK_CONFIG_OBJS) { + itemPtr->typePtr->insertProc((Tk_Canvas) canvasPtr, itemPtr, + beforeThis, toInsert); + } else { +#if defined(TK_NO_DEPRECATED) || (TK_MAJOR_VERSION > 8) + Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory"); +#else + itemPtr->typePtr->insertProc((Tk_Canvas) canvasPtr, itemPtr, + beforeThis, (Tcl_Obj *) Tcl_GetString(toInsert)); +#endif + } } static inline int ItemOverlap( TkCanvas *canvasPtr, @@ -676,35 +741,32 @@ canvasPtr->widgetCmd = Tcl_CreateObjCommand(interp, Tk_PathName(canvasPtr->tkwin), CanvasWidgetCmd, canvasPtr, CanvasCmdDeletedProc); canvasPtr->firstItemPtr = NULL; canvasPtr->lastItemPtr = NULL; - canvasPtr->borderWidthObj = NULL; + canvasPtr->borderWidth = 0; canvasPtr->bgBorder = NULL; canvasPtr->relief = TK_RELIEF_FLAT; - canvasPtr->highlightWidthObj = NULL; + canvasPtr->highlightWidth = 0; canvasPtr->highlightBgColorPtr = NULL; canvasPtr->highlightColorPtr = NULL; canvasPtr->inset = 0; canvasPtr->pixmapGC = NULL; - canvasPtr->widthObj = NULL; - canvasPtr->heightObj = NULL; + canvasPtr->width = 0; + canvasPtr->height = 0; canvasPtr->confine = 0; canvasPtr->textInfo.selBorder = NULL; canvasPtr->textInfo.selBorderWidth = 0; - canvasPtr->textInfo.reserved3 = NULL; canvasPtr->textInfo.selFgColorPtr = NULL; canvasPtr->textInfo.selItemPtr = NULL; canvasPtr->textInfo.selectFirst = TCL_INDEX_NONE; canvasPtr->textInfo.selectLast = TCL_INDEX_NONE; canvasPtr->textInfo.anchorItemPtr = NULL; canvasPtr->textInfo.selectAnchor = 0; canvasPtr->textInfo.insertBorder = NULL; canvasPtr->textInfo.insertWidth = 0; - canvasPtr->textInfo.reserved2 = NULL; canvasPtr->textInfo.insertBorderWidth = 0; - canvasPtr->textInfo.reserved1 = NULL; canvasPtr->textInfo.focusItemPtr = NULL; canvasPtr->textInfo.gotFocus = 0; canvasPtr->textInfo.cursorOn = 0; canvasPtr->insertOnTime = 0; canvasPtr->insertOffTime = 0; @@ -724,12 +786,12 @@ canvasPtr->scrollX1 = 0; canvasPtr->scrollY1 = 0; canvasPtr->scrollX2 = 0; canvasPtr->scrollY2 = 0; canvasPtr->regionObj = NULL; - canvasPtr->xScrollIncrementObj = NULL; - canvasPtr->yScrollIncrementObj = NULL; + canvasPtr->xScrollIncrement = 0; + canvasPtr->yScrollIncrement = 0; canvasPtr->scanX = 0; canvasPtr->scanXOrigin = 0; canvasPtr->scanY = 0; canvasPtr->scanYOrigin = 0; canvasPtr->hotPtr = NULL; @@ -1168,11 +1230,11 @@ * support the same semantics of index, dChars and insert methods * as lines and canvases. */ if (itemPtr == NULL || - !(itemPtr->typePtr->flags & TK_MOVABLE_POINTS)) { + !(itemPtr->typePtr->alwaysRedraw & TK_MOVABLE_POINTS)) { continue; } result = ItemIndex(canvasPtr, itemPtr, objv[3], &index); if (result != TCL_OK) { @@ -2057,21 +2119,18 @@ break; case TK_SCROLL_PAGES: newX = (int) (canvasPtr->xOrigin + count * .9 * (Tk_Width(canvasPtr->tkwin) - 2 * canvasPtr->inset)); break; - case TK_SCROLL_UNITS: { - int xScrollIncrement; - Tk_GetPixelsFromObj(NULL, canvasPtr->tkwin, canvasPtr->xScrollIncrementObj, &xScrollIncrement); - if (xScrollIncrement > 0) { - newX = canvasPtr->xOrigin + count * xScrollIncrement; + case TK_SCROLL_UNITS: + if (canvasPtr->xScrollIncrement > 0) { + newX = canvasPtr->xOrigin + count * canvasPtr->xScrollIncrement; } else { newX = (int) (canvasPtr->xOrigin + count * .1 * (Tk_Width(canvasPtr->tkwin) - 2 * canvasPtr->inset)); } break; - } default: result = TCL_ERROR; goto done; } CanvasSetOrigin(canvasPtr, newX, canvasPtr->yOrigin); @@ -2100,21 +2159,18 @@ break; case TK_SCROLL_PAGES: newY = (int) (canvasPtr->yOrigin + count * .9 * (Tk_Height(canvasPtr->tkwin) - 2 * canvasPtr->inset)); break; - case TK_SCROLL_UNITS: { - int yScrollIncrement; - Tk_GetPixelsFromObj(NULL, canvasPtr->tkwin, canvasPtr->yScrollIncrementObj, &yScrollIncrement); - if (yScrollIncrement > 0) { - newY = canvasPtr->yOrigin + count * yScrollIncrement; + case TK_SCROLL_UNITS: + if (canvasPtr->yScrollIncrement > 0) { + newY = canvasPtr->yOrigin + count * canvasPtr->yScrollIncrement; } else { newY = (int) (canvasPtr->yOrigin + count * .1 * (Tk_Height(canvasPtr->tkwin) - 2 * canvasPtr->inset)); } break; - } default: result = TCL_ERROR; goto done; } CanvasSetOrigin(canvasPtr, canvasPtr->xOrigin, newY); @@ -2266,16 +2322,14 @@ int flags) /* Flags to pass to Tk_ConfigureWidget. */ { XGCValues gcValues; GC newGC; Tk_State old_canvas_state=canvasPtr->canvas_state; - int width, height, borderWidth, highlightWidth; - int xScrollIncrement, yScrollIncrement; if (Tk_ConfigureWidget(interp, canvasPtr->tkwin, configSpecs, - objc, objv, canvasPtr, - flags) != TCL_OK) { + objc, (const char **) objv, (char *) canvasPtr, + flags|TK_CONFIG_OBJS) != TCL_OK) { return TCL_ERROR; } /* * A few options need special processing, such as setting the background @@ -2282,73 +2336,37 @@ * from a 3-D border and creating a GC for copying bits to the screen. */ Tk_SetBackgroundFromBorder(canvasPtr->tkwin, canvasPtr->bgBorder); - Tk_GetPixelsFromObj(NULL, canvasPtr->tkwin, canvasPtr->borderWidthObj, &borderWidth); - Tk_GetPixelsFromObj(NULL, canvasPtr->tkwin, canvasPtr->heightObj, &height); - Tk_GetPixelsFromObj(NULL, canvasPtr->tkwin, canvasPtr->highlightWidthObj, &highlightWidth); - Tk_GetPixelsFromObj(NULL, canvasPtr->tkwin, (Tcl_Obj *)canvasPtr->textInfo.reserved1, &canvasPtr->textInfo.insertBorderWidth); - Tk_GetPixelsFromObj(NULL, canvasPtr->tkwin, (Tcl_Obj *)canvasPtr->textInfo.reserved2, &canvasPtr->textInfo.insertWidth); - Tk_GetPixelsFromObj(NULL, canvasPtr->tkwin, (Tcl_Obj *)canvasPtr->textInfo.reserved3, &canvasPtr->textInfo.selBorderWidth); - Tk_GetPixelsFromObj(NULL, canvasPtr->tkwin, canvasPtr->widthObj, &width); - Tk_GetPixelsFromObj(NULL, canvasPtr->tkwin, canvasPtr->xScrollIncrementObj, &xScrollIncrement); - Tk_GetPixelsFromObj(NULL, canvasPtr->tkwin, canvasPtr->yScrollIncrementObj, &yScrollIncrement); - if (borderWidth < 0) { - borderWidth = 0; - Tcl_DecrRefCount(canvasPtr->borderWidthObj); - canvasPtr->borderWidthObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(canvasPtr->borderWidthObj); - } - if (height < 0) { - height = 0; - Tcl_DecrRefCount(canvasPtr->heightObj); - canvasPtr->heightObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(canvasPtr->heightObj); - } - if (highlightWidth < 0) { - highlightWidth = 0; - Tcl_DecrRefCount(canvasPtr->highlightWidthObj); - canvasPtr->highlightWidthObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(canvasPtr->highlightWidthObj); - } - if (width < 0) { - width = 0; - Tcl_DecrRefCount(canvasPtr->widthObj); - canvasPtr->widthObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(canvasPtr->widthObj); - } - if (xScrollIncrement < 0) { - xScrollIncrement = 0; - Tcl_DecrRefCount(canvasPtr->xScrollIncrementObj); - canvasPtr->xScrollIncrementObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(canvasPtr->xScrollIncrementObj); - } - if (yScrollIncrement < 0) { - yScrollIncrement = 0; - Tcl_DecrRefCount(canvasPtr->yScrollIncrementObj); - canvasPtr->yScrollIncrementObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(canvasPtr->yScrollIncrementObj); - } - canvasPtr->inset = borderWidth + highlightWidth; + if (canvasPtr->borderWidth < 0) { + canvasPtr->borderWidth = 0; + } + if (canvasPtr->height < 0) { + canvasPtr->height = 0; + } + if (canvasPtr->highlightWidth < 0) { + canvasPtr->highlightWidth = 0; + } + if (canvasPtr->width < 0) { + canvasPtr->width = 0; + } + if (canvasPtr->xScrollIncrement < 0) { + canvasPtr->xScrollIncrement = 0; + } + if (canvasPtr->yScrollIncrement < 0) { + canvasPtr->yScrollIncrement = 0; + } + canvasPtr->inset = canvasPtr->borderWidth + canvasPtr->highlightWidth; if (canvasPtr->textInfo.insertBorderWidth < 0) { canvasPtr->textInfo.insertBorderWidth = 0; - Tcl_DecrRefCount((Tcl_Obj *)canvasPtr->textInfo.reserved1); - canvasPtr->textInfo.reserved1 = Tcl_NewIntObj(0); - Tcl_IncrRefCount((Tcl_Obj *)canvasPtr->textInfo.reserved1); } if (canvasPtr->textInfo.insertWidth < 0) { canvasPtr->textInfo.insertWidth = 0; - Tcl_DecrRefCount((Tcl_Obj *)canvasPtr->textInfo.reserved2); - canvasPtr->textInfo.reserved2 = Tcl_NewIntObj(0); - Tcl_IncrRefCount((Tcl_Obj *)canvasPtr->textInfo.reserved2); } if (canvasPtr->textInfo.selBorderWidth < 0) { canvasPtr->textInfo.selBorderWidth = 0; - Tcl_DecrRefCount((Tcl_Obj *)canvasPtr->textInfo.reserved3); - canvasPtr->textInfo.reserved3 = Tcl_NewIntObj(0); - Tcl_IncrRefCount((Tcl_Obj *)canvasPtr->textInfo.reserved3); } gcValues.function = GXcopy; gcValues.graphics_exposures = False; gcValues.foreground = Tk_3DBorderColor(canvasPtr->bgBorder)->pixel; @@ -2382,12 +2400,12 @@ /* * Reset the desired dimensions for the window. */ - Tk_GeometryRequest(canvasPtr->tkwin, width + 2 * canvasPtr->inset, - height + 2 * canvasPtr->inset); + Tk_GeometryRequest(canvasPtr->tkwin, canvasPtr->width + 2 * canvasPtr->inset, + canvasPtr->height + 2 * canvasPtr->inset); /* * Restart the cursor timing sequence in case the on-time or off-time just * changed. */ @@ -2437,20 +2455,20 @@ flags = canvasPtr->tsoffset.flags; if (flags & TK_OFFSET_LEFT) { canvasPtr->tsoffset.xoffset = 0; } else if (flags & TK_OFFSET_CENTER) { - canvasPtr->tsoffset.xoffset = width / 2; + canvasPtr->tsoffset.xoffset = canvasPtr->width / 2; } else if (flags & TK_OFFSET_RIGHT) { - canvasPtr->tsoffset.xoffset = width; + canvasPtr->tsoffset.xoffset = canvasPtr->width; } if (flags & TK_OFFSET_TOP) { canvasPtr->tsoffset.yoffset = 0; } else if (flags & TK_OFFSET_MIDDLE) { - canvasPtr->tsoffset.yoffset = height / 2; + canvasPtr->tsoffset.yoffset = canvasPtr->height / 2; } else if (flags & TK_OFFSET_BOTTOM) { - canvasPtr->tsoffset.yoffset = height; + canvasPtr->tsoffset.yoffset = canvasPtr->height; } /* * Reset the canvas's origin (this is a no-op unless confine mode has just * been turned on or the scroll region has changed). @@ -2490,14 +2508,10 @@ void *instanceData) /* Information about widget. */ { TkCanvas *canvasPtr = (TkCanvas *)instanceData; Tk_Item *itemPtr; - Tk_GetPixelsFromObj(NULL, canvasPtr->tkwin, (Tcl_Obj *)canvasPtr->textInfo.reserved1, &canvasPtr->textInfo.insertBorderWidth); - Tk_GetPixelsFromObj(NULL, canvasPtr->tkwin, (Tcl_Obj *)canvasPtr->textInfo.reserved2, &canvasPtr->textInfo.insertWidth); - Tk_GetPixelsFromObj(NULL, canvasPtr->tkwin, (Tcl_Obj *)canvasPtr->textInfo.reserved3, &canvasPtr->textInfo.selBorderWidth); - itemPtr = canvasPtr->firstItemPtr; for ( ; itemPtr != NULL; itemPtr = itemPtr->nextPtr) { if (ItemConfigure(canvasPtr, itemPtr, 0, NULL) != TCL_OK) { Tcl_ResetResult(canvasPtr->interp); } @@ -3065,11 +3079,10 @@ TkCanvas *canvasPtr = (TkCanvas *)clientData; Tk_Window tkwin = canvasPtr->tkwin; Tk_Item *itemPtr; Pixmap pixmap; int screenX1, screenX2, screenY1, screenY2, width, height; - int borderWidth, highlightWidth; if (canvasPtr->tkwin == NULL) { return; } @@ -3243,34 +3256,33 @@ /* * Draw the window borders, if needed. */ borders: - Tk_GetPixelsFromObj(NULL, canvasPtr->tkwin, canvasPtr->borderWidthObj, &borderWidth); - Tk_GetPixelsFromObj(NULL, canvasPtr->tkwin, canvasPtr->highlightWidthObj, &highlightWidth); if (canvasPtr->flags & REDRAW_BORDERS) { canvasPtr->flags &= ~REDRAW_BORDERS; - if (borderWidth > 0) { + if (canvasPtr->borderWidth > 0) { Tk_Draw3DRectangle(tkwin, Tk_WindowId(tkwin), - canvasPtr->bgBorder, highlightWidth, highlightWidth, - Tk_Width(tkwin) - 2 * highlightWidth, - Tk_Height(tkwin) - 2 * highlightWidth, - borderWidth, canvasPtr->relief); + canvasPtr->bgBorder, canvasPtr->highlightWidth, + canvasPtr->highlightWidth, + Tk_Width(tkwin) - 2 * canvasPtr->highlightWidth, + Tk_Height(tkwin) - 2 * canvasPtr->highlightWidth, + canvasPtr->borderWidth, canvasPtr->relief); } - if (highlightWidth > 0) { + if (canvasPtr->highlightWidth > 0) { GC fgGC, bgGC; bgGC = Tk_GCForColor(canvasPtr->highlightBgColorPtr, Tk_WindowId(tkwin)); if (canvasPtr->textInfo.gotFocus) { fgGC = Tk_GCForColor(canvasPtr->highlightColorPtr, Tk_WindowId(tkwin)); Tk_DrawHighlightBorder(tkwin, fgGC, bgGC, - highlightWidth, Tk_WindowId(tkwin)); + canvasPtr->highlightWidth, Tk_WindowId(tkwin)); } else { Tk_DrawHighlightBorder(tkwin, bgGC, bgGC, - highlightWidth, Tk_WindowId(tkwin)); + canvasPtr->highlightWidth, Tk_WindowId(tkwin)); } } } done: @@ -3358,12 +3370,12 @@ } else if (eventPtr->type == UnmapNotify) { Tk_Item *itemPtr; /* * Special hack: if the canvas is unmapped, then must notify all items - * with flag TK_ALWAYS_REDRAW set, so that they know that they are no - * longer displayed. + * with "alwaysRedraw" set, so that they know that they are no longer + * displayed. */ for (itemPtr = canvasPtr->firstItemPtr; itemPtr != NULL; itemPtr = itemPtr->nextPtr) { if (AlwaysRedraw(itemPtr)) { @@ -5640,12 +5652,10 @@ CanvasFocusProc( TkCanvas *canvasPtr, /* Canvas that just got or lost focus. */ int gotFocus) /* 1 means window is getting focus, 0 means * it's losing it. */ { - int highlightWidth; - Tcl_DeleteTimerHandler(canvasPtr->insertBlinkHandler); if (gotFocus) { canvasPtr->textInfo.gotFocus = 1; canvasPtr->textInfo.cursorOn = 1; if (canvasPtr->insertOffTime != 0) { @@ -5656,12 +5666,11 @@ canvasPtr->textInfo.gotFocus = 0; canvasPtr->textInfo.cursorOn = 0; canvasPtr->insertBlinkHandler = NULL; } EventuallyRedrawItem(canvasPtr, canvasPtr->textInfo.focusItemPtr); - Tk_GetPixelsFromObj(NULL, canvasPtr->tkwin, canvasPtr->highlightWidthObj, &highlightWidth); - if (highlightWidth > 0) { + if (canvasPtr->highlightWidth > 0) { canvasPtr->flags |= REDRAW_BORDERS; if (!(canvasPtr->flags & REDRAW_PENDING)) { Tcl_DoWhenIdle(DisplayCanvas, canvasPtr); canvasPtr->flags |= REDRAW_PENDING; } @@ -5999,40 +6008,37 @@ int yOrigin) /* New Y origin for canvas (canvas y-coord * corresponding to top edge of canvas * window). */ { int left, right, top, bottom, delta; - int xScrollIncrement, yScrollIncrement; /* * If scroll increments have been set, round the window origin to the * nearest multiple of the increments. Remember, the origin is the place * just inside the borders, not the upper left corner. */ - Tk_GetPixelsFromObj(NULL, canvasPtr->tkwin, canvasPtr->xScrollIncrementObj, &xScrollIncrement); - Tk_GetPixelsFromObj(NULL, canvasPtr->tkwin, canvasPtr->yScrollIncrementObj, &yScrollIncrement); - if (xScrollIncrement > 0) { - if (xOrigin >= 0) { - xOrigin += xScrollIncrement/2; - xOrigin -= (xOrigin + canvasPtr->inset) - % xScrollIncrement; - } else { - xOrigin = (-xOrigin) + xScrollIncrement/2; - xOrigin = -(xOrigin - (xOrigin - canvasPtr->inset) - % xScrollIncrement); - } - } - if (yScrollIncrement > 0) { - if (yOrigin >= 0) { - yOrigin += yScrollIncrement/2; - yOrigin -= (yOrigin + canvasPtr->inset) - % yScrollIncrement; - } else { - yOrigin = (-yOrigin) + yScrollIncrement/2; - yOrigin = -(yOrigin - (yOrigin - canvasPtr->inset) - % yScrollIncrement); + if (canvasPtr->xScrollIncrement > 0) { + if (xOrigin >= 0) { + xOrigin += canvasPtr->xScrollIncrement/2; + xOrigin -= (xOrigin + canvasPtr->inset) + % canvasPtr->xScrollIncrement; + } else { + xOrigin = (-xOrigin) + canvasPtr->xScrollIncrement/2; + xOrigin = -(xOrigin - (xOrigin - canvasPtr->inset) + % canvasPtr->xScrollIncrement); + } + } + if (canvasPtr->yScrollIncrement > 0) { + if (yOrigin >= 0) { + yOrigin += canvasPtr->yScrollIncrement/2; + yOrigin -= (yOrigin + canvasPtr->inset) + % canvasPtr->yScrollIncrement; + } else { + yOrigin = (-yOrigin) + canvasPtr->yScrollIncrement/2; + yOrigin = -(yOrigin - (yOrigin - canvasPtr->inset) + % canvasPtr->yScrollIncrement); } } /* * Adjust the origin if necessary to keep as much as possible of the @@ -6052,31 +6058,31 @@ top = yOrigin + canvasPtr->inset - canvasPtr->scrollY1; bottom = canvasPtr->scrollY2 - (yOrigin + Tk_Height(canvasPtr->tkwin) - canvasPtr->inset); if ((left < 0) && (right > 0)) { delta = (right > -left) ? -left : right; - if (xScrollIncrement > 0) { - delta -= delta % xScrollIncrement; + if (canvasPtr->xScrollIncrement > 0) { + delta -= delta % canvasPtr->xScrollIncrement; } xOrigin += delta; } else if ((right < 0) && (left > 0)) { delta = (left > -right) ? -right : left; - if (xScrollIncrement > 0) { - delta -= delta % xScrollIncrement; + if (canvasPtr->xScrollIncrement > 0) { + delta -= delta % canvasPtr->xScrollIncrement; } xOrigin -= delta; } if ((top < 0) && (bottom > 0)) { delta = (bottom > -top) ? -top : bottom; - if (yScrollIncrement > 0) { - delta -= delta % yScrollIncrement; + if (canvasPtr->yScrollIncrement > 0) { + delta -= delta % canvasPtr->yScrollIncrement; } yOrigin += delta; } else if ((bottom < 0) && (top > 0)) { delta = (top > -bottom) ? -bottom : top; - if (yScrollIncrement > 0) { - delta -= delta % yScrollIncrement; + if (canvasPtr->yScrollIncrement > 0) { + delta -= delta % canvasPtr->yScrollIncrement; } yOrigin -= delta; } } @@ -6102,11 +6108,47 @@ Tk_CanvasEventuallyRedraw((Tk_Canvas) canvasPtr, canvasPtr->xOrigin, canvasPtr->yOrigin, canvasPtr->xOrigin + Tk_Width(canvasPtr->tkwin), canvasPtr->yOrigin + Tk_Height(canvasPtr->tkwin)); } + +/* + *---------------------------------------------------------------------- + * + * TkGetStringsFromObjs -- + * + * Results: + * Converts object list into string list. + * + * Side effects: + * Memory is allocated for the objv array, which must be freed using + * ckfree() when no longer needed. + * + *---------------------------------------------------------------------- + */ + +#if !defined(TK_NO_DEPRECATED) && (TK_MAJOR_VERSION < 9) +static const char ** +TkGetStringsFromObjs( + Tcl_Size objc, + Tcl_Obj *const objv[]) +{ + Tcl_Size i; + const char **argv; + if (objc <= 0) { + return NULL; + } + argv = (const char **)ckalloc((objc+1) * sizeof(char *)); + for (i = 0; i < objc; i++) { + argv[i] = Tcl_GetString(objv[i]); + } + argv[objc] = 0; + return argv; +} +#endif + /* *-------------------------------------------------------------- * * Tk_CanvasPsColor -- * Index: generic/tkCmds.c ================================================================== --- generic/tkCmds.c +++ generic/tkCmds.c @@ -454,11 +454,11 @@ /* * Names starting with "." are malloced rather than Uids, so they * have to be freed. */ - ckfree((void *)p); + ckfree((char *)p); } } ckfree(winPtr->tagPtr); winPtr->numTags = 0; winPtr->tagPtr = NULL; Index: generic/tkColor.c ================================================================== --- generic/tkColor.c +++ generic/tkColor.c @@ -150,11 +150,11 @@ /* * Still no luck. Call Tk_GetColor to allocate a new TkColor object. */ - tkColPtr = (TkColor *) Tk_GetColor(interp, tkwin, Tcl_GetString(objPtr)); + tkColPtr = (TkColor *)Tk_GetColor(interp, tkwin, Tcl_GetString(objPtr)); objPtr->internalRep.twoPtrValue.ptr1 = tkColPtr; if (tkColPtr != NULL) { /* The resourceRefCount is incremented by Tk_GetColor. */ tkColPtr->objRefCount++; } Index: generic/tkConsole.c ================================================================== --- generic/tkConsole.c +++ generic/tkConsole.c @@ -220,11 +220,11 @@ /* * Ensure that we are getting a compatible version of Tcl. */ - if (Tcl_InitStubs(interp, "8.7-", 0) == NULL) { + if (Tcl_InitStubs(interp, "8.6-", 0) == NULL) { return; } consoleInitPtr = (int *)Tcl_GetThreadData(&consoleInitKey, (int) sizeof(int)); if (*consoleInitPtr) { @@ -439,11 +439,11 @@ ConsoleEventProc, info); info->refCount++; } Tcl_Preserve(consoleInterp); - result = Tcl_EvalEx(consoleInterp, "source $tk_library/console.tcl", + result = Tcl_EvalEx(consoleInterp, "source -encoding utf-8 $tk_library/console.tcl", TCL_INDEX_NONE, TCL_EVAL_GLOBAL); if (result == TCL_ERROR) { Tcl_SetReturnOptions(interp, Tcl_GetReturnOptions(consoleInterp, result)); Tcl_SetObjResult(interp, Tcl_GetObjResult(consoleInterp)); Index: generic/tkCursor.c ================================================================== --- generic/tkCursor.c +++ generic/tkCursor.c @@ -319,12 +319,12 @@ 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. */ int width, int height, /* Dimensions of cursor. */ int xHot, int yHot, /* Location of hot-spot in cursor. */ - const char *fg, /* Foreground color for cursor. */ - const char *bg) /* Background color for cursor. */ + Tk_Uid fg, /* Foreground color for cursor. */ + Tk_Uid bg) /* Background color for cursor. */ { DataKey dataKey; Tcl_HashEntry *dataHashPtr; TkCursor *cursorPtr; int isNew; @@ -339,12 +339,12 @@ dataKey.mask = mask; dataKey.width = width; dataKey.height = height; dataKey.xHot = xHot; dataKey.yHot = yHot; - dataKey.fg = Tk_GetUid(fg); - dataKey.bg = Tk_GetUid(bg); + dataKey.fg = fg; + dataKey.bg = bg; dataKey.display = Tk_Display(tkwin); dataHashPtr = Tcl_CreateHashEntry(&dispPtr->cursorDataTable, (char *) &dataKey, &isNew); if (!isNew) { cursorPtr = (TkCursor *)Tcl_GetHashValue(dataHashPtr); Index: generic/tkDList.h ================================================================== --- generic/tkDList.h +++ generic/tkDList.h @@ -438,11 +438,11 @@ __TK_DLIST_UNUSED \ static void \ LT##_Free(struct ElemType *elem) \ { \ LT##_Remove(elem); \ - ckfree((void *)elem); \ + ckfree((char *)elem); \ } \ \ __TK_DLIST_UNUSED \ static void \ LT##_RemoveHead(LT *head) \ @@ -506,11 +506,11 @@ struct ElemType *p; \ struct ElemType *next; \ assert(head); \ for (p = head->first; p; p = next) { \ next = LT##_Next(p); \ - ckfree((void *)p); \ + ckfree((char *)p); \ } \ LT##_Init(head); \ } \ \ __TK_DLIST_UNUSED \ Index: generic/tkDecls.h ================================================================== --- generic/tkDecls.h +++ generic/tkDecls.h @@ -140,11 +140,11 @@ void *widgRec, const char *argvName, int flags); /* 29 */ EXTERN int Tk_ConfigureWidget(Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, - Tcl_Size objc, Tcl_Obj *const *objv, + Tcl_Size argc, const char **argv, void *widgRec, int flags); /* 30 */ EXTERN void Tk_ConfigureWindow(Tk_Window tkwin, unsigned int valueMask, XWindowChanges *valuePtr); @@ -286,11 +286,13 @@ int needFlags); /* 75 */ EXTERN void Tk_FreePixmap(Display *display, Pixmap pixmap); /* 76 */ EXTERN void Tk_FreeTextLayout(Tk_TextLayout textLayout); -/* Slot 77 is reserved */ +/* 77 */ +TK_DEPRECATED("function does nothing, call can be removed") +void Tk_FreeXId(Display *display, XID xid); /* 78 */ EXTERN GC Tk_GCForColor(XColor *colorPtr, Drawable drawable); /* 79 */ EXTERN void Tk_GeometryRequest(Tk_Window tkwin, int reqWidth, int reqHeight); @@ -332,12 +334,11 @@ const char *str); /* 92 */ EXTERN Tk_Cursor Tk_GetCursorFromData(Tcl_Interp *interp, Tk_Window tkwin, const char *source, const char *mask, int width, int height, - int xHot, int yHot, const char *fg, - const char *bg); + int xHot, int yHot, Tk_Uid fg, Tk_Uid bg); /* 93 */ EXTERN Tk_Font Tk_GetFont(Tcl_Interp *interp, Tk_Window tkwin, const char *str); /* 94 */ EXTERN Tk_Font Tk_GetFontFromObj(Tk_Window tkwin, Tcl_Obj *objPtr); @@ -410,11 +411,12 @@ EXTERN Tk_Window Tk_IdToWindow(Display *display, Window window); /* 117 */ EXTERN void Tk_ImageChanged(Tk_ImageModel model, int x, int y, int width, int height, int imageWidth, int imageHeight); -/* Slot 118 is reserved */ +/* 118 */ +EXTERN int Tk_Init(Tcl_Interp *interp); /* 119 */ EXTERN Atom Tk_InternAtom(Tk_Window tkwin, const char *name); /* 120 */ EXTERN int Tk_IntersectTextLayout(Tk_TextLayout layout, int x, int y, int width, int height); @@ -472,22 +474,38 @@ Tk_LostSelProc *proc, void *clientData); /* 143 */ EXTERN int Tk_ParseArgv(Tcl_Interp *interp, Tk_Window tkwin, int *argcPtr, const char **argv, const Tk_ArgvInfo *argTable, int flags); -/* Slot 144 is reserved */ -/* Slot 145 is reserved */ +/* 144 */ +TK_DEPRECATED("function signature changed") +void Tk_PhotoPutBlock_NoComposite(Tk_PhotoHandle handle, + Tk_PhotoImageBlock *blockPtr, int x, int y, + int width, int height); +/* 145 */ +TK_DEPRECATED("function signature changed") +void Tk_PhotoPutZoomedBlock_NoComposite( + Tk_PhotoHandle handle, + Tk_PhotoImageBlock *blockPtr, int x, int y, + int width, int height, int zoomX, int zoomY, + int subsampleX, int subsampleY); /* 146 */ EXTERN int Tk_PhotoGetImage(Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr); /* 147 */ EXTERN void Tk_PhotoBlank(Tk_PhotoHandle handle); -/* Slot 148 is reserved */ +/* 148 */ +TK_DEPRECATED("function signature changed") +void Tk_PhotoExpand_Panic(Tk_PhotoHandle handle, + int width, int height); /* 149 */ EXTERN void Tk_PhotoGetSize(Tk_PhotoHandle handle, int *widthPtr, int *heightPtr); -/* Slot 150 is reserved */ +/* 150 */ +TK_DEPRECATED("function signature changed") +void Tk_PhotoSetSize_Panic(Tk_PhotoHandle handle, + int width, int height); /* 151 */ EXTERN int Tk_PointToChar(Tk_TextLayout layout, int x, int y); /* 152 */ EXTERN int Tk_PostscriptFontName(Tk_Font tkfont, Tcl_DString *dsPtr); @@ -509,11 +527,12 @@ EXTERN int Tk_RestackWindow(Tk_Window tkwin, int aboveBelow, Tk_Window other); /* 158 */ EXTERN Tk_RestrictProc * Tk_RestrictEvents(Tk_RestrictProc *proc, void *arg, void **prevArgPtr); -/* Slot 159 is reserved */ +/* 159 */ +EXTERN int Tk_SafeInit(Tcl_Interp *interp); /* 160 */ EXTERN const char * Tk_SetAppName(Tk_Window tkwin, const char *name); /* 161 */ EXTERN void Tk_SetBackgroundFromBorder(Tk_Window tkwin, Tk_3DBorder border); @@ -658,21 +677,25 @@ Tcl_Size objc, Tcl_Obj *const objv[], double *dblPtr, int *intPtr); /* 211 */ EXTERN int Tk_InitOptions(Tcl_Interp *interp, void *recordPtr, Tk_OptionTable optionToken, Tk_Window tkwin); -/* Slot 212 is reserved */ +/* 212 */ +EXTERN void Tk_MainEx(Tcl_Size argc, char **argv, + Tcl_AppInitProc *appInitProc, + Tcl_Interp *interp); /* 213 */ EXTERN void Tk_RestoreSavedOptions(Tk_SavedOptions *savePtr); /* 214 */ EXTERN int Tk_SetOptions(Tcl_Interp *interp, void *recordPtr, Tk_OptionTable optionTable, Tcl_Size objc, Tcl_Obj *const objv[], Tk_Window tkwin, Tk_SavedOptions *savePtr, int *maskPtr); /* 215 */ EXTERN void Tk_InitConsoleChannels(Tcl_Interp *interp); -/* Slot 216 is reserved */ +/* 216 */ +EXTERN int Tk_CreateConsoleWindow(Tcl_Interp *interp); /* 217 */ EXTERN void Tk_CreateSmoothMethod(Tcl_Interp *interp, const Tk_SmoothMethod *method); /* Slot 218 is reserved */ /* Slot 219 is reserved */ @@ -760,12 +783,21 @@ EXTERN void Tk_SetMinimumRequestSize(Tk_Window tkwin, int minWidth, int minHeight); /* 245 */ EXTERN void Tk_SetCaretPos(Tk_Window tkwin, int x, int y, int height); -/* Slot 246 is reserved */ -/* Slot 247 is reserved */ +/* 246 */ +TK_DEPRECATED("function signature changed") +void Tk_PhotoPutBlock_Panic(Tk_PhotoHandle handle, + Tk_PhotoImageBlock *blockPtr, int x, int y, + int width, int height, int compRule); +/* 247 */ +TK_DEPRECATED("function signature changed") +void Tk_PhotoPutZoomedBlock_Panic(Tk_PhotoHandle handle, + Tk_PhotoImageBlock *blockPtr, int x, int y, + int width, int height, int zoomX, int zoomY, + int subsampleX, int subsampleY, int compRule); /* 248 */ EXTERN int Tk_CollapseMotionEvents(Display *display, int collapse); /* 249 */ EXTERN Tk_StyleEngine Tk_RegisterStyleEngine(const char *name, @@ -787,12 +819,14 @@ /* 256 */ EXTERN const char * Tk_NameOfStyle(Tk_Style style); /* 257 */ EXTERN Tk_Style Tk_AllocStyleFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr); -/* Slot 258 is reserved */ -/* Slot 259 is reserved */ +/* 258 */ +EXTERN Tk_Style Tk_GetStyleFromObj(Tcl_Obj *objPtr); +/* 259 */ +EXTERN void Tk_FreeStyleFromObj(Tcl_Obj *objPtr); /* 260 */ EXTERN Tk_StyledElement Tk_GetStyledElement(Tk_Style style, Tcl_Size elementId, Tk_OptionTable optionTable); /* 261 */ @@ -836,12 +870,15 @@ EXTERN long Tk_GetUserInactiveTime(Display *dpy); /* 270 */ EXTERN void Tk_ResetUserInactiveTime(Display *dpy); /* 271 */ EXTERN Tcl_Interp * Tk_Interp(Tk_Window tkwin); -/* Slot 272 is reserved */ -/* Slot 273 is reserved */ +/* 272 */ +EXTERN void Tk_CreateOldImageType(const Tk_ImageType *typePtr); +/* 273 */ +EXTERN void Tk_CreateOldPhotoImageFormat( + const Tk_PhotoImageFormat *formatPtr); /* 274 */ EXTERN int Tk_AlwaysShowSelection(Tk_Window tkwin); /* 275 */ EXTERN unsigned Tk_GetButtonMask(unsigned button); /* 276 */ @@ -886,10 +923,28 @@ EXTERN void Tk_Get3DBorderColors(Tk_3DBorder border, XColor *bgColorPtr, XColor *darkColorPtr, XColor *lightColorPtr); /* 290 */ EXTERN Window Tk_MakeWindow(Tk_Window tkwin, Window parent); +/* 291 */ +EXTERN void Tk_UnderlineCharsInContext(Display *display, + Drawable drawable, GC gc, Tk_Font tkfont, + const char *string, Tcl_Size numBytes, int x, + int y, Tcl_Size firstByte, Tcl_Size lastByte); +/* 292 */ +EXTERN void Tk_DrawCharsInContext(Display *display, + Drawable drawable, GC gc, Tk_Font tkfont, + const char *string, Tcl_Size numBytes, + Tcl_Size rangeStart, Tcl_Size rangeLength, + int x, int y); +/* 293 */ +EXTERN int Tk_MeasureCharsInContext(Tk_Font tkfont, + const char *string, Tcl_Size numBytes, + Tcl_Size rangeStart, Tcl_Size rangeLength, + int maxPixels, int flags, int *lengthPtr); +/* 294 */ +EXTERN void TkUnusedStubEntry(void); typedef struct { const struct TkPlatStubs *tkPlatStubs; const struct TkIntStubs *tkIntStubs; const struct TkIntPlatStubs *tkIntPlatStubs; @@ -927,11 +982,11 @@ void (*tk_ClearSelection) (Tk_Window tkwin, Atom selection); /* 24 */ int (*tk_ClipboardAppend) (Tcl_Interp *interp, Tk_Window tkwin, Atom target, Atom format, const char *buffer); /* 25 */ int (*tk_ClipboardClear) (Tcl_Interp *interp, Tk_Window tkwin); /* 26 */ int (*tk_ConfigureInfo) (Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, void *widgRec, const char *argvName, int flags); /* 27 */ int (*tk_ConfigureValue) (Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, void *widgRec, const char *argvName, int flags); /* 28 */ - int (*tk_ConfigureWidget) (Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, Tcl_Size objc, Tcl_Obj *const *objv, void *widgRec, int flags); /* 29 */ + int (*tk_ConfigureWidget) (Tcl_Interp *interp, Tk_Window tkwin, const Tk_ConfigSpec *specs, Tcl_Size argc, const char **argv, void *widgRec, int flags); /* 29 */ void (*tk_ConfigureWindow) (Tk_Window tkwin, unsigned int valueMask, XWindowChanges *valuePtr); /* 30 */ Tk_TextLayout (*tk_ComputeTextLayout) (Tk_Font font, const char *str, Tcl_Size numChars, int wrapLength, Tk_Justify justify, int flags, int *widthPtr, int *heightPtr); /* 31 */ Tk_Window (*tk_CoordsToWindow) (int rootX, int rootY, Tk_Window tkwin); /* 32 */ unsigned long (*tk_CreateBinding) (Tcl_Interp *interp, Tk_BindingTable bindingTable, void *object, const char *eventStr, const char *script, int append); /* 33 */ Tk_BindingTable (*tk_CreateBindingTable) (Tcl_Interp *interp); /* 34 */ @@ -975,11 +1030,11 @@ void (*tk_FreeGC) (Display *display, GC gc); /* 72 */ void (*tk_FreeImage) (Tk_Image image); /* 73 */ void (*tk_FreeOptions) (const Tk_ConfigSpec *specs, void *widgRec, Display *display, int needFlags); /* 74 */ void (*tk_FreePixmap) (Display *display, Pixmap pixmap); /* 75 */ void (*tk_FreeTextLayout) (Tk_TextLayout textLayout); /* 76 */ - void (*reserved77)(void); + TCL_DEPRECATED_API("function does nothing, call can be removed") void (*tk_FreeXId) (Display *display, XID xid); /* 77 */ GC (*tk_GCForColor) (XColor *colorPtr, Drawable drawable); /* 78 */ void (*tk_GeometryRequest) (Tk_Window tkwin, int reqWidth, int reqHeight); /* 79 */ Tk_3DBorder (*tk_Get3DBorder) (Tcl_Interp *interp, Tk_Window tkwin, const char *colorName); /* 80 */ void (*tk_GetAllBindings) (Tcl_Interp *interp, Tk_BindingTable bindingTable, void *object); /* 81 */ int (*tk_GetAnchor) (Tcl_Interp *interp, const char *str, Tk_Anchor *anchorPtr); /* 82 */ @@ -990,11 +1045,11 @@ int (*tk_GetCapStyle) (Tcl_Interp *interp, const char *str, int *capPtr); /* 87 */ XColor * (*tk_GetColor) (Tcl_Interp *interp, Tk_Window tkwin, const char *name); /* 88 */ XColor * (*tk_GetColorByValue) (Tk_Window tkwin, XColor *colorPtr); /* 89 */ Colormap (*tk_GetColormap) (Tcl_Interp *interp, Tk_Window tkwin, const char *str); /* 90 */ Tk_Cursor (*tk_GetCursor) (Tcl_Interp *interp, Tk_Window tkwin, const char *str); /* 91 */ - Tk_Cursor (*tk_GetCursorFromData) (Tcl_Interp *interp, Tk_Window tkwin, const char *source, const char *mask, int width, int height, int xHot, int yHot, const char *fg, const char *bg); /* 92 */ + Tk_Cursor (*tk_GetCursorFromData) (Tcl_Interp *interp, Tk_Window tkwin, const char *source, const char *mask, int width, int height, int xHot, int yHot, Tk_Uid fg, Tk_Uid bg); /* 92 */ Tk_Font (*tk_GetFont) (Tcl_Interp *interp, Tk_Window tkwin, const char *str); /* 93 */ Tk_Font (*tk_GetFontFromObj) (Tk_Window tkwin, Tcl_Obj *objPtr); /* 94 */ void (*tk_GetFontMetrics) (Tk_Font font, Tk_FontMetrics *fmPtr); /* 95 */ GC (*tk_GetGC) (Tk_Window tkwin, unsigned long valueMask, XGCValues *valuePtr); /* 96 */ Tk_Image (*tk_GetImage) (Tcl_Interp *interp, Tk_Window tkwin, const char *name, Tk_ImageChangedProc *changeProc, void *clientData); /* 97 */ @@ -1016,11 +1071,11 @@ void (*tk_GetVRootGeometry) (Tk_Window tkwin, int *xPtr, int *yPtr, int *widthPtr, int *heightPtr); /* 113 */ int (*tk_Grab) (Tcl_Interp *interp, Tk_Window tkwin, int grabGlobal); /* 114 */ void (*tk_HandleEvent) (XEvent *eventPtr); /* 115 */ Tk_Window (*tk_IdToWindow) (Display *display, Window window); /* 116 */ void (*tk_ImageChanged) (Tk_ImageModel model, int x, int y, int width, int height, int imageWidth, int imageHeight); /* 117 */ - void (*reserved118)(void); + int (*tk_Init) (Tcl_Interp *interp); /* 118 */ Atom (*tk_InternAtom) (Tk_Window tkwin, const char *name); /* 119 */ int (*tk_IntersectTextLayout) (Tk_TextLayout layout, int x, int y, int width, int height); /* 120 */ void (*tk_MaintainGeometry) (Tk_Window window, Tk_Window container, int x, int y, int width, int height); /* 121 */ Tk_Window (*tk_MainWindow) (Tcl_Interp *interp); /* 122 */ void (*tk_MakeWindowExist) (Tk_Window tkwin); /* 123 */ @@ -1042,26 +1097,26 @@ const char * (*tk_NameOfJustify) (Tk_Justify justify); /* 139 */ const char * (*tk_NameOfRelief) (int relief); /* 140 */ Tk_Window (*tk_NameToWindow) (Tcl_Interp *interp, const char *pathName, Tk_Window tkwin); /* 141 */ void (*tk_OwnSelection) (Tk_Window tkwin, Atom selection, Tk_LostSelProc *proc, void *clientData); /* 142 */ int (*tk_ParseArgv) (Tcl_Interp *interp, Tk_Window tkwin, int *argcPtr, const char **argv, const Tk_ArgvInfo *argTable, int flags); /* 143 */ - void (*reserved144)(void); - void (*reserved145)(void); + TCL_DEPRECATED_API("function signature changed") void (*tk_PhotoPutBlock_NoComposite) (Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height); /* 144 */ + TCL_DEPRECATED_API("function signature changed") void (*tk_PhotoPutZoomedBlock_NoComposite) (Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int zoomX, int zoomY, int subsampleX, int subsampleY); /* 145 */ int (*tk_PhotoGetImage) (Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr); /* 146 */ void (*tk_PhotoBlank) (Tk_PhotoHandle handle); /* 147 */ - void (*reserved148)(void); + TCL_DEPRECATED_API("function signature changed") void (*tk_PhotoExpand_Panic) (Tk_PhotoHandle handle, int width, int height); /* 148 */ void (*tk_PhotoGetSize) (Tk_PhotoHandle handle, int *widthPtr, int *heightPtr); /* 149 */ - void (*reserved150)(void); + TCL_DEPRECATED_API("function signature changed") void (*tk_PhotoSetSize_Panic) (Tk_PhotoHandle handle, int width, int height); /* 150 */ int (*tk_PointToChar) (Tk_TextLayout layout, int x, int y); /* 151 */ int (*tk_PostscriptFontName) (Tk_Font tkfont, Tcl_DString *dsPtr); /* 152 */ void (*tk_PreserveColormap) (Display *display, Colormap colormap); /* 153 */ void (*tk_QueueWindowEvent) (XEvent *eventPtr, Tcl_QueuePosition position); /* 154 */ void (*tk_RedrawImage) (Tk_Image image, int imageX, int imageY, int width, int height, Drawable drawable, int drawableX, int drawableY); /* 155 */ void (*tk_ResizeWindow) (Tk_Window tkwin, int width, int height); /* 156 */ int (*tk_RestackWindow) (Tk_Window tkwin, int aboveBelow, Tk_Window other); /* 157 */ Tk_RestrictProc * (*tk_RestrictEvents) (Tk_RestrictProc *proc, void *arg, void **prevArgPtr); /* 158 */ - void (*reserved159)(void); + int (*tk_SafeInit) (Tcl_Interp *interp); /* 159 */ const char * (*tk_SetAppName) (Tk_Window tkwin, const char *name); /* 160 */ void (*tk_SetBackgroundFromBorder) (Tk_Window tkwin, Tk_3DBorder border); /* 161 */ void (*tk_SetClass) (Tk_Window tkwin, const char *className); /* 162 */ void (*tk_SetGrid) (Tk_Window tkwin, int reqWidth, int reqHeight, int gridWidth, int gridHeight); /* 163 */ void (*tk_SetInternalBorder) (Tk_Window tkwin, int width); /* 164 */ @@ -1110,15 +1165,15 @@ int (*tk_GetMMFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, double *doublePtr); /* 207 */ int (*tk_GetPixelsFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, int *intPtr); /* 208 */ int (*tk_GetReliefFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *resultPtr); /* 209 */ int (*tk_GetScrollInfoObj) (Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[], double *dblPtr, int *intPtr); /* 210 */ int (*tk_InitOptions) (Tcl_Interp *interp, void *recordPtr, Tk_OptionTable optionToken, Tk_Window tkwin); /* 211 */ - void (*reserved212)(void); + TCL_DEPRECATED_API("Don't use this function in a stub-enabled extension") void (*tk_MainEx) (Tcl_Size argc, char **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); /* 212 */ void (*tk_RestoreSavedOptions) (Tk_SavedOptions *savePtr); /* 213 */ int (*tk_SetOptions) (Tcl_Interp *interp, void *recordPtr, Tk_OptionTable optionTable, Tcl_Size objc, Tcl_Obj *const objv[], Tk_Window tkwin, Tk_SavedOptions *savePtr, int *maskPtr); /* 214 */ void (*tk_InitConsoleChannels) (Tcl_Interp *interp); /* 215 */ - void (*reserved216)(void); + int (*tk_CreateConsoleWindow) (Tcl_Interp *interp); /* 216 */ void (*tk_CreateSmoothMethod) (Tcl_Interp *interp, const Tk_SmoothMethod *method); /* 217 */ void (*reserved218)(void); void (*reserved219)(void); int (*tk_GetDash) (Tcl_Interp *interp, const char *value, Tk_Dash *dash); /* 220 */ void (*tk_CreateOutline) (Tk_Outline *outline); /* 221 */ @@ -1144,12 +1199,12 @@ Tk_Window (*tk_CreateAnonymousWindow) (Tcl_Interp *interp, Tk_Window parent, const char *screenName); /* 241 */ void (*tk_SetClassProcs) (Tk_Window tkwin, const Tk_ClassProcs *procs, void *instanceData); /* 242 */ void (*tk_SetInternalBorderEx) (Tk_Window tkwin, int left, int right, int top, int bottom); /* 243 */ void (*tk_SetMinimumRequestSize) (Tk_Window tkwin, int minWidth, int minHeight); /* 244 */ void (*tk_SetCaretPos) (Tk_Window tkwin, int x, int y, int height); /* 245 */ - void (*reserved246)(void); - void (*reserved247)(void); + TCL_DEPRECATED_API("function signature changed") void (*tk_PhotoPutBlock_Panic) (Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int compRule); /* 246 */ + TCL_DEPRECATED_API("function signature changed") void (*tk_PhotoPutZoomedBlock_Panic) (Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int zoomX, int zoomY, int subsampleX, int subsampleY, int compRule); /* 247 */ int (*tk_CollapseMotionEvents) (Display *display, int collapse); /* 248 */ Tk_StyleEngine (*tk_RegisterStyleEngine) (const char *name, Tk_StyleEngine parent); /* 249 */ Tk_StyleEngine (*tk_GetStyleEngine) (const char *name); /* 250 */ int (*tk_RegisterStyledElement) (Tk_StyleEngine engine, Tk_ElementSpec *templatePtr); /* 251 */ int (*tk_GetElementId) (const char *name); /* 252 */ @@ -1156,12 +1211,12 @@ Tk_Style (*tk_CreateStyle) (const char *name, Tk_StyleEngine engine, void *clientData); /* 253 */ Tk_Style (*tk_GetStyle) (Tcl_Interp *interp, const char *name); /* 254 */ void (*tk_FreeStyle) (Tk_Style style); /* 255 */ const char * (*tk_NameOfStyle) (Tk_Style style); /* 256 */ Tk_Style (*tk_AllocStyleFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr); /* 257 */ - void (*reserved258)(void); - void (*reserved259)(void); + Tk_Style (*tk_GetStyleFromObj) (Tcl_Obj *objPtr); /* 258 */ + void (*tk_FreeStyleFromObj) (Tcl_Obj *objPtr); /* 259 */ Tk_StyledElement (*tk_GetStyledElement) (Tk_Style style, Tcl_Size elementId, Tk_OptionTable optionTable); /* 260 */ void (*tk_GetElementSize) (Tk_Style style, Tk_StyledElement element, void *recordPtr, Tk_Window tkwin, int width, int height, int inner, int *widthPtr, int *heightPtr); /* 261 */ void (*tk_GetElementBox) (Tk_Style style, Tk_StyledElement element, void *recordPtr, Tk_Window tkwin, int x, int y, int width, int height, int inner, int *xPtr, int *yPtr, int *widthPtr, int *heightPtr); /* 262 */ int (*tk_GetElementBorderWidth) (Tk_Style style, Tk_StyledElement element, void *recordPtr, Tk_Window tkwin); /* 263 */ void (*tk_DrawElement) (Tk_Style style, Tk_StyledElement element, void *recordPtr, Tk_Window tkwin, Drawable d, int x, int y, int width, int height, int state); /* 264 */ @@ -1170,12 +1225,12 @@ int (*tk_PhotoPutZoomedBlock) (Tcl_Interp *interp, Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height, int zoomX, int zoomY, int subsampleX, int subsampleY, int compRule); /* 267 */ int (*tk_PhotoSetSize) (Tcl_Interp *interp, Tk_PhotoHandle handle, int width, int height); /* 268 */ long (*tk_GetUserInactiveTime) (Display *dpy); /* 269 */ void (*tk_ResetUserInactiveTime) (Display *dpy); /* 270 */ Tcl_Interp * (*tk_Interp) (Tk_Window tkwin); /* 271 */ - void (*reserved272)(void); - void (*reserved273)(void); + void (*tk_CreateOldImageType) (const Tk_ImageType *typePtr); /* 272 */ + void (*tk_CreateOldPhotoImageFormat) (const Tk_PhotoImageFormat *formatPtr); /* 273 */ int (*tk_AlwaysShowSelection) (Tk_Window tkwin); /* 274 */ unsigned (*tk_GetButtonMask) (unsigned button); /* 275 */ int (*tk_GetDoublePixelsFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, double *doublePtr); /* 276 */ Tcl_Obj * (*tk_NewWindowObj) (Tk_Window tkwin); /* 277 */ void (*tk_SendVirtualEvent) (Tk_Window tkwin, const char *eventName, Tcl_Obj *detail); /* 278 */ @@ -1189,10 +1244,14 @@ int (*tk_UseWindow) (Tcl_Interp *interp, Tk_Window tkwin, const char *string); /* 286 */ void (*tk_MakeContainer) (Tk_Window tkwin); /* 287 */ Tk_Window (*tk_GetOtherWindow) (Tk_Window tkwin); /* 288 */ void (*tk_Get3DBorderColors) (Tk_3DBorder border, XColor *bgColorPtr, XColor *darkColorPtr, XColor *lightColorPtr); /* 289 */ Window (*tk_MakeWindow) (Tk_Window tkwin, Window parent); /* 290 */ + void (*tk_UnderlineCharsInContext) (Display *display, Drawable drawable, GC gc, Tk_Font tkfont, const char *string, Tcl_Size numBytes, int x, int y, Tcl_Size firstByte, Tcl_Size lastByte); /* 291 */ + void (*tk_DrawCharsInContext) (Display *display, Drawable drawable, GC gc, Tk_Font tkfont, const char *string, Tcl_Size numBytes, Tcl_Size rangeStart, Tcl_Size rangeLength, int x, int y); /* 292 */ + int (*tk_MeasureCharsInContext) (Tk_Font tkfont, const char *string, Tcl_Size numBytes, Tcl_Size rangeStart, Tcl_Size rangeLength, int maxPixels, int flags, int *lengthPtr); /* 293 */ + void (*tkUnusedStubEntry) (void); /* 294 */ } TkStubs; extern const TkStubs *tkStubsPtr; #ifdef __cplusplus @@ -1357,11 +1416,12 @@ (tkStubsPtr->tk_FreeOptions) /* 74 */ #define Tk_FreePixmap \ (tkStubsPtr->tk_FreePixmap) /* 75 */ #define Tk_FreeTextLayout \ (tkStubsPtr->tk_FreeTextLayout) /* 76 */ -/* Slot 77 is reserved */ +#define Tk_FreeXId \ + (tkStubsPtr->tk_FreeXId) /* 77 */ #define Tk_GCForColor \ (tkStubsPtr->tk_GCForColor) /* 78 */ #define Tk_GeometryRequest \ (tkStubsPtr->tk_GeometryRequest) /* 79 */ #define Tk_Get3DBorder \ @@ -1438,11 +1498,12 @@ (tkStubsPtr->tk_HandleEvent) /* 115 */ #define Tk_IdToWindow \ (tkStubsPtr->tk_IdToWindow) /* 116 */ #define Tk_ImageChanged \ (tkStubsPtr->tk_ImageChanged) /* 117 */ -/* Slot 118 is reserved */ +#define Tk_Init \ + (tkStubsPtr->tk_Init) /* 118 */ #define Tk_InternAtom \ (tkStubsPtr->tk_InternAtom) /* 119 */ #define Tk_IntersectTextLayout \ (tkStubsPtr->tk_IntersectTextLayout) /* 120 */ #define Tk_MaintainGeometry \ @@ -1489,20 +1550,24 @@ (tkStubsPtr->tk_NameToWindow) /* 141 */ #define Tk_OwnSelection \ (tkStubsPtr->tk_OwnSelection) /* 142 */ #define Tk_ParseArgv \ (tkStubsPtr->tk_ParseArgv) /* 143 */ -/* Slot 144 is reserved */ -/* Slot 145 is reserved */ +#define Tk_PhotoPutBlock_NoComposite \ + (tkStubsPtr->tk_PhotoPutBlock_NoComposite) /* 144 */ +#define Tk_PhotoPutZoomedBlock_NoComposite \ + (tkStubsPtr->tk_PhotoPutZoomedBlock_NoComposite) /* 145 */ #define Tk_PhotoGetImage \ (tkStubsPtr->tk_PhotoGetImage) /* 146 */ #define Tk_PhotoBlank \ (tkStubsPtr->tk_PhotoBlank) /* 147 */ -/* Slot 148 is reserved */ +#define Tk_PhotoExpand_Panic \ + (tkStubsPtr->tk_PhotoExpand_Panic) /* 148 */ #define Tk_PhotoGetSize \ (tkStubsPtr->tk_PhotoGetSize) /* 149 */ -/* Slot 150 is reserved */ +#define Tk_PhotoSetSize_Panic \ + (tkStubsPtr->tk_PhotoSetSize_Panic) /* 150 */ #define Tk_PointToChar \ (tkStubsPtr->tk_PointToChar) /* 151 */ #define Tk_PostscriptFontName \ (tkStubsPtr->tk_PostscriptFontName) /* 152 */ #define Tk_PreserveColormap \ @@ -1515,11 +1580,12 @@ (tkStubsPtr->tk_ResizeWindow) /* 156 */ #define Tk_RestackWindow \ (tkStubsPtr->tk_RestackWindow) /* 157 */ #define Tk_RestrictEvents \ (tkStubsPtr->tk_RestrictEvents) /* 158 */ -/* Slot 159 is reserved */ +#define Tk_SafeInit \ + (tkStubsPtr->tk_SafeInit) /* 159 */ #define Tk_SetAppName \ (tkStubsPtr->tk_SetAppName) /* 160 */ #define Tk_SetBackgroundFromBorder \ (tkStubsPtr->tk_SetBackgroundFromBorder) /* 161 */ #define Tk_SetClass \ @@ -1620,18 +1686,20 @@ (tkStubsPtr->tk_GetReliefFromObj) /* 209 */ #define Tk_GetScrollInfoObj \ (tkStubsPtr->tk_GetScrollInfoObj) /* 210 */ #define Tk_InitOptions \ (tkStubsPtr->tk_InitOptions) /* 211 */ -/* Slot 212 is reserved */ +#define Tk_MainEx \ + (tkStubsPtr->tk_MainEx) /* 212 */ #define Tk_RestoreSavedOptions \ (tkStubsPtr->tk_RestoreSavedOptions) /* 213 */ #define Tk_SetOptions \ (tkStubsPtr->tk_SetOptions) /* 214 */ #define Tk_InitConsoleChannels \ (tkStubsPtr->tk_InitConsoleChannels) /* 215 */ -/* Slot 216 is reserved */ +#define Tk_CreateConsoleWindow \ + (tkStubsPtr->tk_CreateConsoleWindow) /* 216 */ #define Tk_CreateSmoothMethod \ (tkStubsPtr->tk_CreateSmoothMethod) /* 217 */ /* Slot 218 is reserved */ /* Slot 219 is reserved */ #define Tk_GetDash \ @@ -1684,12 +1752,14 @@ (tkStubsPtr->tk_SetInternalBorderEx) /* 243 */ #define Tk_SetMinimumRequestSize \ (tkStubsPtr->tk_SetMinimumRequestSize) /* 244 */ #define Tk_SetCaretPos \ (tkStubsPtr->tk_SetCaretPos) /* 245 */ -/* Slot 246 is reserved */ -/* Slot 247 is reserved */ +#define Tk_PhotoPutBlock_Panic \ + (tkStubsPtr->tk_PhotoPutBlock_Panic) /* 246 */ +#define Tk_PhotoPutZoomedBlock_Panic \ + (tkStubsPtr->tk_PhotoPutZoomedBlock_Panic) /* 247 */ #define Tk_CollapseMotionEvents \ (tkStubsPtr->tk_CollapseMotionEvents) /* 248 */ #define Tk_RegisterStyleEngine \ (tkStubsPtr->tk_RegisterStyleEngine) /* 249 */ #define Tk_GetStyleEngine \ @@ -1706,12 +1776,14 @@ (tkStubsPtr->tk_FreeStyle) /* 255 */ #define Tk_NameOfStyle \ (tkStubsPtr->tk_NameOfStyle) /* 256 */ #define Tk_AllocStyleFromObj \ (tkStubsPtr->tk_AllocStyleFromObj) /* 257 */ -/* Slot 258 is reserved */ -/* Slot 259 is reserved */ +#define Tk_GetStyleFromObj \ + (tkStubsPtr->tk_GetStyleFromObj) /* 258 */ +#define Tk_FreeStyleFromObj \ + (tkStubsPtr->tk_FreeStyleFromObj) /* 259 */ #define Tk_GetStyledElement \ (tkStubsPtr->tk_GetStyledElement) /* 260 */ #define Tk_GetElementSize \ (tkStubsPtr->tk_GetElementSize) /* 261 */ #define Tk_GetElementBox \ @@ -1732,12 +1804,14 @@ (tkStubsPtr->tk_GetUserInactiveTime) /* 269 */ #define Tk_ResetUserInactiveTime \ (tkStubsPtr->tk_ResetUserInactiveTime) /* 270 */ #define Tk_Interp \ (tkStubsPtr->tk_Interp) /* 271 */ -/* Slot 272 is reserved */ -/* Slot 273 is reserved */ +#define Tk_CreateOldImageType \ + (tkStubsPtr->tk_CreateOldImageType) /* 272 */ +#define Tk_CreateOldPhotoImageFormat \ + (tkStubsPtr->tk_CreateOldPhotoImageFormat) /* 273 */ #define Tk_AlwaysShowSelection \ (tkStubsPtr->tk_AlwaysShowSelection) /* 274 */ #define Tk_GetButtonMask \ (tkStubsPtr->tk_GetButtonMask) /* 275 */ #define Tk_GetDoublePixelsFromObj \ @@ -1768,41 +1842,59 @@ (tkStubsPtr->tk_GetOtherWindow) /* 288 */ #define Tk_Get3DBorderColors \ (tkStubsPtr->tk_Get3DBorderColors) /* 289 */ #define Tk_MakeWindow \ (tkStubsPtr->tk_MakeWindow) /* 290 */ +#define Tk_UnderlineCharsInContext \ + (tkStubsPtr->tk_UnderlineCharsInContext) /* 291 */ +#define Tk_DrawCharsInContext \ + (tkStubsPtr->tk_DrawCharsInContext) /* 292 */ +#define Tk_MeasureCharsInContext \ + (tkStubsPtr->tk_MeasureCharsInContext) /* 293 */ +#define TkUnusedStubEntry \ + (tkStubsPtr->tkUnusedStubEntry) /* 294 */ #endif /* defined(USE_TK_STUBS) */ /* !END!: Do not edit above this line. */ +/* Functions that don't belong in the stub table */ +#undef Tk_MainEx +#undef Tk_Init +#undef Tk_SafeInit +#undef Tk_CreateConsoleWindow + +#undef Tk_FreeXId +#define Tk_FreeXId(display,xid) +#undef Tk_GetStyleFromObj +#undef Tk_FreeStyleFromObj +#define Tk_GetStyleFromObj(obj) Tk_AllocStyleFromObj(NULL, obj) +#define Tk_FreeStyleFromObj(obj) /* no-op */ #define Tk_GetImageMasterData Tk_GetImageModelData #ifndef MAC_OSX_TK # undef Tk_ClipDrawableToRect #endif -EXTERN void Tk_MainEx(Tcl_Size argc, char **argv, - Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); #if defined(_WIN32) && defined(UNICODE) # define Tk_MainEx Tk_MainExW EXTERN void Tk_MainExW(Tcl_Size argc, wchar_t **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); #endif -EXTERN int Tk_Init(Tcl_Interp *interp); -EXTERN int Tk_SafeInit(Tcl_Interp *interp); -EXTERN int Tk_CreateConsoleWindow(Tcl_Interp *interp); - -#if TK_MAJOR_VERSION < 9 -/* Restore 8.x signature of Tk_ConfigureWidget, but panic if TK_CONFIG_OBJS flag is not set */ -#undef Tk_ConfigureWidget -#define Tk_ConfigureWidget(interp, tkwin, specs, argc, argv, widgRec, flags) \ - ((int (*)(Tcl_Interp *, Tk_Window, const Tk_ConfigSpec *, \ - int, const char **, char *, int))(void *)(tkStubsPtr->tk_ConfigureWidget)) \ - (((flags & TK_CONFIG_OBJS) ? interp : (Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory in Tk_ConfigureWidget"), \ - NULL)), tkwin, specs, argc, argv, widgRec, flags) -#endif + + +#if defined(TK_NO_DEPRECATED) || TCL_MAJOR_VERSION > 8 +#undef Tk_PhotoPutBlock_NoComposite +#undef Tk_PhotoPutZoomedBlock_NoComposite +#undef Tk_PhotoExpand_Panic +#undef Tk_PhotoPutBlock_Panic +#undef Tk_PhotoPutZoomedBlock_Panic +#undef Tk_PhotoSetSize_Panic +#undef Tk_CreateOldPhotoImageFormat +#endif /* TK_NO_DEPRECATED */ #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT + +#undef TkUnusedStubEntry #endif /* _TKDECLS */ Index: generic/tkEntry.c ================================================================== --- generic/tkEntry.c +++ generic/tkEntry.c @@ -72,11 +72,11 @@ {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_ENTRY_BORDER_WIDTH, offsetof(Entry, borderWidthObj), TCL_INDEX_NONE, 0, 0, 0}, + DEF_ENTRY_BORDER_WIDTH, TCL_INDEX_NONE, offsetof(Entry, borderWidth), 0, 0, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", DEF_ENTRY_CURSOR, TCL_INDEX_NONE, offsetof(Entry, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BORDER, "-disabledbackground", "disabledBackground", "DisabledBackground", DEF_ENTRY_DISABLED_BG_COLOR, TCL_INDEX_NONE, @@ -98,25 +98,25 @@ "HighlightBackground", DEF_ENTRY_HIGHLIGHT_BG, TCL_INDEX_NONE, offsetof(Entry, highlightBgColorPtr), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", DEF_ENTRY_HIGHLIGHT, TCL_INDEX_NONE, offsetof(Entry, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", - "HighlightThickness", DEF_ENTRY_HIGHLIGHT_WIDTH, offsetof(Entry, highlightWidthObj), - TCL_INDEX_NONE, 0, 0, 0}, + "HighlightThickness", DEF_ENTRY_HIGHLIGHT_WIDTH, TCL_INDEX_NONE, + offsetof(Entry, highlightWidth), 0, 0, 0}, {TK_OPTION_BORDER, "-insertbackground", "insertBackground", "Foreground", DEF_ENTRY_INSERT_BG, TCL_INDEX_NONE, offsetof(Entry, insertBorder), 0, 0, 0}, {TK_OPTION_PIXELS, "-insertborderwidth", "insertBorderWidth", - "BorderWidth", DEF_ENTRY_INSERT_BD_COLOR, offsetof(Entry, insertBorderWidthObj), - TCL_INDEX_NONE, 0, + "BorderWidth", DEF_ENTRY_INSERT_BD_COLOR, TCL_INDEX_NONE, + offsetof(Entry, insertBorderWidth), 0, DEF_ENTRY_INSERT_BD_MONO, 0}, {TK_OPTION_INT, "-insertofftime", "insertOffTime", "OffTime", DEF_ENTRY_INSERT_OFF_TIME, TCL_INDEX_NONE, offsetof(Entry, insertOffTime), 0, 0, 0}, {TK_OPTION_INT, "-insertontime", "insertOnTime", "OnTime", DEF_ENTRY_INSERT_ON_TIME, TCL_INDEX_NONE, offsetof(Entry, insertOnTime), 0, 0, 0}, {TK_OPTION_PIXELS, "-insertwidth", "insertWidth", "InsertWidth", - DEF_ENTRY_INSERT_WIDTH, offsetof(Entry, insertWidthObj), TCL_INDEX_NONE, 0, 0, 0}, + DEF_ENTRY_INSERT_WIDTH, TCL_INDEX_NONE, offsetof(Entry, insertWidth), 0, 0, 0}, {TK_OPTION_STRING, "-invalidcommand", "invalidCommand", "InvalidCommand", DEF_ENTRY_INVALIDCMD, offsetof(Entry, invalidCmdObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_SYNONYM, "-invcmd", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-invalidcommand", 0}, @@ -136,12 +136,12 @@ DEF_ENTRY_RELIEF, TCL_INDEX_NONE, offsetof(Entry, relief), 0, 0, 0}, {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground", DEF_ENTRY_SELECT_COLOR, TCL_INDEX_NONE, offsetof(Entry, selBorder), 0, DEF_ENTRY_SELECT_MONO, 0}, {TK_OPTION_PIXELS, "-selectborderwidth", "selectBorderWidth", - "BorderWidth", DEF_ENTRY_SELECT_BD_COLOR, offsetof(Entry, selBorderWidthObj), - TCL_INDEX_NONE, 0, DEF_ENTRY_SELECT_BD_MONO, 0}, + "BorderWidth", DEF_ENTRY_SELECT_BD_COLOR, TCL_INDEX_NONE, + offsetof(Entry, selBorderWidth), 0, DEF_ENTRY_SELECT_BD_MONO, 0}, {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background", DEF_ENTRY_SELECT_FG_COLOR, TCL_INDEX_NONE, offsetof(Entry, selFgColorPtr), TK_OPTION_NULL_OK, DEF_ENTRY_SELECT_FG_MONO, 0}, {TK_OPTION_STRING, "-show", "show", "Show", DEF_ENTRY_SHOW, offsetof(Entry, showCharObj), TCL_INDEX_NONE, @@ -197,11 +197,11 @@ {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_ENTRY_BORDER_WIDTH, offsetof(Entry, borderWidthObj), TCL_INDEX_NONE, 0, 0, 0}, + DEF_ENTRY_BORDER_WIDTH, TCL_INDEX_NONE, offsetof(Entry, borderWidth), 0, 0, 0}, {TK_OPTION_BORDER, "-buttonbackground", "buttonBackground", "Background", DEF_BUTTON_BG_COLOR, TCL_INDEX_NONE, offsetof(Spinbox, buttonBorder), 0, DEF_BUTTON_BG_MONO, 0}, {TK_OPTION_CURSOR, "-buttoncursor", "buttonCursor", "Cursor", DEF_BUTTON_CURSOR, TCL_INDEX_NONE, offsetof(Spinbox, bCursor), @@ -241,26 +241,26 @@ "HighlightBackground", DEF_ENTRY_HIGHLIGHT_BG, TCL_INDEX_NONE, offsetof(Entry, highlightBgColorPtr), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", DEF_ENTRY_HIGHLIGHT, TCL_INDEX_NONE, offsetof(Entry, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", - "HighlightThickness", DEF_ENTRY_HIGHLIGHT_WIDTH, offsetof(Entry, highlightWidthObj), - TCL_INDEX_NONE, 0, 0, 0}, + "HighlightThickness", DEF_ENTRY_HIGHLIGHT_WIDTH, TCL_INDEX_NONE, + offsetof(Entry, highlightWidth), 0, 0, 0}, {TK_OPTION_DOUBLE, "-increment", "increment", "Increment", DEF_SPINBOX_INCREMENT, TCL_INDEX_NONE, offsetof(Spinbox, increment), 0, 0, 0}, {TK_OPTION_BORDER, "-insertbackground", "insertBackground", "Foreground", DEF_ENTRY_INSERT_BG, TCL_INDEX_NONE, offsetof(Entry, insertBorder), 0, 0, 0}, {TK_OPTION_PIXELS, "-insertborderwidth", "insertBorderWidth", - "BorderWidth", DEF_ENTRY_INSERT_BD_COLOR, offsetof(Entry, insertBorderWidthObj), - TCL_INDEX_NONE, 0, DEF_ENTRY_INSERT_BD_MONO, 0}, + "BorderWidth", DEF_ENTRY_INSERT_BD_COLOR, TCL_INDEX_NONE, + offsetof(Entry, insertBorderWidth), 0, DEF_ENTRY_INSERT_BD_MONO, 0}, {TK_OPTION_INT, "-insertofftime", "insertOffTime", "OffTime", DEF_ENTRY_INSERT_OFF_TIME, TCL_INDEX_NONE, offsetof(Entry, insertOffTime), 0, 0, 0}, {TK_OPTION_INT, "-insertontime", "insertOnTime", "OnTime", DEF_ENTRY_INSERT_ON_TIME, TCL_INDEX_NONE, offsetof(Entry, insertOnTime), 0, 0, 0}, {TK_OPTION_PIXELS, "-insertwidth", "insertWidth", "InsertWidth", - DEF_ENTRY_INSERT_WIDTH, offsetof(Entry, insertWidthObj), TCL_INDEX_NONE, 0, 0, 0}, + DEF_ENTRY_INSERT_WIDTH, TCL_INDEX_NONE, offsetof(Entry, insertWidth), 0, 0, 0}, {TK_OPTION_STRING, "-invalidcommand", "invalidCommand", "InvalidCommand", DEF_ENTRY_INVALIDCMD, offsetof(Entry, invalidCmdObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_SYNONYM, "-invcmd", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-invalidcommand", 0}, @@ -286,12 +286,12 @@ 0, 0, 0}, {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground", DEF_ENTRY_SELECT_COLOR, TCL_INDEX_NONE, offsetof(Entry, selBorder), 0, DEF_ENTRY_SELECT_MONO, 0}, {TK_OPTION_PIXELS, "-selectborderwidth", "selectBorderWidth", - "BorderWidth", DEF_ENTRY_SELECT_BD_COLOR, offsetof(Entry, selBorderWidthObj), - TCL_INDEX_NONE, 0, DEF_ENTRY_SELECT_BD_MONO, 0}, + "BorderWidth", DEF_ENTRY_SELECT_BD_COLOR, TCL_INDEX_NONE, + offsetof(Entry, selBorderWidth), 0, DEF_ENTRY_SELECT_BD_MONO, 0}, {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background", DEF_ENTRY_SELECT_FG_COLOR, TCL_INDEX_NONE, offsetof(Entry, selFgColorPtr), TK_OPTION_NULL_OK, DEF_ENTRY_SELECT_FG_MONO, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", DEF_ENTRY_STATE, TCL_INDEX_NONE, offsetof(Entry, state), @@ -436,11 +436,11 @@ double *firstPtr, double *lastPtr); static Tcl_ObjCmdProc EntryWidgetObjCmd; static void EntryWorldChanged(void *instanceData); static int GetEntryIndex(Tcl_Interp *interp, Entry *entryPtr, Tcl_Obj *indexObj, Tcl_Size *indexPtr); -static int InsertChars(Entry *entryPtr, Tcl_Size index, Tcl_Obj *obj); +static int InsertChars(Entry *entryPtr, Tcl_Size index, const char *string); /* * These forward declarations are the spinbox specific ones: */ @@ -748,11 +748,11 @@ if (GetEntryIndex(interp, entryPtr, objv[2], &index) != TCL_OK) { goto error; } if (entryPtr->state == STATE_NORMAL) { - code = InsertChars(entryPtr, index, objv[3]); + code = InsertChars(entryPtr, index, Tcl_GetString(objv[3])); if (code != TCL_OK) { goto error; } } break; @@ -1042,11 +1042,11 @@ /* * Free up all the stuff that requires special handling, then let * Tk_FreeOptions handle all the standard option-related stuff. */ - ckfree((void *)entryPtr->string); + ckfree((char *)entryPtr->string); if (entryPtr->textVarNameObj != NULL) { Tcl_UntraceVar2(entryPtr->interp, Tcl_GetString(entryPtr->textVarNameObj), NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, EntryTextVarProc, entryPtr); entryPtr->flags &= ~ENTRY_VAR_TRACED; @@ -1057,11 +1057,11 @@ if (entryPtr->selTextGC != NULL) { Tk_FreeGC(entryPtr->display, entryPtr->selTextGC); } Tcl_DeleteTimerHandler(entryPtr->insertBlinkHandler); if (entryPtr->displayString != entryPtr->string) { - ckfree((void *)entryPtr->displayString); + ckfree((char *)entryPtr->displayString); } if (entryPtr->type == TK_SPINBOX) { Spinbox *sbPtr = (Spinbox *) entryPtr; if (sbPtr->listObj != NULL) { @@ -1122,12 +1122,10 @@ int valuesChanged = 0; double oldFrom = 0.0; double oldTo = 0.0; int code; size_t formatSpace = TCL_DOUBLE_SPACE; - int borderWidth, highlightWidth, insertWidth; - int insertBorderWidth, selBorderWidth; /* * Eliminate any existing trace on a variable monitored by the entry. */ @@ -1187,44 +1185,24 @@ } else { border = entryPtr->normalBorder; } Tk_SetBackgroundFromBorder(entryPtr->tkwin, border); - Tk_GetPixelsFromObj(NULL, entryPtr->tkwin, entryPtr->borderWidthObj, &borderWidth); - if (borderWidth < 0) { - borderWidth = 0; - Tcl_DecrRefCount(entryPtr->borderWidthObj); - entryPtr->borderWidthObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(entryPtr->borderWidthObj); - } - Tk_GetPixelsFromObj(NULL, entryPtr->tkwin, entryPtr->highlightWidthObj, &highlightWidth); - if (highlightWidth < 0) { - highlightWidth = 0; - Tcl_DecrRefCount(entryPtr->highlightWidthObj); - entryPtr->highlightWidthObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(entryPtr->highlightWidthObj); - } - Tk_GetPixelsFromObj(NULL, entryPtr->tkwin, entryPtr->insertBorderWidthObj, &insertBorderWidth); - if (insertBorderWidth < 0) { - insertBorderWidth = 0; - Tcl_DecrRefCount(entryPtr->insertBorderWidthObj); - entryPtr->insertBorderWidthObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(entryPtr->insertBorderWidthObj); - } - Tk_GetPixelsFromObj(NULL, entryPtr->tkwin, entryPtr->insertWidthObj, &insertWidth); - if (insertWidth < 0) { - insertWidth = 0; - Tcl_DecrRefCount(entryPtr->insertWidthObj); - entryPtr->insertWidthObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(entryPtr->insertWidthObj); - } - Tk_GetPixelsFromObj(NULL, entryPtr->tkwin, entryPtr->selBorderWidthObj, &selBorderWidth); - if (selBorderWidth < 0) { - selBorderWidth = 0; - Tcl_DecrRefCount(entryPtr->selBorderWidthObj); - entryPtr->selBorderWidthObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(entryPtr->selBorderWidthObj); + if (entryPtr->borderWidth < 0) { + entryPtr->borderWidth = 0; + } + if (entryPtr->highlightWidth < 0) { + entryPtr->highlightWidth = 0; + } + if (entryPtr->insertBorderWidth < 0) { + entryPtr->insertBorderWidth = 0; + } + if (entryPtr->insertWidth < 0) { + entryPtr->insertWidth = 0; + } + if (entryPtr->selBorderWidth < 0) { + entryPtr->selBorderWidth = 0; } if (entryPtr->type == TK_SPINBOX) { if (sbPtr->fromValue > sbPtr->toValue) { /* @@ -1341,13 +1319,13 @@ * Recompute the window's geometry and arrange for it to be * redisplayed. */ Tk_SetInternalBorder(entryPtr->tkwin, - borderWidth + highlightWidth); - entryPtr->inset = highlightWidth - + borderWidth + XPAD; + entryPtr->borderWidth + entryPtr->highlightWidth); + entryPtr->inset = entryPtr->highlightWidth + + entryPtr->borderWidth + XPAD; break; } if (!error) { Tk_FreeSavedOptions(&savedOptions); } @@ -1648,11 +1626,10 @@ int baseY, selStartX, selEndX, cursorX; int showSelection, xBound; Tk_FontMetrics fm; Pixmap pixmap; Tk_3DBorder border; - int borderWidth, selBorderWidth, insertWidth, highlightWidth; entryPtr->flags &= ~REDRAW_PENDING; if ((entryPtr->flags & ENTRY_DELETED) || !Tk_IsMapped(tkwin)) { return; } @@ -1728,11 +1705,10 @@ } else { border = entryPtr->normalBorder; } Tk_Fill3DRectangle(tkwin, pixmap, border, 0, 0, Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT); - Tk_GetPixelsFromObj(NULL, tkwin, entryPtr->selBorderWidthObj, &selBorderWidth); if (showSelection && (entryPtr->state != STATE_DISABLED) && (entryPtr->selectLast > entryPtr->leftIndex)) { if (entryPtr->selectFirst <= entryPtr->leftIndex) { selStartX = entryPtr->leftX; @@ -1739,20 +1715,20 @@ } else { Tk_CharBbox(entryPtr->textLayout, entryPtr->selectFirst, &selStartX, NULL, NULL, NULL); selStartX += entryPtr->layoutX; } - if ((selStartX - selBorderWidth) < xBound) { + if ((selStartX - entryPtr->selBorderWidth) < xBound) { Tk_CharBbox(entryPtr->textLayout, entryPtr->selectLast, &selEndX, NULL, NULL, NULL); selEndX += entryPtr->layoutX; Tk_Fill3DRectangle(tkwin, pixmap, entryPtr->selBorder, - selStartX - selBorderWidth, - baseY - fm.ascent - selBorderWidth, - (selEndX - selStartX) + 2 * selBorderWidth, - (fm.ascent + fm.descent) + 2 * selBorderWidth, - selBorderWidth, + selStartX - entryPtr->selBorderWidth, + baseY - fm.ascent - entryPtr->selBorderWidth, + (selEndX - selStartX) + 2 * entryPtr->selBorderWidth, + (fm.ascent + fm.descent) + 2 * entryPtr->selBorderWidth, + entryPtr->selBorderWidth, #ifndef MAC_OSX_TK TK_RELIEF_RAISED #else MAC_OSX_ENTRY_SELECT_RELIEF #endif @@ -1767,33 +1743,31 @@ * (e.g., on mono displays), write background in the cursor area (instead * of nothing) when the cursor isn't on. Otherwise the selection would * hide the cursor. */ - Tk_GetPixelsFromObj(NULL, tkwin, entryPtr->insertWidthObj, &insertWidth); if ((entryPtr->state == STATE_NORMAL) && (entryPtr->flags & GOT_FOCUS)) { Tk_CharBbox(entryPtr->textLayout, entryPtr->insertPos, &cursorX, NULL, NULL, NULL); cursorX += entryPtr->layoutX; - cursorX -= (insertWidth <= 1) ? 1 : (insertWidth)/2; + cursorX -= (entryPtr->insertWidth <= 1) ? 1 : (entryPtr->insertWidth)/2; Tk_SetCaretPos(entryPtr->tkwin, cursorX, baseY - fm.ascent, fm.ascent + fm.descent); if ((entryPtr->insertPos >= entryPtr->leftIndex) && cursorX < xBound) { if (entryPtr->flags & CURSOR_ON) { /* Take minimum of given insertBorderWidth and insertWidth/2 */ - int insertBorderWidth; - Tk_GetPixelsFromObj(NULL, entryPtr->tkwin, entryPtr->insertBorderWidthObj, &insertBorderWidth); - if (insertBorderWidth > insertWidth/2) { - insertBorderWidth = insertWidth/2; + int insertBorderWidth = entryPtr->insertWidth/2; + if (entryPtr->insertBorderWidth < insertBorderWidth) { + insertBorderWidth = entryPtr->insertBorderWidth; } Tk_Fill3DRectangle(tkwin, pixmap, entryPtr->insertBorder, - cursorX, baseY - fm.ascent, insertWidth, + cursorX, baseY - fm.ascent, entryPtr->insertWidth, fm.ascent + fm.descent, insertBorderWidth, TK_RELIEF_RAISED); } else if (entryPtr->insertBorder == entryPtr->selBorder) { Tk_Fill3DRectangle(tkwin, pixmap, border, cursorX, - baseY - fm.ascent, insertWidth, + baseY - fm.ascent, entryPtr->insertWidth, fm.ascent + fm.descent, 0, TK_RELIEF_FLAT); } } } @@ -1941,20 +1915,18 @@ /* * Draw the border and focus highlight last, so they will overwrite any * text that extends past the viewable part of the window. */ - Tk_GetPixelsFromObj(NULL, entryPtr->tkwin, entryPtr->borderWidthObj, &borderWidth); - Tk_GetPixelsFromObj(NULL, entryPtr->tkwin, entryPtr->highlightWidthObj, &highlightWidth); if (!TkpDrawEntryBorderAndFocus(entryPtr, pixmap, (entryPtr->type == TK_SPINBOX))) { - xBound = highlightWidth; + xBound = entryPtr->highlightWidth; if (entryPtr->relief != TK_RELIEF_FLAT) { Tk_Draw3DRectangle(tkwin, pixmap, border, xBound, xBound, Tk_Width(tkwin) - 2 * xBound, Tk_Height(tkwin) - 2 * xBound, - borderWidth, entryPtr->relief); + entryPtr->borderWidth, entryPtr->relief); } if (xBound > 0) { GC fgGC, bgGC; bgGC = Tk_GCForColor(entryPtr->highlightBgColorPtr, pixmap); @@ -2010,11 +1982,11 @@ int height, width, i; Tk_FontMetrics fm; char *p; if (entryPtr->displayString != entryPtr->string) { - ckfree((void *)entryPtr->displayString); + ckfree((char *)entryPtr->displayString); entryPtr->displayString = entryPtr->string; entryPtr->numDisplayBytes = entryPtr->numBytes; } /* @@ -2032,12 +2004,12 @@ * the display string. If we didn't do this, then two malformed * characters might end up looking like one valid UTF character in the * resulting string. */ - Tcl_UtfToUniChar(Tcl_GetString(entryPtr->showCharObj), &ch); - size = Tcl_UniCharToUtf(ch, buf); + TkUtfToUniChar(Tcl_GetString(entryPtr->showCharObj), &ch); + size = TkUniCharToUtf(ch, buf); entryPtr->numDisplayBytes = entryPtr->numChars * size; p = (char *)ckalloc(entryPtr->numDisplayBytes + 1); entryPtr->displayString = p; @@ -2190,19 +2162,19 @@ static int InsertChars( Entry *entryPtr, /* Entry that is to get the new elements. */ Tcl_Size index, /* Add the new elements before this character * index. */ - Tcl_Obj *obj) /* New characters to add. */ + const char *value) /* New characters to add (NULL-terminated + * string). */ { size_t byteIndex, byteCount, newByteCount, oldChars, charsAdded; const char *string; - const char *value = Tcl_GetString(obj); char *newStr; string = entryPtr->string; - byteIndex = Tcl_UtfAtIndex(string, index) - string; + byteIndex = TkUtfAtIndex(string, index) - string; byteCount = strlen(value); if (byteCount == 0) { return TCL_OK; } @@ -2218,11 +2190,11 @@ VALIDATE_INSERT) != TCL_OK) { ckfree(newStr); return TCL_OK; } - ckfree((void *)string); + ckfree((char *)string); entryPtr->string = newStr; /* * The following construction is used because inserting improperly formed * UTF-8 sequences between other improperly formed UTF-8 sequences could @@ -2231,11 +2203,11 @@ * context. The actual number of characters added is how many characters * are in the string now minus the number that used to be there. */ oldChars = entryPtr->numChars; - entryPtr->numChars = Tcl_NumUtfChars(newStr, TCL_INDEX_NONE); + entryPtr->numChars = TkNumUtfChars(newStr, TCL_INDEX_NONE); charsAdded = entryPtr->numChars - oldChars; entryPtr->numBytes += byteCount; if (entryPtr->displayString == string) { entryPtr->displayString = newStr; @@ -2302,12 +2274,12 @@ if ((int)count <= 0) { return TCL_OK; } string = entryPtr->string; - byteIndex = Tcl_UtfAtIndex(string, index) - string; - byteCount = Tcl_UtfAtIndex(string + byteIndex, count) - (string+byteIndex); + byteIndex = TkUtfAtIndex(string, index) - string; + byteCount = TkUtfAtIndex(string + byteIndex, count) - (string+byteIndex); newByteCount = entryPtr->numBytes + 1 - byteCount; newStr = (char *)ckalloc(newByteCount); memcpy(newStr, string, (size_t) byteIndex); strcpy(newStr + byteIndex, string + byteIndex + byteCount); @@ -2324,11 +2296,11 @@ ckfree(toDelete); return TCL_OK; } ckfree(toDelete); - ckfree((void *)entryPtr->string); + ckfree((char *)entryPtr->string); entryPtr->string = newStr; entryPtr->numChars -= count; entryPtr->numBytes -= byteCount; if (entryPtr->displayString == string) { @@ -2514,17 +2486,17 @@ * aborted because the validatecommand did something else instead */ if (entryPtr->flags & VALIDATE_ABORT) { entryPtr->flags &= ~VALIDATE_ABORT; - ckfree((void *)value); + ckfree((char *)value); return; } } oldSource = entryPtr->string; - ckfree((void *)entryPtr->string); + ckfree((char *)entryPtr->string); if (malloced) { entryPtr->string = value; } else { char *tmp = (char *)ckalloc(valueLen + 1); @@ -2531,11 +2503,11 @@ strcpy(tmp, value); entryPtr->string = tmp; } entryPtr->numBytes = valueLen; - entryPtr->numChars = Tcl_NumUtfChars(value, valueLen); + entryPtr->numChars = TkNumUtfChars(value, valueLen); if (entryPtr->displayString == oldSource) { entryPtr->displayString = entryPtr->string; entryPtr->numDisplayBytes = entryPtr->numBytes; } @@ -2961,12 +2933,12 @@ if ((entryPtr->selectFirst < 0) || (!entryPtr->exportSelection) || Tcl_IsSafe(entryPtr->interp)) { return -1; } string = entryPtr->displayString; - selStart = Tcl_UtfAtIndex(string, entryPtr->selectFirst); - selEnd = Tcl_UtfAtIndex(selStart, + selStart = TkUtfAtIndex(string, entryPtr->selectFirst); + selEnd = TkUtfAtIndex(selStart, entryPtr->selectLast - entryPtr->selectFirst); if (selEnd <= selStart + offset) { return 0; } byteCount = selEnd - selStart - offset; @@ -3614,11 +3586,11 @@ * There's a percent sequence here. Process it. */ before++; /* skip over % */ if (*before != '\0') { - before += Tcl_UtfToUniChar(before, &ch); + before += TkUtfToUniChar(before, &ch); } else { ch = '%'; } if (type == VALIDATE_BUTTON) { /* @@ -3634,11 +3606,11 @@ break; case 'W': /* widget name */ string = Tk_PathName(entryPtr->tkwin); break; default: - length = Tcl_UniCharToUtf(ch, numStorage); + length = TkUniCharToUtf(ch, numStorage); numStorage[length] = '\0'; string = numStorage; break; } } else { @@ -3694,11 +3666,11 @@ break; case 'W': /* widget name */ string = Tk_PathName(entryPtr->tkwin); break; default: - length = Tcl_UniCharToUtf(ch, numStorage); + length = TkUniCharToUtf(ch, numStorage); numStorage[length] = '\0'; string = numStorage; break; } } @@ -4040,11 +4012,11 @@ if (GetEntryIndex(interp, entryPtr, objv[2], &index) != TCL_OK) { goto error; } if (entryPtr->state == STATE_NORMAL) { - code = InsertChars(entryPtr, index, objv[3]); + code = InsertChars(entryPtr, index, Tcl_GetString(objv[3])); if (code != TCL_OK) { goto error; } } break; Index: generic/tkFont.c ================================================================== --- generic/tkFont.c +++ generic/tkFont.c @@ -574,11 +574,11 @@ * The 'charPtr' arg must be a single Unicode. */ if (charPtr != NULL) { const char *string = Tcl_GetString(charPtr); - size_t len = Tcl_UtfToUniChar(string, &uniChar); + size_t len = TkUtfToUniChar(string, &uniChar); if (len != (size_t)charPtr->length) { resultPtr = Tcl_NewStringObj( "expected a single character but got \"", TCL_INDEX_NONE); Tcl_AppendLimitedToObj(resultPtr, string, @@ -646,11 +646,11 @@ &nfPtr->fa); UpdateDependentFonts(fiPtr, tkwin, namedHashPtr); return result; } return GetAttributeInfoObj(interp, &nfPtr->fa, objPtr); - } + } case FONT_CREATE: { int skip = 3, i; const char *name; char buf[16 + TCL_INTEGER_SPACE]; TkFontAttributes fa; @@ -1731,18 +1731,18 @@ for (; *src != '\0'; ) { while (isspace(UCHAR(*src))) { /* INTL: ISO space */ src++; upper = 1; } - src += Tcl_UtfToUniChar(src, &ch); + src += TkUtfToUniChar(src, &ch); if (upper) { ch = Tcl_UniCharToUpper(ch); upper = 0; } else { ch = Tcl_UniCharToLower(ch); } - dest += Tcl_UniCharToUtf(ch, dest); + dest += TkUniCharToUtf(ch, dest); } *dest = '\0'; Tcl_DStringSetLength(dsPtr, dest - Tcl_DStringValue(dsPtr)); family = Tcl_DStringValue(dsPtr) + len; } @@ -1853,11 +1853,11 @@ } /* *--------------------------------------------------------------------------- * - * Tk_UnderlineChars, TkUnderlineCharsInContext -- + * Tk_UnderlineChars, Tk_UnderlineCharsInContext -- * * These procedures draw an underline for a given range of characters in * a given string. They don't draw the characters (which are assumed to * have been displayed previously); they just draw the underline. These * procedures would mainly be used to quickly underline a few characters @@ -1889,16 +1889,16 @@ * string is drawn. */ Tcl_Size firstByte, /* Index of first byte of first character. */ Tcl_Size lastByte) /* Index of first byte after the last * character. */ { - TkUnderlineCharsInContext(display, drawable, gc, tkfont, string, + Tk_UnderlineCharsInContext(display, drawable, gc, tkfont, string, lastByte, x, y, firstByte, lastByte); } void -TkUnderlineCharsInContext( +Tk_UnderlineCharsInContext( Display *display, /* Display on which to draw. */ Drawable drawable, /* Window or pixmap in which to draw. */ GC gc, /* Graphics context for actually drawing * line. */ Tk_Font tkfont, /* Font used in GC; must have been allocated @@ -1914,13 +1914,13 @@ * character. */ { TkFont *fontPtr = (TkFont *) tkfont; int startX, endX; - TkpMeasureCharsInContext(tkfont, string, numBytes, 0, firstByte, -1, 0, + Tk_MeasureCharsInContext(tkfont, string, numBytes, 0, firstByte, -1, 0, &startX); - TkpMeasureCharsInContext(tkfont, string, numBytes, 0, lastByte, -1, 0, + Tk_MeasureCharsInContext(tkfont, string, numBytes, 0, lastByte, -1, 0, &endX); XFillRectangle(display, drawable, gc, x + startX, y + fontPtr->underlinePos, (unsigned) (endX - startX), (unsigned) fontPtr->underlineHeight); @@ -1999,11 +1999,11 @@ fmPtr = &fontPtr->fm; height = fmPtr->ascent + fmPtr->descent; if (numChars < 0) { - numChars = Tcl_NumUtfChars(string, TCL_INDEX_NONE); + numChars = TkNumUtfChars(string, TCL_INDEX_NONE); } if (wrapLength == 0) { wrapLength = -1; } @@ -2022,11 +2022,11 @@ * Divide the string up into simple strings and measure each string. */ curX = 0; - endp = Tcl_UtfAtIndex(string, numChars); + endp = TkUtfAtIndex(string, numChars); special = string; flags &= TK_IGNORE_TABS | TK_IGNORE_NEWLINES; flags |= TK_WHOLE_WORDS | TK_AT_LEAST_ONE; for (start = string; start < endp; ) { @@ -2139,11 +2139,11 @@ bytesThisChunk = start - end; if (bytesThisChunk > 0) { bytesThisChunk = Tk_MeasureChars(tkfont, end, bytesThisChunk, -1, 0, &chunkPtr->totalWidth); chunkPtr->numBytes += bytesThisChunk; - chunkPtr->numChars += Tcl_NumUtfChars(end, bytesThisChunk); + chunkPtr->numChars += TkNumUtfChars(end, bytesThisChunk); chunkPtr->totalWidth += curX; } } wrapLine: @@ -2331,20 +2331,20 @@ if (firstChar <= 0) { drawX = 0; firstChar = 0; firstByte = chunkPtr->start; } else { - firstByte = Tcl_UtfAtIndex(chunkPtr->start, firstChar); + firstByte = TkUtfAtIndex(chunkPtr->start, firstChar); Tk_MeasureChars(layoutPtr->tkfont, chunkPtr->start, firstByte - chunkPtr->start, -1, 0, &drawX); } if (lastChar < numDisplayChars) { numDisplayChars = lastChar; } - lastByte = Tcl_UtfAtIndex(chunkPtr->start, numDisplayChars); + lastByte = TkUtfAtIndex(chunkPtr->start, numDisplayChars); #ifdef TK_DRAW_IN_CONTEXT - TkpDrawCharsInContext(display, drawable, gc, layoutPtr->tkfont, + Tk_DrawCharsInContext(display, drawable, gc, layoutPtr->tkfont, chunkPtr->start, chunkPtr->numBytes, firstByte - chunkPtr->start, lastByte - firstByte, x+chunkPtr->x, y+chunkPtr->y); #else /* !TK_DRAW_IN_CONTEXT */ Tk_DrawChars(display, drawable, gc, layoutPtr->tkfont, firstByte, @@ -2401,23 +2401,23 @@ if (firstChar <= 0) { drawX = 0; firstChar = 0; firstByte = chunkPtr->start; } else { - firstByte = Tcl_UtfAtIndex(chunkPtr->start, firstChar); + firstByte = TkUtfAtIndex(chunkPtr->start, firstChar); Tk_MeasureChars(layoutPtr->tkfont, chunkPtr->start, firstByte - chunkPtr->start, -1, 0, &drawX); } if (lastChar < numDisplayChars) { numDisplayChars = lastChar; } - lastByte = Tcl_UtfAtIndex(chunkPtr->start, numDisplayChars); + lastByte = TkUtfAtIndex(chunkPtr->start, numDisplayChars); #ifdef TK_DRAW_IN_CONTEXT dx = cosA * (chunkPtr->x) + sinA * (chunkPtr->y); dy = -sinA * (chunkPtr->x) + cosA * (chunkPtr->y); if (angle == 0.0) { - TkpDrawCharsInContext(display, drawable, gc, + Tk_DrawCharsInContext(display, drawable, gc, layoutPtr->tkfont, chunkPtr->start, chunkPtr->numBytes, firstByte - chunkPtr->start, lastByte - firstByte, (int)(x + dx), (int)(y + dy)); } else { TkpDrawAngledCharsInContext(display, drawable, gc, @@ -2661,11 +2661,11 @@ return numChars; } n = Tk_MeasureChars((Tk_Font) fontPtr, chunkPtr->start, chunkPtr->numBytes, x - chunkPtr->x, 0, &dummy); - return numChars + Tcl_NumUtfChars(chunkPtr->start, n); + return numChars + TkNumUtfChars(chunkPtr->start, n); } numChars += chunkPtr->numChars; lastPtr = chunkPtr; chunkPtr++; i++; @@ -2770,19 +2770,19 @@ x = chunkPtr->x; w = chunkPtr->totalWidth; goto check; } } else if (index < chunkPtr->numChars) { - end = Tcl_UtfAtIndex(chunkPtr->start, index); + end = TkUtfAtIndex(chunkPtr->start, index); if (xPtr != NULL) { Tk_MeasureChars(tkfont, chunkPtr->start, end - chunkPtr->start, -1, 0, &x); x += chunkPtr->x; } if (widthPtr != NULL) { int ch; - Tk_MeasureChars(tkfont, end, Tcl_UtfToUniChar(end, &ch), -1, 0, &w); + Tk_MeasureChars(tkfont, end, TkUtfToUniChar(end, &ch), -1, 0, &w); } goto check; } index -= chunkPtr->numChars; chunkPtr++; @@ -3324,11 +3324,11 @@ * from the standard set defined by Adobe. The rest get punted. * Eventually this should be revised to handle more sophsticiated * international postscript fonts. */ - p += Tcl_UtfToUniChar(p, &ch); + p += TkUtfToUniChar(p, &ch); if ((ch == '(') || (ch == ')') || (ch == '\\') || (ch < 0x20)) { /* * Tricky point: the "03" is necessary in the snprintf below, * so that a full three digits of octal are always generated. * Without the "03", a number following this sequence could be @@ -3845,11 +3845,11 @@ layoutPtr = (TextLayout *)ckrealloc(layoutPtr, s); *layoutPtrPtr = layoutPtr; *maxPtr = maxChunks; } - numChars = Tcl_NumUtfChars(start, numBytes); + numChars = TkNumUtfChars(start, numBytes); chunkPtr = &layoutPtr->chunks[layoutPtr->numChunks]; chunkPtr->start = start; chunkPtr->numBytes = numBytes; chunkPtr->numChars = numChars; chunkPtr->numDisplayChars = numChars; Index: generic/tkFrame.c ================================================================== --- generic/tkFrame.c +++ generic/tkFrame.c @@ -56,22 +56,22 @@ * allocated for this window, which must be * freed when the window is deleted. */ Tk_3DBorder border; /* Structure used to draw 3-D border and * background. NULL means no background or * border. */ - Tcl_Obj *borderWidthObj; /* Width of 3-D border (if any). */ + int borderWidth; /* Width of 3-D border (if any). */ int relief; /* 3-d effect: TK_RELIEF_RAISED etc. */ - Tcl_Obj *highlightWidthObj; /* Width in pixels of highlight to draw around + int highlightWidth; /* Width in pixels of highlight to draw around * widget when it has the focus. 0 means don't * draw a highlight. */ XColor *highlightBgColorPtr; /* Color for drawing traversal highlight area * when highlight is off. */ XColor *highlightColorPtr; /* Color for drawing traversal highlight. */ - Tcl_Obj *widthObj; /* Width to request for window. <= 0 means + int width; /* Width to request for window. <= 0 means * don't request any size. */ - Tcl_Obj *heightObj; /* Height to request for window. <= 0 means + int height; /* Height to request for window. <= 0 means * don't request any size. */ Tk_Cursor cursor; /* Current cursor for window, or None. */ Tcl_Obj *takeFocusObj; /* Value of -takefocus option; not used in the * C code, but used by keyboard traversal * scripts. May be NULL. */ @@ -193,20 +193,20 @@ DEF_FRAME_CONTAINER, TCL_INDEX_NONE, offsetof(Frame, isContainer), 0, 0, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", DEF_FRAME_CURSOR, TCL_INDEX_NONE, offsetof(Frame, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-height", "height", "Height", - DEF_FRAME_HEIGHT, offsetof(Frame, heightObj), TCL_INDEX_NONE, 0, 0, 0}, + DEF_FRAME_HEIGHT, TCL_INDEX_NONE, offsetof(Frame, height), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_FRAME_HIGHLIGHT_BG, TCL_INDEX_NONE, offsetof(Frame, highlightBgColorPtr), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", DEF_FRAME_HIGHLIGHT, TCL_INDEX_NONE, offsetof(Frame, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", - "HighlightThickness", DEF_FRAME_HIGHLIGHT_WIDTH, offsetof(Frame, highlightWidthObj), - TCL_INDEX_NONE, 0, 0, 0}, + "HighlightThickness", DEF_FRAME_HIGHLIGHT_WIDTH, TCL_INDEX_NONE, + offsetof(Frame, highlightWidth), 0, 0, 0}, {TK_OPTION_PIXELS, "-padx", "padX", "Pad", DEF_FRAME_PADX, offsetof(Frame, padXObj), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_PIXELS, "-pady", "padY", "Pad", DEF_FRAME_PADY, offsetof(Frame, padYObj), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", @@ -214,11 +214,11 @@ TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-visual", "visual", "Visual", DEF_FRAME_VISUAL, offsetof(Frame, visualNameObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-width", "width", "Width", - DEF_FRAME_WIDTH, offsetof(Frame, widthObj), TCL_INDEX_NONE, 0, 0, 0}, + DEF_FRAME_WIDTH, TCL_INDEX_NONE, offsetof(Frame, width), 0, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; static const Tk_OptionSpec frameOptSpec[] = { {TK_OPTION_STRING, "-backgroundimage", "backgroundImage", "BackgroundImage", @@ -227,11 +227,11 @@ {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bgimg", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-backgroundimage", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_FRAME_BORDER_WIDTH, offsetof(Frame, borderWidthObj), TCL_INDEX_NONE, 0, 0, 0}, + DEF_FRAME_BORDER_WIDTH, TCL_INDEX_NONE, offsetof(Frame, borderWidth), 0, 0, 0}, {TK_OPTION_STRING, "-class", "class", "Class", DEF_FRAME_CLASS, offsetof(Frame, classNameObj), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", DEF_FRAME_RELIEF, TCL_INDEX_NONE, offsetof(Frame, relief), 0, 0, 0}, {TK_OPTION_BOOLEAN, "-tile", "tile", "Tile", @@ -247,11 +247,11 @@ {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bgimg", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-backgroundimage", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_FRAME_BORDER_WIDTH, offsetof(Frame, borderWidthObj), TCL_INDEX_NONE, 0, 0, 0}, + DEF_FRAME_BORDER_WIDTH, TCL_INDEX_NONE, offsetof(Frame, borderWidth), 0, 0, 0}, {TK_OPTION_STRING, "-class", "class", "Class", DEF_TOPLEVEL_CLASS, offsetof(Frame, classNameObj), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_STRING, "-menu", "menu", "Menu", DEF_TOPLEVEL_MENU, offsetof(Frame, menuNameObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, @@ -271,11 +271,11 @@ static const Tk_OptionSpec labelframeOptSpec[] = { {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_LABELFRAME_BORDER_WIDTH, offsetof(Frame, borderWidthObj), TCL_INDEX_NONE, + DEF_LABELFRAME_BORDER_WIDTH, TCL_INDEX_NONE, offsetof(Frame, borderWidth), 0, 0, 0}, {TK_OPTION_STRING, "-class", "class", "Class", DEF_LABELFRAME_CLASS, offsetof(Frame, classNameObj), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0}, @@ -319,10 +319,13 @@ */ static void ComputeFrameGeometry(Frame *framePtr); static int ConfigureFrame(Tcl_Interp *interp, Frame *framePtr, Tcl_Size objc, Tcl_Obj *const objv[]); +static int CreateFrame(void *clientData, Tcl_Interp *interp, + Tcl_Size objc, Tcl_Obj *const objv[], + int type, const char *appName); static Tcl_FreeProc DestroyFrame; static void DestroyFramePartly(Frame *framePtr); static void DisplayFrame(void *clientData); static void DrawFrameBackground(Tk_Window tkwin, Pixmap pixmap, int highlightWidth, int borderWidth, @@ -390,31 +393,31 @@ void *clientData, /* Either NULL or pointer to option table. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return TkCreateFrame(clientData, interp, objc, objv, TYPE_FRAME, NULL); + return CreateFrame(clientData, interp, objc, objv, TYPE_FRAME, NULL); } int Tk_ToplevelObjCmd( void *clientData, /* Either NULL or pointer to option table. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return TkCreateFrame(clientData, interp, objc, objv, TYPE_TOPLEVEL, NULL); + return CreateFrame(clientData, interp, objc, objv, TYPE_TOPLEVEL, NULL); } int Tk_LabelframeObjCmd( void *clientData, /* Either NULL or pointer to option table. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - return TkCreateFrame(clientData, interp, objc, objv, TYPE_LABELFRAME, NULL); + return CreateFrame(clientData, interp, objc, objv, TYPE_LABELFRAME, NULL); } /* *-------------------------------------------------------------- * @@ -434,10 +437,64 @@ *-------------------------------------------------------------- */ int TkCreateFrame( + void *clientData, /* Either NULL or pointer to option table. */ + Tcl_Interp *interp, /* Current interpreter. */ + Tcl_Size argc, /* Number of arguments. */ + const char *const *argv, /* Argument strings. */ + int toplevel, /* Non-zero means create a toplevel window, + * zero means create a frame. */ + const char *appName) /* Should only be non-NULL if there is no main + * window associated with the interpreter. + * Gives the base name to use for the new + * application. */ +{ + int result; + Tcl_Size i; + Tcl_Obj **objv = (Tcl_Obj **)ckalloc((argc+1) * sizeof(Tcl_Obj **)); + + for (i=0; itkwin, framePtr->border); } else { Tk_SetWindowBackgroundPixmap(framePtr->tkwin, None); } - Tk_GetPixelsFromObj(NULL, framePtr->tkwin, framePtr->widthObj, &width); - if (width < 0) { - Tcl_DecrRefCount(framePtr->widthObj); - framePtr->widthObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(framePtr->widthObj); - } - Tk_GetPixelsFromObj(NULL, framePtr->tkwin, framePtr->heightObj, &height); - if (height < 0) { - Tcl_DecrRefCount(framePtr->heightObj); - framePtr->heightObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(framePtr->heightObj); - } - Tk_GetPixelsFromObj(NULL, framePtr->tkwin, framePtr->borderWidthObj, &borderWidth); - if (borderWidth < 0) { - Tcl_DecrRefCount(framePtr->borderWidthObj); - framePtr->borderWidthObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(framePtr->borderWidthObj); - } - Tk_GetPixelsFromObj(NULL, framePtr->tkwin, framePtr->highlightWidthObj, &highlightWidth); - if (highlightWidth < 0) { - Tcl_DecrRefCount(framePtr->highlightWidthObj); - framePtr->highlightWidthObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(framePtr->highlightWidthObj); + if (framePtr->width < 0) { + framePtr->width = 0; + } + if (framePtr->height < 0) { + framePtr->height = 0; + } + if (framePtr->borderWidth < 0) { + framePtr->borderWidth = 0; + } + if (framePtr->highlightWidth < 0) { + framePtr->highlightWidth = 0; } Tk_GetPixelsFromObj(NULL, framePtr->tkwin, framePtr->padXObj, &padX); if (padX < 0) { Tcl_DecrRefCount(framePtr->padXObj); framePtr->padXObj = Tcl_NewIntObj(0); @@ -1120,12 +1164,11 @@ XGCValues gcValues; GC gc; int anyTextLabel, anyWindowLabel; int bWidthLeft, bWidthRight, bWidthTop, bWidthBottom; const char *labelText; - int padX, padY, width, height; - int borderWidth, highlightWidth; + int padX, padY; anyTextLabel = (framePtr->type == TYPE_LABELFRAME) && (labelframePtr->textPtr != NULL) && (labelframePtr->labelWin == NULL); anyWindowLabel = (framePtr->type == TYPE_LABELFRAME) && @@ -1137,11 +1180,10 @@ if (framePtr->copyGC != NULL) { Tk_FreeGC(framePtr->display, framePtr->copyGC); } framePtr->copyGC = gc; #endif /* TK_NO_DOUBLE_BUFFERING */ - Tk_GetPixelsFromObj(NULL, framePtr->tkwin, framePtr->borderWidthObj, &borderWidth); if (framePtr->type == TYPE_LABELFRAME) { /* * The textGC is needed even in the labelWin case, so it's always * created for a labelframe. @@ -1185,27 +1227,26 @@ * thick borders. */ if ((labelframePtr->labelAnchor >= LABELANCHOR_N) && (labelframePtr->labelAnchor <= LABELANCHOR_SW)) { - if (labelframePtr->labelReqHeight < borderWidth) { - labelframePtr->labelReqHeight = borderWidth; + if (labelframePtr->labelReqHeight < framePtr->borderWidth) { + labelframePtr->labelReqHeight = framePtr->borderWidth; } } else { - if (labelframePtr->labelReqWidth < borderWidth) { - labelframePtr->labelReqWidth = borderWidth; + if (labelframePtr->labelReqWidth < framePtr->borderWidth) { + labelframePtr->labelReqWidth = framePtr->borderWidth; } } } /* * Calculate individual border widths. */ - Tk_GetPixelsFromObj(NULL, framePtr->tkwin, framePtr->highlightWidthObj, &highlightWidth); bWidthBottom = bWidthTop = bWidthRight = bWidthLeft = - borderWidth + highlightWidth; + framePtr->borderWidth + framePtr->highlightWidth; Tk_GetPixelsFromObj(NULL, framePtr->tkwin, framePtr->padXObj, &padX); Tk_GetPixelsFromObj(NULL, framePtr->tkwin, framePtr->padYObj, &padY); bWidthLeft += padX; bWidthRight += padX; @@ -1215,24 +1256,24 @@ if (anyTextLabel || anyWindowLabel) { switch (labelframePtr->labelAnchor) { case LABELANCHOR_E: case LABELANCHOR_EN: case LABELANCHOR_ES: - bWidthRight += labelframePtr->labelReqWidth - borderWidth; + bWidthRight += labelframePtr->labelReqWidth - framePtr->borderWidth; break; case LABELANCHOR_N: case LABELANCHOR_NE: case LABELANCHOR_NW: - bWidthTop += labelframePtr->labelReqHeight - borderWidth; + bWidthTop += labelframePtr->labelReqHeight - framePtr->borderWidth; break; case LABELANCHOR_S: case LABELANCHOR_SE: case LABELANCHOR_SW: - bWidthBottom += labelframePtr->labelReqHeight - borderWidth; + bWidthBottom += labelframePtr->labelReqHeight - framePtr->borderWidth; break; default: - bWidthLeft += labelframePtr->labelReqWidth - borderWidth; + bWidthLeft += labelframePtr->labelReqWidth - framePtr->borderWidth; break; } } Tk_SetInternalBorderEx(tkwin, bWidthLeft, bWidthRight, bWidthTop, @@ -1245,31 +1286,29 @@ */ if (framePtr->type == TYPE_LABELFRAME) { int minwidth = labelframePtr->labelReqWidth; int minheight = labelframePtr->labelReqHeight; - int padding = highlightWidth; + int padding = framePtr->highlightWidth; - if (borderWidth > 0) { - padding += borderWidth + LABELMARGIN; + if (framePtr->borderWidth > 0) { + padding += framePtr->borderWidth + LABELMARGIN; } padding *= 2; if ((labelframePtr->labelAnchor >= LABELANCHOR_N) && (labelframePtr->labelAnchor <= LABELANCHOR_SW)) { minwidth += padding; - minheight += borderWidth + highlightWidth; + minheight += framePtr->borderWidth + framePtr->highlightWidth; } else { minheight += padding; - minwidth += borderWidth + highlightWidth; + minwidth += framePtr->borderWidth + framePtr->highlightWidth; } Tk_SetMinimumRequestSize(tkwin, minwidth, minheight); } - Tk_GetPixelsFromObj(NULL, framePtr->tkwin, framePtr->widthObj, &width); - Tk_GetPixelsFromObj(NULL, framePtr->tkwin, framePtr->heightObj, &height); - if ((width > 0) || (height > 0)) { - Tk_GeometryRequest(tkwin, width, height); + if ((framePtr->width > 0) || (framePtr->height > 0)) { + Tk_GeometryRequest(tkwin, framePtr->width, framePtr->height); } if (Tk_IsMapped(tkwin)) { if (!(framePtr->flags & REDRAW_PENDING)) { Tcl_DoWhenIdle(DisplayFrame, framePtr); @@ -1301,11 +1340,10 @@ Frame *framePtr) /* Information about widget. */ { int otherWidth, otherHeight, otherWidthT, otherHeightT, padding; int maxWidth, maxHeight; Tk_Window tkwin; - int borderWidth, highlightWidth; Labelframe *labelframePtr = (Labelframe *) framePtr; /* * We have nothing to do here unless there is a label. */ @@ -1324,15 +1362,13 @@ */ labelframePtr->labelBox.width = labelframePtr->labelReqWidth; labelframePtr->labelBox.height = labelframePtr->labelReqHeight; - Tk_GetPixelsFromObj(NULL, framePtr->tkwin, framePtr->borderWidthObj, &borderWidth); - Tk_GetPixelsFromObj(NULL, framePtr->tkwin, framePtr->highlightWidthObj, &highlightWidth); - padding = highlightWidth; - if (borderWidth > 0) { - padding += borderWidth + LABELMARGIN; + padding = framePtr->highlightWidth; + if (framePtr->borderWidth > 0) { + padding += framePtr->borderWidth + LABELMARGIN; } padding *= 2; maxHeight = Tk_Height(tkwin); maxWidth = Tk_Width(tkwin); @@ -1364,11 +1400,11 @@ otherWidth = Tk_Width(tkwin) - labelframePtr->labelBox.width; otherHeight = Tk_Height(tkwin) - labelframePtr->labelBox.height; otherWidthT = Tk_Width(tkwin) - labelframePtr->labelReqWidth; otherHeightT = Tk_Height(tkwin) - labelframePtr->labelReqHeight; - padding = highlightWidth; + padding = framePtr->highlightWidth; switch (labelframePtr->labelAnchor) { case LABELANCHOR_E: case LABELANCHOR_EN: case LABELANCHOR_ES: @@ -1391,12 +1427,12 @@ labelframePtr->labelTextX = padding; labelframePtr->labelBox.x = padding; break; } - if (borderWidth > 0) { - padding += borderWidth + LABELMARGIN; + if (framePtr->borderWidth > 0) { + padding += framePtr->borderWidth + LABELMARGIN; } switch (labelframePtr->labelAnchor) { case LABELANCHOR_NW: case LABELANCHOR_SW: @@ -1453,11 +1489,10 @@ Frame *framePtr = (Frame *)clientData; Tk_Window tkwin = framePtr->tkwin; int bdX1, bdY1, bdX2, bdY2; Pixmap pixmap; Bool useClipping = False; - int borderWidth, highlightWidth; framePtr->flags &= ~REDRAW_PENDING; if ((framePtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) { return; } @@ -1464,24 +1499,22 @@ /* * Highlight shall always be drawn if it exists, so do that first. */ - Tk_GetPixelsFromObj(NULL, framePtr->tkwin, framePtr->highlightWidthObj, &highlightWidth); - - if (highlightWidth > 0) { + if (framePtr->highlightWidth > 0) { GC fgGC, bgGC; bgGC = Tk_GCForColor(framePtr->highlightBgColorPtr, Tk_WindowId(tkwin)); if (framePtr->flags & GOT_FOCUS) { fgGC = Tk_GCForColor(framePtr->highlightColorPtr, Tk_WindowId(tkwin)); - Tk_DrawHighlightBorder(tkwin, fgGC, bgGC, highlightWidth, + Tk_DrawHighlightBorder(tkwin, fgGC, bgGC, framePtr->highlightWidth, Tk_WindowId(tkwin)); } else { - Tk_DrawHighlightBorder(tkwin, bgGC, bgGC, highlightWidth, + Tk_DrawHighlightBorder(tkwin, bgGC, bgGC, framePtr->highlightWidth, Tk_WindowId(tkwin)); } } /* @@ -1509,23 +1542,22 @@ #else pixmap = Tk_WindowId(tkwin); Tk_ClipDrawableToRect(Tk_Display(tkwin), pixmap, 0, 0, Tk_Width(tkwin), Tk_Height(tkwin)); #endif /* TK_NO_DOUBLE_BUFFERING */ - Tk_GetPixelsFromObj(NULL, framePtr->tkwin, framePtr->borderWidthObj, &borderWidth); if (framePtr->type != TYPE_LABELFRAME) { /* * Pass to platform specific draw function. In general, it just draws * a simple rectangle, but it may "theme" the background. */ noLabel: - TkpDrawFrameEx(tkwin, pixmap, framePtr->border, highlightWidth, - borderWidth, framePtr->relief); + TkpDrawFrameEx(tkwin, pixmap, framePtr->border, framePtr->highlightWidth, + framePtr->borderWidth, framePtr->relief); if (framePtr->bgimg) { - DrawFrameBackground(tkwin, pixmap, highlightWidth, borderWidth, + DrawFrameBackground(tkwin, pixmap, framePtr->highlightWidth, framePtr->borderWidth, framePtr->bgimg, framePtr->tile); } } else { Labelframe *labelframePtr = (Labelframe *) framePtr; @@ -1543,46 +1575,46 @@ /* * Calculate how the label affects the border's position. */ - bdX1 = bdY1 = highlightWidth; - bdX2 = Tk_Width(tkwin) - highlightWidth; - bdY2 = Tk_Height(tkwin) - highlightWidth; + bdX1 = bdY1 = framePtr->highlightWidth; + bdX2 = Tk_Width(tkwin) - framePtr->highlightWidth; + bdY2 = Tk_Height(tkwin) - framePtr->highlightWidth; switch (labelframePtr->labelAnchor) { case LABELANCHOR_E: case LABELANCHOR_EN: case LABELANCHOR_ES: - bdX2 -= (labelframePtr->labelBox.width-borderWidth) / 2; + bdX2 -= (labelframePtr->labelBox.width - framePtr->borderWidth) / 2; break; case LABELANCHOR_N: case LABELANCHOR_NE: case LABELANCHOR_NW: /* * Since the glyphs of the text tend to be in the lower part we * favor a lower border position by rounding up. */ - bdY1 += (labelframePtr->labelBox.height - borderWidth+1)/2; + bdY1 += (labelframePtr->labelBox.height - framePtr->borderWidth+1)/2; break; case LABELANCHOR_S: case LABELANCHOR_SE: case LABELANCHOR_SW: - bdY2 -= (labelframePtr->labelBox.height - borderWidth) / 2; + bdY2 -= (labelframePtr->labelBox.height - framePtr->borderWidth) / 2; break; default: - bdX1 += (labelframePtr->labelBox.width - borderWidth) / 2; + bdX1 += (labelframePtr->labelBox.width - framePtr->borderWidth) / 2; break; } /* * Draw border */ Tk_Draw3DRectangle(tkwin, pixmap, framePtr->border, bdX1, bdY1, - bdX2 - bdX1, bdY2 - bdY1, borderWidth, + bdX2 - bdX1, bdY2 - bdY1, framePtr->borderWidth, framePtr->relief); if (labelframePtr->labelWin == NULL) { /* * Clear behind the label @@ -1649,14 +1681,14 @@ * Everything's been redisplayed; now copy the pixmap onto the screen and * free up the pixmap. */ XCopyArea(framePtr->display, pixmap, Tk_WindowId(tkwin), - framePtr->copyGC, highlightWidth, highlightWidth, - (unsigned) (Tk_Width(tkwin) - 2 * highlightWidth), - (unsigned) (Tk_Height(tkwin) - 2 * highlightWidth), - highlightWidth, highlightWidth); + framePtr->copyGC, framePtr->highlightWidth, framePtr->highlightWidth, + (unsigned) (Tk_Width(tkwin) - 2 * framePtr->highlightWidth), + (unsigned) (Tk_Height(tkwin) - 2 * framePtr->highlightWidth), + framePtr->highlightWidth, framePtr->highlightWidth); Tk_FreePixmap(framePtr->display, pixmap); #endif /* TK_NO_DOUBLE_BUFFERING */ } /* @@ -1759,23 +1791,19 @@ } Tcl_CancelIdleCall(MapFrame, framePtr); Tcl_EventuallyFree(framePtr, DestroyFrame); } else if (eventPtr->type == FocusIn) { if (eventPtr->xfocus.detail != NotifyInferior) { - int highlightWidth; framePtr->flags |= GOT_FOCUS; - Tk_GetPixelsFromObj(NULL, framePtr->tkwin, framePtr->highlightWidthObj, &highlightWidth); - if (highlightWidth > 0) { + if (framePtr->highlightWidth > 0) { goto redraw; } } } else if (eventPtr->type == FocusOut) { if (eventPtr->xfocus.detail != NotifyInferior) { - int highlightWidth; framePtr->flags &= ~GOT_FOCUS; - Tk_GetPixelsFromObj(NULL, framePtr->tkwin, framePtr->highlightWidthObj, &highlightWidth); - if (highlightWidth > 0) { + if (framePtr->highlightWidth > 0) { goto redraw; } } } else if (eventPtr->type == ActivateNotify) { Tk_SetMainMenubar(framePtr->interp, framePtr->tkwin, Index: generic/tkIcu.c ================================================================== --- generic/tkIcu.c +++ generic/tkIcu.c @@ -90,11 +90,11 @@ } Tcl_DStringInit(&ds); str = Tcl_GetStringFromObj(objv[1], &len); Tcl_UtfToChar16DString(str, len, &ds); len = Tcl_DStringLength(&ds)/2; - Tcl_Size ulen = Tcl_GetCharLength(objv[1]); + Tcl_Size ulen = TkGetCharLength(objv[1]); if (TkGetIntForIndex(objv[2], ulen-1, 0, &idx) != TCL_OK) { Tcl_DStringFree(&ds); Tcl_SetObjResult(interp, Tcl_ObjPrintf("bad index \"%s\": must be integer?[+-]integer?, end?[+-]integer?, or \"\"", Tcl_GetString(objv[2]))); Tcl_SetErrorCode(interp, "TK", "ICU", "INDEX", (char *)NULL); return TCL_ERROR; @@ -110,11 +110,13 @@ Tcl_DStringFree(&ds); Tcl_SetObjResult(interp, Tcl_ObjPrintf("cannot open ICU iterator, errorcode: %d", (int)errorCode)); Tcl_SetErrorCode(interp, "TK", "ICU", "CANNOTOPEN", (char *)NULL); return TCL_ERROR; } - if (idx > 0 && len != ulen) { + if (idx >= ulen) { + idx = len; + } else if (idx > 0 && len != ulen) { /* The string contains codepoints > \uFFFF. Determine UTF-16 index */ Tcl_Size newIdx = 0; for (Tcl_Size i = 0; i < idx; i++) { newIdx += 1 + (((newIdx < (Tcl_Size)len-1) && (ustr[newIdx]&0xFC00) == 0xD800) && ((ustr[newIdx+1]&0xFC00) == 0xDC00)); } Index: generic/tkImage.c ================================================================== --- generic/tkImage.c +++ generic/tkImage.c @@ -129,11 +129,11 @@ } /* *---------------------------------------------------------------------- * - * Tk_CreateImageType -- + * Tk_CreateOldImageType, Tk_CreateImageType -- * * This function is invoked by an image manager to tell Tk about a new * kind of image and the functions that manage the new type. The function * is typically invoked during Tcl_AppInit. * @@ -144,10 +144,31 @@ * The new image type is entered into a table used in the "image create" * command. * *---------------------------------------------------------------------- */ + +void +Tk_CreateOldImageType( + const Tk_ImageType *typePtr) + /* Structure describing the type. All of the + * fields except "nextPtr" must be filled in + * by caller. */ +{ + Tk_ImageType *copyPtr; + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + + if (!tsdPtr->initialized) { + tsdPtr->initialized = 1; + Tcl_CreateThreadExitHandler(ImageTypeThreadExitProc, NULL); + } + copyPtr = (Tk_ImageType *)ckalloc(sizeof(Tk_ImageType)); + *copyPtr = *typePtr; + copyPtr->nextPtr = tsdPtr->oldImageTypeList; + tsdPtr->oldImageTypeList = copyPtr; +} void Tk_CreateImageType( const Tk_ImageType *typePtr) /* Structure describing the type. All of the Index: generic/tkImgBmap.c ================================================================== --- generic/tkImgBmap.c +++ generic/tkImgBmap.c @@ -238,11 +238,11 @@ { BitmapInstance *instancePtr; int maskWidth, maskHeight, dummy1, dummy2; if (Tk_ConfigureWidget(modelPtr->interp, Tk_MainWindow(modelPtr->interp), - configSpecs, objc, objv, modelPtr, flags) != TCL_OK) { + configSpecs, objc, (const char **)objv, (char *)modelPtr, flags|TK_CONFIG_OBJS) != TCL_OK) { return TCL_ERROR; } /* * Parse the bitmap and/or mask to create binary data. Make sure that the Index: generic/tkImgPhoto.c ================================================================== --- generic/tkImgPhoto.c +++ generic/tkImgPhoto.c @@ -137,10 +137,15 @@ typedef struct { Tk_PhotoImageFormat *formatList; /* Pointer to the first in the list of known * photo image formats.*/ +#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 + Tk_PhotoImageFormat *oldFormatList; + /* Pointer to the first in the list of known + * photo image formats.*/ +#endif Tk_PhotoImageFormatVersion3 *formatListVersion3; /* Pointer to the first in the list of known * photo image formats in Version3 format.*/ int initialized; /* Set to 1 if we've initialized the * structure. */ @@ -160,21 +165,21 @@ * Information used for parsing configuration specifications: */ static const Tk_ConfigSpec configSpecs[] = { {TK_CONFIG_STRING, "-data", NULL, NULL, - NULL, TCL_INDEX_NONE, TK_CONFIG_OBJS|TK_CONFIG_NULL_OK, NULL}, + NULL, TCL_INDEX_NONE, TK_CONFIG_NULL_OK|TK_CONFIG_OBJS, NULL}, {TK_CONFIG_STRING, "-file", NULL, NULL, - NULL, offsetof(PhotoModel, fileObj), TK_CONFIG_OBJS|TK_CONFIG_NULL_OK, NULL}, + NULL, offsetof(PhotoModel, fileObj), TK_CONFIG_NULL_OK|TK_CONFIG_OBJS, NULL}, {TK_CONFIG_STRING, "-format", NULL, NULL, - NULL, TCL_INDEX_NONE, TK_CONFIG_OBJS|TK_CONFIG_NULL_OK, NULL}, + NULL, TCL_INDEX_NONE, TK_CONFIG_NULL_OK|TK_CONFIG_OBJS, NULL}, {TK_CONFIG_DOUBLE, "-gamma", NULL, NULL, DEF_PHOTO_GAMMA, offsetof(PhotoModel, gamma), 0, NULL}, {TK_CONFIG_INT, "-height", NULL, NULL, DEF_PHOTO_HEIGHT, offsetof(PhotoModel, userHeight), 0, NULL}, {TK_CONFIG_STRING, "-metadata", NULL, NULL, - NULL, TCL_INDEX_NONE, TK_CONFIG_OBJS|TK_CONFIG_NULL_OK, NULL}, + NULL, TCL_INDEX_NONE, TK_CONFIG_NULL_OK|TK_CONFIG_OBJS, NULL}, {TK_CONFIG_UID, "-palette", NULL, NULL, DEF_PHOTO_PALETTE, offsetof(PhotoModel, palette), 0, NULL}, {TK_CONFIG_INT, "-width", NULL, NULL, DEF_PHOTO_WIDTH, offsetof(PhotoModel, userWidth), 0, NULL}, {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL} @@ -240,28 +245,35 @@ Tk_PhotoImageFormat *freePtr; Tk_PhotoImageFormatVersion3 *freePtrVersion3; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); +#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 + while (tsdPtr->oldFormatList != NULL) { + freePtr = tsdPtr->oldFormatList; + tsdPtr->oldFormatList = tsdPtr->oldFormatList->nextPtr; + ckfree(freePtr); + } +#endif while (tsdPtr->formatList != NULL) { freePtr = tsdPtr->formatList; tsdPtr->formatList = tsdPtr->formatList->nextPtr; - ckfree((void *)freePtr->name); + ckfree((char *)freePtr->name); ckfree(freePtr); } while (tsdPtr->formatListVersion3 != NULL) { freePtrVersion3 = tsdPtr->formatListVersion3; tsdPtr->formatListVersion3 = tsdPtr->formatListVersion3->nextPtr; - ckfree((void *)freePtrVersion3->name); + ckfree((char *)freePtrVersion3->name); ckfree(freePtrVersion3); } } /* *---------------------------------------------------------------------- * - * Tk_CreatePhotoImageFormat, + * Tk_CreateOldPhotoImageFormat, Tk_CreatePhotoImageFormat, * Tk_CreatePhotoImageFormatVersion3 -- * * This function is invoked by an image file handler to register a new * photo image format and the functions that handle the new format. The * function is typically invoked during Tcl_AppInit. @@ -273,10 +285,33 @@ * The new image file format is entered into a table used in the photo * image "read" and "write" subcommands. * *---------------------------------------------------------------------- */ + +#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 +void +Tk_CreateOldPhotoImageFormat( + const Tk_PhotoImageFormat *formatPtr) + /* Structure describing the format. All of the + * fields except "nextPtr" must be filled in + * by caller. */ +{ + Tk_PhotoImageFormat *copyPtr; + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + + if (!tsdPtr->initialized) { + tsdPtr->initialized = 1; + Tcl_CreateThreadExitHandler(PhotoFormatThreadExitProc, NULL); + } + copyPtr = (Tk_PhotoImageFormat *)ckalloc(sizeof(Tk_PhotoImageFormat)); + *copyPtr = *formatPtr; + copyPtr->nextPtr = tsdPtr->oldFormatList; + tsdPtr->oldFormatList = copyPtr; +} +#endif void Tk_CreatePhotoImageFormat( const Tk_PhotoImageFormat *formatPtr) /* Structure describing the format. All of the @@ -291,10 +326,16 @@ tsdPtr->initialized = 1; Tcl_CreateThreadExitHandler(PhotoFormatThreadExitProc, NULL); } copyPtr = (Tk_PhotoImageFormat *)ckalloc(sizeof(Tk_PhotoImageFormat)); *copyPtr = *formatPtr; +#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 + if (isupper((unsigned char) *formatPtr->name)) { + copyPtr->nextPtr = tsdPtr->oldFormatList; + tsdPtr->oldFormatList = copyPtr; + } else +#endif { /* for compatibility with aMSN: make a copy of formatPtr->name */ char *name = (char *)ckalloc(strlen(formatPtr->name) + 1); strcpy(name, formatPtr->name); copyPtr->name = name; @@ -793,10 +834,27 @@ stringWriteProc = imageFormat->stringWriteProc; break; } } } +#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 + if (stringWriteProc == NULL) { + oldformat = 1; + for (imageFormat = tsdPtr->oldFormatList; imageFormat != NULL; + imageFormat = imageFormat->nextPtr) { + if ((strncasecmp(Tcl_GetString(options.format), + imageFormat->name, + strlen(imageFormat->name)) == 0)) { + matched = 1; + if (imageFormat->stringWriteProc != NULL) { + stringWriteProc = imageFormat->stringWriteProc; + break; + } + } + } + } +#endif if (stringWriteProc == NULL) { oldformat = 0; for (imageFormatVersion3 = tsdPtr->formatListVersion3; imageFormatVersion3 != NULL; imageFormatVersion3 = imageFormatVersion3->nextPtr) { @@ -1448,10 +1506,26 @@ if (imageFormat->fileWriteProc != NULL) { break; } } } +#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 + if (imageFormat == NULL) { + oldformat = 1; + for (imageFormat = tsdPtr->oldFormatList; imageFormat != NULL; + imageFormat = imageFormat->nextPtr) { + if ((fmtString == NULL) + || (strncasecmp(fmtString, imageFormat->name, + strlen(imageFormat->name)) == 0)) { + matched = 1; + if (imageFormat->fileWriteProc != NULL) { + break; + } + } + } + } +#endif if (imageFormat == NULL) { oldformat = 0; for (imageFormatVersion3 = tsdPtr->formatListVersion3; imageFormatVersion3 != NULL; imageFormatVersion3 = imageFormatVersion3->nextPtr) { @@ -1968,11 +2042,11 @@ /* * Process the configuration options specified. */ if (Tk_ConfigureWidget(interp, Tk_MainWindow(interp), configSpecs, - objc, objv, modelPtr, flags) != TCL_OK) { + objc, (const char **)objv, (char *)modelPtr, flags|TK_CONFIG_OBJS) != TCL_OK) { goto errorExit; } /* * Regard the empty string for -file, -data, -format or -metadata as the null value. @@ -2693,10 +2767,46 @@ } break; } } } +#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 +if (formatPtr == NULL) { + useoldformat = 1; + for (formatPtr = tsdPtr->oldFormatList; formatPtr != NULL; + formatPtr = formatPtr->nextPtr) { + if (formatString != NULL) { + if (strncasecmp(formatString, + formatPtr->name, strlen(formatPtr->name)) != 0) { + continue; + } + matched = 1; + if (formatPtr->fileMatchProc == NULL) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "-file option isn't supported for %s images", + formatString)); + Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", + "NOT_FILE_FORMAT", (char *)NULL); + return TCL_ERROR; + } + } + if (formatPtr->fileMatchProc != NULL) { + (void) Tcl_Seek(chan, Tcl_LongAsWide(0L), SEEK_SET); + if (formatPtr->fileMatchProc(chan, fileName, (Tcl_Obj *) + formatString, widthPtr, heightPtr, interp)) { + if (*widthPtr < 1) { + *widthPtr = 1; + } + if (*heightPtr < 1) { + *heightPtr = 1; + } + break; + } + } + } + } +#endif /* * For old and not version 3 format, exit now with success */ @@ -2889,10 +2999,42 @@ && formatPtr->stringMatchProc(data, formatObj, widthPtr, heightPtr, interp)) { break; } } + +#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 + if (formatPtr == NULL) { + useoldformat = 1; + for (formatPtr = tsdPtr->oldFormatList; formatPtr != NULL; + formatPtr = formatPtr->nextPtr) { + if (formatObj != NULL) { + if (strncasecmp(formatString, + formatPtr->name, strlen(formatPtr->name)) != 0) { + continue; + } + matched = 1; + if (formatPtr->stringMatchProc == NULL) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "-data option isn't supported for %s images", + formatString)); + Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", + "NOT_DATA_FORMAT", (char *)NULL); + return TCL_ERROR; + } + } + if ((formatPtr->stringMatchProc != NULL) + && (formatPtr->stringReadProc != NULL) + && formatPtr->stringMatchProc( + (Tcl_Obj *) Tcl_GetString(data), + (Tcl_Obj *) formatString, + widthPtr, heightPtr, interp)) { + break; + } + } + } +#endif if (formatPtr == NULL) { useoldformat = 0; for (formatVersion3Ptr = tsdPtr->formatListVersion3; formatVersion3Ptr != NULL; @@ -4377,13 +4519,114 @@ block.pixelPtr += y * block.pitch + x * block.pixelSize; return Tk_PostscriptPhoto(interp, &block, psInfo, width, height); } +/* + *---------------------------------------------------------------------- + * + * Tk_PhotoPutBlock_NoComposite, Tk_PhotoPutZoomedBlock_NoComposite -- + * + * These backward-compatibility functions just exist to fill slots in stubs + * table. For the behaviour of *_NoComposite, refer to the corresponding + * function without the extra suffix, except that the compositing rule is + * always "overlay" and the function always panics on memory-allocation + * failure. + * + *---------------------------------------------------------------------- + */ +#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 +void +Tk_PhotoPutBlock_NoComposite( + Tk_PhotoHandle handle, + Tk_PhotoImageBlock *blockPtr, + int x, int y, int width, int height) +{ + if (Tk_PhotoPutBlock(NULL, handle, blockPtr, x, y, width, height, + TK_PHOTO_COMPOSITE_OVERLAY) != TCL_OK) { + Tcl_Panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE); + } +} + +void +Tk_PhotoPutZoomedBlock_NoComposite( + Tk_PhotoHandle handle, + Tk_PhotoImageBlock *blockPtr, + int x, int y, int width, int height, + int zoomX, int zoomY, int subsampleX, int subsampleY) +{ + if (Tk_PhotoPutZoomedBlock(NULL, handle, blockPtr, x, y, width, height, + zoomX, zoomY, subsampleX, subsampleY, + TK_PHOTO_COMPOSITE_OVERLAY) != TCL_OK) { + Tcl_Panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE); + } +} + +/* + *---------------------------------------------------------------------- + * + * Tk_PhotoExpand_Panic, Tk_PhotoPutBlock_Panic, + * Tk_PhotoPutZoomedBlock_Panic, Tk_PhotoSetSize_Panic + * + * Backward compatibility functions for preserving the old behaviour (i.e. + * panic on memory allocation failure) so that extensions do not need to be + * significantly updated to take account of TIP #116. These call the new + * interface (i.e. the interface without the extra suffix), but panic if an + * error condition is returned. + * + *---------------------------------------------------------------------- + */ + +void +Tk_PhotoExpand_Panic( + Tk_PhotoHandle handle, + int width, int height) +{ + if (Tk_PhotoExpand(NULL, handle, width, height) != TCL_OK) { + Tcl_Panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE); + } +} + +void +Tk_PhotoPutBlock_Panic( + Tk_PhotoHandle handle, + Tk_PhotoImageBlock *blockPtr, + int x, int y, int width, int height, int compRule) +{ + if (Tk_PhotoPutBlock(NULL, handle, blockPtr, x, y, width, height, + compRule) != TCL_OK) { + Tcl_Panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE); + } +} + +void +Tk_PhotoPutZoomedBlock_Panic( + Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, + int x, int y, int width, int height, + int zoomX, int zoomY, int subsampleX, int subsampleY, + int compRule) +{ + if (Tk_PhotoPutZoomedBlock(NULL, handle, blockPtr, x, y, width, height, + zoomX, zoomY, subsampleX, subsampleY, compRule) != TCL_OK) { + Tcl_Panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE); + } +} + +void +Tk_PhotoSetSize_Panic( + Tk_PhotoHandle handle, + int width, int height) +{ + if (Tk_PhotoSetSize(NULL, handle, width, height) != TCL_OK) { + Tcl_Panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE); + } +} +#endif /* TK_NO_DEPRECATED */ + /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 * tab-width: 8 * End: */ Index: generic/tkInt.decls ================================================================== --- generic/tkInt.decls +++ generic/tkInt.decls @@ -66,11 +66,11 @@ const char *source, const char *mask, int width, int height, int xHot, int yHot, XColor fg, XColor bg) } declare 13 { int TkCreateFrame(void *clientData, Tcl_Interp *interp, - Tcl_Size objc, Tcl_Obj *const objv[], int type, const char *appName) + Tcl_Size argc, const char *const *argv, int toplevel, const char *appName) } declare 14 { Tk_Window TkCreateMainWindow(Tcl_Interp *interp, const char *screenName, const char *baseName) } @@ -224,10 +224,13 @@ void TkpDisplayWarning(const char *msg, const char *title) } declare 59 { void TkpGetAppName(Tcl_Interp *interp, Tcl_DString *name) } +declare 60 {deprecated {renamed to Tk_GetOtherWindow}} { + TkWindow *TkpGetOtherWindow(TkWindow *winPtr) +} declare 61 { TkWindow *TkpGetWrapperWindow(TkWindow *winPtr) } declare 62 { int TkpInit(Tcl_Interp *interp) @@ -234,13 +237,19 @@ } declare 63 { void TkpInitializeMenuBindings(Tcl_Interp *interp, Tk_BindingTable bindingTable) } +declare 64 {deprecated {renamed to Tk_MakeContainer}} { + void TkpMakeContainer(Tk_Window tkwin) +} declare 65 { void TkpMakeMenuWindow(Tk_Window tkwin, int transient) } +declare 66 {deprecated {renamed to Tk_MakeWindow}} { + Window TkpMakeWindow(TkWindow *winPtr, Window parent) +} declare 67 { void TkpMenuNotifyToplevelCreate(Tcl_Interp *interp, const char *menuName) } declare 68 { TkDisplay *TkpOpenDisplay(const char *display_name) @@ -258,10 +267,19 @@ int TkPositionInTree(TkWindow *winPtr, TkWindow *treePtr) } declare 73 { void TkpRedirectKeyEvent(TkWindow *winPtr, XEvent *eventPtr) } +declare 74 {deprecated {renamed to Tk_SetMainMenubar}} { + void TkpSetMainMenubar(Tcl_Interp *interp, Tk_Window tkwin, const char *menuName) +} +declare 75 {deprecated {renamed to Tk_UseWindow}} { + int TkpUseWindow(Tcl_Interp *interp, Tk_Window tkwin, const char *string) +} +# +# Slot 76 unused (WAS: TkpWindowWasRecentlyDeleted) +# declare 77 { void TkQueueEventForAllChildren(TkWindow *winPtr, XEvent *eventPtr) } declare 78 { int TkReadBitmapFile(Display *display, Drawable d, const char *filename, @@ -282,10 +300,20 @@ void TkSelInit(Tk_Window tkwin) } declare 83 { void TkSelPropProc(XEvent *eventPtr) } + +# Exported publically as Tk_SetClassProcs in 8.4a2 +#declare 84 { +# void TkSetClassProcs(Tk_Window tkwin, +# TkClassProcs *procs, void *instanceData) +#} +declare 85 {deprecated {renamed to Tk_SetWindowMenubar}} { + void TkSetWindowMenuBar(Tcl_Interp *interp, Tk_Window tkwin, + const char *oldMenuName, const char *menuName) +} declare 86 { KeySym TkStringToKeysym(const char *name) } declare 87 { int TkThickPolyLineToArea(double *coordPtr, int numPoints, @@ -364,10 +392,14 @@ const char *TkpGetString(TkWindow *winPtr, XEvent *eventPtr, Tcl_DString *dsPtr) } declare 110 { void TkpGetSubFonts(Tcl_Interp *interp, Tk_Font tkfont) } +declare 111 {deprecated {renamed to Tk_GetSystemDefault}} { + Tcl_Obj *TkpGetSystemDefault(Tk_Window tkwin, + const char *dbName, const char *className) +} declare 112 { void TkpMenuThreadInit(void) } declare 113 { int XClipBox(Region rgn, XRectangle *rect_return) @@ -390,19 +422,23 @@ } declare 119 { int XUnionRectWithRegion(XRectangle *rect, Region src, Region dr_return) } -declare 121 { +declare 121 aqua { Pixmap TkpCreateNativeBitmap(Display *display, const void *source) } -declare 122 { +declare 122 aqua { void TkpDefineNativeBitmaps(void) } -declare 124 { +declare 124 aqua { Pixmap TkpGetNativeAppBitmap(Display *display, const char *name, int *width, int *height) +} +declare 135 {deprecated {renamed to Tk_DrawHighlightBorder}} { + void TkpDrawHighlightBorder(Tk_Window tkwin, GC fgGC, GC bgGC, + int highlightWidth, Drawable drawable) } declare 136 { void TkSetFocusWin(TkWindow *winPtr, int force) } declare 137 { @@ -628,37 +664,62 @@ void TkCreateXEventSource(void) } declare 2 x11 { void TkGenerateActivateEvents(TkWindow *winPtr, int active) } +declare 3 x11 { + int TkpCmapStressed(Tk_Window tkwin, Colormap colormap) +} +declare 4 x11 { + void TkpSync(Display *display) +} +declare 5 x11 { + Window TkUnixContainerId(TkWindow *winPtr) +} declare 6 x11 { + int TkUnixDoOneXEvent(Tcl_Time *timePtr) +} +declare 7 x11 { + void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar) +} +declare 8 x11 { int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr) } declare 9 x11 { + void TkWmCleanup(TkDisplay *dispPtr) +} +declare 10 x11 { + void TkSendCleanup(TkDisplay *dispPtr) +} +declare 12 x11 { int TkpWmSetState(TkWindow *winPtr, int state) } # only needed by tktest: +declare 13 x11 { + int TkpTestsendCmd_(void *clientData, Tcl_Interp *interp, Tcl_Size objc, + Tcl_Obj *const objv[]) +} declare 38 x11 { - int TkpCmapStressed(Tk_Window tkwin, Colormap colormap) + int TkpCmapStressed_(Tk_Window tkwin, Colormap colormap) } declare 39 x11 { - void TkpSync(Display *display) + void TkpSync_(Display *display) } declare 40 x11 { - Window TkUnixContainerId(TkWindow *winPtr) + Window TkUnixContainerId_(TkWindow *winPtr) } declare 41 x11 { - int TkUnixDoOneXEvent(Tcl_Time *timePtr) + int TkUnixDoOneXEvent_(Tcl_Time *timePtr) } declare 42 x11 { - void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar) + void TkUnixSetMenubar_(Tk_Window tkwin, Tk_Window menubar) } declare 43 x11 { - void TkWmCleanup(TkDisplay *dispPtr) + void TkWmCleanup_(TkDisplay *dispPtr) } declare 44 x11 { - void TkSendCleanup(TkDisplay *dispPtr) + void TkSendCleanup_(TkDisplay *dispPtr) } # only needed by tktest: declare 45 x11 { int TkpTestsendCmd(void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]) @@ -666,11 +727,11 @@ ################################ # Windows specific functions declare 0 win { - void TkCreateXEventSource(void) + char *TkAlignImageData(XImage *image, int alignment, int bitOrder) } declare 2 win { void TkGenerateActivateEvents(TkWindow *winPtr, int active) } declare 3 win { @@ -769,11 +830,11 @@ declare 32 win { Tcl_Obj *TkWinGetMenuSystemDefault(Tk_Window tkwin, const char *dbName, const char *className) } declare 33 win { - char *TkAlignImageData(XImage *image, int alignment, int bitOrder) + int TkWinGetPlatformId(void) } # new for 8.4.1 declare 34 win { @@ -788,10 +849,14 @@ declare 36 win { LRESULT __stdcall TkWinChildProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) } +# new for 8.4.20+/8.5.12+, Cygwin only +declare 37 win { + void TkCreateXEventSource(void) +} declare 38 win { int TkpCmapStressed(Tk_Window tkwin, Colormap colormap) } declare 39 win { void TkpSync(Display *display) @@ -821,30 +886,30 @@ } ################################ # Aqua specific functions -declare 1 aqua { - void TkAboutDlg(void) +declare 0 aqua { + void TkGenerateActivateEvents(TkWindow *winPtr, int active) } declare 2 aqua { - void TkGenerateActivateEvents(TkWindow *winPtr, int active) + void TkGenerateActivateEvents_(TkWindow *winPtr, int active) } declare 3 aqua { - unsigned long TkpGetMS(void) + void TkPointerDeadWindow(TkWindow *winPtr) } declare 4 aqua { - void TkPointerDeadWindow(TkWindow *winPtr) + void TkpSetCapture(TkWindow *winPtr) } declare 5 aqua { void TkpSetCursor(TkpCursor cursor) } declare 6 aqua { - int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr) + void TkpWmSetState(TkWindow *winPtr, int state) } declare 7 aqua { - int TkpWmSetState(TkWindow *winPtr, int state) + void TkAboutDlg(void) } declare 8 aqua { unsigned int TkMacOSXButtonKeyState(void) } declare 9 aqua { @@ -851,13 +916,14 @@ void TkMacOSXClearMenubarActive(void) } declare 10 aqua { int TkMacOSXDispatchMenuEvent(int menuID, int index) } -declare 11 aqua { - void TkpSetCapture(TkWindow *winPtr) -} +# Now a static function +# declare 11 aqua { +# void TkMacOSXInstallCursor(int resizeOverride) +# } declare 12 aqua { void TkMacOSXHandleTearoffMenu(void) } declare 14 aqua { int TkMacOSXDoHLEvent(void *theEvent) @@ -870,37 +936,61 @@ } declare 18 aqua { void TkMacOSXHandleMenuSelect(short theMenu, unsigned short theItem, int optionKeyPressed) } + +# removed duplicates from tkPlat table(tk.decls) +#declare 19 aqua { +# void TkMacOSXInitAppleEvents(Tcl_Interp *interp) +#} +# +#declare 20 aqua { +# void TkMacOSXInitMenus(Tcl_Interp *interp) +#} + declare 21 aqua { void TkMacOSXInvalidateWindow(MacDrawable *macWin, int flag) } +declare 22 aqua { + int TkMacOSXIsCharacterMissing(Tk_Font tkfont, unsigned int searchChar) +} declare 23 aqua { void TkMacOSXMakeRealWindowExist(TkWindow *winPtr) } declare 24 aqua { void *TkMacOSXMakeStippleMap(Drawable d1, Drawable d2) } declare 25 aqua { void TkMacOSXMenuClick(void) } +# The corresponding Unregister was not a stub, and this should be static. +#declare 26 aqua { +# void TkMacOSXRegisterOffScreenWindow(Window window, void *portPtr) +#} declare 27 aqua { int TkMacOSXResizable(TkWindow *winPtr) } declare 28 aqua { void TkMacOSXSetHelpMenuItemCount(void) } declare 29 aqua { void TkMacOSXSetScrollbarGrow(TkWindow *winPtr, int flag) } +declare 30 aqua { + void TkMacOSXSetUpClippingRgn(Drawable drawable) +} declare 31 aqua { void TkMacOSXSetUpGraphicsPort(GC gc, void *destPort) } declare 32 aqua { void TkMacOSXUpdateClipRgn(TkWindow *winPtr) } +# This was not implemented. Perhaps meant to be OffScreen ? +#declare 33 aqua { +# void TkMacOSXUnregisterMacWindow(void *portPtr) +#} declare 34 aqua { int TkMacOSXUseMenuID(short macID) } declare 35 aqua { Region TkMacOSXVisableClipRgn(TkWindow *winPtr) @@ -946,17 +1036,23 @@ int TkGenerateButtonEvent(int x, int y, Window window, unsigned int state) } declare 51 aqua { void TkGenWMDestroyEvent(Tk_Window tkwin) } -# -# Slot 52 unused (WAS: TkMacOSXSetDrawingEnabled) -# -# Made public as Tk_MacOSXGetNSWindowForDrawable -#declare 54 aqua { -# void *TkMacOSXDrawable(Drawable drawable) -#} +declare 52 aqua { + void TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag) +} +declare 53 aqua { + unsigned long TkpGetMS(void) +} +# For Canvas3d, requested by Sean Woods +declare 54 aqua { + void *TkMacOSXDrawable(Drawable drawable) +} +declare 55 aqua { + int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr) +} ############################################################################## # Define the platform specific internal Xlib interfaces. These functions are # only available on the designated platform. @@ -1496,354 +1592,352 @@ } declare 6 macosx { Colormap XCreateColormap(Display *d, Window w, Visual *v, int i) } declare 7 macosx { - Cursor XCreatePixmapCursor(Display *d, Pixmap p1, Pixmap p2, - XColor *x1, XColor *x2, unsigned int ui1, unsigned int ui2) + GContext XGContextFromGC(GC g) } +# second parameter was of type KeyCode declare 8 macosx { - Cursor XCreateGlyphCursor(Display *d, Font f1, Font f2, - unsigned int ui1, unsigned int ui2, XColor _Xconst *x1, - XColor _Xconst *x2) + KeySym XKeycodeToKeysym(Display *d, unsigned int k, int i) } declare 9 macosx { - GContext XGContextFromGC(GC g) + KeySym XStringToKeysym(_Xconst char *c) } declare 10 macosx { - XHostAddress *XListHosts(Display *d, int *i, Bool *b) + Window XRootWindow(Display *d, int i) } -# second parameter was of type KeyCode declare 11 macosx { - KeySym XKeycodeToKeysym(Display *d, unsigned int k, int i) + XErrorHandler XSetErrorHandler(XErrorHandler x) } declare 12 macosx { - KeySym XStringToKeysym(_Xconst char *c) + Status XAllocColor(Display *d, Colormap c, XColor *xp) } declare 13 macosx { - Window XRootWindow(Display *d, int i) -} -declare 14 macosx { - XErrorHandler XSetErrorHandler(XErrorHandler x) -} -declare 15 macosx { - Status XIconifyWindow(Display *d, Window w, int i) -} -declare 16 macosx { - Status XWithdrawWindow(Display *d, Window w, int i) -} -declare 17 macosx { - Status XGetWMColormapWindows(Display *d, Window w, Window **wpp, int *ip) -} -declare 18 macosx { - Status XAllocColor(Display *d, Colormap c, XColor *xp) -} -declare 19 macosx { int XBell(Display *d, int i) } -declare 20 macosx { +declare 14 macosx { int XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3) } -declare 21 macosx { +declare 15 macosx { int XChangeWindowAttributes(Display *d, Window w, unsigned long ul, XSetWindowAttributes *x) } -declare 22 macosx { - int XClearWindow(Display *d, Window w) -} -declare 23 macosx { +declare 16 macosx { int XConfigureWindow(Display *d, Window w, unsigned int i, XWindowChanges *x) } -declare 24 macosx { +declare 17 macosx { int XCopyArea(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4) } -declare 25 macosx { +declare 18 macosx { int XCopyPlane(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, - int i2, unsigned int ui1, unsigned int ui2, - int i3, int i4, unsigned long ul) + int i2, unsigned int ui1, + unsigned int ui2, int i3, int i4, unsigned long ul) } -declare 26 macosx { +declare 19 macosx { Pixmap XCreateBitmapFromData(Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height) } -declare 27 macosx { +declare 20 macosx { int XDefineCursor(Display *d, Window w, Cursor c) } -declare 28 macosx { - int XDeleteProperty(Display *d, Window w, Atom a) -} -declare 29 macosx { +declare 21 macosx { int XDestroyWindow(Display *d, Window w) } -declare 30 macosx { +declare 22 macosx { int XDrawArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4) } -declare 31 macosx { +declare 23 macosx { int XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2) } -declare 32 macosx { +declare 24 macosx { int XDrawRectangle(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2) } -declare 33 macosx { +declare 25 macosx { int XFillArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4) } -declare 34 macosx { +declare 26 macosx { int XFillPolygon(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3) } -declare 35 macosx { +declare 27 macosx { int XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i) } -declare 36 macosx { - int XForceScreenSaver(Display *d, int i) -} -declare 37 macosx { +declare 28 macosx { int XFreeColormap(Display *d, Colormap c) } -declare 38 macosx { +declare 29 macosx { int XFreeColors(Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul) } -declare 39 macosx { - int XFreeCursor(Display *d, Cursor c) -} -declare 40 macosx { +declare 30 macosx { int XFreeModifiermap(XModifierKeymap *x) } -declare 41 macosx { +declare 31 macosx { Status XGetGeometry(Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4) } -declare 42 macosx { - int XGetInputFocus(Display *d, Window *w, int *i) -} -declare 43 macosx { +declare 32 macosx { int XGetWindowProperty(Display *d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1, unsigned long *ulp2, unsigned char **cpp) } -declare 44 macosx { - Status XGetWindowAttributes(Display *d, Window w, XWindowAttributes *x) -} -declare 45 macosx { +declare 33 macosx { int XGrabKeyboard(Display *d, Window w, Bool b, int i1, int i2, Time t) } -declare 46 macosx { +declare 34 macosx { int XGrabPointer(Display *d, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t) } -declare 47 macosx { +declare 35 macosx { KeyCode XKeysymToKeycode(Display *d, KeySym k) } -declare 48 macosx { - Status XLookupColor(Display *d, Colormap c1, _Xconst char *c2, - XColor *x1, XColor *x2) -} -declare 49 macosx { +declare 36 macosx { int XMapWindow(Display *d, Window w) } -declare 50 macosx { +declare 37 macosx { int XMoveResizeWindow(Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2) } -declare 51 macosx { +declare 38 macosx { int XMoveWindow(Display *d, Window w, int i1, int i2) } -declare 52 macosx { - int XNextEvent(Display *d, XEvent *x) -} -declare 53 macosx { - int XPutBackEvent(Display *d, XEvent *x) -} -declare 54 macosx { - int XQueryColors(Display *d, Colormap c, XColor *x, int i) -} -declare 55 macosx { +declare 39 macosx { Bool XQueryPointer(Display *d, Window w1, Window *w2, Window *w3, int *i1, int *i2, int *i3, int *i4, unsigned int *ui) } -declare 56 macosx { - Status XQueryTree(Display *d, Window w1, Window *w2, Window *w3, - Window **w4, unsigned int *ui) -} -declare 57 macosx { +declare 40 macosx { int XRaiseWindow(Display *d, Window w) } -declare 58 macosx { +declare 41 macosx { int XRefreshKeyboardMapping(XMappingEvent *x) } -declare 59 macosx { +declare 42 macosx { int XResizeWindow(Display *d, Window w, unsigned int ui1, unsigned int ui2) } -declare 60 macosx { +declare 43 macosx { int XSelectInput(Display *d, Window w, long l) } -declare 61 macosx { +declare 44 macosx { Status XSendEvent(Display *d, Window w, Bool b, long l, XEvent *x) } -declare 62 macosx { - int XSetCommand(Display *d, Window w, char **c, int i) -} -declare 63 macosx { +declare 45 macosx { int XSetIconName(Display *d, Window w, _Xconst char *c) } -declare 64 macosx { +declare 46 macosx { int XSetInputFocus(Display *d, Window w, int i, Time t) } -declare 65 macosx { +declare 47 macosx { int XSetSelectionOwner(Display *d, Atom a, Window w, Time t) } -declare 66 macosx { +declare 48 macosx { int XSetWindowBackground(Display *d, Window w, unsigned long ul) } -declare 67 macosx { +declare 49 macosx { int XSetWindowBackgroundPixmap(Display *d, Window w, Pixmap p) } -declare 68 macosx { +declare 50 macosx { int XSetWindowBorder(Display *d, Window w, unsigned long ul) } -declare 69 macosx { +declare 51 macosx { int XSetWindowBorderPixmap(Display *d, Window w, Pixmap p) } -declare 70 macosx { +declare 52 macosx { int XSetWindowBorderWidth(Display *d, Window w, unsigned int ui) } -declare 71 macosx { +declare 53 macosx { int XSetWindowColormap(Display *d, Window w, Colormap c) } -declare 72 macosx { - Bool XTranslateCoordinates(Display *d, Window w1, Window w2, int i1, - int i2, int *i3, int *i4, Window *w3) -} -declare 73 macosx { +declare 54 macosx { int XUngrabKeyboard(Display *d, Time t) } -declare 74 macosx { +declare 55 macosx { int XUngrabPointer(Display *d, Time t) } -declare 75 macosx { +declare 56 macosx { int XUnmapWindow(Display *d, Window w) } -declare 76 macosx { - int XWindowEvent(Display *d, Window w, long l, XEvent *x) -} -declare 77 macosx { - void XDestroyIC(XIC x) -} -declare 78 macosx { - Bool XFilterEvent(XEvent *x, Window w) -} -declare 79 macosx { - int XmbLookupString(XIC xi, XKeyPressedEvent *xk, char *c, int i, - KeySym *k, Status *s) -} -declare 80 macosx { +declare 57 macosx { int TkPutImage(unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height) } -declare 81 macosx { - int XSetClipRectangles(Display *display, GC gc, int clip_x_origin, - int clip_y_origin, XRectangle rectangles[], int n, int ordering) -} -declare 82 macosx { +declare 58 macosx { Status XParseColor(Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr) } -declare 83 macosx { +declare 59 macosx { GC XCreateGC(Display *display, Drawable d, unsigned long valuemask, XGCValues *values) } -declare 84 macosx { +declare 60 macosx { int XFreeGC(Display *display, GC gc) } -declare 85 macosx { +declare 61 macosx { Atom XInternAtom(Display *display, _Xconst char *atom_name, Bool only_if_exists) } -declare 86 macosx { +declare 62 macosx { int XSetBackground(Display *display, GC gc, unsigned long foreground) } -declare 87 macosx { +declare 63 macosx { int XSetForeground(Display *display, GC gc, unsigned long foreground) } -declare 88 macosx { +declare 64 macosx { int XSetClipMask(Display *display, GC gc, Pixmap pixmap) } -declare 89 macosx { +declare 65 macosx { int XSetClipOrigin(Display *display, GC gc, int clip_x_origin, int clip_y_origin) } -declare 90 macosx { +declare 66 macosx { int XSetTSOrigin(Display *display, GC gc, int ts_x_origin, int ts_y_origin) } -declare 91 macosx { +declare 67 macosx { int XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values) } -declare 92 macosx { +declare 68 macosx { int XSetFont(Display *display, GC gc, Font font) } -declare 93 macosx { +declare 69 macosx { int XSetArcMode(Display *display, GC gc, int arc_mode) } -declare 94 macosx { +declare 70 macosx { int XSetStipple(Display *display, GC gc, Pixmap stipple) } -declare 95 macosx { +declare 71 macosx { int XSetFillRule(Display *display, GC gc, int fill_rule) } -declare 96 macosx { +declare 72 macosx { int XSetFillStyle(Display *display, GC gc, int fill_style) } -declare 97 macosx { +declare 73 macosx { int XSetFunction(Display *display, GC gc, int function) } -declare 98 macosx { +declare 74 macosx { int XSetLineAttributes(Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style) } -declare 99 macosx { +declare 75 macosx { int _XInitImageFuncPtrs(XImage *image) } -declare 100 macosx { +declare 76 macosx { XIC XCreateIC(XIM xim, ...) } -declare 101 macosx { +declare 77 macosx { XVisualInfo *XGetVisualInfo(Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return) } -declare 102 macosx { +declare 78 macosx { void XSetWMClientMachine(Display *display, Window w, XTextProperty *text_prop) } -declare 103 macosx { +declare 79 macosx { Status XStringListToTextProperty(char **list, int count, XTextProperty *text_prop_return) } -declare 104 macosx { +declare 80 macosx { + int XDrawSegments(Display *display, Drawable d, GC gc, + XSegment *segments, int nsegments) +} +declare 81 macosx { + int XForceScreenSaver(Display *display, int mode) +} +declare 82 macosx { int XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2) } -declare 105 macosx { - int XWarpPointer(Display *d, Window s, Window dw, int sx, int sy, - unsigned int sw, unsigned int sh, int dx, int dy) -} -declare 106 macosx { +declare 83 macosx { int XFillRectangle(Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height) } - -# New in Tk 8.6 +declare 84 macosx { + int XClearWindow(Display *d, Window w) +} +declare 85 macosx { + int XDrawPoint(Display *display, Drawable d, GC gc, int x, int y) +} +declare 86 macosx { + int XDrawPoints(Display *display, Drawable d, GC gc, XPoint *points, + int npoints, int mode) +} +declare 87 macosx { + int XWarpPointer(Display *display, Window src_w, Window dest_w, + int src_x, int src_y, unsigned int src_width, + unsigned int src_height, int dest_x, int dest_y) +} +declare 88 macosx { + int XQueryColor(Display *display, Colormap colormap, XColor *def_in_out) +} +declare 89 macosx { + int XQueryColors(Display *display, Colormap colormap, + XColor *defs_in_out, int ncolors) +} +declare 90 macosx { + Status XQueryTree(Display *d, Window w1, Window *w2, Window *w3, + Window **w4, unsigned int *ui) +} +declare 91 macosx { + int XSync(Display *display, Bool discard) +} +declare 92 macosx { + Bool XTranslateCoordinates(Display *d, Window w1, Window w2, int i1, + int i2, int *i3, int *i4, Window *w3) +} +declare 93 macosx { + int XDeleteProperty(Display *d, Window w, Atom a) +} +declare 94 macosx { + int XFreeCursor(Display *d, Cursor c) +} +declare 95 macosx { + int XGetInputFocus(Display *d, Window *w, int *i) +} +declare 96 macosx { + int XmbLookupString(XIC xi, XKeyPressedEvent *xk, char *c, int i, + KeySym *k, Status *s) +} +declare 97 macosx { + int XNextEvent(Display *d, XEvent *x) +} +declare 98 macosx { + int XPutBackEvent(Display *d, XEvent *x) +} +declare 99 macosx { + int XSetCommand(Display *d, Window w, char **c, int i) +} +declare 100 macosx { + int XWindowEvent(Display *d, Window w, long l, XEvent *x) +} +declare 101 macosx { + Status XGetWindowAttributes(Display *d, Window w, XWindowAttributes *x) +} +declare 102 macosx { + Status XGetWMColormapWindows(Display *d, Window w, Window **wpp, int *ip) +} +declare 103 macosx { + Status XIconifyWindow(Display *d, Window w, int i) +} +declare 104 macosx { + Status XWithdrawWindow(Display *d, Window w, int i) +} +declare 105 macosx { + XHostAddress *XListHosts(Display *d, int *i, Bool *b) +} +declare 106 macosx { + int XSetClipRectangles(Display *display, GC gc, int clip_x_origin, + int clip_y_origin, XRectangle rectangles[], int n, int ordering) +} declare 107 macosx { int XFlush(Display *display) } declare 108 macosx { int XGrabServer(Display *display) @@ -1859,34 +1953,29 @@ } declare 112 macosx { XAfterFunction XSynchronize(Display *display, Bool onoff) } declare 113 macosx { - int XSync(Display *display, Bool discard) + Status XLookupColor(Display *d, Colormap c1, _Xconst char *c2, + XColor *x1, XColor *x2) } declare 114 macosx { VisualID XVisualIDFromVisual(Visual *visual) } - -# For tktreectrl declare 120 macosx { int XOffsetRegion(Region rgn, int dx, int dy) } declare 121 macosx { int XUnionRegion(Region srca, Region srcb, Region dr_return) } - -# For 3dcanvas declare 122 macosx { Window XCreateWindow(Display *display, Window parent, int x, int y, unsigned int width, unsigned int height, unsigned int border_width, int depth, unsigned int clazz, Visual *visual, unsigned long value_mask, XSetWindowAttributes *attributes) } - -# Various, e.g. for stub-enabled BLT declare 129 macosx { int XLowerWindow(Display *d, Window w) } declare 130 macosx { int XFillArcs(Display *d, Drawable dr, GC gc, XArc *a, int n) @@ -1895,19 +1984,10 @@ int XDrawArcs(Display *d, Drawable dr, GC gc, XArc *a, int n) } declare 132 macosx { int XDrawRectangles(Display *d, Drawable dr, GC gc, XRectangle *r, int n) } -declare 133 macosx { - int XDrawSegments(Display *d, Drawable dr, GC gc, XSegment *s, int n) -} -declare 134 macosx { - int XDrawPoint(Display *d, Drawable dr, GC gc, int x, int y) -} -declare 135 macosx { - int XDrawPoints(Display *d, Drawable dr, GC gc, XPoint *p, int n, int m) -} declare 136 macosx { int XReparentWindow(Display *d, Window w, Window p, int x, int y) } declare 137 macosx { int XPutImage(Display *d, Drawable dr, GC gc, XImage *im, @@ -1918,11 +1998,10 @@ Region XPolygonRegion(XPoint *pts, int n, int rule) } declare 139 macosx { int XPointInRegion(Region rgn, int x, int y) } -# For XIM declare 140 macosx { XVaNestedList XVaCreateNestedList(int dummy, ...) } declare 141 macosx { char *XSetICValues(XIC xic, ...) @@ -1931,10 +2010,22 @@ char *XGetICValues(XIC xic, ...) } declare 143 macosx { void XSetICFocus(XIC xic) } +declare 144 macosx { + void XDestroyIC(XIC xic) +} +declare 145 macosx { + Cursor XCreatePixmapCursor(Display *d, Pixmap p1, Pixmap p2, + XColor *x1, XColor *x2, unsigned int ui1, unsigned int ui2) +} +declare 146 macosx { + Cursor XCreateGlyphCursor(Display *d, Font f1, Font f2, + unsigned int ui1, unsigned int ui2, XColor _Xconst *x1, + XColor _Xconst *x2) +} declare 147 macosx { void XFreeFontSet(Display *display, XFontSet fontset) } declare 148 macosx { int XCloseIM(XIM im) Index: generic/tkInt.h ================================================================== --- generic/tkInt.h +++ generic/tkInt.h @@ -72,18 +72,57 @@ # define TCL_UNUSED(T) T JOIN(dummy, __LINE__) __attribute__((unused)) # else # define TCL_UNUSED(T) T JOIN(dummy, __LINE__) # endif #endif + +#if (TCL_MAJOR_VERSION == 8) && defined(TCL_MINOR_VERSION) && (TCL_MINOR_VERSION < 7) +# define Tcl_WCharToUtfDString ((char * (*)(const WCHAR *, int, Tcl_DString *))Tcl_UniCharToUtfDString) +# define Tcl_UtfToWCharDString ((WCHAR * (*)(const char *, int, Tcl_DString *))Tcl_UtfToUniCharDString) +# define Tcl_Char16ToUtfDString Tcl_UniCharToUtfDString +# define Tcl_UtfToChar16DString Tcl_UtfToUniCharDString +# define TCL_COMBINE 0 +#endif + +/* Make available UTF-32 versions of the API, even though we compile with TCL_UTF_MAX=3 */ +#if TCL_MAJOR_VERSION > 8 +# define TkUtfToUniChar (tclStubsPtr->tcl_UtfToUniChar) /* 646 */ +# define TkUniCharToUtf (tclStubsPtr->tcl_UniCharToUtf) /* 324 (without TCL_COMBINE) */ +# define TkNumUtfChars (tclStubsPtr->tcl_NumUtfChars) /* 669 */ +# define TkGetCharLength (tclStubsPtr->tcl_GetCharLength) /* 670 */ +# define TkUtfAtIndex (tclStubsPtr->tcl_UtfAtIndex) /* 671 */ +#else + MODULE_SCOPE Tcl_Size TkUtfToUniChar(const char *, int *); + MODULE_SCOPE Tcl_Size TkUniCharToUtf(int, char *); +# ifdef USE_TCL_STUBS +# define TkNumUtfChars (((&tclStubsPtr->tcl_PkgProvideEx)[631]) ? \ + ((Tcl_Size (*)(const char *, Tcl_Size))(void *)((&tclStubsPtr->tcl_PkgProvideEx)[669])) \ + : (tclStubsPtr->tcl_NumUtfChars) /* 312 */) +# define TkGetCharLength (((&tclStubsPtr->tcl_PkgProvideEx)[631]) ? \ + ((Tcl_Size (*)(Tcl_Obj *))(void *)((&tclStubsPtr->tcl_PkgProvideEx)[670])) \ + : (tclStubsPtr->tcl_GetCharLength) /* 380 */) +# define TkUtfAtIndex (((&tclStubsPtr->tcl_PkgProvideEx)[631]) ? \ + ((const char *(*)(const char *, Tcl_Size))(void *)((&tclStubsPtr->tcl_PkgProvideEx)[671])) \ + : (tclStubsPtr->tcl_UtfAtIndex) /* 325 */) +# else +# define TkNumUtfChars TclNumUtfChars +# define TkGetCharLength TclGetCharLength +# define TkUtfAtIndex TclUtfAtIndex +# endif +#endif #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) # define TKFLEXARRAY #elif defined(__GNUC__) && (__GNUC__ > 2) # define TKFLEXARRAY 0 #else # define TKFLEXARRAY 1 #endif + +#if !defined(Tcl_GetParent) && (TCL_MAJOR_VERSION < 9) && defined(TCL_MINOR_VERSION) && (TCL_MINOR_VERSION < 7) +# define Tcl_GetParent Tcl_GetMaster +#endif /* * Macros used to cast between pointers and integers (e.g. when storing an int * in ClientData), on 64-bit architectures they avoid gcc warning about "cast * to/from pointer from/to integer of different size". @@ -543,10 +582,25 @@ Tcl_Size refCount; /* Reference count of how many Tk applications * are using this display. Used to clean up * the display when we no longer have any Tk * applications using it. */ + /* + * The following field were all added for Tk8.3 + */ + +#if TCL_MAJOR_VERSION < 9 +#if !defined(TK_NO_DEPRECATED) + int mouseButtonState; /* Current mouse button state for this + * display. NOT USED as of 8.6.10 */ + Window mouseButtonWindow; /* Window the button state was set in, added + * in Tk 8.4. */ +#else + int notused1; + XID notused2; +#endif /* !TK_NO_DEPRECATED */ +#endif Tk_Window warpWindow; Tk_Window warpMainwin; /* For finding the root window for warping * purposes. */ int warpX; int warpY; @@ -938,10 +992,22 @@ #define TK_MAKE_MENU_TEAROFF 0 /* Only non-transient case. */ #define TK_MAKE_MENU_POPUP 1 #define TK_MAKE_MENU_DROPDOWN 2 +/* See TIP #494 */ +#ifndef TCL_IO_FAILURE +# define TCL_IO_FAILURE (-1) +#endif +/* See TIP #537 */ +#ifndef TCL_INDEX_NONE +# define TCL_INDEX_NONE (-1) +#endif +#ifndef TCL_INDEX_END +# define TCL_INDEX_END ((Tcl_Size)-2) +#endif + /* * The following structure is used with TkMakeEnsemble to create ensemble * commands and optionally to create sub-ensembles. */ @@ -989,18 +1055,10 @@ #define TK_GRAB_NONE 0 #define TK_GRAB_IN_TREE 1 #define TK_GRAB_ANCESTOR 2 #define TK_GRAB_EXCLUDED 3 -/* - * Additional flag for TkpMeasureCharsInContext. Coordinate with other flags - * for this routine, but don't make public until TkpMeasureCharsInContext is - * made public, too. - */ - -#define TK_ISOLATE_END 32 - /* * The macro below is used to modify a "char" value (e.g. by casting it to an * unsigned character) so that it can be used safely with macros such as * isspace(). */ @@ -1034,21 +1092,29 @@ #endif #ifndef Button9 # define Button9 9 #endif +/* + * The ButtonMask modifiers for in {6 7 8 9} + * are internally used by Tk. They must be above the + * AnyModifier bit since anything below is reserved + * for the X protocol. If a future X11 version + * defines these, we adhere. + */ + #ifndef Button6Mask -# define Button6Mask (1<<13) +# define Button6Mask (AnyModifier<<6) #endif #ifndef Button7Mask -# define Button7Mask (1<<14) +# define Button7Mask (AnyModifier<<7) #endif #ifndef Button8Mask -# define Button8Mask (AnyModifier<<4) +# define Button8Mask (AnyModifier<<8) #endif #ifndef Button9Mask -# define Button9Mask (AnyModifier<<5) +# define Button9Mask (AnyModifier<<9) #endif /* * Mask that selects any of the state bits corresponding to buttons, plus * masks that select individual buttons' bits: @@ -1066,10 +1132,17 @@ typedef struct { Tcl_ObjType objType; size_t version; } TkObjType; + +#ifndef TCL_OBJTYPE_V0 +# define TCL_OBJTYPE_V0 /* just empty */ +#endif +#ifndef TCL_OBJTYPE_V1 +# define TCL_OBJTYPE_V1(lengthProc) /* just empty */ +#endif MODULE_SCOPE const TkObjType tkBorderObjType; MODULE_SCOPE const TkObjType tkBitmapObjType; MODULE_SCOPE const TkObjType tkColorObjType; MODULE_SCOPE const TkObjType tkCursorObjType; @@ -1234,26 +1307,14 @@ MODULE_SCOPE int TkParsePadAmount(Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, int *pad1Ptr, int *pad2Ptr); MODULE_SCOPE void TkFocusSplit(TkWindow *winPtr); MODULE_SCOPE void TkFocusJoin(TkWindow *winPtr); -MODULE_SCOPE void TkpDrawCharsInContext(Display * display, - Drawable drawable, GC gc, Tk_Font tkfont, - const char *source, Tcl_Size numBytes, Tcl_Size rangeStart, - Tcl_Size rangeLength, int x, int y); MODULE_SCOPE void TkpDrawAngledCharsInContext(Display * display, Drawable drawable, GC gc, Tk_Font tkfont, const char *source, Tcl_Size numBytes, Tcl_Size rangeStart, Tcl_Size rangeLength, double x, double y, double angle); -MODULE_SCOPE int TkpMeasureCharsInContext(Tk_Font tkfont, - const char *source, Tcl_Size numBytes, Tcl_Size rangeStart, - Tcl_Size rangeLength, int maxLength, int flags, - int *lengthPtr); -MODULE_SCOPE void TkUnderlineCharsInContext(Display *display, - Drawable drawable, GC gc, Tk_Font tkfont, - const char *string, Tcl_Size numBytes, int x, int y, - Tcl_Size firstByte, Tcl_Size lastByte); MODULE_SCOPE void TkpGetFontAttrsForChar(Tk_Window tkwin, Tk_Font tkfont, int c, struct TkFontAttributes *faPtr); MODULE_SCOPE void TkpDrawFrameEx(Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, int highlightWidth, int borderWidth, int relief); @@ -1279,17 +1340,25 @@ void *clientData); MODULE_SCOPE void TkInitEmbeddedConfigurationInformation( Tcl_Interp *interp); MODULE_SCOPE void TkDoWarpWrtWin(TkDisplay *dispPtr); MODULE_SCOPE void TkpWarpPointer(TkDisplay *dispPtr); +MODULE_SCOPE int TkListCreateFrame(void *clientData, + Tcl_Interp *interp, Tcl_Obj *listObj, + int toplevel, Tcl_Obj *nameObj); MODULE_SCOPE void TkRotatePoint(double originX, double originY, double sine, double cosine, double *xPtr, double *yPtr); MODULE_SCOPE int TkGetIntForIndex(Tcl_Obj *, Tcl_Size, int lastOK, Tcl_Size*); -#define TkNewIndexObj(value) (((Tcl_Size)(value) == TCL_INDEX_NONE) ? Tcl_NewObj() : Tcl_NewWideIntObj((Tcl_WideInt)(value))) -#define TK_OPTION_UNDERLINE_DEF(type, field) NULL, TCL_INDEX_NONE, offsetof(type, field), TK_OPTION_NULL_OK, NULL +#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9) +# define TkNewIndexObj(value) Tcl_NewWideIntObj((Tcl_WideInt)(value + 1) - 1) +# define TK_OPTION_UNDERLINE_DEF(type, field) "-1", TCL_INDEX_NONE, offsetof(type, field), 0, NULL +#else +# define TkNewIndexObj(value) (((Tcl_Size)(value) == TCL_INDEX_NONE) ? Tcl_NewObj() : Tcl_NewWideIntObj((Tcl_WideInt)(value))) +# define TK_OPTION_UNDERLINE_DEF(type, field) NULL, TCL_INDEX_NONE, offsetof(type, field), TK_OPTION_NULL_OK, NULL +#endif #ifdef _WIN32 #define TkParseColor XParseColor #else @@ -1327,11 +1396,11 @@ #if !defined(__cplusplus) && !defined(c_plusplus) # define c_class class #endif -#if defined(_WIN32) && !defined(STATIC_BUILD) && (TCL_MAJOR_VERSION < 9) && defined(TCL_MINOR_VERSION) +#if defined(_WIN32) && !defined(STATIC_BUILD) && TCL_MAJOR_VERSION < 9 # define tcl_CreateFileHandler reserved9 #endif MODULE_SCOPE void Icu_Init(Tcl_Interp* interp); @@ -1343,10 +1412,11 @@ /* * For Tktest. */ MODULE_SCOPE Tcl_ObjCmdProc SquareObjCmd; +MODULE_SCOPE int TkOldTestInit(Tcl_Interp *interp); #if !(defined(_WIN32) || defined(MAC_OSX_TK)) #define TkplatformtestInit(x) TCL_OK #else MODULE_SCOPE int TkplatformtestInit(Tcl_Interp *interp); #endif Index: generic/tkIntDecls.h ================================================================== --- generic/tkIntDecls.h +++ generic/tkIntDecls.h @@ -78,12 +78,12 @@ const char *source, const char *mask, int width, int height, int xHot, int yHot, XColor fg, XColor bg); /* 13 */ EXTERN int TkCreateFrame(void *clientData, Tcl_Interp *interp, - Tcl_Size objc, Tcl_Obj *const objv[], - int type, const char *appName); + Tcl_Size argc, const char *const *argv, + int toplevel, const char *appName); /* 14 */ EXTERN Tk_Window TkCreateMainWindow(Tcl_Interp *interp, const char *screenName, const char *baseName); /* 15 */ EXTERN Time TkCurrentTime(TkDisplay *dispPtr); @@ -200,22 +200,28 @@ EXTERN void TkpClaimFocus(TkWindow *topLevelPtr, int force); /* 58 */ EXTERN void TkpDisplayWarning(const char *msg, const char *title); /* 59 */ EXTERN void TkpGetAppName(Tcl_Interp *interp, Tcl_DString *name); -/* Slot 60 is reserved */ +/* 60 */ +TK_DEPRECATED("renamed to Tk_GetOtherWindow") +TkWindow * TkpGetOtherWindow(TkWindow *winPtr); /* 61 */ EXTERN TkWindow * TkpGetWrapperWindow(TkWindow *winPtr); /* 62 */ EXTERN int TkpInit(Tcl_Interp *interp); /* 63 */ EXTERN void TkpInitializeMenuBindings(Tcl_Interp *interp, Tk_BindingTable bindingTable); -/* Slot 64 is reserved */ +/* 64 */ +TK_DEPRECATED("renamed to Tk_MakeContainer") +void TkpMakeContainer(Tk_Window tkwin); /* 65 */ EXTERN void TkpMakeMenuWindow(Tk_Window tkwin, int transient); -/* Slot 66 is reserved */ +/* 66 */ +TK_DEPRECATED("renamed to Tk_MakeWindow") +Window TkpMakeWindow(TkWindow *winPtr, Window parent); /* 67 */ EXTERN void TkpMenuNotifyToplevelCreate(Tcl_Interp *interp, const char *menuName); /* 68 */ EXTERN TkDisplay * TkpOpenDisplay(const char *display_name); @@ -230,12 +236,18 @@ /* 72 */ EXTERN int TkPositionInTree(TkWindow *winPtr, TkWindow *treePtr); /* 73 */ EXTERN void TkpRedirectKeyEvent(TkWindow *winPtr, XEvent *eventPtr); -/* Slot 74 is reserved */ -/* Slot 75 is reserved */ +/* 74 */ +TK_DEPRECATED("renamed to Tk_SetMainMenubar") +void TkpSetMainMenubar(Tcl_Interp *interp, + Tk_Window tkwin, const char *menuName); +/* 75 */ +TK_DEPRECATED("renamed to Tk_UseWindow") +int TkpUseWindow(Tcl_Interp *interp, Tk_Window tkwin, + const char *string); /* Slot 76 is reserved */ /* 77 */ EXTERN void TkQueueEventForAllChildren(TkWindow *winPtr, XEvent *eventPtr); /* 78 */ @@ -256,11 +268,15 @@ /* 82 */ EXTERN void TkSelInit(Tk_Window tkwin); /* 83 */ EXTERN void TkSelPropProc(XEvent *eventPtr); /* Slot 84 is reserved */ -/* Slot 85 is reserved */ +/* 85 */ +TK_DEPRECATED("renamed to Tk_SetWindowMenubar") +void TkSetWindowMenuBar(Tcl_Interp *interp, + Tk_Window tkwin, const char *oldMenuName, + const char *menuName); /* 86 */ EXTERN KeySym TkStringToKeysym(const char *name); /* 87 */ EXTERN int TkThickPolyLineToArea(double *coordPtr, int numPoints, double width, int capStyle, @@ -317,11 +333,14 @@ /* 109 */ EXTERN const char * TkpGetString(TkWindow *winPtr, XEvent *eventPtr, Tcl_DString *dsPtr); /* 110 */ EXTERN void TkpGetSubFonts(Tcl_Interp *interp, Tk_Font tkfont); -/* Slot 111 is reserved */ +/* 111 */ +TK_DEPRECATED("renamed to Tk_GetSystemDefault") +Tcl_Obj * TkpGetSystemDefault(Tk_Window tkwin, + const char *dbName, const char *className); /* 112 */ EXTERN void TkpMenuThreadInit(void); /* 113 */ EXTERN int XClipBox(Region rgn, XRectangle *rect_return); /* 114 */ @@ -338,19 +357,25 @@ EXTERN int XSetRegion(Display *display, GC gc, Region rgn); /* 119 */ EXTERN int XUnionRectWithRegion(XRectangle *rect, Region src, Region dr_return); /* Slot 120 is reserved */ +#ifdef MAC_OSX_TK /* AQUA */ /* 121 */ EXTERN Pixmap TkpCreateNativeBitmap(Display *display, const void *source); +#endif /* AQUA */ +#ifdef MAC_OSX_TK /* AQUA */ /* 122 */ EXTERN void TkpDefineNativeBitmaps(void); +#endif /* AQUA */ /* Slot 123 is reserved */ +#ifdef MAC_OSX_TK /* AQUA */ /* 124 */ EXTERN Pixmap TkpGetNativeAppBitmap(Display *display, const char *name, int *width, int *height); +#endif /* AQUA */ /* Slot 125 is reserved */ /* Slot 126 is reserved */ /* Slot 127 is reserved */ /* Slot 128 is reserved */ /* Slot 129 is reserved */ @@ -357,11 +382,15 @@ /* Slot 130 is reserved */ /* Slot 131 is reserved */ /* Slot 132 is reserved */ /* Slot 133 is reserved */ /* Slot 134 is reserved */ -/* Slot 135 is reserved */ +/* 135 */ +TK_DEPRECATED("renamed to Tk_DrawHighlightBorder") +void TkpDrawHighlightBorder(Tk_Window tkwin, GC fgGC, + GC bgGC, int highlightWidth, + Drawable drawable); /* 136 */ EXTERN void TkSetFocusWin(TkWindow *winPtr, int force); /* 137 */ EXTERN void TkpSetKeycodeAndState(Tk_Window tkwin, KeySym keySym, XEvent *eventPtr); @@ -561,11 +590,11 @@ int (*tkClipInit) (Tcl_Interp *interp, TkDisplay *dispPtr); /* 8 */ void (*tkComputeAnchor) (Tk_Anchor anchor, Tk_Window tkwin, int padX, int padY, int innerWidth, int innerHeight, int *xPtr, int *yPtr); /* 9 */ void (*reserved10)(void); void (*reserved11)(void); TkCursor * (*tkCreateCursorFromData) (Tk_Window tkwin, const char *source, const char *mask, int width, int height, int xHot, int yHot, XColor fg, XColor bg); /* 12 */ - int (*tkCreateFrame) (void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[], int type, const char *appName); /* 13 */ + int (*tkCreateFrame) (void *clientData, Tcl_Interp *interp, Tcl_Size argc, const char *const *argv, int toplevel, const char *appName); /* 13 */ Tk_Window (*tkCreateMainWindow) (Tcl_Interp *interp, const char *screenName, const char *baseName); /* 14 */ Time (*tkCurrentTime) (TkDisplay *dispPtr); /* 15 */ void (*tkDeleteAllImages) (TkMainInfo *mainPtr); /* 16 */ void (*tkDoConfigureNotify) (TkWindow *winPtr); /* 17 */ void (*tkDrawInsetFocusHighlight) (Tk_Window tkwin, GC gc, int width, Drawable drawable, int padding); /* 18 */ @@ -608,36 +637,36 @@ int (*tkpChangeFocus) (TkWindow *winPtr, int force); /* 55 */ void (*tkpCloseDisplay) (TkDisplay *dispPtr); /* 56 */ void (*tkpClaimFocus) (TkWindow *topLevelPtr, int force); /* 57 */ void (*tkpDisplayWarning) (const char *msg, const char *title); /* 58 */ void (*tkpGetAppName) (Tcl_Interp *interp, Tcl_DString *name); /* 59 */ - void (*reserved60)(void); + TCL_DEPRECATED_API("renamed to Tk_GetOtherWindow") TkWindow * (*tkpGetOtherWindow) (TkWindow *winPtr); /* 60 */ TkWindow * (*tkpGetWrapperWindow) (TkWindow *winPtr); /* 61 */ int (*tkpInit) (Tcl_Interp *interp); /* 62 */ void (*tkpInitializeMenuBindings) (Tcl_Interp *interp, Tk_BindingTable bindingTable); /* 63 */ - void (*reserved64)(void); + TCL_DEPRECATED_API("renamed to Tk_MakeContainer") void (*tkpMakeContainer) (Tk_Window tkwin); /* 64 */ void (*tkpMakeMenuWindow) (Tk_Window tkwin, int transient); /* 65 */ - void (*reserved66)(void); + TCL_DEPRECATED_API("renamed to Tk_MakeWindow") Window (*tkpMakeWindow) (TkWindow *winPtr, Window parent); /* 66 */ void (*tkpMenuNotifyToplevelCreate) (Tcl_Interp *interp, const char *menuName); /* 67 */ TkDisplay * (*tkpOpenDisplay) (const char *display_name); /* 68 */ int (*tkPointerEvent) (XEvent *eventPtr, TkWindow *winPtr); /* 69 */ int (*tkPolygonToArea) (double *polyPtr, int numPoints, double *rectPtr); /* 70 */ double (*tkPolygonToPoint) (double *polyPtr, int numPoints, double *pointPtr); /* 71 */ int (*tkPositionInTree) (TkWindow *winPtr, TkWindow *treePtr); /* 72 */ void (*tkpRedirectKeyEvent) (TkWindow *winPtr, XEvent *eventPtr); /* 73 */ - void (*reserved74)(void); - void (*reserved75)(void); + TCL_DEPRECATED_API("renamed to Tk_SetMainMenubar") void (*tkpSetMainMenubar) (Tcl_Interp *interp, Tk_Window tkwin, const char *menuName); /* 74 */ + TCL_DEPRECATED_API("renamed to Tk_UseWindow") int (*tkpUseWindow) (Tcl_Interp *interp, Tk_Window tkwin, const char *string); /* 75 */ void (*reserved76)(void); void (*tkQueueEventForAllChildren) (TkWindow *winPtr, XEvent *eventPtr); /* 77 */ int (*tkReadBitmapFile) (Display *display, Drawable d, const char *filename, unsigned int *width_return, unsigned int *height_return, Pixmap *bitmap_return, int *x_hot_return, int *y_hot_return); /* 78 */ int (*tkScrollWindow) (Tk_Window tkwin, GC gc, int x, int y, int width, int height, int dx, int dy, Region damageRgn); /* 79 */ void (*tkSelDeadWindow) (TkWindow *winPtr); /* 80 */ void (*tkSelEventProc) (Tk_Window tkwin, XEvent *eventPtr); /* 81 */ void (*tkSelInit) (Tk_Window tkwin); /* 82 */ void (*tkSelPropProc) (XEvent *eventPtr); /* 83 */ void (*reserved84)(void); - void (*reserved85)(void); + TCL_DEPRECATED_API("renamed to Tk_SetWindowMenubar") void (*tkSetWindowMenuBar) (Tcl_Interp *interp, Tk_Window tkwin, const char *oldMenuName, const char *menuName); /* 85 */ KeySym (*tkStringToKeysym) (const char *name); /* 86 */ int (*tkThickPolyLineToArea) (double *coordPtr, int numPoints, double width, int capStyle, int joinStyle, double *rectPtr); /* 87 */ void (*tkWmAddToColormapWindows) (TkWindow *winPtr); /* 88 */ void (*tkWmDeadWindow) (TkWindow *winPtr); /* 89 */ TkWindow * (*tkWmFocusToplevel) (TkWindow *winPtr); /* 90 */ @@ -659,24 +688,57 @@ TkDisplay * (*tkGetDisplayList) (void); /* 106 */ TkMainInfo * (*tkGetMainInfoList) (void); /* 107 */ int (*tkGetWindowFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, Tk_Window *windowPtr); /* 108 */ const char * (*tkpGetString) (TkWindow *winPtr, XEvent *eventPtr, Tcl_DString *dsPtr); /* 109 */ void (*tkpGetSubFonts) (Tcl_Interp *interp, Tk_Font tkfont); /* 110 */ - void (*reserved111)(void); + TCL_DEPRECATED_API("renamed to Tk_GetSystemDefault") Tcl_Obj * (*tkpGetSystemDefault) (Tk_Window tkwin, const char *dbName, const char *className); /* 111 */ void (*tkpMenuThreadInit) (void); /* 112 */ int (*xClipBox) (Region rgn, XRectangle *rect_return); /* 113 */ Region (*xCreateRegion) (void); /* 114 */ int (*xDestroyRegion) (Region rgn); /* 115 */ int (*xIntersectRegion) (Region sra, Region srcb, Region dr_return); /* 116 */ int (*xRectInRegion) (Region rgn, int x, int y, unsigned int width, unsigned int height); /* 117 */ int (*xSetRegion) (Display *display, GC gc, Region rgn); /* 118 */ int (*xUnionRectWithRegion) (XRectangle *rect, Region src, Region dr_return); /* 119 */ void (*reserved120)(void); +#if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */ + void (*reserved121)(void); +#endif /* X11 */ +#if defined(_WIN32) /* WIN */ + void (*reserved121)(void); +#endif /* WIN */ +#ifdef MAC_OSX_TK /* AQUA */ +# if TCL_MAJOR_VERSION < 9 + void (*reserved121)(void); /* Dummy entry for stubs table backwards compatibility */ +# endif /* TCL_MAJOR_VERSION < 9 */ Pixmap (*tkpCreateNativeBitmap) (Display *display, const void *source); /* 121 */ +#endif /* AQUA */ +#if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */ + void (*reserved122)(void); +#endif /* X11 */ +#if defined(_WIN32) /* WIN */ + void (*reserved122)(void); +#endif /* WIN */ +#ifdef MAC_OSX_TK /* AQUA */ +# if TCL_MAJOR_VERSION < 9 + void (*reserved122)(void); /* Dummy entry for stubs table backwards compatibility */ +# endif /* TCL_MAJOR_VERSION < 9 */ void (*tkpDefineNativeBitmaps) (void); /* 122 */ +#endif /* AQUA */ void (*reserved123)(void); +#if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */ + void (*reserved124)(void); +#endif /* X11 */ +#if defined(_WIN32) /* WIN */ + void (*reserved124)(void); +#endif /* WIN */ +#ifdef MAC_OSX_TK /* AQUA */ +# if TCL_MAJOR_VERSION < 9 + void (*reserved124)(void); /* Dummy entry for stubs table backwards compatibility */ +# endif /* TCL_MAJOR_VERSION < 9 */ Pixmap (*tkpGetNativeAppBitmap) (Display *display, const char *name, int *width, int *height); /* 124 */ +#endif /* AQUA */ void (*reserved125)(void); void (*reserved126)(void); void (*reserved127)(void); void (*reserved128)(void); void (*reserved129)(void); @@ -683,11 +745,11 @@ void (*reserved130)(void); void (*reserved131)(void); void (*reserved132)(void); void (*reserved133)(void); void (*reserved134)(void); - void (*reserved135)(void); + TCL_DEPRECATED_API("renamed to Tk_DrawHighlightBorder") void (*tkpDrawHighlightBorder) (Tk_Window tkwin, GC fgGC, GC bgGC, int highlightWidth, Drawable drawable); /* 135 */ void (*tkSetFocusWin) (TkWindow *winPtr, int force); /* 136 */ void (*tkpSetKeycodeAndState) (Tk_Window tkwin, KeySym keySym, XEvent *eventPtr); /* 137 */ KeySym (*tkpGetKeySym) (TkDisplay *dispPtr, XEvent *eventPtr); /* 138 */ void (*tkpInitKeymapInfo) (TkDisplay *dispPtr); /* 139 */ Region (*tkPhotoGetValidRegion) (Tk_PhotoHandle handle); /* 140 */ @@ -867,21 +929,24 @@ (tkIntStubsPtr->tkpClaimFocus) /* 57 */ #define TkpDisplayWarning \ (tkIntStubsPtr->tkpDisplayWarning) /* 58 */ #define TkpGetAppName \ (tkIntStubsPtr->tkpGetAppName) /* 59 */ -/* Slot 60 is reserved */ +#define TkpGetOtherWindow \ + (tkIntStubsPtr->tkpGetOtherWindow) /* 60 */ #define TkpGetWrapperWindow \ (tkIntStubsPtr->tkpGetWrapperWindow) /* 61 */ #define TkpInit \ (tkIntStubsPtr->tkpInit) /* 62 */ #define TkpInitializeMenuBindings \ (tkIntStubsPtr->tkpInitializeMenuBindings) /* 63 */ -/* Slot 64 is reserved */ +#define TkpMakeContainer \ + (tkIntStubsPtr->tkpMakeContainer) /* 64 */ #define TkpMakeMenuWindow \ (tkIntStubsPtr->tkpMakeMenuWindow) /* 65 */ -/* Slot 66 is reserved */ +#define TkpMakeWindow \ + (tkIntStubsPtr->tkpMakeWindow) /* 66 */ #define TkpMenuNotifyToplevelCreate \ (tkIntStubsPtr->tkpMenuNotifyToplevelCreate) /* 67 */ #define TkpOpenDisplay \ (tkIntStubsPtr->tkpOpenDisplay) /* 68 */ #define TkPointerEvent \ @@ -892,12 +957,14 @@ (tkIntStubsPtr->tkPolygonToPoint) /* 71 */ #define TkPositionInTree \ (tkIntStubsPtr->tkPositionInTree) /* 72 */ #define TkpRedirectKeyEvent \ (tkIntStubsPtr->tkpRedirectKeyEvent) /* 73 */ -/* Slot 74 is reserved */ -/* Slot 75 is reserved */ +#define TkpSetMainMenubar \ + (tkIntStubsPtr->tkpSetMainMenubar) /* 74 */ +#define TkpUseWindow \ + (tkIntStubsPtr->tkpUseWindow) /* 75 */ /* Slot 76 is reserved */ #define TkQueueEventForAllChildren \ (tkIntStubsPtr->tkQueueEventForAllChildren) /* 77 */ #define TkReadBitmapFile \ (tkIntStubsPtr->tkReadBitmapFile) /* 78 */ @@ -910,11 +977,12 @@ #define TkSelInit \ (tkIntStubsPtr->tkSelInit) /* 82 */ #define TkSelPropProc \ (tkIntStubsPtr->tkSelPropProc) /* 83 */ /* Slot 84 is reserved */ -/* Slot 85 is reserved */ +#define TkSetWindowMenuBar \ + (tkIntStubsPtr->tkSetWindowMenuBar) /* 85 */ #define TkStringToKeysym \ (tkIntStubsPtr->tkStringToKeysym) /* 86 */ #define TkThickPolyLineToArea \ (tkIntStubsPtr->tkThickPolyLineToArea) /* 87 */ #define TkWmAddToColormapWindows \ @@ -961,11 +1029,12 @@ (tkIntStubsPtr->tkGetWindowFromObj) /* 108 */ #define TkpGetString \ (tkIntStubsPtr->tkpGetString) /* 109 */ #define TkpGetSubFonts \ (tkIntStubsPtr->tkpGetSubFonts) /* 110 */ -/* Slot 111 is reserved */ +#define TkpGetSystemDefault \ + (tkIntStubsPtr->tkpGetSystemDefault) /* 111 */ #define TkpMenuThreadInit \ (tkIntStubsPtr->tkpMenuThreadInit) /* 112 */ #define XClipBox \ (tkIntStubsPtr->xClipBox) /* 113 */ #define XCreateRegion \ @@ -979,17 +1048,23 @@ #define XSetRegion \ (tkIntStubsPtr->xSetRegion) /* 118 */ #define XUnionRectWithRegion \ (tkIntStubsPtr->xUnionRectWithRegion) /* 119 */ /* Slot 120 is reserved */ +#ifdef MAC_OSX_TK /* AQUA */ #define TkpCreateNativeBitmap \ (tkIntStubsPtr->tkpCreateNativeBitmap) /* 121 */ +#endif /* AQUA */ +#ifdef MAC_OSX_TK /* AQUA */ #define TkpDefineNativeBitmaps \ (tkIntStubsPtr->tkpDefineNativeBitmaps) /* 122 */ +#endif /* AQUA */ /* Slot 123 is reserved */ +#ifdef MAC_OSX_TK /* AQUA */ #define TkpGetNativeAppBitmap \ (tkIntStubsPtr->tkpGetNativeAppBitmap) /* 124 */ +#endif /* AQUA */ /* Slot 125 is reserved */ /* Slot 126 is reserved */ /* Slot 127 is reserved */ /* Slot 128 is reserved */ /* Slot 129 is reserved */ @@ -996,11 +1071,12 @@ /* Slot 130 is reserved */ /* Slot 131 is reserved */ /* Slot 132 is reserved */ /* Slot 133 is reserved */ /* Slot 134 is reserved */ -/* Slot 135 is reserved */ +#define TkpDrawHighlightBorder \ + (tkIntStubsPtr->tkpDrawHighlightBorder) /* 135 */ #define TkSetFocusWin \ (tkIntStubsPtr->tkSetFocusWin) /* 136 */ #define TkpSetKeycodeAndState \ (tkIntStubsPtr->tkpSetKeycodeAndState) /* 137 */ #define TkpGetKeySym \ @@ -1107,20 +1183,42 @@ /* !END!: Do not edit above this line. */ #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT + +#undef TkpCmapStressed_ +#undef TkpSync_ +#undef TkUnixContainerId_ +#undef TkUnixDoOneXEvent_ +#undef TkUnixSetMenubar_ +#undef TkWmCleanup_ +#undef TkSendCleanup_ +#undef TkpTestsendCmd_ +#undef TkSetWindowMenuBar +#undef TkpDrawHighlightBorder +#undef TkpUseWindow +#undef TkpSetMainMenubar +#undef TkpGetOtherWindow +#undef TkpGetSystemDefault +#undef TkpMakeContainer +#undef TkpMakeWindow + +#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION == 8) +# define TkSetWindowMenuBar Tk_SetWindowMenubar +# define TkpDrawHighlightBorder Tk_DrawHighlightBorder +# define TkpUseWindow Tk_UseWindow +# define TkpSetMainMenubar Tk_SetMainMenubar +# define TkpGetOtherWindow ((TkWindow *(*)(TkWindow *))(void *)Tk_GetOtherWindow) +# define TkpGetSystemDefault Tk_GetSystemDefault +# define TkpMakeContainer Tk_MakeContainer +# define TkpMakeWindow ((Window (*)(TkWindow *, Window))(void *)Tk_MakeWindow) +#endif #if !defined(MAC_OSX_TK) && !defined(USE_TK_STUBS) # undef TkpWillDrawWidget # undef TkpRedrawWidget -# undef TkpDefineNativeBitmaps -# undef TkpCreateNativeBitmap -# undef TkpGetNativeAppBitmap # define TkpWillDrawWidget(w) 0 # define TkpRedrawWidget(w) -# define TkpDefineNativeBitmaps() -# define TkpCreateNativeBitmap(display, source) None -# define TkpGetNativeAppBitmap(display, name, w, h) None #endif #endif /* _TKINTDECLS */ Index: generic/tkIntPlatDecls.h ================================================================== --- generic/tkIntPlatDecls.h +++ generic/tkIntPlatDecls.h @@ -34,11 +34,12 @@ * Exported function declarations: */ #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ /* 0 */ -EXTERN void TkCreateXEventSource(void); +EXTERN char * TkAlignImageData(XImage *image, int alignment, + int bitOrder); /* Slot 1 is reserved */ /* 2 */ EXTERN void TkGenerateActivateEvents(TkWindow *winPtr, int active); /* 3 */ @@ -111,20 +112,20 @@ EXTERN void TkWinDialogDebug(int debug); /* 32 */ EXTERN Tcl_Obj * TkWinGetMenuSystemDefault(Tk_Window tkwin, const char *dbName, const char *className); /* 33 */ -EXTERN char * TkAlignImageData(XImage *image, int alignment, - int bitOrder); +EXTERN int TkWinGetPlatformId(void); /* 34 */ EXTERN void TkWinSetHINSTANCE(HINSTANCE hInstance); /* 35 */ EXTERN int TkWinGetPlatformTheme(void); /* 36 */ EXTERN LRESULT __stdcall TkWinChildProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); -/* Slot 37 is reserved */ +/* 37 */ +EXTERN void TkCreateXEventSource(void); /* 38 */ EXTERN int TkpCmapStressed(Tk_Window tkwin, Colormap colormap); /* 39 */ EXTERN void TkpSync(Display *display); /* 40 */ @@ -143,35 +144,34 @@ /* Slot 46 is reserved */ /* 47 */ EXTERN Tk_Window TkpGetCapture(void); #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ -/* Slot 0 is reserved */ -/* 1 */ -EXTERN void TkAboutDlg(void); +/* 0 */ +EXTERN void TkGenerateActivateEvents(TkWindow *winPtr, + int active); +/* Slot 1 is reserved */ /* 2 */ -EXTERN void TkGenerateActivateEvents(TkWindow *winPtr, +EXTERN void TkGenerateActivateEvents_(TkWindow *winPtr, int active); /* 3 */ -EXTERN unsigned long TkpGetMS(void); +EXTERN void TkPointerDeadWindow(TkWindow *winPtr); /* 4 */ -EXTERN void TkPointerDeadWindow(TkWindow *winPtr); +EXTERN void TkpSetCapture(TkWindow *winPtr); /* 5 */ EXTERN void TkpSetCursor(TkpCursor cursor); /* 6 */ -EXTERN int TkpScanWindowId(Tcl_Interp *interp, - const char *string, Window *idPtr); +EXTERN void TkpWmSetState(TkWindow *winPtr, int state); /* 7 */ -EXTERN int TkpWmSetState(TkWindow *winPtr, int state); +EXTERN void TkAboutDlg(void); /* 8 */ EXTERN unsigned int TkMacOSXButtonKeyState(void); /* 9 */ EXTERN void TkMacOSXClearMenubarActive(void); /* 10 */ EXTERN int TkMacOSXDispatchMenuEvent(int menuID, int index); -/* 11 */ -EXTERN void TkpSetCapture(TkWindow *winPtr); +/* Slot 11 is reserved */ /* 12 */ EXTERN void TkMacOSXHandleTearoffMenu(void); /* Slot 13 is reserved */ /* 14 */ EXTERN int TkMacOSXDoHLEvent(void *theEvent); @@ -186,11 +186,13 @@ /* Slot 19 is reserved */ /* Slot 20 is reserved */ /* 21 */ EXTERN void TkMacOSXInvalidateWindow(MacDrawable *macWin, int flag); -/* Slot 22 is reserved */ +/* 22 */ +EXTERN int TkMacOSXIsCharacterMissing(Tk_Font tkfont, + unsigned int searchChar); /* 23 */ EXTERN void TkMacOSXMakeRealWindowExist(TkWindow *winPtr); /* 24 */ EXTERN void * TkMacOSXMakeStippleMap(Drawable d1, Drawable d2); /* 25 */ @@ -200,11 +202,12 @@ EXTERN int TkMacOSXResizable(TkWindow *winPtr); /* 28 */ EXTERN void TkMacOSXSetHelpMenuItemCount(void); /* 29 */ EXTERN void TkMacOSXSetScrollbarGrow(TkWindow *winPtr, int flag); -/* Slot 30 is reserved */ +/* 30 */ +EXTERN void TkMacOSXSetUpClippingRgn(Drawable drawable); /* 31 */ EXTERN void TkMacOSXSetUpGraphicsPort(GC gc, void *destPort); /* 32 */ EXTERN void TkMacOSXUpdateClipRgn(TkWindow *winPtr); /* Slot 33 is reserved */ @@ -244,32 +247,50 @@ /* 50 */ EXTERN int TkGenerateButtonEvent(int x, int y, Window window, unsigned int state); /* 51 */ EXTERN void TkGenWMDestroyEvent(Tk_Window tkwin); +/* 52 */ +EXTERN void TkMacOSXSetDrawingEnabled(TkWindow *winPtr, int flag); +/* 53 */ +EXTERN unsigned long TkpGetMS(void); +/* 54 */ +EXTERN void * TkMacOSXDrawable(Drawable drawable); +/* 55 */ +EXTERN int TkpScanWindowId(Tcl_Interp *interp, + const char *string, Window *idPtr); #endif /* AQUA */ #if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ /* 0 */ EXTERN void TkCreateXEventSource(void); /* Slot 1 is reserved */ /* 2 */ EXTERN void TkGenerateActivateEvents(TkWindow *winPtr, int active); -/* Slot 3 is reserved */ -/* Slot 4 is reserved */ -/* Slot 5 is reserved */ +/* 3 */ +EXTERN int TkpCmapStressed(Tk_Window tkwin, Colormap colormap); +/* 4 */ +EXTERN void TkpSync(Display *display); +/* 5 */ +EXTERN Window TkUnixContainerId(TkWindow *winPtr); /* 6 */ +EXTERN int TkUnixDoOneXEvent(Tcl_Time *timePtr); +/* 7 */ +EXTERN void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar); +/* 8 */ EXTERN int TkpScanWindowId(Tcl_Interp *interp, const char *string, Window *idPtr); -/* Slot 7 is reserved */ -/* Slot 8 is reserved */ /* 9 */ -EXTERN int TkpWmSetState(TkWindow *winPtr, int state); -/* Slot 10 is reserved */ +EXTERN void TkWmCleanup(TkDisplay *dispPtr); +/* 10 */ +EXTERN void TkSendCleanup(TkDisplay *dispPtr); /* Slot 11 is reserved */ -/* Slot 12 is reserved */ -/* Slot 13 is reserved */ +/* 12 */ +EXTERN int TkpWmSetState(TkWindow *winPtr, int state); +/* 13 */ +EXTERN int TkpTestsendCmd_(void *clientData, Tcl_Interp *interp, + Tcl_Size objc, Tcl_Obj *const objv[]); /* Slot 14 is reserved */ /* Slot 15 is reserved */ /* Slot 16 is reserved */ /* Slot 17 is reserved */ /* Slot 18 is reserved */ @@ -291,23 +312,23 @@ /* Slot 34 is reserved */ /* Slot 35 is reserved */ /* Slot 36 is reserved */ /* Slot 37 is reserved */ /* 38 */ -EXTERN int TkpCmapStressed(Tk_Window tkwin, Colormap colormap); +EXTERN int TkpCmapStressed_(Tk_Window tkwin, Colormap colormap); /* 39 */ -EXTERN void TkpSync(Display *display); +EXTERN void TkpSync_(Display *display); /* 40 */ -EXTERN Window TkUnixContainerId(TkWindow *winPtr); +EXTERN Window TkUnixContainerId_(TkWindow *winPtr); /* 41 */ -EXTERN int TkUnixDoOneXEvent(Tcl_Time *timePtr); +EXTERN int TkUnixDoOneXEvent_(Tcl_Time *timePtr); /* 42 */ -EXTERN void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar); +EXTERN void TkUnixSetMenubar_(Tk_Window tkwin, Tk_Window menubar); /* 43 */ -EXTERN void TkWmCleanup(TkDisplay *dispPtr); +EXTERN void TkWmCleanup_(TkDisplay *dispPtr); /* 44 */ -EXTERN void TkSendCleanup(TkDisplay *dispPtr); +EXTERN void TkSendCleanup_(TkDisplay *dispPtr); /* 45 */ EXTERN int TkpTestsendCmd(void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); #endif /* X11 */ @@ -314,11 +335,11 @@ typedef struct TkIntPlatStubs { int magic; void *hooks; #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ - void (*tkCreateXEventSource) (void); /* 0 */ + char * (*tkAlignImageData) (XImage *image, int alignment, int bitOrder); /* 0 */ void (*reserved1)(void); void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 2 */ unsigned long (*tkpGetMS) (void); /* 3 */ void (*tkPointerDeadWindow) (TkWindow *winPtr); /* 4 */ void (*tkpPrintWindowId) (char *buf, Window window); /* 5 */ @@ -347,15 +368,15 @@ void (*tkWinXCleanup) (void *clientData); /* 28 */ void (*tkWinXInit) (HINSTANCE hInstance); /* 29 */ void (*tkWinSetForegroundWindow) (TkWindow *winPtr); /* 30 */ void (*tkWinDialogDebug) (int debug); /* 31 */ Tcl_Obj * (*tkWinGetMenuSystemDefault) (Tk_Window tkwin, const char *dbName, const char *className); /* 32 */ - char * (*tkAlignImageData) (XImage *image, int alignment, int bitOrder); /* 33 */ + int (*tkWinGetPlatformId) (void); /* 33 */ void (*tkWinSetHINSTANCE) (HINSTANCE hInstance); /* 34 */ int (*tkWinGetPlatformTheme) (void); /* 35 */ LRESULT (__stdcall *tkWinChildProc) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); /* 36 */ - void (*reserved37)(void); + void (*tkCreateXEventSource) (void); /* 37 */ int (*tkpCmapStressed) (Tk_Window tkwin, Colormap colormap); /* 38 */ void (*tkpSync) (Display *display); /* 39 */ Window (*tkUnixContainerId) (TkWindow *winPtr); /* 40 */ int (*tkUnixDoOneXEvent) (Tcl_Time *timePtr); /* 41 */ void (*tkUnixSetMenubar) (Tk_Window tkwin, Tk_Window menubar); /* 42 */ @@ -364,22 +385,22 @@ int (*tkpTestsendCmd) (void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); /* 45 */ void (*reserved46)(void); Tk_Window (*tkpGetCapture) (void); /* 47 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ - void (*reserved0)(void); - void (*tkAboutDlg) (void); /* 1 */ - void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 2 */ - unsigned long (*tkpGetMS) (void); /* 3 */ - void (*tkPointerDeadWindow) (TkWindow *winPtr); /* 4 */ + void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 0 */ + void (*reserved1)(void); + void (*tkGenerateActivateEvents_) (TkWindow *winPtr, int active); /* 2 */ + void (*tkPointerDeadWindow) (TkWindow *winPtr); /* 3 */ + void (*tkpSetCapture) (TkWindow *winPtr); /* 4 */ void (*tkpSetCursor) (TkpCursor cursor); /* 5 */ - int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 6 */ - int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 7 */ + void (*tkpWmSetState) (TkWindow *winPtr, int state); /* 6 */ + void (*tkAboutDlg) (void); /* 7 */ unsigned int (*tkMacOSXButtonKeyState) (void); /* 8 */ void (*tkMacOSXClearMenubarActive) (void); /* 9 */ int (*tkMacOSXDispatchMenuEvent) (int menuID, int index); /* 10 */ - void (*tkpSetCapture) (TkWindow *winPtr); /* 11 */ + void (*reserved11)(void); void (*tkMacOSXHandleTearoffMenu) (void); /* 12 */ void (*reserved13)(void); int (*tkMacOSXDoHLEvent) (void *theEvent); /* 14 */ void (*reserved15)(void); Window (*tkMacOSXGetXWindow) (void *macWinPtr); /* 16 */ @@ -386,19 +407,19 @@ int (*tkMacOSXGrowToplevel) (void *whichWindow, XPoint start); /* 17 */ void (*tkMacOSXHandleMenuSelect) (short theMenu, unsigned short theItem, int optionKeyPressed); /* 18 */ void (*reserved19)(void); void (*reserved20)(void); void (*tkMacOSXInvalidateWindow) (MacDrawable *macWin, int flag); /* 21 */ - void (*reserved22)(void); + int (*tkMacOSXIsCharacterMissing) (Tk_Font tkfont, unsigned int searchChar); /* 22 */ void (*tkMacOSXMakeRealWindowExist) (TkWindow *winPtr); /* 23 */ void * (*tkMacOSXMakeStippleMap) (Drawable d1, Drawable d2); /* 24 */ void (*tkMacOSXMenuClick) (void); /* 25 */ void (*reserved26)(void); int (*tkMacOSXResizable) (TkWindow *winPtr); /* 27 */ void (*tkMacOSXSetHelpMenuItemCount) (void); /* 28 */ void (*tkMacOSXSetScrollbarGrow) (TkWindow *winPtr, int flag); /* 29 */ - void (*reserved30)(void); + void (*tkMacOSXSetUpClippingRgn) (Drawable drawable); /* 30 */ void (*tkMacOSXSetUpGraphicsPort) (GC gc, void *destPort); /* 31 */ void (*tkMacOSXUpdateClipRgn) (TkWindow *winPtr); /* 32 */ void (*reserved33)(void); int (*tkMacOSXUseMenuID) (short macID); /* 34 */ Region (*tkMacOSXVisableClipRgn) (TkWindow *winPtr); /* 35 */ @@ -416,26 +437,30 @@ Tk_Window (*tkpGetCapture) (void); /* 47 */ void (*reserved48)(void); Tk_Window (*tkMacOSXGetContainer) (TkWindow *winPtr); /* 49 */ int (*tkGenerateButtonEvent) (int x, int y, Window window, unsigned int state); /* 50 */ void (*tkGenWMDestroyEvent) (Tk_Window tkwin); /* 51 */ + void (*tkMacOSXSetDrawingEnabled) (TkWindow *winPtr, int flag); /* 52 */ + unsigned long (*tkpGetMS) (void); /* 53 */ + void * (*tkMacOSXDrawable) (Drawable drawable); /* 54 */ + int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 55 */ #endif /* AQUA */ #if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ void (*tkCreateXEventSource) (void); /* 0 */ void (*reserved1)(void); void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 2 */ - void (*reserved3)(void); - void (*reserved4)(void); - void (*reserved5)(void); - int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 6 */ - void (*reserved7)(void); - void (*reserved8)(void); - int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 9 */ - void (*reserved10)(void); + int (*tkpCmapStressed) (Tk_Window tkwin, Colormap colormap); /* 3 */ + void (*tkpSync) (Display *display); /* 4 */ + Window (*tkUnixContainerId) (TkWindow *winPtr); /* 5 */ + int (*tkUnixDoOneXEvent) (Tcl_Time *timePtr); /* 6 */ + void (*tkUnixSetMenubar) (Tk_Window tkwin, Tk_Window menubar); /* 7 */ + int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 8 */ + void (*tkWmCleanup) (TkDisplay *dispPtr); /* 9 */ + void (*tkSendCleanup) (TkDisplay *dispPtr); /* 10 */ void (*reserved11)(void); - void (*reserved12)(void); - void (*reserved13)(void); + int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 12 */ + int (*tkpTestsendCmd_) (void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); /* 13 */ void (*reserved14)(void); void (*reserved15)(void); void (*reserved16)(void); void (*reserved17)(void); void (*reserved18)(void); @@ -456,17 +481,17 @@ void (*reserved33)(void); void (*reserved34)(void); void (*reserved35)(void); void (*reserved36)(void); void (*reserved37)(void); - int (*tkpCmapStressed) (Tk_Window tkwin, Colormap colormap); /* 38 */ - void (*tkpSync) (Display *display); /* 39 */ - Window (*tkUnixContainerId) (TkWindow *winPtr); /* 40 */ - int (*tkUnixDoOneXEvent) (Tcl_Time *timePtr); /* 41 */ - void (*tkUnixSetMenubar) (Tk_Window tkwin, Tk_Window menubar); /* 42 */ - void (*tkWmCleanup) (TkDisplay *dispPtr); /* 43 */ - void (*tkSendCleanup) (TkDisplay *dispPtr); /* 44 */ + int (*tkpCmapStressed_) (Tk_Window tkwin, Colormap colormap); /* 38 */ + void (*tkpSync_) (Display *display); /* 39 */ + Window (*tkUnixContainerId_) (TkWindow *winPtr); /* 40 */ + int (*tkUnixDoOneXEvent_) (Tcl_Time *timePtr); /* 41 */ + void (*tkUnixSetMenubar_) (Tk_Window tkwin, Tk_Window menubar); /* 42 */ + void (*tkWmCleanup_) (TkDisplay *dispPtr); /* 43 */ + void (*tkSendCleanup_) (TkDisplay *dispPtr); /* 44 */ int (*tkpTestsendCmd) (void *clientData, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]); /* 45 */ #endif /* X11 */ } TkIntPlatStubs; extern const TkIntPlatStubs *tkIntPlatStubsPtr; @@ -480,12 +505,12 @@ /* * Inline function declarations: */ #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ -#define TkCreateXEventSource \ - (tkIntPlatStubsPtr->tkCreateXEventSource) /* 0 */ +#define TkAlignImageData \ + (tkIntPlatStubsPtr->tkAlignImageData) /* 0 */ /* Slot 1 is reserved */ #define TkGenerateActivateEvents \ (tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 2 */ #define TkpGetMS \ (tkIntPlatStubsPtr->tkpGetMS) /* 3 */ @@ -545,19 +570,20 @@ (tkIntPlatStubsPtr->tkWinSetForegroundWindow) /* 30 */ #define TkWinDialogDebug \ (tkIntPlatStubsPtr->tkWinDialogDebug) /* 31 */ #define TkWinGetMenuSystemDefault \ (tkIntPlatStubsPtr->tkWinGetMenuSystemDefault) /* 32 */ -#define TkAlignImageData \ - (tkIntPlatStubsPtr->tkAlignImageData) /* 33 */ +#define TkWinGetPlatformId \ + (tkIntPlatStubsPtr->tkWinGetPlatformId) /* 33 */ #define TkWinSetHINSTANCE \ (tkIntPlatStubsPtr->tkWinSetHINSTANCE) /* 34 */ #define TkWinGetPlatformTheme \ (tkIntPlatStubsPtr->tkWinGetPlatformTheme) /* 35 */ #define TkWinChildProc \ (tkIntPlatStubsPtr->tkWinChildProc) /* 36 */ -/* Slot 37 is reserved */ +#define TkCreateXEventSource \ + (tkIntPlatStubsPtr->tkCreateXEventSource) /* 37 */ #define TkpCmapStressed \ (tkIntPlatStubsPtr->tkpCmapStressed) /* 38 */ #define TkpSync \ (tkIntPlatStubsPtr->tkpSync) /* 39 */ #define TkUnixContainerId \ @@ -575,33 +601,32 @@ /* Slot 46 is reserved */ #define TkpGetCapture \ (tkIntPlatStubsPtr->tkpGetCapture) /* 47 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ -/* Slot 0 is reserved */ -#define TkAboutDlg \ - (tkIntPlatStubsPtr->tkAboutDlg) /* 1 */ #define TkGenerateActivateEvents \ - (tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 2 */ -#define TkpGetMS \ - (tkIntPlatStubsPtr->tkpGetMS) /* 3 */ + (tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 0 */ +/* Slot 1 is reserved */ +#define TkGenerateActivateEvents_ \ + (tkIntPlatStubsPtr->tkGenerateActivateEvents_) /* 2 */ #define TkPointerDeadWindow \ - (tkIntPlatStubsPtr->tkPointerDeadWindow) /* 4 */ + (tkIntPlatStubsPtr->tkPointerDeadWindow) /* 3 */ +#define TkpSetCapture \ + (tkIntPlatStubsPtr->tkpSetCapture) /* 4 */ #define TkpSetCursor \ (tkIntPlatStubsPtr->tkpSetCursor) /* 5 */ -#define TkpScanWindowId \ - (tkIntPlatStubsPtr->tkpScanWindowId) /* 6 */ #define TkpWmSetState \ - (tkIntPlatStubsPtr->tkpWmSetState) /* 7 */ + (tkIntPlatStubsPtr->tkpWmSetState) /* 6 */ +#define TkAboutDlg \ + (tkIntPlatStubsPtr->tkAboutDlg) /* 7 */ #define TkMacOSXButtonKeyState \ (tkIntPlatStubsPtr->tkMacOSXButtonKeyState) /* 8 */ #define TkMacOSXClearMenubarActive \ (tkIntPlatStubsPtr->tkMacOSXClearMenubarActive) /* 9 */ #define TkMacOSXDispatchMenuEvent \ (tkIntPlatStubsPtr->tkMacOSXDispatchMenuEvent) /* 10 */ -#define TkpSetCapture \ - (tkIntPlatStubsPtr->tkpSetCapture) /* 11 */ +/* Slot 11 is reserved */ #define TkMacOSXHandleTearoffMenu \ (tkIntPlatStubsPtr->tkMacOSXHandleTearoffMenu) /* 12 */ /* Slot 13 is reserved */ #define TkMacOSXDoHLEvent \ (tkIntPlatStubsPtr->tkMacOSXDoHLEvent) /* 14 */ @@ -614,11 +639,12 @@ (tkIntPlatStubsPtr->tkMacOSXHandleMenuSelect) /* 18 */ /* Slot 19 is reserved */ /* Slot 20 is reserved */ #define TkMacOSXInvalidateWindow \ (tkIntPlatStubsPtr->tkMacOSXInvalidateWindow) /* 21 */ -/* Slot 22 is reserved */ +#define TkMacOSXIsCharacterMissing \ + (tkIntPlatStubsPtr->tkMacOSXIsCharacterMissing) /* 22 */ #define TkMacOSXMakeRealWindowExist \ (tkIntPlatStubsPtr->tkMacOSXMakeRealWindowExist) /* 23 */ #define TkMacOSXMakeStippleMap \ (tkIntPlatStubsPtr->tkMacOSXMakeStippleMap) /* 24 */ #define TkMacOSXMenuClick \ @@ -628,11 +654,12 @@ (tkIntPlatStubsPtr->tkMacOSXResizable) /* 27 */ #define TkMacOSXSetHelpMenuItemCount \ (tkIntPlatStubsPtr->tkMacOSXSetHelpMenuItemCount) /* 28 */ #define TkMacOSXSetScrollbarGrow \ (tkIntPlatStubsPtr->tkMacOSXSetScrollbarGrow) /* 29 */ -/* Slot 30 is reserved */ +#define TkMacOSXSetUpClippingRgn \ + (tkIntPlatStubsPtr->tkMacOSXSetUpClippingRgn) /* 30 */ #define TkMacOSXSetUpGraphicsPort \ (tkIntPlatStubsPtr->tkMacOSXSetUpGraphicsPort) /* 31 */ #define TkMacOSXUpdateClipRgn \ (tkIntPlatStubsPtr->tkMacOSXUpdateClipRgn) /* 32 */ /* Slot 33 is reserved */ @@ -668,30 +695,46 @@ (tkIntPlatStubsPtr->tkMacOSXGetContainer) /* 49 */ #define TkGenerateButtonEvent \ (tkIntPlatStubsPtr->tkGenerateButtonEvent) /* 50 */ #define TkGenWMDestroyEvent \ (tkIntPlatStubsPtr->tkGenWMDestroyEvent) /* 51 */ +#define TkMacOSXSetDrawingEnabled \ + (tkIntPlatStubsPtr->tkMacOSXSetDrawingEnabled) /* 52 */ +#define TkpGetMS \ + (tkIntPlatStubsPtr->tkpGetMS) /* 53 */ +#define TkMacOSXDrawable \ + (tkIntPlatStubsPtr->tkMacOSXDrawable) /* 54 */ +#define TkpScanWindowId \ + (tkIntPlatStubsPtr->tkpScanWindowId) /* 55 */ #endif /* AQUA */ #if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ #define TkCreateXEventSource \ (tkIntPlatStubsPtr->tkCreateXEventSource) /* 0 */ /* Slot 1 is reserved */ #define TkGenerateActivateEvents \ (tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 2 */ -/* Slot 3 is reserved */ -/* Slot 4 is reserved */ -/* Slot 5 is reserved */ +#define TkpCmapStressed \ + (tkIntPlatStubsPtr->tkpCmapStressed) /* 3 */ +#define TkpSync \ + (tkIntPlatStubsPtr->tkpSync) /* 4 */ +#define TkUnixContainerId \ + (tkIntPlatStubsPtr->tkUnixContainerId) /* 5 */ +#define TkUnixDoOneXEvent \ + (tkIntPlatStubsPtr->tkUnixDoOneXEvent) /* 6 */ +#define TkUnixSetMenubar \ + (tkIntPlatStubsPtr->tkUnixSetMenubar) /* 7 */ #define TkpScanWindowId \ - (tkIntPlatStubsPtr->tkpScanWindowId) /* 6 */ -/* Slot 7 is reserved */ -/* Slot 8 is reserved */ -#define TkpWmSetState \ - (tkIntPlatStubsPtr->tkpWmSetState) /* 9 */ -/* Slot 10 is reserved */ + (tkIntPlatStubsPtr->tkpScanWindowId) /* 8 */ +#define TkWmCleanup \ + (tkIntPlatStubsPtr->tkWmCleanup) /* 9 */ +#define TkSendCleanup \ + (tkIntPlatStubsPtr->tkSendCleanup) /* 10 */ /* Slot 11 is reserved */ -/* Slot 12 is reserved */ -/* Slot 13 is reserved */ +#define TkpWmSetState \ + (tkIntPlatStubsPtr->tkpWmSetState) /* 12 */ +#define TkpTestsendCmd_ \ + (tkIntPlatStubsPtr->tkpTestsendCmd_) /* 13 */ /* Slot 14 is reserved */ /* Slot 15 is reserved */ /* Slot 16 is reserved */ /* Slot 17 is reserved */ /* Slot 18 is reserved */ @@ -712,35 +755,47 @@ /* Slot 33 is reserved */ /* Slot 34 is reserved */ /* Slot 35 is reserved */ /* Slot 36 is reserved */ /* Slot 37 is reserved */ -#define TkpCmapStressed \ - (tkIntPlatStubsPtr->tkpCmapStressed) /* 38 */ -#define TkpSync \ - (tkIntPlatStubsPtr->tkpSync) /* 39 */ -#define TkUnixContainerId \ - (tkIntPlatStubsPtr->tkUnixContainerId) /* 40 */ -#define TkUnixDoOneXEvent \ - (tkIntPlatStubsPtr->tkUnixDoOneXEvent) /* 41 */ -#define TkUnixSetMenubar \ - (tkIntPlatStubsPtr->tkUnixSetMenubar) /* 42 */ -#define TkWmCleanup \ - (tkIntPlatStubsPtr->tkWmCleanup) /* 43 */ -#define TkSendCleanup \ - (tkIntPlatStubsPtr->tkSendCleanup) /* 44 */ +#define TkpCmapStressed_ \ + (tkIntPlatStubsPtr->tkpCmapStressed_) /* 38 */ +#define TkpSync_ \ + (tkIntPlatStubsPtr->tkpSync_) /* 39 */ +#define TkUnixContainerId_ \ + (tkIntPlatStubsPtr->tkUnixContainerId_) /* 40 */ +#define TkUnixDoOneXEvent_ \ + (tkIntPlatStubsPtr->tkUnixDoOneXEvent_) /* 41 */ +#define TkUnixSetMenubar_ \ + (tkIntPlatStubsPtr->tkUnixSetMenubar_) /* 42 */ +#define TkWmCleanup_ \ + (tkIntPlatStubsPtr->tkWmCleanup_) /* 43 */ +#define TkSendCleanup_ \ + (tkIntPlatStubsPtr->tkSendCleanup_) /* 44 */ #define TkpTestsendCmd \ (tkIntPlatStubsPtr->tkpTestsendCmd) /* 45 */ #endif /* X11 */ #endif /* defined(USE_TK_STUBS) */ /* !END!: Do not edit above this line. */ -#ifndef TK_NO_DEPRECATED -# define TkMacOSXDrawable Tk_MacOSXGetNSWindowForDrawable -#endif +#undef TkpCmapStressed_ +#undef TkpSync_ +#undef TkUnixContainerId_ +#undef TkUnixDoOneXEvent_ +#undef TkUnixSetMenubar_ +#undef TkWmCleanup_ +#undef TkSendCleanup_ +#undef TkpTestsendCmd_ +#undef TkGenerateActivateEvents_ +#undef TkMacOSXSetUpClippingRgn +#undef TkMacOSXIsCharacterMissing +#define TkMacOSXIsCharacterMissing(tkfont) ((void)tkfont, 0) #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT +#undef TkWinGetPlatformId +#define TkWinGetPlatformId() (2) /* VER_PLATFORM_WIN32_NT */ + #endif /* _TKINTPLATDECLS */ Index: generic/tkIntXlibDecls.h ================================================================== --- generic/tkIntXlibDecls.h +++ generic/tkIntXlibDecls.h @@ -496,287 +496,288 @@ EXTERN char * XKeysymToString(KeySym k); /* 6 */ EXTERN Colormap XCreateColormap(Display *d, Window w, Visual *v, int i); /* 7 */ -EXTERN Cursor XCreatePixmapCursor(Display *d, Pixmap p1, Pixmap p2, - XColor *x1, XColor *x2, unsigned int ui1, - unsigned int ui2); +EXTERN GContext XGContextFromGC(GC g); /* 8 */ -EXTERN Cursor XCreateGlyphCursor(Display *d, Font f1, Font f2, - unsigned int ui1, unsigned int ui2, - XColor _Xconst *x1, XColor _Xconst *x2); +EXTERN KeySym XKeycodeToKeysym(Display *d, unsigned int k, int i); /* 9 */ -EXTERN GContext XGContextFromGC(GC g); +EXTERN KeySym XStringToKeysym(_Xconst char *c); /* 10 */ -EXTERN XHostAddress * XListHosts(Display *d, int *i, Bool *b); +EXTERN Window XRootWindow(Display *d, int i); /* 11 */ -EXTERN KeySym XKeycodeToKeysym(Display *d, unsigned int k, int i); +EXTERN XErrorHandler XSetErrorHandler(XErrorHandler x); /* 12 */ -EXTERN KeySym XStringToKeysym(_Xconst char *c); +EXTERN Status XAllocColor(Display *d, Colormap c, XColor *xp); /* 13 */ -EXTERN Window XRootWindow(Display *d, int i); -/* 14 */ -EXTERN XErrorHandler XSetErrorHandler(XErrorHandler x); -/* 15 */ -EXTERN Status XIconifyWindow(Display *d, Window w, int i); -/* 16 */ -EXTERN Status XWithdrawWindow(Display *d, Window w, int i); -/* 17 */ -EXTERN Status XGetWMColormapWindows(Display *d, Window w, - Window **wpp, int *ip); -/* 18 */ -EXTERN Status XAllocColor(Display *d, Colormap c, XColor *xp); -/* 19 */ EXTERN int XBell(Display *d, int i); -/* 20 */ +/* 14 */ EXTERN int XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3); -/* 21 */ +/* 15 */ EXTERN int XChangeWindowAttributes(Display *d, Window w, unsigned long ul, XSetWindowAttributes *x); -/* 22 */ -EXTERN int XClearWindow(Display *d, Window w); -/* 23 */ +/* 16 */ EXTERN int XConfigureWindow(Display *d, Window w, unsigned int i, XWindowChanges *x); -/* 24 */ +/* 17 */ EXTERN int XCopyArea(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); -/* 25 */ +/* 18 */ EXTERN int XCopyPlane(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul); -/* 26 */ +/* 19 */ EXTERN Pixmap XCreateBitmapFromData(Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height); -/* 27 */ +/* 20 */ EXTERN int XDefineCursor(Display *d, Window w, Cursor c); -/* 28 */ -EXTERN int XDeleteProperty(Display *d, Window w, Atom a); -/* 29 */ +/* 21 */ EXTERN int XDestroyWindow(Display *d, Window w); -/* 30 */ +/* 22 */ EXTERN int XDrawArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); -/* 31 */ +/* 23 */ EXTERN int XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); -/* 32 */ +/* 24 */ EXTERN int XDrawRectangle(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2); -/* 33 */ +/* 25 */ EXTERN int XFillArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); -/* 34 */ +/* 26 */ EXTERN int XFillPolygon(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3); -/* 35 */ +/* 27 */ EXTERN int XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i); -/* 36 */ -EXTERN int XForceScreenSaver(Display *d, int i); -/* 37 */ +/* 28 */ EXTERN int XFreeColormap(Display *d, Colormap c); -/* 38 */ +/* 29 */ EXTERN int XFreeColors(Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); -/* 39 */ -EXTERN int XFreeCursor(Display *d, Cursor c); -/* 40 */ +/* 30 */ EXTERN int XFreeModifiermap(XModifierKeymap *x); -/* 41 */ +/* 31 */ EXTERN Status XGetGeometry(Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4); -/* 42 */ -EXTERN int XGetInputFocus(Display *d, Window *w, int *i); -/* 43 */ +/* 32 */ EXTERN int XGetWindowProperty(Display *d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1, unsigned long *ulp2, unsigned char **cpp); -/* 44 */ -EXTERN Status XGetWindowAttributes(Display *d, Window w, - XWindowAttributes *x); -/* 45 */ +/* 33 */ EXTERN int XGrabKeyboard(Display *d, Window w, Bool b, int i1, int i2, Time t); -/* 46 */ +/* 34 */ EXTERN int XGrabPointer(Display *d, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t); -/* 47 */ +/* 35 */ EXTERN KeyCode XKeysymToKeycode(Display *d, KeySym k); -/* 48 */ -EXTERN Status XLookupColor(Display *d, Colormap c1, - _Xconst char *c2, XColor *x1, XColor *x2); -/* 49 */ +/* 36 */ EXTERN int XMapWindow(Display *d, Window w); -/* 50 */ +/* 37 */ EXTERN int XMoveResizeWindow(Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2); -/* 51 */ +/* 38 */ EXTERN int XMoveWindow(Display *d, Window w, int i1, int i2); -/* 52 */ -EXTERN int XNextEvent(Display *d, XEvent *x); -/* 53 */ -EXTERN int XPutBackEvent(Display *d, XEvent *x); -/* 54 */ -EXTERN int XQueryColors(Display *d, Colormap c, XColor *x, - int i); -/* 55 */ +/* 39 */ EXTERN Bool XQueryPointer(Display *d, Window w1, Window *w2, Window *w3, int *i1, int *i2, int *i3, int *i4, unsigned int *ui); -/* 56 */ -EXTERN Status XQueryTree(Display *d, Window w1, Window *w2, - Window *w3, Window **w4, unsigned int *ui); -/* 57 */ +/* 40 */ EXTERN int XRaiseWindow(Display *d, Window w); -/* 58 */ +/* 41 */ EXTERN int XRefreshKeyboardMapping(XMappingEvent *x); -/* 59 */ +/* 42 */ EXTERN int XResizeWindow(Display *d, Window w, unsigned int ui1, unsigned int ui2); -/* 60 */ +/* 43 */ EXTERN int XSelectInput(Display *d, Window w, long l); -/* 61 */ +/* 44 */ EXTERN Status XSendEvent(Display *d, Window w, Bool b, long l, XEvent *x); -/* 62 */ -EXTERN int XSetCommand(Display *d, Window w, char **c, int i); -/* 63 */ +/* 45 */ EXTERN int XSetIconName(Display *d, Window w, _Xconst char *c); -/* 64 */ +/* 46 */ EXTERN int XSetInputFocus(Display *d, Window w, int i, Time t); -/* 65 */ +/* 47 */ EXTERN int XSetSelectionOwner(Display *d, Atom a, Window w, Time t); -/* 66 */ +/* 48 */ EXTERN int XSetWindowBackground(Display *d, Window w, unsigned long ul); -/* 67 */ +/* 49 */ EXTERN int XSetWindowBackgroundPixmap(Display *d, Window w, Pixmap p); -/* 68 */ +/* 50 */ EXTERN int XSetWindowBorder(Display *d, Window w, unsigned long ul); -/* 69 */ +/* 51 */ EXTERN int XSetWindowBorderPixmap(Display *d, Window w, Pixmap p); -/* 70 */ +/* 52 */ EXTERN int XSetWindowBorderWidth(Display *d, Window w, unsigned int ui); -/* 71 */ +/* 53 */ EXTERN int XSetWindowColormap(Display *d, Window w, Colormap c); -/* 72 */ -EXTERN Bool XTranslateCoordinates(Display *d, Window w1, - Window w2, int i1, int i2, int *i3, int *i4, - Window *w3); -/* 73 */ +/* 54 */ EXTERN int XUngrabKeyboard(Display *d, Time t); -/* 74 */ +/* 55 */ EXTERN int XUngrabPointer(Display *d, Time t); -/* 75 */ +/* 56 */ EXTERN int XUnmapWindow(Display *d, Window w); -/* 76 */ -EXTERN int XWindowEvent(Display *d, Window w, long l, XEvent *x); -/* 77 */ -EXTERN void XDestroyIC(XIC x); -/* 78 */ -EXTERN Bool XFilterEvent(XEvent *x, Window w); -/* 79 */ -EXTERN int XmbLookupString(XIC xi, XKeyPressedEvent *xk, - char *c, int i, KeySym *k, Status *s); -/* 80 */ +/* 57 */ EXTERN int TkPutImage(unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height); -/* 81 */ -EXTERN int XSetClipRectangles(Display *display, GC gc, - int clip_x_origin, int clip_y_origin, - XRectangle rectangles[], int n, int ordering); -/* 82 */ +/* 58 */ EXTERN Status XParseColor(Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr); -/* 83 */ +/* 59 */ EXTERN GC XCreateGC(Display *display, Drawable d, unsigned long valuemask, XGCValues *values); -/* 84 */ +/* 60 */ EXTERN int XFreeGC(Display *display, GC gc); -/* 85 */ +/* 61 */ EXTERN Atom XInternAtom(Display *display, _Xconst char *atom_name, Bool only_if_exists); -/* 86 */ +/* 62 */ EXTERN int XSetBackground(Display *display, GC gc, unsigned long foreground); -/* 87 */ +/* 63 */ EXTERN int XSetForeground(Display *display, GC gc, unsigned long foreground); -/* 88 */ +/* 64 */ EXTERN int XSetClipMask(Display *display, GC gc, Pixmap pixmap); -/* 89 */ +/* 65 */ EXTERN int XSetClipOrigin(Display *display, GC gc, int clip_x_origin, int clip_y_origin); -/* 90 */ +/* 66 */ EXTERN int XSetTSOrigin(Display *display, GC gc, int ts_x_origin, int ts_y_origin); -/* 91 */ +/* 67 */ EXTERN int XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values); -/* 92 */ +/* 68 */ EXTERN int XSetFont(Display *display, GC gc, Font font); -/* 93 */ +/* 69 */ EXTERN int XSetArcMode(Display *display, GC gc, int arc_mode); -/* 94 */ +/* 70 */ EXTERN int XSetStipple(Display *display, GC gc, Pixmap stipple); -/* 95 */ +/* 71 */ EXTERN int XSetFillRule(Display *display, GC gc, int fill_rule); -/* 96 */ +/* 72 */ EXTERN int XSetFillStyle(Display *display, GC gc, int fill_style); -/* 97 */ +/* 73 */ EXTERN int XSetFunction(Display *display, GC gc, int function); -/* 98 */ +/* 74 */ EXTERN int XSetLineAttributes(Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); -/* 99 */ +/* 75 */ EXTERN int _XInitImageFuncPtrs(XImage *image); -/* 100 */ +/* 76 */ EXTERN XIC XCreateIC(XIM xim, ...); -/* 101 */ +/* 77 */ EXTERN XVisualInfo * XGetVisualInfo(Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return); -/* 102 */ +/* 78 */ EXTERN void XSetWMClientMachine(Display *display, Window w, XTextProperty *text_prop); -/* 103 */ +/* 79 */ EXTERN Status XStringListToTextProperty(char **list, int count, XTextProperty *text_prop_return); -/* 104 */ +/* 80 */ +EXTERN int XDrawSegments(Display *display, Drawable d, GC gc, + XSegment *segments, int nsegments); +/* 81 */ +EXTERN int XForceScreenSaver(Display *display, int mode); +/* 82 */ EXTERN int XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); -/* 105 */ -EXTERN int XWarpPointer(Display *d, Window s, Window dw, int sx, - int sy, unsigned int sw, unsigned int sh, - int dx, int dy); -/* 106 */ +/* 83 */ EXTERN int XFillRectangle(Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); +/* 84 */ +EXTERN int XClearWindow(Display *d, Window w); +/* 85 */ +EXTERN int XDrawPoint(Display *display, Drawable d, GC gc, + int x, int y); +/* 86 */ +EXTERN int XDrawPoints(Display *display, Drawable d, GC gc, + XPoint *points, int npoints, int mode); +/* 87 */ +EXTERN int XWarpPointer(Display *display, Window src_w, + Window dest_w, int src_x, int src_y, + unsigned int src_width, + unsigned int src_height, int dest_x, + int dest_y); +/* 88 */ +EXTERN int XQueryColor(Display *display, Colormap colormap, + XColor *def_in_out); +/* 89 */ +EXTERN int XQueryColors(Display *display, Colormap colormap, + XColor *defs_in_out, int ncolors); +/* 90 */ +EXTERN Status XQueryTree(Display *d, Window w1, Window *w2, + Window *w3, Window **w4, unsigned int *ui); +/* 91 */ +EXTERN int XSync(Display *display, Bool discard); +/* 92 */ +EXTERN Bool XTranslateCoordinates(Display *d, Window w1, + Window w2, int i1, int i2, int *i3, int *i4, + Window *w3); +/* 93 */ +EXTERN int XDeleteProperty(Display *d, Window w, Atom a); +/* 94 */ +EXTERN int XFreeCursor(Display *d, Cursor c); +/* 95 */ +EXTERN int XGetInputFocus(Display *d, Window *w, int *i); +/* 96 */ +EXTERN int XmbLookupString(XIC xi, XKeyPressedEvent *xk, + char *c, int i, KeySym *k, Status *s); +/* 97 */ +EXTERN int XNextEvent(Display *d, XEvent *x); +/* 98 */ +EXTERN int XPutBackEvent(Display *d, XEvent *x); +/* 99 */ +EXTERN int XSetCommand(Display *d, Window w, char **c, int i); +/* 100 */ +EXTERN int XWindowEvent(Display *d, Window w, long l, XEvent *x); +/* 101 */ +EXTERN Status XGetWindowAttributes(Display *d, Window w, + XWindowAttributes *x); +/* 102 */ +EXTERN Status XGetWMColormapWindows(Display *d, Window w, + Window **wpp, int *ip); +/* 103 */ +EXTERN Status XIconifyWindow(Display *d, Window w, int i); +/* 104 */ +EXTERN Status XWithdrawWindow(Display *d, Window w, int i); +/* 105 */ +EXTERN XHostAddress * XListHosts(Display *d, int *i, Bool *b); +/* 106 */ +EXTERN int XSetClipRectangles(Display *display, GC gc, + int clip_x_origin, int clip_y_origin, + XRectangle rectangles[], int n, int ordering); /* 107 */ EXTERN int XFlush(Display *display); /* 108 */ EXTERN int XGrabServer(Display *display); /* 109 */ @@ -786,11 +787,12 @@ /* 111 */ EXTERN int XNoOp(Display *display); /* 112 */ EXTERN XAfterFunction XSynchronize(Display *display, Bool onoff); /* 113 */ -EXTERN int XSync(Display *display, Bool discard); +EXTERN Status XLookupColor(Display *d, Colormap c1, + _Xconst char *c2, XColor *x1, XColor *x2); /* 114 */ EXTERN VisualID XVisualIDFromVisual(Visual *visual); /* Slot 115 is reserved */ /* Slot 116 is reserved */ /* Slot 117 is reserved */ @@ -824,19 +826,13 @@ EXTERN int XDrawArcs(Display *d, Drawable dr, GC gc, XArc *a, int n); /* 132 */ EXTERN int XDrawRectangles(Display *d, Drawable dr, GC gc, XRectangle *r, int n); -/* 133 */ -EXTERN int XDrawSegments(Display *d, Drawable dr, GC gc, - XSegment *s, int n); -/* 134 */ -EXTERN int XDrawPoint(Display *d, Drawable dr, GC gc, int x, - int y); -/* 135 */ -EXTERN int XDrawPoints(Display *d, Drawable dr, GC gc, - XPoint *p, int n, int m); +/* Slot 133 is reserved */ +/* Slot 134 is reserved */ +/* Slot 135 is reserved */ /* 136 */ EXTERN int XReparentWindow(Display *d, Window w, Window p, int x, int y); /* 137 */ EXTERN int XPutImage(Display *d, Drawable dr, GC gc, XImage *im, @@ -852,13 +848,20 @@ EXTERN char * XSetICValues(XIC xic, ...); /* 142 */ EXTERN char * XGetICValues(XIC xic, ...); /* 143 */ EXTERN void XSetICFocus(XIC xic); -/* Slot 144 is reserved */ -/* Slot 145 is reserved */ -/* Slot 146 is reserved */ +/* 144 */ +EXTERN void XDestroyIC(XIC xic); +/* 145 */ +EXTERN Cursor XCreatePixmapCursor(Display *d, Pixmap p1, Pixmap p2, + XColor *x1, XColor *x2, unsigned int ui1, + unsigned int ui2); +/* 146 */ +EXTERN Cursor XCreateGlyphCursor(Display *d, Font f1, Font f2, + unsigned int ui1, unsigned int ui2, + XColor _Xconst *x1, XColor _Xconst *x2); /* 147 */ EXTERN void XFreeFontSet(Display *display, XFontSet fontset); /* 148 */ EXTERN int XCloseIM(XIM im); /* 149 */ @@ -1068,117 +1071,117 @@ XImage * (*xCreateImage) (Display *d, Visual *v, unsigned int ui1, int i1, int i2, char *cp, unsigned int ui2, unsigned int ui3, int i3, int i4); /* 2 */ XImage * (*xGetImage) (Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3); /* 3 */ char * (*xGetAtomName) (Display *d, Atom a); /* 4 */ char * (*xKeysymToString) (KeySym k); /* 5 */ Colormap (*xCreateColormap) (Display *d, Window w, Visual *v, int i); /* 6 */ - Cursor (*xCreatePixmapCursor) (Display *d, Pixmap p1, Pixmap p2, XColor *x1, XColor *x2, unsigned int ui1, unsigned int ui2); /* 7 */ - Cursor (*xCreateGlyphCursor) (Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor _Xconst *x1, XColor _Xconst *x2); /* 8 */ - GContext (*xGContextFromGC) (GC g); /* 9 */ - XHostAddress * (*xListHosts) (Display *d, int *i, Bool *b); /* 10 */ - KeySym (*xKeycodeToKeysym) (Display *d, unsigned int k, int i); /* 11 */ - KeySym (*xStringToKeysym) (_Xconst char *c); /* 12 */ - Window (*xRootWindow) (Display *d, int i); /* 13 */ - XErrorHandler (*xSetErrorHandler) (XErrorHandler x); /* 14 */ - Status (*xIconifyWindow) (Display *d, Window w, int i); /* 15 */ - Status (*xWithdrawWindow) (Display *d, Window w, int i); /* 16 */ - Status (*xGetWMColormapWindows) (Display *d, Window w, Window **wpp, int *ip); /* 17 */ - Status (*xAllocColor) (Display *d, Colormap c, XColor *xp); /* 18 */ - int (*xBell) (Display *d, int i); /* 19 */ - int (*xChangeProperty) (Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3); /* 20 */ - int (*xChangeWindowAttributes) (Display *d, Window w, unsigned long ul, XSetWindowAttributes *x); /* 21 */ - int (*xClearWindow) (Display *d, Window w); /* 22 */ - int (*xConfigureWindow) (Display *d, Window w, unsigned int i, XWindowChanges *x); /* 23 */ - int (*xCopyArea) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 24 */ - int (*xCopyPlane) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul); /* 25 */ - Pixmap (*xCreateBitmapFromData) (Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height); /* 26 */ - int (*xDefineCursor) (Display *d, Window w, Cursor c); /* 27 */ - int (*xDeleteProperty) (Display *d, Window w, Atom a); /* 28 */ - int (*xDestroyWindow) (Display *d, Window w); /* 29 */ - int (*xDrawArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 30 */ - int (*xDrawLines) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 31 */ - int (*xDrawRectangle) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 32 */ - int (*xFillArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 33 */ - int (*xFillPolygon) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3); /* 34 */ - int (*xFillRectangles) (Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 35 */ - int (*xForceScreenSaver) (Display *d, int i); /* 36 */ - int (*xFreeColormap) (Display *d, Colormap c); /* 37 */ - int (*xFreeColors) (Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 38 */ - int (*xFreeCursor) (Display *d, Cursor c); /* 39 */ - int (*xFreeModifiermap) (XModifierKeymap *x); /* 40 */ - Status (*xGetGeometry) (Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4); /* 41 */ - int (*xGetInputFocus) (Display *d, Window *w, int *i); /* 42 */ - int (*xGetWindowProperty) (Display *d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1, unsigned long *ulp2, unsigned char **cpp); /* 43 */ - Status (*xGetWindowAttributes) (Display *d, Window w, XWindowAttributes *x); /* 44 */ - int (*xGrabKeyboard) (Display *d, Window w, Bool b, int i1, int i2, Time t); /* 45 */ - int (*xGrabPointer) (Display *d, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t); /* 46 */ - KeyCode (*xKeysymToKeycode) (Display *d, KeySym k); /* 47 */ - Status (*xLookupColor) (Display *d, Colormap c1, _Xconst char *c2, XColor *x1, XColor *x2); /* 48 */ - int (*xMapWindow) (Display *d, Window w); /* 49 */ - int (*xMoveResizeWindow) (Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 50 */ - int (*xMoveWindow) (Display *d, Window w, int i1, int i2); /* 51 */ - int (*xNextEvent) (Display *d, XEvent *x); /* 52 */ - int (*xPutBackEvent) (Display *d, XEvent *x); /* 53 */ - int (*xQueryColors) (Display *d, Colormap c, XColor *x, int i); /* 54 */ - Bool (*xQueryPointer) (Display *d, Window w1, Window *w2, Window *w3, int *i1, int *i2, int *i3, int *i4, unsigned int *ui); /* 55 */ - Status (*xQueryTree) (Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui); /* 56 */ - int (*xRaiseWindow) (Display *d, Window w); /* 57 */ - int (*xRefreshKeyboardMapping) (XMappingEvent *x); /* 58 */ - int (*xResizeWindow) (Display *d, Window w, unsigned int ui1, unsigned int ui2); /* 59 */ - int (*xSelectInput) (Display *d, Window w, long l); /* 60 */ - Status (*xSendEvent) (Display *d, Window w, Bool b, long l, XEvent *x); /* 61 */ - int (*xSetCommand) (Display *d, Window w, char **c, int i); /* 62 */ - int (*xSetIconName) (Display *d, Window w, _Xconst char *c); /* 63 */ - int (*xSetInputFocus) (Display *d, Window w, int i, Time t); /* 64 */ - int (*xSetSelectionOwner) (Display *d, Atom a, Window w, Time t); /* 65 */ - int (*xSetWindowBackground) (Display *d, Window w, unsigned long ul); /* 66 */ - int (*xSetWindowBackgroundPixmap) (Display *d, Window w, Pixmap p); /* 67 */ - int (*xSetWindowBorder) (Display *d, Window w, unsigned long ul); /* 68 */ - int (*xSetWindowBorderPixmap) (Display *d, Window w, Pixmap p); /* 69 */ - int (*xSetWindowBorderWidth) (Display *d, Window w, unsigned int ui); /* 70 */ - int (*xSetWindowColormap) (Display *d, Window w, Colormap c); /* 71 */ - Bool (*xTranslateCoordinates) (Display *d, Window w1, Window w2, int i1, int i2, int *i3, int *i4, Window *w3); /* 72 */ - int (*xUngrabKeyboard) (Display *d, Time t); /* 73 */ - int (*xUngrabPointer) (Display *d, Time t); /* 74 */ - int (*xUnmapWindow) (Display *d, Window w); /* 75 */ - int (*xWindowEvent) (Display *d, Window w, long l, XEvent *x); /* 76 */ - void (*xDestroyIC) (XIC x); /* 77 */ - Bool (*xFilterEvent) (XEvent *x, Window w); /* 78 */ - int (*xmbLookupString) (XIC xi, XKeyPressedEvent *xk, char *c, int i, KeySym *k, Status *s); /* 79 */ - int (*tkPutImage) (unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height); /* 80 */ - int (*xSetClipRectangles) (Display *display, GC gc, int clip_x_origin, int clip_y_origin, XRectangle rectangles[], int n, int ordering); /* 81 */ - Status (*xParseColor) (Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr); /* 82 */ - GC (*xCreateGC) (Display *display, Drawable d, unsigned long valuemask, XGCValues *values); /* 83 */ - int (*xFreeGC) (Display *display, GC gc); /* 84 */ - Atom (*xInternAtom) (Display *display, _Xconst char *atom_name, Bool only_if_exists); /* 85 */ - int (*xSetBackground) (Display *display, GC gc, unsigned long foreground); /* 86 */ - int (*xSetForeground) (Display *display, GC gc, unsigned long foreground); /* 87 */ - int (*xSetClipMask) (Display *display, GC gc, Pixmap pixmap); /* 88 */ - int (*xSetClipOrigin) (Display *display, GC gc, int clip_x_origin, int clip_y_origin); /* 89 */ - int (*xSetTSOrigin) (Display *display, GC gc, int ts_x_origin, int ts_y_origin); /* 90 */ - int (*xChangeGC) (Display *d, GC gc, unsigned long mask, XGCValues *values); /* 91 */ - int (*xSetFont) (Display *display, GC gc, Font font); /* 92 */ - int (*xSetArcMode) (Display *display, GC gc, int arc_mode); /* 93 */ - int (*xSetStipple) (Display *display, GC gc, Pixmap stipple); /* 94 */ - int (*xSetFillRule) (Display *display, GC gc, int fill_rule); /* 95 */ - int (*xSetFillStyle) (Display *display, GC gc, int fill_style); /* 96 */ - int (*xSetFunction) (Display *display, GC gc, int function); /* 97 */ - int (*xSetLineAttributes) (Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); /* 98 */ - int (*_XInitImageFuncPtrs) (XImage *image); /* 99 */ - XIC (*xCreateIC) (XIM xim, ...); /* 100 */ - XVisualInfo * (*xGetVisualInfo) (Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return); /* 101 */ - void (*xSetWMClientMachine) (Display *display, Window w, XTextProperty *text_prop); /* 102 */ - Status (*xStringListToTextProperty) (char **list, int count, XTextProperty *text_prop_return); /* 103 */ - int (*xDrawLine) (Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 104 */ - int (*xWarpPointer) (Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy); /* 105 */ - int (*xFillRectangle) (Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 106 */ + GContext (*xGContextFromGC) (GC g); /* 7 */ + KeySym (*xKeycodeToKeysym) (Display *d, unsigned int k, int i); /* 8 */ + KeySym (*xStringToKeysym) (_Xconst char *c); /* 9 */ + Window (*xRootWindow) (Display *d, int i); /* 10 */ + XErrorHandler (*xSetErrorHandler) (XErrorHandler x); /* 11 */ + Status (*xAllocColor) (Display *d, Colormap c, XColor *xp); /* 12 */ + int (*xBell) (Display *d, int i); /* 13 */ + int (*xChangeProperty) (Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3); /* 14 */ + int (*xChangeWindowAttributes) (Display *d, Window w, unsigned long ul, XSetWindowAttributes *x); /* 15 */ + int (*xConfigureWindow) (Display *d, Window w, unsigned int i, XWindowChanges *x); /* 16 */ + int (*xCopyArea) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 17 */ + int (*xCopyPlane) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul); /* 18 */ + Pixmap (*xCreateBitmapFromData) (Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height); /* 19 */ + int (*xDefineCursor) (Display *d, Window w, Cursor c); /* 20 */ + int (*xDestroyWindow) (Display *d, Window w); /* 21 */ + int (*xDrawArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 22 */ + int (*xDrawLines) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 23 */ + int (*xDrawRectangle) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 24 */ + int (*xFillArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 25 */ + int (*xFillPolygon) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3); /* 26 */ + int (*xFillRectangles) (Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 27 */ + int (*xFreeColormap) (Display *d, Colormap c); /* 28 */ + int (*xFreeColors) (Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 29 */ + int (*xFreeModifiermap) (XModifierKeymap *x); /* 30 */ + Status (*xGetGeometry) (Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4); /* 31 */ + int (*xGetWindowProperty) (Display *d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1, unsigned long *ulp2, unsigned char **cpp); /* 32 */ + int (*xGrabKeyboard) (Display *d, Window w, Bool b, int i1, int i2, Time t); /* 33 */ + int (*xGrabPointer) (Display *d, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t); /* 34 */ + KeyCode (*xKeysymToKeycode) (Display *d, KeySym k); /* 35 */ + int (*xMapWindow) (Display *d, Window w); /* 36 */ + int (*xMoveResizeWindow) (Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 37 */ + int (*xMoveWindow) (Display *d, Window w, int i1, int i2); /* 38 */ + Bool (*xQueryPointer) (Display *d, Window w1, Window *w2, Window *w3, int *i1, int *i2, int *i3, int *i4, unsigned int *ui); /* 39 */ + int (*xRaiseWindow) (Display *d, Window w); /* 40 */ + int (*xRefreshKeyboardMapping) (XMappingEvent *x); /* 41 */ + int (*xResizeWindow) (Display *d, Window w, unsigned int ui1, unsigned int ui2); /* 42 */ + int (*xSelectInput) (Display *d, Window w, long l); /* 43 */ + Status (*xSendEvent) (Display *d, Window w, Bool b, long l, XEvent *x); /* 44 */ + int (*xSetIconName) (Display *d, Window w, _Xconst char *c); /* 45 */ + int (*xSetInputFocus) (Display *d, Window w, int i, Time t); /* 46 */ + int (*xSetSelectionOwner) (Display *d, Atom a, Window w, Time t); /* 47 */ + int (*xSetWindowBackground) (Display *d, Window w, unsigned long ul); /* 48 */ + int (*xSetWindowBackgroundPixmap) (Display *d, Window w, Pixmap p); /* 49 */ + int (*xSetWindowBorder) (Display *d, Window w, unsigned long ul); /* 50 */ + int (*xSetWindowBorderPixmap) (Display *d, Window w, Pixmap p); /* 51 */ + int (*xSetWindowBorderWidth) (Display *d, Window w, unsigned int ui); /* 52 */ + int (*xSetWindowColormap) (Display *d, Window w, Colormap c); /* 53 */ + int (*xUngrabKeyboard) (Display *d, Time t); /* 54 */ + int (*xUngrabPointer) (Display *d, Time t); /* 55 */ + int (*xUnmapWindow) (Display *d, Window w); /* 56 */ + int (*tkPutImage) (unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height); /* 57 */ + Status (*xParseColor) (Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr); /* 58 */ + GC (*xCreateGC) (Display *display, Drawable d, unsigned long valuemask, XGCValues *values); /* 59 */ + int (*xFreeGC) (Display *display, GC gc); /* 60 */ + Atom (*xInternAtom) (Display *display, _Xconst char *atom_name, Bool only_if_exists); /* 61 */ + int (*xSetBackground) (Display *display, GC gc, unsigned long foreground); /* 62 */ + int (*xSetForeground) (Display *display, GC gc, unsigned long foreground); /* 63 */ + int (*xSetClipMask) (Display *display, GC gc, Pixmap pixmap); /* 64 */ + int (*xSetClipOrigin) (Display *display, GC gc, int clip_x_origin, int clip_y_origin); /* 65 */ + int (*xSetTSOrigin) (Display *display, GC gc, int ts_x_origin, int ts_y_origin); /* 66 */ + int (*xChangeGC) (Display *d, GC gc, unsigned long mask, XGCValues *values); /* 67 */ + int (*xSetFont) (Display *display, GC gc, Font font); /* 68 */ + int (*xSetArcMode) (Display *display, GC gc, int arc_mode); /* 69 */ + int (*xSetStipple) (Display *display, GC gc, Pixmap stipple); /* 70 */ + int (*xSetFillRule) (Display *display, GC gc, int fill_rule); /* 71 */ + int (*xSetFillStyle) (Display *display, GC gc, int fill_style); /* 72 */ + int (*xSetFunction) (Display *display, GC gc, int function); /* 73 */ + int (*xSetLineAttributes) (Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); /* 74 */ + int (*_XInitImageFuncPtrs) (XImage *image); /* 75 */ + XIC (*xCreateIC) (XIM xim, ...); /* 76 */ + XVisualInfo * (*xGetVisualInfo) (Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return); /* 77 */ + void (*xSetWMClientMachine) (Display *display, Window w, XTextProperty *text_prop); /* 78 */ + Status (*xStringListToTextProperty) (char **list, int count, XTextProperty *text_prop_return); /* 79 */ + int (*xDrawSegments) (Display *display, Drawable d, GC gc, XSegment *segments, int nsegments); /* 80 */ + int (*xForceScreenSaver) (Display *display, int mode); /* 81 */ + int (*xDrawLine) (Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 82 */ + int (*xFillRectangle) (Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 83 */ + int (*xClearWindow) (Display *d, Window w); /* 84 */ + int (*xDrawPoint) (Display *display, Drawable d, GC gc, int x, int y); /* 85 */ + int (*xDrawPoints) (Display *display, Drawable d, GC gc, XPoint *points, int npoints, int mode); /* 86 */ + int (*xWarpPointer) (Display *display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y); /* 87 */ + int (*xQueryColor) (Display *display, Colormap colormap, XColor *def_in_out); /* 88 */ + int (*xQueryColors) (Display *display, Colormap colormap, XColor *defs_in_out, int ncolors); /* 89 */ + Status (*xQueryTree) (Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui); /* 90 */ + int (*xSync) (Display *display, Bool discard); /* 91 */ + Bool (*xTranslateCoordinates) (Display *d, Window w1, Window w2, int i1, int i2, int *i3, int *i4, Window *w3); /* 92 */ + int (*xDeleteProperty) (Display *d, Window w, Atom a); /* 93 */ + int (*xFreeCursor) (Display *d, Cursor c); /* 94 */ + int (*xGetInputFocus) (Display *d, Window *w, int *i); /* 95 */ + int (*xmbLookupString) (XIC xi, XKeyPressedEvent *xk, char *c, int i, KeySym *k, Status *s); /* 96 */ + int (*xNextEvent) (Display *d, XEvent *x); /* 97 */ + int (*xPutBackEvent) (Display *d, XEvent *x); /* 98 */ + int (*xSetCommand) (Display *d, Window w, char **c, int i); /* 99 */ + int (*xWindowEvent) (Display *d, Window w, long l, XEvent *x); /* 100 */ + Status (*xGetWindowAttributes) (Display *d, Window w, XWindowAttributes *x); /* 101 */ + Status (*xGetWMColormapWindows) (Display *d, Window w, Window **wpp, int *ip); /* 102 */ + Status (*xIconifyWindow) (Display *d, Window w, int i); /* 103 */ + Status (*xWithdrawWindow) (Display *d, Window w, int i); /* 104 */ + XHostAddress * (*xListHosts) (Display *d, int *i, Bool *b); /* 105 */ + int (*xSetClipRectangles) (Display *display, GC gc, int clip_x_origin, int clip_y_origin, XRectangle rectangles[], int n, int ordering); /* 106 */ int (*xFlush) (Display *display); /* 107 */ int (*xGrabServer) (Display *display); /* 108 */ int (*xUngrabServer) (Display *display); /* 109 */ int (*xFree) (void *data); /* 110 */ int (*xNoOp) (Display *display); /* 111 */ XAfterFunction (*xSynchronize) (Display *display, Bool onoff); /* 112 */ - int (*xSync) (Display *display, Bool discard); /* 113 */ + Status (*xLookupColor) (Display *d, Colormap c1, _Xconst char *c2, XColor *x1, XColor *x2); /* 113 */ VisualID (*xVisualIDFromVisual) (Visual *visual); /* 114 */ void (*reserved115)(void); void (*reserved116)(void); void (*reserved117)(void); void (*reserved118)(void); @@ -1194,24 +1197,24 @@ void (*reserved128)(void); int (*xLowerWindow) (Display *d, Window w); /* 129 */ int (*xFillArcs) (Display *d, Drawable dr, GC gc, XArc *a, int n); /* 130 */ int (*xDrawArcs) (Display *d, Drawable dr, GC gc, XArc *a, int n); /* 131 */ int (*xDrawRectangles) (Display *d, Drawable dr, GC gc, XRectangle *r, int n); /* 132 */ - int (*xDrawSegments) (Display *d, Drawable dr, GC gc, XSegment *s, int n); /* 133 */ - int (*xDrawPoint) (Display *d, Drawable dr, GC gc, int x, int y); /* 134 */ - int (*xDrawPoints) (Display *d, Drawable dr, GC gc, XPoint *p, int n, int m); /* 135 */ + void (*reserved133)(void); + void (*reserved134)(void); + void (*reserved135)(void); int (*xReparentWindow) (Display *d, Window w, Window p, int x, int y); /* 136 */ int (*xPutImage) (Display *d, Drawable dr, GC gc, XImage *im, int sx, int sy, int dx, int dy, unsigned int w, unsigned int h); /* 137 */ Region (*xPolygonRegion) (XPoint *pts, int n, int rule); /* 138 */ int (*xPointInRegion) (Region rgn, int x, int y); /* 139 */ XVaNestedList (*xVaCreateNestedList) (int dummy, ...); /* 140 */ char * (*xSetICValues) (XIC xic, ...); /* 141 */ char * (*xGetICValues) (XIC xic, ...); /* 142 */ void (*xSetICFocus) (XIC xic); /* 143 */ - void (*reserved144)(void); - void (*reserved145)(void); - void (*reserved146)(void); + void (*xDestroyIC) (XIC xic); /* 144 */ + Cursor (*xCreatePixmapCursor) (Display *d, Pixmap p1, Pixmap p2, XColor *x1, XColor *x2, unsigned int ui1, unsigned int ui2); /* 145 */ + Cursor (*xCreateGlyphCursor) (Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor _Xconst *x1, XColor _Xconst *x2); /* 146 */ void (*xFreeFontSet) (Display *display, XFontSet fontset); /* 147 */ int (*xCloseIM) (XIM im); /* 148 */ Bool (*xRegisterIMInstantiateCallback) (Display *dpy, struct _XrmHashBucketRec *rbd, char *res_name, char *res_class, XIDProc callback, XPointer client_data); /* 149 */ Bool (*xUnregisterIMInstantiateCallback) (Display *dpy, struct _XrmHashBucketRec *rbd, char *res_name, char *res_class, XIDProc callback, XPointer client_data); /* 150 */ char * (*xSetLocaleModifiers) (const char *modifier_list); /* 151 */ @@ -1556,210 +1559,210 @@ (tkIntXlibStubsPtr->xGetAtomName) /* 4 */ #define XKeysymToString \ (tkIntXlibStubsPtr->xKeysymToString) /* 5 */ #define XCreateColormap \ (tkIntXlibStubsPtr->xCreateColormap) /* 6 */ -#define XCreatePixmapCursor \ - (tkIntXlibStubsPtr->xCreatePixmapCursor) /* 7 */ -#define XCreateGlyphCursor \ - (tkIntXlibStubsPtr->xCreateGlyphCursor) /* 8 */ #define XGContextFromGC \ - (tkIntXlibStubsPtr->xGContextFromGC) /* 9 */ -#define XListHosts \ - (tkIntXlibStubsPtr->xListHosts) /* 10 */ + (tkIntXlibStubsPtr->xGContextFromGC) /* 7 */ #define XKeycodeToKeysym \ - (tkIntXlibStubsPtr->xKeycodeToKeysym) /* 11 */ + (tkIntXlibStubsPtr->xKeycodeToKeysym) /* 8 */ #define XStringToKeysym \ - (tkIntXlibStubsPtr->xStringToKeysym) /* 12 */ + (tkIntXlibStubsPtr->xStringToKeysym) /* 9 */ #define XRootWindow \ - (tkIntXlibStubsPtr->xRootWindow) /* 13 */ + (tkIntXlibStubsPtr->xRootWindow) /* 10 */ #define XSetErrorHandler \ - (tkIntXlibStubsPtr->xSetErrorHandler) /* 14 */ -#define XIconifyWindow \ - (tkIntXlibStubsPtr->xIconifyWindow) /* 15 */ -#define XWithdrawWindow \ - (tkIntXlibStubsPtr->xWithdrawWindow) /* 16 */ -#define XGetWMColormapWindows \ - (tkIntXlibStubsPtr->xGetWMColormapWindows) /* 17 */ + (tkIntXlibStubsPtr->xSetErrorHandler) /* 11 */ #define XAllocColor \ - (tkIntXlibStubsPtr->xAllocColor) /* 18 */ + (tkIntXlibStubsPtr->xAllocColor) /* 12 */ #define XBell \ - (tkIntXlibStubsPtr->xBell) /* 19 */ + (tkIntXlibStubsPtr->xBell) /* 13 */ #define XChangeProperty \ - (tkIntXlibStubsPtr->xChangeProperty) /* 20 */ + (tkIntXlibStubsPtr->xChangeProperty) /* 14 */ #define XChangeWindowAttributes \ - (tkIntXlibStubsPtr->xChangeWindowAttributes) /* 21 */ -#define XClearWindow \ - (tkIntXlibStubsPtr->xClearWindow) /* 22 */ + (tkIntXlibStubsPtr->xChangeWindowAttributes) /* 15 */ #define XConfigureWindow \ - (tkIntXlibStubsPtr->xConfigureWindow) /* 23 */ + (tkIntXlibStubsPtr->xConfigureWindow) /* 16 */ #define XCopyArea \ - (tkIntXlibStubsPtr->xCopyArea) /* 24 */ + (tkIntXlibStubsPtr->xCopyArea) /* 17 */ #define XCopyPlane \ - (tkIntXlibStubsPtr->xCopyPlane) /* 25 */ + (tkIntXlibStubsPtr->xCopyPlane) /* 18 */ #define XCreateBitmapFromData \ - (tkIntXlibStubsPtr->xCreateBitmapFromData) /* 26 */ + (tkIntXlibStubsPtr->xCreateBitmapFromData) /* 19 */ #define XDefineCursor \ - (tkIntXlibStubsPtr->xDefineCursor) /* 27 */ -#define XDeleteProperty \ - (tkIntXlibStubsPtr->xDeleteProperty) /* 28 */ + (tkIntXlibStubsPtr->xDefineCursor) /* 20 */ #define XDestroyWindow \ - (tkIntXlibStubsPtr->xDestroyWindow) /* 29 */ + (tkIntXlibStubsPtr->xDestroyWindow) /* 21 */ #define XDrawArc \ - (tkIntXlibStubsPtr->xDrawArc) /* 30 */ + (tkIntXlibStubsPtr->xDrawArc) /* 22 */ #define XDrawLines \ - (tkIntXlibStubsPtr->xDrawLines) /* 31 */ + (tkIntXlibStubsPtr->xDrawLines) /* 23 */ #define XDrawRectangle \ - (tkIntXlibStubsPtr->xDrawRectangle) /* 32 */ + (tkIntXlibStubsPtr->xDrawRectangle) /* 24 */ #define XFillArc \ - (tkIntXlibStubsPtr->xFillArc) /* 33 */ + (tkIntXlibStubsPtr->xFillArc) /* 25 */ #define XFillPolygon \ - (tkIntXlibStubsPtr->xFillPolygon) /* 34 */ + (tkIntXlibStubsPtr->xFillPolygon) /* 26 */ #define XFillRectangles \ - (tkIntXlibStubsPtr->xFillRectangles) /* 35 */ -#define XForceScreenSaver \ - (tkIntXlibStubsPtr->xForceScreenSaver) /* 36 */ + (tkIntXlibStubsPtr->xFillRectangles) /* 27 */ #define XFreeColormap \ - (tkIntXlibStubsPtr->xFreeColormap) /* 37 */ + (tkIntXlibStubsPtr->xFreeColormap) /* 28 */ #define XFreeColors \ - (tkIntXlibStubsPtr->xFreeColors) /* 38 */ -#define XFreeCursor \ - (tkIntXlibStubsPtr->xFreeCursor) /* 39 */ + (tkIntXlibStubsPtr->xFreeColors) /* 29 */ #define XFreeModifiermap \ - (tkIntXlibStubsPtr->xFreeModifiermap) /* 40 */ + (tkIntXlibStubsPtr->xFreeModifiermap) /* 30 */ #define XGetGeometry \ - (tkIntXlibStubsPtr->xGetGeometry) /* 41 */ -#define XGetInputFocus \ - (tkIntXlibStubsPtr->xGetInputFocus) /* 42 */ + (tkIntXlibStubsPtr->xGetGeometry) /* 31 */ #define XGetWindowProperty \ - (tkIntXlibStubsPtr->xGetWindowProperty) /* 43 */ -#define XGetWindowAttributes \ - (tkIntXlibStubsPtr->xGetWindowAttributes) /* 44 */ + (tkIntXlibStubsPtr->xGetWindowProperty) /* 32 */ #define XGrabKeyboard \ - (tkIntXlibStubsPtr->xGrabKeyboard) /* 45 */ + (tkIntXlibStubsPtr->xGrabKeyboard) /* 33 */ #define XGrabPointer \ - (tkIntXlibStubsPtr->xGrabPointer) /* 46 */ + (tkIntXlibStubsPtr->xGrabPointer) /* 34 */ #define XKeysymToKeycode \ - (tkIntXlibStubsPtr->xKeysymToKeycode) /* 47 */ -#define XLookupColor \ - (tkIntXlibStubsPtr->xLookupColor) /* 48 */ + (tkIntXlibStubsPtr->xKeysymToKeycode) /* 35 */ #define XMapWindow \ - (tkIntXlibStubsPtr->xMapWindow) /* 49 */ + (tkIntXlibStubsPtr->xMapWindow) /* 36 */ #define XMoveResizeWindow \ - (tkIntXlibStubsPtr->xMoveResizeWindow) /* 50 */ + (tkIntXlibStubsPtr->xMoveResizeWindow) /* 37 */ #define XMoveWindow \ - (tkIntXlibStubsPtr->xMoveWindow) /* 51 */ -#define XNextEvent \ - (tkIntXlibStubsPtr->xNextEvent) /* 52 */ -#define XPutBackEvent \ - (tkIntXlibStubsPtr->xPutBackEvent) /* 53 */ -#define XQueryColors \ - (tkIntXlibStubsPtr->xQueryColors) /* 54 */ + (tkIntXlibStubsPtr->xMoveWindow) /* 38 */ #define XQueryPointer \ - (tkIntXlibStubsPtr->xQueryPointer) /* 55 */ -#define XQueryTree \ - (tkIntXlibStubsPtr->xQueryTree) /* 56 */ + (tkIntXlibStubsPtr->xQueryPointer) /* 39 */ #define XRaiseWindow \ - (tkIntXlibStubsPtr->xRaiseWindow) /* 57 */ + (tkIntXlibStubsPtr->xRaiseWindow) /* 40 */ #define XRefreshKeyboardMapping \ - (tkIntXlibStubsPtr->xRefreshKeyboardMapping) /* 58 */ + (tkIntXlibStubsPtr->xRefreshKeyboardMapping) /* 41 */ #define XResizeWindow \ - (tkIntXlibStubsPtr->xResizeWindow) /* 59 */ + (tkIntXlibStubsPtr->xResizeWindow) /* 42 */ #define XSelectInput \ - (tkIntXlibStubsPtr->xSelectInput) /* 60 */ + (tkIntXlibStubsPtr->xSelectInput) /* 43 */ #define XSendEvent \ - (tkIntXlibStubsPtr->xSendEvent) /* 61 */ -#define XSetCommand \ - (tkIntXlibStubsPtr->xSetCommand) /* 62 */ + (tkIntXlibStubsPtr->xSendEvent) /* 44 */ #define XSetIconName \ - (tkIntXlibStubsPtr->xSetIconName) /* 63 */ + (tkIntXlibStubsPtr->xSetIconName) /* 45 */ #define XSetInputFocus \ - (tkIntXlibStubsPtr->xSetInputFocus) /* 64 */ + (tkIntXlibStubsPtr->xSetInputFocus) /* 46 */ #define XSetSelectionOwner \ - (tkIntXlibStubsPtr->xSetSelectionOwner) /* 65 */ + (tkIntXlibStubsPtr->xSetSelectionOwner) /* 47 */ #define XSetWindowBackground \ - (tkIntXlibStubsPtr->xSetWindowBackground) /* 66 */ + (tkIntXlibStubsPtr->xSetWindowBackground) /* 48 */ #define XSetWindowBackgroundPixmap \ - (tkIntXlibStubsPtr->xSetWindowBackgroundPixmap) /* 67 */ + (tkIntXlibStubsPtr->xSetWindowBackgroundPixmap) /* 49 */ #define XSetWindowBorder \ - (tkIntXlibStubsPtr->xSetWindowBorder) /* 68 */ + (tkIntXlibStubsPtr->xSetWindowBorder) /* 50 */ #define XSetWindowBorderPixmap \ - (tkIntXlibStubsPtr->xSetWindowBorderPixmap) /* 69 */ + (tkIntXlibStubsPtr->xSetWindowBorderPixmap) /* 51 */ #define XSetWindowBorderWidth \ - (tkIntXlibStubsPtr->xSetWindowBorderWidth) /* 70 */ + (tkIntXlibStubsPtr->xSetWindowBorderWidth) /* 52 */ #define XSetWindowColormap \ - (tkIntXlibStubsPtr->xSetWindowColormap) /* 71 */ -#define XTranslateCoordinates \ - (tkIntXlibStubsPtr->xTranslateCoordinates) /* 72 */ + (tkIntXlibStubsPtr->xSetWindowColormap) /* 53 */ #define XUngrabKeyboard \ - (tkIntXlibStubsPtr->xUngrabKeyboard) /* 73 */ + (tkIntXlibStubsPtr->xUngrabKeyboard) /* 54 */ #define XUngrabPointer \ - (tkIntXlibStubsPtr->xUngrabPointer) /* 74 */ + (tkIntXlibStubsPtr->xUngrabPointer) /* 55 */ #define XUnmapWindow \ - (tkIntXlibStubsPtr->xUnmapWindow) /* 75 */ -#define XWindowEvent \ - (tkIntXlibStubsPtr->xWindowEvent) /* 76 */ -#define XDestroyIC \ - (tkIntXlibStubsPtr->xDestroyIC) /* 77 */ -#define XFilterEvent \ - (tkIntXlibStubsPtr->xFilterEvent) /* 78 */ -#define XmbLookupString \ - (tkIntXlibStubsPtr->xmbLookupString) /* 79 */ + (tkIntXlibStubsPtr->xUnmapWindow) /* 56 */ #define TkPutImage \ - (tkIntXlibStubsPtr->tkPutImage) /* 80 */ -#define XSetClipRectangles \ - (tkIntXlibStubsPtr->xSetClipRectangles) /* 81 */ + (tkIntXlibStubsPtr->tkPutImage) /* 57 */ #define XParseColor \ - (tkIntXlibStubsPtr->xParseColor) /* 82 */ + (tkIntXlibStubsPtr->xParseColor) /* 58 */ #define XCreateGC \ - (tkIntXlibStubsPtr->xCreateGC) /* 83 */ + (tkIntXlibStubsPtr->xCreateGC) /* 59 */ #define XFreeGC \ - (tkIntXlibStubsPtr->xFreeGC) /* 84 */ + (tkIntXlibStubsPtr->xFreeGC) /* 60 */ #define XInternAtom \ - (tkIntXlibStubsPtr->xInternAtom) /* 85 */ + (tkIntXlibStubsPtr->xInternAtom) /* 61 */ #define XSetBackground \ - (tkIntXlibStubsPtr->xSetBackground) /* 86 */ + (tkIntXlibStubsPtr->xSetBackground) /* 62 */ #define XSetForeground \ - (tkIntXlibStubsPtr->xSetForeground) /* 87 */ + (tkIntXlibStubsPtr->xSetForeground) /* 63 */ #define XSetClipMask \ - (tkIntXlibStubsPtr->xSetClipMask) /* 88 */ + (tkIntXlibStubsPtr->xSetClipMask) /* 64 */ #define XSetClipOrigin \ - (tkIntXlibStubsPtr->xSetClipOrigin) /* 89 */ + (tkIntXlibStubsPtr->xSetClipOrigin) /* 65 */ #define XSetTSOrigin \ - (tkIntXlibStubsPtr->xSetTSOrigin) /* 90 */ + (tkIntXlibStubsPtr->xSetTSOrigin) /* 66 */ #define XChangeGC \ - (tkIntXlibStubsPtr->xChangeGC) /* 91 */ + (tkIntXlibStubsPtr->xChangeGC) /* 67 */ #define XSetFont \ - (tkIntXlibStubsPtr->xSetFont) /* 92 */ + (tkIntXlibStubsPtr->xSetFont) /* 68 */ #define XSetArcMode \ - (tkIntXlibStubsPtr->xSetArcMode) /* 93 */ + (tkIntXlibStubsPtr->xSetArcMode) /* 69 */ #define XSetStipple \ - (tkIntXlibStubsPtr->xSetStipple) /* 94 */ + (tkIntXlibStubsPtr->xSetStipple) /* 70 */ #define XSetFillRule \ - (tkIntXlibStubsPtr->xSetFillRule) /* 95 */ + (tkIntXlibStubsPtr->xSetFillRule) /* 71 */ #define XSetFillStyle \ - (tkIntXlibStubsPtr->xSetFillStyle) /* 96 */ + (tkIntXlibStubsPtr->xSetFillStyle) /* 72 */ #define XSetFunction \ - (tkIntXlibStubsPtr->xSetFunction) /* 97 */ + (tkIntXlibStubsPtr->xSetFunction) /* 73 */ #define XSetLineAttributes \ - (tkIntXlibStubsPtr->xSetLineAttributes) /* 98 */ + (tkIntXlibStubsPtr->xSetLineAttributes) /* 74 */ #define _XInitImageFuncPtrs \ - (tkIntXlibStubsPtr->_XInitImageFuncPtrs) /* 99 */ + (tkIntXlibStubsPtr->_XInitImageFuncPtrs) /* 75 */ #define XCreateIC \ - (tkIntXlibStubsPtr->xCreateIC) /* 100 */ + (tkIntXlibStubsPtr->xCreateIC) /* 76 */ #define XGetVisualInfo \ - (tkIntXlibStubsPtr->xGetVisualInfo) /* 101 */ + (tkIntXlibStubsPtr->xGetVisualInfo) /* 77 */ #define XSetWMClientMachine \ - (tkIntXlibStubsPtr->xSetWMClientMachine) /* 102 */ + (tkIntXlibStubsPtr->xSetWMClientMachine) /* 78 */ #define XStringListToTextProperty \ - (tkIntXlibStubsPtr->xStringListToTextProperty) /* 103 */ + (tkIntXlibStubsPtr->xStringListToTextProperty) /* 79 */ +#define XDrawSegments \ + (tkIntXlibStubsPtr->xDrawSegments) /* 80 */ +#define XForceScreenSaver \ + (tkIntXlibStubsPtr->xForceScreenSaver) /* 81 */ #define XDrawLine \ - (tkIntXlibStubsPtr->xDrawLine) /* 104 */ -#define XWarpPointer \ - (tkIntXlibStubsPtr->xWarpPointer) /* 105 */ + (tkIntXlibStubsPtr->xDrawLine) /* 82 */ #define XFillRectangle \ - (tkIntXlibStubsPtr->xFillRectangle) /* 106 */ + (tkIntXlibStubsPtr->xFillRectangle) /* 83 */ +#define XClearWindow \ + (tkIntXlibStubsPtr->xClearWindow) /* 84 */ +#define XDrawPoint \ + (tkIntXlibStubsPtr->xDrawPoint) /* 85 */ +#define XDrawPoints \ + (tkIntXlibStubsPtr->xDrawPoints) /* 86 */ +#define XWarpPointer \ + (tkIntXlibStubsPtr->xWarpPointer) /* 87 */ +#define XQueryColor \ + (tkIntXlibStubsPtr->xQueryColor) /* 88 */ +#define XQueryColors \ + (tkIntXlibStubsPtr->xQueryColors) /* 89 */ +#define XQueryTree \ + (tkIntXlibStubsPtr->xQueryTree) /* 90 */ +#define XSync \ + (tkIntXlibStubsPtr->xSync) /* 91 */ +#define XTranslateCoordinates \ + (tkIntXlibStubsPtr->xTranslateCoordinates) /* 92 */ +#define XDeleteProperty \ + (tkIntXlibStubsPtr->xDeleteProperty) /* 93 */ +#define XFreeCursor \ + (tkIntXlibStubsPtr->xFreeCursor) /* 94 */ +#define XGetInputFocus \ + (tkIntXlibStubsPtr->xGetInputFocus) /* 95 */ +#define XmbLookupString \ + (tkIntXlibStubsPtr->xmbLookupString) /* 96 */ +#define XNextEvent \ + (tkIntXlibStubsPtr->xNextEvent) /* 97 */ +#define XPutBackEvent \ + (tkIntXlibStubsPtr->xPutBackEvent) /* 98 */ +#define XSetCommand \ + (tkIntXlibStubsPtr->xSetCommand) /* 99 */ +#define XWindowEvent \ + (tkIntXlibStubsPtr->xWindowEvent) /* 100 */ +#define XGetWindowAttributes \ + (tkIntXlibStubsPtr->xGetWindowAttributes) /* 101 */ +#define XGetWMColormapWindows \ + (tkIntXlibStubsPtr->xGetWMColormapWindows) /* 102 */ +#define XIconifyWindow \ + (tkIntXlibStubsPtr->xIconifyWindow) /* 103 */ +#define XWithdrawWindow \ + (tkIntXlibStubsPtr->xWithdrawWindow) /* 104 */ +#define XListHosts \ + (tkIntXlibStubsPtr->xListHosts) /* 105 */ +#define XSetClipRectangles \ + (tkIntXlibStubsPtr->xSetClipRectangles) /* 106 */ #define XFlush \ (tkIntXlibStubsPtr->xFlush) /* 107 */ #define XGrabServer \ (tkIntXlibStubsPtr->xGrabServer) /* 108 */ #define XUngrabServer \ @@ -1768,12 +1771,12 @@ (tkIntXlibStubsPtr->xFree) /* 110 */ #define XNoOp \ (tkIntXlibStubsPtr->xNoOp) /* 111 */ #define XSynchronize \ (tkIntXlibStubsPtr->xSynchronize) /* 112 */ -#define XSync \ - (tkIntXlibStubsPtr->xSync) /* 113 */ +#define XLookupColor \ + (tkIntXlibStubsPtr->xLookupColor) /* 113 */ #define XVisualIDFromVisual \ (tkIntXlibStubsPtr->xVisualIDFromVisual) /* 114 */ /* Slot 115 is reserved */ /* Slot 116 is reserved */ /* Slot 117 is reserved */ @@ -1797,16 +1800,13 @@ (tkIntXlibStubsPtr->xFillArcs) /* 130 */ #define XDrawArcs \ (tkIntXlibStubsPtr->xDrawArcs) /* 131 */ #define XDrawRectangles \ (tkIntXlibStubsPtr->xDrawRectangles) /* 132 */ -#define XDrawSegments \ - (tkIntXlibStubsPtr->xDrawSegments) /* 133 */ -#define XDrawPoint \ - (tkIntXlibStubsPtr->xDrawPoint) /* 134 */ -#define XDrawPoints \ - (tkIntXlibStubsPtr->xDrawPoints) /* 135 */ +/* Slot 133 is reserved */ +/* Slot 134 is reserved */ +/* Slot 135 is reserved */ #define XReparentWindow \ (tkIntXlibStubsPtr->xReparentWindow) /* 136 */ #define XPutImage \ (tkIntXlibStubsPtr->xPutImage) /* 137 */ #define XPolygonRegion \ @@ -1819,13 +1819,16 @@ (tkIntXlibStubsPtr->xSetICValues) /* 141 */ #define XGetICValues \ (tkIntXlibStubsPtr->xGetICValues) /* 142 */ #define XSetICFocus \ (tkIntXlibStubsPtr->xSetICFocus) /* 143 */ -/* Slot 144 is reserved */ -/* Slot 145 is reserved */ -/* Slot 146 is reserved */ +#define XDestroyIC \ + (tkIntXlibStubsPtr->xDestroyIC) /* 144 */ +#define XCreatePixmapCursor \ + (tkIntXlibStubsPtr->xCreatePixmapCursor) /* 145 */ +#define XCreateGlyphCursor \ + (tkIntXlibStubsPtr->xCreateGlyphCursor) /* 146 */ #define XFreeFontSet \ (tkIntXlibStubsPtr->xFreeFontSet) /* 147 */ #define XCloseIM \ (tkIntXlibStubsPtr->xCloseIM) /* 148 */ #define XRegisterIMInstantiateCallback \ Index: generic/tkListbox.c ================================================================== --- generic/tkListbox.c +++ generic/tkListbox.c @@ -55,13 +55,13 @@ * Information used when displaying widget: */ Tk_3DBorder normalBorder; /* Used for drawing border around whole * window, plus used for background. */ - Tcl_Obj *borderWidthObj; /* Width of 3-D border around window. */ + int borderWidth; /* Width of 3-D border around window. */ int relief; /* 3-D effect: TK_RELIEF_RAISED, etc. */ - Tcl_Obj *highlightWidthObj; /* Width in pixels of highlight to draw around + int highlightWidth; /* Width in pixels of highlight to draw around * widget when it has the focus. <= 0 means * don't draw a highlight. */ XColor *highlightBgColorPtr; /* Color for drawing traversal highlight area * when highlight is off. */ @@ -75,11 +75,11 @@ XColor *fgColorPtr; /* Text color in normal mode. */ XColor *dfgColorPtr; /* Text color in disabled mode. */ GC textGC; /* For drawing normal text. */ Tk_3DBorder selBorder; /* Borders and backgrounds for selected * elements. */ - Tcl_Obj *selBorderWidthObj; /* Width of border around selection. */ + int selBorderWidth; /* Width of border around selection. */ XColor *selFgColorPtr; /* Foreground color for selected elements. */ GC selTextGC; /* For drawing selected text. */ int width; /* Desired width of window, in characters. */ int height; /* Desired height of window, in lines. */ int lineHeight; /* Number of pixels allocated for each line in @@ -239,11 +239,11 @@ {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_LISTBOX_BORDER_WIDTH, offsetof(Listbox, borderWidthObj), TCL_INDEX_NONE, + DEF_LISTBOX_BORDER_WIDTH, TCL_INDEX_NONE, offsetof(Listbox, borderWidth), 0, 0, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", DEF_LISTBOX_CURSOR, TCL_INDEX_NONE, offsetof(Listbox, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", @@ -266,21 +266,21 @@ {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", DEF_LISTBOX_HIGHLIGHT, TCL_INDEX_NONE, offsetof(Listbox, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", DEF_LISTBOX_HIGHLIGHT_WIDTH, - offsetof(Listbox, highlightWidthObj), TCL_INDEX_NONE, 0, 0, 0}, + TCL_INDEX_NONE, offsetof(Listbox, highlightWidth), 0, 0, 0}, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", DEF_LISTBOX_JUSTIFY, TCL_INDEX_NONE, offsetof(Listbox, justify), TK_OPTION_ENUM_VAR, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", DEF_LISTBOX_RELIEF, TCL_INDEX_NONE, offsetof(Listbox, relief), 0, 0, 0}, {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground", DEF_LISTBOX_SELECT_COLOR, TCL_INDEX_NONE, offsetof(Listbox, selBorder), 0, DEF_LISTBOX_SELECT_MONO, 0}, {TK_OPTION_PIXELS, "-selectborderwidth", "selectBorderWidth", - "BorderWidth", DEF_LISTBOX_SELECT_BD, offsetof(Listbox, selBorderWidthObj), - TCL_INDEX_NONE, 0, 0, 0}, + "BorderWidth", DEF_LISTBOX_SELECT_BD, TCL_INDEX_NONE, + offsetof(Listbox, selBorderWidth), 0, 0, 0}, {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background", DEF_LISTBOX_SELECT_FG_COLOR, TCL_INDEX_NONE, offsetof(Listbox, selFgColorPtr), TK_OPTION_NULL_OK, DEF_LISTBOX_SELECT_FG_MONO, 0}, {TK_OPTION_STRING, "-selectmode", "selectMode", "SelectMode", DEF_LISTBOX_SELECT_MODE, offsetof(Listbox, selectModeObj), TCL_INDEX_NONE, @@ -1091,11 +1091,10 @@ Tcl_Obj *el, *results[4]; const char *stringRep; int pixelWidth, x, y, result; Tcl_Size stringLen; Tk_FontMetrics fm; - int selBorderWidth; /* * Compute the pixel width of the requested element. */ @@ -1106,22 +1105,21 @@ stringRep = Tcl_GetStringFromObj(el, &stringLen); Tk_GetFontMetrics(listPtr->tkfont, &fm); pixelWidth = Tk_TextWidth(listPtr->tkfont, stringRep, stringLen); - Tk_GetPixelsFromObj(NULL, listPtr->tkwin, listPtr->selBorderWidthObj, &selBorderWidth); if (listPtr->justify == TK_JUSTIFY_LEFT) { - x = (listPtr->inset + selBorderWidth) - listPtr->xOffset; + x = (listPtr->inset + listPtr->selBorderWidth) - listPtr->xOffset; } else if (listPtr->justify == TK_JUSTIFY_RIGHT) { - x = Tk_Width(tkwin) - (listPtr->inset + selBorderWidth) + x = Tk_Width(tkwin) - (listPtr->inset + listPtr->selBorderWidth) - pixelWidth - listPtr->xOffset + GetMaxOffset(listPtr); } else { x = (Tk_Width(tkwin) - pixelWidth) / 2 - listPtr->xOffset + GetMaxOffset(listPtr) / 2; } y = ((index - listPtr->topIndex)*listPtr->lineHeight) - + listPtr->inset + selBorderWidth; + + listPtr->inset + listPtr->selBorderWidth; results[0] = Tcl_NewWideIntObj(x); results[1] = Tcl_NewWideIntObj(y); results[2] = Tcl_NewWideIntObj(pixelWidth); results[3] = Tcl_NewWideIntObj(fm.linespace); Tcl_SetObjResult(interp, Tcl_NewListObj(4, results)); @@ -1245,15 +1243,13 @@ Tcl_Obj *const objv[]) /* Array of arguments to the procedure */ { int index, count, windowWidth, windowUnits; int offset = 0; /* Initialized to stop gcc warnings. */ double fraction; - int selBorderWidth; - Tk_GetPixelsFromObj(NULL, listPtr->tkwin, listPtr->selBorderWidthObj, &selBorderWidth); windowWidth = Tk_Width(listPtr->tkwin) - - 2 * (listPtr->inset + selBorderWidth); + - 2 * (listPtr->inset + listPtr->selBorderWidth); if (objc == 2) { Tcl_Obj *results[2]; if (listPtr->maxWidth == 0) { results[0] = Tcl_NewDoubleObj(0.0); @@ -1560,11 +1556,10 @@ { Tk_SavedOptions savedOptions; Tcl_Obj *oldListObj = NULL; Tcl_Obj *errorResult = NULL; int oldExport, error; - int borderWidth, selBorderWidth, highlightWidth; oldExport = (listPtr->exportSelection) && (!Tcl_IsSafe(listPtr->interp)); if (listPtr->listVarNameObj != NULL) { Tcl_UntraceVar2(interp, Tcl_GetString(listPtr->listVarNameObj), NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, @@ -1597,32 +1592,20 @@ * background from a 3-D border. */ Tk_SetBackgroundFromBorder(listPtr->tkwin, listPtr->normalBorder); - Tk_GetPixelsFromObj(NULL, listPtr->tkwin, listPtr->borderWidthObj, &borderWidth); - if (borderWidth < 0) { - borderWidth = 0; - Tcl_DecrRefCount(listPtr->borderWidthObj); - listPtr->borderWidthObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(listPtr->borderWidthObj); - } - Tk_GetPixelsFromObj(NULL, listPtr->tkwin, listPtr->highlightWidthObj, &highlightWidth); - if (highlightWidth < 0) { - highlightWidth = 0; - Tcl_DecrRefCount(listPtr->highlightWidthObj); - listPtr->highlightWidthObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(listPtr->highlightWidthObj); - } - Tk_GetPixelsFromObj(NULL, listPtr->tkwin, listPtr->selBorderWidthObj, &selBorderWidth); - if (selBorderWidth < 0) { - selBorderWidth = 0; - Tcl_DecrRefCount(listPtr->selBorderWidthObj); - listPtr->selBorderWidthObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(listPtr->selBorderWidthObj); - } - listPtr->inset = highlightWidth + borderWidth; + if (listPtr->borderWidth < 0) { + listPtr->borderWidth = 0; + } + if (listPtr->highlightWidth < 0) { + listPtr->highlightWidth = 0; + } + if (listPtr->selBorderWidth < 0) { + listPtr->selBorderWidth = 0; + } + listPtr->inset = listPtr->highlightWidth + listPtr->borderWidth; /* * Claim the selection if we've suddenly started exporting it and * there is a selection to export and this interp is unsafe. */ @@ -1871,11 +1854,10 @@ int left, right; /* Non-zero values here indicate that the left * or right edge of the listbox is * off-screen. */ Pixmap pixmap; int textWidth; - int borderWidth, selBorderWidth, highlightWidth; listPtr->flags &= ~REDRAW_PENDING; if (listPtr->flags & LISTBOX_DELETED) { return; } @@ -1923,22 +1905,21 @@ /* * Display each item in the listbox. */ - Tk_GetPixelsFromObj(NULL, listPtr->tkwin, listPtr->selBorderWidthObj, &selBorderWidth); limit = listPtr->topIndex + listPtr->fullLines + listPtr->partialLine - 1; if (limit >= (int)listPtr->nElements) { limit = listPtr->nElements-1; } left = right = 0; if (listPtr->xOffset > 0) { - left = selBorderWidth + 1; + left = listPtr->selBorderWidth + 1; } if ((listPtr->maxWidth - listPtr->xOffset) > (Tk_Width(listPtr->tkwin) - - 2 * (listPtr->inset + selBorderWidth))) { - right = selBorderWidth + 1; + - 2 * (listPtr->inset + listPtr->selBorderWidth))) { + right = listPtr->selBorderWidth + 1; } prevSelected = 0; for (i = listPtr->topIndex; i <= limit; i++) { int width = Tk_Width(tkwin); /* zeroth approx to silence warning */ @@ -2023,33 +2004,33 @@ */ /* Draw left bevel */ if (left == 0) { Tk_3DVerticalBevel(tkwin, pixmap, selectedBg, - x, y, selBorderWidth, listPtr->lineHeight, + x, y, listPtr->selBorderWidth, listPtr->lineHeight, 1, TK_RELIEF_RAISED); } /* Draw right bevel */ if (right == 0) { Tk_3DVerticalBevel(tkwin, pixmap, selectedBg, - x + width - selBorderWidth, y, - selBorderWidth, listPtr->lineHeight, + x + width - listPtr->selBorderWidth, y, + listPtr->selBorderWidth, listPtr->lineHeight, 0, TK_RELIEF_RAISED); } /* Draw top bevel */ if (!prevSelected) { Tk_3DHorizontalBevel(tkwin, pixmap, selectedBg, x-left, y, width+left+right, - selBorderWidth, + listPtr->selBorderWidth, 1, 1, 1, TK_RELIEF_RAISED); } /* Draw bottom bevel */ if (i + 1 == (int)listPtr->nElements || !Tcl_FindHashEntry(listPtr->selection, KEY(i + 1))) { Tk_3DHorizontalBevel(tkwin, pixmap, selectedBg, x-left, - y + listPtr->lineHeight - selBorderWidth, - width+left+right, selBorderWidth, 0, 0, 0, + y + listPtr->lineHeight - listPtr->selBorderWidth, + width+left+right, listPtr->selBorderWidth, 0, 0, 0, TK_RELIEF_RAISED); } prevSelected = 1; } else { /* @@ -2097,16 +2078,16 @@ Tcl_ListObjIndex(listPtr->interp, listPtr->listObj, i, &curElement); stringRep = Tcl_GetStringFromObj(curElement, &stringLen); textWidth = Tk_TextWidth(listPtr->tkfont, stringRep, stringLen); Tk_GetFontMetrics(listPtr->tkfont, &fm); - y += fm.ascent + selBorderWidth; + y += fm.ascent + listPtr->selBorderWidth; if (listPtr->justify == TK_JUSTIFY_LEFT) { - x = (listPtr->inset + selBorderWidth) - listPtr->xOffset; + x = (listPtr->inset + listPtr->selBorderWidth) - listPtr->xOffset; } else if (listPtr->justify == TK_JUSTIFY_RIGHT) { - x = Tk_Width(tkwin) - (listPtr->inset + selBorderWidth) + x = Tk_Width(tkwin) - (listPtr->inset + listPtr->selBorderWidth) - textWidth - listPtr->xOffset + GetMaxOffset(listPtr); } else { x = (Tk_Width(tkwin) - textWidth)/2 - listPtr->xOffset + GetMaxOffset(listPtr)/2; } @@ -2158,28 +2139,26 @@ /* * Redraw the border for the listbox to make sure that it's on top of any * of the text of the listbox entries. */ - Tk_GetPixelsFromObj(NULL, listPtr->tkwin, listPtr->borderWidthObj, &borderWidth); - Tk_GetPixelsFromObj(NULL, listPtr->tkwin, listPtr->highlightWidthObj, &highlightWidth); Tk_Draw3DRectangle(tkwin, pixmap, listPtr->normalBorder, - highlightWidth, highlightWidth, - Tk_Width(tkwin) - 2 * highlightWidth, - Tk_Height(tkwin) - 2 * highlightWidth, - borderWidth, listPtr->relief); - if (highlightWidth > 0) { + listPtr->highlightWidth, listPtr->highlightWidth, + Tk_Width(tkwin) - 2 * listPtr->highlightWidth, + Tk_Height(tkwin) - 2 * listPtr->highlightWidth, + listPtr->borderWidth, listPtr->relief); + if (listPtr->highlightWidth > 0) { GC fgGC, bgGC; bgGC = Tk_GCForColor(listPtr->highlightBgColorPtr, pixmap); if (listPtr->flags & GOT_FOCUS) { fgGC = Tk_GCForColor(listPtr->highlightColorPtr, pixmap); Tk_DrawHighlightBorder(tkwin, fgGC, bgGC, - highlightWidth, pixmap); + listPtr->highlightWidth, pixmap); } else { Tk_DrawHighlightBorder(tkwin, bgGC, bgGC, - highlightWidth, pixmap); + listPtr->highlightWidth, pixmap); } } #ifndef TK_NO_DOUBLE_BUFFERING XCopyArea(disp, pixmap, Tk_WindowId(tkwin), listPtr->textGC, 0, 0, (unsigned) Tk_Width(tkwin), (unsigned) Tk_Height(tkwin), 0, 0); @@ -2224,11 +2203,10 @@ int width, height, pixelWidth, pixelHeight, i, result; Tcl_Size textLength; Tk_FontMetrics fm; Tcl_Obj *element; const char *text; - int selBorderWidth; if (fontChanged || maxIsStale) { listPtr->xScrollUnit = Tk_TextWidth(listPtr->tkfont, "0", 1); if (listPtr->xScrollUnit == 0) { listPtr->xScrollUnit = 1; @@ -2252,22 +2230,21 @@ } } } Tk_GetFontMetrics(listPtr->tkfont, &fm); - Tk_GetPixelsFromObj(NULL, listPtr->tkwin, listPtr->selBorderWidthObj, &selBorderWidth); - listPtr->lineHeight = fm.linespace + 1 + 2 * selBorderWidth; + listPtr->lineHeight = fm.linespace + 1 + 2 * listPtr->selBorderWidth; width = listPtr->width; if (width <= 0) { width = (listPtr->maxWidth + listPtr->xScrollUnit - 1) / listPtr->xScrollUnit; if (width < 1) { width = 1; } } pixelWidth = width*listPtr->xScrollUnit + 2 * listPtr->inset - + 2 * selBorderWidth; + + 2 * listPtr->selBorderWidth; height = listPtr->height; if (listPtr->height <= 0) { height = (int)listPtr->nElements; if (height < 1) { height = 1; @@ -3356,19 +3333,17 @@ char firstStr[TCL_DOUBLE_SPACE], lastStr[TCL_DOUBLE_SPACE]; int result, windowWidth; double first, last; Tcl_Interp *interp; Tcl_DString buf; - int selBorderWidth; if (listPtr->xScrollCmdObj == NULL) { return; } - Tk_GetPixelsFromObj(NULL, listPtr->tkwin, listPtr->selBorderWidthObj, &selBorderWidth); windowWidth = Tk_Width(listPtr->tkwin) - - 2 * (listPtr->inset + selBorderWidth); + - 2 * (listPtr->inset + listPtr->selBorderWidth); if (listPtr->maxWidth == 0) { first = 0; last = 1.0; } else { first = listPtr->xOffset / (double) listPtr->maxWidth; @@ -3635,16 +3610,15 @@ *---------------------------------------------------------------------- */ static int GetMaxOffset( Listbox *listPtr) { - int maxOffset, selBorderWidth; + int maxOffset; - Tk_GetPixelsFromObj(NULL, listPtr->tkwin, listPtr->selBorderWidthObj, &selBorderWidth); maxOffset = listPtr->maxWidth - (Tk_Width(listPtr->tkwin) - 2 * listPtr->inset - - 2 * selBorderWidth) + listPtr->xScrollUnit - 1; + 2 * listPtr->selBorderWidth) + listPtr->xScrollUnit - 1; if (maxOffset < 0) { /* * Listbox is larger in width than its largest width item. */ Index: generic/tkMain.c ================================================================== --- generic/tkMain.c +++ generic/tkMain.c @@ -161,11 +161,11 @@ * interpreted. * *---------------------------------------------------------------------- */ -void +TCL_NORETURN1 void Tk_MainEx( Tcl_Size argc, /* Number of arguments. */ TCHAR **argv, /* Array of argument strings. */ Tcl_AppInitProc *appInitProc, /* Application-specific initialization @@ -187,11 +187,11 @@ /* * Ensure that we are getting a compatible version of Tcl. */ - if (Tcl_InitStubs(interp, "8.7-", 0) == NULL) { + if (Tcl_InitStubs(interp, "8.6-", 0) == NULL) { if (Tcl_InitStubs(interp, "8.1", 0) == NULL) { abort(); } else { Tcl_Panic("%s", Tcl_GetString(Tcl_GetObjResult(interp))); } @@ -201,11 +201,11 @@ if (tclStubsPtr->tcl_CreateFileHandler) { /* We are running win32 Tk under Cygwin, so let's check * whether the env("DISPLAY") variable or the -display * argument is set. If so, we really want to run the - * Tk_MainEx function of libtcl9tk9.?.dll, not this one. */ + * Tk_MainEx function of libtk8.?.dll, not this one. */ if (Tcl_GetVar2(interp, "env", "DISPLAY", TCL_GLOBAL_ONLY)) { loadCygwinTk: TkCygwinMainEx(argc, argv, appInitProc, interp); /* Only returns when Tk_MainEx() was not found */ } else { @@ -245,10 +245,13 @@ * first few command line arguments to determine the script path and * encoding. */ if (NULL == Tcl_GetStartupScript(NULL)) { +#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 + size_t length; +#endif /* * Check whether first 3 args (argv[1] - argv[3]) look like * -encoding ENCODING FILENAME * or like @@ -259,19 +262,26 @@ /* mind argc is being adjusted as we proceed */ if ((argc >= 3) && (0 == _tcscmp(TEXT("-encoding"), argv[1])) && ('-' != argv[3][0])) { Tcl_Obj *value = NewNativeObj(argv[2]); - Tcl_SetStartupScript(NewNativeObj(argv[3]), - Tcl_GetString(value)); + Tcl_SetStartupScript(NewNativeObj(argv[3]), Tcl_GetString(value)); Tcl_DecrRefCount(value); argc -= 3; i += 3; } else if ((argc >= 1) && ('-' != argv[1][0])) { Tcl_SetStartupScript(NewNativeObj(argv[1]), NULL); argc--; i++; +#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 + } else if ((argc >= 2) && (length = _tcslen(argv[1])) + && (length > 1) && (0 == _tcsncmp(TEXT("-file"), argv[1], length)) + && ('-' != argv[2][0])) { + Tcl_SetStartupScript(NewNativeObj(argv[2]), NULL); + argc -= 2; + i += 2; +#endif } } path = Tcl_GetStartupScript(&encodingName); if (path == NULL) { @@ -279,11 +289,11 @@ } else { appName = path; } Tcl_SetVar2Ex(interp, "argv0", NULL, appName, TCL_GLOBAL_ONLY); - Tcl_SetVar2Ex(interp, "argc", NULL, Tcl_NewWideIntObj((Tcl_WideInt)argc), TCL_GLOBAL_ONLY); + Tcl_SetVar2Ex(interp, "argc", NULL, Tcl_NewWideIntObj(argc), TCL_GLOBAL_ONLY); argvPtr = Tcl_NewListObj(0, NULL); while (argc--) { Tcl_ListObjAppendElement(NULL, argvPtr, NewNativeObj(argv[i++])); } @@ -306,11 +316,11 @@ nullStdin = fstat(0, &st) || (S_ISCHR(st.st_mode) && !st.st_blocks); } #endif Tcl_SetVar2Ex(interp, "tcl_interactive", NULL, - Tcl_NewWideIntObj(!path && (is.tty || nullStdin)), TCL_GLOBAL_ONLY); + Tcl_NewBooleanObj(!path && (is.tty || nullStdin)), TCL_GLOBAL_ONLY); /* * Invoke application-specific initialization. */ Index: generic/tkMenu.c ================================================================== --- generic/tkMenu.c +++ generic/tkMenu.c @@ -258,11 +258,11 @@ NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", DEF_MENU_BORDER_WIDTH, - offsetof(TkMenu, borderWidthObj), TCL_INDEX_NONE, 0, NULL, 0}, + offsetof(TkMenu, borderWidthPtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", DEF_MENU_CURSOR, offsetof(TkMenu, cursorPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_MENU_DISABLED_FG_COLOR, @@ -276,11 +276,11 @@ DEF_MENU_FG, offsetof(TkMenu, fgPtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_STRING, "-postcommand", "postCommand", "Command", DEF_MENU_POST_COMMAND, offsetof(TkMenu, postCommandPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", - DEF_MENU_RELIEF, TCL_INDEX_NONE, offsetof(TkMenu, relief), 0, NULL, 0}, + DEF_MENU_RELIEF, offsetof(TkMenu, reliefPtr), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_COLOR, "-selectcolor", "selectColor", "Background", DEF_MENU_SELECT_COLOR, offsetof(TkMenu, indicatorFgPtr), TCL_INDEX_NONE, 0, DEF_MENU_SELECT_MONO, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", DEF_MENU_TAKE_FOCUS, @@ -853,11 +853,15 @@ } if (GetMenuIndex(interp, menuPtr, objv[2], 0, &index) != TCL_OK) { goto error; } if (index < 0) { +#if defined(TK_NO_DEPRECATED) Tcl_SetObjResult(interp, Tcl_NewObj()); +#else + Tcl_SetObjResult(interp, Tcl_NewStringObj("none", TCL_INDEX_NONE)); +#endif } else { Tcl_SetObjResult(interp, TkNewIndexObj(index)); } break; } @@ -3054,11 +3058,11 @@ int x2, borderwidth, max; TkRecomputeMenu(menuPtr); p = string + 1; Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, - menuPtr->borderWidthObj, &borderwidth); + menuPtr->borderWidthPtr, &borderwidth); rest = strchr(p, ','); if (rest) { Tcl_DString ds; Tcl_DStringInit(&ds); Tcl_DStringAppend(&ds, p, rest - p); Index: generic/tkMenuDraw.c ================================================================== --- generic/tkMenuDraw.c +++ generic/tkMenuDraw.c @@ -624,18 +624,19 @@ Tk_Font tkfont; Tk_FontMetrics menuMetrics; int width; int borderWidth; Tk_3DBorder border; + int relief; menuPtr->menuFlags &= ~REDRAW_PENDING; if ((menuPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) { return; } - Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->borderWidthObj, + Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->borderWidthPtr, &borderWidth); border = Tk_Get3DBorderFromObj(menuPtr->tkwin, menuPtr->borderPtr); if (menuPtr->menuType == MENUBAR) { Tk_Fill3DRectangle(tkwin, Tk_WindowId(tkwin), border, borderWidth, @@ -729,13 +730,14 @@ Tk_Fill3DRectangle(tkwin, Tk_WindowId(tkwin), border, x, y, width, height, 0, TK_RELIEF_FLAT); } + Tk_GetReliefFromObj(NULL, menuPtr->reliefPtr, &relief); Tk_Draw3DRectangle(menuPtr->tkwin, Tk_WindowId(tkwin), border, 0, 0, Tk_Width(tkwin), Tk_Height(tkwin), borderWidth, - menuPtr->relief); + relief); } /* *-------------------------------------------------------------- * @@ -987,11 +989,11 @@ *xPtr += mePtr->x; *yPtr += mePtr->y + mePtr->height; } else { int borderWidth, activeBorderWidth; - Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->borderWidthObj, + Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->borderWidthPtr, &borderWidth); Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->activeBorderWidthPtr, &activeBorderWidth); *xPtr += Tk_Width(menuPtr->tkwin) - borderWidth - activeBorderWidth - 2; Index: generic/tkMenubutton.c ================================================================== --- generic/tkMenubutton.c +++ generic/tkMenubutton.c @@ -60,12 +60,12 @@ 0, "-background", 0}, {TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap", DEF_MENUBUTTON_BITMAP, TCL_INDEX_NONE, offsetof(TkMenuButton, bitmap), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_MENUBUTTON_BORDER_WIDTH, offsetof(TkMenuButton, borderWidthObj), - TCL_INDEX_NONE, 0, 0, 0}, + DEF_MENUBUTTON_BORDER_WIDTH, TCL_INDEX_NONE, + offsetof(TkMenuButton, borderWidth), 0, 0, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", DEF_MENUBUTTON_CURSOR, TCL_INDEX_NONE, offsetof(TkMenuButton, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-direction", "direction", "Direction", DEF_MENUBUTTON_DIRECTION, TCL_INDEX_NONE, offsetof(TkMenuButton, direction), @@ -89,11 +89,11 @@ {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", DEF_MENUBUTTON_HIGHLIGHT, TCL_INDEX_NONE, offsetof(TkMenuButton, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", DEF_MENUBUTTON_HIGHLIGHT_WIDTH, - offsetof(TkMenuButton, highlightWidthObj), TCL_INDEX_NONE, 0, 0, 0}, + TCL_INDEX_NONE, offsetof(TkMenuButton, highlightWidth), 0, 0, 0}, {TK_OPTION_STRING, "-image", "image", "Image", DEF_MENUBUTTON_IMAGE, offsetof(TkMenuButton, imageObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-indicatoron", "indicatorOn", "IndicatorOn", DEF_MENUBUTTON_INDICATOR, TCL_INDEX_NONE, offsetof(TkMenuButton, indicatorOn), @@ -102,14 +102,14 @@ DEF_MENUBUTTON_JUSTIFY, TCL_INDEX_NONE, offsetof(TkMenuButton, justify), TK_OPTION_ENUM_VAR, 0, 0}, {TK_OPTION_STRING, "-menu", "menu", "Menu", DEF_MENUBUTTON_MENU, offsetof(TkMenuButton, menuNameObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-padx", "padX", "Pad", - DEF_MENUBUTTON_PADX, offsetof(TkMenuButton, padXObj), TCL_INDEX_NONE, + DEF_MENUBUTTON_PADX, TCL_INDEX_NONE, offsetof(TkMenuButton, padX), 0, 0, 0}, {TK_OPTION_PIXELS, "-pady", "padY", "Pad", - DEF_MENUBUTTON_PADY, offsetof(TkMenuButton, padYObj), TCL_INDEX_NONE, + DEF_MENUBUTTON_PADY, TCL_INDEX_NONE, offsetof(TkMenuButton, padY), 0, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", DEF_MENUBUTTON_RELIEF, TCL_INDEX_NONE, offsetof(TkMenuButton, relief), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", @@ -130,12 +130,12 @@ TK_OPTION_UNDERLINE_DEF(TkMenuButton, underline), 0}, {TK_OPTION_STRING, "-width", "width", "Width", DEF_MENUBUTTON_WIDTH, offsetof(TkMenuButton, widthObj), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength", - DEF_MENUBUTTON_WRAP_LENGTH, offsetof(TkMenuButton, wrapLengthObj), - TCL_INDEX_NONE, 0, 0, 0}, + DEF_MENUBUTTON_WRAP_LENGTH, TCL_INDEX_NONE, + offsetof(TkMenuButton, wrapLength), 0, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0} }; /* * The following tables define the menubutton widget commands and map the @@ -245,13 +245,13 @@ mbPtr->imageObj = NULL; mbPtr->image = NULL; mbPtr->state = STATE_NORMAL; mbPtr->normalBorder = NULL; mbPtr->activeBorder = NULL; - mbPtr->borderWidthObj = NULL; + mbPtr->borderWidth = 0; mbPtr->relief = TK_RELIEF_FLAT; - mbPtr->highlightWidthObj = 0; + mbPtr->highlightWidth = 0; mbPtr->highlightBgColorPtr = NULL; mbPtr->highlightColorPtr = NULL; mbPtr->inset = 0; mbPtr->tkfont = NULL; mbPtr->normalFg = NULL; @@ -266,13 +266,13 @@ mbPtr->rightBearing = 0; mbPtr->widthObj = NULL; mbPtr->heightObj = NULL; mbPtr->width = 0; mbPtr->height = 0; - mbPtr->wrapLengthObj = 0; - mbPtr->padXObj = NULL; - mbPtr->padYObj = NULL; + mbPtr->wrapLength = 0; + mbPtr->padX = 0; + mbPtr->padY = 0; mbPtr->anchor = TK_ANCHOR_CENTER; mbPtr->justify = TK_JUSTIFY_CENTER; mbPtr->textLayout = NULL; mbPtr->indicatorOn = 0; mbPtr->indicatorWidth = 0; @@ -279,15 +279,10 @@ mbPtr->indicatorHeight = 0; mbPtr->direction = DIRECTION_FLUSH; mbPtr->cursor = NULL; mbPtr->takeFocusObj = NULL; mbPtr->flags = 0; - mbPtr->borderWidthObj = NULL; - mbPtr->highlightWidthObj = NULL; - mbPtr->padXObj = NULL; - mbPtr->padYObj = NULL; - mbPtr->wrapLengthObj = NULL; Tk_CreateEventHandler(mbPtr->tkwin, ExposureMask|StructureNotifyMask|FocusChangeMask, MenuButtonEventProc, mbPtr); @@ -481,12 +476,10 @@ { Tk_SavedOptions savedOptions; Tcl_Obj *errorResult = NULL; int error; Tk_Image image; - int borderWidth, highlightWidth; - int padX, padY; /* * Eliminate any existing trace on variables monitored by the menubutton. */ @@ -535,37 +528,21 @@ Tk_SetBackgroundFromBorder(mbPtr->tkwin, mbPtr->activeBorder); } else { Tk_SetBackgroundFromBorder(mbPtr->tkwin, mbPtr->normalBorder); } - Tk_GetPixelsFromObj(NULL, mbPtr->tkwin, mbPtr->borderWidthObj, &borderWidth); - Tk_GetPixelsFromObj(NULL, mbPtr->tkwin, mbPtr->highlightWidthObj, &highlightWidth); - Tk_GetPixelsFromObj(NULL, mbPtr->tkwin, mbPtr->padXObj, &padX); - Tk_GetPixelsFromObj(NULL, mbPtr->tkwin, mbPtr->padYObj, &padY); - if (borderWidth < 0) { - borderWidth = 0; - Tcl_DecrRefCount(mbPtr->borderWidthObj); - mbPtr->borderWidthObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(mbPtr->borderWidthObj); - } - if (highlightWidth < 0) { - highlightWidth = 0; - Tcl_DecrRefCount(mbPtr->highlightWidthObj); - mbPtr->highlightWidthObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(mbPtr->highlightWidthObj); - } - if (padX < 0) { - padX = 0; - Tcl_DecrRefCount(mbPtr->padXObj); - mbPtr->padXObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(mbPtr->padXObj); - } - if (padY < 0) { - padY = 0; - Tcl_DecrRefCount(mbPtr->padYObj); - mbPtr->padYObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(mbPtr->padYObj); + if (mbPtr->borderWidth < 0) { + mbPtr->borderWidth = 0; + } + if (mbPtr->highlightWidth < 0) { + mbPtr->highlightWidth = 0; + } + if (mbPtr->padX < 0) { + mbPtr->padX = 0; + } + if (mbPtr->padY < 0) { + mbPtr->padY = 0; } /* * Get the image for the widget, if there is one. Allocate the new * image before freeing the old one, so that the reference count @@ -778,11 +755,10 @@ MenuButtonEventProc( void *clientData, /* Information about window. */ XEvent *eventPtr) /* Information about event. */ { TkMenuButton *mbPtr = (TkMenuButton *)clientData; - int highlightWidth; if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) { goto redraw; } else if (eventPtr->type == ConfigureNotify) { /* @@ -794,20 +770,18 @@ } else if (eventPtr->type == DestroyNotify) { DestroyMenuButton(mbPtr); } else if (eventPtr->type == FocusIn) { if (eventPtr->xfocus.detail != NotifyInferior) { mbPtr->flags |= GOT_FOCUS; - Tk_GetPixelsFromObj(NULL, mbPtr->tkwin, mbPtr->highlightWidthObj, &highlightWidth); - if (highlightWidth > 0) { + if (mbPtr->highlightWidth > 0) { goto redraw; } } } else if (eventPtr->type == FocusOut) { if (eventPtr->xfocus.detail != NotifyInferior) { mbPtr->flags &= ~GOT_FOCUS; - Tk_GetPixelsFromObj(NULL, mbPtr->tkwin, mbPtr->highlightWidthObj, &highlightWidth); - if (highlightWidth > 0) { + if (mbPtr->highlightWidth > 0) { goto redraw; } } } return; @@ -959,16 +933,16 @@ */ static void MenuButtonImageProc( void *clientData, /* Pointer to widget record. */ - TCL_UNUSED(int), /* x, Upper left pixel (within image) that must */ - TCL_UNUSED(int), /* y, be redisplayed. */ - TCL_UNUSED(int), /* width, Dimensions of area to redisplay (may be <= */ - TCL_UNUSED(int), /* height, 0). */ - TCL_UNUSED(int), /* imgWidth, New dimensions of image. */ - TCL_UNUSED(int)) /* imgHeight */ + TCL_UNUSED(int), /* x, Upper left pixel (within image) that must */ + TCL_UNUSED(int), /* y, be redisplayed. */ + TCL_UNUSED(int), /* width, Dimensions of area to redisplay (may be <= */ + TCL_UNUSED(int), /* height, 0). */ + TCL_UNUSED(int), /* imgWidth, New dimensions of image. */ + TCL_UNUSED(int)) /* imgHeight) */ { TkMenuButton *mbPtr = (TkMenuButton *)clientData; if (mbPtr->tkwin != NULL) { TkpComputeMenuButtonGeometry(mbPtr); Index: generic/tkMessage.c ================================================================== --- generic/tkMessage.c +++ generic/tkMessage.c @@ -43,24 +43,24 @@ * If non-NULL, message displays the contents * of this variable. */ Tk_3DBorder border; /* Structure used to draw 3-D border and * background. NULL means a border hasn't been * created yet. */ - Tcl_Obj *borderWidthObj; /* Width of border. */ + int borderWidth; /* Width of border. */ int relief; /* 3-D effect: TK_RELIEF_RAISED, etc. */ - Tcl_Obj *highlightWidthObj; /* Width in pixels of highlight to draw + int highlightWidth; /* Width in pixels of highlight to draw * around widget when it has the focus. * 0 means don't draw a highlight. */ XColor *highlightBgColorPtr; /* Color for drawing traversal highlight * area when highlight is off. */ XColor *highlightColorPtr; /* Color for drawing traversal highlight. */ Tk_Font tkfont; /* Information about text font, or NULL. */ XColor *fgColorPtr; /* Foreground color in normal mode. */ Tcl_Obj *padXObj, *padYObj; /* Tcl_Obj rep's of padX, padY values. */ - Tcl_Obj *widthObj; /* User-requested width, in pixels. 0 means - * compute width using aspect ratio. */ + int width; /* User-requested width, in pixels. 0 means + * compute width using aspect ratio below. */ int aspect; /* Desired aspect ratio for window * (100*width/height). */ int msgWidth; /* Width in pixels needed to display * message. */ int msgHeight; /* Height in pixels needed to display @@ -115,12 +115,12 @@ {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_MESSAGE_BORDER_WIDTH, offsetof(Message, borderWidthObj), - TCL_INDEX_NONE, 0, 0, 0}, + DEF_MESSAGE_BORDER_WIDTH, TCL_INDEX_NONE, + offsetof(Message, borderWidth), 0, 0, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", DEF_MESSAGE_CURSOR, TCL_INDEX_NONE, offsetof(Message, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_SYNONYM, "-fg", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0}, @@ -133,12 +133,12 @@ offsetof(Message, highlightBgColorPtr), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", DEF_MESSAGE_HIGHLIGHT, TCL_INDEX_NONE, offsetof(Message, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", - "HighlightThickness", DEF_MESSAGE_HIGHLIGHT_WIDTH, offsetof(Message, highlightWidthObj), - TCL_INDEX_NONE, 0, 0, 0}, + "HighlightThickness", DEF_MESSAGE_HIGHLIGHT_WIDTH, TCL_INDEX_NONE, + offsetof(Message, highlightWidth), 0, 0, 0}, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", DEF_MESSAGE_JUSTIFY, TCL_INDEX_NONE, offsetof(Message, justify), TK_OPTION_ENUM_VAR, 0, 0}, {TK_OPTION_PIXELS, "-padx", "padX", "Pad", DEF_MESSAGE_PADX, offsetof(Message, padXObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, @@ -154,11 +154,11 @@ DEF_MESSAGE_TEXT, offsetof(Message, stringObj), TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_STRING, "-textvariable", "textVariable", "Variable", DEF_MESSAGE_TEXT_VARIABLE, offsetof(Message, textVarNameObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-width", "width", "Width", - DEF_MESSAGE_WIDTH, offsetof(Message, widthObj), TCL_INDEX_NONE, 0, 0 ,0}, + DEF_MESSAGE_WIDTH, TCL_INDEX_NONE, offsetof(Message, width), 0, 0 ,0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; /* * Forward declarations for functions defined later in this file: @@ -437,11 +437,11 @@ int objc, /* Number of valid entries in argv. */ Tcl_Obj *const objv[], /* Arguments. */ TCL_UNUSED(int)) /* Flags to pass to Tk_ConfigureWidget. */ { Tk_SavedOptions savedOptions; - int width, borderWidth, highlightWidth, padX, padY; + int padX, padY; /* * Eliminate any existing trace on a variable monitored by the message. */ @@ -486,46 +486,41 @@ * A few other options need special processing, such as setting the * background from a 3-D border or handling special defaults that couldn't * be specified to Tk_ConfigureWidget. */ - Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->widthObj, &width); - if (width < 0) { - if (msgPtr->widthObj) { - Tcl_DecrRefCount(msgPtr->widthObj); - } - msgPtr->widthObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(msgPtr->widthObj); - } - Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->borderWidthObj, &borderWidth); - if (borderWidth < 0) { - if (msgPtr->borderWidthObj) { - Tcl_DecrRefCount(msgPtr->borderWidthObj); - } - msgPtr->borderWidthObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(msgPtr->borderWidthObj); - } - Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->highlightWidthObj, &highlightWidth); - if (highlightWidth < 0) { - if (msgPtr->highlightWidthObj) { - Tcl_DecrRefCount(msgPtr->highlightWidthObj); - } - msgPtr->highlightWidthObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(msgPtr->highlightWidthObj); - } - if (msgPtr->padXObj) { - Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padXObj, &padX); - if (padX < 0) { + if (msgPtr->width < 0) { + msgPtr->width = 0; + } + if (msgPtr->borderWidth < 0) { + msgPtr->borderWidth = 0; + } + if (msgPtr->highlightWidth < 0) { + msgPtr->highlightWidth = 0; + } + if (!msgPtr->padXObj) { + msgPtr->padXObj = Tcl_NewIntObj(-1); + Tcl_IncrRefCount(msgPtr->padXObj); + } + Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padXObj, &padX); + if (padX < 0) { + if (strcmp(Tcl_GetString(msgPtr->padXObj), "-1")) { Tcl_DecrRefCount(msgPtr->padXObj); - msgPtr->padXObj = NULL; + msgPtr->padXObj = Tcl_NewIntObj(-1); + Tcl_IncrRefCount(msgPtr->padXObj); } } - if (msgPtr->padYObj) { - Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padYObj, &padY); - if (padY < 0) { + if (!msgPtr->padYObj) { + msgPtr->padYObj = Tcl_NewIntObj(-1); + Tcl_IncrRefCount(msgPtr->padYObj); + } + Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padYObj, &padY); + if (padY < 0) { + if (strcmp(Tcl_GetString(msgPtr->padYObj), "-1")) { Tcl_DecrRefCount(msgPtr->padYObj); - msgPtr->padYObj = NULL; + msgPtr->padYObj = Tcl_NewIntObj(-1); + Tcl_IncrRefCount(msgPtr->padYObj); } } Tk_FreeSavedOptions(&savedOptions); MessageWorldChanged(msgPtr); @@ -606,31 +601,27 @@ Message *msgPtr) /* Information about window. */ { int width, inc, height; int thisWidth, thisHeight, maxWidth; int aspect, lowerBound, upperBound, inset; - int borderWidth, highlightWidth, padX, padY; + int padX, padY; Tk_FontMetrics fm; Tcl_Size numChars; Tk_FreeTextLayout(msgPtr->textLayout); Tk_GetFontMetrics(msgPtr->tkfont, &fm); - if (msgPtr->padXObj) { - Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padXObj, &padX); - } else { + Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padXObj, &padX); + if (padX < 0) { padX = fm.ascent / 2; } - if (msgPtr->padYObj) { - Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padYObj, &padY); - } else { + Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padYObj, &padY); + if (padY < 0) { padY = fm.ascent / 4; } - Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->borderWidthObj, &borderWidth); - Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->highlightWidthObj, &highlightWidth); - inset = borderWidth + highlightWidth; + inset = msgPtr->borderWidth + msgPtr->highlightWidth; /* * Compute acceptable bounds for the final aspect ratio. */ @@ -647,19 +638,19 @@ * Reduce the size of the change and iterate until dimensions are found * that approximate the desired aspect ratio. Or, if the user gave an * explicit width then just use that. */ - Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->widthObj, &width); + width = msgPtr->width; if (width > 0) { inc = 0; } else { width = WidthOfScreen(Tk_Screen(msgPtr->tkwin))/2; inc = width/2; } - numChars = Tcl_GetCharLength(msgPtr->stringObj); + numChars = TkGetCharLength(msgPtr->stringObj); for ( ; ; inc /= 2) { msgPtr->textLayout = Tk_ComputeTextLayout(msgPtr->tkfont, Tcl_GetString(msgPtr->stringObj), numChars, width, msgPtr->justify, 0, &thisWidth, &thisHeight); maxWidth = thisWidth + 2 * (inset + padX); @@ -706,37 +697,33 @@ void *clientData) /* Information about window. */ { Message *msgPtr = (Message *)clientData; Tk_Window tkwin = msgPtr->tkwin; int x, y; - int width, borderWidth, highlightWidth, padX, padY; + int width, padX, padY; Tk_FontMetrics fm; - Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->borderWidthObj, &borderWidth); - Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->highlightWidthObj, &highlightWidth); Tk_GetFontMetrics(msgPtr->tkfont, &fm); - if (msgPtr->padXObj) { - Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padXObj, &padX); - } else { + Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padXObj, &padX); + if (padX < 0) { padX = fm.ascent / 2; } - if (msgPtr->padYObj) { - Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padYObj, &padY); - } else { + Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padYObj, &padY); + if (padY < 0) { padY = fm.ascent / 4; } - width = highlightWidth; + width = msgPtr->highlightWidth; msgPtr->flags &= ~REDRAW_PENDING; if ((msgPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) { return; } if (msgPtr->border != NULL) { - width += borderWidth; + width += msgPtr->borderWidth; } if (msgPtr->relief == TK_RELIEF_FLAT) { - width = highlightWidth; + width = msgPtr->highlightWidth; } Tk_Fill3DRectangle(tkwin, Tk_WindowId(tkwin), msgPtr->border, width, width, Tk_Width(tkwin) - 2 * width, Tk_Height(tkwin) - 2 * width, @@ -750,27 +737,27 @@ TkComputeAnchor(msgPtr->anchor, tkwin, padX, padY, msgPtr->msgWidth, msgPtr->msgHeight, &x, &y); Tk_DrawTextLayout(Tk_Display(tkwin), Tk_WindowId(tkwin), msgPtr->textGC, msgPtr->textLayout, x, y, 0, -1); - if (width > highlightWidth) { + if (width > msgPtr->highlightWidth) { Tk_Draw3DRectangle(tkwin, Tk_WindowId(tkwin), msgPtr->border, - highlightWidth, highlightWidth, - Tk_Width(tkwin) - 2 * highlightWidth, - Tk_Height(tkwin) - 2 * highlightWidth, - borderWidth, msgPtr->relief); + msgPtr->highlightWidth, msgPtr->highlightWidth, + Tk_Width(tkwin) - 2 * msgPtr->highlightWidth, + Tk_Height(tkwin) - 2 * msgPtr->highlightWidth, + msgPtr->borderWidth, msgPtr->relief); } - if (highlightWidth > 0) { + if (msgPtr->highlightWidth > 0) { GC fgGC, bgGC; bgGC = Tk_GCForColor(msgPtr->highlightBgColorPtr, Tk_WindowId(tkwin)); if (msgPtr->flags & GOT_FOCUS) { fgGC = Tk_GCForColor(msgPtr->highlightColorPtr,Tk_WindowId(tkwin)); - Tk_DrawHighlightBorder(tkwin, fgGC, bgGC, highlightWidth, + Tk_DrawHighlightBorder(tkwin, fgGC, bgGC, msgPtr->highlightWidth, Tk_WindowId(tkwin)); } else { - Tk_DrawHighlightBorder(tkwin, bgGC, bgGC, highlightWidth, + Tk_DrawHighlightBorder(tkwin, bgGC, bgGC, msgPtr->highlightWidth, Tk_WindowId(tkwin)); } } } @@ -796,30 +783,27 @@ MessageEventProc( void *clientData, /* Information about window. */ XEvent *eventPtr) /* Information about event. */ { Message *msgPtr = (Message *)clientData; - int highlightWidth; if (((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) || (eventPtr->type == ConfigureNotify)) { goto redraw; } else if (eventPtr->type == DestroyNotify) { DestroyMessage(clientData); } else if (eventPtr->type == FocusIn) { if (eventPtr->xfocus.detail != NotifyInferior) { msgPtr->flags |= GOT_FOCUS; - Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->highlightWidthObj, &highlightWidth); - if (highlightWidth > 0) { + if (msgPtr->highlightWidth > 0) { goto redraw; } } } else if (eventPtr->type == FocusOut) { if (eventPtr->xfocus.detail != NotifyInferior) { msgPtr->flags &= ~GOT_FOCUS; - Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->highlightWidthObj, &highlightWidth); - if (highlightWidth > 0) { + if (msgPtr->highlightWidth > 0) { goto redraw; } } } return; Index: generic/tkObj.c ================================================================== --- generic/tkObj.c +++ generic/tkObj.c @@ -93,10 +93,39 @@ static ThreadSpecificData *GetTypeCache(void); static void UpdateStringOfMM(Tcl_Obj *objPtr); static int SetMMFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr); static int SetPixelFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr); static int SetWindowFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr); + +#if TCL_MAJOR_VERSION < 9 +#ifdef __cplusplus +extern "C" { +#endif +#if defined(USE_TCL_STUBS) +/* Little hack to eliminate the need for "tclInt.h" here: + Just copy a small portion of TclIntStubs, just + enough to make it work */ +typedef struct TclIntStubs { + int magic; + void *hooks; + void (*dummy[34]) (void); /* dummy entries 0-33, not used */ + int (*tclGetIntForIndex) (Tcl_Interp *interp, Tcl_Obj *objPtr, int endValue, int *indexPtr); /* 34 */ +} TclIntStubs; +extern const TclIntStubs *tclIntStubsPtr; + +# undef Tcl_GetIntForIndex +# define Tcl_GetIntForIndex(interp, obj, max, ptr) ((tclIntStubsPtr->tclGetIntForIndex == NULL)? \ + ((int (*)(Tcl_Interp*, Tcl_Obj *, int, int*))(void *)((&(tclStubsPtr->tcl_PkgProvideEx))[645]))((interp), (obj), (max), (ptr)): \ + tclIntStubsPtr->tclGetIntForIndex((interp), (obj), (max), (ptr))) +#elif defined(TCL_MINOR_VERSION) && (TCL_MINOR_VERSION < 7) +extern int TclGetIntForIndex(Tcl_Interp*, Tcl_Obj *, int, int*); +# define Tcl_GetIntForIndex(interp, obj, max, ptr) TclGetIntForIndex(interp, obj, max, ptr) +#endif +#ifdef __cplusplus +} +#endif +#endif /* * The following structure defines the implementation of the "pixel" Tcl * object, used for measuring distances. The pixel object remembers its * initial display-independent settings. Index: generic/tkOldConfig.c ================================================================== --- generic/tkOldConfig.c +++ generic/tkOldConfig.c @@ -59,11 +59,11 @@ * Results: * A standard Tcl return value. In case of an error, the interp's result * will hold an error message. * * Side effects: - * The fields of widgRec get filled in with information from objc/objv + * The fields of widgRec get filled in with information from argc/argv * and the option database. Old information in widgRec's fields gets * recycled. A copy of the spec-table is taken with (some of) the char* * fields converted into Tk_Uid fields; this copy will be released when * the interpreter terminates. * @@ -74,12 +74,12 @@ Tk_ConfigureWidget( Tcl_Interp *interp, /* Interpreter for error reporting. */ Tk_Window tkwin, /* Window containing widget (needed to set up * X resources). */ const Tk_ConfigSpec *specs, /* Describes legal options. */ - Tcl_Size objc, /* Number of elements in objv. */ - Tcl_Obj *const *objv, /* Command-line options. */ + Tcl_Size argc, /* Number of elements in argv. */ + const char **argv, /* Command-line options. */ void *widgRec, /* Record whose fields are to be modified. * Values must be properly initialized. */ int flags) /* Used to specify additional flags that must * be present in config specs for them to be * considered. Also, may have @@ -89,10 +89,11 @@ Tk_Uid value; /* Value of option from database. */ int needFlags; /* Specs must contain this set of flags or * else they are not considered. */ int hateFlags; /* If a spec contains any bits here, it's not * considered. */ + Tcl_Obj *obj; if (tkwin == NULL) { /* * Either we're not really in Tk, or the main window was destroyed and * we're on our way out of the application @@ -123,33 +124,57 @@ /* * Pass one: scan through all of the arguments, processing those that * match entries in the specs. */ - for ( ; objc > 0; objc -= 2, objv += 2) { + for ( ; argc > 0; argc -= 2, argv += 2) { const char *arg; - arg = Tcl_GetString(*objv); + if (flags & TK_CONFIG_OBJS) { + arg = Tcl_GetString((Tcl_Obj *)*argv); + } else { + arg = *argv; +#if defined(TK_NO_DEPRECATED) || (TK_MAJOR_VERSION > 8) + Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory"); +#endif + } specPtr = FindConfigSpec(interp, staticSpecs, arg, needFlags, hateFlags); if (specPtr == NULL) { return TCL_ERROR; } /* * Process the entry. */ - if (objc < 2) { + if (argc < 2) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "value for \"%s\" missing", arg)); Tcl_SetErrorCode(interp, "TK", "VALUE_MISSING", (char *)NULL); return TCL_ERROR; } - if (DoConfig(interp, tkwin, specPtr, objv[1], widgRec) != TCL_OK) { + if (flags & TK_CONFIG_OBJS) { + obj = (Tcl_Obj *)argv[1]; + arg = Tcl_GetString(obj); + } else { + arg = argv[1]; + obj = Tcl_NewStringObj(arg, TCL_INDEX_NONE); + Tcl_IncrRefCount(obj); +#if defined(TK_NO_DEPRECATED) || (TK_MAJOR_VERSION > 8) + Tcl_Panic("Flag TK_CONFIG_OBJS is mandatory"); +#endif + } + if (DoConfig(interp, tkwin, specPtr, obj, widgRec) != TCL_OK) { Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf( - "\n (processing \"%.40s\" option)",specPtr->argvName)); + "\n (processing \"%.40s\" option)", specPtr->argvName)); + if (!(flags & TK_CONFIG_OBJS)) { + Tcl_DecrRefCount(obj); + } return TCL_ERROR; + } + if (!(flags & TK_CONFIG_OBJS)) { + Tcl_DecrRefCount(obj); } if (!(flags & TK_CONFIG_ARGV_ONLY)) { specPtr->specFlags |= TK_CONFIG_OPTION_SPECIFIED; } } @@ -517,20 +542,26 @@ case TK_CONFIG_JOIN_STYLE: if (Tk_GetJoinStyle(interp, value, (int *)ptr) != TCL_OK) { return TCL_ERROR; } break; - case TK_CONFIG_PIXELS: + case TK_CONFIG_PIXELS: { + int nullOK = specPtr->specFlags & (TK_CONFIG_NULL_OK|TCL_NULL_OK|1); if (specPtr->specFlags & TK_CONFIG_OBJS) { int dummy; if (nullValue) { if (*(Tcl_Obj **)ptr != NULL) { Tcl_DecrRefCount(*(Tcl_Obj **)ptr); *(Tcl_Obj **)ptr = NULL; } - } else if (Tk_GetPixelsFromObj(interp, tkwin, arg, &dummy) + } else if (Tk_GetPixelsFromObj((nullOK ? NULL : interp), tkwin, arg, &dummy) != TCL_OK) { + wrongPixel: + if (interp && nullOK) { + Tcl_AppendResult(interp, "expected screen distance or \"\" but got \"", + Tcl_GetString(arg), "\"", (char *)NULL); + } return TCL_ERROR; } else { Tcl_IncrRefCount(arg); if (*(Tcl_Obj **)ptr != NULL) { Tcl_DecrRefCount(*(Tcl_Obj **)ptr); @@ -537,15 +568,16 @@ } *(Tcl_Obj **)ptr = arg; } } else if (nullValue) { *(int *)ptr = INT_MIN; - } else if (Tk_GetPixelsFromObj(interp, tkwin, arg, (int *)ptr) + } else if (Tk_GetPixelsFromObj((nullOK ? NULL : interp), tkwin, arg, (int *)ptr) != TCL_OK) { - return TCL_ERROR; + goto wrongPixel; } break; + } case TK_CONFIG_MM: if (Tk_GetScreenMM(interp, tkwin, value, (double *)ptr) != TCL_OK) { return TCL_ERROR; } break; ADDED generic/tkOldTest.c Index: generic/tkOldTest.c ================================================================== --- /dev/null +++ generic/tkOldTest.c @@ -0,0 +1,416 @@ +/* + * tkOldTest.c -- + * + * This file contains C command functions for additional Tcl + * commands that are used to test Tk's support for legacy + * interfaces. These commands are not normally included in Tcl/Tk + * applications; they're only used for testing. + * + * Copyright © 1993-1994 The Regents of the University of California. + * Copyright © 1994-1997 Sun Microsystems, Inc. + * Copyright © 1998-1999 Scriptics Corporation. + * Contributions by Don Porter, NIST, 2007. (not subject to US copyright) + * + * See the file "license.terms" for information on usage and redistribution of + * this file, and for a DISCLAIMER OF ALL WARRANTIES. + */ + +#define USE_OLD_IMAGE +#ifndef USE_TCL_STUBS +# define USE_TCL_STUBS +#endif +#ifndef USE_TK_STUBS +# define USE_TK_STUBS +#endif +#include "tkInt.h" + +#ifdef _WIN32 +#include "tkWinInt.h" +#endif + +#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9) +/* + * The following data structure represents the model for a test image: + */ + +typedef struct TImageModel { + Tk_ImageModel model; /* Tk's token for image model. */ + Tcl_Interp *interp; /* Interpreter for application. */ + int width, height; /* Dimensions of image. */ + char *imageName; /* Name of image (malloc-ed). */ + char *varName; /* Name of variable in which to log events for + * image (malloc-ed). */ +} TImageModel; + +/* + * The following data structure represents a particular use of a particular + * test image. + */ + +typedef struct TImageInstance { + TImageModel *modelPtr; /* Pointer to model for image. */ + XColor *fg; /* Foreground color for drawing in image. */ + GC gc; /* Graphics context for drawing in image. */ +} TImageInstance; + +/* + * The type record for test images: + */ + +static int ImageCreate(Tcl_Interp *interp, + char *name, Tcl_Size argc, char **argv, + Tk_ImageType *typePtr, Tk_ImageModel model, + void **clientDataPtr); +static void *ImageGet(Tk_Window tkwin, void *clientData); +static void ImageDisplay(void *clientData, + Display *display, Drawable drawable, + int imageX, int imageY, int width, + int height, int drawableX, + int drawableY); +static void ImageFree(void *clientData, Display *display); +static void ImageDelete(void *clientData); + +static Tk_ImageType imageType = { + "oldtest", /* name */ + (Tk_ImageCreateProc *) ImageCreate, /* createProc */ + ImageGet, /* getProc */ + ImageDisplay, /* displayProc */ + ImageFree, /* freeProc */ + ImageDelete, /* deleteProc */ + NULL, /* postscriptPtr */ + NULL, /* nextPtr */ + NULL +}; + +/* + * Forward declarations for functions defined later in this file: + */ + +static Tcl_ObjCmdProc ImageObjCmd; +#endif + +/* + *---------------------------------------------------------------------- + * + * TkOldTestInit -- + * + * This function performs initialization for the Tk test suite + * extensions for testing support for legacy interfaces. + * + * Results: + * Returns a standard Tcl completion code, and leaves an error message in + * the interp's result if an error occurs. + * + * Side effects: + * Creates several test commands. + * + *---------------------------------------------------------------------- + */ + +int +TkOldTestInit( + Tcl_Interp *dummy) +{ + static int initialized = 0; + (void)dummy; + + if (!initialized) { + initialized = 1; +#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9) + Tk_CreateImageType(&imageType); +#endif + } + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * + * ImageCreate -- + * + * This function is called by the Tk image code to create "oldtest" images. + * + * Results: + * A standard Tcl result. + * + * Side effects: + * The data structure for a new image is allocated. + * + *---------------------------------------------------------------------- + */ +#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9) +static int +ImageCreate( + Tcl_Interp *interp, /* Interpreter for application containing + * image. */ + char *name, /* Name to use for image. */ + Tcl_Size argc, /* Number of arguments. */ + char **argv, /* Argument strings for options (doesn't + * include image name or type). */ + Tk_ImageType *typePtr, /* Pointer to our type record (not used). */ + Tk_ImageModel model, /* Token for image, to be used by us in later + * callbacks. */ + void **clientDataPtr) /* Store manager's token for image here; it + * will be returned in later callbacks. */ +{ + TImageModel *timPtr; + const char *varName; + Tcl_Size i; + (void)typePtr; + + varName = "log"; + for (i = 0; i < argc; i += 2) { + if (strcmp(argv[i], "-variable") != 0) { + Tcl_AppendResult(interp, "bad option name \"", + argv[i], "\"", NULL); + return TCL_ERROR; + } + if ((i+1) == argc) { + Tcl_AppendResult(interp, "no value given for \"", + argv[i], "\" option", NULL); + return TCL_ERROR; + } + varName = argv[i+1]; + } + + timPtr = (TImageModel *)ckalloc(sizeof(TImageModel)); + timPtr->model = model; + timPtr->interp = interp; + timPtr->width = 30; + timPtr->height = 15; + timPtr->imageName = (char *)ckalloc(strlen(name) + 1); + strcpy(timPtr->imageName, name); + timPtr->varName = (char *)ckalloc(strlen(varName) + 1); + strcpy(timPtr->varName, varName); + Tcl_CreateObjCommand(interp, name, ImageObjCmd, timPtr, NULL); + *clientDataPtr = timPtr; + Tk_ImageChanged(model, 0, 0, 30, 15, 30, 15); + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * + * ImageObjCmd -- + * + * This function implements the commands corresponding to individual + * images. + * + * Results: + * A standard Tcl result. + * + * Side effects: + * Forces windows to be created. + * + *---------------------------------------------------------------------- + */ + +static int +ImageObjCmd( + void *clientData, /* Main window for application. */ + Tcl_Interp *interp, /* Current interpreter. */ + int objc, /* Number of arguments. */ + Tcl_Obj *const objv[]) /* Argument strings. */ +{ + TImageModel *timPtr = (TImageModel *)clientData; + int x, y, width, height; + + if (objc < 2) { + Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); + return TCL_ERROR; + } + if (strcmp(Tcl_GetString(objv[1]), "changed") == 0) { + if (objc != 8) { + Tcl_WrongNumArgs(interp, 1, objv, "changed x y width height" + " imageWidth imageHeight"); + return TCL_ERROR; + } + if ((Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK) + || (Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK) + || (Tcl_GetIntFromObj(interp, objv[4], &width) != TCL_OK) + || (Tcl_GetIntFromObj(interp, objv[5], &height) != TCL_OK) + || (Tcl_GetIntFromObj(interp, objv[6], &timPtr->width) != TCL_OK) + || (Tcl_GetIntFromObj(interp, objv[7], &timPtr->height) != TCL_OK)) { + return TCL_ERROR; + } + Tk_ImageChanged(timPtr->model, x, y, width, height, timPtr->width, + timPtr->height); + } else { + Tcl_AppendResult(interp, "bad option \"", Tcl_GetString(objv[1]), + "\": must be changed", NULL); + return TCL_ERROR; + } + return TCL_OK; +} + +/* + *---------------------------------------------------------------------- + * + * ImageGet -- + * + * This function is called by Tk to set things up for using a test image + * in a particular widget. + * + * Results: + * The return value is a token for the image instance, which is used in + * future callbacks to ImageDisplay and ImageFree. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +static void * +ImageGet( + Tk_Window tkwin, /* Token for window in which image will be + * used. */ + void *clientData) /* Pointer to TImageModel for image. */ +{ + TImageModel *timPtr = (TImageModel *)clientData; + TImageInstance *instPtr; + char buffer[100]; + XGCValues gcValues; + + snprintf(buffer, sizeof(buffer), "%s get", timPtr->imageName); + Tcl_SetVar2(timPtr->interp, timPtr->varName, NULL, buffer, + TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); + + instPtr = (TImageInstance *)ckalloc(sizeof(TImageInstance)); + instPtr->modelPtr = timPtr; + instPtr->fg = Tk_GetColor(timPtr->interp, tkwin, "#ff0000"); + gcValues.foreground = instPtr->fg->pixel; + instPtr->gc = Tk_GetGC(tkwin, GCForeground, &gcValues); + return instPtr; +} + +/* + *---------------------------------------------------------------------- + * + * ImageDisplay -- + * + * This function is invoked to redisplay part or all of an image in a + * given drawable. + * + * Results: + * None. + * + * Side effects: + * The image gets partially redrawn, as an "X" that shows the exact + * redraw area. + * + *---------------------------------------------------------------------- + */ + +static void +ImageDisplay( + void *clientData, /* Pointer to TImageInstance for image. */ + Display *display, /* Display to use for drawing. */ + Drawable drawable, /* Where to redraw image. */ + int imageX, int imageY, /* Origin of area to redraw, relative to + * origin of image. */ + int width, int height, /* Dimensions of area to redraw. */ + int drawableX, int drawableY) + /* Coordinates in drawable corresponding to + * imageX and imageY. */ +{ + TImageInstance *instPtr = (TImageInstance *)clientData; + char buffer[200 + TCL_INTEGER_SPACE * 6]; + + snprintf(buffer, sizeof(buffer), "%s display %d %d %d %d %d %d", + instPtr->modelPtr->imageName, imageX, imageY, width, height, + drawableX, drawableY); + Tcl_SetVar2(instPtr->modelPtr->interp, instPtr->modelPtr->varName, NULL, + buffer, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); + if (width > (instPtr->modelPtr->width - imageX)) { + width = instPtr->modelPtr->width - imageX; + } + if (height > (instPtr->modelPtr->height - imageY)) { + height = instPtr->modelPtr->height - imageY; + } + XDrawRectangle(display, drawable, instPtr->gc, drawableX, drawableY, + (unsigned) (width-1), (unsigned) (height-1)); + XDrawLine(display, drawable, instPtr->gc, drawableX, drawableY, + (int) (drawableX + width - 1), (int) (drawableY + height - 1)); + XDrawLine(display, drawable, instPtr->gc, drawableX, + (int) (drawableY + height - 1), + (int) (drawableX + width - 1), drawableY); +} + +/* + *---------------------------------------------------------------------- + * + * ImageFree -- + * + * This function is called when an instance of an image is no longer + * used. + * + * Results: + * None. + * + * Side effects: + * Information related to the instance is freed. + * + *---------------------------------------------------------------------- + */ + +static void +ImageFree( + void *clientData, /* Pointer to TImageInstance for instance. */ + Display *display) /* Display where image was to be drawn. */ +{ + TImageInstance *instPtr = (TImageInstance *)clientData; + char buffer[200]; + + snprintf(buffer, sizeof(buffer), "%s free", instPtr->modelPtr->imageName); + Tcl_SetVar2(instPtr->modelPtr->interp, instPtr->modelPtr->varName, NULL, + buffer, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); + Tk_FreeColor(instPtr->fg); + Tk_FreeGC(display, instPtr->gc); + ckfree(instPtr); +} + +/* + *---------------------------------------------------------------------- + * + * ImageDelete -- + * + * This function is called to clean up a test image when an application + * goes away. + * + * Results: + * None. + * + * Side effects: + * Information about the image is deleted. + * + *---------------------------------------------------------------------- + */ + +static void +ImageDelete( + void *clientData) /* Pointer to TImageModel for image. When + * this function is called, no more instances + * exist. */ +{ + TImageModel *timPtr = (TImageModel *)clientData; + char buffer[100]; + + snprintf(buffer, sizeof(buffer), "%s delete", timPtr->imageName); + Tcl_SetVar2(timPtr->interp, timPtr->varName, NULL, buffer, + TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); + + Tcl_DeleteCommand(timPtr->interp, timPtr->imageName); + ckfree(timPtr->imageName); + ckfree(timPtr->varName); + ckfree(timPtr); +} +#endif + +/* + * Local Variables: + * mode: c + * c-basic-offset: 4 + * fill-column: 78 + * End: + */ Index: generic/tkOption.c ================================================================== --- generic/tkOption.c +++ generic/tkOption.c @@ -1595,10 +1595,14 @@ Tcl_IncrRefCount(xdefaults); Tcl_ResetResult(interp); result = ReadOptionFile(interp, (Tk_Window)winPtr, Tcl_GetString(xdefaults), TK_USER_DEFAULT_PRIO); Tcl_DecrRefCount(xdefaults); + } else { + Tcl_ResetResult(interp); + result = ReadOptionFile(interp, (Tk_Window)winPtr, "~/.Xdefaults", + TK_USER_DEFAULT_PRIO); } return result; } /* Index: generic/tkPack.c ================================================================== --- generic/tkPack.c +++ generic/tkPack.c @@ -120,10 +120,14 @@ static void ArrangePacking(void *clientData); static int ConfigureContent(Tcl_Interp *interp, Tk_Window tkwin, int objc, Tcl_Obj *const objv[]); static Tcl_FreeProc DestroyPacker; static Packer * GetPacker(Tk_Window tkwin); +#ifndef TK_NO_DEPRECATED +static int PackAfter(Tcl_Interp *interp, Packer *prevPtr, + Packer *containerPtr, int objc,Tcl_Obj *const objv[]); +#endif /* !TK_NO_DEPRECATED */ static void PackStructureProc(void *clientData, XEvent *eventPtr); static void Unlink(Packer *packPtr); static int XExpansion(Packer *contentPtr, int cavityWidth); static int YExpansion(Packer *contentPtr, int cavityHeight); @@ -193,14 +197,20 @@ Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window tkwin = (Tk_Window)clientData; const char *argv2; static const char *const optionStrings[] = { +#ifndef TK_NO_DEPRECATED + "after", "append", "before", "unpack", +#endif /* !TK_NO_DEPRECATED */ "configure", "content", "forget", "info", "propagate", "slaves", NULL }; static const char *const optionStringsNoDep[] = { "configure", "content", "forget", "info", "propagate", NULL }; enum options { +#ifndef TK_NO_DEPRECATED + PACK_AFTER, PACK_APPEND, PACK_BEFORE, PACK_UNPACK, +#endif /* !TK_NO_DEPRECATED */ PACK_CONFIGURE, PACK_CONTENT, PACK_FORGET, PACK_INFO, PACK_PROPAGATE, PACK_SLAVES }; int index; if (objc >= 2) { const char *string = Tcl_GetString(objv[1]); @@ -227,15 +237,87 @@ return TCL_ERROR; } argv2 = Tcl_GetString(objv[2]); switch ((enum options) index) { +#ifndef TK_NO_DEPRECATED + case PACK_AFTER: { + Packer *prevPtr; + Tk_Window tkwin2; + + if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin2) != TCL_OK) { + return TCL_ERROR; + } + if (!(prevPtr = GetPacker(tkwin2))) { + return TCL_OK; + } + if (prevPtr->containerPtr == NULL) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "window \"%s\" isn't packed", argv2)); + Tcl_SetErrorCode(interp, "TK", "PACK", "NOT_PACKED", (char *)NULL); + return TCL_ERROR; + } + return PackAfter(interp, prevPtr, prevPtr->containerPtr, objc-3, objv+3); + } + case PACK_APPEND: { + Packer *containerPtr; + Packer *prevPtr; + Tk_Window tkwin2; + + if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin2) != TCL_OK) { + return TCL_ERROR; + } + if (!(containerPtr = GetPacker(tkwin2))) { + return TCL_OK; + } + prevPtr = containerPtr->contentPtr; + if (prevPtr != NULL) { + while (prevPtr->nextPtr != NULL) { + prevPtr = prevPtr->nextPtr; + } + } + return PackAfter(interp, prevPtr, containerPtr, objc-3, objv+3); + } + case PACK_BEFORE: { + Packer *packPtr, *containerPtr; + Packer *prevPtr; + Tk_Window tkwin2; + + if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin2) != TCL_OK) { + return TCL_ERROR; + } + if (!(packPtr = GetPacker(tkwin2))) { + return TCL_OK; + } + if (packPtr->containerPtr == NULL) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "window \"%s\" isn't packed", argv2)); + Tcl_SetErrorCode(interp, "TK", "PACK", "NOT_PACKED", (char *)NULL); + return TCL_ERROR; + } + containerPtr = packPtr->containerPtr; + prevPtr = containerPtr->contentPtr; + if (prevPtr == packPtr) { + prevPtr = NULL; + } else { + for ( ; ; prevPtr = prevPtr->nextPtr) { + if (prevPtr == NULL) { + Tcl_Panic("\"pack before\" couldn't find predecessor"); + } + if (prevPtr->nextPtr == packPtr) { + break; + } + } + } + return PackAfter(interp, prevPtr, containerPtr, objc-3, objv+3); + } +#endif /* !TK_NO_DEPRECATED */ case PACK_CONFIGURE: if (argv2[0] != '.') { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad argument \"%s\": must be name of window", argv2)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "WINDOW_PATH", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "WINDOW_PATH", (char *)NULL); return TCL_ERROR; } return ConfigureContent(interp, tkwin, objc-2, objv+2); case PACK_FORGET: { Tk_Window content; @@ -277,11 +359,11 @@ return TCL_OK; } if (contentPtr->containerPtr == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window \"%s\" isn't packed", argv2)); - Tcl_SetErrorCode(interp, "TK", "PACK", "NOT_PACKED", NULL); + Tcl_SetErrorCode(interp, "TK", "PACK", "NOT_PACKED", (char *)NULL); return TCL_ERROR; } infoObj = Tcl_NewObj(); Tcl_DictObjPut(NULL, infoObj, Tcl_NewStringObj("-in", TCL_INDEX_NONE), @@ -397,10 +479,35 @@ Tk_NewWindowObj(contentPtr->tkwin)); } Tcl_SetObjResult(interp, resultObj); break; } +#ifndef TK_NO_DEPRECATED + case PACK_UNPACK: { + Tk_Window tkwin2; + Packer *packPtr; + + if (objc != 3) { + Tcl_WrongNumArgs(interp, 2, objv, "window"); + return TCL_ERROR; + } + if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin2) != TCL_OK) { + return TCL_ERROR; + } + packPtr = GetPacker(tkwin2); + if (packPtr && (packPtr->containerPtr != NULL)) { + Tk_ManageGeometry(tkwin2, NULL, NULL); + if (packPtr->containerPtr->tkwin != Tk_Parent(packPtr->tkwin)) { + Tk_UnmaintainGeometry(packPtr->tkwin, + packPtr->containerPtr->tkwin); + } + Unlink(packPtr); + Tk_UnmapWindow(packPtr->tkwin); + } + break; + } +#endif /* !TK_NO_DEPRECATED */ } return TCL_OK; } @@ -987,10 +1094,254 @@ Tk_CreateEventHandler(tkwin, StructureNotifyMask, PackStructureProc, packPtr); return packPtr; } +/* + *------------------------------------------------------------------------ + * + * PackAfter -- + * + * This function does most of the real work of adding one or more windows + * into the packing order for its container. + * + * Results: + * A standard Tcl return value. + * + * Side effects: + * The geometry of the specified windows may change, both now and again + * in the future. + * + *------------------------------------------------------------------------ + */ + +#ifndef TK_NO_DEPRECATED +static int +PackAfter( + Tcl_Interp *interp, /* Interpreter for error reporting. */ + Packer *prevPtr, /* Pack windows in argv just after this + * window; NULL means pack as first child of + * containerPtr. */ + Packer *containerPtr, /* Container in which to pack windows. */ + int objc, /* Number of elements in objv. */ + Tcl_Obj *const objv[]) /* Array of lists, each containing 2 elements: + * window name and side against which to + * pack. */ +{ + Packer *packPtr; + Tk_Window tkwin, ancestor, parent; + Tcl_Obj **options; + int c; + Tcl_Size index, optionCount; + + /* + * Iterate over all of the window specifiers, each consisting of two + * arguments. The first argument contains the window name and the + * additional arguments contain options such as "top" or "padx 20". + */ + + for ( ; objc > 0; objc -= 2, objv += 2, prevPtr = packPtr) { + if (objc < 2) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "wrong # args: window \"%s\" should be followed by options", + Tcl_GetString(objv[0]))); + Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", (char *)NULL); + return TCL_ERROR; + } + + /* + * Find the packer for the window to be packed, and make sure that the + * window in which it will be packed is either its or a descendant of + * its parent. + */ + + if (TkGetWindowFromObj(interp, containerPtr->tkwin, objv[0], &tkwin) + != TCL_OK) { + return TCL_ERROR; + } + + parent = Tk_Parent(tkwin); + for (ancestor = containerPtr->tkwin; ; ancestor = Tk_Parent(ancestor)) { + if (ancestor == parent) { + break; + } + if (((Tk_FakeWin *) (ancestor))->flags & TK_TOP_HIERARCHY) { + badWindow: + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "can't pack \"%s\" inside \"%s\"", Tcl_GetString(objv[0]), + Tk_PathName(containerPtr->tkwin))); + Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "HIERARCHY", (char *)NULL); + return TCL_ERROR; + } + } + if (((Tk_FakeWin *) (tkwin))->flags & TK_TOP_HIERARCHY) { + goto badWindow; + } + if (tkwin == containerPtr->tkwin) { + goto badWindow; + } + if (!(packPtr = GetPacker(tkwin))) { + return TCL_OK; + } + + /* + * Process options for this window. + */ + + if (Tcl_ListObjGetElements(interp, objv[1], &optionCount, &options) + != TCL_OK) { + return TCL_ERROR; + } + packPtr->side = TOP; + packPtr->anchor = TK_ANCHOR_CENTER; + packPtr->padX = packPtr->padY = 0; + packPtr->padLeft = packPtr->padTop = 0; + packPtr->iPadX = packPtr->iPadY = 0; + packPtr->flags &= ~(FILLX|FILLY|EXPAND); + packPtr->flags |= OLD_STYLE; + for (index = 0 ; index < optionCount; index++) { + Tcl_Obj *curOptPtr = options[index]; + Tcl_Size length; + const char *curOpt = Tcl_GetStringFromObj(curOptPtr, &length); + + c = curOpt[0]; + + if ((c == 't') + && (strncmp(curOpt, "top", length)) == 0) { + packPtr->side = TOP; + } else if ((c == 'b') + && (strncmp(curOpt, "bottom", length)) == 0) { + packPtr->side = BOTTOM; + } else if ((c == 'l') + && (strncmp(curOpt, "left", length)) == 0) { + packPtr->side = LEFT; + } else if ((c == 'r') + && (strncmp(curOpt, "right", length)) == 0) { + packPtr->side = RIGHT; + } else if ((c == 'e') + && (strncmp(curOpt, "expand", length)) == 0) { + packPtr->flags |= EXPAND; + } else if ((c == 'f') + && (strcmp(curOpt, "fill")) == 0) { + packPtr->flags |= FILLX|FILLY; + } else if ((length == 5) && (strcmp(curOpt, "fillx")) == 0) { + packPtr->flags |= FILLX; + } else if ((length == 5) && (strcmp(curOpt, "filly")) == 0) { + packPtr->flags |= FILLY; + } else if ((c == 'p') && (strcmp(curOpt, "padx")) == 0) { + if (optionCount <= (index+1)) { + missingPad: + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "wrong # args: \"%s\" option must be" + " followed by screen distance", curOpt)); + Tcl_SetErrorCode(interp, "TK", "OLDPACK", "BAD_PARAMETER", + (char *)NULL); + return TCL_ERROR; + } + if (TkParsePadAmount(interp, tkwin, options[index+1], + &packPtr->padLeft, &packPtr->padX) != TCL_OK) { + return TCL_ERROR; + } + packPtr->padX /= 2; + packPtr->padLeft /= 2; + packPtr->iPadX = 0; + index++; + } else if ((c == 'p') && (strcmp(curOpt, "pady")) == 0) { + if (optionCount <= (index+1)) { + goto missingPad; + } + if (TkParsePadAmount(interp, tkwin, options[index+1], + &packPtr->padTop, &packPtr->padY) != TCL_OK) { + return TCL_ERROR; + } + packPtr->padY /= 2; + packPtr->padTop /= 2; + packPtr->iPadY = 0; + index++; + } else if ((c == 'f') && (length > 1) + && (strncmp(curOpt, "frame", length) == 0)) { + if (optionCount <= (index+1)) { + Tcl_SetObjResult(interp, Tcl_NewStringObj( + "wrong # args: \"frame\"" + " option must be followed by anchor point", TCL_INDEX_NONE)); + Tcl_SetErrorCode(interp, "TK", "OLDPACK", "BAD_PARAMETER", + (char *)NULL); + return TCL_ERROR; + } + if (Tk_GetAnchorFromObj(interp, options[index+1], + &packPtr->anchor) != TCL_OK) { + return TCL_ERROR; + } + index++; + } else { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "bad option \"%s\": should be top, bottom, left," + " right, expand, fill, fillx, filly, padx, pady, or" + " frame", curOpt)); + Tcl_SetErrorCode(interp, "TK", "OLDPACK", "BAD_PARAMETER", + (char *)NULL); + return TCL_ERROR; + } + } + + if (packPtr != prevPtr) { + /* + * Unpack this window if it's currently packed. + */ + + if (packPtr->containerPtr != NULL) { + if ((packPtr->containerPtr != containerPtr) && + (packPtr->containerPtr->tkwin + != Tk_Parent(packPtr->tkwin))) { + Tk_UnmaintainGeometry(packPtr->tkwin, + packPtr->containerPtr->tkwin); + } + Unlink(packPtr); + } + + /* + * Add the window in the correct place in its container's packing + * order, then make sure that the window is managed by us. + */ + + packPtr->containerPtr = containerPtr; + if (prevPtr == NULL) { + packPtr->nextPtr = containerPtr->contentPtr; + containerPtr->contentPtr = packPtr; + } else { + packPtr->nextPtr = prevPtr->nextPtr; + prevPtr->nextPtr = packPtr; + } + Tk_ManageGeometry(tkwin, &packerType, packPtr); + + if (!(containerPtr->flags & DONT_PROPAGATE)) { + if (TkSetGeometryContainer(interp, containerPtr->tkwin, "pack") + != TCL_OK) { + Tk_ManageGeometry(tkwin, NULL, NULL); + Unlink(packPtr); + return TCL_ERROR; + } + containerPtr->flags |= ALLOCED_CONTAINER; + } + } + } + + /* + * Arrange for the container to be re-packed at the first idle moment. + */ + + if (containerPtr->abortPtr != NULL) { + *containerPtr->abortPtr = 1; + } + if (!(containerPtr->flags & REQUESTED_REPACK)) { + containerPtr->flags |= REQUESTED_REPACK; + Tcl_DoWhenIdle(ArrangePacking, containerPtr); + } + return TCL_OK; +} +#endif /* !TK_NO_DEPRECATED */ + /* *---------------------------------------------------------------------- * * Unlink -- * @@ -1254,11 +1605,11 @@ } if (Tk_TopWinHierarchy(content)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't pack \"%s\": it's a top-level window", Tcl_GetString(objv[j]))); - Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "TOPLEVEL", NULL); + Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "TOPLEVEL", (char *)NULL); return TCL_ERROR; } if (!(contentPtr = GetPacker(content))) { continue; } @@ -1283,11 +1634,11 @@ for (i = numWindows; i < objc; i+=2) { if ((i+2) > objc) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "extra option \"%s\" (option with no value?)", Tcl_GetString(objv[i]))); - Tcl_SetErrorCode(interp, "TK", "PACK", "BAD_PARAMETER", NULL); + Tcl_SetErrorCode(interp, "TK", "PACK", "BAD_PARAMETER", (char *)NULL); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[i], optionStrings, "option", 0, &index) != TCL_OK) { return TCL_ERROR; @@ -1307,11 +1658,11 @@ notPacked: Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window \"%s\" isn't packed", Tcl_GetString(objv[i+1]))); Tcl_SetErrorCode(interp, "TK", "PACK", "NOT_PACKED", - NULL); + (char *)NULL); return TCL_ERROR; } containerPtr = prevPtr->containerPtr; positionGiven = 1; } @@ -1367,11 +1718,11 @@ contentPtr->flags |= FILLX|FILLY; } else { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad fill style \"%s\": must be " "none, x, y, or both", string)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "FILL", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "FILL", (char *)NULL); return TCL_ERROR; } break; case CONF_IN: if (j == 0) { @@ -1395,11 +1746,11 @@ if ((Tk_GetPixelsFromObj(interp, content, objv[i+1], &tmp) != TCL_OK) || (tmp < 0)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad ipadx value \"%s\": must be positive screen" " distance", Tcl_GetString(objv[i+1]))); - Tcl_SetErrorCode(interp, "TK", "VALUE", "INT_PAD", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "INT_PAD", (char *)NULL); return TCL_ERROR; } contentPtr->iPadX = tmp * 2; break; case CONF_IPADY: @@ -1406,11 +1757,11 @@ if ((Tk_GetPixelsFromObj(interp, content, objv[i+1], &tmp) != TCL_OK) || (tmp < 0)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad ipady value \"%s\": must be positive screen" " distance", Tcl_GetString(objv[i+1]))); - Tcl_SetErrorCode(interp, "TK", "VALUE", "INT_PAD", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "INT_PAD", (char *)NULL); return TCL_ERROR; } contentPtr->iPadY = tmp * 2; break; case CONF_PADX: @@ -1488,18 +1839,18 @@ } if (Tk_TopWinHierarchy(ancestor)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't pack \"%s\" inside \"%s\"", Tcl_GetString(objv[j]), Tk_PathName(containerPtr->tkwin))); - Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "HIERARCHY", NULL); + Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "HIERARCHY", (char *)NULL); return TCL_ERROR; } } if (content == containerPtr->tkwin) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't pack \"%s\" inside itself", Tcl_GetString(objv[j]))); - Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "SELF", NULL); + Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "SELF", (char *)NULL); return TCL_ERROR; } /* * Check for management loops. @@ -1509,11 +1860,11 @@ container = (TkWindow *)TkGetContainer(container)) { if (container == (TkWindow *)content) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't put \"%s\" inside \"%s\": would cause management loop", Tcl_GetString(objv[j]), Tk_PathName(containerPtr->tkwin))); - Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "LOOP", NULL); + Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "LOOP", (char *)NULL); return TCL_ERROR; } } if (containerPtr->tkwin != Tk_Parent(content)) { ((TkWindow *)content)->maintainerPtr = (TkWindow *)containerPtr->tkwin; Index: generic/tkPanedWindow.c ================================================================== --- generic/tkPanedWindow.c +++ generic/tkPanedWindow.c @@ -18,11 +18,11 @@ /* * Flag values for "sticky"ness. The 16 combinations subsume the packer's * notion of anchor and fill. * - * STICK_NORTH This window sticks to the top of its cavity. + * STICK_NORTH This window sticks to the top of its cavity. * STICK_EAST This window sticks to the right edge of its cavity. * STICK_SOUTH This window sticks to the bottom of its cavity. * STICK_WEST This window sticks to the left edge of its cavity. */ @@ -78,15 +78,15 @@ * managed by a paned window widget. */ typedef struct Pane { Tk_Window tkwin; /* Window being managed. */ - Tcl_Obj *minSizeObj; /* Minimum size of this pane, on the relevant + int minSize; /* Minimum size of this pane, on the relevant * axis, in pixels. */ - Tcl_Obj *padXObj; /* Additional padding requested for pane, in + int padx; /* Additional padding requested for pane, in * the x dimension. */ - Tcl_Obj *padYObj; /* Additional padding requested for pane, in + int pady; /* Additional padding requested for pane, in * the y dimension. */ Tcl_Obj *widthObj, *heightObj; /* Tcl_Obj rep's of pane width/height, to * allow for null values. */ int width; /* Pane width. */ @@ -104,14 +104,10 @@ int hide; /* Controls visibility of pane */ struct PanedWindow *containerPtr; /* Paned window managing the window. */ Tk_Window after; /* Placeholder for parsing options. */ Tk_Window before; /* Placeholder for parsing options. */ -#ifdef BUILD_tk - int padX, padY; - int minSize; -#endif } Pane; /* * A data structure of the following type is kept for each paned window widget * managed by this file: @@ -157,12 +153,10 @@ int proxyRelief; /* Relief used to draw proxy, if TK_RELIEF_NULL then use relief. */ Pane **panes; /* Pointer to array of Panes. */ int numPanes; /* Number of panes. */ int sizeofPanes; /* Number of elements in the panes array. */ int flags; /* Flags for widget; see below. */ - Tcl_Obj *borderWidthObj; - Tcl_Obj *handlePadPtr; } PanedWindow; /* * Flags used for paned windows: * @@ -283,17 +277,17 @@ {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_PANEDWINDOW_BORDERWIDTH, offsetof(PanedWindow, borderWidthObj), offsetof(PanedWindow, borderWidth), + DEF_PANEDWINDOW_BORDERWIDTH, TCL_INDEX_NONE, offsetof(PanedWindow, borderWidth), 0, 0, GEOMETRY}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", DEF_PANEDWINDOW_CURSOR, TCL_INDEX_NONE, offsetof(PanedWindow, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-handlepad", "handlePad", "HandlePad", - DEF_PANEDWINDOW_HANDLEPAD, offsetof(PanedWindow, handlePadPtr), offsetof(PanedWindow, handlePad), + DEF_PANEDWINDOW_HANDLEPAD, TCL_INDEX_NONE, offsetof(PanedWindow, handlePad), 0, 0, GEOMETRY}, {TK_OPTION_PIXELS, "-handlesize", "handleSize", "HandleSize", DEF_PANEDWINDOW_HANDLESIZE, offsetof(PanedWindow, handleSizePtr), offsetof(PanedWindow, handleSize), 0, 0, GEOMETRY}, {TK_OPTION_PIXELS, "-height", "height", "Height", @@ -318,11 +312,11 @@ DEF_PANEDWINDOW_RELIEF, TCL_INDEX_NONE, offsetof(PanedWindow, relief), 0, 0, 0}, {TK_OPTION_CURSOR, "-sashcursor", "sashCursor", "Cursor", DEF_PANEDWINDOW_SASHCURSOR, TCL_INDEX_NONE, offsetof(PanedWindow, sashCursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-sashpad", "sashPad", "SashPad", - DEF_PANEDWINDOW_SASHPAD, offsetof(PanedWindow, sashPadPtr), offsetof(PanedWindow, sashPad), + DEF_PANEDWINDOW_SASHPAD, TCL_INDEX_NONE, offsetof(PanedWindow, sashPad), 0, 0, GEOMETRY}, {TK_OPTION_RELIEF, "-sashrelief", "sashRelief", "Relief", DEF_PANEDWINDOW_SASHRELIEF, TCL_INDEX_NONE, offsetof(PanedWindow, sashRelief), 0, 0, 0}, {TK_OPTION_PIXELS, "-sashwidth", "sashWidth", "Width", @@ -348,15 +342,15 @@ DEF_PANEDWINDOW_PANE_HEIGHT, offsetof(Pane, heightObj), offsetof(Pane, height), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-hide", "hide", "Hide", DEF_PANEDWINDOW_PANE_HIDE, TCL_INDEX_NONE, offsetof(Pane, hide), 0,0,GEOMETRY}, {TK_OPTION_PIXELS, "-minsize", NULL, NULL, - DEF_PANEDWINDOW_PANE_MINSIZE, offsetof(Pane, minSizeObj), offsetof(Pane, minSize), 0, 0, 0}, + DEF_PANEDWINDOW_PANE_MINSIZE, TCL_INDEX_NONE, offsetof(Pane, minSize), 0, 0, 0}, {TK_OPTION_PIXELS, "-padx", NULL, NULL, - DEF_PANEDWINDOW_PANE_PADX, offsetof(Pane, padXObj), offsetof(Pane, padX), 0, 0, 0}, + DEF_PANEDWINDOW_PANE_PADX, TCL_INDEX_NONE, offsetof(Pane, padx), 0, 0, 0}, {TK_OPTION_PIXELS, "-pady", NULL, NULL, - DEF_PANEDWINDOW_PANE_PADY, offsetof(Pane, padYObj), offsetof(Pane, padY), 0, 0, 0}, + DEF_PANEDWINDOW_PANE_PADY, TCL_INDEX_NONE, offsetof(Pane, pady), 0, 0, 0}, {TK_OPTION_CUSTOM, "-sticky", NULL, NULL, DEF_PANEDWINDOW_PANE_STICKY, TCL_INDEX_NONE, offsetof(Pane, sticky), 0, &stickyOption, 0}, {TK_OPTION_STRING_TABLE, "-stretch", "stretch", "Stretch", DEF_PANEDWINDOW_PANE_STRETCH, TCL_INDEX_NONE, offsetof(Pane, stretch), @@ -802,20 +796,20 @@ /* * A panedwindow cannot manage itself. */ Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "cannot add %s to itself", arg)); + "can't add %s to itself", arg)); Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "SELF", (char *)NULL); return TCL_ERROR; } else if (Tk_IsTopLevel(tkwin)) { /* * A panedwindow cannot manage a toplevel. */ Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "cannot add toplevel %s to %s", arg, + "can't add toplevel %s to %s", arg, Tk_PathName(pwPtr->tkwin))); Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "TOPLEVEL", (char *)NULL); return TCL_ERROR; } else { /* @@ -828,11 +822,11 @@ if (ancestor == parent) { break; } if (Tk_IsTopLevel(ancestor)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "cannot add %s to %s", arg, + "can't add %s to %s", arg, Tk_PathName(pwPtr->tkwin))); Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "HIERARCHY", (char *)NULL); return TCL_ERROR; } @@ -953,11 +947,11 @@ } /* * Make sure this pane wasn't already put into the inserts array, * i.e., when the user specifies the same window multiple times in a - * single add command. + * single add commaned. */ for (j = 0; j < insertIndex; j++) { if (inserts[j]->tkwin == tkwin) { found = 1; break; @@ -1798,18 +1792,18 @@ if (panePtr->width > 0) { paneSize = panePtr->width; } else { paneSize = panePtr->paneWidth; } - stretchReserve -= paneSize + (2 * panePtr->padX); + stretchReserve -= paneSize + (2 * panePtr->padx); } else { if (panePtr->height > 0) { paneSize = panePtr->height; } else { paneSize = panePtr->paneHeight; } - stretchReserve -= paneSize + (2 * panePtr->padY); + stretchReserve -= paneSize + (2 * panePtr->pady); } if (IsStretchable(panePtr->stretch,i,first,last) && Tk_IsMapped(pwPtr->tkwin)) { paneDynSize += paneSize; paneDynMinSize += panePtr->minSize; @@ -1903,13 +1897,13 @@ stretchReserve = paneDynMinSize - paneDynSize; } } if (horizontal) { paneWidth = paneSize; - paneHeight = pwHeight - (2 * panePtr->padY); + paneHeight = pwHeight - (2 * panePtr->pady); } else { - paneWidth = pwWidth - (2 * panePtr->padX); + paneWidth = pwWidth - (2 * panePtr->padx); paneHeight = paneSize; } /* * Adjust for area reserved for sashes. @@ -1949,21 +1943,21 @@ * Compute the location of the sash at the right or bottom of the * parcel and the location of the next parcel. */ if (horizontal) { - x += paneWidth + (2 * panePtr->padX); + x += paneWidth + (2 * panePtr->padx); if (x < internalBW) { x = internalBW; } panePtr->sashx = x + sashOffset; panePtr->sashy = y; panePtr->handlex = x + handleOffset; panePtr->handley = y + pwPtr->handlePad; x += sashWidth; } else { - y += paneHeight + (2 * panePtr->padY); + y += paneHeight + (2 * panePtr->pady); if (y < internalBW) { y = internalBW; } panePtr->sashx = x; panePtr->sashy = y + sashOffset; @@ -1979,12 +1973,12 @@ paneX = panePtr->x; paneY = panePtr->y; AdjustForSticky(panePtr->sticky, paneWidth, paneHeight, &paneX, &paneY, &newPaneWidth, &newPaneHeight); - paneX += panePtr->padX; - paneY += panePtr->padY; + paneX += panePtr->padx; + paneY += panePtr->pady; /* * Now put the window in the proper spot. */ @@ -2262,18 +2256,18 @@ * Compute the location of the sash at the right or bottom of the * parcel. */ if (horizontal) { - x += panePtr->paneWidth + (2 * panePtr->padX); + x += panePtr->paneWidth + (2 * panePtr->padx); panePtr->sashx = x + sashOffset; panePtr->sashy = y; panePtr->handlex = x + handleOffset; panePtr->handley = y + pwPtr->handlePad; x += sashWidth; } else { - y += panePtr->paneHeight + (2 * panePtr->padY); + y += panePtr->paneHeight + (2 * panePtr->pady); panePtr->sashx = x; panePtr->sashy = y + sashOffset; panePtr->handlex = x + pwPtr->handlePad; panePtr->handley = y + handleOffset; y += sashWidth; @@ -2294,11 +2288,11 @@ dim = panePtr->height; } else { doubleBw = 2 * Tk_Changes(panePtr->tkwin)->border_width; dim = Tk_ReqHeight(panePtr->tkwin) + doubleBw; } - dim += 2 * panePtr->padY; + dim += 2 * panePtr->pady; if (dim > reqHeight) { reqHeight = dim; } } else { /* @@ -2310,11 +2304,11 @@ dim = panePtr->width; } else { doubleBw = 2 * Tk_Changes(panePtr->tkwin)->border_width; dim = Tk_ReqWidth(panePtr->tkwin) + doubleBw; } - dim += 2 * panePtr->padX; + dim += 2 * panePtr->padx; if (dim > reqWidth) { reqWidth = dim; } } } @@ -2639,14 +2633,14 @@ if (panePtr->hide) { continue; } if (horizontal) { panePtr->paneWidth = panePtr->width = panePtr->sashx - - sashOffset - panePtr->x - (2 * panePtr->padX); + - sashOffset - panePtr->x - (2 * panePtr->padx); } else { panePtr->paneHeight = panePtr->height = panePtr->sashy - - sashOffset - panePtr->y - (2 * panePtr->padY); + - sashOffset - panePtr->y - (2 * panePtr->pady); } } /* * There must be a next sash since it is only possible to enter this Index: generic/tkPkgConfig.c ================================================================== --- generic/tkPkgConfig.c +++ generic/tkPkgConfig.c @@ -12,13 +12,24 @@ */ /* Note, the definitions in this module are influenced by the following C * preprocessor macros: * + * OSCMa = shortcut for "old style configuration macro activates" + * NSCMdt = shortcut for "new style configuration macro declares that" + * + * - TCL_THREADS OSCMa compilation as threaded. + * - TCL_MEM_DEBUG OSCMa memory debugging. + * + * - TCL_CFG_DO64BIT NSCMdt tk is compiled for a 64bit system. + * - NDEBUG NSCMdt tk is compiled with symbol info off. + * - TCL_CFG_OPTIMIZED NSCMdt tk is compiled with cc optimizations on + * - TCL_CFG_PROFILED NSCMdt tk is compiled with profiling info. + * * - _WIN32 || __CYGWIN__ The value for the fontsytem key will be * MAC_OSX_TK chosen based on these macros/defines. - * HAVE_XFT declares that xft font support was requested. + * HAVE_XFT NSCMdt xft font support was requested. * * - CFG_RUNTIME_* Paths to various stuff at runtime. * - CFG_INSTALL_* Paths to various stuff at installation time. * * - TCL_CFGVAL_ENCODING string containing the encoding used for the @@ -34,10 +45,46 @@ /* * Use C preprocessor statements to define the various values for the embedded * configuration information. */ + +#ifdef TCL_THREADS +# define CFG_THREADED "1" +#else +# define CFG_THREADED "0" +#endif + +#ifdef TCL_MEM_DEBUG +# define CFG_MEMDEBUG "1" +#else +# define CFG_MEMDEBUG "0" +#endif + +#ifdef TCL_CFG_DO64BIT +# define CFG_64 "1" +#else +# define CFG_64 "0" +#endif + +#ifndef NDEBUG +# define CFG_DEBUG "1" +#else +# define CFG_DEBUG "0" +#endif + +#ifdef TCL_CFG_OPTIMIZED +# define CFG_OPTIMIZED "1" +#else +# define CFG_OPTIMIZED "0" +#endif + +#ifdef TCL_CFG_PROFILED +# define CFG_PROFILED "1" +#else +# define CFG_PROFILED "0" +#endif #if defined(_WIN32) # define CFG_FONTSYSTEM "gdi" #elif defined(MAC_OSX_TK) # define CFG_FONTSYSTEM "cocoa" @@ -46,10 +93,18 @@ #else # define CFG_FONTSYSTEM "x11" #endif static const Tcl_Config cfg[] = { +#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 + {"debug", CFG_DEBUG}, + {"threaded", CFG_THREADED}, + {"profiled", CFG_PROFILED}, + {"64bit", CFG_64}, + {"optimized", CFG_OPTIMIZED}, + {"mem_debug", CFG_MEMDEBUG}, +#endif {"fontsystem", CFG_FONTSYSTEM}, /* Runtime paths to various stuff */ #ifdef CFG_RUNTIME_LIBDIR Index: generic/tkPlatDecls.h ================================================================== --- generic/tkPlatDecls.h +++ generic/tkPlatDecls.h @@ -44,19 +44,27 @@ EXTERN HINSTANCE Tk_GetHINSTANCE(void); /* 2 */ EXTERN HWND Tk_GetHWND(Window window); /* 3 */ EXTERN Tk_Window Tk_HWNDToWindow(HWND hwnd); +/* 4 */ +EXTERN void Tk_PointerEvent(HWND hwnd, int x, int y); +/* 5 */ +EXTERN int Tk_TranslateWinEvent(HWND hwnd, UINT message, + WPARAM wParam, LPARAM lParam, + LRESULT *result); #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ /* Slot 0 is reserved */ /* Slot 1 is reserved */ /* Slot 2 is reserved */ /* Slot 3 is reserved */ /* 4 */ EXTERN void TkMacOSXInitAppleEvents(Tcl_Interp *interp); -/* Slot 5 is reserved */ +/* 5 */ +EXTERN void TkGenWMConfigureEvent_(Tk_Window tkwin, int x, int y, + int width, int height, int flags); /* 6 */ EXTERN void TkMacOSXInvalClipRgns(Tk_Window tkwin); /* Slot 7 is reserved */ /* 8 */ EXTERN void * TkMacOSXGetRootControl(Drawable drawable); @@ -84,18 +92,20 @@ #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ Window (*tk_AttachHWND) (Tk_Window tkwin, HWND hwnd); /* 0 */ HINSTANCE (*tk_GetHINSTANCE) (void); /* 1 */ HWND (*tk_GetHWND) (Window window); /* 2 */ Tk_Window (*tk_HWNDToWindow) (HWND hwnd); /* 3 */ + void (*tk_PointerEvent) (HWND hwnd, int x, int y); /* 4 */ + int (*tk_TranslateWinEvent) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result); /* 5 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ void (*reserved0)(void); void (*reserved1)(void); void (*reserved2)(void); void (*reserved3)(void); void (*tkMacOSXInitAppleEvents) (Tcl_Interp *interp); /* 4 */ - void (*reserved5)(void); + void (*tkGenWMConfigureEvent_) (Tk_Window tkwin, int x, int y, int width, int height, int flags); /* 5 */ void (*tkMacOSXInvalClipRgns) (Tk_Window tkwin); /* 6 */ void (*reserved7)(void); void * (*tkMacOSXGetRootControl) (Drawable drawable); /* 8 */ void (*tk_MacOSXSetupTkNotifier) (void); /* 9 */ int (*tk_MacOSXIsAppInFront) (void); /* 10 */ @@ -127,19 +137,24 @@ (tkPlatStubsPtr->tk_GetHINSTANCE) /* 1 */ #define Tk_GetHWND \ (tkPlatStubsPtr->tk_GetHWND) /* 2 */ #define Tk_HWNDToWindow \ (tkPlatStubsPtr->tk_HWNDToWindow) /* 3 */ +#define Tk_PointerEvent \ + (tkPlatStubsPtr->tk_PointerEvent) /* 4 */ +#define Tk_TranslateWinEvent \ + (tkPlatStubsPtr->tk_TranslateWinEvent) /* 5 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ /* Slot 0 is reserved */ /* Slot 1 is reserved */ /* Slot 2 is reserved */ /* Slot 3 is reserved */ #define TkMacOSXInitAppleEvents \ (tkPlatStubsPtr->tkMacOSXInitAppleEvents) /* 4 */ -/* Slot 5 is reserved */ +#define TkGenWMConfigureEvent_ \ + (tkPlatStubsPtr->tkGenWMConfigureEvent_) /* 5 */ #define TkMacOSXInvalClipRgns \ (tkPlatStubsPtr->tkMacOSXInvalClipRgns) /* 6 */ /* Slot 7 is reserved */ #define TkMacOSXGetRootControl \ (tkPlatStubsPtr->tkMacOSXGetRootControl) /* 8 */ @@ -168,8 +183,9 @@ #endif #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT +#undef TkGenWMConfigureEvent_ #define Tk_MacOSXGetNSViewForDrawable TkMacOSXGetRootControl #endif /* _TKPLATDECLS */ Index: generic/tkPointer.c ================================================================== --- generic/tkPointer.c +++ generic/tkPointer.c @@ -414,20 +414,27 @@ int XGrabPointer( Display *display, Window grab_window, - TCL_UNUSED(Bool), /* owner_events */ - TCL_UNUSED(unsigned int), /* event_mask */ - TCL_UNUSED(int), /* pointer_mode */ - TCL_UNUSED(int), /* keyboard_mode */ - TCL_UNUSED(Window), /* confine_to */ - TCL_UNUSED(Cursor), /* cursor */ - TCL_UNUSED(Time)) /* time */ + Bool owner_events, + unsigned int event_mask, + int pointer_mode, + int keyboard_mode, + Window confine_to, + Cursor cursor, + Time time) { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + (void)owner_events; + (void)event_mask; + (void)pointer_mode; + (void)keyboard_mode; + (void)confine_to; + (void)cursor; + (void)time; LastKnownRequestProcessed(display)++; tsdPtr->grabWinPtr = (TkWindow *) Tk_IdToWindow(display, grab_window); tsdPtr->restrictWinPtr = NULL; TkpSetCapture(tsdPtr->grabWinPtr); @@ -455,14 +462,15 @@ */ int XUngrabPointer( Display *display, - TCL_UNUSED(Time)) /* time */ + Time time) { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + (void)time; LastKnownRequestProcessed(display)++; tsdPtr->grabWinPtr = NULL; tsdPtr->restrictWinPtr = NULL; TkpSetCapture(NULL); @@ -578,15 +586,16 @@ int XDefineCursor( Display *display, Window w, - TCL_UNUSED(Cursor)) /* cursor */ + Cursor cursor) { TkWindow *winPtr = (TkWindow *) Tk_IdToWindow(display, w); ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + (void)cursor; if (tsdPtr->cursorWinPtr == winPtr) { UpdateCursor(winPtr); } LastKnownRequestProcessed(display)++; Index: generic/tkRectOval.c ================================================================== --- generic/tkRectOval.c +++ generic/tkRectOval.c @@ -77,12 +77,12 @@ TK_CONFIG_DONT_SET_DEFAULT, &pixelOption}, {TK_CONFIG_CUSTOM, "-dash", NULL, NULL, NULL, offsetof(RectOvalItem, outline.dash), TK_CONFIG_NULL_OK, &dashOption}, {TK_CONFIG_PIXELS, "-dashoffset", NULL, NULL, - "0", offsetof(RectOvalItem, outline.offsetObj), - TK_CONFIG_OBJS, NULL}, + "0", offsetof(RectOvalItem, outline.offset), + TK_CONFIG_DONT_SET_DEFAULT, NULL}, {TK_CONFIG_CUSTOM, "-disableddash", NULL, NULL, NULL, offsetof(RectOvalItem, outline.disabledDash), TK_CONFIG_NULL_OK, &dashOption}, {TK_CONFIG_COLOR, "-disabledfill", NULL, NULL, NULL, offsetof(RectOvalItem, disabledFillColor), TK_CONFIG_NULL_OK, NULL}, @@ -169,11 +169,11 @@ configSpecs, /* configSpecs */ ConfigureRectOval, /* configureProc */ RectOvalCoords, /* coordProc */ DeleteRectOval, /* deleteProc */ DisplayRectOval, /* displayProc */ - 0, /* flags */ + TK_CONFIG_OBJS, /* flags */ RectToPoint, /* pointProc */ RectToArea, /* areaProc */ RectOvalToPostscript, /* postscriptProc */ ScaleRectOval, /* scaleProc */ TranslateRectOval, /* translateProc */ @@ -194,11 +194,11 @@ configSpecs, /* configSpecs */ ConfigureRectOval, /* configureProc */ RectOvalCoords, /* coordProc */ DeleteRectOval, /* deleteProc */ DisplayRectOval, /* displayProc */ - 0, /* flags */ + TK_CONFIG_OBJS, /* flags */ OvalToPoint, /* pointProc */ OvalToArea, /* areaProc */ RectOvalToPostscript, /* postscriptProc */ ScaleRectOval, /* scaleProc */ TranslateRectOval, /* translateProc */ @@ -414,11 +414,11 @@ Tk_State state; tkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, - objv, rectOvalPtr, flags)) { + (const char **)objv, (char *) rectOvalPtr, flags|TK_CONFIG_OBJS)) { return TCL_ERROR; } state = itemPtr->state; /* Index: generic/tkScale.c ================================================================== --- generic/tkScale.c +++ generic/tkScale.c @@ -47,11 +47,11 @@ {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_SCALE_BORDER_WIDTH, offsetof(TkScale, borderWidthObj), TCL_INDEX_NONE, + DEF_SCALE_BORDER_WIDTH, TCL_INDEX_NONE, offsetof(TkScale, borderWidth), 0, 0, 0}, {TK_OPTION_STRING, "-command", "command", "Command", DEF_SCALE_COMMAND, offsetof(TkScale, commandObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", @@ -75,17 +75,17 @@ 0, DEF_SCALE_HIGHLIGHT_BG_MONO, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", DEF_SCALE_HIGHLIGHT, TCL_INDEX_NONE, offsetof(TkScale, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", - "HighlightThickness", DEF_SCALE_HIGHLIGHT_WIDTH, offsetof(TkScale, highlightWidthObj), - TCL_INDEX_NONE, 0, 0, 0}, + "HighlightThickness", DEF_SCALE_HIGHLIGHT_WIDTH, TCL_INDEX_NONE, + offsetof(TkScale, highlightWidth), 0, 0, 0}, {TK_OPTION_STRING, "-label", "label", "Label", DEF_SCALE_LABEL, offsetof(TkScale, labelObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-length", "length", "Length", - DEF_SCALE_LENGTH, offsetof(TkScale, lengthObj), TCL_INDEX_NONE, 0, 0, 0}, + DEF_SCALE_LENGTH, TCL_INDEX_NONE, offsetof(TkScale, length), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", DEF_SCALE_ORIENT, TCL_INDEX_NONE, offsetof(TkScale, orient), TK_OPTION_ENUM_VAR, orientStrings, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", DEF_SCALE_RELIEF, TCL_INDEX_NONE, offsetof(TkScale, relief), 0, 0, 0}, @@ -100,11 +100,11 @@ 0, 0, 0}, {TK_OPTION_BOOLEAN, "-showvalue", "showValue", "ShowValue", DEF_SCALE_SHOW_VALUE, TCL_INDEX_NONE, offsetof(TkScale, showValue), 0, 0, 0}, {TK_OPTION_PIXELS, "-sliderlength", "sliderLength", "SliderLength", - DEF_SCALE_SLIDER_LENGTH, offsetof(TkScale, sliderLengthObj), TCL_INDEX_NONE, + DEF_SCALE_SLIDER_LENGTH, TCL_INDEX_NONE, offsetof(TkScale, sliderLength), 0, 0, 0}, {TK_OPTION_RELIEF, "-sliderrelief", "sliderRelief", "SliderRelief", DEF_SCALE_SLIDER_RELIEF, TCL_INDEX_NONE, offsetof(TkScale, sliderRelief), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", @@ -123,11 +123,11 @@ 0, DEF_SCALE_TROUGH_MONO, 0}, {TK_OPTION_STRING, "-variable", "variable", "Variable", DEF_SCALE_VARIABLE, offsetof(TkScale, varNamePtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-width", "width", "Width", - DEF_SCALE_WIDTH, offsetof(TkScale, widthObj), TCL_INDEX_NONE, 0, 0, 0}, + DEF_SCALE_WIDTH, TCL_INDEX_NONE, offsetof(TkScale, width), 0, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, 0, 0} }; /* * The following tables define the scale widget commands and map the indexes @@ -149,11 +149,11 @@ */ static void ComputeFormat(TkScale *scalePtr, int forTicks); static void ComputeScaleGeometry(TkScale *scalePtr); static int ConfigureScale(Tcl_Interp *interp, TkScale *scalePtr, - int objc, Tcl_Obj *const objv[]); + Tcl_Size objc, Tcl_Obj *const objv[]); static void DestroyScale(void *memPtr); static double MaxTickRoundingError(TkScale *scalePtr, double tickResolution); static void ScaleCmdDeletedProc(void *clientData); static void ScaleEventProc(void *clientData, @@ -279,12 +279,12 @@ scalePtr->widgetCmd = Tcl_CreateObjCommand(interp, Tk_PathName(scalePtr->tkwin), ScaleWidgetObjCmd, scalePtr, ScaleCmdDeletedProc); scalePtr->optionTable = optionTable; scalePtr->orient = ORIENT_VERTICAL; - scalePtr->widthObj = NULL; - scalePtr->lengthObj = NULL; + scalePtr->width = 0; + scalePtr->length = 0; scalePtr->value = 0.0; scalePtr->varNamePtr = NULL; scalePtr->fromValue = 0.0; scalePtr->toValue = 0.0; scalePtr->tickInterval = 0.0; @@ -294,11 +294,11 @@ scalePtr->commandObj = NULL; scalePtr->repeatDelay = 0; scalePtr->repeatInterval = 0; scalePtr->labelObj = NULL; scalePtr->state = STATE_NORMAL; - scalePtr->borderWidthObj = NULL; + scalePtr->borderWidth = 0; scalePtr->bgBorder = NULL; scalePtr->activeBorder = NULL; scalePtr->sliderRelief = TK_RELIEF_RAISED; scalePtr->troughColorPtr = NULL; scalePtr->troughGC = NULL; @@ -305,15 +305,15 @@ scalePtr->copyGC = NULL; scalePtr->tkfont = NULL; scalePtr->textColorPtr = NULL; scalePtr->textGC = NULL; scalePtr->relief = TK_RELIEF_FLAT; - scalePtr->highlightWidthObj = NULL; + scalePtr->highlightWidth = 0; scalePtr->highlightBorder = NULL; scalePtr->highlightColorPtr = NULL; scalePtr->inset = 0; - scalePtr->sliderLengthObj = NULL; + scalePtr->sliderLength = 0; scalePtr->showValue = 0; scalePtr->horizLabelY = 0; scalePtr->horizValueY = 0; scalePtr->horizTroughY = 0; scalePtr->horizTickY = 0; @@ -323,12 +323,10 @@ scalePtr->vertLabelX = 0; scalePtr->fontHeight = 0; scalePtr->cursor = NULL; scalePtr->takeFocusPtr = NULL; scalePtr->flags = NEVER_SET; - - Tk_SetClassProcs(scalePtr->tkwin, &scaleClass, scalePtr); Tk_CreateEventHandler(scalePtr->tkwin, ExposureMask|StructureNotifyMask|FocusChangeMask, ScaleEventProc, scalePtr); @@ -415,11 +413,11 @@ } else { result = ConfigureScale(interp, scalePtr, objc-2, objv+2); } break; case COMMAND_COORDS: { - int x, y, width, borderWidth; + int x, y; double value; Tcl_Obj *coords[2]; if ((objc != 2) && (objc != 3)) { Tcl_WrongNumArgs(interp, 1, objv, "coords ?value?"); @@ -430,20 +428,18 @@ goto error; } } else { value = scalePtr->value; } - Tk_GetPixelsFromObj(NULL, scalePtr->tkwin, scalePtr->widthObj, &width); - Tk_GetPixelsFromObj(NULL, scalePtr->tkwin, scalePtr->borderWidthObj, &borderWidth); if (scalePtr->orient == ORIENT_VERTICAL) { - x = scalePtr->vertTroughX + width/2 - + borderWidth; + x = scalePtr->vertTroughX + scalePtr->width/2 + + scalePtr->borderWidth; y = TkScaleValueToPixel(scalePtr, value); } else { x = TkScaleValueToPixel(scalePtr, value); - y = scalePtr->horizTroughY + width/2 - + borderWidth; + y = scalePtr->horizTroughY + scalePtr->width/2 + + scalePtr->borderWidth; } coords[0] = Tcl_NewWideIntObj(x); coords[1] = Tcl_NewWideIntObj(y); Tcl_SetObjResult(interp, Tcl_NewListObj(2, coords)); break; @@ -591,16 +587,16 @@ static int ConfigureScale( Tcl_Interp *interp, /* Used for error reporting. */ TkScale *scalePtr, /* Information about widget; may or may not * already have values for some fields. */ - int objc, /* Number of valid entries in objv. */ + Tcl_Size objc, /* Number of valid entries in objv. */ Tcl_Obj *const objv[]) /* Argument values. */ { Tk_SavedOptions savedOptions; Tcl_Obj *errorResult = NULL; - int error, highlightWidth, borderWidth; + int error; double varValue; /* * Eliminate any existing trace on a variable monitored by the scale. */ @@ -672,21 +668,14 @@ ComputeFormat(scalePtr, 0); ComputeFormat(scalePtr, 1); Tk_SetBackgroundFromBorder(scalePtr->tkwin, scalePtr->bgBorder); - Tk_GetPixelsFromObj(NULL, scalePtr->tkwin, scalePtr->highlightWidthObj, &highlightWidth); - if (highlightWidth < 0) { - highlightWidth = 0; - if (scalePtr->highlightWidthObj) { - Tcl_DecrRefCount(scalePtr->highlightWidthObj); - } - scalePtr->highlightWidthObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(scalePtr->highlightWidthObj); - } - Tk_GetPixelsFromObj(NULL, scalePtr->tkwin, scalePtr->borderWidthObj, &borderWidth); - scalePtr->inset = highlightWidth + borderWidth; + if (scalePtr->highlightWidth < 0) { + scalePtr->highlightWidth = 0; + } + scalePtr->inset = scalePtr->highlightWidth + scalePtr->borderWidth; break; } if (!error) { Tk_FreeSavedOptions(&savedOptions); } @@ -763,11 +752,10 @@ void *instanceData) /* Information about widget. */ { XGCValues gcValues; GC gc; TkScale *scalePtr = (TkScale *)instanceData; - int highlightWidth, borderWidth; gcValues.foreground = scalePtr->troughColorPtr->pixel; gc = Tk_GetGC(scalePtr->tkwin, GCForeground, &gcValues); if (scalePtr->troughGC != NULL) { Tk_FreeGC(scalePtr->display, scalePtr->troughGC); @@ -785,13 +773,11 @@ if (scalePtr->copyGC == NULL) { gcValues.graphics_exposures = False; scalePtr->copyGC = Tk_GetGC(scalePtr->tkwin, GCGraphicsExposures, &gcValues); } - Tk_GetPixelsFromObj(NULL, scalePtr->tkwin, scalePtr->highlightWidthObj, &highlightWidth); - Tk_GetPixelsFromObj(NULL, scalePtr->tkwin, scalePtr->borderWidthObj, &borderWidth); - scalePtr->inset = highlightWidth + borderWidth; + scalePtr->inset = scalePtr->highlightWidth + scalePtr->borderWidth; /* * Recompute display-related information, and let the geometry manager * know how much space is needed now. */ @@ -940,16 +926,14 @@ /* * No resolution was specified, so compute the difference in * value between adjacent pixels and use it for the least * significant digit. */ - int length; x = fabs(scalePtr->fromValue - scalePtr->toValue); - Tk_GetPixelsFromObj(NULL, scalePtr->tkwin, scalePtr->lengthObj, &length); - if (length > 0) { - x /= length; + if (scalePtr->length > 0) { + x /= scalePtr->length; } if (x > 0) { leastSigDigit = ScaleDigit(x); } else { leastSigDigit = 0; @@ -1022,11 +1006,10 @@ TkScale *scalePtr) /* Information about widget. */ { char valueString[TCL_DOUBLE_SPACE]; int tmp, valuePixels, tickPixels, x, y, extraSpace; Tk_FontMetrics fm; - int length, width, borderWidth; Tk_GetFontMetrics(scalePtr->tkfont, &fm); scalePtr->fontHeight = fm.linespace + SPACING; /* @@ -1050,20 +1033,17 @@ } else { scalePtr->horizValueY = y; } y += extraSpace; scalePtr->horizTroughY = y; - Tk_GetPixelsFromObj(NULL, scalePtr->tkwin, scalePtr->lengthObj, &length); - Tk_GetPixelsFromObj(NULL, scalePtr->tkwin, scalePtr->widthObj, &width); - Tk_GetPixelsFromObj(NULL, scalePtr->tkwin, scalePtr->borderWidthObj, &borderWidth); - y += width + 2 * borderWidth; + y += scalePtr->width + 2*scalePtr->borderWidth; if (scalePtr->tickInterval != 0) { scalePtr->horizTickY = y + SPACING; y += scalePtr->fontHeight + SPACING; } Tk_GeometryRequest(scalePtr->tkwin, - length + 2*scalePtr->inset, y + scalePtr->inset); + scalePtr->length + 2*scalePtr->inset, y + scalePtr->inset); Tk_SetInternalBorder(scalePtr->tkwin, scalePtr->inset); return; } /* @@ -1128,25 +1108,22 @@ } else { scalePtr->vertTickRightX = x; scalePtr->vertValueRightX = x; } scalePtr->vertTroughX = x; - Tk_GetPixelsFromObj(NULL, scalePtr->tkwin, scalePtr->borderWidthObj, &borderWidth); - Tk_GetPixelsFromObj(NULL, scalePtr->tkwin, scalePtr->widthObj, &width); - x += 2 * borderWidth + width; + x += 2*scalePtr->borderWidth + scalePtr->width; if (scalePtr->labelObj == NULL) { scalePtr->vertLabelX = 0; } else { Tcl_Size labelLength; const char *label= Tcl_GetStringFromObj(scalePtr->labelObj, &labelLength); scalePtr->vertLabelX = x + fm.ascent/2; x = scalePtr->vertLabelX + fm.ascent/2 + Tk_TextWidth(scalePtr->tkfont, label, labelLength); } - Tk_GetPixelsFromObj(NULL, scalePtr->tkwin, scalePtr->lengthObj, &length); Tk_GeometryRequest(scalePtr->tkwin, x + scalePtr->inset, - length + 2*scalePtr->inset); + scalePtr->length + 2*scalePtr->inset); Tk_SetInternalBorder(scalePtr->tkwin, scalePtr->inset); } /* *-------------------------------------------------------------- @@ -1170,11 +1147,10 @@ ScaleEventProc( void *clientData, /* Information about window. */ XEvent *eventPtr) /* Information about event. */ { TkScale *scalePtr = (TkScale *)clientData; - int highlightWidth; if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) { TkEventuallyRedrawScale(scalePtr, REDRAW_ALL); } else if (eventPtr->type == DestroyNotify) { DestroyScale(clientData); @@ -1182,20 +1158,18 @@ ComputeScaleGeometry(scalePtr); TkEventuallyRedrawScale(scalePtr, REDRAW_ALL); } else if (eventPtr->type == FocusIn) { if (eventPtr->xfocus.detail != NotifyInferior) { scalePtr->flags |= GOT_FOCUS; - Tk_GetPixelsFromObj(NULL, scalePtr->tkwin, scalePtr->highlightWidthObj, &highlightWidth); - if (highlightWidth > 0) { + if (scalePtr->highlightWidth > 0) { TkEventuallyRedrawScale(scalePtr, REDRAW_ALL); } } } else if (eventPtr->type == FocusOut) { if (eventPtr->xfocus.detail != NotifyInferior) { scalePtr->flags &= ~GOT_FOCUS; - Tk_GetPixelsFromObj(NULL, scalePtr->tkwin, scalePtr->highlightWidthObj, &highlightWidth); - if (highlightWidth > 0) { + if (scalePtr->highlightWidth > 0) { TkEventuallyRedrawScale(scalePtr, REDRAW_ALL); } } } } @@ -1547,21 +1521,18 @@ TkScalePixelToValue( TkScale *scalePtr, /* Information about widget. */ int x, int y) /* Coordinates of point within window. */ { double value, pixelRange; - int borderWidth, sliderLength; - Tk_GetPixelsFromObj(NULL, scalePtr->tkwin, scalePtr->borderWidthObj, &borderWidth); - Tk_GetPixelsFromObj(NULL, scalePtr->tkwin, scalePtr->sliderLengthObj, &sliderLength); if (scalePtr->orient == ORIENT_VERTICAL) { - pixelRange = Tk_Height(scalePtr->tkwin) - sliderLength - - 2 * scalePtr->inset - 2 * borderWidth; + pixelRange = Tk_Height(scalePtr->tkwin) - scalePtr->sliderLength + - 2*scalePtr->inset - 2*scalePtr->borderWidth; value = y; } else { - pixelRange = Tk_Width(scalePtr->tkwin) - sliderLength - - 2 * scalePtr->inset - 2 * borderWidth; + pixelRange = Tk_Width(scalePtr->tkwin) - scalePtr->sliderLength + - 2*scalePtr->inset - 2*scalePtr->borderWidth; value = x; } if (pixelRange <= 0) { /* @@ -1569,12 +1540,12 @@ * scale's current value. */ return scalePtr->value; } - value -= sliderLength/2 + scalePtr->inset - + borderWidth; + value -= scalePtr->sliderLength/2 + scalePtr->inset + + scalePtr->borderWidth; value /= pixelRange; if (value < 0) { value = 0; } if (value > 1) { @@ -1609,18 +1580,15 @@ TkScale *scalePtr, /* Information about widget. */ double value) /* Reading of the widget. */ { int y, pixelRange; double valueRange; - int borderWidth, sliderLength; - Tk_GetPixelsFromObj(NULL, scalePtr->tkwin, scalePtr->borderWidthObj, &borderWidth); - Tk_GetPixelsFromObj(NULL, scalePtr->tkwin, scalePtr->sliderLengthObj, &sliderLength); valueRange = scalePtr->toValue - scalePtr->fromValue; pixelRange = ((scalePtr->orient == ORIENT_VERTICAL) ? Tk_Height(scalePtr->tkwin) : Tk_Width(scalePtr->tkwin)) - - sliderLength - 2 * scalePtr->inset - 2 * borderWidth; + - scalePtr->sliderLength - 2*scalePtr->inset - 2*scalePtr->borderWidth; if (valueRange == 0) { y = 0; } else { y = ScaleRound((value - scalePtr->fromValue) * pixelRange / valueRange); @@ -1628,11 +1596,11 @@ y = 0; } else if (y > pixelRange) { y = pixelRange; } } - y += sliderLength / 2 + scalePtr->inset + borderWidth; + y += scalePtr->sliderLength/2 + scalePtr->inset + scalePtr->borderWidth; return y; } /* * Local Variables: Index: generic/tkScrollbar.c ================================================================== --- generic/tkScrollbar.c +++ generic/tkScrollbar.c @@ -47,28 +47,28 @@ DEF_SCROLLBAR_BG_MONO, offsetof(TkScrollbar, bgBorder), TK_CONFIG_MONO_ONLY, NULL}, {TK_CONFIG_SYNONYM, "-bd", "borderWidth", NULL, NULL, 0, 0, NULL}, {TK_CONFIG_SYNONYM, "-bg", "background", NULL, NULL, 0, 0, NULL}, {TK_CONFIG_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_SCROLLBAR_BORDER_WIDTH, offsetof(TkScrollbar, borderWidthObj), TK_CONFIG_OBJS, NULL}, + DEF_SCROLLBAR_BORDER_WIDTH, offsetof(TkScrollbar, borderWidth), 0, NULL}, {TK_CONFIG_STRING, "-command", "command", "Command", DEF_SCROLLBAR_COMMAND, offsetof(TkScrollbar, commandObj), TK_CONFIG_OBJS|TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor", DEF_SCROLLBAR_CURSOR, offsetof(TkScrollbar, cursor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_PIXELS, "-elementborderwidth", "elementBorderWidth", "BorderWidth", DEF_SCROLLBAR_EL_BORDER_WIDTH, - offsetof(TkScrollbar, elementBorderWidthObj), TK_CONFIG_OBJS|TK_CONFIG_NULL_OK, NULL}, + offsetof(TkScrollbar, elementBorderWidth), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_COLOR, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_SCROLLBAR_HIGHLIGHT_BG, offsetof(TkScrollbar, highlightBgColorPtr), 0, NULL}, {TK_CONFIG_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", DEF_SCROLLBAR_HIGHLIGHT, offsetof(TkScrollbar, highlightColorPtr), 0, NULL}, {TK_CONFIG_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", - DEF_SCROLLBAR_HIGHLIGHT_WIDTH, offsetof(TkScrollbar, highlightWidthObj), TK_CONFIG_OBJS, NULL}, + DEF_SCROLLBAR_HIGHLIGHT_WIDTH, offsetof(TkScrollbar, highlightWidth), 0, NULL}, {TK_CONFIG_BOOLEAN, "-jump", "jump", "Jump", DEF_SCROLLBAR_JUMP, offsetof(TkScrollbar, jump), 0, NULL}, {TK_CONFIG_CUSTOM, "-orient", "orient", "Orient", DEF_SCROLLBAR_ORIENT, offsetof(TkScrollbar, vertical), 0, &orientOption}, @@ -78,19 +78,19 @@ DEF_SCROLLBAR_REPEAT_DELAY, offsetof(TkScrollbar, repeatDelay), 0, NULL}, {TK_CONFIG_INT, "-repeatinterval", "repeatInterval", "RepeatInterval", DEF_SCROLLBAR_REPEAT_INTERVAL, offsetof(TkScrollbar, repeatInterval), 0, NULL}, {TK_CONFIG_STRING, "-takefocus", "takeFocus", "TakeFocus", DEF_SCROLLBAR_TAKE_FOCUS, offsetof(TkScrollbar, takeFocusObj), - TK_CONFIG_OBJS|TK_CONFIG_NULL_OK, NULL}, + TK_CONFIG_NULL_OK|TK_CONFIG_OBJS, NULL}, {TK_CONFIG_COLOR, "-troughcolor", "troughColor", "Background", DEF_SCROLLBAR_TROUGH_COLOR, offsetof(TkScrollbar, troughColorPtr), TK_CONFIG_COLOR_ONLY, NULL}, {TK_CONFIG_COLOR, "-troughcolor", "troughColor", "Background", DEF_SCROLLBAR_TROUGH_MONO, offsetof(TkScrollbar, troughColorPtr), TK_CONFIG_MONO_ONLY, NULL}, {TK_CONFIG_PIXELS, "-width", "width", "Width", - tkDefScrollbarWidth, offsetof(TkScrollbar, widthObj), TK_CONFIG_OBJS, NULL}, + tkDefScrollbarWidth, offsetof(TkScrollbar, width), 0, NULL}, {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0, NULL} }; /* * Forward declarations for functions defined later in this file: @@ -156,29 +156,39 @@ scrollPtr->interp = interp; scrollPtr->widgetCmd = Tcl_CreateObjCommand(interp, Tk_PathName(scrollPtr->tkwin), ScrollbarWidgetObjCmd, scrollPtr, ScrollbarCmdDeletedProc); scrollPtr->vertical = 0; - scrollPtr->widthObj = 0; + scrollPtr->width = 0; scrollPtr->commandObj = NULL; scrollPtr->repeatDelay = 0; scrollPtr->repeatInterval = 0; - scrollPtr->borderWidthObj = NULL; + scrollPtr->borderWidth = 0; scrollPtr->bgBorder = NULL; scrollPtr->activeBorder = NULL; scrollPtr->troughColorPtr = NULL; scrollPtr->relief = TK_RELIEF_FLAT; - scrollPtr->highlightWidthObj = NULL; + scrollPtr->highlightWidth = 0; scrollPtr->highlightBgColorPtr = NULL; scrollPtr->highlightColorPtr = NULL; scrollPtr->inset = 0; - scrollPtr->elementBorderWidthObj = NULL; + scrollPtr->elementBorderWidth = -1; scrollPtr->arrowLength = 0; scrollPtr->sliderFirst = 0; scrollPtr->sliderLast = 0; scrollPtr->activeField = 0; scrollPtr->activeRelief = TK_RELIEF_RAISED; +#ifndef TK_NO_DEPRECATED +#define totalUnits dummy1 +#define windowUnits dummy2 +#define firstUnit dummy3 +#define lastUnit dummy4 + scrollPtr->totalUnits = 0; + scrollPtr->windowUnits = 0; + scrollPtr->firstUnit = 0; + scrollPtr->lastUnit = 0; +#endif /* TK_NO_DEPRECATED */ scrollPtr->firstFraction = 0.0; scrollPtr->lastFraction = 0.0; scrollPtr->cursor = NULL; scrollPtr->takeFocusObj = NULL; scrollPtr->flags = 0; @@ -369,10 +379,21 @@ if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "get"); goto error; } +#ifndef TK_NO_DEPRECATED +# define OLD_STYLE_COMMANDS 2 + if (scrollPtr->flags & OLD_STYLE_COMMANDS) { + resObjs[0] = Tcl_NewWideIntObj(scrollPtr->totalUnits); + resObjs[1] = Tcl_NewWideIntObj(scrollPtr->windowUnits); + resObjs[2] = Tcl_NewWideIntObj(scrollPtr->firstUnit); + resObjs[3] = Tcl_NewWideIntObj(scrollPtr->lastUnit); + Tcl_SetObjResult(interp, Tcl_NewListObj(4, resObjs)); + break; + } +#endif /* TK_NO_DEPRECATED */ resObjs[0] = Tcl_NewDoubleObj(scrollPtr->firstFraction); resObjs[1] = Tcl_NewDoubleObj(scrollPtr->lastFraction); Tcl_SetObjResult(interp, Tcl_NewListObj(2, resObjs)); break; } @@ -420,10 +441,52 @@ } else if (last > 1.0) { scrollPtr->lastFraction = 1.0; } else { scrollPtr->lastFraction = last; } +#ifndef TK_NO_DEPRECATED + scrollPtr->flags &= ~OLD_STYLE_COMMANDS; + } else if (objc == 6) { + int totalUnits, windowUnits, firstUnit, lastUnit; + if (Tcl_GetIntFromObj(interp, objv[2], &totalUnits) != TCL_OK) { + goto error; + } + if (totalUnits < 0) { + totalUnits = 0; + } + if (Tcl_GetIntFromObj(interp, objv[3], &windowUnits) != TCL_OK) { + goto error; + } + if (windowUnits < 0) { + windowUnits = 0; + } + if (Tcl_GetIntFromObj(interp, objv[4], &firstUnit) != TCL_OK) { + goto error; + } + if (Tcl_GetIntFromObj(interp, objv[5], &lastUnit) != TCL_OK) { + goto error; + } + if (totalUnits > 0) { + if (lastUnit < firstUnit) { + lastUnit = firstUnit; + } + } else { + firstUnit = lastUnit = 0; + } + scrollPtr->totalUnits = totalUnits; + scrollPtr->windowUnits = windowUnits; + scrollPtr->firstUnit = firstUnit; + scrollPtr->lastUnit = lastUnit; + if (scrollPtr->totalUnits == 0) { + scrollPtr->firstFraction = 0.0; + scrollPtr->lastFraction = 1.0; + } else { + scrollPtr->firstFraction = ((double) firstUnit)/totalUnits; + scrollPtr->lastFraction = ((double) (lastUnit+1))/totalUnits; + } + scrollPtr->flags |= OLD_STYLE_COMMANDS; +#endif /* !TK_NO_DEPRECATED */ } else { Tcl_WrongNumArgs(interp, 1, objv, "set firstFraction lastFraction"); goto error; } TkpComputeScrollbarGeometry(scrollPtr); @@ -469,46 +532,28 @@ * already have values for some fields. */ Tcl_Size objc, /* Number of valid entries in argv. */ Tcl_Obj *const objv[], /* Arguments. */ int flags) /* Flags to pass to Tk_ConfigureWidget. */ { - int width, borderWidth, highlightWidth, elementBorderWidth; - if (Tk_ConfigureWidget(interp, scrollPtr->tkwin, configSpecs, objc, - objv, scrollPtr, flags) != TCL_OK) { + (const char **)objv, (char *)scrollPtr, flags|TK_CONFIG_OBJS) != TCL_OK) { return TCL_ERROR; } /* * A few options need special processing, such as setting the background * from a 3-D border. */ - Tk_GetPixelsFromObj(NULL, scrollPtr->tkwin, scrollPtr->borderWidthObj, &borderWidth); - if (borderWidth < 0) { - Tcl_DecrRefCount(scrollPtr->borderWidthObj); - scrollPtr->borderWidthObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(scrollPtr->borderWidthObj); - } - Tk_GetPixelsFromObj(NULL, scrollPtr->tkwin, scrollPtr->highlightWidthObj, &highlightWidth); - if (highlightWidth < 0) { - Tcl_DecrRefCount(scrollPtr->highlightWidthObj); - scrollPtr->highlightWidthObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(scrollPtr->highlightWidthObj); - } - Tk_GetPixelsFromObj(NULL, scrollPtr->tkwin, scrollPtr->widthObj, &width); - if (width < 0) { - Tcl_DecrRefCount(scrollPtr->widthObj); - scrollPtr->widthObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(scrollPtr->widthObj); - } - if (scrollPtr->elementBorderWidthObj) { - Tk_GetPixelsFromObj(NULL, scrollPtr->tkwin, scrollPtr->elementBorderWidthObj, &elementBorderWidth); - if (elementBorderWidth < 0) { - Tcl_DecrRefCount(scrollPtr->elementBorderWidthObj); - scrollPtr->elementBorderWidthObj = NULL; - } + if (scrollPtr->highlightWidth < 0) { + scrollPtr->highlightWidth = 0; + } + if (scrollPtr->borderWidth < 0) { + scrollPtr->borderWidth = 0; + } + if (scrollPtr->elementBorderWidth < 0) { + scrollPtr->elementBorderWidth = -1; } /* * Configure platform specific options. */ @@ -547,11 +592,10 @@ TkScrollbarEventProc( void *clientData, /* Information about window. */ XEvent *eventPtr) /* Information about event. */ { TkScrollbar *scrollPtr = (TkScrollbar *)clientData; - int highlightWidth; if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) { TkScrollbarEventuallyRedraw(scrollPtr); } else if (eventPtr->type == DestroyNotify) { TkpDestroyScrollbar(scrollPtr); @@ -574,20 +618,18 @@ TkpComputeScrollbarGeometry(scrollPtr); TkScrollbarEventuallyRedraw(scrollPtr); } else if (eventPtr->type == FocusIn) { if (eventPtr->xfocus.detail != NotifyInferior) { scrollPtr->flags |= GOT_FOCUS; - Tk_GetPixelsFromObj(NULL, scrollPtr->tkwin, scrollPtr->highlightWidthObj, &highlightWidth); - if (highlightWidth > 0) { + if (scrollPtr->highlightWidth > 0) { TkScrollbarEventuallyRedraw(scrollPtr); } } } else if (eventPtr->type == FocusOut) { if (eventPtr->xfocus.detail != NotifyInferior) { scrollPtr->flags &= ~GOT_FOCUS; - Tk_GetPixelsFromObj(NULL, scrollPtr->tkwin, scrollPtr->highlightWidthObj, &highlightWidth); - if (highlightWidth > 0) { + if (scrollPtr->highlightWidth > 0) { TkScrollbarEventuallyRedraw(scrollPtr); } } } else if (eventPtr->type == MapNotify) { TkScrollbarEventuallyRedraw(scrollPtr); Index: generic/tkScrollbar.h ================================================================== --- generic/tkScrollbar.h +++ generic/tkScrollbar.h @@ -103,10 +103,12 @@ * use for active element. */ /* * Information describing the application related to the scrollbar, which * is provided by the application by invoking the "set" widget command. + * It can be provided in two ways: the "new" form (firstFraction + * and lastFraction) or the "old" form. The "old" form is deprecated. */ #if TK_MAJOR_VERSION < 9 int dummy1, dummy2, dummy3, dummy4; /* deprecated, for "old" form. */ #endif Index: generic/tkSelect.c ================================================================== --- generic/tkSelect.c +++ generic/tkSelect.c @@ -1399,19 +1399,19 @@ * the command has not been deleted. */ if (cmdInfoPtr->interp != NULL) { if (length <= maxBytes) { - cmdInfoPtr->charOffset += Tcl_NumUtfChars(string, TCL_INDEX_NONE); + cmdInfoPtr->charOffset += TkNumUtfChars(string, TCL_INDEX_NONE); cmdInfoPtr->buffer[0] = '\0'; } else { - Tcl_UniChar ch = 0; + int ch = 0; p = string; string += count; numChars = 0; while (p < string) { - p += Tcl_UtfToUniChar(p, &ch); + p += TkUtfToUniChar(p, &ch); numChars++; } cmdInfoPtr->charOffset += numChars; length = p - string; if (length > 0) { Index: generic/tkSquare.c ================================================================== --- generic/tkSquare.c +++ generic/tkSquare.c @@ -21,11 +21,10 @@ #endif #ifndef USE_TK_STUBS # define USE_TK_STUBS #endif #include "tkInt.h" -#include /* * A data structure of the following type is kept for each square widget * managed by this file: */ @@ -52,14 +51,13 @@ Tcl_Obj *bgBorderPtr; Tcl_Obj *fgBorderPtr; Tcl_Obj *reliefPtr; GC gc; /* Graphics context for copying from * off-screen pixmap onto screen. */ - bool doubleBuffer; /* true means double-buffer redisplay with - * pixmap; false means draw straight onto the - * display. */ - bool updatePending; /* true means a call to SquareDisplay has + int doubleBuffer; /* Non-zero means double-buffer redisplay with + * pixmap; 0 means draw straight onto the display. */ + int updatePending; /* Non-zero means a call to SquareDisplay has * already been scheduled. */ } Square; /* * Information used for argv parsing. @@ -74,11 +72,11 @@ {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", "2", offsetof(Square, borderWidthObj), TCL_INDEX_NONE, 0, NULL, 0}, {TK_OPTION_BOOLEAN, "-dbl", "doubleBuffer", "DoubleBuffer", - "1", TCL_INDEX_NONE, offsetof(Square, doubleBuffer), TK_OPTION_VAR(bool) , NULL, 0}, + "1", TCL_INDEX_NONE, offsetof(Square, doubleBuffer), 0 , NULL, 0}, {TK_OPTION_SYNONYM, "-fg", NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, "-foreground", 0}, {TK_OPTION_BORDER, "-foreground", "foreground", "Foreground", "#b03060", offsetof(Square, fgBorderPtr), TCL_INDEX_NONE, 0, "black", 0}, @@ -278,11 +276,11 @@ if (result == TCL_OK) { result = SquareConfigure(interp, squarePtr); } if (!squarePtr->updatePending) { Tcl_DoWhenIdle(SquareDisplay, squarePtr); - squarePtr->updatePending = true; + squarePtr->updatePending = 1; } } if (resultObjPtr != NULL) { Tcl_SetObjResult(interp, resultObjPtr); } @@ -349,11 +347,11 @@ Tk_GetPixelsFromObj(NULL, squarePtr->tkwin, squarePtr->borderWidthObj, &borderWidth); Tk_SetInternalBorder(squarePtr->tkwin, borderWidth); if (!squarePtr->updatePending) { Tcl_DoWhenIdle(SquareDisplay, squarePtr); - squarePtr->updatePending = true; + squarePtr->updatePending = 1; } KeepInWindow(squarePtr); return TCL_OK; } @@ -383,17 +381,17 @@ Square *squarePtr = (Square *)clientData; if (eventPtr->type == Expose) { if (!squarePtr->updatePending) { Tcl_DoWhenIdle(SquareDisplay, squarePtr); - squarePtr->updatePending = true; + squarePtr->updatePending = 1; } } else if (eventPtr->type == ConfigureNotify) { KeepInWindow(squarePtr); if (!squarePtr->updatePending) { Tcl_DoWhenIdle(SquareDisplay, squarePtr); - squarePtr->updatePending = true; + squarePtr->updatePending = 1; } } else if (eventPtr->type == DestroyNotify) { if (squarePtr->tkwin != NULL) { Tk_FreeConfigOptions(squarePtr, squarePtr->optionTable, squarePtr->tkwin); @@ -475,11 +473,11 @@ Pixmap pm = None; Drawable d; int borderWidth, size, relief; Tk_3DBorder bgBorder, fgBorder; - squarePtr->updatePending = false; + squarePtr->updatePending = 0; if (!Tk_IsMapped(tkwin)) { return; } /* Index: generic/tkStubInit.c ================================================================== --- generic/tkStubInit.c +++ generic/tkStubInit.c @@ -37,30 +37,96 @@ /* * Remove macro that might interfere with the definition below. */ +#undef Tk_MainEx +#undef Tk_FreeXId +#undef Tk_FreeStyleFromObj +#undef Tk_GetStyleFromObj +#undef TkWinGetPlatformId #undef TkPutImage #undef XPutImage +#define TkMacOSXSetUpClippingRgn (void (*)(Drawable))(void *)doNothing +#undef TkMacOSXIsCharacterMissing +#define TkMacOSXIsCharacterMissing (int (*)(Tk_Font, unsigned int))(void *)doNothing +#undef TkMacOSXSetDrawingEnabled +#define TkMacOSXSetDrawingEnabled (void (*)(TkWindow *, int))(void *)doNothing +#define TkUnusedStubEntry 0 + + +#if defined(_WIN32) && !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 +# define Tk_TranslateWinEvent TkTranslateWinEvent +# define Tk_PointerEvent TkWinPointerEvent +#define TkWinGetPlatformId winGetPlatformId +static int TkWinGetPlatformId(void) { + return 2; +} +#else +# define Tk_TranslateWinEvent 0 +# define Tk_PointerEvent 0 +# define TkWinGetPlatformId 0 +#endif -#if !defined(MAC_OSX_TK) +#if defined(TK_NO_DEPRECATED) || (TCL_MAJOR_VERSION > 8) +# define TkSetWindowMenuBar 0 +# define TkpDrawHighlightBorder 0 +# define TkpUseWindow 0 +# define TkpSetMainMenubar 0 +# define TkpGetOtherWindow 0 +# define TkpGetSystemDefault 0 +# define TkpMakeContainer 0 +# define TkpMakeWindow 0 +#endif + static int doNothing(void) { /* dummy implementation, no need to do anything */ return 0; } + +#if defined(TK_NO_DEPRECATED) || TCL_MAJOR_VERSION > 8 +#define Tk_MainEx 0 +#define Tk_FreeXId 0 +#define Tk_FreeStyleFromObj 0 +#define Tk_GetStyleFromObj 0 +#define TkWinGetPlatformId 0 +#define Tk_PhotoPutBlock_NoComposite 0 +#define Tk_PhotoPutZoomedBlock_NoComposite 0 +#define Tk_PhotoExpand_Panic 0 +#define Tk_PhotoPutBlock_Panic 0 +#define Tk_PhotoPutZoomedBlock_Panic 0 +#define Tk_PhotoSetSize_Panic 0 +#define Tk_CreateOldPhotoImageFormat 0 +#else +#define Tk_FreeXId ((void (*)(Display *, XID))(void *)doNothing) +#define Tk_FreeStyleFromObj ((void (*)(Tcl_Obj *))(void *)doNothing) +#define Tk_GetStyleFromObj getStyleFromObj +static Tk_Style Tk_GetStyleFromObj(Tcl_Obj *obj) +{ + return Tk_AllocStyleFromObj(NULL, obj); +} +#endif /* !TK_NO_DEPRECATED */ + +#define TkpCmapStressed_ TkpCmapStressed +#define TkpSync_ TkpSync +#define TkUnixContainerId_ TkUnixContainerId +#define TkUnixDoOneXEvent_ TkUnixDoOneXEvent +#define TkUnixSetMenubar_ TkUnixSetMenubar +#define TkWmCleanup_ TkWmCleanup +#define TkSendCleanup_ TkSendCleanup +#define TkpTestsendCmd_ TkpTestsendCmd +#define TkGenWMConfigureEvent_ TkGenWMConfigureEvent +#define TkGenerateActivateEvents_ TkGenerateActivateEvents +#define TkMacOSXDrawable Tk_MacOSXGetNSWindowForDrawable + +#if !defined(MAC_OSX_TK) # undef TkpWillDrawWidget # undef TkpRedrawWidget -# undef TkpDefineNativeBitmaps -# undef TkpCreateNativeBitmap -# undef TkpGetNativeAppBitmap # define TkpWillDrawWidget ((int (*)(Tk_Window))(void *)doNothing) # define TkpRedrawWidget ((void (*)(Tk_Window))(void *)doNothing) -# define TkpDefineNativeBitmaps ((void (*)(void))(void *)doNothing) -# define TkpCreateNativeBitmap ((Pixmap (*)(Display *, const void *))(void *)doNothing) -# define TkpGetNativeAppBitmap ((Pixmap (*)(Display *, const char *, int *, int *))(void *)doNothing) #endif #ifdef _WIN32 int @@ -294,36 +360,36 @@ TkpChangeFocus, /* 55 */ TkpCloseDisplay, /* 56 */ TkpClaimFocus, /* 57 */ TkpDisplayWarning, /* 58 */ TkpGetAppName, /* 59 */ - 0, /* 60 */ + TkpGetOtherWindow, /* 60 */ TkpGetWrapperWindow, /* 61 */ TkpInit, /* 62 */ TkpInitializeMenuBindings, /* 63 */ - 0, /* 64 */ + TkpMakeContainer, /* 64 */ TkpMakeMenuWindow, /* 65 */ - 0, /* 66 */ + TkpMakeWindow, /* 66 */ TkpMenuNotifyToplevelCreate, /* 67 */ TkpOpenDisplay, /* 68 */ TkPointerEvent, /* 69 */ TkPolygonToArea, /* 70 */ TkPolygonToPoint, /* 71 */ TkPositionInTree, /* 72 */ TkpRedirectKeyEvent, /* 73 */ - 0, /* 74 */ - 0, /* 75 */ + TkpSetMainMenubar, /* 74 */ + TkpUseWindow, /* 75 */ 0, /* 76 */ TkQueueEventForAllChildren, /* 77 */ TkReadBitmapFile, /* 78 */ TkScrollWindow, /* 79 */ TkSelDeadWindow, /* 80 */ TkSelEventProc, /* 81 */ TkSelInit, /* 82 */ TkSelPropProc, /* 83 */ 0, /* 84 */ - 0, /* 85 */ + TkSetWindowMenuBar, /* 85 */ TkStringToKeysym, /* 86 */ TkThickPolyLineToArea, /* 87 */ TkWmAddToColormapWindows, /* 88 */ TkWmDeadWindow, /* 89 */ TkWmFocusToplevel, /* 90 */ @@ -345,24 +411,57 @@ TkGetDisplayList, /* 106 */ TkGetMainInfoList, /* 107 */ TkGetWindowFromObj, /* 108 */ TkpGetString, /* 109 */ TkpGetSubFonts, /* 110 */ - 0, /* 111 */ + TkpGetSystemDefault, /* 111 */ TkpMenuThreadInit, /* 112 */ XClipBox, /* 113 */ XCreateRegion, /* 114 */ XDestroyRegion, /* 115 */ XIntersectRegion, /* 116 */ XRectInRegion, /* 117 */ XSetRegion, /* 118 */ XUnionRectWithRegion, /* 119 */ 0, /* 120 */ +#if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */ + 0, /* 121 */ +#endif /* X11 */ +#if defined(_WIN32) /* WIN */ + 0, /* 121 */ +#endif /* WIN */ +#ifdef MAC_OSX_TK /* AQUA */ +# if TCL_MAJOR_VERSION < 9 + 0, /* 121 */ /* Dummy entry for stubs table backwards compatibility */ +# endif /* TCL_MAJOR_VERSION < 9 */ TkpCreateNativeBitmap, /* 121 */ +#endif /* AQUA */ +#if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */ + 0, /* 122 */ +#endif /* X11 */ +#if defined(_WIN32) /* WIN */ + 0, /* 122 */ +#endif /* WIN */ +#ifdef MAC_OSX_TK /* AQUA */ +# if TCL_MAJOR_VERSION < 9 + 0, /* 122 */ /* Dummy entry for stubs table backwards compatibility */ +# endif /* TCL_MAJOR_VERSION < 9 */ TkpDefineNativeBitmaps, /* 122 */ +#endif /* AQUA */ 0, /* 123 */ +#if !(defined(_WIN32) || defined(MAC_OSX_TK)) /* X11 */ + 0, /* 124 */ +#endif /* X11 */ +#if defined(_WIN32) /* WIN */ + 0, /* 124 */ +#endif /* WIN */ +#ifdef MAC_OSX_TK /* AQUA */ +# if TCL_MAJOR_VERSION < 9 + 0, /* 124 */ /* Dummy entry for stubs table backwards compatibility */ +# endif /* TCL_MAJOR_VERSION < 9 */ TkpGetNativeAppBitmap, /* 124 */ +#endif /* AQUA */ 0, /* 125 */ 0, /* 126 */ 0, /* 127 */ 0, /* 128 */ 0, /* 129 */ @@ -369,11 +468,11 @@ 0, /* 130 */ 0, /* 131 */ 0, /* 132 */ 0, /* 133 */ 0, /* 134 */ - 0, /* 135 */ + TkpDrawHighlightBorder, /* 135 */ TkSetFocusWin, /* 136 */ TkpSetKeycodeAndState, /* 137 */ TkpGetKeySym, /* 138 */ TkpInitKeymapInfo, /* 139 */ TkPhotoGetValidRegion, /* 140 */ @@ -428,11 +527,11 @@ static const TkIntPlatStubs tkIntPlatStubs = { TCL_STUB_MAGIC, 0, #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ - TkCreateXEventSource, /* 0 */ + TkAlignImageData, /* 0 */ 0, /* 1 */ TkGenerateActivateEvents, /* 2 */ TkpGetMS, /* 3 */ TkPointerDeadWindow, /* 4 */ TkpPrintWindowId, /* 5 */ @@ -461,15 +560,15 @@ TkWinXCleanup, /* 28 */ TkWinXInit, /* 29 */ TkWinSetForegroundWindow, /* 30 */ TkWinDialogDebug, /* 31 */ TkWinGetMenuSystemDefault, /* 32 */ - TkAlignImageData, /* 33 */ + TkWinGetPlatformId, /* 33 */ TkWinSetHINSTANCE, /* 34 */ TkWinGetPlatformTheme, /* 35 */ TkWinChildProc, /* 36 */ - 0, /* 37 */ + TkCreateXEventSource, /* 37 */ TkpCmapStressed, /* 38 */ TkpSync, /* 39 */ TkUnixContainerId, /* 40 */ TkUnixDoOneXEvent, /* 41 */ TkUnixSetMenubar, /* 42 */ @@ -478,22 +577,22 @@ TkpTestsendCmd, /* 45 */ 0, /* 46 */ TkpGetCapture, /* 47 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ - 0, /* 0 */ - TkAboutDlg, /* 1 */ - TkGenerateActivateEvents, /* 2 */ - TkpGetMS, /* 3 */ - TkPointerDeadWindow, /* 4 */ + TkGenerateActivateEvents, /* 0 */ + 0, /* 1 */ + TkGenerateActivateEvents_, /* 2 */ + TkPointerDeadWindow, /* 3 */ + TkpSetCapture, /* 4 */ TkpSetCursor, /* 5 */ - TkpScanWindowId, /* 6 */ - TkpWmSetState, /* 7 */ + TkpWmSetState, /* 6 */ + TkAboutDlg, /* 7 */ TkMacOSXButtonKeyState, /* 8 */ TkMacOSXClearMenubarActive, /* 9 */ TkMacOSXDispatchMenuEvent, /* 10 */ - TkpSetCapture, /* 11 */ + 0, /* 11 */ TkMacOSXHandleTearoffMenu, /* 12 */ 0, /* 13 */ TkMacOSXDoHLEvent, /* 14 */ 0, /* 15 */ TkMacOSXGetXWindow, /* 16 */ @@ -500,19 +599,19 @@ TkMacOSXGrowToplevel, /* 17 */ TkMacOSXHandleMenuSelect, /* 18 */ 0, /* 19 */ 0, /* 20 */ TkMacOSXInvalidateWindow, /* 21 */ - 0, /* 22 */ + TkMacOSXIsCharacterMissing, /* 22 */ TkMacOSXMakeRealWindowExist, /* 23 */ TkMacOSXMakeStippleMap, /* 24 */ TkMacOSXMenuClick, /* 25 */ 0, /* 26 */ TkMacOSXResizable, /* 27 */ TkMacOSXSetHelpMenuItemCount, /* 28 */ TkMacOSXSetScrollbarGrow, /* 29 */ - 0, /* 30 */ + TkMacOSXSetUpClippingRgn, /* 30 */ TkMacOSXSetUpGraphicsPort, /* 31 */ TkMacOSXUpdateClipRgn, /* 32 */ 0, /* 33 */ TkMacOSXUseMenuID, /* 34 */ TkMacOSXVisableClipRgn, /* 35 */ @@ -530,26 +629,30 @@ TkpGetCapture, /* 47 */ 0, /* 48 */ TkMacOSXGetContainer, /* 49 */ TkGenerateButtonEvent, /* 50 */ TkGenWMDestroyEvent, /* 51 */ + TkMacOSXSetDrawingEnabled, /* 52 */ + TkpGetMS, /* 53 */ + TkMacOSXDrawable, /* 54 */ + TkpScanWindowId, /* 55 */ #endif /* AQUA */ #if !(defined(_WIN32) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ TkCreateXEventSource, /* 0 */ 0, /* 1 */ TkGenerateActivateEvents, /* 2 */ - 0, /* 3 */ - 0, /* 4 */ - 0, /* 5 */ - TkpScanWindowId, /* 6 */ - 0, /* 7 */ - 0, /* 8 */ - TkpWmSetState, /* 9 */ - 0, /* 10 */ + TkpCmapStressed, /* 3 */ + TkpSync, /* 4 */ + TkUnixContainerId, /* 5 */ + TkUnixDoOneXEvent, /* 6 */ + TkUnixSetMenubar, /* 7 */ + TkpScanWindowId, /* 8 */ + TkWmCleanup, /* 9 */ + TkSendCleanup, /* 10 */ 0, /* 11 */ - 0, /* 12 */ - 0, /* 13 */ + TkpWmSetState, /* 12 */ + TkpTestsendCmd_, /* 13 */ 0, /* 14 */ 0, /* 15 */ 0, /* 16 */ 0, /* 17 */ 0, /* 18 */ @@ -570,17 +673,17 @@ 0, /* 33 */ 0, /* 34 */ 0, /* 35 */ 0, /* 36 */ 0, /* 37 */ - TkpCmapStressed, /* 38 */ - TkpSync, /* 39 */ - TkUnixContainerId, /* 40 */ - TkUnixDoOneXEvent, /* 41 */ - TkUnixSetMenubar, /* 42 */ - TkWmCleanup, /* 43 */ - TkSendCleanup, /* 44 */ + TkpCmapStressed_, /* 38 */ + TkpSync_, /* 39 */ + TkUnixContainerId_, /* 40 */ + TkUnixDoOneXEvent_, /* 41 */ + TkUnixSetMenubar_, /* 42 */ + TkWmCleanup_, /* 43 */ + TkSendCleanup_, /* 44 */ TkpTestsendCmd, /* 45 */ #endif /* X11 */ }; static const TkIntXlibStubs tkIntXlibStubs = { @@ -753,117 +856,117 @@ XCreateImage, /* 2 */ XGetImage, /* 3 */ XGetAtomName, /* 4 */ XKeysymToString, /* 5 */ XCreateColormap, /* 6 */ - XCreatePixmapCursor, /* 7 */ - XCreateGlyphCursor, /* 8 */ - XGContextFromGC, /* 9 */ - XListHosts, /* 10 */ - XKeycodeToKeysym, /* 11 */ - XStringToKeysym, /* 12 */ - XRootWindow, /* 13 */ - XSetErrorHandler, /* 14 */ - XIconifyWindow, /* 15 */ - XWithdrawWindow, /* 16 */ - XGetWMColormapWindows, /* 17 */ - XAllocColor, /* 18 */ - XBell, /* 19 */ - XChangeProperty, /* 20 */ - XChangeWindowAttributes, /* 21 */ - XClearWindow, /* 22 */ - XConfigureWindow, /* 23 */ - XCopyArea, /* 24 */ - XCopyPlane, /* 25 */ - XCreateBitmapFromData, /* 26 */ - XDefineCursor, /* 27 */ - XDeleteProperty, /* 28 */ - XDestroyWindow, /* 29 */ - XDrawArc, /* 30 */ - XDrawLines, /* 31 */ - XDrawRectangle, /* 32 */ - XFillArc, /* 33 */ - XFillPolygon, /* 34 */ - XFillRectangles, /* 35 */ - XForceScreenSaver, /* 36 */ - XFreeColormap, /* 37 */ - XFreeColors, /* 38 */ - XFreeCursor, /* 39 */ - XFreeModifiermap, /* 40 */ - XGetGeometry, /* 41 */ - XGetInputFocus, /* 42 */ - XGetWindowProperty, /* 43 */ - XGetWindowAttributes, /* 44 */ - XGrabKeyboard, /* 45 */ - XGrabPointer, /* 46 */ - XKeysymToKeycode, /* 47 */ - XLookupColor, /* 48 */ - XMapWindow, /* 49 */ - XMoveResizeWindow, /* 50 */ - XMoveWindow, /* 51 */ - XNextEvent, /* 52 */ - XPutBackEvent, /* 53 */ - XQueryColors, /* 54 */ - XQueryPointer, /* 55 */ - XQueryTree, /* 56 */ - XRaiseWindow, /* 57 */ - XRefreshKeyboardMapping, /* 58 */ - XResizeWindow, /* 59 */ - XSelectInput, /* 60 */ - XSendEvent, /* 61 */ - XSetCommand, /* 62 */ - XSetIconName, /* 63 */ - XSetInputFocus, /* 64 */ - XSetSelectionOwner, /* 65 */ - XSetWindowBackground, /* 66 */ - XSetWindowBackgroundPixmap, /* 67 */ - XSetWindowBorder, /* 68 */ - XSetWindowBorderPixmap, /* 69 */ - XSetWindowBorderWidth, /* 70 */ - XSetWindowColormap, /* 71 */ - XTranslateCoordinates, /* 72 */ - XUngrabKeyboard, /* 73 */ - XUngrabPointer, /* 74 */ - XUnmapWindow, /* 75 */ - XWindowEvent, /* 76 */ - XDestroyIC, /* 77 */ - XFilterEvent, /* 78 */ - XmbLookupString, /* 79 */ - TkPutImage, /* 80 */ - XSetClipRectangles, /* 81 */ - XParseColor, /* 82 */ - XCreateGC, /* 83 */ - XFreeGC, /* 84 */ - XInternAtom, /* 85 */ - XSetBackground, /* 86 */ - XSetForeground, /* 87 */ - XSetClipMask, /* 88 */ - XSetClipOrigin, /* 89 */ - XSetTSOrigin, /* 90 */ - XChangeGC, /* 91 */ - XSetFont, /* 92 */ - XSetArcMode, /* 93 */ - XSetStipple, /* 94 */ - XSetFillRule, /* 95 */ - XSetFillStyle, /* 96 */ - XSetFunction, /* 97 */ - XSetLineAttributes, /* 98 */ - _XInitImageFuncPtrs, /* 99 */ - XCreateIC, /* 100 */ - XGetVisualInfo, /* 101 */ - XSetWMClientMachine, /* 102 */ - XStringListToTextProperty, /* 103 */ - XDrawLine, /* 104 */ - XWarpPointer, /* 105 */ - XFillRectangle, /* 106 */ + XGContextFromGC, /* 7 */ + XKeycodeToKeysym, /* 8 */ + XStringToKeysym, /* 9 */ + XRootWindow, /* 10 */ + XSetErrorHandler, /* 11 */ + XAllocColor, /* 12 */ + XBell, /* 13 */ + XChangeProperty, /* 14 */ + XChangeWindowAttributes, /* 15 */ + XConfigureWindow, /* 16 */ + XCopyArea, /* 17 */ + XCopyPlane, /* 18 */ + XCreateBitmapFromData, /* 19 */ + XDefineCursor, /* 20 */ + XDestroyWindow, /* 21 */ + XDrawArc, /* 22 */ + XDrawLines, /* 23 */ + XDrawRectangle, /* 24 */ + XFillArc, /* 25 */ + XFillPolygon, /* 26 */ + XFillRectangles, /* 27 */ + XFreeColormap, /* 28 */ + XFreeColors, /* 29 */ + XFreeModifiermap, /* 30 */ + XGetGeometry, /* 31 */ + XGetWindowProperty, /* 32 */ + XGrabKeyboard, /* 33 */ + XGrabPointer, /* 34 */ + XKeysymToKeycode, /* 35 */ + XMapWindow, /* 36 */ + XMoveResizeWindow, /* 37 */ + XMoveWindow, /* 38 */ + XQueryPointer, /* 39 */ + XRaiseWindow, /* 40 */ + XRefreshKeyboardMapping, /* 41 */ + XResizeWindow, /* 42 */ + XSelectInput, /* 43 */ + XSendEvent, /* 44 */ + XSetIconName, /* 45 */ + XSetInputFocus, /* 46 */ + XSetSelectionOwner, /* 47 */ + XSetWindowBackground, /* 48 */ + XSetWindowBackgroundPixmap, /* 49 */ + XSetWindowBorder, /* 50 */ + XSetWindowBorderPixmap, /* 51 */ + XSetWindowBorderWidth, /* 52 */ + XSetWindowColormap, /* 53 */ + XUngrabKeyboard, /* 54 */ + XUngrabPointer, /* 55 */ + XUnmapWindow, /* 56 */ + TkPutImage, /* 57 */ + XParseColor, /* 58 */ + XCreateGC, /* 59 */ + XFreeGC, /* 60 */ + XInternAtom, /* 61 */ + XSetBackground, /* 62 */ + XSetForeground, /* 63 */ + XSetClipMask, /* 64 */ + XSetClipOrigin, /* 65 */ + XSetTSOrigin, /* 66 */ + XChangeGC, /* 67 */ + XSetFont, /* 68 */ + XSetArcMode, /* 69 */ + XSetStipple, /* 70 */ + XSetFillRule, /* 71 */ + XSetFillStyle, /* 72 */ + XSetFunction, /* 73 */ + XSetLineAttributes, /* 74 */ + _XInitImageFuncPtrs, /* 75 */ + XCreateIC, /* 76 */ + XGetVisualInfo, /* 77 */ + XSetWMClientMachine, /* 78 */ + XStringListToTextProperty, /* 79 */ + XDrawSegments, /* 80 */ + XForceScreenSaver, /* 81 */ + XDrawLine, /* 82 */ + XFillRectangle, /* 83 */ + XClearWindow, /* 84 */ + XDrawPoint, /* 85 */ + XDrawPoints, /* 86 */ + XWarpPointer, /* 87 */ + XQueryColor, /* 88 */ + XQueryColors, /* 89 */ + XQueryTree, /* 90 */ + XSync, /* 91 */ + XTranslateCoordinates, /* 92 */ + XDeleteProperty, /* 93 */ + XFreeCursor, /* 94 */ + XGetInputFocus, /* 95 */ + XmbLookupString, /* 96 */ + XNextEvent, /* 97 */ + XPutBackEvent, /* 98 */ + XSetCommand, /* 99 */ + XWindowEvent, /* 100 */ + XGetWindowAttributes, /* 101 */ + XGetWMColormapWindows, /* 102 */ + XIconifyWindow, /* 103 */ + XWithdrawWindow, /* 104 */ + XListHosts, /* 105 */ + XSetClipRectangles, /* 106 */ XFlush, /* 107 */ XGrabServer, /* 108 */ XUngrabServer, /* 109 */ XFree, /* 110 */ XNoOp, /* 111 */ XSynchronize, /* 112 */ - XSync, /* 113 */ + XLookupColor, /* 113 */ XVisualIDFromVisual, /* 114 */ 0, /* 115 */ 0, /* 116 */ 0, /* 117 */ 0, /* 118 */ @@ -879,24 +982,24 @@ 0, /* 128 */ XLowerWindow, /* 129 */ XFillArcs, /* 130 */ XDrawArcs, /* 131 */ XDrawRectangles, /* 132 */ - XDrawSegments, /* 133 */ - XDrawPoint, /* 134 */ - XDrawPoints, /* 135 */ + 0, /* 133 */ + 0, /* 134 */ + 0, /* 135 */ XReparentWindow, /* 136 */ XPutImage, /* 137 */ XPolygonRegion, /* 138 */ XPointInRegion, /* 139 */ XVaCreateNestedList, /* 140 */ XSetICValues, /* 141 */ XGetICValues, /* 142 */ XSetICFocus, /* 143 */ - 0, /* 144 */ - 0, /* 145 */ - 0, /* 146 */ + XDestroyIC, /* 144 */ + XCreatePixmapCursor, /* 145 */ + XCreateGlyphCursor, /* 146 */ XFreeFontSet, /* 147 */ XCloseIM, /* 148 */ XRegisterIMInstantiateCallback, /* 149 */ XUnregisterIMInstantiateCallback, /* 150 */ XSetLocaleModifiers, /* 151 */ @@ -916,18 +1019,20 @@ #if defined(_WIN32) || defined(__CYGWIN__) /* WIN */ Tk_AttachHWND, /* 0 */ Tk_GetHINSTANCE, /* 1 */ Tk_GetHWND, /* 2 */ Tk_HWNDToWindow, /* 3 */ + Tk_PointerEvent, /* 4 */ + Tk_TranslateWinEvent, /* 5 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ 0, /* 0 */ 0, /* 1 */ 0, /* 2 */ 0, /* 3 */ TkMacOSXInitAppleEvents, /* 4 */ - 0, /* 5 */ + TkGenWMConfigureEvent_, /* 5 */ TkMacOSXInvalClipRgns, /* 6 */ 0, /* 7 */ TkMacOSXGetRootControl, /* 8 */ Tk_MacOSXSetupTkNotifier, /* 9 */ Tk_MacOSXIsAppInFront, /* 10 */ @@ -1025,11 +1130,11 @@ Tk_FreeGC, /* 72 */ Tk_FreeImage, /* 73 */ Tk_FreeOptions, /* 74 */ Tk_FreePixmap, /* 75 */ Tk_FreeTextLayout, /* 76 */ - 0, /* 77 */ + Tk_FreeXId, /* 77 */ Tk_GCForColor, /* 78 */ Tk_GeometryRequest, /* 79 */ Tk_Get3DBorder, /* 80 */ Tk_GetAllBindings, /* 81 */ Tk_GetAnchor, /* 82 */ @@ -1066,11 +1171,11 @@ Tk_GetVRootGeometry, /* 113 */ Tk_Grab, /* 114 */ Tk_HandleEvent, /* 115 */ Tk_IdToWindow, /* 116 */ Tk_ImageChanged, /* 117 */ - 0, /* 118 */ + Tk_Init, /* 118 */ Tk_InternAtom, /* 119 */ Tk_IntersectTextLayout, /* 120 */ Tk_MaintainGeometry, /* 121 */ Tk_MainWindow, /* 122 */ Tk_MakeWindowExist, /* 123 */ @@ -1092,26 +1197,26 @@ Tk_NameOfJustify, /* 139 */ Tk_NameOfRelief, /* 140 */ Tk_NameToWindow, /* 141 */ Tk_OwnSelection, /* 142 */ Tk_ParseArgv, /* 143 */ - 0, /* 144 */ - 0, /* 145 */ + Tk_PhotoPutBlock_NoComposite, /* 144 */ + Tk_PhotoPutZoomedBlock_NoComposite, /* 145 */ Tk_PhotoGetImage, /* 146 */ Tk_PhotoBlank, /* 147 */ - 0, /* 148 */ + Tk_PhotoExpand_Panic, /* 148 */ Tk_PhotoGetSize, /* 149 */ - 0, /* 150 */ + Tk_PhotoSetSize_Panic, /* 150 */ Tk_PointToChar, /* 151 */ Tk_PostscriptFontName, /* 152 */ Tk_PreserveColormap, /* 153 */ Tk_QueueWindowEvent, /* 154 */ Tk_RedrawImage, /* 155 */ Tk_ResizeWindow, /* 156 */ Tk_RestackWindow, /* 157 */ Tk_RestrictEvents, /* 158 */ - 0, /* 159 */ + Tk_SafeInit, /* 159 */ Tk_SetAppName, /* 160 */ Tk_SetBackgroundFromBorder, /* 161 */ Tk_SetClass, /* 162 */ Tk_SetGrid, /* 163 */ Tk_SetInternalBorder, /* 164 */ @@ -1160,15 +1265,15 @@ Tk_GetMMFromObj, /* 207 */ Tk_GetPixelsFromObj, /* 208 */ Tk_GetReliefFromObj, /* 209 */ Tk_GetScrollInfoObj, /* 210 */ Tk_InitOptions, /* 211 */ - 0, /* 212 */ + Tk_MainEx, /* 212 */ Tk_RestoreSavedOptions, /* 213 */ Tk_SetOptions, /* 214 */ Tk_InitConsoleChannels, /* 215 */ - 0, /* 216 */ + Tk_CreateConsoleWindow, /* 216 */ Tk_CreateSmoothMethod, /* 217 */ 0, /* 218 */ 0, /* 219 */ Tk_GetDash, /* 220 */ Tk_CreateOutline, /* 221 */ @@ -1194,12 +1299,12 @@ Tk_CreateAnonymousWindow, /* 241 */ Tk_SetClassProcs, /* 242 */ Tk_SetInternalBorderEx, /* 243 */ Tk_SetMinimumRequestSize, /* 244 */ Tk_SetCaretPos, /* 245 */ - 0, /* 246 */ - 0, /* 247 */ + Tk_PhotoPutBlock_Panic, /* 246 */ + Tk_PhotoPutZoomedBlock_Panic, /* 247 */ Tk_CollapseMotionEvents, /* 248 */ Tk_RegisterStyleEngine, /* 249 */ Tk_GetStyleEngine, /* 250 */ Tk_RegisterStyledElement, /* 251 */ Tk_GetElementId, /* 252 */ @@ -1206,12 +1311,12 @@ Tk_CreateStyle, /* 253 */ Tk_GetStyle, /* 254 */ Tk_FreeStyle, /* 255 */ Tk_NameOfStyle, /* 256 */ Tk_AllocStyleFromObj, /* 257 */ - 0, /* 258 */ - 0, /* 259 */ + Tk_GetStyleFromObj, /* 258 */ + Tk_FreeStyleFromObj, /* 259 */ Tk_GetStyledElement, /* 260 */ Tk_GetElementSize, /* 261 */ Tk_GetElementBox, /* 262 */ Tk_GetElementBorderWidth, /* 263 */ Tk_DrawElement, /* 264 */ @@ -1220,12 +1325,12 @@ Tk_PhotoPutZoomedBlock, /* 267 */ Tk_PhotoSetSize, /* 268 */ Tk_GetUserInactiveTime, /* 269 */ Tk_ResetUserInactiveTime, /* 270 */ Tk_Interp, /* 271 */ - 0, /* 272 */ - 0, /* 273 */ + Tk_CreateOldImageType, /* 272 */ + Tk_CreateOldPhotoImageFormat, /* 273 */ Tk_AlwaysShowSelection, /* 274 */ Tk_GetButtonMask, /* 275 */ Tk_GetDoublePixelsFromObj, /* 276 */ Tk_NewWindowObj, /* 277 */ Tk_SendVirtualEvent, /* 278 */ @@ -1239,10 +1344,14 @@ Tk_UseWindow, /* 286 */ Tk_MakeContainer, /* 287 */ Tk_GetOtherWindow, /* 288 */ Tk_Get3DBorderColors, /* 289 */ Tk_MakeWindow, /* 290 */ + Tk_UnderlineCharsInContext, /* 291 */ + Tk_DrawCharsInContext, /* 292 */ + Tk_MeasureCharsInContext, /* 293 */ + TkUnusedStubEntry, /* 294 */ }; /* !END!: Do not edit above this line. */ Index: generic/tkTest.c ================================================================== --- generic/tkTest.c +++ generic/tkTest.c @@ -206,11 +206,11 @@ Tktest_Init( Tcl_Interp *interp) /* Interpreter for application. */ { static int initialized = 0; - if (Tcl_InitStubs(interp, "8.7-", 0) == NULL) { + if (Tcl_InitStubs(interp, "8.6-", 0) == NULL) { return TCL_ERROR; } if (Tk_InitStubs(interp, TK_VERSION, 0) == NULL) { return TCL_ERROR; } @@ -269,10 +269,18 @@ if (!initialized) { initialized = 1; Tk_CreateImageType(&imageType); } + + /* + * Enable testing of legacy interfaces. + */ + + if (TkOldTestInit(interp) != TCL_OK) { + return TCL_ERROR; + } /* * And finally add any platform specific test commands. */ Index: generic/tkText.c ================================================================== --- generic/tkText.c +++ generic/tkText.c @@ -25,10 +25,20 @@ #ifdef _WIN32 #include "tkWinInt.h" #endif +/* + * For compatibility with Tk 4.0 through 8.4.x, we allow tabs to be + * mis-specified with non-increasing values. These are converted into tabs + * which are the equivalent of at least a character width apart. + */ + +#if (TK_MAJOR_VERSION < 9) +#define _TK_ALLOW_DECREASING_TABS +#endif + #include "tkText.h" /* * Used to avoid having to allocate and deallocate arrays on the fly for * commonly used functions. Must be > 0. @@ -118,11 +128,11 @@ NULL, 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_BOOLEAN, "-blockcursor", "blockCursor", "BlockCursor", DEF_TEXT_BLOCK_CURSOR, TCL_INDEX_NONE, offsetof(TkText, insertCursorType), 0, 0, 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_TEXT_BORDER_WIDTH, offsetof(TkText, borderWidthObj), TCL_INDEX_NONE, + DEF_TEXT_BORDER_WIDTH, TCL_INDEX_NONE, offsetof(TkText, borderWidth), 0, 0, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", DEF_TEXT_CURSOR, TCL_INDEX_NONE, offsetof(TkText, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_CUSTOM, "-endline", NULL, NULL, @@ -138,21 +148,21 @@ TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", DEF_TEXT_FG, TCL_INDEX_NONE, offsetof(TkText, fgColor), 0, 0, 0}, {TK_OPTION_PIXELS, "-height", "height", "Height", - DEF_TEXT_HEIGHT, offsetof(TkText, heightObj), TCL_INDEX_NONE, 0, 0, 0}, + DEF_TEXT_HEIGHT, TCL_INDEX_NONE, offsetof(TkText, height), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_TEXT_HIGHLIGHT_BG, TCL_INDEX_NONE, offsetof(TkText, highlightBgColorPtr), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", DEF_TEXT_HIGHLIGHT, TCL_INDEX_NONE, offsetof(TkText, highlightColorPtr), 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", - "HighlightThickness", DEF_TEXT_HIGHLIGHT_WIDTH, offsetof(TkText, highlightWidthObj), - TCL_INDEX_NONE, 0, 0, TK_TEXT_LINE_GEOMETRY}, + "HighlightThickness", DEF_TEXT_HIGHLIGHT_WIDTH, TCL_INDEX_NONE, + offsetof(TkText, highlightWidth), 0, 0, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_BORDER, "-inactiveselectbackground","inactiveSelectBackground", "Foreground", DEF_TEXT_INACTIVE_SELECT_BG_COLOR, TCL_INDEX_NONE, offsetof(TkText, inactiveSelBorder), TK_OPTION_NULL_OK, DEF_TEXT_SELECT_MONO, 0}, @@ -159,12 +169,12 @@ {TK_OPTION_BORDER, "-insertbackground", "insertBackground", "Foreground", DEF_TEXT_INSERT_BG, TCL_INDEX_NONE, offsetof(TkText, insertBorder), 0, 0, 0}, {TK_OPTION_PIXELS, "-insertborderwidth", "insertBorderWidth", - "BorderWidth", DEF_TEXT_INSERT_BD_COLOR, offsetof(TkText, insertBorderWidthObj), - TCL_INDEX_NONE, 0, + "BorderWidth", DEF_TEXT_INSERT_BD_COLOR, TCL_INDEX_NONE, + offsetof(TkText, insertBorderWidth), 0, DEF_TEXT_INSERT_BD_MONO, 0}, {TK_OPTION_INT, "-insertofftime", "insertOffTime", "OffTime", DEF_TEXT_INSERT_OFF_TIME, TCL_INDEX_NONE, offsetof(TkText, insertOffTime), 0, 0, 0}, {TK_OPTION_INT, "-insertontime", "insertOnTime", "OnTime", @@ -173,42 +183,42 @@ {TK_OPTION_STRING_TABLE, "-insertunfocussed", "insertUnfocussed", "InsertUnfocussed", DEF_TEXT_INSERT_UNFOCUSSED, TCL_INDEX_NONE, offsetof(TkText, insertUnfocussed), TK_OPTION_ENUM_VAR, insertUnfocussedStrings, 0}, {TK_OPTION_PIXELS, "-insertwidth", "insertWidth", "InsertWidth", - DEF_TEXT_INSERT_WIDTH, offsetof(TkText, insertWidthObj), TCL_INDEX_NONE, + DEF_TEXT_INSERT_WIDTH, TCL_INDEX_NONE, offsetof(TkText, insertWidth), 0, 0, 0}, {TK_OPTION_INT, "-maxundo", "maxUndo", "MaxUndo", DEF_TEXT_MAX_UNDO, TCL_INDEX_NONE, offsetof(TkText, maxUndo), TK_OPTION_DONT_SET_DEFAULT, 0, 0}, {TK_OPTION_PIXELS, "-padx", "padX", "Pad", - DEF_TEXT_PADX, offsetof(TkText, padXObj), TCL_INDEX_NONE, 0, 0, + DEF_TEXT_PADX, TCL_INDEX_NONE, offsetof(TkText, padX), 0, 0, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_PIXELS, "-pady", "padY", "Pad", - DEF_TEXT_PADY, offsetof(TkText, padYObj), TCL_INDEX_NONE, 0, 0, 0}, + DEF_TEXT_PADY, TCL_INDEX_NONE, offsetof(TkText, padY), 0, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", DEF_TEXT_RELIEF, TCL_INDEX_NONE, offsetof(TkText, relief), 0, 0, 0}, {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground", DEF_TEXT_SELECT_COLOR, TCL_INDEX_NONE, offsetof(TkText, selBorder), 0, DEF_TEXT_SELECT_MONO, 0}, {TK_OPTION_PIXELS, "-selectborderwidth", "selectBorderWidth", "BorderWidth", DEF_TEXT_SELECT_BD_COLOR, offsetof(TkText, selBorderWidthObj), TCL_INDEX_NONE, - 0, DEF_TEXT_SELECT_BD_MONO, 0}, + TK_OPTION_NULL_OK, DEF_TEXT_SELECT_BD_MONO, 0}, {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background", DEF_TEXT_SELECT_FG_COLOR, TCL_INDEX_NONE, offsetof(TkText, selFgColorPtr), TK_OPTION_NULL_OK, DEF_TEXT_SELECT_FG_MONO, 0}, {TK_OPTION_BOOLEAN, "-setgrid", "setGrid", "SetGrid", DEF_TEXT_SET_GRID, TCL_INDEX_NONE, offsetof(TkText, setGrid), 0, 0, 0}, {TK_OPTION_PIXELS, "-spacing1", "spacing1", "Spacing", - DEF_TEXT_SPACING1, offsetof(TkText, spacing1Obj), TCL_INDEX_NONE, + DEF_TEXT_SPACING1, TCL_INDEX_NONE, offsetof(TkText, spacing1), 0, 0, TK_TEXT_LINE_GEOMETRY }, {TK_OPTION_PIXELS, "-spacing2", "spacing2", "Spacing", - DEF_TEXT_SPACING2, offsetof(TkText, spacing2Obj), TCL_INDEX_NONE, + DEF_TEXT_SPACING2, TCL_INDEX_NONE, offsetof(TkText, spacing2), 0, 0, TK_TEXT_LINE_GEOMETRY }, {TK_OPTION_PIXELS, "-spacing3", "spacing3", "Spacing", - DEF_TEXT_SPACING3, offsetof(TkText, spacing3Obj), TCL_INDEX_NONE, + DEF_TEXT_SPACING3, TCL_INDEX_NONE, offsetof(TkText, spacing3), 0, 0, TK_TEXT_LINE_GEOMETRY }, {TK_OPTION_CUSTOM, "-startline", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkText, start), TK_OPTION_NULL_OK, &lineOption, TK_TEXT_LINE_RANGE}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", @@ -1444,11 +1454,11 @@ int deleteInsertOffset, insertLength, indexFromLine, indexFromByteOffset; Tcl_Size j; insertLength = 0; for (j = 4; j < objc; j += 2) { - insertLength += Tcl_GetCharLength(objv[j]); + insertLength += TkGetCharLength(objv[j]); } /* * Calculate 'deleteInsertOffset' as an offset we will apply * to the insertion point after this operation. @@ -2061,12 +2071,10 @@ Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_SavedOptions savedOptions; int oldExport = (textPtr->exportSelection) && (!Tcl_IsSafe(textPtr->interp)); int mask = 0; - int selBorderWidth = INT_MIN, spacing1, spacing2, spacing3; - int insertBorderWidth, insertWidth; if (Tk_SetOptions(interp, (char *) textPtr, textPtr->optionTable, objc, objv, textPtr->tkwin, &savedOptions, &mask) != TCL_OK) { return TCL_ERROR; } @@ -2202,57 +2210,19 @@ /* * Don't allow negative spacings. */ - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, textPtr->spacing1Obj, &spacing1); - if (spacing1 < 0) { - spacing1 = 0; - Tcl_DecrRefCount(textPtr->spacing1Obj); - textPtr->spacing1Obj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(textPtr->spacing1Obj); - } - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, textPtr->spacing2Obj, &spacing2); - if (spacing2 < 0) { - spacing2 = 0; - Tcl_DecrRefCount(textPtr->spacing2Obj); - textPtr->spacing2Obj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(textPtr->spacing2Obj); - } - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, textPtr->spacing3Obj, &spacing3); - if (spacing3 < 0) { - spacing3 = 0; - Tcl_DecrRefCount(textPtr->spacing3Obj); - textPtr->spacing3Obj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(textPtr->spacing3Obj); - } - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, textPtr->insertBorderWidthObj, &insertBorderWidth); - if (insertBorderWidth < 0) { - insertBorderWidth = 0; - Tcl_DecrRefCount(textPtr->insertBorderWidthObj); - textPtr->insertBorderWidthObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(textPtr->insertBorderWidthObj); - } - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, textPtr->insertWidthObj, &insertWidth); - if (insertWidth < 0) { - insertWidth = 0; - Tcl_DecrRefCount(textPtr->insertWidthObj); - textPtr->insertWidthObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(textPtr->insertWidthObj); - } - if (textPtr->selBorderWidthObj) { - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, textPtr->selBorderWidthObj, &selBorderWidth); - } - if (selBorderWidth < 0) { - selBorderWidth = 0; - if (textPtr->selBorderWidthObj) { - Tcl_DecrRefCount(textPtr->selBorderWidthObj); - } - textPtr->selBorderWidthObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(textPtr->selBorderWidthObj); - } - + if (textPtr->spacing1 < 0) { + textPtr->spacing1 = 0; + } + if (textPtr->spacing2 < 0) { + textPtr->spacing2 = 0; + } + if (textPtr->spacing3 < 0) { + textPtr->spacing3 = 0; + } /* * Parse tab stops. */ @@ -2259,11 +2229,11 @@ if (textPtr->tabArrayPtr != NULL) { ckfree(textPtr->tabArrayPtr); textPtr->tabArrayPtr = NULL; } if (textPtr->tabOptionObj != NULL) { - textPtr->tabArrayPtr = TkTextGetTabs(interp, textPtr->tkwin, + textPtr->tabArrayPtr = TkTextGetTabs(interp, textPtr, textPtr->tabOptionObj); if (textPtr->tabArrayPtr == NULL) { Tcl_AddErrorInfo(interp,"\n (while processing -tabs option)"); Tk_RestoreSavedOptions(&savedOptions); return TCL_ERROR; @@ -2290,11 +2260,11 @@ } else { textPtr->selTagPtr->selFgColor = textPtr->selFgColorPtr; } textPtr->selTagPtr->affectsDisplay = 0; textPtr->selTagPtr->affectsDisplayGeometry = 0; - if ((textPtr->selTagPtr->elide >= 0) + if ((textPtr->selTagPtr->elideObj != NULL) || (textPtr->selTagPtr->tkfont != NULL) || (textPtr->selTagPtr->justify != TK_JUSTIFY_NULL) || (textPtr->selTagPtr->lMargin1Obj != NULL) || (textPtr->selTagPtr->lMargin2Obj != NULL) || (textPtr->selTagPtr->offsetObj != NULL) @@ -2316,13 +2286,13 @@ || (textPtr->selTagPtr->relief != TK_RELIEF_NULL) || (textPtr->selTagPtr->bgStipple != None) || (textPtr->selTagPtr->fgColor != NULL) || (textPtr->selTagPtr->selFgColor != NULL) || (textPtr->selTagPtr->fgStipple != None) - || (textPtr->selTagPtr->overstrike >= 0) + || (textPtr->selTagPtr->overstrikeObj != NULL) || (textPtr->selTagPtr->overstrikeColor != NULL) - || (textPtr->selTagPtr->underline >= 0) + || (textPtr->selTagPtr->underlineObj != NULL) || (textPtr->selTagPtr->underlineColor != NULL) || (textPtr->selTagPtr->lMarginColor != NULL) || (textPtr->selTagPtr->rMarginColor != NULL)) { textPtr->selTagPtr->affectsDisplay = 1; } @@ -2366,10 +2336,13 @@ * window to be redisplayed. */ if (textPtr->width <= 0) { textPtr->width = 1; + } + if (textPtr->height <= 0) { + textPtr->height = 1; } Tk_FreeSavedOptions(&savedOptions); TextWorldChanged(textPtr, mask); return TCL_OK; } @@ -2428,15 +2401,12 @@ TkText *textPtr, /* Information about widget. */ int mask) /* OR'd collection of bits showing what has * changed. */ { Tk_FontMetrics fm; - int border, height; + int border; int oldCharHeight = textPtr->charHeight; - int padX, padY; - int spacing1, spacing3; - int borderWidth, highlightWidth; textPtr->charWidth = Tk_TextWidth(textPtr->tkfont, "0", 1); if (textPtr->charWidth <= 0) { textPtr->charWidth = 1; } @@ -2447,30 +2417,21 @@ textPtr->charHeight = 1; } if (textPtr->charHeight != oldCharHeight) { TkBTreeClientRangeChanged(textPtr, textPtr->charHeight); } - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, textPtr->padXObj, &padX); - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, textPtr->padYObj, &padY); - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, textPtr->spacing1Obj, &spacing1); - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, textPtr->spacing3Obj, &spacing3); - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, textPtr->borderWidthObj, &borderWidth); - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, textPtr->highlightWidthObj, &highlightWidth); - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, textPtr->heightObj, &height); - if (height < 1) { - height = 1; - } - border = borderWidth + highlightWidth; + border = textPtr->borderWidth + textPtr->highlightWidth; Tk_GeometryRequest(textPtr->tkwin, - textPtr->width * textPtr->charWidth + 2 * padX + 2 * border, - height * (fm.linespace + spacing1 + spacing3) - + 2 * padY + 2*border); + textPtr->width * textPtr->charWidth + 2 * textPtr->padX + 2 * border, + textPtr->height * (fm.linespace + textPtr->spacing1 + textPtr->spacing3) + + 2 * textPtr->padY + 2 * border); Tk_SetInternalBorderEx(textPtr->tkwin, - border + padX, border + padX, border + padY, border + padY); + border + textPtr->padX, border + textPtr->padX, + border + textPtr->padY, border + textPtr->padY); if (textPtr->setGrid) { - Tk_SetGrid(textPtr->tkwin, textPtr->width, height, + Tk_SetGrid(textPtr->tkwin, textPtr->width, textPtr->height, textPtr->charWidth, textPtr->charHeight); } else { Tk_UnsetGrid(textPtr->tkwin); } @@ -2501,11 +2462,10 @@ void *clientData, /* Information about window. */ XEvent *eventPtr) /* Information about event. */ { TkText *textPtr = (TkText *)clientData; TkTextIndex index, index2; - int highlightWidth; if (eventPtr->type == Expose) { TkTextRedrawRegion(textPtr, eventPtr->xexpose.x, eventPtr->xexpose.y, eventPtr->xexpose.width, eventPtr->xexpose.height); @@ -2578,13 +2538,13 @@ * While we wish to redisplay, no heights have changed, so no need * to call TkTextInvalidateLineMetrics. */ TkTextChanged(NULL, textPtr, &index, &index2); - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, textPtr->highlightWidthObj, &highlightWidth); - if (highlightWidth > 0) { - TkTextRedrawRegion(textPtr, 0, 0, highlightWidth, highlightWidth); + if (textPtr->highlightWidth > 0) { + TkTextRedrawRegion(textPtr, 0, 0, textPtr->highlightWidth, + textPtr->highlightWidth); } } } } @@ -3701,20 +3661,18 @@ textPtr->insertOnTime, TextBlinkProc, textPtr); } redrawInsert: TkTextMarkSegToIndex(textPtr, textPtr->insertMarkPtr, &index); if (TkTextIndexBbox(textPtr, &index, &x, &y, &w, &h, &charWidth) == 0) { - int insertWidth; - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, textPtr->insertWidthObj, &insertWidth); if (textPtr->insertCursorType) { /* Block cursor */ TkTextRedrawRegion(textPtr, x - textPtr->width / 2, y, - charWidth + insertWidth / 2, h); + charWidth + textPtr->insertWidth / 2, h); } else { /* I-beam cursor */ - TkTextRedrawRegion(textPtr, x - insertWidth / 2, y, - insertWidth, h); + TkTextRedrawRegion(textPtr, x - textPtr->insertWidth / 2, y, + textPtr->insertWidth, h); } } } /* @@ -4126,16 +4084,16 @@ || !TkTextIsElided(textPtr, &curIndex, NULL))) { if (leftToScan < segPtr->size) { if (searchSpecPtr->exact) { index += leftToScan; } else { - index += Tcl_NumUtfChars(segPtr->body.chars, leftToScan); + index += TkNumUtfChars(segPtr->body.chars, leftToScan); } } else if (searchSpecPtr->exact) { index += segPtr->size; } else { - index += Tcl_NumUtfChars(segPtr->body.chars, -1); + index += TkNumUtfChars(segPtr->body.chars, -1); } } leftToScan -= segPtr->size; } return index; @@ -4256,11 +4214,11 @@ if (lenPtr != NULL) { if (searchSpecPtr->exact) { Tcl_GetString(theLine); *lenPtr = theLine->length; } else { - *lenPtr = Tcl_GetCharLength(theLine); + *lenPtr = TkGetCharLength(theLine); } } return linePtr; } @@ -4326,11 +4284,11 @@ */ if (searchSpecPtr->exact) { const char *startOfLine = Tcl_GetString(theLine); - numChars = Tcl_NumUtfChars(startOfLine + matchOffset, matchLength); + numChars = TkNumUtfChars(startOfLine + matchOffset, matchLength); } else { numChars = matchLength; } /* @@ -4385,17 +4343,17 @@ } else if (!searchSpecPtr->searchElide && TkTextIsElided(textPtr, &curIndex, NULL)) { if (searchSpecPtr->exact) { matchOffset += segPtr->size; } else { - matchOffset += Tcl_NumUtfChars(segPtr->body.chars, -1); + matchOffset += TkNumUtfChars(segPtr->body.chars, -1); } } else { if (searchSpecPtr->exact) { leftToScan -= (int)segPtr->size; } else { - leftToScan -= Tcl_NumUtfChars(segPtr->body.chars, -1); + leftToScan -= TkNumUtfChars(segPtr->body.chars, -1); } } curIndex.byteIndex += segPtr->size; } if (segPtr == NULL && leftToScan >= 0) { @@ -4476,17 +4434,17 @@ numChars += segPtr->size; continue; } else if (!searchSpecPtr->searchElide && TkTextIsElided(textPtr, &curIndex, NULL)) { - numChars += Tcl_NumUtfChars(segPtr->body.chars, -1); + numChars += TkNumUtfChars(segPtr->body.chars, -1); continue; } if (searchSpecPtr->exact) { leftToScan -= segPtr->size; } else { - leftToScan -= Tcl_NumUtfChars(segPtr->body.chars, -1); + leftToScan -= TkNumUtfChars(segPtr->body.chars, -1); } } /* * Now store the count result, if it is wanted. @@ -4526,11 +4484,11 @@ */ TkTextTabArray * TkTextGetTabs( Tcl_Interp *interp, /* Used for error reporting. */ - Tk_Window tkwin, /* Information about the window. */ + const TkText *textPtr, /* Information about the text widget. */ Tcl_Obj *stringPtr) /* Description of the tab stops. See the text * manual entry for details. */ { Tcl_Size objc, i, count; Tcl_Obj **objv; @@ -4577,11 +4535,11 @@ /* * This will round fractional pixels above 0.5 upwards, and otherwise * downwards, to find the right integer pixel position. */ - if (Tk_GetPixelsFromObj(interp, tkwin, objv[i], + if (Tk_GetPixelsFromObj(interp, textPtr->tkwin, objv[i], &tabPtr->location) != TCL_OK) { goto error; } if (tabPtr->location <= 0) { @@ -4591,11 +4549,11 @@ Tcl_SetErrorCode(interp, "TK", "VALUE", "TAB_STOP", (char *)NULL); goto error; } prevStop = lastStop; - if (Tk_GetDoublePixelsFromObj(interp, tkwin, objv[i], + if (Tk_GetDoublePixelsFromObj(interp, textPtr->tkwin, objv[i], &lastStop) != TCL_OK) { goto error; } if (i > 0 && (tabPtr->location <= (tabPtr-1)->location)) { @@ -4602,16 +4560,31 @@ /* * This tab is actually to the left of the previous one, which is * illegal. */ +#ifdef _TK_ALLOW_DECREASING_TABS + /* + * Force the tab to be a typical character width to the right of + * the previous one, and update the 'lastStop' with the changed + * position. + */ + + if (textPtr->charWidth > 0) { + tabPtr->location = (tabPtr-1)->location + textPtr->charWidth; + } else { + tabPtr->location = (tabPtr-1)->location + 8; + } + lastStop = tabPtr->location; +#else Tcl_SetObjResult(interp, Tcl_ObjPrintf( "tabs must be monotonically increasing, but \"%s\" is " "smaller than or equal to the previous tab", Tcl_GetString(objv[i]))); Tcl_SetErrorCode(interp, "TK", "VALUE", "TAB_STOP", (char *)NULL); goto error; +#endif /* _TK_ALLOW_DECREASING_TABS */ } tabArrayPtr->numTabs++; /* @@ -4626,11 +4599,11 @@ /* * There may be a more efficient way of getting this. */ - Tcl_UtfToUniChar(Tcl_GetString(objv[i+1]), &ch); + TkUtfToUniChar(Tcl_GetString(objv[i+1]), &ch); if (!Tcl_UniCharIsAlpha(ch)) { continue; } i += 1; @@ -6213,11 +6186,11 @@ if (alreadySearchOffset < 0) { break; } } else { firstOffset = p - startOfLine + - Tcl_UtfToUniChar(startOfLine+matchOffset,&ch); + TkUtfToUniChar(startOfLine+matchOffset,&ch); } } } while (searchSpecPtr->all); } else { int maxExtraLines = 0; Index: generic/tkText.h ================================================================== --- generic/tkText.h +++ generic/tkText.h @@ -1105,11 +1105,11 @@ TkSharedText *sharedTextPtr, Tcl_Obj *idxPtr, TkTextIndex *indexPtr); MODULE_SCOPE const TkTextIndex *TkTextGetIndexFromObj(Tcl_Interp *interp, TkText *textPtr, Tcl_Obj *objPtr); MODULE_SCOPE TkTextTabArray *TkTextGetTabs(Tcl_Interp *interp, - Tk_Window tkwin, Tcl_Obj *stringPtr); + const TkText *textPtr, Tcl_Obj *stringPtr); MODULE_SCOPE void TkTextFindDisplayLineEnd(TkText *textPtr, TkTextIndex *indexPtr, int end, int *xOffset); MODULE_SCOPE void TkTextIndexBackChars(const TkText *textPtr, const TkTextIndex *srcPtr, int count, TkTextIndex *dstPtr, TkTextCountType type); Index: generic/tkTextBTree.c ================================================================== --- generic/tkTextBTree.c +++ generic/tkTextBTree.c @@ -3558,11 +3558,11 @@ segPtr = linePtr->segPtr; while ((index + (int)segPtr->size) <= indexPtr->byteIndex) { if ((segPtr->typePtr == &tkTextToggleOnType) || (segPtr->typePtr == &tkTextToggleOffType)) { tagPtr = segPtr->body.toggle.tagPtr; - if (tagPtr->elide >= 0) { + if (tagPtr->elideObj != NULL) { infoPtr->tagPtrs[tagPtr->priority] = tagPtr; infoPtr->tagCnts[tagPtr->priority]++; } } @@ -3598,11 +3598,11 @@ for (segPtr = siblingLinePtr->segPtr; segPtr != NULL; segPtr = segPtr->nextPtr) { if ((segPtr->typePtr == &tkTextToggleOnType) || (segPtr->typePtr == &tkTextToggleOffType)) { tagPtr = segPtr->body.toggle.tagPtr; - if (tagPtr->elide >= 0) { + if (tagPtr->elideObj != NULL) { infoPtr->tagPtrs[tagPtr->priority] = tagPtr; infoPtr->tagCnts[tagPtr->priority]++; } } } @@ -3622,11 +3622,11 @@ siblingPtr != nodePtr; siblingPtr = siblingPtr->nextPtr) { for (summaryPtr = siblingPtr->summaryPtr; summaryPtr != NULL; summaryPtr = summaryPtr->nextPtr) { if (summaryPtr->toggleCount & 1) { tagPtr = summaryPtr->tagPtr; - if (tagPtr->elide >= 0) { + if (tagPtr->elideObj != NULL) { infoPtr->tagPtrs[tagPtr->priority] = tagPtr; infoPtr->tagCnts[tagPtr->priority] += summaryPtr->toggleCount; } } @@ -3640,11 +3640,11 @@ */ infoPtr->elidePriority = -1; for (i = infoPtr->numTags-1; i >=0; i--) { if (infoPtr->tagCnts[i] & 1) { - infoPtr->elide = infoPtr->tagPtrs[i]->elide > 0; + infoPtr->elide = infoPtr->tagPtrs[i]->elideObj && infoPtr->tagPtrs[i]->elide != 0; /* * Note: i == infoPtr->tagPtrs[i]->priority */ Index: generic/tkTextDisp.c ================================================================== --- generic/tkTextDisp.c +++ generic/tkTextDisp.c @@ -802,13 +802,13 @@ styleValues.fgColor = textPtr->fgColor; styleValues.underlineColor = textPtr->fgColor; styleValues.overstrikeColor = textPtr->fgColor; styleValues.tkfont = textPtr->tkfont; styleValues.justify = TK_JUSTIFY_LEFT; - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, textPtr->spacing1Obj, &styleValues.spacing1); - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, textPtr->spacing2Obj, &styleValues.spacing2); - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, textPtr->spacing3Obj, &styleValues.spacing3); + styleValues.spacing1 = textPtr->spacing1; + styleValues.spacing2 = textPtr->spacing2; + styleValues.spacing3 = textPtr->spacing3; styleValues.tabArrayPtr = textPtr->tabArrayPtr; styleValues.tabStyle = textPtr->tabStyle; styleValues.wrapMode = textPtr->wrapMode; styleValues.elide = 0; isSelected = 0; @@ -913,18 +913,18 @@ if ((tagPtr->offsetObj != NULL) && (tagPtr->priority > offsetPrio)) { Tk_GetPixelsFromObj(NULL, textPtr->tkwin, tagPtr->offsetObj, &styleValues.offset); offsetPrio = tagPtr->priority; } - if ((tagPtr->overstrike >= 0) + if ((tagPtr->overstrikeObj != NULL) && (tagPtr->priority > overstrikePrio)) { - styleValues.overstrike = tagPtr->overstrike > 0; + styleValues.overstrike = tagPtr->overstrike != 0; overstrikePrio = tagPtr->priority; if (tagPtr->overstrikeColor != NULL) { - styleValues.overstrikeColor = tagPtr->overstrikeColor; + styleValues.overstrikeColor = tagPtr->overstrikeColor; } else if (fgColor != NULL) { - styleValues.overstrikeColor = fgColor; + styleValues.overstrikeColor = fgColor; } } if ((tagPtr->rMarginObj != NULL) && (tagPtr->priority > rMarginPrio)) { Tk_GetPixelsFromObj(NULL, textPtr->tkwin, tagPtr->rMarginObj, &styleValues.rMargin); @@ -959,23 +959,23 @@ || (tagPtr->tabStyle == TK_TEXT_TABSTYLE_WORDPROCESSOR)) && (tagPtr->priority > tabStylePrio)) { styleValues.tabStyle = tagPtr->tabStyle; tabStylePrio = tagPtr->priority; } - if ((tagPtr->underline >= 0) + if ((tagPtr->underlineObj != NULL) && (tagPtr->priority > underlinePrio)) { - styleValues.underline = tagPtr->underline > 0; + styleValues.underline = tagPtr->underline != 0; underlinePrio = tagPtr->priority; if (tagPtr->underlineColor != NULL) { styleValues.underlineColor = tagPtr->underlineColor; } else if (fgColor != NULL) { styleValues.underlineColor = fgColor; } } - if ((tagPtr->elide >= 0) + if ((tagPtr->elideObj != NULL) && (tagPtr->priority > elidePrio)) { - styleValues.elide = tagPtr->elide > 0; + styleValues.elide = tagPtr->elide != 0; elidePrio = tagPtr->priority; } if (((tagPtr->wrapMode == TEXT_WRAPMODE_CHAR) || (tagPtr->wrapMode == TEXT_WRAPMODE_NONE) || (tagPtr->wrapMode == TEXT_WRAPMODE_WORD)) && (tagPtr->priority > wrapPrio)) { styleValues.wrapMode = tagPtr->wrapMode; @@ -1234,11 +1234,11 @@ * The elide state only changes if this tag is either the * current highest priority tag (and is therefore being * toggled off), or it's a new tag with higher priority. */ - if (tagPtr->elide >= 0) { + if (tagPtr->elideObj != NULL) { info.tagCnts[tagPtr->priority]++; if (info.tagCnts[tagPtr->priority] & 1) { info.tagPtrs[tagPtr->priority] = tagPtr; } if (tagPtr->priority >= info.elidePriority) { @@ -1259,17 +1259,17 @@ */ elide = 0; while (--info.elidePriority > 0) { if (info.tagCnts[info.elidePriority] & 1) { - elide = info.tagPtrs[info.elidePriority] - ->elide > 0; + elide = info.tagPtrs[info.elidePriority]->elideObj + && (info.tagPtrs[info.elidePriority]->elide != 0); break; } } } else { - elide = tagPtr->elide > 0; + elide = tagPtr->elideObj && (tagPtr->elide != 0); info.elidePriority = tagPtr->priority; } } } } @@ -1381,13 +1381,13 @@ * If have we have a tag toggle, there is a chance that * invisibility state changed, so bail out. */ } else if ((segPtr->typePtr == &tkTextToggleOffType) || (segPtr->typePtr == &tkTextToggleOnType)) { - if (segPtr->body.toggle.tagPtr->elide >= 0) { + if (segPtr->body.toggle.tagPtr->elideObj) { elide = (segPtr->typePtr == &tkTextToggleOffType) - ^ (segPtr->body.toggle.tagPtr->elide > 0); + ^ (segPtr->body.toggle.tagPtr->elide != 0); } } byteOffset = 0; segPtr = segPtr->nextPtr; @@ -4171,12 +4171,10 @@ Pixmap pixmap; int maxHeight, borders; int bottomY = 0; /* Initialization needed only to stop compiler * warnings. */ Tcl_Interp *interp; - int padX, padY; - int borderWidth, highlightWidth; if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) { /* * The widget has been deleted. Don't do anything. @@ -4366,13 +4364,10 @@ * bindings triggered by redisplay). */ dInfoPtr->flags &= ~REDRAW_PENDING; - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, textPtr->padXObj, &padX); - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, textPtr->padYObj, &padY); - /* * Redraw the borders if that's needed. */ if (dInfoPtr->flags & REDRAW_BORDERS) { @@ -4386,56 +4381,54 @@ */ goto end; } - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, textPtr->borderWidthObj, &borderWidth); - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, textPtr->highlightWidthObj, &highlightWidth); Tk_Draw3DRectangle(textPtr->tkwin, Tk_WindowId(textPtr->tkwin), - textPtr->border, highlightWidth, - highlightWidth, - Tk_Width(textPtr->tkwin) - 2 * highlightWidth, - Tk_Height(textPtr->tkwin) - 2 * highlightWidth, - borderWidth, textPtr->relief); - if (highlightWidth > 0) { + textPtr->border, textPtr->highlightWidth, + textPtr->highlightWidth, + Tk_Width(textPtr->tkwin) - 2 * textPtr->highlightWidth, + Tk_Height(textPtr->tkwin) - 2 * textPtr->highlightWidth, + textPtr->borderWidth, textPtr->relief); + if (textPtr->highlightWidth > 0) { GC fgGC, bgGC; bgGC = Tk_GCForColor(textPtr->highlightBgColorPtr, Tk_WindowId(textPtr->tkwin)); if (textPtr->flags & GOT_FOCUS) { fgGC = Tk_GCForColor(textPtr->highlightColorPtr, Tk_WindowId(textPtr->tkwin)); Tk_DrawHighlightBorder(textPtr->tkwin, fgGC, bgGC, - highlightWidth, Tk_WindowId(textPtr->tkwin)); + textPtr->highlightWidth, Tk_WindowId(textPtr->tkwin)); } else { Tk_DrawHighlightBorder(textPtr->tkwin, bgGC, bgGC, - highlightWidth, Tk_WindowId(textPtr->tkwin)); + textPtr->highlightWidth, Tk_WindowId(textPtr->tkwin)); } } - borders = borderWidth + highlightWidth; - if (padY > 0) { + borders = textPtr->borderWidth + textPtr->highlightWidth; + if (textPtr->padY > 0) { Tk_Fill3DRectangle(textPtr->tkwin, Tk_WindowId(textPtr->tkwin), textPtr->border, borders, borders, - Tk_Width(textPtr->tkwin) - 2 * borders, padY, + Tk_Width(textPtr->tkwin) - 2 * borders, textPtr->padY, 0, TK_RELIEF_FLAT); Tk_Fill3DRectangle(textPtr->tkwin, Tk_WindowId(textPtr->tkwin), textPtr->border, borders, - Tk_Height(textPtr->tkwin) - borders - padY, + Tk_Height(textPtr->tkwin) - borders - textPtr->padY, Tk_Width(textPtr->tkwin) - 2 * borders, - padY, 0, TK_RELIEF_FLAT); + textPtr->padY, 0, TK_RELIEF_FLAT); } - if (padX > 0) { + if (textPtr->padX > 0) { Tk_Fill3DRectangle(textPtr->tkwin, Tk_WindowId(textPtr->tkwin), - textPtr->border, borders, borders + padY, - padX, - Tk_Height(textPtr->tkwin) - 2 * borders -2 * padY, + textPtr->border, borders, borders + textPtr->padY, + textPtr->padX, + Tk_Height(textPtr->tkwin) - 2 * borders -2 * textPtr->padY, 0, TK_RELIEF_FLAT); Tk_Fill3DRectangle(textPtr->tkwin, Tk_WindowId(textPtr->tkwin), textPtr->border, - Tk_Width(textPtr->tkwin) - borders - padX, - borders + padY, padX, - Tk_Height(textPtr->tkwin) - 2 * borders -2 * padY, + Tk_Width(textPtr->tkwin) - borders - textPtr->padX, + borders + textPtr->padY, textPtr->padX, + Tk_Height(textPtr->tkwin) - 2 * borders -2 * textPtr->padY, 0, TK_RELIEF_FLAT); } dInfoPtr->flags &= ~REDRAW_BORDERS; } @@ -4614,12 +4607,12 @@ goto end; } Tk_Fill3DRectangle(textPtr->tkwin, Tk_WindowId(textPtr->tkwin), - textPtr->border, dInfoPtr->x - padX, bottomY, - dInfoPtr->maxX - (dInfoPtr->x - padX), + textPtr->border, dInfoPtr->x - textPtr->padX, bottomY, + dInfoPtr->maxX - (dInfoPtr->x - textPtr->padX), dInfoPtr->topOfEof-bottomY, 0, TK_RELIEF_FLAT); } dInfoPtr->topOfEof = bottomY; /* @@ -4759,12 +4752,10 @@ { DLine *dlPtr; TextDInfo *dInfoPtr = textPtr->dInfoPtr; int maxY, inset; XRectangle rect; - int padX, padY; - int borderWidth, highlightWidth; /* * Find all lines that overlap the given region and mark them for * redisplay. */ @@ -4781,20 +4772,16 @@ } if (dInfoPtr->topOfEof < maxY) { dInfoPtr->topOfEof = maxY; } - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, textPtr->padXObj, &padX); - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, textPtr->padYObj, &padY); - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, textPtr->borderWidthObj, &borderWidth); - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, textPtr->highlightWidthObj, &highlightWidth); - inset = borderWidth + highlightWidth; - if ((rect.x < (inset + padX)) - || (rect.y < (inset + padY)) + inset = textPtr->borderWidth + textPtr->highlightWidth; + if ((rect.x < (inset + textPtr->padX)) + || (rect.y < (inset + textPtr->padY)) || ((int) (rect.x + rect.width) > (Tk_Width(textPtr->tkwin) - - inset - padX)) - || (maxY > (Tk_Height(textPtr->tkwin) - inset - padY))) { + - inset - textPtr->padX)) + || (maxY > (Tk_Height(textPtr->tkwin) - inset - textPtr->padY))) { dInfoPtr->flags |= REDRAW_BORDERS; } } /* @@ -5205,12 +5192,10 @@ { TextDInfo *dInfoPtr = textPtr->dInfoPtr; GC newGC; XGCValues gcValues; Bool inSync = 1; - int padX, padY; - int borderWidth, highlightWidth; /* * Schedule the window redisplay. See TkTextChanged for the reason why * this has to be done before any calls to FreeDLines. */ @@ -5244,34 +5229,29 @@ * Recompute some overall things for the layout. Even if the window gets * very small, pretend that there's at least one pixel of drawing space in * it. */ - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, textPtr->padXObj, &padX); - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, textPtr->padYObj, &padY); - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, textPtr->borderWidthObj, &borderWidth); - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, textPtr->highlightWidthObj, &highlightWidth); - if (highlightWidth < 0) { - highlightWidth = 0; - Tcl_DecrRefCount(textPtr->highlightWidthObj); - textPtr->highlightWidthObj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(textPtr->highlightWidthObj); - } - dInfoPtr->x = highlightWidth + borderWidth + padX; - dInfoPtr->y = highlightWidth + borderWidth + padY; - dInfoPtr->maxX = Tk_Width(textPtr->tkwin) - highlightWidth - - borderWidth - padX; + if (textPtr->highlightWidth < 0) { + textPtr->highlightWidth = 0; + } + dInfoPtr->x = textPtr->highlightWidth + textPtr->borderWidth + + textPtr->padX; + dInfoPtr->y = textPtr->highlightWidth + textPtr->borderWidth + + textPtr->padY; + dInfoPtr->maxX = Tk_Width(textPtr->tkwin) - textPtr->highlightWidth + - textPtr->borderWidth - textPtr->padX; if (dInfoPtr->maxX <= dInfoPtr->x) { dInfoPtr->maxX = dInfoPtr->x + 1; } /* * This is the only place where dInfoPtr->maxY is set. */ - dInfoPtr->maxY = Tk_Height(textPtr->tkwin) - highlightWidth - - borderWidth - padY; + dInfoPtr->maxY = Tk_Height(textPtr->tkwin) - textPtr->highlightWidth + - textPtr->borderWidth - textPtr->padY; if (dInfoPtr->maxY <= dInfoPtr->y) { dInfoPtr->maxY = dInfoPtr->y + 1; } dInfoPtr->topOfEof = dInfoPtr->maxY; @@ -7696,11 +7676,11 @@ #endif /* TK_LAYOUT_WITH_BASE_CHUNKS */ if (bytesThatFit + 1 <= maxBytes) { if ((bytesThatFit == 0) && noCharsYet) { int ch; - int chLen = Tcl_UtfToUniChar(p, &ch); + int chLen = TkUtfToUniChar(p, &ch); #ifdef TK_LAYOUT_WITH_BASE_CHUNKS bytesThatFit = CharChunkMeasureChars(chunkPtr, line, lineOffset+chLen, lineOffset, -1, chunkPtr->x, -1, 0, &nextX); @@ -8054,27 +8034,27 @@ } if (len <= 0) { return; } - TkpDrawCharsInContext(display, dst, stylePtr->fgGC, sValuePtr->tkfont, + Tk_DrawCharsInContext(display, dst, stylePtr->fgGC, sValuePtr->tkfont, string, numBytes, start, len, ciPtr->baseChunkPtr->x + xDisplacement, y + baseline - sValuePtr->offset); if (sValuePtr->underline) { - TkUnderlineCharsInContext(display, dst, stylePtr->ulGC, + Tk_UnderlineCharsInContext(display, dst, stylePtr->ulGC, sValuePtr->tkfont, string, numBytes, ciPtr->baseChunkPtr->x + xDisplacement, y + baseline - sValuePtr->offset, start, start+len); } if (sValuePtr->overstrike) { Tk_FontMetrics fm; Tk_GetFontMetrics(sValuePtr->tkfont, &fm); - TkUnderlineCharsInContext(display, dst, stylePtr->ovGC, + Tk_UnderlineCharsInContext(display, dst, stylePtr->ovGC, sValuePtr->tkfont, string, numBytes, ciPtr->baseChunkPtr->x + xDisplacement, y + baseline - sValuePtr->offset - fm.descent - (fm.ascent * 3) / 10, start, start+len); @@ -8716,11 +8696,11 @@ if ((maxX >= 0) && (curX >= maxX)) { break; } #ifdef TK_DRAW_IN_CONTEXT - start += TkpMeasureCharsInContext(tkfont, source, maxBytes, + start += Tk_MeasureCharsInContext(tkfont, source, maxBytes, start - source, special - start, maxX >= 0 ? maxX - curX : -1, flags, &width); #else (void) maxBytes; start += Tk_MeasureChars(tkfont, start, special - start, @@ -9000,11 +8980,11 @@ * Compare the foreground attributes of two styles. Specifically must * consider: foreground color, font, font style and font decorations, * elide, "offset" and foreground stipple. Do *not* consider: background * color, border, relief or background stipple. * - * If we use TkpDrawCharsInContext(), we also don't need to check + * If we use Tk_DrawCharsInContext(), we also don't need to check * foreground color, font decorations, elide, offset and foreground * stipple, so all that is left is font (including font size and font * style) and "offset". * * Results: Index: generic/tkTextImage.c ================================================================== --- generic/tkTextImage.c +++ generic/tkTextImage.c @@ -82,15 +82,15 @@ */ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_STRING_TABLE, "-align", NULL, NULL, "center", TCL_INDEX_NONE, offsetof(TkTextEmbImage, align), - (TCL_MAJOR_VERSION > 8) ? TK_OPTION_ENUM_VAR : 0, alignStrings, 0}, + TK_OPTION_ENUM_VAR, alignStrings, 0}, {TK_OPTION_PIXELS, "-padx", NULL, NULL, - "0", offsetof(TkTextEmbImage, padXObj), TCL_INDEX_NONE, 0, 0, 0}, + "0", TCL_INDEX_NONE, offsetof(TkTextEmbImage, padX), 0, 0, 0}, {TK_OPTION_PIXELS, "-pady", NULL, NULL, - "0", offsetof(TkTextEmbImage, padYObj), TCL_INDEX_NONE, 0, 0, 0}, + "0", TCL_INDEX_NONE, offsetof(TkTextEmbImage, padY), 0, 0, 0}, {TK_OPTION_STRING, "-image", NULL, NULL, NULL, offsetof(TkTextEmbImage, imageObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-name", NULL, NULL, NULL, offsetof(TkTextEmbImage, imageNameObj), TCL_INDEX_NONE, @@ -250,11 +250,11 @@ eiPtr->body.ei.imageNameObj = NULL; eiPtr->body.ei.imageObj = NULL; eiPtr->body.ei.name = NULL; eiPtr->body.ei.image = NULL; eiPtr->body.ei.align = TK_ALIGN_CENTER; - eiPtr->body.ei.padXObj = eiPtr->body.ei.padYObj = NULL; + eiPtr->body.ei.padX = eiPtr->body.ei.padY = 0; eiPtr->body.ei.chunkCount = 0; eiPtr->body.ei.optionTable = Tk_CreateOptionTable(interp, optionSpecs); /* * Link the segment into the text widget, then configure it (delete it @@ -529,33 +529,26 @@ /* Structure to fill in with information about * this chunk. The x field has already been * set by the caller. */ { int width, height; - int padX = 0, padY = 0; if (offset != 0) { Tcl_Panic("Non-zero offset in EmbImageLayoutProc"); } - if (eiPtr->body.ei.padXObj) { - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, eiPtr->body.ei.padXObj, &padX); - } - if (eiPtr->body.ei.padYObj) { - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, eiPtr->body.ei.padYObj, &padY); - } /* * See if there's room for this image on this line. */ if (eiPtr->body.ei.image == NULL) { width = 0; height = 0; } else { Tk_SizeOfImage(eiPtr->body.ei.image, &width, &height); - width += 2 * padX; - height += 2 * padY; + width += 2 * eiPtr->body.ei.padX; + height += 2 * eiPtr->body.ei.padY; } if ((width > (maxX - chunkPtr->x)) && !noCharsYet && (textPtr->wrapMode != TEXT_WRAPMODE_NONE)) { return 0; } @@ -568,12 +561,12 @@ chunkPtr->undisplayProc = NULL; chunkPtr->measureProc = NULL; chunkPtr->bboxProc = EmbImageBboxProc; chunkPtr->numBytes = 1; if (eiPtr->body.ei.align == TK_ALIGN_BASELINE) { - chunkPtr->minAscent = height - padY; - chunkPtr->minDescent = padY; + chunkPtr->minAscent = height - eiPtr->body.ei.padY; + chunkPtr->minDescent = eiPtr->body.ei.padY; chunkPtr->minHeight = 0; } else { chunkPtr->minAscent = 0; chunkPtr->minDescent = 0; chunkPtr->minHeight = height; @@ -699,11 +692,11 @@ *-------------------------------------------------------------- */ static void EmbImageBboxProc( - TkText *textPtr, + TCL_UNUSED(TkText *), TkTextDispChunk *chunkPtr, /* Chunk containing desired char. */ TCL_UNUSED(Tcl_Size), /* Index of desired character within the * chunk. */ int y, /* Topmost pixel in area allocated for this * line. */ @@ -717,37 +710,30 @@ int *heightPtr) /* Gets filled in with height of image, in * pixels. */ { TkTextSegment *eiPtr = (TkTextSegment *)chunkPtr->clientData; Tk_Image image; - int padX = 0, padY = 0; image = eiPtr->body.ei.image; if (image != NULL) { Tk_SizeOfImage(image, widthPtr, heightPtr); } else { *widthPtr = 0; *heightPtr = 0; } - if (eiPtr->body.ei.padXObj) { - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, eiPtr->body.ei.padXObj, &padX); - } - if (eiPtr->body.ei.padYObj) { - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, eiPtr->body.ei.padYObj, &padY); - } - *xPtr = chunkPtr->x + padX; + *xPtr = chunkPtr->x + eiPtr->body.ei.padX; switch (eiPtr->body.ei.align) { case TK_ALIGN_BOTTOM: - *yPtr = y + (lineHeight - *heightPtr - padY); + *yPtr = y + (lineHeight - *heightPtr - eiPtr->body.ei.padY); break; case TK_ALIGN_CENTER: *yPtr = y + (lineHeight - *heightPtr)/2; break; case TK_ALIGN_TOP: - *yPtr = y + padY; + *yPtr = y + eiPtr->body.ei.padY; break; case TK_ALIGN_BASELINE: *yPtr = y + (baseline - *heightPtr); break; } Index: generic/tkTextIndex.c ================================================================== --- generic/tkTextIndex.c +++ generic/tkTextIndex.c @@ -45,10 +45,18 @@ TkText *textPtr, const char *string, TkTextIndex *indexPtr, int *canCachePtr); static int IndexCountBytesOrdered(const TkText *textPtr, const TkTextIndex *indexPtr1, const TkTextIndex *indexPtr2); + +#if defined(USE_TCL_STUBS) && (TCL_MAJOR_VERSION < 9) +# undef Tcl_UtfPrev +# define Tcl_UtfPrev (((&tclStubsPtr->tcl_PkgProvideEx)[631]) ? \ + ((const char * (*)(const char *, const char *))(void *)((&tclStubsPtr->tcl_PkgProvideEx)[656])) \ + : ((const char * (*)(const char *, const char *))(void *)((&tclStubsPtr->tcl_PkgProvideEx)[331]))) +#endif + /* * The "textindex" Tcl_Obj definition: */ @@ -441,11 +449,11 @@ * adjusted to the end of that UTF-8 character. */ start = segPtr->body.chars + (byteIndex - index); p = Tcl_UtfPrev(start, segPtr->body.chars); - p += Tcl_UtfToUniChar(p, &ch); + p += TkUtfToUniChar(p, &ch); indexPtr->byteIndex += p - start; } break; } index += segPtr->size; @@ -484,11 +492,11 @@ TkTextIndex *indexPtr) /* Structure to fill in. */ { TkTextSegment *segPtr; char *p, *start, *end; int index, offset; - Tcl_UniChar ch = 0; + int ch = 0; indexPtr->tree = tree; if (lineIndex < 0) { lineIndex = 0; charIndex = 0; @@ -531,11 +539,11 @@ if (charIndex == 0) { indexPtr->byteIndex = index; return indexPtr; } charIndex--; - offset = Tcl_UtfToUniChar(p, &ch); + offset = TkUtfToUniChar(p, &ch); index += offset; } } else { if (charIndex < (int)segPtr->size) { indexPtr->byteIndex = index; @@ -1119,19 +1127,19 @@ } if (numBytes <= segPtr->size) { break; } if (segPtr->typePtr == &tkTextCharType) { - charIndex += Tcl_NumUtfChars(segPtr->body.chars, segPtr->size); + charIndex += TkNumUtfChars(segPtr->body.chars, segPtr->size); } else { charIndex += segPtr->size; } numBytes -= segPtr->size; } if (segPtr->typePtr == &tkTextCharType) { - charIndex += Tcl_NumUtfChars(segPtr->body.chars, numBytes); + charIndex += TkNumUtfChars(segPtr->body.chars, numBytes); } else { charIndex += numBytes; } return snprintf(string, TK_POS_CHARS, "%d.%" TCL_SIZE_MODIFIER "d", @@ -1611,11 +1619,11 @@ * The elide state only changes if this tag is either the * current highest priority tag (and is therefore being * toggled off), or it's a new tag with higher priority. */ - if (tagPtr->elide >= 0) { + if (tagPtr->elideObj) { infoPtr->tagCnts[tagPtr->priority]++; if (infoPtr->tagCnts[tagPtr->priority] & 1) { infoPtr->tagPtrs[tagPtr->priority] = tagPtr; } @@ -1638,17 +1646,17 @@ elide = 0; while (--infoPtr->elidePriority > 0) { if (infoPtr->tagCnts[infoPtr->elidePriority] & 1) { - elide = infoPtr->tagPtrs - [infoPtr->elidePriority]->elide > 0; + elide = infoPtr->tagPtrs[infoPtr->elidePriority]->elideObj + && infoPtr->tagPtrs[infoPtr->elidePriority]->elide != 0; break; } } } else { - elide = tagPtr->elide > 0; + elide = tagPtr->elideObj && (tagPtr->elide != 0); infoPtr->elidePriority = tagPtr->priority; } } } } @@ -1655,11 +1663,11 @@ if (!elide) { if (segPtr->typePtr == &tkTextCharType) { start = segPtr->body.chars + byteOffset; end = segPtr->body.chars + segPtr->size; - for (p = start; p < end; p += Tcl_UtfToUniChar(p, &ch)) { + for (p = start; p < end; p += TkUtfToUniChar(p, &ch)) { if (charCount == 0) { dstPtr->byteIndex += (p - start); goto forwardCharDone; } charCount--; @@ -1861,11 +1869,11 @@ * The elide state only changes if this tag is either the * current highest priority tag (and is therefore being * toggled off), or it's a new tag with higher priority. */ - if (tagPtr->elide >= 0) { + if (tagPtr->elideObj) { infoPtr->tagCnts[tagPtr->priority]++; if (infoPtr->tagCnts[tagPtr->priority] & 1) { infoPtr->tagPtrs[tagPtr->priority] = tagPtr; } if (tagPtr->priority >= infoPtr->elidePriority) { @@ -1888,17 +1896,17 @@ elide = 0; while (--infoPtr->elidePriority > 0) { if (infoPtr->tagCnts[ infoPtr->elidePriority] & 1) { - elide = infoPtr->tagPtrs[ - infoPtr->elidePriority]->elide > 0; + elide = infoPtr->tagPtrs[infoPtr->elidePriority]->elideObj + && (infoPtr->tagPtrs[infoPtr->elidePriority]->elide != 0); break; } } } else { - elide = tagPtr->elide > 0; + elide = tagPtr->elideObj && (tagPtr->elide != 0); infoPtr->elidePriority = tagPtr->priority; } } } } @@ -1938,11 +1946,11 @@ i--; str++; } count += byteLen - i; if (i) { - count += Tcl_NumUtfChars(segPtr->body.chars + byteOffset + count += TkNumUtfChars(segPtr->body.chars + byteOffset + (byteLen - i), i); } } else { if (type & COUNT_INDICES) { Tcl_Size byteLen = segPtr->size - byteOffset; @@ -2150,11 +2158,11 @@ * The elide state only changes if this tag is either the current * highest priority tag (and is therefore being toggled off), or * it's a new tag with higher priority. */ - if (tagPtr->elide >= 0) { + if (tagPtr->elideObj) { infoPtr->tagCnts[tagPtr->priority]++; if (infoPtr->tagCnts[tagPtr->priority] & 1) { infoPtr->tagPtrs[tagPtr->priority] = tagPtr; } if (tagPtr->priority >= infoPtr->elidePriority) { @@ -2175,17 +2183,17 @@ */ elide = 0; while (--infoPtr->elidePriority > 0) { if (infoPtr->tagCnts[infoPtr->elidePriority] & 1) { - elide = infoPtr->tagPtrs[ - infoPtr->elidePriority]->elide > 0; + elide = infoPtr->tagPtrs[infoPtr->elidePriority]->elideObj + && (infoPtr->tagPtrs[infoPtr->elidePriority]->elide != 0); break; } } } else { - elide = tagPtr->elide > 0; + elide = tagPtr->elideObj && (tagPtr->elide != 0); infoPtr->elidePriority = tagPtr->priority; } } } } @@ -2200,13 +2208,10 @@ goto backwardCharDone; } if (p == start) { break; } - if ((sizeof(Tcl_UniChar) == 2) && (unsigned)(UCHAR(*p) - 0xF0) <= 5) { - charCount--; /* Characters > U+FFFF count as 2 here */ - } if (charCount != 0) { charCount--; } } } else { @@ -2387,11 +2392,11 @@ int chSize = 1; if (segPtr->typePtr == &tkTextCharType) { int ch; - chSize = Tcl_UtfToUniChar(segPtr->body.chars + offset, &ch); + chSize = TkUtfToUniChar(segPtr->body.chars + offset, &ch); if (!Tcl_UniCharIsWordChar(ch)) { break; } firstChar = 0; } @@ -2432,11 +2437,11 @@ int chSize = 1; if (segPtr->typePtr == &tkTextCharType) { int ch; - Tcl_UtfToUniChar(segPtr->body.chars + offset, &ch); + TkUtfToUniChar(segPtr->body.chars + offset, &ch); if (!Tcl_UniCharIsWordChar(ch)) { break; } if (offset + 1 > 1) { chSize = (segPtr->body.chars + offset Index: generic/tkTextMark.c ================================================================== --- generic/tkTextMark.c +++ generic/tkTextMark.c @@ -621,17 +621,14 @@ * We have no need for the clientData. */ /* TkText *textPtr = chunkPtr->clientData; */ TkTextIndex index; - int halfWidth, insertWidth, insertBorderWidth; + int halfWidth = textPtr->insertWidth/2; int rightSideWidth; int ix = 0, iy = 0, iw = 0, ih = 0, charWidth = 0; - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, textPtr->insertWidthObj, &insertWidth); - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, textPtr->insertBorderWidthObj, &insertBorderWidth); - halfWidth = insertWidth/2; if (textPtr->insertCursorType) { TkTextMarkSegToIndex(textPtr, textPtr->insertMarkPtr, &index); TkTextIndexBbox(textPtr, &index, &ix, &iy, &iw, &ih, &charWidth); rightSideWidth = charWidth + halfWidth; } else { @@ -659,38 +656,38 @@ */ if (textPtr->flags & GOT_FOCUS) { if (textPtr->flags & INSERT_ON) { Tk_Fill3DRectangle(textPtr->tkwin, dst, textPtr->insertBorder, - x - halfWidth, y, charWidth + insertWidth, - height, insertBorderWidth, TK_RELIEF_RAISED); + x - halfWidth, y, charWidth + textPtr->insertWidth, + height, textPtr->insertBorderWidth, TK_RELIEF_RAISED); } else if (textPtr->selBorder == textPtr->insertBorder) { Tk_Fill3DRectangle(textPtr->tkwin, dst, textPtr->border, - x - halfWidth, y, charWidth + insertWidth, + x - halfWidth, y, charWidth + textPtr->insertWidth, height, 0, TK_RELIEF_FLAT); } } else if (textPtr->insertUnfocussed == TK_TEXT_INSERT_NOFOCUS_HOLLOW) { - if (insertBorderWidth > 0) { - Tk_Draw3DRectangle(textPtr->tkwin, dst, textPtr->insertBorder, - x - halfWidth, y, charWidth + insertWidth, - height, insertBorderWidth, TK_RELIEF_RAISED); - } else { + if (textPtr->insertBorderWidth < 1) { /* * Hack to work around the fact that a "solid" border always * paints in black. */ TkBorder *borderPtr = (TkBorder *) textPtr->insertBorder; XDrawRectangle(Tk_Display(textPtr->tkwin), dst, borderPtr->bgGC, - x - halfWidth, y, charWidth + insertWidth - 1, + x - halfWidth, y, charWidth + textPtr->insertWidth - 1, height - 1); + } else { + Tk_Draw3DRectangle(textPtr->tkwin, dst, textPtr->insertBorder, + x - halfWidth, y, charWidth + textPtr->insertWidth, + height, textPtr->insertBorderWidth, TK_RELIEF_RAISED); } } else if (textPtr->insertUnfocussed == TK_TEXT_INSERT_NOFOCUS_SOLID) { Tk_Fill3DRectangle(textPtr->tkwin, dst, textPtr->insertBorder, - x - halfWidth, y, charWidth + insertWidth, height, - insertBorderWidth, TK_RELIEF_RAISED); + x - halfWidth, y, charWidth + textPtr->insertWidth, height, + textPtr->insertBorderWidth, TK_RELIEF_RAISED); } } /* *-------------------------------------------------------------- Index: generic/tkTextTag.c ================================================================== --- generic/tkTextTag.c +++ generic/tkTextTag.c @@ -13,10 +13,21 @@ */ #include "tkInt.h" #include "tkText.h" #include "default.h" + +/* This struct can be used for booleans, relief and pixels */ +typedef struct { + char *string; + int value; +} IntStruct; + +typedef struct { + char *string; + Tk_Justify value; +} JustifyStruct; static const Tk_OptionSpec tagOptionSpecs[] = { {TK_OPTION_BORDER, "-background", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, border), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BITMAP, "-bgstipple", NULL, NULL, @@ -23,11 +34,11 @@ NULL, TCL_INDEX_NONE, offsetof(TkTextTag, bgStipple), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-borderwidth", NULL, NULL, NULL, offsetof(TkTextTag, borderWidthObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-elide", NULL, NULL, - NULL, TCL_INDEX_NONE, offsetof(TkTextTag, elide), + NULL, offsetof(TkTextTag, elideObj), offsetof(TkTextTag, elide), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BITMAP, "-fgstipple", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, fgStipple), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_FONT, "-font", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, tkfont), TK_OPTION_NULL_OK, 0, 0}, @@ -42,11 +53,11 @@ {TK_OPTION_BORDER, "-lmargincolor", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, lMarginColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-offset", NULL, NULL, NULL, offsetof(TkTextTag, offsetObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-overstrike", NULL, NULL, - NULL, TCL_INDEX_NONE, offsetof(TkTextTag, overstrike), + NULL, offsetof(TkTextTag, overstrikeObj), offsetof(TkTextTag, overstrike), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-overstrikefg", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, overstrikeColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_RELIEF, "-relief", NULL, NULL, @@ -69,11 +80,11 @@ NULL, offsetof(TkTextTag, tabStringPtr), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-tabstyle", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, tabStyle), TK_OPTION_NULL_OK|TK_OPTION_ENUM_VAR, tkTextTabStyleStrings, 0}, {TK_OPTION_BOOLEAN, "-underline", NULL, NULL, - NULL, TCL_INDEX_NONE, offsetof(TkTextTag, underline), + NULL, offsetof(TkTextTag, underlineObj), offsetof(TkTextTag, underline), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-underlinefg", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextTag, underlineColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-wrap", NULL, NULL, @@ -160,24 +171,24 @@ Tcl_WrongNumArgs(interp, 3, objv, "tagName index1 ?index2 index1 index2 ...?"); return TCL_ERROR; } tagPtr = TkTextCreateTag(textPtr, Tcl_GetString(objv[3]), NULL); - if (tagPtr->elide > 0) { + if (tagPtr->elideObj && (tagPtr->elide != 0)) { /* * Indices are potentially obsolete after adding or removing * elided character ranges, especially indices having "display" * or "any" submodifier, therefore increase the epoch. */ textPtr->sharedTextPtr->stateEpoch++; } - for (i = 4; i < (Tcl_Size)objc; i += 2) { + for (i = 4; i < objc; i += 2) { if (TkTextGetObjIndex(interp, textPtr, objv[i], &index1) != TCL_OK) { return TCL_ERROR; } - if ((Tcl_Size)objc > (i+1)) { + if (objc > (i+1)) { if (TkTextGetObjIndex(interp, textPtr, objv[i+1], &index2) != TCL_OK) { return TCL_ERROR; } if (TkTextIndexCmp(&index1, &index2) >= 0) { @@ -279,11 +290,11 @@ Tk_DeleteBinding(interp, textPtr->sharedTextPtr->bindingTable, (void *) tagPtr->name, Tcl_GetString(objv[4])); Tcl_SetObjResult(interp, Tcl_NewStringObj( "requested illegal events; only key, button, motion," " enter, leave, and virtual events may be used", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "TEXT", "TAG_BIND_EVENT",NULL); + Tcl_SetErrorCode(interp, "TK", "TEXT", "TAG_BIND_EVENT", (char *)NULL); return TCL_ERROR; } } else if (objc == 5) { const char *command; @@ -370,53 +381,23 @@ borderWidth = 0; Tcl_DecrRefCount(tagPtr->borderWidthObj); tagPtr->borderWidthObj = Tcl_NewIntObj(0); Tcl_IncrRefCount(tagPtr->borderWidthObj); } - } - if (tagPtr->spacing1Obj) { - int spacing1; - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, tagPtr->spacing1Obj, &spacing1); - if (spacing1 < 0) { - spacing1 = 0; - Tcl_DecrRefCount(tagPtr->spacing1Obj); - tagPtr->spacing1Obj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(tagPtr->spacing1Obj); - } - } - if (tagPtr->spacing2Obj) { - int spacing2; - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, tagPtr->spacing2Obj, &spacing2); - if (spacing2 < 0) { - spacing2 = 0; - Tcl_DecrRefCount(tagPtr->spacing2Obj); - tagPtr->spacing2Obj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(tagPtr->spacing2Obj); - } - } - if (tagPtr->spacing3Obj) { - int spacing3; - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, tagPtr->spacing3Obj, &spacing3); - if (spacing3 < 0) { - spacing3 = 0; - Tcl_DecrRefCount(tagPtr->spacing3Obj); - tagPtr->spacing3Obj = Tcl_NewIntObj(0); - Tcl_IncrRefCount(tagPtr->spacing3Obj); - } } if (tagPtr->tabArrayPtr != NULL) { ckfree(tagPtr->tabArrayPtr); tagPtr->tabArrayPtr = NULL; } if (tagPtr->tabStringPtr != NULL) { tagPtr->tabArrayPtr = - TkTextGetTabs(interp, textPtr->tkwin, tagPtr->tabStringPtr); + TkTextGetTabs(interp, textPtr, tagPtr->tabStringPtr); if (tagPtr->tabArrayPtr == NULL) { return TCL_ERROR; } } - if (tagPtr->elide >= 0) { + if (tagPtr->elideObj) { /* * Indices are potentially obsolete after changing -elide, * especially those computed with "display" or "any" * submodifier, therefore increase the epoch. */ @@ -446,11 +427,11 @@ } } tagPtr->affectsDisplay = 0; tagPtr->affectsDisplayGeometry = 0; - if ((tagPtr->elide >= 0) + if ((tagPtr->elideObj) || (tagPtr->tkfont != NULL) || (tagPtr->justify != TK_JUSTIFY_NULL) || (tagPtr->lMargin1Obj != NULL) || (tagPtr->lMargin2Obj != NULL) || (tagPtr->offsetObj != NULL) @@ -472,13 +453,13 @@ || (tagPtr->relief != TK_RELIEF_NULL) || (tagPtr->bgStipple != None) || (tagPtr->fgColor != NULL) || (tagPtr->selFgColor != NULL) || (tagPtr->fgStipple != None) - || (tagPtr->overstrike >= 0) + || (tagPtr->overstrikeObj != NULL) || (tagPtr->overstrikeColor != NULL) - || (tagPtr->underline >= 0) + || (tagPtr->underlineObj != NULL) || (tagPtr->underlineColor != NULL) || (tagPtr->lMarginColor != NULL) || (tagPtr->rMarginColor != NULL)) { tagPtr->affectsDisplay = 1; } @@ -506,11 +487,11 @@ if (objc < 4) { Tcl_WrongNumArgs(interp, 3, objv, "tagName ?tagName ...?"); return TCL_ERROR; } - for (i = 3; i < (Tcl_Size)objc; i++) { + for (i = 3; i < objc; i++) { hPtr = Tcl_FindHashEntry(&textPtr->sharedTextPtr->tagTable, Tcl_GetString(objv[i])); if (hPtr == NULL) { /* * Either this tag doesn't exist or it's the 'sel' tag (which @@ -610,11 +591,11 @@ listObj = Tcl_NewListObj(0, NULL); for (i = 0; i < arraySize; i++) { tagPtr = arrayPtr[i]; Tcl_ListObjAppendElement(interp, listObj, - Tcl_NewStringObj(tagPtr->name,-1)); + Tcl_NewStringObj(tagPtr->name, TCL_INDEX_NONE)); } Tcl_SetObjResult(interp, listObj); ckfree(arrayPtr); break; } @@ -974,11 +955,12 @@ tagPtr->lMargin2Obj = NULL; tagPtr->lMargin2 = 0; tagPtr->lMarginColor = NULL; tagPtr->offsetObj = NULL; tagPtr->offset = 0; - tagPtr->overstrike = -1; + tagPtr->overstrikeObj = NULL; + tagPtr->overstrike = 0; tagPtr->overstrikeColor = NULL; tagPtr->rMarginObj = NULL; tagPtr->rMargin = 0; tagPtr->rMarginColor = NULL; tagPtr->selBorder = NULL; @@ -987,13 +969,15 @@ tagPtr->spacing2Obj = NULL; tagPtr->spacing3Obj = NULL; tagPtr->tabStringPtr = NULL; tagPtr->tabArrayPtr = NULL; tagPtr->tabStyle = TK_TEXT_TABSTYLE_NULL; - tagPtr->underline = -1; + tagPtr->underlineObj = NULL; + tagPtr->underline = 0; tagPtr->underlineColor = NULL; - tagPtr->elide = -1; + tagPtr->elideObj = NULL; + tagPtr->elide = 0; tagPtr->wrapMode = TEXT_WRAPMODE_NULL; tagPtr->affectsDisplay = 0; tagPtr->affectsDisplayGeometry = 0; textPtr->sharedTextPtr->numTags++; if (!strcmp(tagName, "sel")) { @@ -1050,11 +1034,11 @@ if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "tag \"%s\" isn't defined in text widget", Tcl_GetString(tagName))); Tcl_SetErrorCode(interp, "TK", "LOOKUP", "TEXT_TAG", - Tcl_GetString(tagName), NULL); + Tcl_GetString(tagName), (char *)NULL); } return NULL; } /* Index: generic/tkTextWind.c ================================================================== --- generic/tkTextWind.c +++ generic/tkTextWind.c @@ -94,17 +94,17 @@ */ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_STRING_TABLE, "-align", NULL, NULL, "center", TCL_INDEX_NONE, offsetof(TkTextEmbWindow, align), - (TCL_MAJOR_VERSION > 8) ? TK_OPTION_ENUM_VAR : 0, alignStrings, 0}, + TK_OPTION_ENUM_VAR, alignStrings, 0}, {TK_OPTION_STRING, "-create", NULL, NULL, NULL, offsetof(TkTextEmbWindow, createObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-padx", NULL, NULL, - "0", offsetof(TkTextEmbWindow, padXObj), TCL_INDEX_NONE, 0, 0, 0}, + "0", TCL_INDEX_NONE, offsetof(TkTextEmbWindow, padX), 0, 0, 0}, {TK_OPTION_PIXELS, "-pady", NULL, NULL, - "0", offsetof(TkTextEmbWindow, padYObj), TCL_INDEX_NONE, 0, 0, 0}, + "0", TCL_INDEX_NONE, offsetof(TkTextEmbWindow, padY), 0, 0, 0}, {TK_OPTION_BOOLEAN, "-stretch", NULL, NULL, "0", TCL_INDEX_NONE, offsetof(TkTextEmbWindow, stretch), 0, 0, 0}, {TK_OPTION_WINDOW, "-window", NULL, NULL, NULL, TCL_INDEX_NONE, offsetof(TkTextEmbWindow, tkwin), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} @@ -290,11 +290,11 @@ ewPtr->body.ew.sharedTextPtr = textPtr->sharedTextPtr; ewPtr->body.ew.linePtr = NULL; ewPtr->body.ew.tkwin = NULL; ewPtr->body.ew.createObj = NULL; ewPtr->body.ew.align = TK_ALIGN_CENTER; - ewPtr->body.ew.padXObj = ewPtr->body.ew.padYObj = NULL; + ewPtr->body.ew.padX = ewPtr->body.ew.padY = 0; ewPtr->body.ew.stretch = 0; ewPtr->body.ew.optionTable = Tk_CreateOptionTable(interp, optionSpecs); client = (TkTextEmbWindowClient *)ckalloc(sizeof(TkTextEmbWindowClient)); client->next = NULL; @@ -831,11 +831,10 @@ * this chunk. The x field has already been * set by the caller. */ { int width, height; TkTextEmbWindowClient *client; - int padX = 0, padY = 0; if (offset != 0) { Tcl_Panic("Non-zero offset in EmbWinLayoutProc"); } @@ -987,18 +986,12 @@ gotWindow: if (ewPtr->body.ew.tkwin == NULL) { width = 0; height = 0; } else { - if (ewPtr->body.ew.padXObj) { - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, ewPtr->body.ew.padXObj, &padX); - } - if (ewPtr->body.ew.padYObj) { - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, ewPtr->body.ew.padYObj, &padY); - } - width = Tk_ReqWidth(ewPtr->body.ew.tkwin) + 2 * padX; - height = Tk_ReqHeight(ewPtr->body.ew.tkwin) + 2 * padY; + width = Tk_ReqWidth(ewPtr->body.ew.tkwin) + 2*ewPtr->body.ew.padX; + height = Tk_ReqHeight(ewPtr->body.ew.tkwin) + 2*ewPtr->body.ew.padY; } if ((width > (maxX - chunkPtr->x)) && !noCharsYet && (textPtr->wrapMode != TEXT_WRAPMODE_NONE)) { return 0; } @@ -1011,12 +1004,12 @@ chunkPtr->undisplayProc = EmbWinUndisplayProc; chunkPtr->measureProc = NULL; chunkPtr->bboxProc = EmbWinBboxProc; chunkPtr->numBytes = 1; if (ewPtr->body.ew.align == TK_ALIGN_BASELINE) { - chunkPtr->minAscent = height - padY; - chunkPtr->minDescent = padY; + chunkPtr->minAscent = height - ewPtr->body.ew.padY; + chunkPtr->minDescent = ewPtr->body.ew.padY; chunkPtr->minHeight = 0; } else { chunkPtr->minAscent = 0; chunkPtr->minDescent = 0; chunkPtr->minHeight = height; @@ -1243,11 +1236,10 @@ * pixels. */ { Tk_Window tkwin; TkTextSegment *ewPtr = (TkTextSegment *)chunkPtr->clientData; TkTextEmbWindowClient *client = EmbWinGetClient(textPtr, ewPtr); - int padX = 0, padY = 0; if (client == NULL) { tkwin = NULL; } else { tkwin = client->tkwin; @@ -1257,33 +1249,27 @@ *heightPtr = Tk_ReqHeight(tkwin); } else { *widthPtr = 0; *heightPtr = 0; } - if (ewPtr->body.ew.padXObj) { - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, ewPtr->body.ew.padXObj, &padX); - } - if (ewPtr->body.ew.padYObj) { - Tk_GetPixelsFromObj(NULL, textPtr->tkwin, ewPtr->body.ew.padYObj, &padY); - } - *xPtr = chunkPtr->x + padX; + *xPtr = chunkPtr->x + ewPtr->body.ew.padX; if (ewPtr->body.ew.stretch) { if (ewPtr->body.ew.align == TK_ALIGN_BASELINE) { - *heightPtr = baseline - padY; + *heightPtr = baseline - ewPtr->body.ew.padY; } else { - *heightPtr = lineHeight - 2 * padY; + *heightPtr = lineHeight - 2*ewPtr->body.ew.padY; } } switch (ewPtr->body.ew.align) { case TK_ALIGN_BOTTOM: - *yPtr = y + (lineHeight - *heightPtr - padY); + *yPtr = y + (lineHeight - *heightPtr - ewPtr->body.ew.padY); break; case TK_ALIGN_CENTER: *yPtr = y + (lineHeight - *heightPtr)/2; break; case TK_ALIGN_TOP: - *yPtr = y + padY; + *yPtr = y + ewPtr->body.ew.padY; break; case TK_ALIGN_BASELINE: *yPtr = y + (baseline - *heightPtr); break; } Index: generic/tkUtil.c ================================================================== --- generic/tkUtil.c +++ generic/tkUtil.c @@ -1308,10 +1308,82 @@ if (detail) Tcl_IncrRefCount(detail); // Event code will DecrRefCount Tk_QueueWindowEvent(&event.general, TCL_QUEUE_TAIL); } +#if TCL_MAJOR_VERSION < 9 +/* + *--------------------------------------------------------------------------- + * + * TkUtfToUniChar -- + * + * Almost the same as Tcl_UtfToUniChar but using int instead of Tcl_UniChar. + * This function is capable of collapsing a upper/lower surrogate pair to a + * single unicode character. So, up to 6 bytes might be consumed. + * + * Results: + * *chPtr is filled with the Tcl_UniChar, and the return value is the + * number of bytes from the UTF-8 string that were consumed. + * + * Side effects: + * None. + * + *--------------------------------------------------------------------------- + */ + +Tcl_Size +TkUtfToUniChar( + const char *src, /* The UTF-8 string. */ + int *chPtr) /* Filled with the Unicode value represented by + * the UTF-8 string. */ +{ + Tcl_UniChar uniChar = 0; + + Tcl_Size len = Tcl_UtfToUniChar(src, &uniChar); + if ((uniChar & 0xFC00) == 0xD800) { + Tcl_UniChar low = uniChar; + /* This can only happen if src points to a character > U+FFFF */ + Tcl_Size len2 = Tcl_UtfToUniChar(src+len, &low); + if ((low & 0xFC00) == 0xDC00) { + *chPtr = (((uniChar & 0x3FF) << 10) | (low & 0x3FF)) + 0x10000; + return len + len2; + } + } + *chPtr = uniChar; + return len; +} + +/* + *--------------------------------------------------------------------------- + * + * TkUniCharToUtf -- + * + * Almost the same as Tcl_UniCharToUtf but producing 2 x 3-byte UTF-8 + * sequences for out-of-bmp characters when TCL_UTF_MAX==3. + * So, up to 6 bytes might be produced. + * + * Results: + * *buf is filled with the UTF-8 string, and the return value is the + * number of bytes produced. + * + * Side effects: + * None. + * + *--------------------------------------------------------------------------- + */ + +Tcl_Size TkUniCharToUtf(int ch, char *buf) +{ + if ((unsigned)(ch - 0x10000) <= 0xFFFFF) { + /* Spit out a 4-byte UTF-8 character (Tcl 8.7+) or + * 2 x 3-byte UTF-8 characters (Tcl 8.6) */ + Tcl_Size len = Tcl_UniCharToUtf(0xD800 | ((ch - 0x10000) >> 10), buf); + return len + Tcl_UniCharToUtf(0xDC00 | (ch & 0x7FF), buf + len); + } + return Tcl_UniCharToUtf(ch, buf); +} +#endif /* * Local Variables: * mode: c * c-basic-offset: 4 * fill-column: 78 Index: generic/tkWindow.c ================================================================== --- generic/tkWindow.c +++ generic/tkWindow.c @@ -897,19 +897,19 @@ mainPtr->alwaysShowSelection = 0; mainPtr->tclUpdateObjProc = NULL; #if TCL_MAJOR_VERSION > 8 mainPtr->tclUpdateObjProc2 = NULL; #endif - if (Tcl_LinkVar(interp, "tk_strictMotif", &mainPtr->strictMotif, + if (Tcl_LinkVar(interp, "tk_strictMotif", (char *)&mainPtr->strictMotif, TCL_LINK_BOOLEAN) != TCL_OK) { Tcl_ResetResult(interp); } if (Tcl_CreateNamespace(interp, "::tk", NULL, NULL) == NULL) { Tcl_ResetResult(interp); } if (Tcl_LinkVar(interp, "::tk::AlwaysShowSelection", - &mainPtr->alwaysShowSelection, + (char *)&mainPtr->alwaysShowSelection, TCL_LINK_BOOLEAN) != TCL_OK) { Tcl_ResetResult(interp); } mainPtr->nextPtr = tsdPtr->mainWindowList; tsdPtr->mainWindowList = mainPtr; @@ -2994,13 +2994,13 @@ #if defined(_WIN32) && !defined(STATIC_BUILD) static HMODULE tkcygwindll = NULL; /* - * Run Tk_MainEx from libtcl9tk9.?.dll + * Run Tk_MainEx from libtk8.?.dll * - * This function is only ever called from wish9.?.exe, the cygwin port of Tcl. + * This function is only ever called from wish8.?.exe, the cygwin port of Tcl. * This means that the system encoding is utf-8, so we don't have to do any * encoding conversions. */ MODULE_SCOPE void @@ -3015,19 +3015,19 @@ { WCHAR name[MAX_PATH]; size_t len; void (*tkmainex)(Tcl_Size, char **, Tcl_AppInitProc *, Tcl_Interp *); - /* construct "/libtcl9tk9.?.dll", from "/tcl9tk9?.dll" */ + /* construct "/libtk8.?.dll", from "/tk8?.dll" */ len = GetModuleFileNameW((HINSTANCE)Tk_GetHINSTANCE(), name, MAX_PATH); name[len-2] = '.'; name[len-1] = name[len-5]; wcscpy(name+len, L".dll"); #if TCL_MAJOR_VERSION > 8 - memcpy(name+len-12, L"libtcl9tk9", 10 * sizeof(WCHAR)); + memcpy(name+len-12, L"libtcl9tk8", 10 * sizeof(WCHAR)); #else - memcpy(name+len-8, L"libtk9", 6 * sizeof(WCHAR)); + memcpy(name+len-8, L"libtk8", 6 * sizeof(WCHAR)); #endif tkcygwindll = LoadLibraryW(name); if (tkcygwindll) { tkmainex = (void (*)(Tcl_Size, char **, Tcl_AppInitProc *, Tcl_Interp *)) @@ -3223,11 +3223,11 @@ /* * Ensure that we are getting a compatible version of Tcl. */ - if (Tcl_InitStubs(interp, "8.7-", 0) == NULL) { + if (Tcl_InitStubs(interp, "8.6-", 0) == NULL) { return TCL_ERROR; } /* * TIP #59: Make embedded configuration information available. @@ -3423,18 +3423,11 @@ Tcl_ListObjAppendElement(NULL, cmd, Tcl_NewStringObj("-visual", TCL_INDEX_NONE)); Tcl_ListObjAppendElement(NULL, cmd, visualObj); visualObj = NULL; } - Tcl_Size objc; - Tcl_Obj **objv; - - if (TCL_OK != Tcl_ListObjGetElements(interp, cmd, &objc, &objv)) { - return TCL_ERROR; - } - code = TkCreateFrame(NULL, interp, objc, objv, - 1, nameObj ? Tcl_GetString(nameObj) : NULL); + code = TkListCreateFrame(NULL, interp, cmd, 1, nameObj); Tcl_DecrRefCount(cmd); if (code != TCL_OK) { goto done; Index: generic/ttk/ttk.decls ================================================================== --- generic/ttk/ttk.decls +++ generic/ttk/ttk.decls @@ -141,10 +141,10 @@ } # # Utilities. # -declare 40 { - int Ttk_GetOrientFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, Ttk_Orient *orient) +declare 40 {deprecated {}} { + int Ttk_GetOrientFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, int *orient) } Index: generic/ttk/ttkClamTheme.c ================================================================== --- generic/ttk/ttkClamTheme.c +++ generic/ttk/ttkClamTheme.c @@ -547,20 +547,20 @@ */ typedef struct { Tcl_Obj *lightColorObj; Tcl_Obj *borderColorObj; - Tcl_Obj *gripSizeObj; + Tcl_Obj *gripCountObj; } GripElement; static const Ttk_ElementOptionSpec GripElementOptions[] = { { "-lightcolor", TK_OPTION_COLOR, offsetof(GripElement,lightColorObj), LIGHT_COLOR }, { "-bordercolor", TK_OPTION_COLOR, offsetof(GripElement,borderColorObj), DARKEST_COLOR }, - { "-gripsize", TK_OPTION_PIXELS, - offsetof(GripElement,gripSizeObj), "7.5p" }, + { "-gripcount", TK_OPTION_PIXELS, + offsetof(GripElement,gripCountObj), "5" }, { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; static void GripElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, @@ -569,11 +569,12 @@ { Ttk_Orient orient = (Ttk_Orient)PTR2INT(clientData); GripElement *grip = (GripElement *)elementRecord; int gripSize = 0; - Tk_GetPixelsFromObj(NULL, tkwin, grip->gripSizeObj, &gripSize); + Tk_GetPixelsFromObj(NULL, tkwin, grip->gripCountObj, &gripSize); + gripSize *= 2; if (orient == TTK_ORIENT_HORIZONTAL) { *widthPtr = gripSize; } else { *heightPtr = gripSize; } @@ -590,11 +591,12 @@ GC lightGC = Ttk_GCForColor(tkwin,grip->lightColorObj,d); GC darkGC = Ttk_GCForColor(tkwin,grip->borderColorObj,d); int gripPad = 1, gripSize = 0; int i; - Tk_GetPixelsFromObj(NULL, tkwin, grip->gripSizeObj, &gripSize); + Tk_GetPixelsFromObj(NULL, tkwin, grip->gripCountObj, &gripSize); + gripSize *= 2; if (orient == TTK_ORIENT_HORIZONTAL) { int x = b.x + (b.width - gripSize) / 2; int y1 = b.y + gripPad, y2 = b.y + b.height - gripPad - 1 + w; for (i=0; iorientObj, &orient); - Tk_GetPixelsFromObj(NULL, tkwin, sb->gripSizeObj, &gripSize); + TtkGetOrientFromObj(NULL, sb->orientObj, &orient); + Tk_GetPixelsFromObj(NULL, tkwin, sb->gripCountObj, &gripSize); + gripSize *= 2; lightGC = Ttk_GCForColor(tkwin,sb->lightColorObj,d); darkGC = Ttk_GCForColor(tkwin,sb->borderColorObj,d); if (orient == TTK_ORIENT_HORIZONTAL) { dx = 1; dy = 0; @@ -772,11 +775,11 @@ ScrollbarElement *sb = (ScrollbarElement *)elementRecord; int length, thickness; Ttk_Orient orient; length = thickness = SCROLLBAR_THICKNESS; - Ttk_GetOrientFromObj(NULL, sb->orientObj, &orient); + TtkGetOrientFromObj(NULL, sb->orientObj, &orient); Tk_GetPixelsFromObj(NULL, tkwin, sb->arrowSizeObj, &thickness); Tk_GetPixelsFromObj(NULL, tkwin, sb->sliderlengthObj, &length); if (orient == TTK_ORIENT_VERTICAL) { *heightPtr = length; *widthPtr = thickness; Index: generic/ttk/ttkClassicTheme.c ================================================================== --- generic/ttk/ttkClassicTheme.c +++ generic/ttk/ttkClassicTheme.c @@ -232,11 +232,11 @@ offsetof(IndicatorElement,backgroundObj), DEFAULT_BACKGROUND }, { "-indicatorcolor", TK_OPTION_BORDER, offsetof(IndicatorElement,colorObj), DEFAULT_BACKGROUND }, { "-indicatorrelief", TK_OPTION_RELIEF, offsetof(IndicatorElement,reliefObj), "raised" }, - { "-indicatorsize", TK_OPTION_PIXELS, + { "-indicatordiameter", TK_OPTION_PIXELS, offsetof(IndicatorElement,sizeObj), "9p" }, { "-indicatormargin", TK_OPTION_STRING, offsetof(IndicatorElement,marginObj), "0 2 4 2" }, { "-borderwidth", TK_OPTION_PIXELS, offsetof(IndicatorElement,borderWidthObj), DEFAULT_BORDERWIDTH }, @@ -592,11 +592,11 @@ { SliderElement *slider = (SliderElement *)elementRecord; Ttk_Orient orient; int length, thickness; - Ttk_GetOrientFromObj(NULL, slider->orientObj, &orient); + TtkGetOrientFromObj(NULL, slider->orientObj, &orient); Tk_GetPixelsFromObj(NULL, tkwin, slider->lengthObj, &length); Tk_GetPixelsFromObj(NULL, tkwin, slider->thicknessObj, &thickness); switch (orient) { case TTK_ORIENT_VERTICAL: @@ -625,11 +625,11 @@ Ttk_Orient orient; border = Tk_Get3DBorderFromObj(tkwin, slider->borderObj); Tk_GetReliefFromObj(NULL, slider->reliefObj, &relief); Tk_GetPixelsFromObj(NULL, tkwin, slider->borderWidthObj, &borderWidth); - Ttk_GetOrientFromObj(NULL, slider->orientObj, &orient); + TtkGetOrientFromObj(NULL, slider->orientObj, &orient); Tk_Fill3DRectangle(tkwin, d, border, b.x, b.y, b.width, b.height, borderWidth, relief); Index: generic/ttk/ttkDecls.h ================================================================== --- generic/ttk/ttkDecls.h +++ generic/ttk/ttkDecls.h @@ -11,11 +11,15 @@ Tcl_Interp *, const char *version, int epoch, int revision); #define Ttk_InitStubs(interp) TtkInitializeStubs( \ interp, TTK_VERSION, TTK_STUBS_EPOCH, TTK_STUBS_REVISION) #else -#define Ttk_InitStubs(interp) Tcl_PkgRequireEx(interp, "ttk", TTK_VERSION, 0, NULL) +#if !defined(TK_NO_DEPRECATED) && TCL_MAJOR_VERSION < 9 +# define Ttk_InitStubs(interp) Tcl_PkgRequireEx(interp, "Ttk", TTK_VERSION, 0, NULL) +#else +# define Ttk_InitStubs(interp) Tcl_PkgRequireEx(interp, "ttk", TTK_VERSION, 0, NULL) +#endif #endif #if !defined(BUILD_tk) # define TTK_DEPRECATED(msg) TTKAPI TCL_DEPRECATED_API(msg) @@ -137,12 +141,13 @@ /* Slot 36 is reserved */ /* Slot 37 is reserved */ /* Slot 38 is reserved */ /* Slot 39 is reserved */ /* 40 */ -TTKAPI int Ttk_GetOrientFromObj(Tcl_Interp *interp, - Tcl_Obj *objPtr, Ttk_Orient *orient); +TTK_DEPRECATED("") +int Ttk_GetOrientFromObj(Tcl_Interp *interp, + Tcl_Obj *objPtr, int *orient); typedef struct TtkStubs { int magic; int epoch; int revision; @@ -186,11 +191,11 @@ Tcl_Obj * (*ttk_NewBoxObj) (Ttk_Box box); /* 35 */ void (*reserved36)(void); void (*reserved37)(void); void (*reserved38)(void); void (*reserved39)(void); - int (*ttk_GetOrientFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, Ttk_Orient *orient); /* 40 */ + TCL_DEPRECATED_API("") int (*ttk_GetOrientFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *orient); /* 40 */ } TtkStubs; extern const TtkStubs *ttkStubsPtr; #ifdef __cplusplus Index: generic/ttk/ttkDefaultTheme.c ================================================================== --- generic/ttk/ttkDefaultTheme.c +++ generic/ttk/ttkDefaultTheme.c @@ -1061,11 +1061,11 @@ ThumbElement *thumb = (ThumbElement *)elementRecord; Ttk_Orient orient; int size; Tk_GetPixelsFromObj(NULL, tkwin, thumb->sizeObj, &size); - Ttk_GetOrientFromObj(NULL, thumb->orientObj, &orient); + TtkGetOrientFromObj(NULL, thumb->orientObj, &orient); if (orient == TTK_ORIENT_VERTICAL) { *widthPtr = size; *heightPtr = MIN_THUMB_SIZE; } else { @@ -1156,11 +1156,11 @@ { SliderElement *slider = (SliderElement *)elementRecord; Ttk_Orient orient; int thickness, borderWidth; - Ttk_GetOrientFromObj(NULL, slider->orientObj, &orient); + TtkGetOrientFromObj(NULL, slider->orientObj, &orient); Tk_GetPixelsFromObj(NULL, tkwin, slider->thicknessObj, &thickness); Tk_GetPixelsFromObj(NULL, tkwin, slider->borderWidthObj, &borderWidth); switch (orient) { case TTK_ORIENT_VERTICAL: @@ -1215,11 +1215,11 @@ } TreeitemIndicator; static const Ttk_ElementOptionSpec TreeitemIndicatorOptions[] = { { "-foreground", TK_OPTION_COLOR, offsetof(TreeitemIndicator,colorObj), DEFAULT_FOREGROUND }, - { "-size", TK_OPTION_PIXELS, + { "-diameter", TK_OPTION_PIXELS, offsetof(TreeitemIndicator,sizeObj), "6.75p" }, { "-indicatormargins", TK_OPTION_STRING, offsetof(TreeitemIndicator,marginObj), "2 2 4 2" }, { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; Index: generic/ttk/ttkElements.c ================================================================== --- generic/ttk/ttkElements.c +++ generic/ttk/ttkElements.c @@ -523,11 +523,11 @@ Drawable d, Ttk_Box b, Ttk_State state) { SeparatorElement *separator = (SeparatorElement *)elementRecord; Ttk_Orient orient; - Ttk_GetOrientFromObj(NULL, separator->orientObj, &orient); + TtkGetOrientFromObj(NULL, separator->orientObj, &orient); switch (orient) { case TTK_ORIENT_HORIZONTAL: HorizontalSeparatorElementDraw( clientData, elementRecord, tkwin, d, b, state); break; @@ -1233,11 +1233,11 @@ TkMainInfo *mainInfoPtr = ((TkWindow *) tkwin)->mainPtr; Tk_GetPixelsFromObj(NULL, tkwin, troughPtr->borderWidthObj, &borderWidth); Tk_GetPixelsFromObj(NULL, tkwin, troughPtr->grooveWidthObj, &grooveWidth); Tk_GetReliefFromObj(NULL, troughPtr->reliefObj, &relief); - Ttk_GetOrientFromObj(NULL, troughPtr->orientObj, &orient); + TtkGetOrientFromObj(NULL, troughPtr->orientObj, &orient); if (grooveWidth > 0 && grooveWidth < b.height && grooveWidth < b.width) { if (orient == TTK_ORIENT_HORIZONTAL) { b.y += (b.height - grooveWidth) / 2; b.height = grooveWidth; @@ -1307,11 +1307,11 @@ ThumbElement *thumb = (ThumbElement *)elementRecord; Ttk_Orient orient; int thickness; Tk_GetPixelsFromObj(NULL, tkwin, thumb->thicknessObj, &thickness); - Ttk_GetOrientFromObj(NULL, thumb->orientObj, &orient); + TtkGetOrientFromObj(NULL, thumb->orientObj, &orient); if (orient == TTK_ORIENT_VERTICAL) { *widthPtr = thickness; *heightPtr = MIN_THUMB_SIZE; } else { @@ -1438,11 +1438,11 @@ /* * Fill the thin trough area preceding the * slider's center with the inner color */ if (mainInfoPtr != NULL) { - Ttk_GetOrientFromObj(NULL, slider->orientObj, &orient); + TtkGetOrientFromObj(NULL, slider->orientObj, &orient); switch (orient) { case TTK_ORIENT_HORIZONTAL: XFillRectangle(disp, d, gc, mainInfoPtr->troughInnerX, mainInfoPtr->troughInnerY, b.x + dim/2 - 1, mainInfoPtr->troughInnerHeight); @@ -1577,11 +1577,11 @@ { PbarElement *pbar = (PbarElement *)elementRecord; Ttk_Orient orient; int thickness = 15, length = 30, borderWidth = 2; - Ttk_GetOrientFromObj(NULL, pbar->orientObj, &orient); + TtkGetOrientFromObj(NULL, pbar->orientObj, &orient); Tk_GetPixelsFromObj(NULL, tkwin, pbar->thicknessObj, &thickness); Tk_GetPixelsFromObj(NULL, tkwin, pbar->lengthObj, &length); Tk_GetPixelsFromObj(NULL, tkwin, pbar->borderWidthObj, &borderWidth); switch (orient) { Index: generic/ttk/ttkEntry.c ================================================================== --- generic/ttk/ttkEntry.c +++ generic/ttk/ttkEntry.c @@ -298,12 +298,12 @@ char *displayString, *p; int size; int ch; char buf[6]; - Tcl_UtfToUniChar(showChar, &ch); - size = Tcl_UniCharToUtf(ch, buf); + TkUtfToUniChar(showChar, &ch); + size = TkUniCharToUtf(ch, buf); p = displayString = (char *)ckalloc(numChars * size + 1); while (numChars--) { memcpy(p, buf, size); p += size; @@ -367,12 +367,12 @@ || Tcl_IsSafe(entryPtr->core.interp)) { return TCL_INDEX_NONE; } string = entryPtr->entry.displayString; - selStart = Tcl_UtfAtIndex(string, entryPtr->entry.selectFirst); - selEnd = Tcl_UtfAtIndex(selStart, + selStart = TkUtfAtIndex(string, entryPtr->entry.selectFirst); + selEnd = TkUtfAtIndex(selStart, entryPtr->entry.selectLast - entryPtr->entry.selectFirst); if (selEnd <= selStart + offset) { return 0; } byteCount = selEnd - selStart - offset; @@ -456,11 +456,11 @@ /* There's a percent sequence here. Process it. */ ++templ; /* skip over % */ if (*templ != '\0') { - templ += Tcl_UtfToUniChar(templ, &ch); + templ += TkUtfToUniChar(templ, &ch); } else { ch = '%'; } stringLength = -1; @@ -486,15 +486,15 @@ case 's': /* Current string value */ string = entryPtr->entry.string; break; case 'S': /* string to be inserted/deleted, if any */ if (reason == VALIDATE_INSERT) { - string = Tcl_UtfAtIndex(newValue, index); - stringLength = Tcl_UtfAtIndex(string, count) - string; + string = TkUtfAtIndex(newValue, index); + stringLength = TkUtfAtIndex(string, count) - string; } else if (reason == VALIDATE_DELETE) { - string = Tcl_UtfAtIndex(entryPtr->entry.string, index); - stringLength = Tcl_UtfAtIndex(string, count) - string; + string = TkUtfAtIndex(entryPtr->entry.string, index); + stringLength = TkUtfAtIndex(string, count) - string; } else { string = ""; stringLength = 0; } break; @@ -506,11 +506,11 @@ break; case 'W': /* widget name */ string = Tk_PathName(entryPtr->core.tkwin); break; default: - length = Tcl_UniCharToUtf(ch, numStorage); + length = TkUniCharToUtf(ch, numStorage); numStorage[length] = '\0'; string = numStorage; break; } @@ -738,11 +738,11 @@ */ static void EntryStoreValue(Entry *entryPtr, const char *value) { size_t numBytes = strlen(value); - Tcl_Size numChars = Tcl_NumUtfChars(value, numBytes); + Tcl_Size numChars = TkNumUtfChars(value, numBytes); if (entryPtr->core.flags & VALIDATING) entryPtr->core.flags |= VALIDATION_SET_VALUE; /* Make sure all indices remain in bounds: @@ -840,17 +840,16 @@ */ static int InsertChars( Entry *entryPtr, /* Entry that is to get the new elements. */ Tcl_Size index, /* Insert before this index */ - Tcl_Obj *obj) /* New characters to add */ + const char *value) /* New characters to add */ { char *string = entryPtr->entry.string; - const char *value = Tcl_GetString(obj); - size_t byteIndex = Tcl_UtfAtIndex(string, index) - string; + size_t byteIndex = TkUtfAtIndex(string, index) - string; size_t byteCount = strlen(value); - int charsAdded = Tcl_NumUtfChars(value, byteCount); + int charsAdded = TkNumUtfChars(value, byteCount); size_t newByteCount = entryPtr->entry.numBytes + byteCount + 1; char *newBytes; int code; if (byteCount == 0) { @@ -898,12 +897,12 @@ } if (count <= 0) { return TCL_OK; } - byteIndex = Tcl_UtfAtIndex(string, index) - string; - byteCount = Tcl_UtfAtIndex(string+byteIndex, count) - (string+byteIndex); + byteIndex = TkUtfAtIndex(string, index) - string; + byteCount = TkUtfAtIndex(string+byteIndex, count) - (string+byteIndex); newByteCount = entryPtr->entry.numBytes + 1 - byteCount; newBytes = (char *)ckalloc(newByteCount); memcpy(newBytes, string, byteIndex); strcpy(newBytes + byteIndex, string + byteIndex + byteCount); @@ -1318,11 +1317,11 @@ /* Draw the text: */ if ((*(entryPtr->entry.displayString) == '\0') && (entryPtr->entry.placeholderObj != NULL)) { /* No text displayed, but -placeholder is given */ - if (Tcl_GetCharLength(es.placeholderForegroundObj) > 0) { + if (TkGetCharLength(es.placeholderForegroundObj) > 0) { foregroundObj = es.placeholderForegroundObj; } else { foregroundObj = es.foregroundObj; } /* Use placeholder text width */ @@ -1615,11 +1614,11 @@ } if (EntryIndex(interp, entryPtr, objv[2], &index) != TCL_OK) { return TCL_ERROR; } if (EntryEditable(entryPtr)) { - return InsertChars(entryPtr, index, objv[3]); + return InsertChars(entryPtr, index, Tcl_GetString(objv[3])); } return TCL_OK; } /* $entry selection clear -- Index: generic/ttk/ttkInit.c ================================================================== --- generic/ttk/ttkInit.c +++ generic/ttk/ttkInit.c @@ -53,11 +53,21 @@ */ const char *const ttkOrientStrings[] = { "horizontal", "vertical", NULL }; +#if !defined(TK_NO_DEPRECATED) && TK_MAJOR_VERSION < 9 int Ttk_GetOrientFromObj( + Tcl_Interp *interp, Tcl_Obj *objPtr, int *resultPtr) +{ + *resultPtr = TTK_ORIENT_HORIZONTAL; + return Tcl_GetIndexFromObj(interp, objPtr, ttkOrientStrings, + "orientation", 0, resultPtr); +} +#endif + +int TtkGetOrientFromObj( Tcl_Interp *interp, Tcl_Obj *objPtr, Ttk_Orient *resultPtr) { int orient = (int)TTK_ORIENT_HORIZONTAL; int result = Tcl_GetIndexFromObj(interp, objPtr, ttkOrientStrings, "orientation", 0, &orient); Index: generic/ttk/ttkLabel.c ================================================================== --- generic/ttk/ttkLabel.c +++ generic/ttk/ttkLabel.c @@ -52,11 +52,15 @@ { "-font", TK_OPTION_FONT, offsetof(TextElement,fontObj), DEFAULT_FONT }, { "-foreground", TK_OPTION_COLOR, offsetof(TextElement,foregroundObj), "black" }, { "-underline", TK_OPTION_INDEX, +#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9) + offsetof(TextElement,underlineObj), "-1"}, +#else offsetof(TextElement,underlineObj), NULL}, +#endif { "-width", TK_OPTION_INT, offsetof(TextElement,widthObj), "-1"}, { "-anchor", TK_OPTION_ANCHOR, offsetof(TextElement,anchorObj), "w"}, { "-justify", TK_OPTION_JUSTIFY, @@ -523,11 +527,15 @@ { "-font", TK_OPTION_FONT, offsetof(LabelElement,text.fontObj), DEFAULT_FONT }, { "-foreground", TK_OPTION_COLOR, offsetof(LabelElement,text.foregroundObj), "black" }, { "-underline", TK_OPTION_INDEX, +#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9) offsetof(LabelElement,text.underlineObj), "-1"}, +#else + offsetof(LabelElement,text.underlineObj), NULL}, +#endif { "-width", TK_OPTION_INT, offsetof(LabelElement,text.widthObj), ""}, { "-anchor", TK_OPTION_ANCHOR, offsetof(LabelElement,text.anchorObj), "w"}, { "-justify", TK_OPTION_JUSTIFY, Index: generic/ttk/ttkNotebook.c ================================================================== --- generic/ttk/ttkNotebook.c +++ generic/ttk/ttkNotebook.c @@ -1124,13 +1124,14 @@ Tcl_SetObjResult(interp, Tcl_NewStringObj(elementName, -1)); } break; case IDENTIFY_TAB: - if (tabIndex >= 0) { - Tcl_SetObjResult(interp, TkNewIndexObj(tabIndex)); - } +#if !defined TK_NO_DEPRECATED && (TCL_MAJOR_VERSION < 9) + if (tabIndex >= 0) +#endif + Tcl_SetObjResult(interp, TkNewIndexObj(tabIndex)); break; } return TCL_OK; } @@ -1151,13 +1152,14 @@ return TCL_ERROR; } status = FindTabIndex(interp, nb, objv[2], &index); if (status == TCL_OK) { - if (index >= 0) { - Tcl_SetObjResult(interp, TkNewIndexObj(index)); - } +#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9) + if (index >= 0) +#endif + Tcl_SetObjResult(interp, TkNewIndexObj(index)); } return status; } Index: generic/ttk/ttkProgress.c ================================================================== --- generic/ttk/ttkProgress.c +++ generic/ttk/ttkProgress.c @@ -301,11 +301,11 @@ TtkWidgetSize(recordPtr, widthPtr, heightPtr); /* Override requested width (height) based on -length and -orient */ Tk_GetPixelsFromObj(NULL, pb->core.tkwin, pb->progress.lengthObj, &length); - Ttk_GetOrientFromObj(NULL, pb->progress.orientObj, &orient); + TtkGetOrientFromObj(NULL, pb->progress.orientObj, &orient); if (orient == TTK_ORIENT_HORIZONTAL) { *widthPtr = length; } else { *heightPtr = length; @@ -374,11 +374,11 @@ /* Adjust the bar size: */ Tcl_GetDoubleFromObj(NULL, pb->progress.valueObj, &value); Tcl_GetDoubleFromObj(NULL, pb->progress.maximumObj, &maximum); - Ttk_GetOrientFromObj(NULL, pb->progress.orientObj, &orient); + TtkGetOrientFromObj(NULL, pb->progress.orientObj, &orient); if (pbar) { double fraction = value / maximum; Ttk_Box parcel = Ttk_ClientRegion(corePtr->layout, "trough"); Index: generic/ttk/ttkStubInit.c ================================================================== --- generic/ttk/ttkStubInit.c +++ generic/ttk/ttkStubInit.c @@ -5,10 +5,14 @@ #include "tkInt.h" #include "ttkTheme.h" MODULE_SCOPE const TtkStubs ttkStubs; + +#if defined(TK_NO_DEPRECATED) || TK_MAJOR_VERSION > 8 +#define Ttk_GetOrientFromObj 0 +#endif #ifdef __GNUC__ /* * The rest of this file shouldn't warn about deprecated functions; they're * there because we intend them to be so and know that this file is OK to Index: generic/ttk/ttkTheme.h ================================================================== --- generic/ttk/ttkTheme.h +++ generic/ttk/ttkTheme.h @@ -364,10 +364,13 @@ typedef enum { /* -orient option values */ TTK_ORIENT_HORIZONTAL, TTK_ORIENT_VERTICAL } Ttk_Orient; + +MODULE_SCOPE int TtkGetOrientFromObj(Tcl_Interp *interp, + Tcl_Obj *objPtr, Ttk_Orient *orient); /*------------------------------------------------------------------------ * +++ Utilities. */ Index: generic/ttk/ttkThemeInt.h ================================================================== --- generic/ttk/ttkThemeInt.h +++ generic/ttk/ttkThemeInt.h @@ -50,8 +50,12 @@ MODULE_SCOPE void TtkSetBlinkCursorTimes(Tcl_Interp* interp); MODULE_SCOPE int TtkBoxEqual(Ttk_Box, Ttk_Box); -#define TTK_OPTION_UNDERLINE_DEF(type, field) NULL, offsetof(type, field), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL +#if !defined(TK_NO_DEPRECATED) && (TCL_MAJOR_VERSION < 9) +# define TTK_OPTION_UNDERLINE_DEF(type, field) "-1", offsetof(type, field), TCL_INDEX_NONE, 0, NULL +#else +# define TTK_OPTION_UNDERLINE_DEF(type, field) NULL, offsetof(type, field), TCL_INDEX_NONE, TK_OPTION_NULL_OK, NULL +#endif #endif /* _TTKTHEMEINT */ Index: generic/ttk/ttkTreeview.c ================================================================== --- generic/ttk/ttkTreeview.c +++ generic/ttk/ttkTreeview.c @@ -1739,30 +1739,10 @@ return -1; } return row - tv->tree.yscroll.first + tv->tree.titleRows; } -/* Is an item detached? The root is never detached. */ -static int IsDetached(Treeview* tv, TreeItem* item) -{ - return item->next == NULL && item->prev == NULL && - item->parent == NULL && item != tv->tree.root; -} - -/* Is an item or one of its ancestors detached? */ -static int IsItemOrAncestorDetached(Treeview* tv, TreeItem* item) -{ - TreeItem *parent; - - for (parent = item; parent; parent = parent->parent) { - if (IsDetached(tv, parent)) { - return 1; - } - } - return 0; -} - /* + 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. */ @@ -1785,13 +1765,10 @@ dispRow = DisplayRow(item->rowPos, tv); if (dispRow < 0) { /* not viewable, or off-screen */ return 0; } - if (IsItemOrAncestorDetached(tv, item)) { - return 0; - } bbox.y += dispRow * tv->tree.rowHeight; bbox.height = tv->tree.rowHeight * item->height; bbox.x -= tv->tree.xscroll.first; @@ -3368,47 +3345,10 @@ TtkRedisplayWidget(&tv->core); ckfree(items); return TCL_OK; } -/* + $tv detached ?$item? -- - * List detached items (in arbitrary order) or query the detached state of - * $item. - */ -static int TreeviewDetachedCommand( - void *recordPtr, Tcl_Interp *interp, Tcl_Size objc, Tcl_Obj *const objv[]) -{ - Treeview *tv = (Treeview *)recordPtr; - TreeItem *item; - - if (objc == 2) { - /* List detached items */ - Tcl_HashSearch search; - Tcl_HashEntry *entryPtr = Tcl_FirstHashEntry(&tv->tree.items, &search); - Tcl_Obj *objPtr = Tcl_NewObj(); - - while (entryPtr != NULL) { - item = (TreeItem *)Tcl_GetHashValue(entryPtr); - entryPtr = Tcl_NextHashEntry(&search); - if (IsDetached(tv, item)) { - Tcl_ListObjAppendElement(NULL, objPtr, ItemID(tv, item)); - } - } - Tcl_SetObjResult(interp, objPtr); - return TCL_OK; - } else if (objc == 3) { - /* Query; the root is never reported as detached */ - if (!(item = FindItem(interp, tv, objv[2]))) { - return TCL_ERROR; - } - Tcl_SetObjResult(interp, Tcl_NewBooleanObj(IsDetached(tv, item))); - return TCL_OK; - } else { - Tcl_WrongNumArgs(interp, 2, objv, "?item?"); - return TCL_ERROR; - } -} /* + $tv delete $items -- * Delete each item in $items. * * Do this in two passes: * First detach the item and all its descendants and remove them @@ -3581,16 +3521,10 @@ } if (!(item = FindItem(interp, tv, objv[2]))) { return TCL_ERROR; } - /* The item cannot be moved into view if any ancestor (or itself) is detached. - */ - if (IsItemOrAncestorDetached(tv, item)) { - return TCL_OK; - } - /* Make sure all ancestors are open: */ for (parent = item->parent; parent; parent = parent->parent) { if (!(parent->state & TTK_STATE_OPEN)) { parent->openObj = unshareObj(parent->openObj); @@ -4534,11 +4468,10 @@ { "cget", TtkWidgetCgetCommand,0 }, { "column", TreeviewColumnCommand,0 }, { "configure", TtkWidgetConfigureCommand,0 }, { "delete", TreeviewDeleteCommand,0 }, { "detach", TreeviewDetachCommand,0 }, - { "detached", TreeviewDetachedCommand,0 }, { "drag", TreeviewDragCommand,0 }, { "drop", TreeviewDropCommand,0 }, { "exists", TreeviewExistsCommand,0 }, { "focus", TreeviewFocusCommand,0 }, { "heading", TreeviewHeadingCommand,0 }, Index: generic/ttk/ttkWidget.c ================================================================== --- generic/ttk/ttkWidget.c +++ generic/ttk/ttkWidget.c @@ -480,11 +480,11 @@ Tcl_DStringInit(&styleName); /* Prefix: */ - Ttk_GetOrientFromObj(NULL, orientObj, &orient); + TtkGetOrientFromObj(NULL, orientObj, &orient); if (orient == TTK_ORIENT_HORIZONTAL) Tcl_DStringAppend(&styleName, "Horizontal.", TCL_INDEX_NONE); else Tcl_DStringAppend(&styleName, "Vertical.", TCL_INDEX_NONE); Index: library/demos/anilabel.tcl ================================================================== --- library/demos/anilabel.tcl +++ library/demos/anilabel.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .anilabel catch {destroy $w} toplevel $w wm title $w "Animated Label Demonstration" Index: library/demos/aniwave.tcl ================================================================== --- library/demos/aniwave.tcl +++ library/demos/aniwave.tcl @@ -6,11 +6,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .aniwave catch {destroy $w} toplevel $w wm title $w "Animated Wave Demonstration" Index: library/demos/arrow.tcl ================================================================== --- library/demos/arrow.tcl +++ library/demos/arrow.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk # scl -- # Scales an integer according to the display's current scaling percentage. # # Arguments: Index: library/demos/bind.tcl ================================================================== --- library/demos/bind.tcl +++ library/demos/bind.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .bind catch {destroy $w} toplevel $w wm title $w "Text Demonstration - Tag Bindings" Index: library/demos/bitmap.tcl ================================================================== --- library/demos/bitmap.tcl +++ library/demos/bitmap.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk # bitmapRow -- # Create a row of bitmap items in a window. # # Arguments: Index: library/demos/browse ================================================================== --- library/demos/browse +++ library/demos/browse @@ -5,11 +5,11 @@ # browse -- # This script generates a directory browser, which lists the working # directory and allows you to open files or subdirectories by # double-clicking. -package require tk +package require Tk # Create a scrollbar on the right side of the main window and a listbox # on the left side. scrollbar .scroll -command ".list yview" Index: library/demos/button.tcl ================================================================== --- library/demos/button.tcl +++ library/demos/button.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .button catch {destroy $w} toplevel $w wm title $w "Button Demonstration" Index: library/demos/check.tcl ================================================================== --- library/demos/check.tcl +++ library/demos/check.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .check catch {destroy $w} toplevel $w wm title $w "Checkbutton Demonstration" Index: library/demos/clrpick.tcl ================================================================== --- library/demos/clrpick.tcl +++ library/demos/clrpick.tcl @@ -4,11 +4,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .clrpick catch {destroy $w} toplevel $w wm title $w "Color Selection Dialog" Index: library/demos/colors.tcl ================================================================== --- library/demos/colors.tcl +++ library/demos/colors.tcl @@ -6,11 +6,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .colors catch {destroy $w} toplevel $w wm title $w "Listbox Demonstration (colors)" Index: library/demos/combo.tcl ================================================================== --- library/demos/combo.tcl +++ library/demos/combo.tcl @@ -4,11 +4,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .combo catch {destroy $w} toplevel $w wm title $w "Combobox Demonstration" Index: library/demos/cscroll.tcl ================================================================== --- library/demos/cscroll.tcl +++ library/demos/cscroll.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .cscroll catch {destroy $w} toplevel $w wm title $w "Scrollable Canvas Demonstration" Index: library/demos/ctext.tcl ================================================================== --- library/demos/ctext.tcl +++ library/demos/ctext.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .ctext catch {destroy $w} toplevel $w wm title $w "Canvas Text Demonstration" Index: library/demos/entry1.tcl ================================================================== --- library/demos/entry1.tcl +++ library/demos/entry1.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .entry1 catch {destroy $w} toplevel $w wm title $w "Entry Demonstration (no scrollbars)" Index: library/demos/entry2.tcl ================================================================== --- library/demos/entry2.tcl +++ library/demos/entry2.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .entry2 catch {destroy $w} toplevel $w wm title $w "Entry Demonstration (with scrollbars)" Index: library/demos/entry3.tcl ================================================================== --- library/demos/entry3.tcl +++ library/demos/entry3.tcl @@ -6,11 +6,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .entry3 catch {destroy $w} toplevel $w wm title $w "Constrained Entry Demonstration" Index: library/demos/filebox.tcl ================================================================== --- library/demos/filebox.tcl +++ library/demos/filebox.tcl @@ -4,11 +4,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .filebox catch {destroy $w} toplevel $w wm title $w "File Selection Dialogs" Index: library/demos/floor.tcl ================================================================== --- library/demos/floor.tcl +++ library/demos/floor.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk # floorDisplay -- # Recreate the floorplan display in the canvas given by "w". The # floor given by "active" is displayed on top with its office structure # visible. Index: library/demos/fontchoose.tcl ================================================================== --- library/demos/fontchoose.tcl +++ library/demos/fontchoose.tcl @@ -4,11 +4,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .fontchoose catch {destroy $w} toplevel $w wm title $w "Font Selection Dialog" Index: library/demos/form.tcl ================================================================== --- library/demos/form.tcl +++ library/demos/form.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .form catch {destroy $w} toplevel $w wm title $w "Form Demonstration" Index: library/demos/goldberg.tcl ================================================================== --- library/demos/goldberg.tcl +++ library/demos/goldberg.tcl @@ -38,11 +38,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .goldberg catch {destroy $w} toplevel $w wm title $w "Tk Goldberg (demonstration)" Index: library/demos/hello ================================================================== --- library/demos/hello +++ library/demos/hello @@ -4,11 +4,11 @@ # hello -- # Simple Tk script to create a button that prints "Hello, world". # Click on the button to terminate the program. -package require tk +package require Tk # The first line below creates the button, and the second line # asks the packer to shrink-wrap the application's main window # around the button. Index: library/demos/hscale.tcl ================================================================== --- library/demos/hscale.tcl +++ library/demos/hscale.tcl @@ -4,11 +4,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .hscale catch {destroy $w} toplevel $w wm title $w "Horizontal Scale Demonstration" Index: library/demos/icon.tcl ================================================================== --- library/demos/icon.tcl +++ library/demos/icon.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .icon catch {destroy $w} toplevel $w wm title $w "Iconic Button Demonstration" Index: library/demos/image1.tcl ================================================================== --- library/demos/image1.tcl +++ library/demos/image1.tcl @@ -4,11 +4,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .image1 catch {destroy $w} toplevel $w wm title $w "Image Demonstration #1" Index: library/demos/image2.tcl ================================================================== --- library/demos/image2.tcl +++ library/demos/image2.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk # loadDir -- # This procedure reloads the directory listbox from the directory # named in the demo's entry. # Index: library/demos/images/Tcl.svg ================================================================== --- library/demos/images/Tcl.svg +++ library/demos/images/Tcl.svg @@ -38,38 +38,38 @@ inkscape:window-y="49" /> - image/svg+xml - + rdf:about=""> + image/svg+xml + - - - + style="opacity:1;display:inline" + id="g2244" + transform="translate(308.95998,366.42022)"> + + + Index: library/demos/items.tcl ================================================================== --- library/demos/items.tcl +++ library/demos/items.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .items catch {destroy $w} toplevel $w wm title $w "Canvas Item Demonstration" Index: library/demos/ixset ================================================================== --- library/demos/ixset +++ library/demos/ixset @@ -7,11 +7,11 @@ # # History : # 91/11/23 : pda@masi.ibp.fr, jt@ratp.fr : design # 92/08/01 : pda@masi.ibp.fr : cleaning -package require tk +package require Tk # # Button actions # Index: library/demos/knightstour.tcl ================================================================== --- library/demos/knightstour.tcl +++ library/demos/knightstour.tcl @@ -19,11 +19,11 @@ # # You can drag the knight to a specific square to start if you wish. # If you let it repeat then it will choose random start positions # for each new tour. -package require tk +package require Tk # Return a list of accessible squares from a given square proc ValidMoves {square} { set moves {} foreach pair {{-1 -2} {-2 -1} {-2 1} {-1 2} {1 2} {2 1} {2 -1} {1 -2}} { Index: library/demos/label.tcl ================================================================== --- library/demos/label.tcl +++ library/demos/label.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .label catch {destroy $w} toplevel $w wm title $w "Label Demonstration" Index: library/demos/labelframe.tcl ================================================================== --- library/demos/labelframe.tcl +++ library/demos/labelframe.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .labelframe catch {destroy $w} toplevel $w wm title $w "Labelframe Demonstration" Index: library/demos/mac_styles.tcl ================================================================== --- library/demos/mac_styles.tcl +++ library/demos/mac_styles.tcl @@ -6,14 +6,16 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } +package require Tk + set w .mac_styles catch {destroy $w} toplevel $w -package require tk +package require Tk wm title $w "Tk Aqua Widgets" wm iconname $w "mac_styles" positionWindow $w ## # System images we use in our buttons Index: library/demos/mac_tabs.tcl ================================================================== --- library/demos/mac_tabs.tcl +++ library/demos/mac_tabs.tcl @@ -6,15 +6,16 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk catch {font create giant -family {Times New Roman} -size 64} set w .mac_tabs catch {destroy $w} toplevel $w +package require Tk wm title $w "Tabbed Windows in Aqua" wm iconname $w "mac_tabs" positionWindow $w set suffix 0 set winlist {} Index: library/demos/mac_wm.tcl ================================================================== --- library/demos/mac_wm.tcl +++ library/demos/mac_wm.tcl @@ -6,15 +6,16 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .mac_wm catch {destroy $w} toplevel $w +package require Tk wm title $w "Tk Aqua Window Styles" wm iconname $w "mac_wm" positionWindow $w set suffix 0 set winlist {} Index: library/demos/mclist.tcl ================================================================== --- library/demos/mclist.tcl +++ library/demos/mclist.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .mclist catch {destroy $w} toplevel $w -class MCList wm title $w "Multi-Column List" Index: library/demos/menu.tcl ================================================================== --- library/demos/menu.tcl +++ library/demos/menu.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .menu catch {destroy $w} toplevel $w wm title $w "Menu Demonstration" Index: library/demos/menubu.tcl ================================================================== --- library/demos/menubu.tcl +++ library/demos/menubu.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .menubu catch {destroy $w} toplevel $w wm title $w "Menu Button Demonstration" Index: library/demos/msgbox.tcl ================================================================== --- library/demos/msgbox.tcl +++ library/demos/msgbox.tcl @@ -4,11 +4,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .msgbox catch {destroy $w} toplevel $w wm title $w "Message Box Demonstration" Index: library/demos/nl.msg ================================================================== --- library/demos/nl.msg +++ library/demos/nl.msg @@ -64,19 +64,19 @@ "Kaders met bijschrift" ::msgcat::mcset nl "Listboxes" "Keuzelijsten" ::msgcat::mcset nl "The 50 states" "De 50 staten van de VS" ::msgcat::mcset nl "Colors: change the color scheme for the application" \ - "Kleuren: verander het kleurenschema voor het programma" + "Kleuren: verander het kleurenschema voor het programma" ::msgcat::mcset nl "A collection of famous and infamous sayings" \ - "Beroemde en beruchte citaten en gezegden" + "Beroemde en beruchte citaten en gezegden" ::msgcat::mcset nl "Entries and Spin-boxes" "Invulvelden en Spinboxen" ::msgcat::mcset nl "Entries without scrollbars" "Invulvelden zonder schuifbalk" ::msgcat::mcset nl "Entries with scrollbars" "Invulvelden met schuifbalk" ::msgcat::mcset nl "Validated entries and password fields" \ - "Invulvelden met controle of wachtwoorden" + "Invulvelden met controle of wachtwoorden" ::msgcat::mcset nl "Spin-boxes" "Spinboxen" ::msgcat::mcset nl "Simple Rolodex-like form" "Simpel kaartsysteem" ::msgcat::mcset nl "Text" "Tekst" ::msgcat::mcset nl "Basic editable text" "Voorbeeld met te wijzigen tekst" Index: library/demos/paned1.tcl ================================================================== --- library/demos/paned1.tcl +++ library/demos/paned1.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .paned1 catch {destroy $w} toplevel $w wm title $w "Horizontal Paned Window Demonstration" Index: library/demos/paned2.tcl ================================================================== --- library/demos/paned2.tcl +++ library/demos/paned2.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .paned2 catch {destroy $w} toplevel $w wm title $w "Vertical Paned Window Demonstration" Index: library/demos/pendulum.tcl ================================================================== --- library/demos/pendulum.tcl +++ library/demos/pendulum.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .pendulum catch {destroy $w} toplevel $w wm title $w "Pendulum Animation Demonstration" Index: library/demos/plot.tcl ================================================================== --- library/demos/plot.tcl +++ library/demos/plot.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .plot catch {destroy $w} toplevel $w wm title $w "Plot Demonstration" Index: library/demos/puzzle.tcl ================================================================== --- library/demos/puzzle.tcl +++ library/demos/puzzle.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk # puzzleSwitch -- # This procedure is invoked when the user clicks on a particular button; # if the button is next to the empty space, it moves the button into the # empty space. Index: library/demos/radio.tcl ================================================================== --- library/demos/radio.tcl +++ library/demos/radio.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .radio catch {destroy $w} toplevel $w wm title $w "Radiobutton Demonstration" Index: library/demos/rmt ================================================================== --- library/demos/rmt +++ library/demos/rmt @@ -5,11 +5,11 @@ # rmt -- # This script implements a simple remote-control mechanism for # Tk applications. It allows you to select an application and # then type commands to that application. -package require tk +package require Tk wm title . "Tk Remote Controller" wm iconname . "Tk Remote" wm minsize . 1 1 Index: library/demos/rolodex ================================================================== --- library/demos/rolodex +++ library/demos/rolodex @@ -6,11 +6,11 @@ # This script was written as an entry in Tom LaStrange's rolodex # benchmark. It creates something that has some of the look and # feel of a rolodex program, although it's lifeless and doesn't # actually do the rolodex application. -package require tk +package require Tk foreach i [winfo children .] { catch {destroy $i} } Index: library/demos/ruler.tcl ================================================================== --- library/demos/ruler.tcl +++ library/demos/ruler.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk # rulerMkTab -- # This procedure creates a new triangular polygon in a canvas to # represent a tab stop. # Index: library/demos/sayings.tcl ================================================================== --- library/demos/sayings.tcl +++ library/demos/sayings.tcl @@ -6,11 +6,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .sayings catch {destroy $w} toplevel $w wm title $w "Listbox Demonstration (well-known sayings)" Index: library/demos/search.tcl ================================================================== --- library/demos/search.tcl +++ library/demos/search.tcl @@ -6,11 +6,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk # textLoadFile -- # This procedure below loads a file into a text widget, discarding # the previous contents of the widget. Tags for the old widget are # not affected, however. Index: library/demos/spin.tcl ================================================================== --- library/demos/spin.tcl +++ library/demos/spin.tcl @@ -4,11 +4,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .spin catch {destroy $w} toplevel $w wm title $w "Spinbox Demonstration" Index: library/demos/states.tcl ================================================================== --- library/demos/states.tcl +++ library/demos/states.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .states catch {destroy $w} toplevel $w wm title $w "Listbox Demonstration (50 states)" Index: library/demos/style.tcl ================================================================== --- library/demos/style.tcl +++ library/demos/style.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .style catch {destroy $w} toplevel $w wm title $w "Text Demonstration - Display Styles" Index: library/demos/tcolor ================================================================== --- library/demos/tcolor +++ library/demos/tcolor @@ -5,11 +5,11 @@ # tcolor -- # This script implements a simple color editor, where you can # create colors using either the RGB, HSB, or CYM color spaces # and apply the color to existing applications. -package require tk +package require Tk wm title . "Color Editor" # Global variables that control the program: # # colorSpace - Color space currently being used for Index: library/demos/text.tcl ================================================================== --- library/demos/text.tcl +++ library/demos/text.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .text catch {destroy $w} toplevel $w wm title $w "Text Demonstration - Basic Facilities" Index: library/demos/textpeer.tcl ================================================================== --- library/demos/textpeer.tcl +++ library/demos/textpeer.tcl @@ -6,11 +6,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .textpeer catch {destroy $w} toplevel $w wm title $w "Text Widget Peering Demonstration" Index: library/demos/timer ================================================================== --- library/demos/timer +++ library/demos/timer @@ -3,11 +3,11 @@ exec wish "$0" ${1+"$@"} # timer -- # This script generates a counter with start and stop buttons. -package require tk +package require Tk label .counter -text 0.00 -relief raised -width 10 -padx 2m -pady 1m button .start -text Start -command { if {$stopped} { set stopped 0 Index: library/demos/toolbar.tcl ================================================================== --- library/demos/toolbar.tcl +++ library/demos/toolbar.tcl @@ -4,11 +4,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .toolbar destroy $w toplevel $w wm title $w "Toolbar Demonstration" Index: library/demos/tree.tcl ================================================================== --- library/demos/tree.tcl +++ library/demos/tree.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .tree catch {destroy $w} toplevel $w wm title $w "Directory Browser" Index: library/demos/ttkbut.tcl ================================================================== --- library/demos/ttkbut.tcl +++ library/demos/ttkbut.tcl @@ -6,11 +6,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .ttkbut catch {destroy $w} toplevel $w wm title $w "Simple Ttk Widgets" Index: library/demos/ttkmenu.tcl ================================================================== --- library/demos/ttkmenu.tcl +++ library/demos/ttkmenu.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .ttkmenu catch {destroy $w} toplevel $w wm title $w "Ttk Menu Buttons" Index: library/demos/ttknote.tcl ================================================================== --- library/demos/ttknote.tcl +++ library/demos/ttknote.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .ttknote catch {destroy $w} toplevel $w wm title $w "Ttk Notebook Widget" Index: library/demos/ttkpane.tcl ================================================================== --- library/demos/ttkpane.tcl +++ library/demos/ttkpane.tcl @@ -4,11 +4,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .ttkpane catch {destroy $w} toplevel $w wm title $w "Themed Nested Panes" Index: library/demos/ttkprogress.tcl ================================================================== --- library/demos/ttkprogress.tcl +++ library/demos/ttkprogress.tcl @@ -4,11 +4,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .ttkprogress catch {destroy $w} toplevel $w wm title $w "Progress Bar Demonstration" Index: library/demos/ttkscale.tcl ================================================================== --- library/demos/ttkscale.tcl +++ library/demos/ttkscale.tcl @@ -4,11 +4,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .ttkscale catch {destroy $w} toplevel $w -bg [ttk::style lookup TLabel -background] wm title $w "Themed Scale Demonstration" Index: library/demos/ttkspin.tcl ================================================================== --- library/demos/ttkspin.tcl +++ library/demos/ttkspin.tcl @@ -4,11 +4,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .ttkspin catch {destroy $w} toplevel $w wm title $w "Themed Spinbox Demonstration" Index: library/demos/twind.tcl ================================================================== --- library/demos/twind.tcl +++ library/demos/twind.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk # Make an Aqua button's fill color match its parent's background proc blend {bt} { if {[tk windowingsystem] eq "aqua"} { $bt configure -highlightbackground [[winfo parent $bt] cget -background] Index: library/demos/unicodeout.tcl ================================================================== --- library/demos/unicodeout.tcl +++ library/demos/unicodeout.tcl @@ -5,11 +5,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .unicodeout catch {destroy $w} toplevel $w wm title $w "Unicode Label Demonstration" Index: library/demos/vscale.tcl ================================================================== --- library/demos/vscale.tcl +++ library/demos/vscale.tcl @@ -4,11 +4,11 @@ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } -package require tk +package require Tk set w .vscale catch {destroy $w} toplevel $w wm title $w "Vertical Scale Demonstration" Index: library/demos/widget ================================================================== --- library/demos/widget +++ library/demos/widget @@ -8,11 +8,11 @@ # the main window for the application, which invokes individual # demonstrations. The code for the actual demonstrations is contained in # separate ".tcl" files is this directory, which are sourced by this script as # needed. -package require tk 8.7- +package require Tk 8.7- package require msgcat destroy {*}[winfo children .] set tk_demoDirectory [file join [pwd] [file dirname [info script]]] ::msgcat::mcload $tk_demoDirectory Index: library/menu.tcl ================================================================== --- library/menu.tcl +++ library/menu.tcl @@ -485,10 +485,11 @@ $menu activate @$x,$y GenerateMenuSelect $menu } set index [$menu index @$x,$y] if {[info exists Priv(menuActivated)] \ + && $index ne "none" \ && $index >= 0 \ && $index ne $activeindex} { set mode [option get $menu clickToFocus ClickToFocus] if {[string is false $mode]} { set delay [expr {[$menu cget -type] eq "menubar" ? 0 : 50}] @@ -527,11 +528,12 @@ variable ::tk::Priv if {![winfo viewable $menu]} { return } - if {[$menu index active] < 0} { + set activeindex [$menu index active] + if {($activeindex eq "none") || ($activeindex < 0)} { if {[$menu cget -type] ne "menubar" } { set Priv(window) {} } return } @@ -585,11 +587,12 @@ # state - Modifier state. proc ::tk::MenuLeave {menu rootx rooty state} { variable ::tk::Priv set Priv(window) {} - if {[$menu index active] < 0} { + set activeindex [$menu index active] + if {($activeindex eq "none") || ($activeindex < 0)} { return } if {[$menu type active] eq "cascade" \ && [winfo containing $rootx $rooty] eq \ [$menu entrycget active -menu]} { @@ -652,11 +655,12 @@ if { !$isCascade } { uplevel #0 [list $w invoke $activeindex] } } else { - if {$Priv(popup) eq "" || [$w index active] >= 0} { + set activeindex [$w index active] + if {($Priv(popup) eq "") || (($activeindex ne "none") && ($activeindex >= 0))} { MenuUnpost $w } uplevel #0 [list $w invoke active] } } @@ -796,10 +800,11 @@ } set mb [lindex $buttons $i] if {[winfo class $mb] eq "Menubutton" \ && [$mb cget -state] ne "disabled" \ && [$mb cget -menu] ne "" \ + && [[$mb cget -menu] index last] ne "none" \ && [[$mb cget -menu] index last] >= 0} { break } if {$mb eq $w} { return @@ -819,17 +824,17 @@ # count - 1 means go to the next lower entry, # -1 means go to the next higher entry. proc ::tk::MenuNextEntry {menu count} { set last [$menu index last] - if {$last < 0} { + if {($last eq "none") || ($last < 0)} { return } set length [expr {$last+1}] set quitAfter $length set activeindex [$menu index active] - if {$activeindex < 0} { + if {($activeindex eq "none") || ($activeindex < 0)} { set i 0 } else { set i [expr {$activeindex + $count}] } while {1} { @@ -1025,10 +1030,13 @@ if {$char eq ""} { return } set char [string tolower $char] set last [$w index last] + if {$last eq "none"} { + return + } for {set i 0} {$i <= $last} {incr i} { if {[catch {set char2 [string index \ [$w entrycget $i -label] [$w entrycget $i -underline]]}]} { continue } @@ -1064,14 +1072,18 @@ proc ::tk::MenuFirstEntry menu { if {$menu eq ""} { return } tk_menuSetFocus $menu - if {[$menu index active] >= 0} { + set activeindex [$menu index active] + if {($activeindex ne "none") && ($activeindex >= 0)} { return } set last [$menu index last] + if {$last eq "none"} { + return + } for {set i 0} {$i <= $last} {incr i} { if {([catch {set state [$menu entrycget $i -state]}] == 0) \ && $state ne "disabled" && [$menu type $i] ne "tearoff"} { $menu activate $i GenerateMenuSelect $menu @@ -1107,10 +1119,13 @@ if {![regexp {^active$|^last$|^none$|^[0-9]|^@} $s]} { catch {set i [$menu index $s]} return $i } set last [$menu index last] + if {$last eq "none"} { + return "" + } for {set i 0} {$i <= $last} {incr i} { if {![catch {$menu entrycget $i -label} label]} { if {$label eq $s} { return $i } ADDED library/obsolete.tcl Index: library/obsolete.tcl ================================================================== --- /dev/null +++ library/obsolete.tcl @@ -0,0 +1,178 @@ +# obsolete.tcl -- +# +# This file contains obsolete procedures that people really shouldn't +# be using anymore, but which are kept around for backward compatibility. +# +# Copyright © 1994 The Regents of the University of California. +# Copyright © 1994 Sun Microsystems, Inc. +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# + +# The procedures below are here strictly for backward compatibility with +# Tk version 3.6 and earlier. The procedures are no longer needed, so +# they are no-ops. You should not use these procedures anymore, since +# they may be removed in some future release. + +proc tk_menuBar args {} +proc tk_bindForTraversal args {} + +# ::tk::classic::restore -- +# +# Restore the pre-8.5 (Tk classic) look as the widget defaults for classic +# Tk widgets. +# +# The value following an 'option add' call is the new 8.5 value. +# +namespace eval ::tk::classic { + # This may need to be adjusted for some window managers that are + # more aggressive with their own Xdefaults (like KDE and CDE) + variable prio "widgetDefault" +} + +proc ::tk::classic::restore {args} { + # Restore classic (8.4) look to classic Tk widgets + variable prio + + if {[llength $args]} { + foreach what $args { + ::tk::classic::restore_$what + } + } else { + foreach cmd [info procs restore_*] { + $cmd + } + } +} + +proc ::tk::classic::restore_font {args} { + # Many widgets were adjusted from hard-coded defaults to using the + # TIP#145 fonts defined in fonts.tcl (eg TkDefaultFont, TkFixedFont, ...) + # For restoring compatibility, we only correct size and weighting changes, + # as the fonts themselves remained mostly the same. + if {[tk windowingsystem] eq "x11"} { + font configure TkDefaultFont -weight bold ; # normal + font configure TkFixedFont -size -12 ; # -10 + } + # Add these with prio 21 to override value in dialog/msgbox.tcl + if {[tk windowingsystem] eq "aqua"} { + option add *Dialog.msg.font system 21; # TkCaptionFont + option add *Dialog.dtl.font system 21; # TkCaptionFont + option add *ErrorDialog*Label.font system 21; # TkCaptionFont + } else { + option add *Dialog.msg.font {Times 12} 21; # TkCaptionFont + option add *Dialog.dtl.font {Times 10} 21; # TkCaptionFont + option add *ErrorDialog*Label.font {Times -18} 21; # TkCaptionFont + } +} + +proc ::tk::classic::restore_button {args} { + variable prio + if {[tk windowingsystem] eq "x11"} { + foreach cls {Button Radiobutton Checkbutton} { + option add *$cls.borderWidth 2 $prio; # 1 + } + } +} + +proc ::tk::classic::restore_entry {args} { + variable prio + # Entry and Spinbox share core defaults + foreach cls {Entry Spinbox} { + if {[tk windowingsystem] ne "aqua"} { + option add *$cls.borderWidth 2 $prio; # 1 + } + if {[tk windowingsystem] eq "x11"} { + option add *$cls.background "#d9d9d9" $prio; # "white" + option add *$cls.selectBorderWidth 1 $prio; # 0 + } + } +} + +proc ::tk::classic::restore_listbox {args} { + variable prio + if {[tk windowingsystem] ne "win32"} { + option add *Listbox.background "#d9d9d9" $prio; # "white" + option add *Listbox.activeStyle "underline" $prio; # "dotbox" + } + if {[tk windowingsystem] ne "aqua"} { + option add *Listbox.borderWidth 2 $prio; # 1 + } + if {[tk windowingsystem] eq "x11"} { + option add *Listbox.selectBorderWidth 1 $prio; # 0 + } + # Remove focus into Listbox added for 8.5 + bind Listbox { + if {[winfo exists %W]} { + tk::ListboxBeginSelect %W [%W index @%x,%y] + } + } +} + +proc ::tk::classic::restore_menu {args} { + variable prio + if {[tk windowingsystem] eq "x11"} { + option add *Menu.activeBorderWidth 2 $prio; # 1 + option add *Menu.borderWidth 2 $prio; # 1 + option add *Menu.clickToFocus true $prio + option add *Menu.useMotifHelp true $prio + } + if {[tk windowingsystem] ne "aqua"} { + option add *Menu.font "TkDefaultFont" $prio; # "TkMenuFont" + } +} + +proc ::tk::classic::restore_menubutton {args} { + variable prio + option add *Menubutton.borderWidth 2 $prio; # 1 +} + +proc ::tk::classic::restore_message {args} { + variable prio + option add *Message.borderWidth 2 $prio; # 1 +} + +proc ::tk::classic::restore_panedwindow {args} { + variable prio + option add *Panedwindow.borderWidth 2 $prio; # 1 + option add *Panedwindow.sashWidth 2 $prio; # 3 + option add *Panedwindow.sashPad 2 $prio; # 0 + option add *Panedwindow.sashRelief raised $prio; # flat + option add *Panedwindow.opaqueResize 0 $prio; # 1 + if {[tk windowingsystem] ne "win32"} { + option add *Panedwindow.showHandle 1 $prio; # 0 + } +} + +proc ::tk::classic::restore_scale {args} { + variable prio + option add *Scale.borderWidth 2 $prio; # 1 + if {[tk windowingsystem] eq "x11"} { + option add *Scale.troughColor "#c3c3c3" $prio; # "#b3b3b3" + } +} + +proc ::tk::classic::restore_scrollbar {args} { + variable prio + if {[tk windowingsystem] eq "x11"} { + option add *Scrollbar.borderWidth 2 $prio; # 1 + option add *Scrollbar.highlightThickness 1 $prio; # 0 + option add *Scrollbar.width 15 $prio; # 11 + option add *Scrollbar.troughColor "#c3c3c3" $prio; # "#b3b3b3" + } +} + +proc ::tk::classic::restore_text {args} { + variable prio + if {[tk windowingsystem] ne "aqua"} { + option add *Text.borderWidth 2 $prio; # 1 + } + if {[tk windowingsystem] eq "win32"} { + option add *Text.font "TkDefaultFont" $prio; # "TkFixedFont" + } + if {[tk windowingsystem] eq "x11"} { + option add *Text.background "#d9d9d9" $prio; # white + option add *Text.selectBorderWidth 1 $prio; # 0 + } +} Index: library/tclIndex ================================================================== --- library/tclIndex +++ library/tclIndex @@ -4,249 +4,254 @@ # more commands. Typically each line is a command that # sets an element in the auto_index array, where the # element name is the name of a command and the value is # a script that loads the command. -set auto_index(::tk::dialog::error::Return) [list source [file join $dir bgerror.tcl]] -set auto_index(::tk::dialog::error::Details) [list source [file join $dir bgerror.tcl]] -set auto_index(::tk::dialog::error::SaveToLog) [list source [file join $dir bgerror.tcl]] -set auto_index(::tk::dialog::error::Destroy) [list source [file join $dir bgerror.tcl]] -set auto_index(::tk::dialog::error::bgerror) [list source [file join $dir bgerror.tcl]] -set auto_index(bgerror) [list source [file join $dir bgerror.tcl]] -set auto_index(::tk::ButtonInvoke) [list source [file join $dir button.tcl]] -set auto_index(::tk::ButtonAutoInvoke) [list source [file join $dir button.tcl]] -set auto_index(::tk::CheckRadioInvoke) [list source [file join $dir button.tcl]] -set auto_index(::tk::dialog::file::chooseDir::) [list source [file join $dir choosedir.tcl]] -set auto_index(::tk::dialog::file::chooseDir::Config) [list source [file join $dir choosedir.tcl]] -set auto_index(::tk::dialog::file::chooseDir::OkCmd) [list source [file join $dir choosedir.tcl]] -set auto_index(::tk::dialog::file::chooseDir::DblClick) [list source [file join $dir choosedir.tcl]] -set auto_index(::tk::dialog::file::chooseDir::ListBrowse) [list source [file join $dir choosedir.tcl]] -set auto_index(::tk::dialog::file::chooseDir::Done) [list source [file join $dir choosedir.tcl]] -set auto_index(::tk::dialog::color::) [list source [file join $dir clrpick.tcl]] -set auto_index(::tk::dialog::color::InitValues) [list source [file join $dir clrpick.tcl]] -set auto_index(::tk::dialog::color::Config) [list source [file join $dir clrpick.tcl]] -set auto_index(::tk::dialog::color::BuildDialog) [list source [file join $dir clrpick.tcl]] -set auto_index(::tk::dialog::color::SetRGBValue) [list source [file join $dir clrpick.tcl]] -set auto_index(::tk::dialog::color::XToRgb) [list source [file join $dir clrpick.tcl]] -set auto_index(::tk::dialog::color::RgbToX) [list source [file join $dir clrpick.tcl]] -set auto_index(::tk::dialog::color::DrawColorScale) [list source [file join $dir clrpick.tcl]] -set auto_index(::tk::dialog::color::CreateSelector) [list source [file join $dir clrpick.tcl]] -set auto_index(::tk::dialog::color::RedrawFinalColor) [list source [file join $dir clrpick.tcl]] -set auto_index(::tk::dialog::color::RedrawColorBars) [list source [file join $dir clrpick.tcl]] -set auto_index(::tk::dialog::color::StartMove) [list source [file join $dir clrpick.tcl]] -set auto_index(::tk::dialog::color::MoveSelector) [list source [file join $dir clrpick.tcl]] -set auto_index(::tk::dialog::color::ReleaseMouse) [list source [file join $dir clrpick.tcl]] -set auto_index(::tk::dialog::color::ResizeColorBars) [list source [file join $dir clrpick.tcl]] -set auto_index(::tk::dialog::color::HandleSelEntry) [list source [file join $dir clrpick.tcl]] -set auto_index(::tk::dialog::color::HandleRGBEntry) [list source [file join $dir clrpick.tcl]] -set auto_index(::tk::dialog::color::EnterColorBar) [list source [file join $dir clrpick.tcl]] -set auto_index(::tk::dialog::color::LeaveColorBar) [list source [file join $dir clrpick.tcl]] -set auto_index(::tk::dialog::color::OkCmd) [list source [file join $dir clrpick.tcl]] -set auto_index(::tk::dialog::color::CancelCmd) [list source [file join $dir clrpick.tcl]] -set auto_index(tclParseConfigSpec) [list source [file join $dir comdlg.tcl]] -set auto_index(tclListValidFlags) [list source [file join $dir comdlg.tcl]] -set auto_index(::tk::FocusGroup_Create) [list source [file join $dir comdlg.tcl]] -set auto_index(::tk::FocusGroup_BindIn) [list source [file join $dir comdlg.tcl]] -set auto_index(::tk::FocusGroup_BindOut) [list source [file join $dir comdlg.tcl]] -set auto_index(::tk::FocusGroup_Destroy) [list source [file join $dir comdlg.tcl]] -set auto_index(::tk::FocusGroup_In) [list source [file join $dir comdlg.tcl]] -set auto_index(::tk::FocusGroup_Out) [list source [file join $dir comdlg.tcl]] -set auto_index(::tk::FDGetFileTypes) [list source [file join $dir comdlg.tcl]] -set auto_index(::tk::ConsoleInit) [list source [file join $dir console.tcl]] -set auto_index(::tk::ConsoleSource) [list source [file join $dir console.tcl]] -set auto_index(::tk::ConsoleInvoke) [list source [file join $dir console.tcl]] -set auto_index(::tk::ConsoleHistory) [list source [file join $dir console.tcl]] -set auto_index(::tk::ConsolePrompt) [list source [file join $dir console.tcl]] -set auto_index(::tk::ConsoleBind) [list source [file join $dir console.tcl]] -set auto_index(::tk::ConsoleInsert) [list source [file join $dir console.tcl]] -set auto_index(::tk::ConsoleOutput) [list source [file join $dir console.tcl]] -set auto_index(::tk::ConsoleExit) [list source [file join $dir console.tcl]] -set auto_index(::tk::ConsoleAbout) [list source [file join $dir console.tcl]] -set auto_index(tk_dialog) [list source [file join $dir dialog.tcl]] -set auto_index(::tk::EntryClosestGap) [list source [file join $dir entry.tcl]] -set auto_index(::tk::EntryButton1) [list source [file join $dir entry.tcl]] -set auto_index(::tk::EntryMouseSelect) [list source [file join $dir entry.tcl]] -set auto_index(::tk::EntryPaste) [list source [file join $dir entry.tcl]] -set auto_index(::tk::EntryAutoScan) [list source [file join $dir entry.tcl]] -set auto_index(::tk::EntryKeySelect) [list source [file join $dir entry.tcl]] -set auto_index(::tk::EntryInsert) [list source [file join $dir entry.tcl]] -set auto_index(::tk::EntryBackspace) [list source [file join $dir entry.tcl]] -set auto_index(::tk::EntrySeeInsert) [list source [file join $dir entry.tcl]] -set auto_index(::tk::EntrySetCursor) [list source [file join $dir entry.tcl]] -set auto_index(::tk::EntryTranspose) [list source [file join $dir entry.tcl]] -set auto_index(::tk::EntryPreviousWord) [list source [file join $dir entry.tcl]] -set auto_index(::tk::EntryGetSelection) [list source [file join $dir entry.tcl]] -set auto_index(tk_focusNext) [list source [file join $dir focus.tcl]] -set auto_index(tk_focusPrev) [list source [file join $dir focus.tcl]] -set auto_index(::tk::FocusOK) [list source [file join $dir focus.tcl]] -set auto_index(tk_focusFollowsMouse) [list source [file join $dir focus.tcl]] -set auto_index(::tk::IconList) [list source [file join $dir iconlist.tcl]] -set auto_index(::tk::ListboxBeginSelect) [list source [file join $dir listbox.tcl]] -set auto_index(::tk::ListboxMotion) [list source [file join $dir listbox.tcl]] -set auto_index(::tk::ListboxBeginExtend) [list source [file join $dir listbox.tcl]] -set auto_index(::tk::ListboxBeginToggle) [list source [file join $dir listbox.tcl]] -set auto_index(::tk::ListboxAutoScan) [list source [file join $dir listbox.tcl]] -set auto_index(::tk::ListboxUpDown) [list source [file join $dir listbox.tcl]] -set auto_index(::tk::ListboxExtendUpDown) [list source [file join $dir listbox.tcl]] -set auto_index(::tk::ListboxDataExtend) [list source [file join $dir listbox.tcl]] -set auto_index(::tk::ListboxCancel) [list source [file join $dir listbox.tcl]] -set auto_index(::tk::ListboxSelectAll) [list source [file join $dir listbox.tcl]] -set auto_index(::tk::Megawidget) [list source [file join $dir megawidget.tcl]] -set auto_index(::tk::MbEnter) [list source [file join $dir menu.tcl]] -set auto_index(::tk::MbLeave) [list source [file join $dir menu.tcl]] -set auto_index(::tk::MbPost) [list source [file join $dir menu.tcl]] -set auto_index(::tk::MenuUnpost) [list source [file join $dir menu.tcl]] -set auto_index(::tk::MbMotion) [list source [file join $dir menu.tcl]] -set auto_index(::tk::MbButtonUp) [list source [file join $dir menu.tcl]] -set auto_index(::tk::MenuMotion) [list source [file join $dir menu.tcl]] -set auto_index(::tk::MenuButtonDown) [list source [file join $dir menu.tcl]] -set auto_index(::tk::MenuLeave) [list source [file join $dir menu.tcl]] -set auto_index(::tk::MenuInvoke) [list source [file join $dir menu.tcl]] -set auto_index(::tk::MenuEscape) [list source [file join $dir menu.tcl]] -set auto_index(::tk::MenuUpArrow) [list source [file join $dir menu.tcl]] -set auto_index(::tk::MenuDownArrow) [list source [file join $dir menu.tcl]] -set auto_index(::tk::MenuLeftArrow) [list source [file join $dir menu.tcl]] -set auto_index(::tk::MenuRightArrow) [list source [file join $dir menu.tcl]] -set auto_index(::tk::MenuNextMenu) [list source [file join $dir menu.tcl]] -set auto_index(::tk::MenuNextEntry) [list source [file join $dir menu.tcl]] -set auto_index(::tk::MenuFind) [list source [file join $dir menu.tcl]] -set auto_index(::tk::TraverseToMenu) [list source [file join $dir menu.tcl]] -set auto_index(::tk::FirstMenu) [list source [file join $dir menu.tcl]] -set auto_index(::tk::TraverseWithinMenu) [list source [file join $dir menu.tcl]] -set auto_index(::tk::MenuFirstEntry) [list source [file join $dir menu.tcl]] -set auto_index(::tk::MenuFindName) [list source [file join $dir menu.tcl]] -set auto_index(::tk::PostOverPoint) [list source [file join $dir menu.tcl]] -set auto_index(::tk::SaveGrabInfo) [list source [file join $dir menu.tcl]] -set auto_index(::tk::RestoreOldGrab) [list source [file join $dir menu.tcl]] -set auto_index(tk_menuSetFocus) [list source [file join $dir menu.tcl]] -set auto_index(::tk::GenerateMenuSelect) [list source [file join $dir menu.tcl]] -set auto_index(tk_popup) [list source [file join $dir menu.tcl]] -set auto_index(::tk::ensure_psenc_is_loaded) [list source [file join $dir mkpsenc.tcl]] -set auto_index(::tk::MessageBox) [list source [file join $dir msgbox.tcl]] -set auto_index(tk_optionMenu) [list source [file join $dir optMenu.tcl]] -set auto_index(tk_setPalette) [list source [file join $dir palette.tcl]] -set auto_index(::tk::RecolorTree) [list source [file join $dir palette.tcl]] -set auto_index(::tk::Darken) [list source [file join $dir palette.tcl]] -set auto_index(tk_bisque) [list source [file join $dir palette.tcl]] -set auto_index(::safe::tkInterpInit) [list source [file join $dir safetk.tcl]] -set auto_index(::safe::loadTk) [list source [file join $dir safetk.tcl]] -set auto_index(::safe::TkInit) [list source [file join $dir safetk.tcl]] -set auto_index(::safe::allowTk) [list source [file join $dir safetk.tcl]] -set auto_index(::safe::disallowTk) [list source [file join $dir safetk.tcl]] -set auto_index(::safe::tkDelete) [list source [file join $dir safetk.tcl]] -set auto_index(::safe::tkTopLevel) [list source [file join $dir safetk.tcl]] -set auto_index(::tk::ScaleActivate) [list source [file join $dir scale.tcl]] -set auto_index(::tk::ScaleButtonDown) [list source [file join $dir scale.tcl]] -set auto_index(::tk::ScaleDrag) [list source [file join $dir scale.tcl]] -set auto_index(::tk::ScaleEndDrag) [list source [file join $dir scale.tcl]] -set auto_index(::tk::ScaleIncrement) [list source [file join $dir scale.tcl]] -set auto_index(::tk::ScaleControlPress) [list source [file join $dir scale.tcl]] -set auto_index(::tk::ScaleButton2Down) [list source [file join $dir scale.tcl]] -set auto_index(::tk::ScalingPct) [list source [file join $dir scaling.tcl]] -set auto_index(::tk::ScaleNum) [list source [file join $dir scaling.tcl]] -set auto_index(::tk::FontScalingFactor) [list source [file join $dir scaling.tcl]] -set auto_index(::tk::ScanMonitorsFile) [list source [file join $dir scaling.tcl]] -set auto_index(::tk::ScrollButtonDown) [list source [file join $dir scrlbar.tcl]] -set auto_index(::tk::ScrollButtonUp) [list source [file join $dir scrlbar.tcl]] -set auto_index(::tk::ScrollSelect) [list source [file join $dir scrlbar.tcl]] -set auto_index(::tk::ScrollStartDrag) [list source [file join $dir scrlbar.tcl]] -set auto_index(::tk::ScrollDrag) [list source [file join $dir scrlbar.tcl]] -set auto_index(::tk::ScrollEndDrag) [list source [file join $dir scrlbar.tcl]] -set auto_index(::tk::ScrollByUnits) [list source [file join $dir scrlbar.tcl]] -set auto_index(::tk::ScrollByPages) [list source [file join $dir scrlbar.tcl]] -set auto_index(::tk::ScrollToPos) [list source [file join $dir scrlbar.tcl]] -set auto_index(::tk::ScrollTopBottom) [list source [file join $dir scrlbar.tcl]] -set auto_index(::tk::ScrollButton2Down) [list source [file join $dir scrlbar.tcl]] -set auto_index(::tk::spinbox::Invoke) [list source [file join $dir spinbox.tcl]] -set auto_index(::tk::spinbox::ClosestGap) [list source [file join $dir spinbox.tcl]] -set auto_index(::tk::spinbox::ButtonDown) [list source [file join $dir spinbox.tcl]] -set auto_index(::tk::spinbox::ButtonUp) [list source [file join $dir spinbox.tcl]] -set auto_index(::tk::spinbox::MouseSelect) [list source [file join $dir spinbox.tcl]] -set auto_index(::tk::spinbox::Paste) [list source [file join $dir spinbox.tcl]] -set auto_index(::tk::spinbox::Motion) [list source [file join $dir spinbox.tcl]] -set auto_index(::tk::spinbox::AutoScan) [list source [file join $dir spinbox.tcl]] -set auto_index(::tk::spinbox::KeySelect) [list source [file join $dir spinbox.tcl]] -set auto_index(::tk::spinbox::Insert) [list source [file join $dir spinbox.tcl]] -set auto_index(::tk::spinbox::Backspace) [list source [file join $dir spinbox.tcl]] -set auto_index(::tk::spinbox::SeeInsert) [list source [file join $dir spinbox.tcl]] -set auto_index(::tk::spinbox::SetCursor) [list source [file join $dir spinbox.tcl]] -set auto_index(::tk::spinbox::Transpose) [list source [file join $dir spinbox.tcl]] -set auto_index(::tk::spinbox::PreviousWord) [list source [file join $dir spinbox.tcl]] -set auto_index(::tk::spinbox::GetSelection) [list source [file join $dir spinbox.tcl]] -set auto_index(::tk::TearOffMenu) [list source [file join $dir tearoff.tcl]] -set auto_index(::tk::MenuDup) [list source [file join $dir tearoff.tcl]] -set auto_index(::tk::TextClosestGap) [list source [file join $dir text.tcl]] -set auto_index(::tk::TextButton1) [list source [file join $dir text.tcl]] -set auto_index(::tk::TextSelectTo) [list source [file join $dir text.tcl]] -set auto_index(::tk::TextKeyExtend) [list source [file join $dir text.tcl]] -set auto_index(::tk::TextPaste) [list source [file join $dir text.tcl]] -set auto_index(::tk::TextAutoScan) [list source [file join $dir text.tcl]] -set auto_index(::tk::TextSetCursor) [list source [file join $dir text.tcl]] -set auto_index(::tk::TextKeySelect) [list source [file join $dir text.tcl]] -set auto_index(::tk::TextResetAnchor) [list source [file join $dir text.tcl]] -set auto_index(::tk::TextInsert) [list source [file join $dir text.tcl]] -set auto_index(::tk::TextUpDownLine) [list source [file join $dir text.tcl]] -set auto_index(::tk::TextPrevPara) [list source [file join $dir text.tcl]] -set auto_index(::tk::TextNextPara) [list source [file join $dir text.tcl]] -set auto_index(::tk::TextScrollPages) [list source [file join $dir text.tcl]] -set auto_index(::tk::TextTranspose) [list source [file join $dir text.tcl]] -set auto_index(tk_textCopy) [list source [file join $dir text.tcl]] -set auto_index(tk_textCut) [list source [file join $dir text.tcl]] -set auto_index(tk_textPaste) [list source [file join $dir text.tcl]] -set auto_index(::tk::TextNextPos) [list source [file join $dir text.tcl]] -set auto_index(::tk::TextPrevPos) [list source [file join $dir text.tcl]] -set auto_index(::tk::PlaceWindow) [list source [file join $dir tk.tcl]] -set auto_index(::tk::SetFocusGrab) [list source [file join $dir tk.tcl]] -set auto_index(::tk::RestoreFocusGrab) [list source [file join $dir tk.tcl]] -set auto_index(::tk::ScreenChanged) [list source [file join $dir tk.tcl]] -set auto_index(::tk::EventMotifBindings) [list source [file join $dir tk.tcl]] -set auto_index(::tk::CancelRepeat) [list source [file join $dir tk.tcl]] -set auto_index(::tk::MouseWheel) [list source [file join $dir tk.tcl]] -set auto_index(::tk::TabToWindow) [list source [file join $dir tk.tcl]] -set auto_index(::tk::dialog::file::) [list source [file join $dir tkfbox.tcl]] -set auto_index(::tk::dialog::file::Config) [list source [file join $dir tkfbox.tcl]] -set auto_index(::tk::dialog::file::Create) [list source [file join $dir tkfbox.tcl]] -set auto_index(::tk::dialog::file::SetSelectMode) [list source [file join $dir tkfbox.tcl]] -set auto_index(::tk::dialog::file::UpdateWhenIdle) [list source [file join $dir tkfbox.tcl]] -set auto_index(::tk::dialog::file::Update) [list source [file join $dir tkfbox.tcl]] -set auto_index(::tk::dialog::file::SetPathSilently) [list source [file join $dir tkfbox.tcl]] -set auto_index(::tk::dialog::file::SetPath) [list source [file join $dir tkfbox.tcl]] -set auto_index(::tk::dialog::file::SetFilter) [list source [file join $dir tkfbox.tcl]] -set auto_index(::tk::dialog::file::ResolveFile) [list source [file join $dir tkfbox.tcl]] -set auto_index(::tk::dialog::file::EntFocusIn) [list source [file join $dir tkfbox.tcl]] -set auto_index(::tk::dialog::file::EntFocusOut) [list source [file join $dir tkfbox.tcl]] -set auto_index(::tk::dialog::file::ActivateEnt) [list source [file join $dir tkfbox.tcl]] -set auto_index(::tk::dialog::file::VerifyFileName) [list source [file join $dir tkfbox.tcl]] -set auto_index(::tk::dialog::file::InvokeBtn) [list source [file join $dir tkfbox.tcl]] -set auto_index(::tk::dialog::file::UpDirCmd) [list source [file join $dir tkfbox.tcl]] -set auto_index(::tk::dialog::file::JoinFile) [list source [file join $dir tkfbox.tcl]] -set auto_index(::tk::dialog::file::OkCmd) [list source [file join $dir tkfbox.tcl]] -set auto_index(::tk::dialog::file::CancelCmd) [list source [file join $dir tkfbox.tcl]] -set auto_index(::tk::dialog::file::ListBrowse) [list source [file join $dir tkfbox.tcl]] -set auto_index(::tk::dialog::file::ListInvoke) [list source [file join $dir tkfbox.tcl]] -set auto_index(::tk::dialog::file::Done) [list source [file join $dir tkfbox.tcl]] -set auto_index(::tk::MotifFDialog) [list source [file join $dir xmfbox.tcl]] -set auto_index(::tk::MotifFDialog_Create) [list source [file join $dir xmfbox.tcl]] -set auto_index(::tk::MotifFDialog_FileTypes) [list source [file join $dir xmfbox.tcl]] -set auto_index(::tk::MotifFDialog_SetFilter) [list source [file join $dir xmfbox.tcl]] -set auto_index(::tk::MotifFDialog_Config) [list source [file join $dir xmfbox.tcl]] -set auto_index(::tk::MotifFDialog_BuildUI) [list source [file join $dir xmfbox.tcl]] -set auto_index(::tk::MotifFDialog_SetListMode) [list source [file join $dir xmfbox.tcl]] -set auto_index(::tk::MotifFDialog_MakeSList) [list source [file join $dir xmfbox.tcl]] -set auto_index(::tk::MotifFDialog_InterpFilter) [list source [file join $dir xmfbox.tcl]] -set auto_index(::tk::MotifFDialog_Update) [list source [file join $dir xmfbox.tcl]] -set auto_index(::tk::MotifFDialog_LoadFiles) [list source [file join $dir xmfbox.tcl]] -set auto_index(::tk::MotifFDialog_BrowseDList) [list source [file join $dir xmfbox.tcl]] -set auto_index(::tk::MotifFDialog_ActivateDList) [list source [file join $dir xmfbox.tcl]] -set auto_index(::tk::MotifFDialog_BrowseFList) [list source [file join $dir xmfbox.tcl]] -set auto_index(::tk::MotifFDialog_ActivateFList) [list source [file join $dir xmfbox.tcl]] -set auto_index(::tk::MotifFDialog_ActivateFEnt) [list source [file join $dir xmfbox.tcl]] -set auto_index(::tk::MotifFDialog_ActivateSEnt) [list source [file join $dir xmfbox.tcl]] -set auto_index(::tk::MotifFDialog_OkCmd) [list source [file join $dir xmfbox.tcl]] -set auto_index(::tk::MotifFDialog_FilterCmd) [list source [file join $dir xmfbox.tcl]] -set auto_index(::tk::MotifFDialog_CancelCmd) [list source [file join $dir xmfbox.tcl]] -set auto_index(::tk::ListBoxKeyAccel_Set) [list source [file join $dir xmfbox.tcl]] -set auto_index(::tk::ListBoxKeyAccel_Unset) [list source [file join $dir xmfbox.tcl]] -set auto_index(::tk::ListBoxKeyAccel_Key) [list source [file join $dir xmfbox.tcl]] -set auto_index(::tk::ListBoxKeyAccel_Goto) [list source [file join $dir xmfbox.tcl]] -set auto_index(::tk::ListBoxKeyAccel_Reset) [list source [file join $dir xmfbox.tcl]] -set auto_index(::tk::fontchooser) [list source [file join $dir fontchooser.tcl]] +set auto_index(::tk::dialog::error::Return) [list source -encoding utf-8 [file join $dir bgerror.tcl]] +set auto_index(::tk::dialog::error::Details) [list source -encoding utf-8 [file join $dir bgerror.tcl]] +set auto_index(::tk::dialog::error::SaveToLog) [list source -encoding utf-8 [file join $dir bgerror.tcl]] +set auto_index(::tk::dialog::error::Destroy) [list source -encoding utf-8 [file join $dir bgerror.tcl]] +set auto_index(::tk::dialog::error::bgerror) [list source -encoding utf-8 [file join $dir bgerror.tcl]] +set auto_index(bgerror) [list source -encoding utf-8 [file join $dir bgerror.tcl]] +set auto_index(::tk::ButtonInvoke) [list source -encoding utf-8 [file join $dir button.tcl]] +set auto_index(::tk::ButtonAutoInvoke) [list source -encoding utf-8 [file join $dir button.tcl]] +set auto_index(::tk::CheckRadioInvoke) [list source -encoding utf-8 [file join $dir button.tcl]] +set auto_index(::tk::dialog::file::chooseDir::) [list source -encoding utf-8 [file join $dir choosedir.tcl]] +set auto_index(::tk::dialog::file::chooseDir::Config) [list source -encoding utf-8 [file join $dir choosedir.tcl]] +set auto_index(::tk::dialog::file::chooseDir::OkCmd) [list source -encoding utf-8 [file join $dir choosedir.tcl]] +set auto_index(::tk::dialog::file::chooseDir::DblClick) [list source -encoding utf-8 [file join $dir choosedir.tcl]] +set auto_index(::tk::dialog::file::chooseDir::ListBrowse) [list source -encoding utf-8 [file join $dir choosedir.tcl]] +set auto_index(::tk::dialog::file::chooseDir::Done) [list source -encoding utf-8 [file join $dir choosedir.tcl]] +set auto_index(::tk::dialog::color::) [list source -encoding utf-8 [file join $dir clrpick.tcl]] +set auto_index(::tk::dialog::color::InitValues) [list source -encoding utf-8 [file join $dir clrpick.tcl]] +set auto_index(::tk::dialog::color::Config) [list source -encoding utf-8 [file join $dir clrpick.tcl]] +set auto_index(::tk::dialog::color::BuildDialog) [list source -encoding utf-8 [file join $dir clrpick.tcl]] +set auto_index(::tk::dialog::color::SetRGBValue) [list source -encoding utf-8 [file join $dir clrpick.tcl]] +set auto_index(::tk::dialog::color::XToRgb) [list source -encoding utf-8 [file join $dir clrpick.tcl]] +set auto_index(::tk::dialog::color::RgbToX) [list source -encoding utf-8 [file join $dir clrpick.tcl]] +set auto_index(::tk::dialog::color::DrawColorScale) [list source -encoding utf-8 [file join $dir clrpick.tcl]] +set auto_index(::tk::dialog::color::CreateSelector) [list source -encoding utf-8 [file join $dir clrpick.tcl]] +set auto_index(::tk::dialog::color::RedrawFinalColor) [list source -encoding utf-8 [file join $dir clrpick.tcl]] +set auto_index(::tk::dialog::color::RedrawColorBars) [list source -encoding utf-8 [file join $dir clrpick.tcl]] +set auto_index(::tk::dialog::color::StartMove) [list source -encoding utf-8 [file join $dir clrpick.tcl]] +set auto_index(::tk::dialog::color::MoveSelector) [list source -encoding utf-8 [file join $dir clrpick.tcl]] +set auto_index(::tk::dialog::color::ReleaseMouse) [list source -encoding utf-8 [file join $dir clrpick.tcl]] +set auto_index(::tk::dialog::color::ResizeColorBars) [list source -encoding utf-8 [file join $dir clrpick.tcl]] +set auto_index(::tk::dialog::color::HandleSelEntry) [list source -encoding utf-8 [file join $dir clrpick.tcl]] +set auto_index(::tk::dialog::color::HandleRGBEntry) [list source -encoding utf-8 [file join $dir clrpick.tcl]] +set auto_index(::tk::dialog::color::EnterColorBar) [list source -encoding utf-8 [file join $dir clrpick.tcl]] +set auto_index(::tk::dialog::color::LeaveColorBar) [list source -encoding utf-8 [file join $dir clrpick.tcl]] +set auto_index(::tk::dialog::color::OkCmd) [list source -encoding utf-8 [file join $dir clrpick.tcl]] +set auto_index(::tk::dialog::color::CancelCmd) [list source -encoding utf-8 [file join $dir clrpick.tcl]] +set auto_index(tclParseConfigSpec) [list source -encoding utf-8 [file join $dir comdlg.tcl]] +set auto_index(tclListValidFlags) [list source -encoding utf-8 [file join $dir comdlg.tcl]] +set auto_index(::tk::FocusGroup_Create) [list source -encoding utf-8 [file join $dir comdlg.tcl]] +set auto_index(::tk::FocusGroup_BindIn) [list source -encoding utf-8 [file join $dir comdlg.tcl]] +set auto_index(::tk::FocusGroup_BindOut) [list source -encoding utf-8 [file join $dir comdlg.tcl]] +set auto_index(::tk::FocusGroup_Destroy) [list source -encoding utf-8 [file join $dir comdlg.tcl]] +set auto_index(::tk::FocusGroup_In) [list source -encoding utf-8 [file join $dir comdlg.tcl]] +set auto_index(::tk::FocusGroup_Out) [list source -encoding utf-8 [file join $dir comdlg.tcl]] +set auto_index(::tk::FDGetFileTypes) [list source -encoding utf-8 [file join $dir comdlg.tcl]] +set auto_index(::tk::ConsoleInit) [list source -encoding utf-8 [file join $dir console.tcl]] +set auto_index(::tk::ConsoleSource) [list source -encoding utf-8 [file join $dir console.tcl]] +set auto_index(::tk::ConsoleInvoke) [list source -encoding utf-8 [file join $dir console.tcl]] +set auto_index(::tk::ConsoleHistory) [list source -encoding utf-8 [file join $dir console.tcl]] +set auto_index(::tk::ConsolePrompt) [list source -encoding utf-8 [file join $dir console.tcl]] +set auto_index(::tk::ConsoleBind) [list source -encoding utf-8 [file join $dir console.tcl]] +set auto_index(::tk::ConsoleInsert) [list source -encoding utf-8 [file join $dir console.tcl]] +set auto_index(::tk::ConsoleOutput) [list source -encoding utf-8 [file join $dir console.tcl]] +set auto_index(::tk::ConsoleExit) [list source -encoding utf-8 [file join $dir console.tcl]] +set auto_index(::tk::ConsoleAbout) [list source -encoding utf-8 [file join $dir console.tcl]] +set auto_index(tk_dialog) [list source -encoding utf-8 [file join $dir dialog.tcl]] +set auto_index(::tk::EntryClosestGap) [list source -encoding utf-8 [file join $dir entry.tcl]] +set auto_index(::tk::EntryButton1) [list source -encoding utf-8 [file join $dir entry.tcl]] +set auto_index(::tk::EntryMouseSelect) [list source -encoding utf-8 [file join $dir entry.tcl]] +set auto_index(::tk::EntryPaste) [list source -encoding utf-8 [file join $dir entry.tcl]] +set auto_index(::tk::EntryAutoScan) [list source -encoding utf-8 [file join $dir entry.tcl]] +set auto_index(::tk::EntryKeySelect) [list source -encoding utf-8 [file join $dir entry.tcl]] +set auto_index(::tk::EntryInsert) [list source -encoding utf-8 [file join $dir entry.tcl]] +set auto_index(::tk::EntryBackspace) [list source -encoding utf-8 [file join $dir entry.tcl]] +set auto_index(::tk::EntrySeeInsert) [list source -encoding utf-8 [file join $dir entry.tcl]] +set auto_index(::tk::EntrySetCursor) [list source -encoding utf-8 [file join $dir entry.tcl]] +set auto_index(::tk::EntryTranspose) [list source -encoding utf-8 [file join $dir entry.tcl]] +set auto_index(::tk::EntryPreviousWord) [list source -encoding utf-8 [file join $dir entry.tcl]] +set auto_index(::tk::EntryGetSelection) [list source -encoding utf-8 [file join $dir entry.tcl]] +set auto_index(tk_focusNext) [list source -encoding utf-8 [file join $dir focus.tcl]] +set auto_index(tk_focusPrev) [list source -encoding utf-8 [file join $dir focus.tcl]] +set auto_index(::tk::FocusOK) [list source -encoding utf-8 [file join $dir focus.tcl]] +set auto_index(tk_focusFollowsMouse) [list source -encoding utf-8 [file join $dir focus.tcl]] +set auto_index(::tk::IconList) [list source -encoding utf-8 [file join $dir iconlist.tcl]] +set auto_index(::tk::ListboxBeginSelect) [list source -encoding utf-8 [file join $dir listbox.tcl]] +set auto_index(::tk::ListboxMotion) [list source -encoding utf-8 [file join $dir listbox.tcl]] +set auto_index(::tk::ListboxBeginExtend) [list source -encoding utf-8 [file join $dir listbox.tcl]] +set auto_index(::tk::ListboxBeginToggle) [list source -encoding utf-8 [file join $dir listbox.tcl]] +set auto_index(::tk::ListboxAutoScan) [list source -encoding utf-8 [file join $dir listbox.tcl]] +set auto_index(::tk::ListboxUpDown) [list source -encoding utf-8 [file join $dir listbox.tcl]] +set auto_index(::tk::ListboxExtendUpDown) [list source -encoding utf-8 [file join $dir listbox.tcl]] +set auto_index(::tk::ListboxDataExtend) [list source -encoding utf-8 [file join $dir listbox.tcl]] +set auto_index(::tk::ListboxCancel) [list source -encoding utf-8 [file join $dir listbox.tcl]] +set auto_index(::tk::ListboxSelectAll) [list source -encoding utf-8 [file join $dir listbox.tcl]] +set auto_index(::tk::Megawidget) [list source -encoding utf-8 [file join $dir megawidget.tcl]] +set auto_index(::tk::MbEnter) [list source -encoding utf-8 [file join $dir menu.tcl]] +set auto_index(::tk::MbLeave) [list source -encoding utf-8 [file join $dir menu.tcl]] +set auto_index(::tk::MbPost) [list source -encoding utf-8 [file join $dir menu.tcl]] +set auto_index(::tk::MenuUnpost) [list source -encoding utf-8 [file join $dir menu.tcl]] +set auto_index(::tk::MbMotion) [list source -encoding utf-8 [file join $dir menu.tcl]] +set auto_index(::tk::MbButtonUp) [list source -encoding utf-8 [file join $dir menu.tcl]] +set auto_index(::tk::MenuMotion) [list source -encoding utf-8 [file join $dir menu.tcl]] +set auto_index(::tk::MenuButtonDown) [list source -encoding utf-8 [file join $dir menu.tcl]] +set auto_index(::tk::MenuLeave) [list source -encoding utf-8 [file join $dir menu.tcl]] +set auto_index(::tk::MenuInvoke) [list source -encoding utf-8 [file join $dir menu.tcl]] +set auto_index(::tk::MenuEscape) [list source -encoding utf-8 [file join $dir menu.tcl]] +set auto_index(::tk::MenuUpArrow) [list source -encoding utf-8 [file join $dir menu.tcl]] +set auto_index(::tk::MenuDownArrow) [list source -encoding utf-8 [file join $dir menu.tcl]] +set auto_index(::tk::MenuLeftArrow) [list source -encoding utf-8 [file join $dir menu.tcl]] +set auto_index(::tk::MenuRightArrow) [list source -encoding utf-8 [file join $dir menu.tcl]] +set auto_index(::tk::MenuNextMenu) [list source -encoding utf-8 [file join $dir menu.tcl]] +set auto_index(::tk::MenuNextEntry) [list source -encoding utf-8 [file join $dir menu.tcl]] +set auto_index(::tk::MenuFind) [list source -encoding utf-8 [file join $dir menu.tcl]] +set auto_index(::tk::TraverseToMenu) [list source -encoding utf-8 [file join $dir menu.tcl]] +set auto_index(::tk::FirstMenu) [list source -encoding utf-8 [file join $dir menu.tcl]] +set auto_index(::tk::TraverseWithinMenu) [list source -encoding utf-8 [file join $dir menu.tcl]] +set auto_index(::tk::MenuFirstEntry) [list source -encoding utf-8 [file join $dir menu.tcl]] +set auto_index(::tk::MenuFindName) [list source -encoding utf-8 [file join $dir menu.tcl]] +set auto_index(::tk::PostOverPoint) [list source -encoding utf-8 [file join $dir menu.tcl]] +set auto_index(::tk::SaveGrabInfo) [list source -encoding utf-8 [file join $dir menu.tcl]] +set auto_index(::tk::RestoreOldGrab) [list source -encoding utf-8 [file join $dir menu.tcl]] +set auto_index(tk_menuSetFocus) [list source -encoding utf-8 [file join $dir menu.tcl]] +set auto_index(::tk::GenerateMenuSelect) [list source -encoding utf-8 [file join $dir menu.tcl]] +set auto_index(tk_popup) [list source -encoding utf-8 [file join $dir menu.tcl]] +set auto_index(::tk::ensure_psenc_is_loaded) [list source -encoding utf-8 [file join $dir mkpsenc.tcl]] +set auto_index(::tk::MessageBox) [list source -encoding utf-8 [file join $dir msgbox.tcl]] +set auto_index(tk_menuBar) [list source -encoding utf-8 [file join $dir obsolete.tcl]] +set auto_index(tk_bindForTraversal) [list source -encoding utf-8 [file join $dir obsolete.tcl]] +set auto_index(::tk::classic::restore) [list source -encoding utf-8 [file join $dir obsolete.tcl]] +set auto_index(tk_optionMenu) [list source -encoding utf-8 [file join $dir optMenu.tcl]] +set auto_index(tk_setPalette) [list source -encoding utf-8 [file join $dir palette.tcl]] +set auto_index(::tk::RecolorTree) [list source -encoding utf-8 [file join $dir palette.tcl]] +set auto_index(::tk::Darken) [list source -encoding utf-8 [file join $dir palette.tcl]] +set auto_index(tk_bisque) [list source -encoding utf-8 [file join $dir palette.tcl]] +set auto_index(::safe::tkInterpInit) [list source -encoding utf-8 [file join $dir safetk.tcl]] +set auto_index(::safe::loadTk) [list source -encoding utf-8 [file join $dir safetk.tcl]] +set auto_index(::safe::TkInit) [list source -encoding utf-8 [file join $dir safetk.tcl]] +set auto_index(::safe::allowTk) [list source -encoding utf-8 [file join $dir safetk.tcl]] +set auto_index(::safe::disallowTk) [list source -encoding utf-8 [file join $dir safetk.tcl]] +set auto_index(::safe::tkDelete) [list source -encoding utf-8 [file join $dir safetk.tcl]] +set auto_index(::safe::tkTopLevel) [list source -encoding utf-8 [file join $dir safetk.tcl]] +set auto_index(::tk::ScaleActivate) [list source -encoding utf-8 [file join $dir scale.tcl]] +set auto_index(::tk::ScaleButtonDown) [list source -encoding utf-8 [file join $dir scale.tcl]] +set auto_index(::tk::ScaleDrag) [list source -encoding utf-8 [file join $dir scale.tcl]] +set auto_index(::tk::ScaleEndDrag) [list source -encoding utf-8 [file join $dir scale.tcl]] +set auto_index(::tk::ScaleIncrement) [list source -encoding utf-8 [file join $dir scale.tcl]] +set auto_index(::tk::ScaleControlPress) [list source -encoding utf-8 [file join $dir scale.tcl]] +set auto_index(::tk::ScaleButton2Down) [list source -encoding utf-8 [file join $dir scale.tcl]] +set auto_index(::tk::ScalingPct) [list source -encoding utf-8 [file join $dir scaling.tcl]] +set auto_index(::tk::ScaleNum) [list source -encoding utf-8 [file join $dir scaling.tcl]] +set auto_index(::tk::FontScalingFactor) [list source -encoding utf-8 [file join $dir scaling.tcl]] +set auto_index(::tk::ScanMonitorsFile) [list source -encoding utf-8 [file join $dir scaling.tcl]] +set auto_index(::tk::ScrollButtonDown) [list source -encoding utf-8 [file join $dir scrlbar.tcl]] +set auto_index(::tk::ScrollButtonUp) [list source -encoding utf-8 [file join $dir scrlbar.tcl]] +set auto_index(::tk::ScrollSelect) [list source -encoding utf-8 [file join $dir scrlbar.tcl]] +set auto_index(::tk::ScrollStartDrag) [list source -encoding utf-8 [file join $dir scrlbar.tcl]] +set auto_index(::tk::ScrollDrag) [list source -encoding utf-8 [file join $dir scrlbar.tcl]] +set auto_index(::tk::ScrollEndDrag) [list source -encoding utf-8 [file join $dir scrlbar.tcl]] +set auto_index(::tk::ScrollByUnits) [list source -encoding utf-8 [file join $dir scrlbar.tcl]] +set auto_index(::tk::ScrollByPages) [list source -encoding utf-8 [file join $dir scrlbar.tcl]] +set auto_index(::tk::ScrollToPos) [list source -encoding utf-8 [file join $dir scrlbar.tcl]] +set auto_index(::tk::ScrollTopBottom) [list source -encoding utf-8 [file join $dir scrlbar.tcl]] +set auto_index(::tk::ScrollButton2Down) [list source -encoding utf-8 [file join $dir scrlbar.tcl]] +set auto_index(::tk::spinbox::Invoke) [list source -encoding utf-8 [file join $dir spinbox.tcl]] +set auto_index(::tk::spinbox::ClosestGap) [list source -encoding utf-8 [file join $dir spinbox.tcl]] +set auto_index(::tk::spinbox::ButtonDown) [list source -encoding utf-8 [file join $dir spinbox.tcl]] +set auto_index(::tk::spinbox::ButtonUp) [list source -encoding utf-8 [file join $dir spinbox.tcl]] +set auto_index(::tk::spinbox::MouseSelect) [list source -encoding utf-8 [file join $dir spinbox.tcl]] +set auto_index(::tk::spinbox::Paste) [list source -encoding utf-8 [file join $dir spinbox.tcl]] +set auto_index(::tk::spinbox::Motion) [list source -encoding utf-8 [file join $dir spinbox.tcl]] +set auto_index(::tk::spinbox::AutoScan) [list source -encoding utf-8 [file join $dir spinbox.tcl]] +set auto_index(::tk::spinbox::KeySelect) [list source -encoding utf-8 [file join $dir spinbox.tcl]] +set auto_index(::tk::spinbox::Insert) [list source -encoding utf-8 [file join $dir spinbox.tcl]] +set auto_index(::tk::spinbox::Backspace) [list source -encoding utf-8 [file join $dir spinbox.tcl]] +set auto_index(::tk::spinbox::SeeInsert) [list source -encoding utf-8 [file join $dir spinbox.tcl]] +set auto_index(::tk::spinbox::SetCursor) [list source -encoding utf-8 [file join $dir spinbox.tcl]] +set auto_index(::tk::spinbox::Transpose) [list source -encoding utf-8 [file join $dir spinbox.tcl]] +set auto_index(::tk::spinbox::PreviousWord) [list source -encoding utf-8 [file join $dir spinbox.tcl]] +set auto_index(::tk::spinbox::GetSelection) [list source -encoding utf-8 [file join $dir spinbox.tcl]] +set auto_index(::tk::TearOffMenu) [list source -encoding utf-8 [file join $dir tearoff.tcl]] +set auto_index(::tk::MenuDup) [list source -encoding utf-8 [file join $dir tearoff.tcl]] +set auto_index(::tk::TextClosestGap) [list source -encoding utf-8 [file join $dir text.tcl]] +set auto_index(::tk::TextButton1) [list source -encoding utf-8 [file join $dir text.tcl]] +set auto_index(::tk::TextSelectTo) [list source -encoding utf-8 [file join $dir text.tcl]] +set auto_index(::tk::TextKeyExtend) [list source -encoding utf-8 [file join $dir text.tcl]] +set auto_index(::tk::TextPaste) [list source -encoding utf-8 [file join $dir text.tcl]] +set auto_index(::tk::TextAutoScan) [list source -encoding utf-8 [file join $dir text.tcl]] +set auto_index(::tk::TextSetCursor) [list source -encoding utf-8 [file join $dir text.tcl]] +set auto_index(::tk::TextKeySelect) [list source -encoding utf-8 [file join $dir text.tcl]] +set auto_index(::tk::TextResetAnchor) [list source -encoding utf-8 [file join $dir text.tcl]] +set auto_index(::tk::TextInsert) [list source -encoding utf-8 [file join $dir text.tcl]] +set auto_index(::tk::TextUpDownLine) [list source -encoding utf-8 [file join $dir text.tcl]] +set auto_index(::tk::TextPrevPara) [list source -encoding utf-8 [file join $dir text.tcl]] +set auto_index(::tk::TextNextPara) [list source -encoding utf-8 [file join $dir text.tcl]] +set auto_index(::tk::TextScrollPages) [list source -encoding utf-8 [file join $dir text.tcl]] +set auto_index(::tk::TextTranspose) [list source -encoding utf-8 [file join $dir text.tcl]] +set auto_index(tk_textCopy) [list source -encoding utf-8 [file join $dir text.tcl]] +set auto_index(tk_textCut) [list source -encoding utf-8 [file join $dir text.tcl]] +set auto_index(tk_textPaste) [list source -encoding utf-8 [file join $dir text.tcl]] +set auto_index(::tk::TextNextPos) [list source -encoding utf-8 [file join $dir text.tcl]] +set auto_index(::tk::TextPrevPos) [list source -encoding utf-8 [file join $dir text.tcl]] +set auto_index(::tk::PlaceWindow) [list source -encoding utf-8 [file join $dir tk.tcl]] +set auto_index(::tk::SetFocusGrab) [list source -encoding utf-8 [file join $dir tk.tcl]] +set auto_index(::tk::RestoreFocusGrab) [list source -encoding utf-8 [file join $dir tk.tcl]] +set auto_index(::tk::ScreenChanged) [list source -encoding utf-8 [file join $dir tk.tcl]] +set auto_index(::tk::EventMotifBindings) [list source -encoding utf-8 [file join $dir tk.tcl]] +set auto_index(::tk::CancelRepeat) [list source -encoding utf-8 [file join $dir tk.tcl]] +set auto_index(::tk::MouseWheel) [list source -encoding utf-8 [file join $dir tk.tcl]] +set auto_index(::tk::TabToWindow) [list source -encoding utf-8 [file join $dir tk.tcl]] +set auto_index(::tk::dialog::file::) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] +set auto_index(::tk::dialog::file::Config) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] +set auto_index(::tk::dialog::file::Create) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] +set auto_index(::tk::dialog::file::SetSelectMode) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] +set auto_index(::tk::dialog::file::UpdateWhenIdle) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] +set auto_index(::tk::dialog::file::Update) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] +set auto_index(::tk::dialog::file::SetPathSilently) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] +set auto_index(::tk::dialog::file::SetPath) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] +set auto_index(::tk::dialog::file::SetFilter) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] +set auto_index(::tk::dialog::file::ResolveFile) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] +set auto_index(::tk::dialog::file::EntFocusIn) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] +set auto_index(::tk::dialog::file::EntFocusOut) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] +set auto_index(::tk::dialog::file::ActivateEnt) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] +set auto_index(::tk::dialog::file::VerifyFileName) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] +set auto_index(::tk::dialog::file::InvokeBtn) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] +set auto_index(::tk::dialog::file::UpDirCmd) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] +set auto_index(::tk::dialog::file::JoinFile) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] +set auto_index(::tk::dialog::file::OkCmd) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] +set auto_index(::tk::dialog::file::CancelCmd) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] +set auto_index(::tk::dialog::file::ListBrowse) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] +set auto_index(::tk::dialog::file::ListInvoke) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] +set auto_index(::tk::dialog::file::Done) [list source -encoding utf-8 [file join $dir tkfbox.tcl]] +set auto_index(::tk::MotifFDialog) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] +set auto_index(::tk::MotifFDialog_Create) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] +set auto_index(::tk::MotifFDialog_FileTypes) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] +set auto_index(::tk::MotifFDialog_SetFilter) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] +set auto_index(::tk::MotifFDialog_Config) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] +set auto_index(::tk::MotifFDialog_BuildUI) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] +set auto_index(::tk::MotifFDialog_SetListMode) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] +set auto_index(::tk::MotifFDialog_MakeSList) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] +set auto_index(::tk::MotifFDialog_InterpFilter) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] +set auto_index(::tk::MotifFDialog_Update) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] +set auto_index(::tk::MotifFDialog_LoadFiles) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] +set auto_index(::tk::MotifFDialog_BrowseDList) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] +set auto_index(::tk::MotifFDialog_ActivateDList) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] +set auto_index(::tk::MotifFDialog_BrowseFList) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] +set auto_index(::tk::MotifFDialog_ActivateFList) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] +set auto_index(::tk::MotifFDialog_ActivateFEnt) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] +set auto_index(::tk::MotifFDialog_ActivateSEnt) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] +set auto_index(::tk::MotifFDialog_OkCmd) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] +set auto_index(::tk::MotifFDialog_FilterCmd) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] +set auto_index(::tk::MotifFDialog_CancelCmd) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] +set auto_index(::tk::ListBoxKeyAccel_Set) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] +set auto_index(::tk::ListBoxKeyAccel_Unset) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] +set auto_index(::tk::ListBoxKeyAccel_Key) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] +set auto_index(::tk::ListBoxKeyAccel_Goto) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] +set auto_index(::tk::ListBoxKeyAccel_Reset) [list source -encoding utf-8 [file join $dir xmfbox.tcl]] +set auto_index(::tk::unsupported::ExposePrivateCommand) [list source -encoding utf-8 [file join $dir unsupported.tcl]] +set auto_index(::tk::unsupported::ExposePrivateVariable) [list source -encoding utf-8 [file join $dir unsupported.tcl]] +set auto_index(::tk::fontchooser) [list source -encoding utf-8 [file join $dir fontchooser.tcl]] Index: library/tearoff.tcl ================================================================== --- library/tearoff.tcl +++ library/tearoff.tcl @@ -136,16 +136,18 @@ eval $cmd # Copy the meny entries, if any set last [$src index last] - for {set i [$src cget -tearoff]} {$i <= $last} {incr i} { - set cmd [list $dst add [$src type $i] [$src id $i]] - foreach option [$src entryconfigure $i] { - lappend cmd [lindex $option 0] [lindex $option 4] + if {$last ne "none"} { + for {set i [$src cget -tearoff]} {$i <= $last} {incr i} { + set cmd [list $dst add [$src type $i] [$src id $i]] + foreach option [$src entryconfigure $i] { + lappend cmd [lindex $option 0] [lindex $option 4] + } + eval $cmd } - eval $cmd } # Duplicate the binding tags from the source menu, replacing src with dst set tags [bindtags $src] Index: library/tk.tcl ================================================================== --- library/tk.tcl +++ library/tk.tcl @@ -9,11 +9,11 @@ # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. # Verify that we have Tk binary and script components from the same release -package require -exact tk 9.0.1 +package require -exact tk 8.7b1 # Create a ::tk namespace namespace eval ::tk { # Set up the msgcat commands namespace eval msgcat { @@ -496,11 +496,11 @@ # Read in files that define all of the class bindings. # ---------------------------------------------------------------------- if {$::tk_library ne ""} { proc ::tk::SourceLibFile {file} { - namespace eval :: [list source [file join $::tk_library $file.tcl]] + namespace eval :: [list source -encoding utf-8 [file join $::tk_library $file.tcl]] } namespace eval ::tk { SourceLibFile icons SourceLibFile iconbadges SourceLibFile button @@ -711,11 +711,11 @@ if {[tk windowingsystem] eq "aqua"} { #stub procedures to respond to "do script" Apple Events proc ::tk::mac::DoScriptFile {file} { uplevel #0 $file - source $file + source -encoding utf-8 $file } proc ::tk::mac::DoScriptText {script} { uplevel #0 $script eval $script } @@ -839,13 +839,13 @@ option add *Scrollbar.width 8.25p widgetDefault } # Run the Ttk themed widget set initialization if {$::ttk::library ne ""} { - uplevel \#0 [list source $::ttk::library/ttk.tcl] + uplevel \#0 [list source -encoding utf-8 $::ttk::library/ttk.tcl] } # Local Variables: # mode: tcl # fill-column: 78 # End: Index: library/ttk/clamTheme.tcl ================================================================== --- library/ttk/clamTheme.tcl +++ library/ttk/clamTheme.tcl @@ -149,20 +149,20 @@ ttk::style configure TLabelframe \ -labeloutside true -labelmargins {0 0 0 3p} \ -borderwidth 2 -relief raised - ttk::style configure TScrollbar -gripsize 7.5p \ + ttk::style configure TScrollbar -gripcount 3.75p \ -arrowsize 10.5p -width 10.5p - ttk::style configure TScale -gripsize 7.5p \ + ttk::style configure TScale -gripcount 3.75p \ -arrowsize 10.5p -sliderlength 22.5p ttk::style configure TProgressbar -background $colors(-frame) \ -arrowsize 10.5p -sliderlength 22.5p - ttk::style configure Sash -sashthickness 4.5p -gripsize 15p + ttk::style configure Sash -sashthickness 4.5p -gripcount 7.5p } } # ttk::theme::clam::configureNotebookStyle -- # ADDED library/unsupported.tcl Index: library/unsupported.tcl ================================================================== --- /dev/null +++ library/unsupported.tcl @@ -0,0 +1,269 @@ +# unsupported.tcl -- +# +# Commands provided by Tk without official support. Use them at your +# own risk. They may change or go away without notice. +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. + +# ---------------------------------------------------------------------- +# Unsupported compatibility interface for folks accessing Tk's private +# commands and variable against recommended usage. +# ---------------------------------------------------------------------- + +namespace eval ::tk::unsupported { + + # Map from the old global names of Tk private commands to their + # new namespace-encapsulated names. + + variable PrivateCommands + array set PrivateCommands { + tkButtonAutoInvoke ::tk::ButtonAutoInvoke + tkButtonDown ::tk::ButtonDown + tkButtonEnter ::tk::ButtonEnter + tkButtonInvoke ::tk::ButtonInvoke + tkButtonLeave ::tk::ButtonLeave + tkButtonUp ::tk::ButtonUp + tkCancelRepeat ::tk::CancelRepeat + tkCheckRadioDown ::tk::CheckRadioDown + tkCheckRadioEnter ::tk::CheckRadioEnter + tkCheckRadioInvoke ::tk::CheckRadioInvoke + tkColorDialog ::tk::dialog::color:: + tkColorDialog_BuildDialog ::tk::dialog::color::BuildDialog + tkColorDialog_CancelCmd ::tk::dialog::color::CancelCmd + tkColorDialog_Config ::tk::dialog::color::Config + tkColorDialog_CreateSelector ::tk::dialog::color::CreateSelector + tkColorDialog_DrawColorScale ::tk::dialog::color::DrawColorScale + tkColorDialog_EnterColorBar ::tk::dialog::color::EnterColorBar + tkColorDialog_InitValues ::tk::dialog::color::InitValues + tkColorDialog_HandleRGBEntry ::tk::dialog::color::HandleRGBEntry + tkColorDialog_HandleSelEntry ::tk::dialog::color::HandleSelEntry + tkColorDialog_LeaveColorBar ::tk::dialog::color::LeaveColorBar + tkColorDialog_MoveSelector ::tk::dialog::color::MoveSelector + tkColorDialog_OkCmd ::tk::dialog::color::OkCmd + tkColorDialog_RedrawColorBars ::tk::dialog::color::RedrawColorBars + tkColorDialog_RedrawFinalColor ::tk::dialog::color::RedrawFinalColor + tkColorDialog_ReleaseMouse ::tk::dialog::color::ReleaseMouse + tkColorDialog_ResizeColorBars ::tk::dialog::color::ResizeColorBars + tkColorDialog_RgbToX ::tk::dialog::color::RgbToX + tkColorDialog_SetRGBValue ::tk::dialog::color::SetRGBValue + tkColorDialog_StartMove ::tk::dialog::color::StartMove + tkColorDialog_XToRgb ::tk::dialog::color::XToRGB + tkConsoleAbout ::tk::ConsoleAbout + tkConsoleBind ::tk::ConsoleBind + tkConsoleExit ::tk::ConsoleExit + tkConsoleHistory ::tk::ConsoleHistory + tkConsoleInit ::tk::ConsoleInit + tkConsoleInsert ::tk::ConsoleInsert + tkConsoleInvoke ::tk::ConsoleInvoke + tkConsoleOutput ::tk::ConsoleOutput + tkConsolePrompt ::tk::ConsolePrompt + tkConsoleSource ::tk::ConsoleSource + tkDarken ::tk::Darken + tkEntryAutoScan ::tk::EntryAutoScan + tkEntryBackspace ::tk::EntryBackspace + tkEntryButton1 ::tk::EntryButton1 + tkEntryClosestGap ::tk::EntryClosestGap + tkEntryGetSelection ::tk::EntryGetSelection + tkEntryInsert ::tk::EntryInsert + tkEntryKeySelect ::tk::EntryKeySelect + tkEntryMouseSelect ::tk::EntryMouseSelect + tkEntryNextWord ::tk::EntryNextWord + tkEntryPaste ::tk::EntryPaste + tkEntryPreviousWord ::tk::EntryPreviousWord + tkEntrySeeInsert ::tk::EntrySeeInsert + tkEntrySetCursor ::tk::EntrySetCursor + tkEntryTranspose ::tk::EntryTranspose + tkEventMotifBindings ::tk::EventMotifBindings + tkFDGetFileTypes ::tk::FDGetFileTypes + tkFirstMenu ::tk::FirstMenu + tkFocusGroup_BindIn ::tk::FocusGroup_BindIn + tkFocusGroup_BindOut ::tk::FocusGroup_BindOut + tkFocusGroup_Create ::tk::FocusGroup_Create + tkFocusGroup_Destroy ::tk::FocusGroup_Destroy + tkFocusGroup_In ::tk::FocusGroup_In + tkFocusGroup_Out ::tk::FocusGroup_Out + tkFocusOK ::tk::FocusOK + tkGenerateMenuSelect ::tk::GenerateMenuSelect + tkIconList ::tk::IconList + tkListbox ::tk::Listbox + tkListboxAutoScan ::tk::ListboxAutoScan + tkListboxBeginExtend ::tk::ListboxBeginExtend + tkListboxBeginSelect ::tk::ListboxBeginSelect + tkListboxBeginToggle ::tk::ListboxBeginToggle + tkListboxCancel ::tk::ListboxCancel + tkListboxDataExtend ::tk::ListboxDataExtend + tkListboxExtendUpDown ::tk::ListboxExtendUpDown + tkListboxKeyAccel_Goto ::tk::ListboxKeyAccel_Goto + tkListboxKeyAccel_Key ::tk::ListboxKeyAccel_Key + tkListboxKeyAccel_Reset ::tk::ListboxKeyAccel_Reset + tkListboxKeyAccel_Set ::tk::ListboxKeyAccel_Set + tkListboxKeyAccel_Unset ::tk::ListboxKeyAccel_Unxet + tkListboxMotion ::tk::ListboxMotion + tkListboxSelectAll ::tk::ListboxSelectAll + tkListboxUpDown ::tk::ListboxUpDown + tkListboxBeginToggle ::tk::ListboxBeginToggle + tkMbButtonUp ::tk::MbButtonUp + tkMbEnter ::tk::MbEnter + tkMbLeave ::tk::MbLeave + tkMbMotion ::tk::MbMotion + tkMbPost ::tk::MbPost + tkMenuButtonDown ::tk::MenuButtonDown + tkMenuDownArrow ::tk::MenuDownArrow + tkMenuDup ::tk::MenuDup + tkMenuEscape ::tk::MenuEscape + tkMenuFind ::tk::MenuFind + tkMenuFindName ::tk::MenuFindName + tkMenuFirstEntry ::tk::MenuFirstEntry + tkMenuInvoke ::tk::MenuInvoke + tkMenuLeave ::tk::MenuLeave + tkMenuLeftArrow ::tk::MenuLeftArrow + tkMenuMotion ::tk::MenuMotion + tkMenuNextEntry ::tk::MenuNextEntry + tkMenuNextMenu ::tk::MenuNextMenu + tkMenuRightArrow ::tk::MenuRightArrow + tkMenuUnpost ::tk::MenuUnpost + tkMenuUpArrow ::tk::MenuUpArrow + tkMessageBox ::tk::MessageBox + tkMotifFDialog ::tk::MotifFDialog + tkMotifFDialog_ActivateDList ::tk::MotifFDialog_ActivateDList + tkMotifFDialog_ActivateFList ::tk::MotifFDialog_ActivateFList + tkMotifFDialog_ActivateFEnt ::tk::MotifFDialog_ActivateFEnt + tkMotifFDialog_ActivateSEnt ::tk::MotifFDialog_ActivateSEnt + tkMotifFDialog ::tk::MotifFDialog + tkMotifFDialog_BrowseDList ::tk::MotifFDialog_BrowseDList + tkMotifFDialog_BrowseFList ::tk::MotifFDialog_BrowseFList + tkMotifFDialog_BuildUI ::tk::MotifFDialog_BuildUI + tkMotifFDialog_CancelCmd ::tk::MotifFDialog_CancelCmd + tkMotifFDialog_Config ::tk::MotifFDialog_Config + tkMotifFDialog_Create ::tk::MotifFDialog_Create + tkMotifFDialog_FileTypes ::tk::MotifFDialog_FileTypes + tkMotifFDialog_FilterCmd ::tk::MotifFDialog_FilterCmd + tkMotifFDialog_InterpFilter ::tk::MotifFDialog_InterpFilter + tkMotifFDialog_LoadFiles ::tk::MotifFDialog_LoadFiles + tkMotifFDialog_MakeSList ::tk::MotifFDialog_MakeSList + tkMotifFDialog_OkCmd ::tk::MotifFDialog_OkCmd + tkMotifFDialog_SetFilter ::tk::MotifFDialog_SetFilter + tkMotifFDialog_SetListMode ::tk::MotifFDialog_SetListMode + tkMotifFDialog_Update ::tk::MotifFDialog_Update + tkPostOverPoint ::tk::PostOverPoint + tkRecolorTree ::tk::RecolorTree + tkRestoreOldGrab ::tk::RestoreOldGrab + tkSaveGrabInfo ::tk::SaveGrabInfo + tkScaleActivate ::tk::ScaleActivate + tkScaleButtonDown ::tk::ScaleButtonDown + tkScaleButton2Down ::tk::ScaleButton2Down + tkScaleControlPress ::tk::ScaleControlPress + tkScaleDrag ::tk::ScaleDrag + tkScaleEndDrag ::tk::ScaleEndDrag + tkScaleIncrement ::tk::ScaleIncrement + tkScreenChanged ::tk::ScreenChanged + tkScrollButtonDown ::tk::ScrollButtonDown + tkScrollButton2Down ::tk::ScrollButton2Down + tkScrollButtonDrag ::tk::ScrollButtonDrag + tkScrollButtonUp ::tk::ScrollButtonUp + tkScrollByPages ::tk::ScrollByPages + tkScrollByUnits ::tk::ScrollByUnits + tkScrollEndDrag ::tk::ScrollEndDrag + tkScrollSelect ::tk::ScrollSelect + tkScrollStartDrag ::tk::ScrollStartDrag + tkScrollTopBottom ::tk::ScrollTopBottom + tkScrollToPos ::tk::ScrollToPos + tkTabToWindow ::tk::TabToWindow + tkTearOffMenu ::tk::TearOffMenu + tkTextAutoScan ::tk::TextAutoScan + tkTextButton1 ::tk::TextButton1 + tkTextClosestGap ::tk::TextClosestGap + tkTextInsert ::tk::TextInsert + tkTextKeyExtend ::tk::TextKeyExtend + tkTextKeySelect ::tk::TextKeySelect + tkTextNextPara ::tk::TextNextPara + tkTextNextPos ::tk::TextNextPos + tkTextNextWord ::tk::TextNextWord + tkTextPaste ::tk::TextPaste + tkTextPrevPara ::tk::TextPrevPara + tkTextPrevPos ::tk::TextPrevPos + tkTextPrevWord ::tk::TextPrevWord + tkTextResetAnchor ::tk::TextResetAnchor + tkTextScrollPages ::tk::TextScrollPages + tkTextSelectTo ::tk::TextSelectTo + tkTextSetCursor ::tk::TextSetCursor + tkTextTranspose ::tk::TextTranspose + tkTextUpDownLine ::tk::TextUpDownLine + tkTraverseToMenu ::tk::TraverseToMenu + tkTraverseWithinMenu ::tk::TraverseWithinMenu + unsupported1 ::tk::unsupported::MacWindowStyle + } + + # Map from the old global names of Tk private variable to their + # new namespace-encapsulated names. + + variable PrivateVariables + array set PrivateVariables { + droped_to_start ::tk::mac::Droped_to_start + histNum ::tk::HistNum + stub_location ::tk::mac::Stub_location + tkFocusIn ::tk::FocusIn + tkFocusOut ::tk::FocusOut + tkPalette ::tk::Palette + tkPriv ::tk::Priv + tkPrivMsgBox ::tk::PrivMsgBox + } +} + +# ::tk::unsupported::ExposePrivateCommand -- +# +# Expose one of Tk's private commands to be visible under its +# old global name +# +# Arguments: +# cmd Global name by which the command was once known, +# or a glob-style pattern. +# +# Results: +# None. +# +# Side effects: +# The old command name in the global namespace is aliased to the +# new private name. + +proc ::tk::unsupported::ExposePrivateCommand {cmd} { + variable PrivateCommands + set cmds [array get PrivateCommands $cmd] + if {[llength $cmds] == 0} { + return -code error -errorcode {TK EXPOSE_PRIVATE_COMMAND} \ + "No compatibility support for \[$cmd]" + } + foreach {old new} $cmds { + namespace eval :: [list interp alias {} $old {}] $new + } +} + +# ::tk::unsupported::ExposePrivateVariable -- +# +# Expose one of Tk's private variables to be visible under its +# old global name +# +# Arguments: +# var Global name by which the variable was once known, +# or a glob-style pattern. +# +# Results: +# None. +# +# Side effects: +# The old variable name in the global namespace is aliased to the +# new private name. + +proc ::tk::unsupported::ExposePrivateVariable {var} { + variable PrivateVariables + set vars [array get PrivateVariables $var] + if {[llength $vars] == 0} { + return -code error -errorcode {TK EXPOSE_PRIVATE_VARIABLE} \ + "No compatibility support for \$$var" + } + namespace eval ::tk::mac {} + foreach {old new} $vars { + namespace eval :: [list upvar "#0" $new $old] + } +} Index: macosx/README ================================================================== --- macosx/README +++ macosx/README @@ -368,11 +368,11 @@ Note that the non-SDK configurations have their deployment target set to 10.6 (Tk.xcodeproj). The Xcode projects refer to the toplevel tcl and tk source directories via the the TCL_SRCROOT and TK_SRCROOT user build settings, by default these are set to the project-relative paths '../../tcl' and '../../tk', if your source -directories are named differently, e.g. '../../tcl9.0' and '../../tk9.0', you +directories are named differently, e.g. '../../tcl8.7' and '../../tk8.7', you need to manually change the TCL_SRCROOT and TK_SRCROOT settings by editing your ${USER}.pbxuser file (located inside the Tk.xcodeproj bundle directory) with a text editor. Detailed Instructions for building with macosx/GNUmakefile Index: macosx/tkMacOSXButton.c ================================================================== --- macosx/tkMacOSXButton.c +++ macosx/tkMacOSXButton.c @@ -185,19 +185,18 @@ TkButton *butPtr = (TkButton *)clientData; Tk_Window tkwin = butPtr->tkwin; Pixmap pixmap; DrawParams* dpPtr = &macButtonPtr->drawParams; int needhighlight = 0; - int highlightWidth; butPtr->flags &= ~REDRAW_PENDING; if ((butPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) { return; } pixmap = (Pixmap) Tk_WindowId(tkwin); - Tk_GetPixelsFromObj(NULL, tkwin, butPtr->highlightWidthObj, &highlightWidth); + Tk_GetPixelsFromObj(NULL, tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); if (TkMacOSXComputeButtonDrawParams(butPtr, dpPtr)) { macButtonPtr->useTkText = 0; } else { macButtonPtr->useTkText = 1; @@ -226,11 +225,11 @@ /* * Ask for the highlight border, if needed. */ - if (highlightWidth < 3) { + if (butPtr->highlightWidth < 3) { needhighlight = 1; } } /* @@ -243,11 +242,11 @@ gc = Tk_GCForColor(butPtr->highlightColorPtr, pixmap); } else if (butPtr->type == TYPE_LABEL) { gc = Tk_GCForColor(Tk_3DBorderColor(butPtr->highlightBorder), pixmap); } if (gc) { - TkMacOSXDrawSolidBorder(tkwin, gc, 0, highlightWidth); + TkMacOSXDrawSolidBorder(tkwin, gc, 0, butPtr->highlightWidth); } } } /* @@ -275,13 +274,10 @@ int width = 0, height = 0, charWidth = 1, haveImage = 0, haveText = 0; int txtWidth = 0, txtHeight = 0; MacButton *mbPtr = (MacButton *) butPtr; Tk_FontMetrics fm; char *text = Tcl_GetString(butPtr->textPtr); - int padX, padY, wrapLength; - int butPtrWidth, butPtrHeight; - int borderWidth, highlightWidth; TkMacOSXComputeButtonParams(butPtr, &mbPtr->btnkind, &mbPtr->drawinfo); /* * If the indicator is on, get its size. @@ -317,23 +313,21 @@ } else if (butPtr->bitmap != None) { Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height); haveImage = 1; } - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->widthObj, &butPtrWidth); - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->heightObj, &butPtrHeight); - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padXObj, &padX); - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padYObj, &padY); - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->wrapLengthObj, &wrapLength); + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padXPtr, &butPtr->padX); + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padYPtr, &butPtr->padY); + if (haveImage == 0 || butPtr->compound != COMPOUND_NONE) { Tk_FreeTextLayout(butPtr->textLayout); butPtr->textLayout = Tk_ComputeTextLayout(butPtr->tkfont, - text, TCL_INDEX_NONE, wrapLength, butPtr->justify, 0, + text, TCL_INDEX_NONE, butPtr->wrapLength, butPtr->justify, 0, &butPtr->textWidth, &butPtr->textHeight); - txtWidth = butPtr->textWidth + 2 * padX; - txtHeight = butPtr->textHeight + 2 * padY; + txtWidth = butPtr->textWidth + 2 * butPtr->padX; + txtHeight = butPtr->textHeight + 2 * butPtr->padY; haveText = 1; } if (haveImage) { if (haveText) { /* Image and Text */ @@ -342,20 +336,20 @@ case COMPOUND_BOTTOM: /* * Image is above or below text. */ - height += txtHeight + padY; + height += txtHeight + butPtr->padY; width = (width > txtWidth ? width : txtWidth); break; case COMPOUND_LEFT: case COMPOUND_RIGHT: /* * Image is left or right of text. */ - width += txtWidth + 2 * padX; + width += txtWidth + 2 * butPtr->padX; height = (height > txtHeight ? height : txtHeight); break; case COMPOUND_CENTER: /* * Image and text are superimposed. @@ -367,12 +361,12 @@ default: break; } } /* Image with or without text */ - width = butPtrWidth > 0 ? butPtrWidth : width + butPtr->indicatorSpace; - height = butPtrHeight > 0 ? butPtrHeight : height; + width = butPtr->width > 0 ? butPtr->width : width + butPtr->indicatorSpace; + height = butPtr->height > 0 ? butPtr->height : height; if (butPtr->type == TYPE_BUTTON) { /* * Allow room to shift the image. */ width += 2; @@ -379,28 +373,28 @@ height += 2; } } else { /* Text only */ width = txtWidth + butPtr->indicatorSpace; height = txtHeight; - if (butPtrWidth > 0) { + if (butPtr->width > 0) { charWidth = Tk_TextWidth(butPtr->tkfont, "0", 1); - width = butPtrWidth * charWidth + 2 * padX; + width = butPtr->width * charWidth + 2 * butPtr->padX; } - if (butPtrHeight > 0) { + if (butPtr->height > 0) { Tk_GetFontMetrics(butPtr->tkfont, &fm); - height = butPtrHeight * fm.linespace + 2 * padY; + height = butPtr->height * fm.linespace + 2 * butPtr->padY; } } /* * Now figure out the size of the border decorations for the button. */ - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->borderWidthObj, &borderWidth); - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->highlightWidthObj, &highlightWidth); + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->borderWidthPtr, &butPtr->borderWidth); + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); - butPtr->inset = borderWidth + highlightWidth; + butPtr->inset = butPtr->borderWidth + butPtr->highlightWidth; width += butPtr->inset * 2; height += butPtr->inset * 2; if ([NSApp macOSVersion] == 100600) { width += 12; @@ -458,11 +452,10 @@ int imageWidth = 0, imageHeight = 0; int imageXOffset = 0, imageYOffset = 0; int textXOffset = 0, textYOffset = 0; int width = 0, height = 0; int fullWidth = 0, fullHeight = 0; - int padX, padY, borderWidth, highlightWidth; DrawParams *dpPtr = &mbPtr->drawParams; if (tkwin == NULL || !Tk_IsMapped(tkwin)) { return; } @@ -482,14 +475,14 @@ if (mbPtr->drawinfo.state == kThemeStatePressed) { pressed = 1; } - Tk_GetPixelsFromObj(NULL, tkwin, butPtr->padXObj, &padX); - Tk_GetPixelsFromObj(NULL, tkwin, butPtr->padYObj, &padY); - Tk_GetPixelsFromObj(NULL, tkwin, butPtr->borderWidthObj, &borderWidth); - Tk_GetPixelsFromObj(NULL, tkwin, butPtr->highlightWidthObj, &highlightWidth); + Tk_GetPixelsFromObj(NULL, tkwin, butPtr->padXPtr, &butPtr->padX); + Tk_GetPixelsFromObj(NULL, tkwin, butPtr->padYPtr, &butPtr->padY); + Tk_GetPixelsFromObj(NULL, tkwin, butPtr->borderWidthPtr, &butPtr->borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); haveText = (butPtr->textWidth != 0 && butPtr->textHeight != 0); if (butPtr->compound != COMPOUND_NONE && haveImage && haveText) { /* Image and Text */ int x, y; @@ -496,15 +489,15 @@ switch ((enum compound) butPtr->compound) { case COMPOUND_TOP: case COMPOUND_BOTTOM: /* Image is above or below text */ if (butPtr->compound == COMPOUND_TOP) { - textYOffset = height + padY; + textYOffset = height + butPtr->padY; } else { - imageYOffset = butPtr->textHeight + padY; + imageYOffset = butPtr->textHeight + butPtr->padY; } - fullHeight = height + butPtr->textHeight + padY; + fullHeight = height + butPtr->textHeight + butPtr->padY; fullWidth = (width > butPtr->textWidth ? width : butPtr->textWidth); textXOffset = (fullWidth - butPtr->textWidth)/2; imageXOffset = (fullWidth - width)/2; break; case COMPOUND_LEFT: @@ -512,15 +505,15 @@ /* * Image is left or right of text */ if (butPtr->compound == COMPOUND_LEFT) { - textXOffset = width + padX; + textXOffset = width + butPtr->padX; } else { - imageXOffset = butPtr->textWidth + padX; + imageXOffset = butPtr->textWidth + butPtr->padX; } - fullWidth = butPtr->textWidth + padX + width; + fullWidth = butPtr->textWidth + butPtr->padX + width; fullHeight = (height > butPtr->textHeight ? height : butPtr->textHeight); textYOffset = (fullHeight - butPtr->textHeight)/2; imageYOffset = (fullHeight - height)/2; break; @@ -541,11 +534,12 @@ default: break; } TkComputeAnchor(butPtr->anchor, tkwin, - padX + borderWidth, padY + borderWidth, + butPtr->padX + butPtr->borderWidth, + butPtr->padY + butPtr->borderWidth, fullWidth + butPtr->indicatorSpace, fullHeight, &x, &y); x += butPtr->indicatorSpace; if (dpPtr->relief == TK_RELIEF_SUNKEN) { x += dpPtr->offset; @@ -591,11 +585,12 @@ butPtr->underline); } else if (haveImage) { /* Image only */ int x = 0, y; TkComputeAnchor(butPtr->anchor, tkwin, - padX + borderWidth, padY + borderWidth, + butPtr->padX + butPtr->borderWidth, + butPtr->padY + butPtr->borderWidth, width + butPtr->indicatorSpace, height, &x, &y); x += butPtr->indicatorSpace; if (pressed) { x += dpPtr->offset; y += dpPtr->offset; @@ -624,11 +619,11 @@ XSetClipOrigin(butPtr->display, dpPtr->gc, 0, 0); } } else { /* Text only */ int x, y; - TkComputeAnchor(butPtr->anchor, tkwin, padX, padY, + TkComputeAnchor(butPtr->anchor, tkwin, butPtr->padX, butPtr->padY, butPtr->textWidth + butPtr->indicatorSpace, butPtr->textHeight, &x, &y); x += butPtr->indicatorSpace; y += 1; /* Tweak to match native buttons */ Tk_DrawTextLayout(butPtr->display, pixmap, dpPtr->gc, butPtr->textLayout, @@ -675,15 +670,15 @@ * Draw the border and traversal highlight last. This way, if the * button's contents overflow they'll be covered up by the border. */ if (dpPtr->relief != TK_RELIEF_FLAT) { - int inset = highlightWidth; + int inset = butPtr->highlightWidth; Tk_Draw3DRectangle(tkwin, pixmap, dpPtr->border, inset, inset, Tk_Width(tkwin) - 2 * inset, Tk_Height(tkwin) - 2 * inset, - borderWidth, dpPtr->relief); + butPtr->borderWidth, dpPtr->relief); } } } /* @@ -960,20 +955,19 @@ TkButton *butPtr, ThemeButtonKind *btnkind, HIThemeButtonDrawInfo *drawinfo) { MacButton *mbPtr = (MacButton *) butPtr; - int borderWidth, highlightWidth; - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->borderWidthObj, &borderWidth); - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->highlightWidthObj, &highlightWidth); + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->borderWidthPtr, &butPtr->borderWidth); + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); - if (borderWidth <= 2) { + if (butPtr->borderWidth <= 2) { *btnkind = kThemeSmallBevelButton; - } else if (borderWidth == 3) { + } else if (butPtr->borderWidth == 3) { *btnkind = kThemeBevelButton; - } else if (borderWidth == 4) { + } else if (butPtr->borderWidth == 4) { *btnkind = kThemeRoundedBevelButton; } else { *btnkind = kThemePushButton; } @@ -981,18 +975,18 @@ switch (butPtr->type) { case TYPE_BUTTON: *btnkind = kThemePushButton; break; case TYPE_RADIO_BUTTON: - if (borderWidth <= 1) { + if (butPtr->borderWidth <= 1) { *btnkind = kThemeSmallRadioButton; } else { *btnkind = kThemeRadioButton; } break; case TYPE_CHECK_BUTTON: - if (borderWidth <= 1) { + if (butPtr->borderWidth <= 1) { *btnkind = kThemeSmallCheckBox; } else { *btnkind = kThemeCheckBox; } break; @@ -1000,18 +994,18 @@ } if (butPtr->indicatorOn) { switch (butPtr->type) { case TYPE_RADIO_BUTTON: - if (borderWidth <= 1) { + if (butPtr->borderWidth <= 1) { *btnkind = kThemeSmallRadioButton; } else { *btnkind = kThemeRadioButton; } break; case TYPE_CHECK_BUTTON: - if (borderWidth <= 1) { + if (butPtr->borderWidth <= 1) { *btnkind = kThemeSmallCheckBox; } else { *btnkind = kThemeCheckBox; } break; @@ -1065,18 +1059,18 @@ * Older macOS systems (10.9 and earlier) use an animation to * indicate the active button. This is simulated by redrawing * the button periodically. */ - if (!mbPtr->defaultPulseHandler && ([NSApp macOSVersion] <= 100900)) { + if (!mbPtr->defaultPulseHandler && ([NSApp macOSVersion] < 101000)) { mbPtr->defaultPulseHandler = Tcl_CreateTimerHandler( PULSE_TIMER_MSECS, PulseDefaultButtonProc, butPtr); } } else if (mbPtr->defaultPulseHandler) { Tcl_DeleteTimerHandler(mbPtr->defaultPulseHandler); } - if (highlightWidth >= 3) { + if (butPtr->highlightWidth >= 3) { if ((butPtr->flags & GOT_FOCUS)) { drawinfo->adornment |= kThemeAdornmentFocus; } } } Index: macosx/tkMacOSXColor.h ================================================================== --- macosx/tkMacOSXColor.h +++ macosx/tkMacOSXColor.h @@ -36,10 +36,14 @@ enum colorType { rgbColor, /* The 24 bit value is an rgb color. */ clearColor, /* The unique rgba color with all channels 0. */ HIBrush, /* A HITheme brush color.*/ +#if TCL_MAJOR_VERSION < 9 + HIText, /* A HITheme text color (32-bit only). */ + HIBackground, /* A HITheme background color (32-bit only). */ +#endif ttkBackground, /* A background color which indicates nesting level.*/ semantic, /* A semantic NSColor.*/ }; typedef struct xpixel_t { @@ -49,10 +53,21 @@ typedef union MacPixel_t { unsigned long ulong; xpixel pixel; } MacPixel; + +/* + * We maintain two colormaps, one for the LightAqua appearance and one for the + * DarkAqua appearance. + */ + +enum macColormap { + noColormap, + lightColormap, + darkColormap, +}; /* * In TkMacOSXColor.c a Tk hash table is constructed from the static data * below to map system color names to CGColors. */ Index: macosx/tkMacOSXDefault.h ================================================================== --- macosx/tkMacOSXDefault.h +++ macosx/tkMacOSXDefault.h @@ -377,12 +377,12 @@ #define DEF_MESSAGE_FONT "TkDefaultFont" #define DEF_MESSAGE_HIGHLIGHT_BG NORMAL_BG #define DEF_MESSAGE_HIGHLIGHT NORMAL_FG #define DEF_MESSAGE_HIGHLIGHT_WIDTH "0" #define DEF_MESSAGE_JUSTIFY "left" -#define DEF_MESSAGE_PADX NULL -#define DEF_MESSAGE_PADY NULL +#define DEF_MESSAGE_PADX "-1" +#define DEF_MESSAGE_PADY "-1" #define DEF_MESSAGE_RELIEF "flat" #define DEF_MESSAGE_TAKE_FOCUS "0" #define DEF_MESSAGE_TEXT "" #define DEF_MESSAGE_TEXT_VARIABLE "" #define DEF_MESSAGE_WIDTH "0" @@ -473,11 +473,11 @@ #define DEF_SCROLLBAR_BG_COLOR NORMAL_BG #define DEF_SCROLLBAR_BG_MONO WHITE #define DEF_SCROLLBAR_BORDER_WIDTH "0" #define DEF_SCROLLBAR_COMMAND "" #define DEF_SCROLLBAR_CURSOR "" -#define DEF_SCROLLBAR_EL_BORDER_WIDTH NULL +#define DEF_SCROLLBAR_EL_BORDER_WIDTH "-1" #define DEF_SCROLLBAR_HIGHLIGHT_BG NORMAL_BG #define DEF_SCROLLBAR_HIGHLIGHT NORMAL_FG #define DEF_SCROLLBAR_HIGHLIGHT_WIDTH "0" #define DEF_SCROLLBAR_JUMP "0" #define DEF_SCROLLBAR_ORIENT "vertical" Index: macosx/tkMacOSXDialog.c ================================================================== --- macosx/tkMacOSXDialog.c +++ macosx/tkMacOSXDialog.c @@ -774,11 +774,11 @@ /* * From OSX 10.11, the title string is silently ignored in the open * panel. Prepend the title to the message in this case. */ - if ([NSApp macOSVersion] > 101000) { + if ([NSApp macOSVersion] >= 101100) { if (message) { NSString *fullmessage = [[NSString alloc] initWithFormat:@"%@\n%@", title, message]; [message release]; [title release]; Index: macosx/tkMacOSXDraw.c ================================================================== --- macosx/tkMacOSXDraw.c +++ macosx/tkMacOSXDraw.c @@ -84,25 +84,25 @@ if (Tcl_CreateNamespace(interp, "::tk::mac", NULL, NULL) == NULL) { Tcl_ResetResult(interp); } if (Tcl_LinkVar(interp, "::tk::mac::CGAntialiasLimit", - &cgAntiAliasLimit, TCL_LINK_INT) != TCL_OK) { + (char *)&cgAntiAliasLimit, TCL_LINK_INT) != TCL_OK) { Tcl_ResetResult(interp); } cgAntiAliasLimit = limit; /* * Piggy-back the themed drawing var init here. */ if (Tcl_LinkVar(interp, "::tk::mac::useThemedToplevel", - &useThemedToplevel, TCL_LINK_BOOLEAN) != TCL_OK) { + (char *)&useThemedToplevel, TCL_LINK_BOOLEAN) != TCL_OK) { Tcl_ResetResult(interp); } if (Tcl_LinkVar(interp, "::tk::mac::useThemedFrame", - &useThemedFrame, TCL_LINK_BOOLEAN) != TCL_OK) { + (char *)&useThemedFrame, TCL_LINK_BOOLEAN) != TCL_OK) { Tcl_ResetResult(interp); } transparentColor = TkMacOSXClearPixel(); } return TCL_OK; @@ -1480,11 +1480,11 @@ /* * Mark the view as needing to be redisplayed, since we have drawn on its * backing layer. */ - + [dcPtr->view setNeedsDisplay:YES]; #ifdef TK_MAC_DEBUG bzero(dcPtr, sizeof(TkMacOSXDrawingContext)); #endif Index: macosx/tkMacOSXEntry.c ================================================================== --- macosx/tkMacOSXEntry.c +++ macosx/tkMacOSXEntry.c @@ -98,22 +98,19 @@ .kind = kHIThemeFrameTextFieldSquare, .state = (entryPtr->state == STATE_DISABLED ? kThemeStateInactive : kThemeStateActive), .isFocused = (entryPtr->flags & GOT_FOCUS ? 1 : 0), }; - int borderWidth, highlightWidth; /* * I use 6 as the borderwidth. 2 of the 5 go into the actual frame the 3 * are because the Mac OS Entry widgets leave more space around the Text * than Tk does on X11. */ - Tk_GetPixelsFromObj(NULL, tkwin, entryPtr->borderWidthObj, &borderWidth); - Tk_GetPixelsFromObj(NULL, tkwin, entryPtr->highlightWidthObj, &highlightWidth); - if (borderWidth != MAC_OSX_ENTRY_BORDER - || highlightWidth != MAC_OSX_FOCUS_WIDTH + if (entryPtr->borderWidth != MAC_OSX_ENTRY_BORDER + || entryPtr->highlightWidth != MAC_OSX_FOCUS_WIDTH || entryPtr->relief != MAC_OSX_ENTRY_RELIEF) { return 0; } /* Index: macosx/tkMacOSXFont.c ================================================================== --- macosx/tkMacOSXFont.c +++ macosx/tkMacOSXFont.c @@ -22,30 +22,10 @@ #ifdef TK_MAC_DEBUG #define TK_MAC_DEBUG_FONTS #endif */ -/* - * TclNumUtfChars() is the same as Tcl_NumUtfChars(), but counting - * in UTF-16 in stead of UTF-32. For Tcl 8.7 it's a little bit - * tricky to get this function, because we are compiling with - * TCL_UTF_MAX=4. Same for TclUtfAtIndex() - */ -#if TCL_MAJOR_VERSION < 9 -# undef TclNumUtfChars -# undef TclUtfAtIndex -# ifdef USE_TCL_STUBS -# define TclNumUtfChars \ - (tclStubsPtr->tcl_NumUtfChars) /* 312 */ -# define TclUtfAtIndex \ - (tclStubsPtr->tcl_UtfAtIndex) /* 325 */ -# else -# define TclNumUtfChars Tcl_NumUtfChars -# define TclUtfAtIndex Tcl_UtfAtIndex -# endif -#endif - /* * The following structure represents our Macintosh-specific implementation * of a font object. */ @@ -474,21 +454,23 @@ } stringArg = Tcl_GetStringFromObj(objv[1], &len); if (stringArg == NULL) { return TCL_ERROR; } - Tcl_Size ulen = Tcl_GetCharLength(objv[1]); + Tcl_Size ulen = TkGetCharLength(objv[1]); S = [[TKNSString alloc] initWithTclUtfBytes:stringArg length:len]; len = [S length]; if (TkGetIntForIndex(objv[2], ulen - 1, 0, &idx) != TCL_OK) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad index \"%s\": must be integer?[+-]integer?, end?[+-]integer?, or \"\"", Tcl_GetString(objv[2]))); Tcl_SetErrorCode(interp, "TK", "VALUE", "INDEX", NULL); return TCL_ERROR; } - if (idx > 0 && len != ulen) { + if (idx >= ulen) { + idx = len; + } else if (idx > 0 && len != ulen) { /* The string contains codepoints > \uFFFF. Determine UTF-16 index */ Tcl_Size newIdx = 0; for (Tcl_Size i = 0; i < idx; i++) { newIdx += 1 + (((newIdx < len-1) && ([S characterAtIndex:newIdx]&0xFC00) == 0xD800) && (([S characterAtIndex:newIdx+1]&0xFC00) == 0xDC00)); } @@ -531,21 +513,23 @@ } stringArg = Tcl_GetStringFromObj(objv[1], &len); if (stringArg == NULL) { return TCL_ERROR; } - Tcl_Size ulen = Tcl_GetCharLength(objv[1]); + Tcl_Size ulen = TkGetCharLength(objv[1]); S = [[TKNSString alloc] initWithTclUtfBytes:stringArg length:len]; len = [S length]; if (TkGetIntForIndex(objv[2], ulen - 1, 0, &idx) != TCL_OK) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad index \"%s\": must be integer?[+-]integer?, end?[+-]integer?, or \"\"", Tcl_GetString(objv[2]))); Tcl_SetErrorCode(interp, "TK", "VALUE", "INDEX", NULL); return TCL_ERROR; } - if (idx > 0 && len != ulen) { + if (idx >= ulen) { + idx = len; + } else if (idx > 0 && len != ulen) { /* The string contains codepoints > \uFFFF. Determine UTF-16 index */ Tcl_Size newIdx = 0; for (Tcl_Size i = 0; i < idx; i++) { newIdx += 1 + (((newIdx < len-1) && ([S characterAtIndex:newIdx]&0xFC00) == 0xD800) && (([S characterAtIndex:newIdx+1]&0xFC00) == 0xDC00)); } @@ -952,11 +936,11 @@ * the given horizontal span. The measurement is done under the * assumption that Tk_DrawChars() will be used to actually display the * characters. * * With ATSUI we need the line context to do this right, so we have the - * actual implementation in TkpMeasureCharsInContext(). + * actual implementation in Tk_MeasureCharsInContext(). * * Results: * The return value is the number of bytes from source that fit into the * span that extends from 0 to maxLength. *lengthPtr is filled with the * x-coordinate of the right edge of the last character that did fit. @@ -990,22 +974,22 @@ * means return at least one character even if * no characters fit. */ int *lengthPtr) /* Filled with x-location just after the * terminating character. */ { - return TkpMeasureCharsInContext(tkfont, source, numBytes, 0, numBytes, + return Tk_MeasureCharsInContext(tkfont, source, numBytes, 0, numBytes, maxLength, flags, lengthPtr); } /* *--------------------------------------------------------------------------- * - * TkpMeasureCharsInContext -- + * Tk_MeasureCharsInContext -- * * Determine the number of bytes from the string that will fit in the * given horizontal span. The measurement is done under the assumption - * that TkpDrawCharsInContext() will be used to actually display the + * that Tk_DrawCharsInContext() will be used to actually display the * characters. * * This one is almost the same as Tk_MeasureChars(), but with access to * all the characters on the line for context. * @@ -1019,11 +1003,11 @@ * *--------------------------------------------------------------------------- */ int -TkpMeasureCharsInContext( +Tk_MeasureCharsInContext( Tk_Font tkfont, /* Font in which characters will be drawn. */ const char * source, /* UTF-8 string to be displayed. Need not be * '\0' terminated. */ Tcl_Size numBytes, /* Maximum number of bytes to consider from * source string in all. */ @@ -1080,12 +1064,12 @@ } attributedString = [[NSAttributedString alloc] initWithString:string attributes:fontPtr->nsAttributes]; typesetter = CTTypesetterCreateWithAttributedString( (CFAttributedStringRef)attributedString); - start = TclNumUtfChars(source, rangeStart); - len = TclNumUtfChars(source + rangeStart, rangeLength); + start = Tcl_NumUtfChars(source, rangeStart); + len = Tcl_NumUtfChars(source + rangeStart, rangeLength); if (start > 0) { range.length = start; line = CTTypesetterCreateLine(typesetter, range); offset = CTLineGetTypographicBounds(line, NULL, NULL, NULL); CFRelease(line); @@ -1182,11 +1166,11 @@ } CFRelease(typesetter); [attributedString release]; [string release]; length = ceil(width - offset); - fit = (TclUtfAtIndex(source, index) - source) - rangeStart; + fit = (Tcl_UtfAtIndex(source, index) - source) - rangeStart; done: #ifdef TK_MAC_DEBUG_FONTS TkMacOSXDbgMsg("measure: source=\"%s\" range=\"%.*s\" maxLength=%d " "flags='%s%s%s%s' -> width=%d bytesFit=%d\n", source, rangeLength, source+rangeStart, maxLength, @@ -1265,11 +1249,11 @@ } /* *--------------------------------------------------------------------------- * - * TkpDrawCharsInContext -- + * Tk_DrawCharsInContext -- * * Draw a string of characters on the screen like Tk_DrawChars(), with * access to all the characters on the line for context. * * Results: @@ -1283,11 +1267,11 @@ * *--------------------------------------------------------------------------- */ void -TkpDrawCharsInContext( +Tk_DrawCharsInContext( Display *display, /* Display on which to draw. */ Drawable drawable, /* Window or pixmap in which to draw. */ GC gc, /* Graphics context for drawing characters. */ Tk_Font tkfont, /* Font in which characters will be drawn; must * be the same as font used in GC. */ @@ -1381,12 +1365,12 @@ CGAffineTransformRotate( CGAffineTransformTranslate(t, textX, textY), angle*PI/180.0), -textX, -textY); } CGContextConcatCTM(context, t); - start = TclNumUtfChars(source, rangeStart); - length = TclNumUtfChars(source, rangeStart + rangeLength) - start; + start = Tcl_NumUtfChars(source, rangeStart); + length = Tcl_NumUtfChars(source, rangeStart + rangeLength) - start; line = CTTypesetterCreateLine(typesetter, CFRangeMake(start, length)); if (start > 0) { /* * We are only drawing part of the string. To compute the x coordinate @@ -1550,11 +1534,11 @@ if (Tcl_CreateNamespace(interp, "::tk::mac", NULL, NULL) == NULL) { Tcl_ResetResult(interp); } if (Tcl_LinkVar(interp, "::tk::mac::antialiasedtext", - &antialiasedTextEnabled, + (char *)&antialiasedTextEnabled, TCL_LINK_INT) != TCL_OK) { Tcl_ResetResult(interp); } } antialiasedTextEnabled = enable; Index: macosx/tkMacOSXInit.c ================================================================== --- macosx/tkMacOSXInit.c +++ macosx/tkMacOSXInit.c @@ -649,11 +649,11 @@ /* * Ordering the root window front in an idle task allows * checking whether it was immediately withdrawn, and * therefore does not need to be placed on the screen. */ - + Tcl_DoWhenIdle(showRootWindow, window); break; } } Index: macosx/tkMacOSXInt.h ================================================================== --- macosx/tkMacOSXInt.h +++ macosx/tkMacOSXInt.h @@ -86,10 +86,11 @@ #define TK_CLIP_INVALID 0x02 #define TK_HOST_EXISTS 0x04 #define TK_DRAWN_UNDER_MENU 0x08 #define TK_IS_PIXMAP 0x10 #define TK_IS_BW_PIXMAP 0x20 +#define TK_DO_NOT_DRAW 0x40 #define TTK_HAS_CONTRASTING_BG 0x80 /* * I am reserving TK_EMBEDDED = 0x100 in the MacDrawable flags * This is defined in tk.h. We need to duplicate the TK_EMBEDDED flag in the Index: macosx/tkMacOSXMenu.c ================================================================== --- macosx/tkMacOSXMenu.c +++ macosx/tkMacOSXMenu.c @@ -1414,11 +1414,11 @@ if (menuPtr->tkwin == NULL || menuPtr->mainMenuPtr != menuPtr) { return; } menuSize = [(NSMenu *) menuPtr->platformData size]; - Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->borderWidthObj, + Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->borderWidthPtr, &borderWidth); Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->activeBorderWidthPtr, &activeBorderWidth); x = y = borderWidth; windowHeight = maxWidth = 0; Index: macosx/tkMacOSXMenubutton.c ================================================================== --- macosx/tkMacOSXMenubutton.c +++ macosx/tkMacOSXMenubutton.c @@ -168,11 +168,10 @@ MacMenuButton *mbPtr = (MacMenuButton *)clientData; TkMenuButton *butPtr = (TkMenuButton *)clientData; Tk_Window tkwin = butPtr->tkwin; Pixmap pixmap; DrawParams *dpPtr = &mbPtr->drawParams; - int highlightWidth; butPtr->flags &= ~REDRAW_PENDING; if ((butPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) { return; } @@ -189,15 +188,14 @@ /* * Draw highlight border, if needed. */ - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->highlightWidthObj, &highlightWidth); - if (highlightWidth < 3) { + if (butPtr->highlightWidth < 3) { if (butPtr->flags & GOT_FOCUS) { GC gc = Tk_GCForColor(butPtr->highlightColorPtr, pixmap); - TkMacOSXDrawSolidBorder(tkwin, gc, 0, highlightWidth); + TkMacOSXDrawSolidBorder(tkwin, gc, 0, butPtr->highlightWidth); } } } /* @@ -246,12 +244,10 @@ TkMenuButton *butPtr) /* Widget record for menu button. */ { int width, height, avgWidth, haveImage = 0, haveText = 0; int txtWidth, txtHeight; Tk_FontMetrics fm; - int borderWidth, highlightWidth; - int padX, padY; /* * First compute the size of the contents of the button. */ @@ -268,17 +264,15 @@ Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height); haveImage = 1; } if (butPtr->textObj && Tcl_GetString(butPtr->textObj)[0]) { - int wrapLength; haveText = 1; Tk_FreeTextLayout(butPtr->textLayout); - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->wrapLengthObj, &wrapLength); butPtr->textLayout = Tk_ComputeTextLayout(butPtr->tkfont, - Tcl_GetString(butPtr->textObj), TCL_INDEX_NONE, wrapLength, + Tcl_GetString(butPtr->textObj), TCL_INDEX_NONE, butPtr->wrapLength, butPtr->justify, 0, &butPtr->textWidth, &butPtr->textHeight); txtWidth = butPtr->textWidth; txtHeight = butPtr->textHeight; avgWidth = Tk_TextWidth(butPtr->tkfont, "0", 1); Tk_GetFontMetrics(butPtr->tkfont, &fm); @@ -289,32 +283,28 @@ * geometry is a combination of the image and text geometry. We only honor * the compound bit if the button has both text and an image, because * otherwise it is not really a compound button. */ - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->widthObj, &butPtr->width); - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->heightObj, &butPtr->height); - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padXObj, &padX); - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padYObj, &padY); if (haveImage && haveText) { switch ((enum compound) butPtr->compound) { case COMPOUND_TOP: case COMPOUND_BOTTOM: /* * Image is above or below text */ - height += txtHeight + padY; + height += txtHeight + butPtr->padY; width = (width > txtWidth ? width : txtWidth); break; case COMPOUND_LEFT: case COMPOUND_RIGHT: /* * Image is left or right of text */ - width += txtWidth + padX; + width += txtWidth + butPtr->padX; height = (height > txtHeight ? height : txtHeight); break; case COMPOUND_CENTER: /* * Image and text are superimposed @@ -344,21 +334,19 @@ } } else { /* Text only */ width = txtWidth; height = txtHeight; if (butPtr->width > 0) { - width = butPtr->width * avgWidth + 2 * padX; + width = butPtr->width * avgWidth + 2 * butPtr->padX; } if (butPtr->height > 0) { - height = butPtr->height * fm.linespace + 2 * padY; + height = butPtr->height * fm.linespace + 2 * butPtr->padY; } } } - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->borderWidthObj, &borderWidth); - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->highlightWidthObj, &highlightWidth); - butPtr->inset = highlightWidth + borderWidth; + butPtr->inset = butPtr->highlightWidth + butPtr->borderWidth; width += LEFT_INSET + RIGHT_INSET + 2*butPtr->inset; height += 2*butPtr->inset; height = height < MIN_HEIGHT ? MIN_HEIGHT : height; Tk_GeometryRequest(butPtr->tkwin, width, height); Tk_SetInternalBorder(butPtr->tkwin, butPtr->inset); @@ -389,11 +377,10 @@ int haveImage = 0, haveText = 0; int imageXOffset = 0, imageYOffset = 0; int textXOffset = 0, textYOffset = 0; int width = 0, height = 0; int fullWidth = 0, fullHeight = 0; - int padX, padY; if (tkwin == NULL || !Tk_IsMapped(tkwin)) { return; } @@ -407,12 +394,10 @@ Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height); haveImage = 1; } haveText = (butPtr->textWidth != 0 && butPtr->textHeight != 0); - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padXObj, &padX); - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padYObj, &padY); if (butPtr->compound != COMPOUND_NONE && haveImage && haveText) { int x = 0, y = 0; textXOffset = 0; textYOffset = 0; @@ -425,15 +410,15 @@ /* * Image is above or below text. */ if (butPtr->compound == COMPOUND_TOP) { - textYOffset = height + padY; + textYOffset = height + butPtr->padY; } else { - imageYOffset = butPtr->textHeight + padY; + imageYOffset = butPtr->textHeight + butPtr->padY; } - fullHeight = height + butPtr->textHeight + padY; + fullHeight = height + butPtr->textHeight + butPtr->padY; fullWidth = (width > butPtr->textWidth ? width : butPtr->textWidth); textXOffset = (fullWidth - butPtr->textWidth)/2; imageXOffset = (fullWidth - width)/2; break; @@ -442,15 +427,15 @@ /* * Image is left or right of text */ if (butPtr->compound == COMPOUND_LEFT) { - textXOffset = width + padX - 2; + textXOffset = width + butPtr->padX - 2; } else { - imageXOffset = butPtr->textWidth + padX; + imageXOffset = butPtr->textWidth + butPtr->padX; } - fullWidth = butPtr->textWidth + padX + width; + fullWidth = butPtr->textWidth + butPtr->padX + width; fullHeight = (height > butPtr->textHeight ? height : butPtr->textHeight); textYOffset = (fullHeight - butPtr->textHeight)/2; imageYOffset = (fullHeight - height)/2; break; @@ -470,11 +455,11 @@ case COMPOUND_NONE: break; } TkComputeAnchor(butPtr->anchor, tkwin, - padX + butPtr->inset, padY + butPtr->inset, + butPtr->padX + butPtr->inset, butPtr->padY + butPtr->inset, fullWidth, fullHeight, &x, &y); imageXOffset = LEFT_INSET; imageYOffset += y; textYOffset -= 1; @@ -498,16 +483,13 @@ butPtr->underline); } else { int x, y; if (haveImage) { - int borderWidth; - - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->borderWidthObj, &borderWidth); TkComputeAnchor(butPtr->anchor, tkwin, - padX + borderWidth, - padY + borderWidth, + butPtr->padX + butPtr->borderWidth, + butPtr->padY + butPtr->borderWidth, width, height, &x, &y); imageXOffset = LEFT_INSET; imageYOffset += y; if (butPtr->image != NULL) { Tk_RedrawImage(butPtr->image, 0, 0, width, height, @@ -521,11 +503,11 @@ imageXOffset, imageYOffset, 1); XSetClipOrigin(butPtr->display, dpPtr->gc, 0, 0); } } else { textXOffset = LEFT_INSET; - TkComputeAnchor(butPtr->anchor, tkwin, padX, padY, + TkComputeAnchor(butPtr->anchor, tkwin, butPtr->padX, butPtr->padY, butPtr->textWidth, butPtr->textHeight, &x, &y); Tk_DrawTextLayout(butPtr->display, pixmap, dpPtr->gc, butPtr->textLayout, textXOffset, y, 0, -1); y += butPtr->textHeight/2; } @@ -746,11 +728,10 @@ TkMenuButton *butPtr, ThemeButtonKind *btnkind, HIThemeButtonDrawInfo *drawinfo) { MacMenuButton *mbPtr = (MacMenuButton *) butPtr; - int highlightWidth; if (butPtr->image || butPtr->bitmap || butPtr->textObj) { /* TODO: allow for Small and Mini menubuttons. */ *btnkind = kThemePopupButton; } else { /* This should never happen. */ @@ -778,12 +759,11 @@ } else { drawinfo->state = kThemeStateActive; } drawinfo->adornment = kThemeAdornmentNone; - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->highlightWidthObj, &highlightWidth); - if (highlightWidth >= 3) { + if (butPtr->highlightWidth >= 3) { if ((butPtr->flags & GOT_FOCUS)) { drawinfo->adornment |= kThemeAdornmentFocus; } } drawinfo->adornment |= kThemeAdornmentArrowDoubleArrow; Index: macosx/tkMacOSXMenus.c ================================================================== --- macosx/tkMacOSXMenus.c +++ macosx/tkMacOSXMenus.c @@ -110,11 +110,11 @@ /* * On OS X 10.12 we get duplicate tab control items if we create them here. */ - if ([NSApp macOSVersion] > 101200) { + if ([NSApp macOSVersion] >= 101300) { _defaultWindowsMenuItems = [_defaultWindowsMenuItems arrayByAddingObjectsFromArray: [NSArray arrayWithObjects: [NSMenuItem separatorItem], [NSMenuItem itemWithTitle:@"Show Previous Tab" Index: macosx/tkMacOSXNotify.c ================================================================== --- macosx/tkMacOSXNotify.c +++ macosx/tkMacOSXNotify.c @@ -14,10 +14,38 @@ */ #include "tkMacOSXPrivate.h" #include "tkMacOSXInt.h" #include "tkMacOSXConstants.h" +#if TCL_MAJOR_VERSION < 9 +#undef Tcl_MacOSXNotifierAddRunLoopMode +#ifdef USE_TCL_STUBS +#ifdef __cplusplus +extern "C" { +#endif +/* Little hack to eliminate the need for "tclInt.h" here: + Just copy a small portion of TclIntPlatStubs, just + enough to make it work. See [600b72bfbc] */ +typedef struct TclIntPlatStubs { + int magic; + void *hooks; + void (*dummy[19]) (void); /* dummy entries 0-18, not used */ + void (*tclMacOSXNotifierAddRunLoopMode) (const void *runLoopMode); /* 19 */ +} TclIntPlatStubs; +extern const TclIntPlatStubs *tclIntPlatStubsPtr; +#ifdef __cplusplus +} +#endif +#define Tcl_MacOSXNotifierAddRunLoopMode \ + (tclIntPlatStubsPtr->tclMacOSXNotifierAddRunLoopMode) /* 19 */ +#elif defined(TCL_MINOR_VERSION) && (TCL_MINOR_VERSION < 7) + extern void TclMacOSXNotifierAddRunLoopMode(const void *runLoopMode); +# define Tcl_MacOSXNotifierAddRunLoopMode TclMacOSXNotifierAddRunLoopMode +#else + extern void Tcl_MacOSXNotifierAddRunLoopMode(const void *runLoopMode); +#endif +#endif #import /* This is not used for anything at the moment. */ typedef struct ThreadSpecificData { int initialized; Index: macosx/tkMacOSXScrlbr.c ================================================================== --- macosx/tkMacOSXScrlbr.c +++ macosx/tkMacOSXScrlbr.c @@ -246,11 +246,10 @@ TkScrollbar *scrollPtr = (TkScrollbar *)clientData; MacScrollbar *msPtr = (MacScrollbar *) scrollPtr; Tk_Window tkwin = scrollPtr->tkwin; TkWindow *winPtr = (TkWindow *) tkwin; TkMacOSXDrawingContext dc; - int borderWidth, highlightWidth; scrollPtr->flags &= ~REDRAW_PENDING; if (tkwin == NULL || !Tk_IsMapped(tkwin)) { return; @@ -279,34 +278,32 @@ /* * Draw a 3D rectangle to provide a base for the native scrollbar. */ - Tk_GetPixelsFromObj(NULL, scrollPtr->tkwin, scrollPtr->highlightWidthObj, &highlightWidth); - if (highlightWidth > 0) { + if (scrollPtr->highlightWidth > 0) { GC fgGC, bgGC; bgGC = Tk_GCForColor(scrollPtr->highlightBgColorPtr, (Pixmap) macWin); if (scrollPtr->flags & GOT_FOCUS) { fgGC = Tk_GCForColor(scrollPtr->highlightColorPtr, (Pixmap) macWin); } else { fgGC = bgGC; } - Tk_DrawHighlightBorder(tkwin, fgGC, bgGC, highlightWidth, + Tk_DrawHighlightBorder(tkwin, fgGC, bgGC, scrollPtr->highlightWidth, (Pixmap) macWin); } - Tk_GetPixelsFromObj(NULL, scrollPtr->tkwin, scrollPtr->borderWidthObj, &borderWidth); Tk_Draw3DRectangle(tkwin, (Pixmap) macWin, scrollPtr->bgBorder, - highlightWidth, highlightWidth, - Tk_Width(tkwin) - 2 * highlightWidth, - Tk_Height(tkwin) - 2 * highlightWidth, - borderWidth, scrollPtr->relief); + scrollPtr->highlightWidth, scrollPtr->highlightWidth, + Tk_Width(tkwin) - 2*scrollPtr->highlightWidth, + Tk_Height(tkwin) - 2*scrollPtr->highlightWidth, + scrollPtr->borderWidth, scrollPtr->relief); Tk_Fill3DRectangle(tkwin, (Pixmap) macWin, scrollPtr->bgBorder, scrollPtr->inset, scrollPtr->inset, - Tk_Width(tkwin) - 2 * scrollPtr->inset, - Tk_Height(tkwin) - 2 * scrollPtr->inset, 0, TK_RELIEF_FLAT); + Tk_Width(tkwin) - 2*scrollPtr->inset, + Tk_Height(tkwin) - 2*scrollPtr->inset, 0, TK_RELIEF_FLAT); /* * Update values and then draw the native scrollbar over the rectangle. */ @@ -313,13 +310,10 @@ UpdateControlValues(scrollPtr); if (SNOW_LEOPARD_STYLE) { HIThemeDrawTrack(&msPtr->info, 0, dc.context, kHIThemeOrientationInverted); - } else if ([NSApp macOSVersion] <= 100800) { - HIThemeDrawTrack(&msPtr->info, 0, dc.context, - kHIThemeOrientationNormal); } else { /* * Switch back to NSView coordinates and draw a modern scrollbar. */ @@ -367,18 +361,17 @@ * happens to be zero. To adjust for having both arrows at the same end we * shift the scrollbar up by the arrowLength. */ int fieldLength; - int width, borderWidth, highlightWidth; - Tk_GetPixelsFromObj(NULL, scrollPtr->tkwin, scrollPtr->borderWidthObj, &borderWidth); - Tk_GetPixelsFromObj(NULL, scrollPtr->tkwin, scrollPtr->widthObj, &width); - Tk_GetPixelsFromObj(NULL, scrollPtr->tkwin, scrollPtr->highlightWidthObj, &highlightWidth); - scrollPtr->inset = highlightWidth + borderWidth; + if (scrollPtr->highlightWidth < 0) { + scrollPtr->highlightWidth = 0; + } + scrollPtr->inset = scrollPtr->highlightWidth + scrollPtr->borderWidth; if ([NSApp macOSVersion] == 100600) { - scrollPtr->arrowLength = width; + scrollPtr->arrowLength = scrollPtr->width; } else { scrollPtr->arrowLength = 0; } fieldLength = (scrollPtr->vertical ? Tk_Height(scrollPtr->tkwin) : Tk_Width(scrollPtr->tkwin)) @@ -418,18 +411,18 @@ * be redisplayed. */ if (scrollPtr->vertical) { Tk_GeometryRequest(scrollPtr->tkwin, - width + 2 * scrollPtr->inset, - 2 * (scrollPtr->arrowLength + borderWidth + scrollPtr->width + 2*scrollPtr->inset, + 2 * (scrollPtr->arrowLength + scrollPtr->borderWidth + scrollPtr->inset) + metrics.minThumbHeight); } else { Tk_GeometryRequest(scrollPtr->tkwin, - 2 * (scrollPtr->arrowLength + borderWidth + 2 * (scrollPtr->arrowLength + scrollPtr->borderWidth + scrollPtr->inset) + metrics.minThumbHeight, - width + 2 * scrollPtr->inset); + scrollPtr->width + 2 * scrollPtr->inset); } Tk_SetInternalBorder(scrollPtr->tkwin, scrollPtr->inset); } /* Index: macosx/tkMacOSXWindowEvent.c ================================================================== --- macosx/tkMacOSXWindowEvent.c +++ macosx/tkMacOSXWindowEvent.c @@ -436,11 +436,11 @@ } } @end #pragma mark - - + /* *---------------------------------------------------------------------- * * TkpWillDrawWidget -- * @@ -468,11 +468,11 @@ int TkpWillDrawWidget(Tk_Window tkwin) { (void) tkwin; return false; } - + /* *---------------------------------------------------------------------- * * GenerateUpdates -- * Index: macosx/tkMacOSXWm.c ================================================================== --- macosx/tkMacOSXWm.c +++ macosx/tkMacOSXWm.c @@ -466,11 +466,11 @@ int *maxHeightPtr); static void RemapWindows(TkWindow *winPtr, MacDrawable *parentWin); static void RemoveTransient(TkWindow *winPtr); -#if MAC_OS_X_VERSION_MAX_ALLOWED > 101300 +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101300 /* * Add a window as a tab in the group specified by its tabbingid, or * make it a standalone window if it is the only window with that * tabbingid. Adjust the window size if a tab bar appeared or @@ -6283,16 +6283,10 @@ Tcl_WrongNumArgs(interp, 2, objv, "window ?class attributes?"); return TCL_ERROR; } return WmWinStyle(interp, winPtr, objc, objv); case TKMWS_APPEARANCE: - if ([NSApp macOSVersion] < 100900) { - Tcl_SetObjResult(interp, Tcl_NewStringObj( - "Window appearances did not exist until OSX 10.9.", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "WINDOWSTYLE", "APPEARANCE", NULL); - return TCL_ERROR; - } if ((objc < 3) || (objc > 4)) { Tcl_WrongNumArgs(interp, 2, objv, "window ?appearancename?"); return TCL_ERROR; } if (objc == 4 && [NSApp macOSVersion] < 101400) { @@ -6536,11 +6530,11 @@ Tcl_Interp *interp, /* Current interpreter. */ TkWindow *winPtr, /* Window to be manipulated. */ Tcl_Size objc, /* Number of arguments. */ Tcl_Obj * const objv[]) /* Argument objects. */ { -#if MAC_OS_X_VERSION_MAX_ALLOWED <= 1090 +#if MAC_OS_X_VERSION_MAX_ALLOWED < 101000 (void) interp; (void) winPtr; (void) objc; (void) objv; return TCL_OK; @@ -6800,11 +6794,11 @@ TKWindow *window = [[winClass alloc] initWithContentRect:contentRect styleMask:styleMask backing:NSBackingStoreBuffered defer:YES]; if (!window) { Tcl_Panic("couldn't allocate new Mac window"); } -#if MAC_OS_X_VERSION_MAX_ALLOWED > 101200 +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101300 if (tabbingId) { identifier = [NSString stringWithUTF8String:tabbingId]; } else { identifier = [NSString stringWithUTF8String:Tk_PathName(winPtr)]; } @@ -7029,11 +7023,11 @@ * May maximize, minimize, restore, or withdraw a window. * *---------------------------------------------------------------------- */ -int +void TkpWmSetState( TkWindow *winPtr, /* Toplevel window to operate on. */ int state) /* One of IconicState, ZoomState, NormalState, * or WithdrawnState. */ { @@ -7040,11 +7034,11 @@ WmInfo *wmPtr = winPtr->wmInfoPtr; NSWindow *macWin = nil; wmPtr->hints.initial_state = state; if (wmPtr->flags & WM_NEVER_MAPPED) { - goto setStateEnd; + return; } if (winPtr && winPtr->window) { macWin = TkMacOSXGetNSWindowForDrawable(winPtr->window); } @@ -7085,12 +7079,10 @@ /* * Make sure windows are updated after the state change too. */ while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)){} -setStateEnd: - return 1; } /* *---------------------------------------------------------------------- * Index: macosx/ttkMacOSXTheme.c ================================================================== --- macosx/ttkMacOSXTheme.c +++ macosx/ttkMacOSXTheme.c @@ -320,11 +320,11 @@ if (containerPtr && containerPtr->privatePtr) { for (int i = 0; i < 4; i++) { rgba[i] = containerPtr->privatePtr->fillRGBA[i]; } } else { - if ([NSApp macOSVersion] > 101300) { + if ([NSApp macOSVersion] >= 101400) { NSColorSpace *deviceRGB = [NSColorSpace deviceRGBColorSpace]; NSColor *windowColor = [[NSColor windowBackgroundColor] colorUsingColorSpace: deviceRGB]; [windowColor getComponents: rgba]; } else { @@ -2468,11 +2468,11 @@ TrackElement *elem = (TrackElement *)elementRecord; Ttk_Orient orientation = TTK_ORIENT_HORIZONTAL; double from = 0, to = 100, value = 0, fraction, max; CGRect bounds = BoxToRect(d, b); - Ttk_GetOrientFromObj(NULL, elem->orientObj, &orientation); + TtkGetOrientFromObj(NULL, elem->orientObj, &orientation); Tcl_GetDoubleFromObj(NULL, elem->fromObj, &from); Tcl_GetDoubleFromObj(NULL, elem->toObj, &to); Tcl_GetDoubleFromObj(NULL, elem->valueObj, &value); fraction = (value - from) / (to - from); @@ -2610,11 +2610,11 @@ double value = 0, maximum = 100, factor; CGRect bounds = BoxToRect(d, b); int isIndeterminate = !strcmp("indeterminate", Tcl_GetString(pbar->modeObj)); - Ttk_GetOrientFromObj(NULL, pbar->orientObj, &orientation); + TtkGetOrientFromObj(NULL, pbar->orientObj, &orientation); Tcl_GetDoubleFromObj(NULL, pbar->valueObj, &value); Tcl_GetDoubleFromObj(NULL, pbar->maximumObj, &maximum); Tcl_GetIntFromObj(NULL, pbar->phaseObj, &phase); if (isIndeterminate) { @@ -2685,11 +2685,11 @@ { ScrollbarElement *scrollbar = (ScrollbarElement *)elementRecord; Ttk_Orient orientation = TTK_ORIENT_HORIZONTAL; SInt32 thickness = 15; - Ttk_GetOrientFromObj(NULL, scrollbar->orientObj, &orientation); + TtkGetOrientFromObj(NULL, scrollbar->orientObj, &orientation); ChkErr(GetThemeMetric, kThemeMetricScrollBarWidth, &thickness); if (orientation == TTK_ORIENT_HORIZONTAL) { *minHeight = thickness; if ([NSApp macOSVersion] > 100700) { *paddingPtr = Ttk_MakePadding(4, 4, 4, 3); @@ -2713,11 +2713,11 @@ ScrollbarElement *scrollbar = (ScrollbarElement *)elementRecord; Ttk_Orient orientation = TTK_ORIENT_HORIZONTAL; CGRect bounds = BoxToRect(d, b); GrayColor bgGray; - Ttk_GetOrientFromObj(NULL, scrollbar->orientObj, &orientation); + TtkGetOrientFromObj(NULL, scrollbar->orientObj, &orientation); if (orientation == TTK_ORIENT_HORIZONTAL) { bounds = CGRectInset(bounds, 0, 1); } else { bounds = CGRectInset(bounds, 1, 0); } @@ -2749,11 +2749,11 @@ TCL_UNUSED(Ttk_Padding *)) /* paddingPtr */ { ScrollbarElement *scrollbar = (ScrollbarElement *)elementRecord; Ttk_Orient orientation = TTK_ORIENT_HORIZONTAL; - Ttk_GetOrientFromObj(NULL, scrollbar->orientObj, &orientation); + TtkGetOrientFromObj(NULL, scrollbar->orientObj, &orientation); if (orientation == TTK_ORIENT_VERTICAL) { *minHeight = 18; *minWidth = 8; } else { *minHeight = 8; @@ -2770,11 +2770,11 @@ Ttk_State state) { ScrollbarElement *scrollbar = (ScrollbarElement *)elementRecord; Ttk_Orient orientation = TTK_ORIENT_HORIZONTAL; - Ttk_GetOrientFromObj(NULL, scrollbar->orientObj, &orientation); + TtkGetOrientFromObj(NULL, scrollbar->orientObj, &orientation); /* * In order to make ttk scrollbars work correctly it is necessary to be * able to display the thumb element at the size and location which the ttk * scrollbar widget requests. The algorithm that HIToolbox uses to Index: tests/bind.test ================================================================== --- tests/bind.test +++ tests/bind.test @@ -2223,11 +2223,11 @@ destroy .t.e bind Entry $savedBind(Entry) bind all $savedBind(All) unset savedBind } -result {0 1 2} -test bind-16.47 {ExpandPercents procedure} -constraints aquaOrWin32 -setup { +test bind-16.47 {ExpandPercents procedure} -constraints {aquaOrWin32 needsTcl87} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f focus -force .t.f update } -body { @@ -6036,11 +6036,11 @@ bind .t.f foo bind .t.f } -cleanup { destroy .t.f } -result -test bind-28.12 {keysym names, Greek_IOTAdiaeresis -> Greek_IOTAdieresis} -constraints deprecated -body { +test bind-28.12 {keysym names, Greek_IOTAdiaeresis -> Greek_IOTAdieresis} -constraints {deprecated needsTcl87} -body { frame .t.f -class Test -width 150 -height 100 bind .t.f foo bind .t.f } -cleanup { destroy .t.f @@ -6057,11 +6057,11 @@ bind .t.f <\U1F44D> foo bind .t.f } -cleanup { destroy .t.f } -result "" -test bind-28.15 {keysym names, Emoji} -body { +test bind-28.15 {keysym names, Emoji} -constraints needsTcl87 -body { frame .t.f -class Test -width 150 -height 100 bind .t.f <👍> foo bind .t.f } -cleanup { destroy .t.f Index: tests/butGeom2.tcl ================================================================== --- tests/butGeom2.tcl +++ tests/butGeom2.tcl @@ -33,17 +33,17 @@ frame .t.control.left.f -width 6c -height 3c pack .t.anchorLabel .t.control.left.f -in .t.control.left -side top -anchor w foreach opt {activebackground activeforeground background disabledforeground foreground highlightbackground highlightcolor } { #button .t.color-$opt -text $opt -command "config -$opt \[tk_chooseColor]" menubutton .t.color-$opt -text $opt -menu .t.color-$opt.m -indicatoron 1 \ - -relief raised -bd 2 + -relief raised -bd 2 menu .t.color-$opt.m -tearoff 0 .t.color-$opt.m add command -label Red -command "config -$opt red" .t.color-$opt.m add command -label Green -command "config -$opt green" .t.color-$opt.m add command -label Blue -command "config -$opt blue" .t.color-$opt.m add command -label Other... \ - -command "config -$opt \[tk_chooseColor]" + -command "config -$opt \[tk_chooseColor]" pack .t.color-$opt -in .t.control.left.f -fill x } set default disabled label .t.default -text Default: Index: tests/button.test ================================================================== --- tests/button.test +++ tests/button.test @@ -1742,11 +1742,11 @@ .b configure -overrelief "" .b cget -overrelief } -cleanup { destroy .b } -result {} -test button-1.178 {configuration option: "overrelief" for button} -setup { +test button-1.178 {configuration option: "overrelief" for button} -constraints needsTcl87 -setup { button .b -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .b update } -body { .b configure -overrelief 1.5 @@ -1761,11 +1761,11 @@ .c configure -overrelief "" .c cget -overrelief } -cleanup { destroy .c } -result {} -test button-1.180 {configuration option: "overrelief" for checkbutton} -setup { +test button-1.180 {configuration option: "overrelief" for checkbutton} -constraints needsTcl87 -setup { checkbutton .c -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .c update } -body { .c configure -overrelief 1.5 @@ -1780,11 +1780,11 @@ .r configure -overrelief "" .r cget -overrelief } -cleanup { destroy .r } -result {} -test button-1.182 {configuration option: "overrelief" for radiobutton} -setup { +test button-1.182 {configuration option: "overrelief" for radiobutton} -constraints needsTcl87 -setup { radiobutton .r -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .r update } -body { .r configure -overrelief 1.5 @@ -2924,11 +2924,11 @@ trace add variable checkvar write bogusTrace .c deselect } -cleanup { destroy .c trace remove variable checkvar write bogusTrace -} -returnCodes error -result {can't set "checkvar": trace aborted} +} -returnCodes error -match glob -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 add variable checkvar write bogusTrace catch {.c deselect} @@ -2946,11 +2946,11 @@ trace add variable radiovar write bogusTrace .r deselect } -cleanup { destroy .r trace remove variable radiovar write bogusTrace -} -match glob -returnCodes error -result {can't set "radiovar": trace aborted} +} -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 add variable radiovar write bogusTrace catch {.r deselect} @@ -3084,11 +3084,11 @@ trace add variable radiovar write bogusTrace .r select } -cleanup { destroy .r trace remove variable radiovar write bogusTrace -} -returnCodes error -result {can't set "radiovar": trace aborted} +} -returnCodes error -match glob -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 add variable radiovar write bogusTrace catch {.r select} @@ -3145,11 +3145,11 @@ trace add variable checkvar write bogusTrace .c toggle } -cleanup { destroy .c trace remove variable checkvar write bogusTrace -} -returnCodes error -result {can't set "checkvar": trace aborted} +} -returnCodes error -match glob -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 add variable checkvar write bogusTrace catch {.c toggle} @@ -3167,11 +3167,11 @@ trace add variable checkvar write bogusTrace .c toggle } -cleanup { trace remove variable checkvar write bogusTrace destroy .c -} -returnCodes error -result {can't set "checkvar": trace aborted} +} -returnCodes error -match glob -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 add variable checkvar write bogusTrace catch {.c toggle} @@ -3190,11 +3190,11 @@ unset checkvar set checkvar(1) 1 .c toggle } -cleanup { destroy .c -} -returnCodes error -result {can't set "checkvar": variable is array} +} -returnCodes error -match glob -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 @@ -3201,11 +3201,11 @@ set checkvar(1) 1 catch {.c toggle} return $errorInfo } -cleanup { destroy .c -} -match glob -result {can't set "checkvar": variable is array +} -match glob -result {can*t set "checkvar": variable is *array while executing ".c toggle"} test button-4.1 {DestroyButton procedure} -constraints { testImageType @@ -3318,11 +3318,11 @@ trace add variable x write bogusTrace radiobutton .r -variable x } -cleanup { destroy .r trace remove variable x write bogusTrace -} -returnCodes error -result {can't set "x": trace aborted} +} -returnCodes error -match glob -result {can*t set "x": trace aborted} test button-5.11 {ConfigureButton - bad image name} -body { button .b -image bogus } -cleanup { destroy .b @@ -3351,11 +3351,11 @@ trace add variable x write bogusTrace radiobutton .r -text foo -textvariable x } -cleanup { trace remove variable x write bogusTrace destroy .r -} -returnCodes error -result {can't set "x": trace aborted} +} -returnCodes error -match glob -result {can*t set "x": trace aborted} test button-5.15 {ConfigureButton - variable handling} -setup { unset -nocomplain x } -body { trace add variable x write bogusTrace catch {radiobutton .r -text foo -textvariable x} @@ -3552,11 +3552,11 @@ trace add variable x write bogusTrace .c invoke } -cleanup { destroy .c trace remove variable x write bogusTrace -} -returnCodes error -result {can't set "x": trace aborted} +} -returnCodes error -match glob -result {can*t set "x": trace aborted} test button-8.3 {TkInvokeButton procedure} -setup { set x 0 } -body { checkbutton .c -variable x trace add variable x write bogusTrace @@ -3573,11 +3573,11 @@ trace add variable x write bogusTrace .c invoke } -cleanup { destroy .c trace remove variable x write bogusTrace -} -returnCodes error -result {can't set "x": trace aborted} +} -returnCodes error -match glob -result {can*t set "x": trace aborted} test button-8.5 {TkInvokeButton procedure} -setup { set x 1 } -body { checkbutton .c -variable x trace add variable x write bogusTrace @@ -3607,11 +3607,11 @@ trace add variable x write bogusTrace .r invoke } -cleanup { destroy .r trace remove variable x write bogusTrace -} -returnCodes error -result {can't set "x": trace aborted} +} -returnCodes error -match glob -result {can*t set "x": trace aborted} test button-8.8 {TkInvokeButton procedure} -body { radiobutton .r -variable x -value red set x green trace add variable x write bogusTrace catch {.r invoke} Index: tests/canvas.test ================================================================== --- tests/canvas.test +++ tests/canvas.test @@ -42,11 +42,11 @@ .c configure -bd badValue } -returnCodes error -result {expected screen distance but got "badValue"} test canvas-1.7 {configuration options: good value for "borderwidth"} -body { .c configure -borderwidth 1.3 .c cget -borderwidth -} -result 1.3 +} -result 1 test canvas-1.8 {configuration options: bad value for "borderwidth"} -body { .c configure -borderwidth badValue } -returnCodes error -result {expected screen distance but got "badValue"} test canvas-1.9 {configuration options: good value for "closeenough"} -body { .c configure -closeenough 24 @@ -70,11 +70,11 @@ .c configure -cursor badValue } -returnCodes error -result {bad cursor spec "badValue"} test canvas-1.15 {configuration options: good value for "height"} -body { .c configure -height 2.1 .c cget -height -} -result 2.1 +} -result 2 test canvas-1.16 {configuration options: bad value for "height"} -body { .c configure -height x42 } -returnCodes error -result {expected screen distance but got "x42"} test canvas-1.17 {configuration options: good value for "highlightbackground"} -body { .c configure -highlightbackground #112233 @@ -105,11 +105,11 @@ .c configure -insertbackground bogus } -returnCodes error -result {unknown color name "bogus"} test canvas-1.25 {configuration options: good value for "insertborderwidth"} -body { .c configure -insertborderwidth 1.3 .c cget -insertborderwidth -} -result 1.3 +} -result 1 test canvas-1.26 {configuration options: bad value for "insertborderwidth"} -body { .c configure -insertborderwidth 2.6x } -returnCodes error -result {expected screen distance but got "2.6x"} test canvas-1.27 {configuration options: good value for "insertofftime"} -body { .c configure -insertofftime 100 @@ -126,11 +126,11 @@ .c configure -insertontime 3.2 } -returnCodes error -result {expected integer but got "3.2"} test canvas-1.31 {configuration options: good value for "insertwidth"} -body { .c configure -insertwidth 1.3 .c cget -insertwidth -} -result 1.3 +} -result 1 test canvas-1.32 {configuration options: bad value for "insertwidth"} -body { .c configure -insertwidth 6x } -returnCodes error -result {expected screen distance but got "6x"} test canvas-1.33 {configuration options: good value for "relief"} -body { .c configure -relief g @@ -147,11 +147,11 @@ .c configure -selectbackground bogus } -returnCodes error -result {unknown color name "bogus"} test canvas-1.37 {configuration options: good value for "selectborderwidth"} -body { .c configure -selectborderwidth 1.3 .c cget -selectborderwidth -} -result 1.3 +} -result 1 test canvas-1.38 {configuration options: bad value for "selectborderwidth"} -body { .c configure -selectborderwidth badValue } -returnCodes error -result {expected screen distance but got "badValue"} test canvas-1.39 {configuration options: good value for "selectforeground"} -body { .c configure -selectforeground #654321 Index: tests/clrpick.test ================================================================== --- tests/clrpick.test +++ tests/clrpick.test @@ -147,11 +147,11 @@ } -setup { set verylongstring [string repeat longstring: 100] } -body { ToPressButton . ok tk_chooseColor -title "Press Ok $verylongstring" -initialcolor #404040 \ - -parent . + -parent . } -result {#404040} test clrpick-2.2 {tk_chooseColor command} -constraints { nonUnixUserInteraction colorsLeftover } -body { set colors "128 128 64" Index: tests/cluster.test ================================================================== --- tests/cluster.test +++ tests/cluster.test @@ -120,11 +120,11 @@ ::tk::startOfPreviousWord "ab cd" end } -result 3 test cluster-4.8 {::tk::startOfPreviousWord} -body { ::tk::startOfPreviousWord "ab cd" {} } -result {} -test cluster-4.9 {::tk::startOfPreviousWord} -body { +test cluster-4.9 {::tk::startOfPreviousWord} -constraints needsTcl87 -body { ::tk::startOfPreviousWord "ab cd" end-1 } -result 0 test cluster-5.0 {::tk::startOfNextWord} -body { ::tk::startOfNextWord "ab cd" -1 Index: tests/config.test ================================================================== --- tests/config.test +++ tests/config.test @@ -456,18 +456,18 @@ rename .foo {} } -cleanup { killTables } -returnCodes ok test config-4.29 {DoObjConfig - invalid string table} -constraints { - testobjconfig + testobjconfig needsTcl87 } -body { testobjconfig alltypes .foo -stringtable foo } -cleanup { killTables } -returnCodes error -result {bad stringtable "foo": must be one, two, three, four, or ""} test config-4.29a {DoObjConfig - invalid string table} -constraints { - testobjconfig + testobjconfig needsTcl87 } -body { testobjconfig alltypes .foo -stringtable2 foo } -cleanup { killTables } -returnCodes error -result {bad stringtable2 "foo": must be one, two, or ""} @@ -778,11 +778,11 @@ .foo cget -relief } -cleanup { killTables } -returnCodes ok -result flat test config-4.71 {DoObjConfig - invalid relief} -constraints { - testobjconfig + testobjconfig needsTcl87 } -body { testobjconfig alltypes .foo -relief foo } -cleanup { killTables } -returnCodes error -result {bad relief "foo": must be flat, groove, raised, ridge, solid, sunken, or ""} @@ -872,11 +872,11 @@ testobjconfig alltypes .foo -justify center .foo cget -justify } -cleanup { killTables } -returnCodes ok -result center -test config-4.85 {DoObjConfig - invalid justify} -constraints testobjconfig -body { +test config-4.85 {DoObjConfig - invalid justify} -constraints {testobjconfig needsTcl87} -body { testobjconfig alltypes .foo -justify foo } -cleanup { killTables } -returnCodes error -result {bad justification "foo": must be left, right, center, or ""} test config-4.86 {DoObjConfig - new justify} -constraints testobjconfig -body { @@ -914,11 +914,11 @@ } -cleanup { killTables } -returnCodes ok -result center test config-4.91 {DoObjConfig - invalid anchor} -constraints testobjconfig -body { testobjconfig alltypes .foo -anchor foo -} -cleanup { +} -constraints needsTcl87 -cleanup { killTables } -returnCodes error -result {bad anchor "foo": must be n, ne, e, se, s, sw, w, nw, center, or ""} test config-4.92 {DoObjConfig - new anchor} -constraints testobjconfig -body { testobjconfig alltypes .foo -anchor e .foo configure -anchor n Index: tests/constraints.tcl ================================================================== --- tests/constraints.tcl +++ tests/constraints.tcl @@ -187,12 +187,17 @@ # [event generate $w $event -warp 1 ...] # # It takes care of the following timing details of pointer warping: # # a. Allow pointer warping to happen if it was scheduled for execution at - # idle time. This happens synchronously if $w refers to the - # whole screen or if the -when option to [event generate] is "now". + # idle time. + # - In Tk releases 8.6 and older, pointer warping is scheduled for + # execution at idle time + # - In release 8.7 and newer this happens synchronously if $w refers to the + # whole screen or if the -when option to [event generate] is "now". + # The namespace variable idle_pointer_warping records which of these is + # the case. # # b. Work around a race condition associated with OS notification of # mouse motion on Windows. # # When calling [event generate $w $event -warp 1 ...], the following @@ -231,39 +236,22 @@ # [controlPointerWarpTiming] doesn't ensure the new position of the pointer. # For example, when issued under Tk8.7+, if the value for the -when option # to [event generate $w] is not "now", and $w refers to a Tk window, i.e. not # the whole screen. # + variable idle_pointer_warping [expr {[package provide tk] != ""}] proc controlPointerWarpTiming {{duration 50}} { - update idletasks ;# see a. above + variable idle_pointer_warping + if {$idle_pointer_warping} { + update idletasks ;# see a. above + } if {[tk windowingsystem] eq "win32"} { after $duration ;# see b. above } } namespace export controlPointerWarpTiming - # On macOS windows are not allowed to overlap the menubar at the top of the - # screen or the dock. So tests which move a window and then check whether it - # got moved to the requested location should use a y coordinate larger than the - # height of the menubar (normally 23 pixels) and an x coordinate larger than the - # width of the dock, if it happens to be on the left. - # menubarheight deals with this issue but may not be available from the test - # environment, therefore provide a fallback here - if {[llength [info procs menubarheight]] == 0} { - if {[tk windowingsystem] ne "aqua"} { - # Windows may overlap the menubar - proc menubarheight {} { - return 0 - } - } else { - # Windows may not overlap the menubar - proc menubarheight {} { - return 30 ; # arbitrary value known to be larger than the menubar height - } - } - namespace export menubarheight - } } } namespace import -force tk::test::* @@ -283,18 +271,20 @@ testConstraint haveDISPLAY [expr {[info exists env(DISPLAY)] && [testConstraint x11]}] testConstraint altDisplay [info exists env(TK_ALT_DISPLAY)] testConstraint noExceed [expr { ![testConstraint unix] || [catch {font actual "\{xyz"}] }] -testConstraint deprecated [expr {![::tk::build-info no-deprecate]}] +testConstraint deprecated [expr {![package vsatisfies [package provide Tcl] 8.7-] || ![::tk::build-info no-deprecate]}] +testConstraint needsTcl87 [package vsatisfies [package provide Tcl] 8.7-] # constraint for running a test on all windowing system except aqua # where the test fails due to a known bug testConstraint aquaKnownBug [expr {[testConstraint notAqua] || [testConstraint knownBug]}] # constraints for testing facilities defined in the tktest executable... testConstraint testImageType [expr {"test" in [image types]}] +testConstraint testOldImageType [expr {"oldtest" in [image types]}] testConstraint testbitmap [llength [info commands testbitmap]] testConstraint testborder [llength [info commands testborder]] testConstraint testcbind [llength [info commands testcbind]] testConstraint testclipboard [llength [info commands testclipboard]] testConstraint testcolor [llength [info commands testcolor]] Index: tests/entry.test ================================================================== --- tests/entry.test +++ tests/entry.test @@ -12,32 +12,32 @@ tcltest::loadTestedCommands # For xscrollcommand set scrollInfo {} proc scroll args { - global scrollInfo - set scrollInfo $args + global scrollInfo + set scrollInfo $args } # For trace add variable proc override args { - global x - set x 12345 + global x + set x 12345 } # 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 + 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 + 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 + set ::vVals [list $W $d $i $P $s $S $v $V] + return 0 } set cy [font metrics {Courier -12} -linespace] @@ -108,11 +108,11 @@ } -body { .e configure -borderwidth 1.3 .e cget -borderwidth } -cleanup { destroy .e -} -result 1.3 +} -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 idletasks update } -body { @@ -358,11 +358,11 @@ } -body { .e configure -insertborderwidth 1.3 .e cget -insertborderwidth } -cleanup { destroy .e -} -result 1.3 +} -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 idletasks update } -body { @@ -511,11 +511,11 @@ } -body { .e configure -selectborderwidth 1.3 .e cget -selectborderwidth } -cleanup { destroy .e -} -result 1.3 +} -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 idletasks update } -body { @@ -3530,11 +3530,11 @@ entry .e -textvariable ::test::foo namespace delete test set ::test::foo } -cleanup { destroy .e -} -returnCodes error -result {can't read "::test::foo": no such variable} +} -match glob -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 catch {.e insert end "more stuff"} result1 @@ -3541,14 +3541,14 @@ catch {.e delete 5 end } result2 catch {set ::test::foo} result3 list [.e get] [.e cget -textvar] $result1 $result2 $result3 } -cleanup { destroy .e -} -result [list "a bmo" ::test::foo \ - {can't set "::test::foo": parent namespace doesn't exist} \ - {can't set "::test::foo": parent namespace doesn't exist} \ - {can't read "::test::foo": no such variable}] +} -match glob -result [list "a bmo" ::test::foo \ + {can*t set "::test::foo": parent namespace does*t exist} \ + {can*t set "::test::foo": parent namespace does*t exist} \ + {can*t read "::test::foo": no such variable}] test entry-23.1 {error in trace proc attached to the textvariable} -setup { destroy .e } -body { trace add variable myvar write traceit @@ -3557,21 +3557,21 @@ catch {.e insert end mystring} result1 catch {.e delete 0} result2 list $result1 $result2 } -cleanup { destroy .e -} -result [list {can't set "myvar": Intentional error here!} \ - {can't set "myvar": Intentional error here!}] +} -match glob -result [list {ca*t set "myvar": Intentional error here!} \ + {can*t set "myvar": Intentional error here!}] test entry-24.1 {textvariable lives in a non-existing namespace} -setup { destroy .e } -body { catch {entry .e -textvariable thisnsdoesntexist::myvar} result1 set result1 } -cleanup { destroy .e -} -result {can't trace "thisnsdoesntexist::myvar": parent namespace doesn't exist} +} -match glob -result {can*t trace "thisnsdoesntexist::myvar": parent namespace does*t exist} test entry-25.1 {Bug [5d991b822e]} { # Want this not to segfault, or write to variable with empty name set var INIT entry .b -textvariable var Index: tests/event.test ================================================================== --- tests/event.test +++ tests/event.test @@ -822,34 +822,26 @@ wm geometry . 200x200+300+300 wm deiconify . _pause 200 toplevel .top2 -width 200 -height 200 wm geometry .top2 +[expr {[winfo rootx .]+50}]+[expr {[winfo rooty .]+50}] - update idletasks + _pause 200 wm deiconify .top2 - update idletasks raise .top2 _pause 400 event generate .top2 -warp 1 -x 50 -y 50 _pause 100 bind . {lappend res %W} set res [list ] destroy .top2 - update idletasks _pause 200 set res } -cleanup { deleteWindows bind . $EnterBind } -result {.} - -# This test fails sporadically when run on the macOS CI runner. It does -# not seem to fail on real computers. It is not needed since the same -# thing is tested by 9.13. So it is simpler to constrain it as notAqua. -test event-9.2 {enter toplevel window by destroying a toplevel - bug b1d115fa60} \ --constraints { notAqua} \ --setup { +test event-9.2 {enter toplevel window by destroying a toplevel - bug b1d115fa60} -setup { set iconified false if {[winfo ismapped .]} { wm iconify . update set iconified true @@ -858,14 +850,14 @@ toplevel .top1 wm geometry .top1 200x200+300+300 wm deiconify .top1 _pause 200 toplevel .top2 -width 200 -height 200 + _pause 200 wm geometry .top2 +[expr {[winfo rootx .top1]+50}]+[expr {[winfo rooty .top1]+50}] _pause 200 wm deiconify .top2 - update idletasks raise .top2 _pause 400 event generate .top2 -warp 1 -x 50 -y 50 _pause 100 bind .top1 {lappend res %W} Index: tests/frame.test ================================================================== --- tests/frame.test +++ tests/frame.test @@ -211,11 +211,11 @@ test frame-1.19 {frame configuration options} -body { .f configure -borderwidth 1.3 lindex [.f configure -borderwidth] 4 } -cleanup { .f configure -borderwidth [lindex [.f configure -borderwidth] 3] -} -result 1.3 +} -result 1 test frame-1.20 {frame configuration options} -body { .f configure -borderwidth badValue } -returnCodes error -result {expected screen distance but got "badValue"} test frame-1.21 {frame configuration options} -body { .f configure -cursor arrow @@ -512,11 +512,11 @@ .t configure -bg non-existent } -returnCodes error -result {unknown color name "non-existent"} test frame-2.26 {toplevel configuration options} -body { .t configure -borderwidth 1.3 lindex [.t configure -borderwidth] 4 -} -result 1.3 +} -result 1 test frame-2.27 {toplevel configuration options} -body { .t configure -borderwidth badValue } -returnCodes error -result {expected screen distance but got "badValue"} test frame-2.28 {toplevel configuration options} -body { .t configure -cursor arrow @@ -1246,11 +1246,11 @@ test frame-13.16 {labelframe configuration options} -body { .f configure -borderwidth 1.3 lindex [.f configure -borderwidth] 4 } -cleanup { .f configure -borderwidth [lindex [.f configure -borderwidth] 3] -} -result 1.3 +} -result 1 test frame-13.17 {labelframe configuration options} -body { .f configure -borderwidth badValue } -returnCodes error -result {expected screen distance but got "badValue"} test frame-13.18 {labelframe configuration options} -body { .f configure -cursor arrow Index: tests/image.test ================================================================== --- tests/image.test +++ tests/image.test @@ -280,10 +280,34 @@ image delete myimage image type myimage } -cleanup { imageCleanup } -returnCodes error -result {image "myimage" does not exist} +test image-5.6 {Tk_ImageCmd procedure, "type" option} -constraints { + testOldImageType +} -setup { + imageCleanup +} -body { + image create oldtest myimage + image type myimage +} -cleanup { + imageCleanup +} -result {oldtest} +test image-5.7 {Tk_ImageCmd procedure, "type" option} -constraints { + testOldImageType +} -setup { + .c delete all + imageCleanup +} -body { + image create oldtest myimage + .c create image 50 50 -image myimage + image delete myimage + image type myimage +} -cleanup { + .c delete all + imageCleanup +} -returnCodes error -result {image "myimage" does not exist} test image-6.1 {Tk_ImageCmd procedure, "types" option} -constraints { testImageType } -body { @@ -550,10 +574,36 @@ .c create image 90 100 -image foo -tags i2 set x {} image delete foo lappend x | [imageNames] | [catch {image delete foo} msg] | $msg | [imageNames] | } -cleanup { + imageCleanup +} -result {{foo free} {foo free} {foo delete} | {} | 1 | {image "foo" does not exist} | {} |} + +test image-13.3 {Tk_SizeOfImage procedure} -constraints testOldImageType -setup { + imageCleanup +} -body { + image create oldtest foo -variable x + set result [list [image width foo] [image height foo]] + foo changed 0 0 0 0 85 60 + lappend result [image width foo] [image height foo] +} -cleanup { + imageCleanup +} -result {30 15 85 60} + +test image-13.4 {DeleteImage procedure} -constraints testOldImageType -setup { + .c delete all + imageCleanup +} -body { + image create oldtest foo -variable x + .c create image 50 50 -image foo -tags i1 + .c create image 90 100 -image foo -tags i2 + set x {} + image delete foo + lappend x | [imageNames] | [catch {image delete foo} msg] | $msg | [imageNames] | +} -cleanup { + .c delete all imageCleanup } -result {{foo free} {foo free} {foo delete} | {} | 1 | {image "foo" does not exist} | {} |} test image-14.1 {image command vs hidden commands} -body { catch {image delete hidden} Index: tests/imgPPM.test ================================================================== --- tests/imgPPM.test +++ tests/imgPPM.test @@ -54,24 +54,25 @@ put test.ppm "P6\n5 4\n255\n01234567890123456789012345678901234567890123456789012345678" image create photo p1 -file test.ppm } -returnCodes error -result {error reading PPM image file "test.ppm": not enough data} test imgPPM-1.9 {FileReadPPM procedure} -body { put test.ppm "P6\n5 4\n150\n012345678901234567890123456789012345678901234567890123456789" - list [image create photo p1 -file test.ppm] [image width p1] [image height p1] + list [image create photo p1 -file test.ppm] \ + [image width p1] [image height p1] } -returnCodes ok -result {p1 5 4} test imgPPM-2.1 {FileWritePPM procedure} -setup { catch {image delete p1} } -body { put test.ppm "P6\n5 4\n255\n012345678901234567890123456789012345678901234567890123456789" image create photo p1 -file test.ppm list [catch {p1 write not_a_dir/bar/baz/gorp} msg] [string tolower $msg] \ - [string tolower $errorCode] + [string tolower $errorCode] } -cleanup { image delete p1 -} -result {1 {couldn't open "not_a_dir/bar/baz/gorp": no such file or directory} {posix enoent {no such file or directory}}} +} -match glob -result {1 {c*t open "not_a_dir/bar/baz/gorp": no such file or directory} {posix enoent {no such file or directory}}} test imgPPM-2.2 {FileWritePPM procedure} -setup { catch {image delete p1} catch {unset data} } -body { Index: tests/imgPhoto.test ================================================================== --- tests/imgPhoto.test +++ tests/imgPhoto.test @@ -133,11 +133,11 @@ image delete photo1 } -result {79 83 79 83} test imgPhoto-1.2 {options for photo images} -body { list [catch {image create photo photo1 -file no.such.file} err] \ [string tolower $err] -} -result {1 {couldn't open "no.such.file": no such file or directory}} +} -match glob -result {1 {c*t open "no.such.file": no such file or directory}} test imgPhoto-1.3 {options for photo images} -body { image create photo photo1 -file $teapotPhotoFile -format no.such.format } -returnCodes error -result {image file format "no.such.format" is not supported} test imgPhoto-1.4 {options for photo images} -body { image create photo photo1 -file $teapotPhotoFile @@ -226,11 +226,11 @@ image create photo photo1 -file $teapotPhotoFile list [catch {photo1 configure -file bogus} err] [string tolower $err] \ [image width photo1] [image height photo1] } -cleanup { image delete photo1 -} -result {1 {couldn't open "bogus": no such file or directory} 256 256} +} -match glob -result {1 {c*t open "bogus": no such file or directory} 256 256} test imgPhoto-3.3 {ImgPhotoConfigureModel procedure} -setup { destroy .c pack [canvas .c] update } -body { @@ -545,11 +545,11 @@ image create photo photo1 } -body { list [catch {photo1 read bogus} err] [string tolower $err] } -cleanup { image delete photo1 -} -result {1 {couldn't open "bogus": no such file or directory}} +} -match glob -result {1 {c*t open "bogus": no such file or directory}} test imgPhoto-4.33 {ImgPhotoCmd procedure: read option} -setup { image create photo photo1 } -body { photo1 read $teapotPhotoFile -format bogus } -cleanup { Index: tests/imgSVGnano.test ================================================================== --- tests/imgSVGnano.test +++ tests/imgSVGnano.test @@ -206,11 +206,11 @@ tcltest::removeFile tmpplus.svg } -body { foo configure -format "svg -scale 2" } -cleanup { rename foo "" -} -returnCodes error -match glob -result {couldn't open "*/tmpplus.svg": no such file or directory} +} -returnCodes error -match glob -result {c*t open "*/tmpplus.svg": no such file or directory} # Special images test imgSVGnano-5.0 {image without any of "width", "height" and "viewbox"} -body { image create photo foo -data\ { -x 100 -y 100 @@ -4130,166 +4282,14 @@ after 4500 {set done true} tkwait variable done pressbutton 530 510 } -test menu-41.1 {identifiers - auto generated} -setup { - destroy .m -} -body { - menu .m - list [.m add command -label 1] [.m add command -label 2] [.m add command -label 3] -} -cleanup { - destroy .m -} -result {e001 e002 e003} -test menu-41.2 {identifiers - out of sequence} -setup { - destroy .m -} -body { - menu .m -tearoff 0 - .m add command -label 1 - .m insert 0 command -label 2 - .m add command -label 3 - list [.m index e001] [.m index e002] [.m index e003] -} -cleanup { - destroy .m -} -result {1 0 2} -test menu-41.3 {identifiers - out of sequence with tearoff} -setup { - destroy .m -} -body { - menu .m -tearoff 1 - .m add command -label 1 - .m insert 0 command -label 2 - .m add command -label 3 - list [.m index e001] [.m index e002] [.m index e003] -} -cleanup { - destroy .m -} -result {2 1 3} -test menu-41.4 {identifiers - entry id} -setup { - destroy .m -} -body { - menu .m -tearoff 1 - .m add command -label 1 - .m insert 0 command -label 2 - .m add command -label 3 - list [.m id 0] [.m id 1] [.m id 2] [.m id 3] -} -cleanup { - destroy .m -} -result {{} e002 e001 e003} -test menu-41.5 {identifiers - assigned} -setup { - destroy .m -} -body { - menu .m - list [.m add command cmd1 -label 1] [.m insert 0 command cmd2 -label 2] [.m add command cmd3 -label 3] -} -cleanup { - destroy .m -} -result {cmd1 cmd2 cmd3} -test menu-41.6 {identifiers - mixed} -setup { - destroy .m -} -body { - menu .m - list [.m add command -label 1] [.m insert 0 command cmd2 -label 2] [.m add command -label 3] -} -cleanup { - destroy .m -} -result {e001 cmd2 e002} -test menu-41.7 {identifiers - conflict} -setup { - destroy .m -} -body { - menu .m - list [.m add command e002 -label 1] [.m add command -label 2] [.m add command -label 3] -} -cleanup { - destroy .m -} -result {e002 e001 e003} -test menu-41.8 {identifiers - clone of complete menu} -setup { - destroy .m1 .m2 -} -body { - menu .m1 -tearoff 0 - .m1 add command -label 1 - .m1 insert 0 command -label 2 - .m1 add command cmd3 -label 3 - .m1 clone .m2 - list [.m2 index e001] [.m2 index e002] [.m2 index cmd3] -} -cleanup { - destroy .m1 .m2 -} -result {1 0 2} -test menu-41.9 {identifiers - modify after cloning} -setup { - destroy .m1 .m2 -} -body { - menu .m1 -tearoff 0 - .m1 clone .m2 - .m1 add command -label 1 - .m1 insert 0 command -label 2 - .m1 add command cmd3 -label 3 - list [.m2 index e001] [.m2 index e002] [.m2 index cmd3] -} -cleanup { - destroy .m1 .m2 -} -result {1 0 2} -test menu-41.10 {identifiers - modify clone} -setup { - destroy .m1 .m2 -} -body { - menu .m1 -tearoff 0 - .m1 clone .m2 - .m2 add command -label 1 - .m2 insert 0 command -label 2 - .m2 add command cmd3 -label 3 - list [.m1 index e001] [.m1 index e002] [.m1 index cmd3] -} -cleanup { - destroy .m1 .m2 -} -result {1 0 2} -test menu-41.11 {identifiers - entrycget by id} -setup { - destroy .m -} -body { - menu .m - .m add command -label 1 - .m add command -label 2 - .m add command cmd3 -label 3 - list [.m entrycget e001 -label] [.m entrycget e002 -label] [.m entrycget cmd3 -label] -} -cleanup { - destroy .m -} -result {1 2 3} -test menu-41.12 {identifiers - delete by id} -setup { - destroy .m -} -body { - menu .m - .m add command -label 1 - .m add command -label 2 - .m add command -label 3 - .m add command -label 4 - .m add command -label 5 - .m add command -label 6 - .m add command -label 7 - .m add command cmd8 -label 8 - .m add command cmd9 -label 9 - .m delete e003 cmd8 - list [.m id 0] [.m id 1] [.m id 2] -} -cleanup { - destroy .m -} -result {e001 e002 cmd9} -test menu-41.13 {identifiers - duplicate} -setup { - destroy .m -} -body { - menu .m - .m add command foo -label 1 - .m add command bar -label 2 - .m add command foo -label 3 -} -cleanup { - destroy .m -} -returnCodes error -result {entry "foo" already exists} -test menu-41.14 {identifiers - reserved word} -setup { - destroy .m -} -body { - menu .m -tearoff 0 - .m add command last -label 1 - .m add command -label 2 - .m add command -label 3 - .m index last -} -cleanup { - destroy .m -} -result {2} - # cleanup imageFinish deleteWindows cleanupTests return # Local variables: # mode: tcl # End: Index: tests/menuDraw.test ================================================================== --- tests/menuDraw.test +++ tests/menuDraw.test @@ -556,11 +556,11 @@ deleteWindows } -body { menu .m1 .m1 add command -label "foo" -state active set tearoff [tk::TearOffMenu .m1 40 40] - expr {[$tearoff index active]<0} + expr {[$tearoff index active] in [list {} none]} } -cleanup { deleteWindows } -result 1 test menuDraw-15.3 {TkPostTearoffMenu - post command} -setup { deleteWindows Index: tests/menubut.test ================================================================== --- tests/menubut.test +++ tests/menubut.test @@ -96,11 +96,11 @@ test menubutton-1.15 {configuration options} -body { .mb configure -borderwidth 1.3 .mb cget -borderwidth } -cleanup { .mb configure -borderwidth [lindex [.mb configure -borderwidth] 3] -} -result 1.3 +} -result 1 test menubutton-1.16 {configuration options} -body { .mb configure -borderwidth badValue } -returnCodes error -result {expected screen distance but got "badValue"} test menubutton-1.17 {configuration options} -body { .mb configure -cursor arrow Index: tests/message.test ================================================================== --- tests/message.test +++ tests/message.test @@ -119,11 +119,11 @@ } -body { .m configure -borderwidth 1.3 .m cget -borderwidth } -cleanup { destroy .m -} -result 1.3 +} -result 1 test message-1.12 {configuration option: "borderwidth"} -setup { message .m -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} pack .m update } -body { @@ -400,11 +400,11 @@ } -body { .m configure -padx -2 -pady -2 -width -2 list [.m cget -padx] [.m cget -pady] [.m cget -borderwidth] [.m cget -highlightthickness] [.m cget -width] } -cleanup { destroy .m -} -result {{} {} 0 0 0} +} -result {-1 -1 0 0 0} test message-2.1 {Tk_MessageObjCmd procedure} -body { message } -returnCodes error -result {wrong # args: should be "message pathName ?-option value ...?"} Index: tests/panedwindow.test ================================================================== --- tests/panedwindow.test +++ tests/panedwindow.test @@ -47,11 +47,11 @@ test panedwindow-1.7 {configuration options: -borderwidth (good)} -body { .p configure -borderwidth 1.3 list [lindex [.p configure -borderwidth] 4] [.p cget -borderwidth] } -cleanup { .p configure -borderwidth [lindex [.p configure -borderwidth] 3] -} -result {1.3 1.3} +} -result {1 1} test panedwindow-1.8 {configuration options: -borderwidth (bad)} -body { .p configure -borderwidth badValue } -returnCodes error -result {expected screen distance but got "badValue"} test panedwindow-1.9 {configuration options: -cursor (good)} -body { .p configure -cursor arrow @@ -120,11 +120,11 @@ .p configure -proxyrelief groove list [lindex [.p configure -proxyrelief] 4] [.p cget -proxyrelief] } -cleanup { .p configure -proxyrelief [lindex [.p configure -proxyrelief] 3] } -result {groove groove} -test panedwindow-1.24 {configuration options: -proxyrelief (bad)} -body { +test panedwindow-1.24 {configuration options: -proxyrelief (bad)} -constraints needsTcl87 -body { .p configure -proxyrelief 1.5 } -returnCodes error -result {bad relief "1.5": must be flat, groove, raised, ridge, solid, sunken, or ""} test panedwindow-1.25 {configuration options: -relief (good)} -body { .p configure -relief groove list [lindex [.p configure -relief] 4] [.p cget -relief] @@ -146,11 +146,11 @@ test panedwindow-1.29 {configuration options: -sashpad (good)} -body { .p configure -sashpad 1.3 list [lindex [.p configure -sashpad] 4] [.p cget -sashpad] } -cleanup { .p configure -sashpad [lindex [.p configure -sashpad] 3] -} -result {1.3 1.3} +} -result {1 1} test panedwindow-1.30 {configuration options: -sashpad (bad)} -body { .p configure -sashpad badValue } -returnCodes error -result {expected screen distance but got "badValue"} test panedwindow-1.31 {configuration options: -sashrelief (good)} -body { .p configure -sashrelief groove @@ -243,21 +243,21 @@ .p paneconfigure .b -padx 1.3 list [lindex [.p paneconfigure .b -padx] 4] \ [.p panecget .b -padx] } -cleanup { .p paneconfig .b -padx [lindex [.p paneconfig .b -padx] 3] -} -result {1.3 1.3} +} -result {1 1} test panedwindow-1.50 {configuration options: -padx (bad)} -body { .p paneconfigure .b -padx badValue } -returnCodes error -result {expected screen distance but got "badValue"} test panedwindow-1.51 {configuration options: -pady (good)} -body { .p paneconfigure .b -pady 1.3 list [lindex [.p paneconfigure .b -pady] 4] \ [.p panecget .b -pady] } -cleanup { .p paneconfig .b -pady [lindex [.p paneconfig .b -pady] 3] -} -result {1.3 1.3} +} -result {1 1} test panedwindow-1.52 {configuration options: -pady (bad)} -body { .p paneconfigure .b -pady badValue } -returnCodes error -result {expected screen distance but got "badValue"} test panedwindow-1.53 {configuration options: -sticky (good)} -body { .p paneconfigure .b -sticky nsew @@ -4570,11 +4570,11 @@ } -body { panedwindow .p .p add .p } -cleanup { deleteWindows -} -returnCodes error -result {cannot add .p to itself} +} -returnCodes error -result {can't add .p to itself} test panedwindow-23.2 {ConfigurePanes, bad window throws error} -setup { deleteWindows } -body { panedwindow .p .p add .b @@ -4861,21 +4861,21 @@ panedwindow .p toplevel .t .p add .t } -cleanup { deleteWindows -} -returnCodes error -result {cannot add toplevel .t to .p} +} -returnCodes error -result {can't add toplevel .t to .p} test panedwindow-23.25 {ConfigurePanes, restrict possible panes} -setup { deleteWindows } -body { panedwindow .p frame .f button .f.b .p add .f.b } -cleanup { deleteWindows -} -returnCodes error -result {cannot add .f.b to .p} +} -returnCodes error -result {can't add .f.b to .p} test panedwindow-23.26 {ConfigurePanes, restrict possible panes} -setup { deleteWindows } -body { frame .f panedwindow .f.p Index: tests/scale.test ================================================================== --- tests/scale.test +++ tests/scale.test @@ -71,11 +71,11 @@ test scale-1.11 {configuration options} -body { .s configure -borderwidth 1.3 .s cget -borderwidth } -cleanup { .s configure -borderwidth [lindex [.s configure -borderwidth] 3] -} -result 1.3 +} -result 1 test scale-1.12 {configuration options} -body { .s configure -borderwidth badValue } -returnCodes error -result {expected screen distance but got "badValue"} test scale-1.13 {configuration options} -body { .s configure -command {set x} @@ -1243,11 +1243,11 @@ scale .s -from -200 -to 0 -variable y -orient horizontal -length 150 pack .s set y 40q } -cleanup { deleteWindows -} -returnCodes error -result {can't set "y": cannot assign a non-numeric value to a scale variable} +} -returnCodes error -match glob -result {can*t set "y": cannot assign a non-numeric value to a scale variable} test scale-15.4 {ScaleVarProc procedure} -setup { deleteWindows } -body { set y -130 scale .s -from -200 -to 0 -variable y -orient horizontal -length 150 @@ -1264,11 +1264,11 @@ scale .s -from 1 -to 0 -variable y -orient horizontal -length 150 pack .s set y x } -cleanup { deleteWindows -} -returnCodes error -result {can't set "y": cannot assign a non-numeric value to a scale variable} +} -returnCodes error -match glob -result {can*t set "y": cannot assign a non-numeric value to a scale variable} test scale-15.6 {ScaleVarProc procedure} -setup { deleteWindows } -body { set y 1 scale .s -from 1 -to 0 -variable y -orient horizontal -length 150 Index: tests/scrollbar.test ================================================================== --- tests/scrollbar.test +++ tests/scrollbar.test @@ -76,13 +76,13 @@ {-background #ff0000 #ff0000 non-existent {unknown color name "non-existent"}} {-bd 4 4 badValue {expected screen distance but got "badValue"}} {-bg #ff0000 #ff0000 non-existent {unknown color name "non-existent"}} - {-borderwidth 1.3 1.3 badValue {expected screen distance but got "badValue"}} + {-borderwidth 1.3 1 badValue {expected screen distance but got "badValue"}} {-command "set x" {set x} {} {}} - {-elementborderwidth 4 4 badValue {expected screen distance but got "badValue"}} + {-elementborderwidth 4 4 badValue {expected screen distance or "" but got "badValue"}} {-cursor arrow arrow badValue {bad cursor spec "badValue"}} {-highlightbackground #112233 #112233 ugly {unknown color name "ugly"}} {-highlightcolor #123456 #123456 bogus {unknown color name "bogus"}} {-highlightthickness 6 6 bogus {expected screen distance but got "bogus"}} {-highlightthickness -2 0 {} {}} @@ -314,10 +314,14 @@ } 0 destroy .t test scrollbar-3.43 {ScrollbarWidgetCmd procedure, "get" option} { list [catch {.s get a} msg] $msg } {1 {wrong # args: should be ".s get"}} +test scrollbar-3.44 {ScrollbarWidgetCmd procedure, "get" option} {deprecated needsTcl87} { + .s set 100 10 13 14 + .s get +} {100 10 13 14} test scrollbar-3.45 {ScrollbarWidgetCmd procedure, "get" option} { .s set 0.6 0.8 set result {} foreach element [.s get] { lappend result [format %.1f $element] @@ -395,10 +399,34 @@ foreach element [.s get] { lappend result [format %.1f $element] } set result } {0.4 0.4} +test scrollbar-3.64 {ScrollbarWidgetCmd procedure, "set" option} {deprecated needsTcl87} { + list [catch {.s set abc def ghi jkl} msg] $msg +} {1 {expected integer but got "abc"}} +test scrollbar-3.65 {ScrollbarWidgetCmd procedure, "set" option} {deprecated needsTcl87} { + list [catch {.s set 1 def ghi jkl} msg] $msg +} {1 {expected integer but got "def"}} +test scrollbar-3.66 {ScrollbarWidgetCmd procedure, "set" option} {deprecated needsTcl87} { + list [catch {.s set 1 2 ghi jkl} msg] $msg +} {1 {expected integer but got "ghi"}} +test scrollbar-3.67 {ScrollbarWidgetCmd procedure, "set" option} {deprecated needsTcl87} { + list [catch {.s set 1 2 3 jkl} msg] $msg +} {1 {expected integer but got "jkl"}} +test scrollbar-3.68 {ScrollbarWidgetCmd procedure, "set" option} {deprecated needsTcl87} { + .s set -10 50 20 30 + .s get +} {0 50 0 0} +test scrollbar-3.69 {ScrollbarWidgetCmd procedure, "set" option} {deprecated needsTcl87} { + .s set 100 -10 20 30 + .s get +} {100 0 20 30} +test scrollbar-3.70 {ScrollbarWidgetCmd procedure, "set" option} {deprecated needsTcl87} { + .s set 100 50 30 20 + .s get +} {100 50 30 30} test scrollbar-3.71 {ScrollbarWidgetCmd procedure, "set" option} { list [catch {.s set 1 2 3} msg] $msg } {1 {wrong # args: should be ".s set firstFraction lastFraction"}} test scrollbar-3.72 {ScrollbarWidgetCmd procedure, "set" option} { list [catch {.s set 1 2 3 4 5} msg] $msg Index: tests/spinbox.test ================================================================== --- tests/spinbox.test +++ tests/spinbox.test @@ -12,71 +12,71 @@ tcltest::loadTestedCommands # For xscrollcommand set scrollInfo {} proc scroll args { - global scrollInfo - set scrollInfo $args + global scrollInfo + set scrollInfo $args } # For trace add variable proc override args { - global x - set x 12345 + global x + set x 12345 } # 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 + 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 + 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 + set ::vVals [list $W $d $i $P $s $S $v $V] + return 0 } 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 + 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 + 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 + 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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -background non-existent @@ -83,11 +83,11 @@ } -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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -bd 4 @@ -94,11 +94,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -bd badValue @@ -105,11 +105,11 @@ } -cleanup { destroy .e } -returnCodes error -result {expected screen distance but got "badValue"} test spinbox-1.7 {configuration option: "bg"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -bg #ff0000 @@ -116,11 +116,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -bg non-existent @@ -127,22 +127,22 @@ } -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} \ + 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.3 +} -result 1 test spinbox-1.10 {configuration option: "borderwidth" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -borderwidth badValue @@ -149,11 +149,11 @@ } -cleanup { destroy .e } -returnCodes error -result {expected screen distance but got "badValue"} test spinbox-1.11 {configuration option: "buttonbackground"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -buttonbackground #ff0000 @@ -160,11 +160,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -buttonbackground non-existent @@ -171,11 +171,11 @@ } -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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -buttoncursor arrow @@ -182,11 +182,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -buttoncursor badValue @@ -193,11 +193,11 @@ } -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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -command {a command} @@ -205,11 +205,11 @@ } -cleanup { destroy .e } -result {a command} test spinbox-1.16 {configuration option: "cursor"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -cursor arrow @@ -216,11 +216,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -cursor badValue @@ -227,11 +227,11 @@ } -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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -disabledbackground green @@ -238,11 +238,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -disabledbackground non-existent @@ -249,11 +249,11 @@ } -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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -disabledforeground #110022 @@ -260,11 +260,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -disabledforeground bogus @@ -271,11 +271,11 @@ } -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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -exportselection yes @@ -282,11 +282,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -exportselection xyzzy @@ -293,11 +293,11 @@ } -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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -fg #110022 @@ -304,11 +304,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -fg bogus @@ -315,11 +315,11 @@ } -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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-* @@ -326,11 +326,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -font {} @@ -337,11 +337,11 @@ } -cleanup { destroy .e } -returnCodes error -result {font "" does not exist} test spinbox-1.28 {configuration option: "foreground"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -foreground #110022 @@ -348,11 +348,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -foreground bogus @@ -359,11 +359,11 @@ } -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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -format %0.5f @@ -370,11 +370,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -format %d @@ -381,11 +381,11 @@ } -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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -from -10 @@ -392,11 +392,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -from bogus @@ -403,11 +403,11 @@ } -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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -highlightbackground #123456 @@ -414,11 +414,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -highlightbackground ugly @@ -425,11 +425,11 @@ } -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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -highlightcolor #123456 @@ -436,11 +436,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -highlightcolor bogus @@ -447,11 +447,11 @@ } -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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -highlightthickness 6 @@ -458,11 +458,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -highlightthickness bogus @@ -469,11 +469,11 @@ } -cleanup { destroy .e } -returnCodes error -result {expected screen distance but got "bogus"} test spinbox-1.40 {configuration option: "highlightthickness"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -highlightthickness -2 @@ -481,11 +481,11 @@ } -cleanup { destroy .e } -result 0 test spinbox-1.41 {configuration option: "increment"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -increment 1.0 @@ -492,11 +492,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -increment bogus @@ -503,11 +503,11 @@ } -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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -insertbackground #110022 @@ -514,11 +514,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -insertbackground bogus @@ -525,22 +525,22 @@ } -cleanup { destroy .e } -returnCodes error -result {unknown color name "bogus"} test spinbox-1.45 {configuration option: "insertborderwidth"} -setup { - spinbox .e -borderwidth 2 -insertwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + spinbox .e -borderwidth 2 -insertwidth 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.3 +} -result 1 test spinbox-1.46 {configuration option: "insertborderwidth" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -insertborderwidth 2.6x @@ -547,11 +547,11 @@ } -cleanup { destroy .e } -returnCodes error -result {expected screen distance but got "2.6x"} test spinbox-1.47 {configuration option: "insertofftime"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -insertofftime 100 @@ -558,11 +558,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -insertofftime 3.2 @@ -569,11 +569,11 @@ } -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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -insertontime 100 @@ -580,11 +580,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -insertontime 3.2 @@ -591,11 +591,11 @@ } -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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -invalidcommand "a command" @@ -603,11 +603,11 @@ } -cleanup { destroy .e } -result {a command} test spinbox-1.52 {configuration option: "invcmd"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -invcmd "a command" @@ -615,11 +615,11 @@ } -cleanup { destroy .e } -result {a command} test spinbox-1.53 {configuration option: "justify"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -justify right @@ -626,11 +626,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -justify bogus @@ -637,11 +637,11 @@ } -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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -readonlybackground green @@ -648,11 +648,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -readonlybackground non-existent @@ -659,11 +659,11 @@ } -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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -relief groove @@ -670,11 +670,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -relief 1.5 @@ -681,11 +681,11 @@ } -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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -repeatdelay 500 @@ -692,11 +692,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -repeatdelay 3p @@ -703,11 +703,11 @@ } -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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -repeatinterval -500 @@ -714,11 +714,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -repeatinterval 3p @@ -725,11 +725,11 @@ } -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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -selectbackground #110022 @@ -736,11 +736,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -selectbackground bogus @@ -747,22 +747,22 @@ } -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} \ + 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.3 +} -result 1 test spinbox-1.66 {configuration option: "selectborderwidth" for spinbox} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -selectborderwidth badValue @@ -769,11 +769,11 @@ } -cleanup { destroy .e } -returnCodes error -result {expected screen distance but got "badValue"} test spinbox-1.67 {configuration option: "selectforeground"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -selectforeground #654321 @@ -780,11 +780,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -selectforeground bogus @@ -791,11 +791,11 @@ } -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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -state n @@ -802,11 +802,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -state bogus @@ -813,11 +813,11 @@ } -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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -takefocus "any string" @@ -825,11 +825,11 @@ } -cleanup { destroy .e } -result {any string} test spinbox-1.72 {configuration option: "textvariable"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -textvariable i @@ -837,11 +837,11 @@ } -cleanup { destroy .e } -result {i} test spinbox-1.73 {configuration option: "to"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -to 14.9 @@ -848,11 +848,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -to bogus @@ -859,11 +859,11 @@ } -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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -validate "key" @@ -870,11 +870,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -validate "bogus" @@ -881,11 +881,11 @@ } -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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -validatecommand "a command" @@ -893,11 +893,11 @@ } -cleanup { destroy .e } -result {a command} test spinbox-1.78 {configuration option: "values"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -values {mon tue wed thur} @@ -904,11 +904,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -values {bad {}list} @@ -915,11 +915,11 @@ } -cleanup { destroy .e } -returnCodes error -result {list element in braces followed by "list" instead of space} test spinbox-1.80 {configuration option: "validatecommand"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -validatecommand "a command" @@ -927,11 +927,11 @@ } -cleanup { destroy .e } -result {a command} test spinbox-1.81 {configuration option: "width"} -setup { - spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -width 402 @@ -938,11 +938,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -width 3p @@ -949,11 +949,11 @@ } -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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -wrap yes @@ -960,11 +960,11 @@ .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} \ + spinbox .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12} \ -relief sunken pack .e update } -body { .e configure -wrap xyzzy @@ -2896,11 +2896,11 @@ test spinbox-13.10 {GetSpinboxIndex procedure} -constraints x11 -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 + 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 @@ -2916,15 +2916,15 @@ test spinbox-13.11 {GetSpinboxIndex procedure} -constraints aquaOrWin32 -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 + 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 @@ -2934,15 +2934,15 @@ destroy .e } -result 1 test spinbox-13.12 {GetSpinboxIndex procedure} -constraints x11 -body { # Previous settings: - spinbox .e -font {Courier -12} -width 5 -bd 2 -relief sunken - pack .e - .e insert 0 012345678901234567890 - .e xview 4 - update + 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 @@ -2951,15 +2951,15 @@ destroy .e } -returnCodes error -result {selection isn't in widget .e} test spinbox-13.12.1 {GetSpinboxIndex 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 + 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 @@ -2968,15 +2968,15 @@ destroy .e } -returnCodes error -result {bad spinbox index "bogus"} test spinbox-13.13 {GetSpinboxIndex 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 + 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 @@ -2988,15 +2988,15 @@ test spinbox-13.14 {GetSpinboxIndex 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 + 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 @@ -3008,15 +3008,15 @@ test spinbox-13.14.1 {GetSpinboxIndex 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 + 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 @@ -3873,23 +3873,23 @@ catch {.s delete 0} result3 catch {.s invoke buttonup} result4 list $result1 $result2 $result3 $result4 } -cleanup { destroy .s -} -result [list {can't set "myvar": Intentional error here!} \ - {can't set "myvar": Intentional error here!} \ - {can't set "myvar": Intentional error here!} \ - {can't set "myvar": Intentional error here!}] +} -match glob -result [list {can*t set "myvar": Intentional error here!} \ + {can*t set "myvar": Intentional error here!} \ + {can*t set "myvar": Intentional error here!} \ + {can*t set "myvar": Intentional error here!}] test spinbox-25.1 {textvariable lives in a non-existing namespace} -setup { destroy .s } -body { catch {spinbox .s -textvariable thisnsdoesntexist::myvar} result1 set result1 } -cleanup { destroy .s -} -result {can't trace "thisnsdoesntexist::myvar": parent namespace doesn't exist} +} -match glob -result {can*t trace "thisnsdoesntexist::myvar": parent namespace does*t exist} test spinbox-25.3 {Bugs [2a32225cd1] and [9fa3e08243]} -setup { destroy .s pack [spinbox .s] update set res {} Index: tests/text.test ================================================================== --- tests/text.test +++ tests/text.test @@ -415,11 +415,11 @@ } -body { .t configure -insertwidth 2.3 .t cget -insertwidth } -cleanup { destroy .t -} -result 2.3 +} -result 2 test text-1.42 {configuration option: "insertwidth"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t update } -body { @@ -462,11 +462,11 @@ } -body { .t configure -padx 3.4 .t cget -padx } -cleanup { destroy .t -} -result 3.4 +} -result 3 test text-1.46 {configuration option: "padx"} -setup { text .t -borderwidth 2 -highlightthickness 2 -font {Courier -12 bold} pack .t update } -body { @@ -3376,22 +3376,22 @@ destroy .t } -result {17 #332211 #abc} test text-14.10 {ConfigureText procedure} -setup { text .t -font {Courier -12} -borderwidth 2 -highlightthickness 2 } -body { - .t configure -selectborderwidth 0 + .t configure -selectborderwidth {} .t tag cget sel -borderwidth } -cleanup { destroy .t -} -result 0 +} -result {} test text-14.11 {ConfigureText procedure} -setup { text .t } -body { .t configure -selectborderwidth foo } -cleanup { destroy .t -} -returnCodes error -result {expected screen distance but got "foo"} +} -returnCodes error -result {expected screen distance or "" but got "foo"} test text-14.12 {ConfigureText procedure} -body { text .t entry .t.e .t.e insert end abcdefg .t.e select from 0 @@ -4180,11 +4180,11 @@ text .t .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx" .t search -regexp a( 1.0 } -cleanup { destroy .t -} -returnCodes error -result {cannot compile regular expression pattern: parentheses () not balanced} +} -returnCodes error -match glob -result {*t compile regular expression pattern: parentheses () not balanced} test text-22.23 {TextSearchCmd procedure, skip dummy last line} -body { text .t .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx" .t search -backwards BaR end 1.0 } -cleanup { @@ -4484,11 +4484,11 @@ .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx" set a 44 .t search -count a(2) xyz 1.0 } -cleanup { destroy .t -} -returnCodes error -result {can't set "a(2)": variable isn't array} +} -returnCodes error -match glob -result {can*t set "a(2)": variable is* array} test text-22.57 {TextSearchCmd procedure, wrap-around} -body { text .t .t insert end "xxyz xyz x. the\nfoo -forward bar xxxxx BaR foo\nxyz xxyzx" .t search -backwards xyz 1.1 } -cleanup { Index: tests/textImage.test ================================================================== --- tests/textImage.test +++ tests/textImage.test @@ -204,11 +204,11 @@ .t image create end -image small .t image configure small } -cleanup { destroy .t image delete small -} -result {{-align {} {} center center} {-padx {} {} 0 {}} {-pady {} {} 0 {}} {-image {} {} {} small} {-name {} {} {} {}}} +} -result {{-align {} {} center center} {-padx {} {} 0 0} {-pady {} {} 0 0} {-image {} {} {} small} {-name {} {} {} {}}} test textImage-1.17 {basic cget options} -setup { destroy .t set result "" } -body { @@ -224,11 +224,11 @@ } return $result } -cleanup { destroy .t image delete small -} -result {align:center padx: pady: image:small name:} +} -result {align:center padx:0 pady:0 image:small name:} test textImage-1.18 {basic configure options} -setup { destroy .t set result "" } -body { Index: tests/textTag.test ================================================================== --- tests/textTag.test +++ tests/textTag.test @@ -111,11 +111,11 @@ .t tag configure x -justify left .t tag cget x -justify } -cleanup { .t tag configure x -justify [lindex [.t tag configure x -justify] 3] } -result {left} -test textTag-1.13 {configuration options, bug [026e2bb685]} -body { +test textTag-1.13 {configuration options, bug [026e2bb685]} -constraints needsTcl87 -body { .t tag configure x -justify right catch {.t tag configure x -justify middle} msg list $msg [.t tag configure x -justify] } -cleanup { .t tag configure x -justify [lindex [.t tag configure x -justify] 3] @@ -167,11 +167,11 @@ test textTag-1.20 {tag configuration options} -body { .t tag configure x -overstrike on .t tag cget x -overstrike } -cleanup { .t tag configure x -overstrike [lindex [.t tag configure x -overstrike] 3] -} -result 1 +} -result {on} test textTag-1.21 {configuration options} -body { .t tag configure x -overstrike stupid } -cleanup { .t tag configure x -overstrike [lindex [.t tag configure x -overstrike] 3] } -returnCodes error -result {expected boolean value or "" but got "stupid"} @@ -190,11 +190,11 @@ .t tag configure x -relief raised .t tag cget x -relief } -cleanup { .t tag configure x -relief [lindex [.t tag configure x -relief] 3] } -result {raised} -test textTag-1.23 {configuration options} -body { +test textTag-1.23 {configuration options} -constraints needsTcl87 -body { .t tag configure x -relief stupid } -cleanup { .t tag configure x -relief [lindex [.t tag configure x -relief] 3] } -returnCodes error -result {bad relief "stupid": must be flat, groove, raised, ridge, solid, sunken, or ""} test textTag-1.24 {tag configuration options} -body { @@ -289,11 +289,11 @@ test textTag-1.34 {tag configuration options} -body { .t tag configure x -underline no .t tag cget x -underline } -cleanup { .t tag configure x -underline [lindex [.t tag configure x -underline] 3] -} -result 0 +} -result {no} test textTag-1.35 {configuration options} -body { .t tag configure x -underline stupid } -cleanup { .t tag configure x -underline [lindex [.t tag configure x -underline] 3] } -returnCodes error -result {expected boolean value or "" but got "stupid"} @@ -499,11 +499,11 @@ .t tag delete x .t tag configure x -underline yes .t tag configure x -underline } -cleanup { .t tag delete x -} -result {-underline {} {} {} 1} +} -result {-underline {} {} {} yes} test textTag-5.4a {TkTextTagCmd - "configure" option} -body { .t tag delete x .t tag configure x -underlinefg lightgreen .t tag configure x -underlinefg } -cleanup { @@ -513,11 +513,11 @@ .t tag delete x .t tag configure x -overstrike on .t tag cget x -overstrike } -cleanup { .t tag delete x -} -result 1 +} -result {on} test textTag-5.5a {TkTextTagCmd - "configure" option} -body { .t tag delete x .t tag configure x -overstrikefg lightgreen .t tag configure x -overstrikefg } -cleanup { @@ -539,18 +539,18 @@ .t tag configure x -justify left .t tag configure x -justify } -cleanup { .t tag delete x } -result {-justify {} {} {} left} -test textTag-5.9 {TkTextTagCmd - "configure" option, bug [026e2bb685]} -body { - .t tag delete x +test textTag-5.9 {TkTextTagCmd - "configure" option, bug [026e2bb685]} -constraints needsTcl87 -body { + .t tag delete x catch {.t tag configure x -justify bogus} msg list $msg [.t tag configure x -justify] } -cleanup { .t tag delete x } -result {{bad justification "bogus": must be left, right, center, or ""} {-justify {} {} {} {}}} -test textTag-5.10 {TkTextTagCmd - "configure" option} -body { +test textTag-5.10 {TkTextTagCmd - "configure" option} -constraints needsTcl87 -body { .t tag delete x .t tag configure x -justify fill } -cleanup { .t tag delete x } -returnCodes error -result {bad justification "fill": must be left, right, center, or ""} Index: tests/textWind.test ================================================================== --- tests/textWind.test +++ tests/textWind.test @@ -285,11 +285,11 @@ } -result {2.6} test textWind-2.17 {TkTextWindowCmd procedure} -setup { .t delete 1.0 end } -body { list [catch {.t window create 1.0} msg] $msg [.t window configure 1.0] -} -result {0 {} {{-align {} {} center center} {-create {} {} {} {}} {-padx {} {} 0 {}} {-pady {} {} 0 {}} {-stretch {} {} 0 0} {-window {} {} {} {}}}} +} -result {0 {} {{-align {} {} center center} {-create {} {} {} {}} {-padx {} {} 0 0} {-pady {} {} 0 0} {-stretch {} {} 0 0} {-window {} {} {} {}}}} test textWind-2.18 {TkTextWindowCmd procedure} -setup { destroy .f frame .f -width 20 -height 10 -bg $color .t window create end -window .f .t delete 1.0 end Index: tests/ttk/entry.test ================================================================== --- tests/ttk/entry.test +++ tests/ttk/entry.test @@ -62,11 +62,11 @@ .e icursor 3 .e delete 0 end .e index insert } -result 0 -test entry-1.8 "Index is between 0 and end" -body { +test entry-1.8 "Index is between 0 and end" -constraints deprecated -body { .e delete 0 end .e insert end abcde set res [list [.e index -1] [.e index -4] [.e index 999]] } -result {0 0 5} @@ -300,11 +300,11 @@ namespace eval ::test { variable foo "bar" } pack [ttk::entry .e -textvariable ::test::foo] namespace delete ::test .e insert end "baz" ;# <== error here list [.e cget -textvariable] [.e get] [set foo] -} -returnCodes error -result "*parent namespace doesn't exist*" -match glob +} -returnCodes error -result {can*t set "::test::foo": parent namespace does*t exist} -match glob # '-result [list ::test::foo "baz" "baz"]' would also be sensible, # but Tcl namespaces don't work that way. test entry-8.2a "Followup to test 8.2" -body { .e cget -textvariable Index: tests/ttk/panedwindow.test ================================================================== --- tests/ttk/panedwindow.test +++ tests/ttk/panedwindow.test @@ -309,11 +309,11 @@ # Contrary to ttk::scrollbar, ttk::progressbar and ttk::scale, # ttk::panedwindow has same style TPanedwindow whatever -orient is ttk::panedwindow .wv ; # default is -orient vertical ttk::panedwindow .wh -orient horizontal list [.wv cget -style] [.wv style] [winfo class .wv]\ - [.wh cget -style] [.wh style] [winfo class .wh] + [.wh cget -style] [.wh style] [winfo class .wh] } -cleanup { destroy .wv .wh } -result {{} TPanedwindow TPanedwindow {} TPanedwindow TPanedwindow} test panedwindow-6.2 "style command" -body { ttk::style configure customStyle.TPanedwindow Index: tests/ttk/pb_image.svg ================================================================== --- tests/ttk/pb_image.svg +++ tests/ttk/pb_image.svg @@ -47,15 +47,15 @@ inkscape:pagecheckerboard="true" /> - image/svg+xml - - + rdf:about=""> + image/svg+xml + + /dev/null || \ (echo '${NATIVE_ZIP}' | sed "s?^\./?$$(pwd)/?")`; \ - cd ${TK_VFS_ROOT} && $$zip -J ../${TK_ZIP_FILE}) \ + cd ${TK_VFS_ROOT} && $$zip -A ../${TK_ZIP_FILE} && $$zip -J ../${TK_ZIP_FILE}) \ fi @(zip=`(realpath '${NATIVE_ZIP}' || readlink -m '${NATIVE_ZIP}' || \ echo '${NATIVE_ZIP}' | sed "s?^\./?$$(pwd)/?") 2>/dev/null`; \ echo 'cd ${TK_VFS_ROOT} &&' $$zip '${ZIP_PROG_OPTIONS} ../${TK_ZIP_FILE} ${ZIP_PROG_VFSSEARCH}'; \ cd ${TK_VFS_ROOT} && \ @@ -648,18 +648,16 @@ if test "x$(MACHER)" = "x" ; then \ cat ${TK_ZIP_FILE} >> ${LIB_FILE}; \ else $(MACHER) append ${LIB_FILE} ${TK_ZIP_FILE} /tmp/macher_output; \ mv /tmp/macher_output ${LIB_FILE}; chmod u+x ${LIB_FILE}; \ fi; \ - ${NATIVE_ZIP} -A ${LIB_FILE} \ - || echo 'ignore zip-error by adjust sfx process (not executable?)'; \ fi ${STUB_LIB_FILE}: ${STUB_LIB_OBJS} - @if test "x${LIB_FILE}" = "xlibtcl9tk${MAJOR_VERSION}.${MINOR_VERSION}.dll"; then \ - (cd ${TOP_DIR}/win; ${MAKE} tcl9tk${MAJOR_VERSION}${MINOR_VERSION}.dll); \ - cp "${TOP_DIR}/win/tcl9tk${MAJOR_VERSION}${MINOR_VERSION}.dll" .; \ + @if test "x${LIB_FILE}" = "xlibtk${MAJOR_VERSION}.${MINOR_VERSION}.dll"; then \ + (cd ${TOP_DIR}/win; ${MAKE} tk${MAJOR_VERSION}${MINOR_VERSION}.dll); \ + cp "${TOP_DIR}/win/tk${MAJOR_VERSION}${MINOR_VERSION}.dll" .; \ fi rm -f $@ @MAKE_STUB_LIB@ # Build Aqua resource files @@ -690,12 +688,10 @@ if test "x$(MACHER)" = "x" ; then \ cat ${TK_ZIP_FILE} >> ${WISH_EXE}; \ else $(MACHER) append ${WISH_EXE} ${TK_ZIP_FILE} /tmp/macher_output; \ mv /tmp/macher_output ${LIB_FILE}; chmod u+x ${LIB_FILE}; \ fi; \ - ${NATIVE_ZIP} -A ${WISH_EXE} \ - || echo 'ignore zip-error by adjust sfx process (not executable?)'; \ fi # Resetting the LIB_RUNTIME_DIR below is required so that # the generated tktest executable gets the build directory # burned into its ld search path. This keeps tktest from @@ -1245,10 +1241,13 @@ $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkImgPhoto.c tkImgPhInstance.o: $(GENERIC_DIR)/tkImgPhInstance.c $(GENERIC_DIR)/tkImgPhoto.h $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkImgPhInstance.c +tkOldTest.o: $(GENERIC_DIR)/tkOldTest.c + $(CC) -c $(APP_CC_SWITCHES) $(GENERIC_DIR)/tkOldTest.c + tkTest.o: $(GENERIC_DIR)/tkTest.c tkUuid.h $(CC) -c $(APP_CC_SWITCHES) $(GENERIC_DIR)/tkTest.c tkText.o: $(GENERIC_DIR)/tkText.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkText.c @@ -1697,11 +1696,12 @@ dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tkConfig.h.in $(UNIX_DIR)/tk.pc.in $(MAC_OSX_DIR)/configure $(TOP_DIR)/doc/man.macros $(TOP_DIR)/manifest.uuid rm -rf $(DISTDIR) $(INSTALL_DATA_DIR) $(DISTDIR)/unix $(DIST_INSTALL_DATA) $(TOP_DIR)/manifest.uuid $(DISTDIR) - $(DIST_INSTALL_DATA) $(UNIX_DIR)/*.c $(UNIX_DIR)/*.h $(DISTDIR)/unix + $(DIST_INSTALL_DATA) $(UNIX_DIR)/*.c $(UNIX_DIR)/tkUnixDefault.h \ + $(UNIX_DIR)/tkUnixInt.h $(UNIX_DIR)/tkUnixPort.h $(DISTDIR)/unix $(DIST_INSTALL_DATA) $(TOP_DIR)/license.terms $(UNIX_DIR)/Makefile.in $(DISTDIR)/unix $(DIST_INSTALL_DATA) $(UNIX_DIR)/configure.ac $(UNIX_DIR)/tk.spec \ $(UNIX_DIR)/aclocal.m4 $(UNIX_DIR)/tcl.m4 \ $(UNIX_DIR)/tkConfig.sh.in $(UNIX_DIR)/install-sh \ $(UNIX_DIR)/README $(UNIX_DIR)/installManPage \ @@ -1726,11 +1726,14 @@ $(DISTDIR)/generic/ttk $(INSTALL_DATA_DIR) $(DISTDIR)/win $(DIST_INSTALL_DATA) $(TOP_DIR)/win/*.in $(DISTDIR)/win $(DIST_INSTALL_DATA) $(TOP_DIR)/win/configure.ac \ $(TOP_DIR)/win/aclocal.m4 $(TOP_DIR)/win/tcl.m4 \ - $(TOP_DIR)/win/*.[ch] $(TOP_DIR)/win/*.bat \ + $(TOP_DIR)/win/*.c $(TOP_DIR)/win/*.bat \ + $(TOP_DIR)/win/tkWin.h $(TOP_DIR)/win/tkWinDefault.h \ + $(TOP_DIR)/win/tkWinIco.h $(TOP_DIR)/win/tkWinInt.h \ + $(TOP_DIR)/win/tkWinPort.h $(TOP_DIR)/win/tkWinSendCom.h \ $(TOP_DIR)/win/*.vc $(TOP_DIR)/win/README \ $(TOP_DIR)/license.terms \ $(DISTDIR)/win $(DIST_INSTALL_SCRIPT) $(TOP_DIR)/win/configure $(DISTDIR)/win $(INSTALL_DATA_DIR) $(DISTDIR)/win/rc @@ -1808,11 +1811,11 @@ # # This target creates the HTML folder for Tcl & Tk and places it # in DISTDIR/html. It uses the tcltk-man2html.tcl tool from # the Tcl group's tool workspace. It depends on the Tcl & Tk being -# in directories called tcl9.0 & tk9.0 up two directories from the +# in directories called tcl8.3 & tk8.3 up two directories from the # TOOL_DIR. # html: $(BUILD_HTML) Index: unix/configure ================================================================== --- unix/configure +++ unix/configure @@ -1,8 +1,8 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.72 for tk 9.0. +# Generated by GNU Autoconf 2.72 for tk 8.7. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, # Inc. # @@ -599,12 +599,12 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='tk' PACKAGE_TARNAME='tk' -PACKAGE_VERSION='9.0' -PACKAGE_STRING='tk 9.0' +PACKAGE_VERSION='8.7' +PACKAGE_STRING='tk 8.7' PACKAGE_BUGREPORT='' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ @@ -1374,11 +1374,11 @@ # 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 9.0 to adapt to many kinds of systems. +'configure' configures tk 8.7 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. @@ -1440,11 +1440,11 @@ _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of tk 9.0:";; + short | recursive ) echo "Configuration of tk 8.7:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options @@ -1557,11 +1557,11 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -tk configure 9.0 +tk configure 8.7 generated by GNU Autoconf 2.72 Copyright (C) 2023 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. @@ -1923,11 +1923,11 @@ cat >config.log <<_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 9.0, which was +It was created by tk $as_me 8.7, which was generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw _ACEOF @@ -2602,14 +2602,14 @@ -TK_VERSION=9.0 -TK_MAJOR_VERSION=9 -TK_MINOR_VERSION=0 -TK_PATCH_LEVEL=".1" +TK_VERSION=8.7 +TK_MAJOR_VERSION=8 +TK_MINOR_VERSION=7 +TK_PATCH_LEVEL="b1" VERSION=${TK_VERSION} LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv" #-------------------------------------------------------------------- # Find and load the tclConfig.sh file @@ -2698,15 +2698,15 @@ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/pkg/lib 2>/dev/null` \ - `ls -d /usr/lib/tcl9.0 2>/dev/null` \ + `ls -d /usr/lib/tcl8.7 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ `ls -d /usr/lib64 2>/dev/null` \ - `ls -d /usr/local/lib/tcl9.0 2>/dev/null` \ - `ls -d /usr/local/lib/tcl/tcl9.0 2>/dev/null` \ + `ls -d /usr/local/lib/tcl8.7 2>/dev/null` \ + `ls -d /usr/local/lib/tcl/tcl8.7 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i; pwd)`" break fi @@ -2801,12 +2801,16 @@ if test "${TCL_MAJOR_VERSION}" -lt 9 ; then -if test "${TCL_MINOR_VERSION}" -lt 7 ; then - as_fn_error $? "${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.7+ +if test "${TCL_MAJOR_VERSION}" -ne 8 ; then + as_fn_error $? "${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+ +Found config for Tcl ${TCL_VERSION}" "$LINENO" 5 +fi +if test "${TCL_MINOR_VERSION}" -lt 6 ; then + as_fn_error $? "${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+ Found config for Tcl ${TCL_VERSION}" "$LINENO" 5 fi fi @@ -5221,14 +5225,18 @@ DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" case $system in DragonFly-*|FreeBSD-*) - # The -pthread needs to go in the LDFLAGS, not LIBS - LIBS=`echo $LIBS | sed s/-pthread//` - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - LDFLAGS="$LDFLAGS $PTHREAD_LIBS" + if test "${TCL_THREADS}" = "1" +then : + + # The -pthread needs to go in the LDFLAGS, not LIBS + LIBS=`echo $LIBS | sed s/-pthread//` + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LDFLAGS="$LDFLAGS $PTHREAD_LIBS" +fi ;; esac if test $doRpath = yes then : @@ -6559,63 +6567,10 @@ printf "%s\n" "#define _ISOC99_SOURCE 1" >>confdefs.h tcl_flags="$tcl_flags _ISOC99_SOURCE" fi - - if test ${tcl_cv_flag__file_offset_bits+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -switch (0) { case 0: case (sizeof(off_t)==sizeof(long long)): ; } - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - tcl_cv_flag__file_offset_bits=no -else case e in #( - e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define _FILE_OFFSET_BITS 64 -#include -int -main (void) -{ -switch (0) { case 0: case (sizeof(off_t)==sizeof(long long)): ; } - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - tcl_cv_flag__file_offset_bits=yes -else case e in #( - e) tcl_cv_flag__file_offset_bits=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac -fi - - if test "x${tcl_cv_flag__file_offset_bits}" = "xyes" ; then - -printf "%s\n" "#define _FILE_OFFSET_BITS 64" >>confdefs.h - - tcl_flags="$tcl_flags _FILE_OFFSET_BITS" - fi - if test ${tcl_cv_flag__largefile64_source+y} then : printf %s "(cached) " >&6 else case e in #( @@ -6717,81 +6672,10 @@ printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } # Now check for auxiliary declarations - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit time_t" >&5 -printf %s "checking for 64-bit time_t... " >&6; } -if test ${tcl_cv_time_t_64+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main (void) -{ -switch (0) {case 0: case (sizeof(time_t)==sizeof(long long)): ;} - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - tcl_cv_time_t_64=yes -else case e in #( - e) tcl_cv_time_t_64=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_time_t_64" >&5 -printf "%s\n" "$tcl_cv_time_t_64" >&6; } - if test "x${tcl_cv_time_t_64}" = "xno" ; then - # Note that _TIME_BITS=64 requires _FILE_OFFSET_BITS=64 - # which SC_TCL_EARLY_FLAGS has defined if necessary. - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if _TIME_BITS=64 enables 64-bit time_t" >&5 -printf %s "checking if _TIME_BITS=64 enables 64-bit time_t... " >&6; } -if test ${tcl_cv__time_bits+y} -then : - printf %s "(cached) " >&6 -else case e in #( - e) - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define _TIME_BITS 64 -#include -int -main (void) -{ -switch (0) {case 0: case (sizeof(time_t)==sizeof(long long)): ;} - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - tcl_cv__time_bits=yes -else case e in #( - e) tcl_cv__time_bits=no ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; -esac -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv__time_bits" >&5 -printf "%s\n" "$tcl_cv__time_bits" >&6; } - if test "x${tcl_cv__time_bits}" = "xyes" ; then - -printf "%s\n" "#define _TIME_BITS 64" >>confdefs.h - - fi - fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct dirent64" >&5 printf %s "checking for struct dirent64... " >&6; } if test ${tcl_cv_struct_dirent64+y} then : printf %s "(cached) " >&6 @@ -6861,10 +6745,47 @@ printf "%s\n" "$tcl_cv_DIR64" >&6; } if test "x${tcl_cv_DIR64}" = "xyes" ; then printf "%s\n" "#define HAVE_DIR64 1" >>confdefs.h + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct stat64" >&5 +printf %s "checking for struct stat64... " >&6; } +if test ${tcl_cv_struct_stat64+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +struct stat64 p; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + tcl_cv_struct_stat64=yes +else case e in #( + e) tcl_cv_struct_stat64=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_stat64" >&5 +printf "%s\n" "$tcl_cv_struct_stat64" >&6; } + if test "x${tcl_cv_struct_stat64}" = "xyes" ; then + +printf "%s\n" "#define HAVE_STRUCT_STAT64 1" >>confdefs.h + fi ac_fn_c_check_func "$LINENO" "open64" "ac_cv_func_open64" if test "x$ac_cv_func_open64" = xyes then : @@ -9153,12 +9074,21 @@ # The statements below define various symbols relating to Tk # stub support. #-------------------------------------------------------------------- # Replace ${VERSION} with contents of ${TK_VERSION} +if test "${TCL_MAJOR_VERSION}" -gt 8 ; then TK_STUB_LIB_FILE="libtkstub.a" TK_STUB_LIB_FLAG="-ltkstub" +else + eval "TK_STUB_LIB_FILE=libtkstub${TK_UNSHARED_LIB_SUFFIX}" +if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then + TK_STUB_LIB_FLAG="-ltkstub${TK_VERSION}" +else + TK_STUB_LIB_FLAG="-ltkstub`echo ${TK_VERSION} | tr -d .`" +fi +fi eval "TK_STUB_LIB_DIR=\"${libdir}\"" TK_BUILD_STUB_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TK_STUB_LIB_FLAG}" TK_STUB_LIB_SPEC="-L${TK_STUB_LIB_DIR} ${TK_STUB_LIB_FLAG}" TK_BUILD_STUB_LIB_PATH="`pwd`/${TK_STUB_LIB_FILE}" @@ -9776,11 +9706,11 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by tk $as_me 9.0, which was +This file was extended by tk $as_me 8.7, which was generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS @@ -9835,11 +9765,11 @@ ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -tk config.status 9.0 +tk config.status 8.7 configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" Copyright (C) 2023 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation Index: unix/configure.ac ================================================================== --- unix/configure.ac +++ unix/configure.ac @@ -1,11 +1,11 @@ ! /bin/bash -norc 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. -AC_INIT([tk],[9.0]) +AC_INIT([tk],[8.7]) AC_PREREQ([2.69]) dnl This is only used when included from macosx/configure.ac m4_ifdef([SC_USE_CONFIG_HEADERS], [ AC_CONFIG_HEADERS([tkConfig.h:../unix/tkConfig.h.in]) @@ -21,14 +21,14 @@ /* override */ #undef PACKAGE_VERSION /* override */ #undef PACKAGE_STRING #endif /* _TKCONFIG */]) ]) -TK_VERSION=9.0 -TK_MAJOR_VERSION=9 -TK_MINOR_VERSION=0 -TK_PATCH_LEVEL=".1" +TK_VERSION=8.7 +TK_MAJOR_VERSION=8 +TK_MINOR_VERSION=7 +TK_PATCH_LEVEL="b1" VERSION=${TK_VERSION} LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv" #-------------------------------------------------------------------- # Find and load the tclConfig.sh file @@ -36,12 +36,16 @@ SC_PATH_TCLCONFIG SC_LOAD_TCLCONFIG if test "${TCL_MAJOR_VERSION}" -lt 9 ; then -if test "${TCL_MINOR_VERSION}" -lt 7 ; then - AC_MSG_ERROR([${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.7+ +if test "${TCL_MAJOR_VERSION}" -ne 8 ; then + AC_MSG_ERROR([${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+ +Found config for Tcl ${TCL_VERSION}]) +fi +if test "${TCL_MINOR_VERSION}" -lt 6 ; then + AC_MSG_ERROR([${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+ Found config for Tcl ${TCL_VERSION}]) fi fi SC_PROG_TCLSH @@ -716,12 +720,21 @@ # The statements below define various symbols relating to Tk # stub support. #-------------------------------------------------------------------- # Replace ${VERSION} with contents of ${TK_VERSION} +if test "${TCL_MAJOR_VERSION}" -gt 8 ; then TK_STUB_LIB_FILE="libtkstub.a" TK_STUB_LIB_FLAG="-ltkstub" +else + eval "TK_STUB_LIB_FILE=libtkstub${TK_UNSHARED_LIB_SUFFIX}" +if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then + TK_STUB_LIB_FLAG="-ltkstub${TK_VERSION}" +else + TK_STUB_LIB_FLAG="-ltkstub`echo ${TK_VERSION} | tr -d .`" +fi +fi eval "TK_STUB_LIB_DIR=\"${libdir}\"" TK_BUILD_STUB_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TK_STUB_LIB_FLAG}" TK_STUB_LIB_SPEC="-L${TK_STUB_LIB_DIR} ${TK_STUB_LIB_FLAG}" TK_BUILD_STUB_LIB_PATH="`pwd`/${TK_STUB_LIB_FILE}" Index: unix/tcl.m4 ================================================================== --- unix/tcl.m4 +++ unix/tcl.m4 @@ -91,15 +91,15 @@ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/pkg/lib 2>/dev/null` \ - `ls -d /usr/lib/tcl9.0 2>/dev/null` \ + `ls -d /usr/lib/tcl8.7 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ `ls -d /usr/lib64 2>/dev/null` \ - `ls -d /usr/local/lib/tcl9.0 2>/dev/null` \ - `ls -d /usr/local/lib/tcl/tcl9.0 2>/dev/null` \ + `ls -d /usr/local/lib/tcl8.7 2>/dev/null` \ + `ls -d /usr/local/lib/tcl/tcl8.7 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i; pwd)`" break fi @@ -224,15 +224,15 @@ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/pkg/lib 2>/dev/null` \ - `ls -d /usr/lib/tk9.0 2>/dev/null` \ + `ls -d /usr/lib/tk8.7 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ `ls -d /usr/lib64 2>/dev/null` \ - `ls -d /usr/local/lib/tk9.0 2>/dev/null` \ - `ls -d /usr/local/lib/tcl/tk9.0 2>/dev/null` \ + `ls -d /usr/local/lib/tk8.7 2>/dev/null` \ + `ls -d /usr/local/lib/tcl/tk8.7 2>/dev/null` \ ; do if test -f "$i/tkConfig.sh" ; then ac_cv_c_tkconfig="`(cd $i; pwd)`" break fi @@ -1274,14 +1274,15 @@ DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" case $system in DragonFly-*|FreeBSD-*) - # The -pthread needs to go in the LDFLAGS, not LIBS - LIBS=`echo $LIBS | sed s/-pthread//` - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - LDFLAGS="$LDFLAGS $PTHREAD_LIBS" + AS_IF([test "${TCL_THREADS}" = "1"], [ + # The -pthread needs to go in the LDFLAGS, not LIBS + LIBS=`echo $LIBS | sed s/-pthread//` + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LDFLAGS="$LDFLAGS $PTHREAD_LIBS"]) ;; esac AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"']) @@ -2274,11 +2275,10 @@ # # Results: # # Might define the following vars: # _ISOC99_SOURCE -# _FILE_OFFSET_BITS # _LARGEFILE64_SOURCE # #-------------------------------------------------------------------- AC_DEFUN([SC_TCL_EARLY_FLAG],[ @@ -2297,12 +2297,10 @@ AC_DEFUN([SC_TCL_EARLY_FLAGS],[ AC_MSG_CHECKING([for required early compiler flags]) tcl_flags="" SC_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include ], [char *p = (char *)strtoll; char *q = (char *)strtoull;]) - SC_TCL_EARLY_FLAG(_FILE_OFFSET_BITS,[#include ], - [switch (0) { case 0: case (sizeof(off_t)==sizeof(long long)): ; }],64) SC_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include ], [struct stat64 buf; int i = stat64("/", &buf);]) if test "x${tcl_flags}" = "x" ; then AC_MSG_RESULT([none]) else @@ -2321,12 +2319,12 @@ # Results: # # Might define the following vars: # TCL_WIDE_INT_IS_LONG # HAVE_STRUCT_DIRENT64, HAVE_DIR64 +# HAVE_STRUCT_STAT64 # HAVE_TYPE_OFF64_T -# _TIME_BITS # #-------------------------------------------------------------------- AC_DEFUN([SC_TCL_64BIT_FLAGS], [ AC_MSG_CHECKING([if 'long' and 'long long' have the same size (64-bit)?]) @@ -2342,27 +2340,10 @@ AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Do 'long' and 'long long' have the same size (64-bit)?]) AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) # Now check for auxiliary declarations - AC_CACHE_CHECK([for 64-bit time_t], tcl_cv_time_t_64,[ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[switch (0) {case 0: case (sizeof(time_t)==sizeof(long long)): ;}]])], - [tcl_cv_time_t_64=yes],[tcl_cv_time_t_64=no])]) - if test "x${tcl_cv_time_t_64}" = "xno" ; then - # Note that _TIME_BITS=64 requires _FILE_OFFSET_BITS=64 - # which SC_TCL_EARLY_FLAGS has defined if necessary. - AC_CACHE_CHECK([if _TIME_BITS=64 enables 64-bit time_t], tcl_cv__time_bits,[ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _TIME_BITS 64 -#include ]], - [[switch (0) {case 0: case (sizeof(time_t)==sizeof(long long)): ;}]])], - [tcl_cv__time_bits=yes],[tcl_cv__time_bits=no])]) - if test "x${tcl_cv__time_bits}" = "xyes" ; then - AC_DEFINE(_TIME_BITS, 64, [_TIME_BITS=64 enables 64-bit time_t.]) - fi - fi - AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[struct dirent64 p;]])], [tcl_cv_struct_dirent64=yes],[tcl_cv_struct_dirent64=no])]) if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then @@ -2375,10 +2356,18 @@ p = readdir64(d); rewinddir64(d); closedir64(d);]])], [tcl_cv_DIR64=yes], [tcl_cv_DIR64=no])]) if test "x${tcl_cv_DIR64}" = "xyes" ; then AC_DEFINE(HAVE_DIR64, 1, [Is 'DIR64' in ?]) fi + + AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[struct stat64 p; +]])], + [tcl_cv_struct_stat64=yes], [tcl_cv_struct_stat64=no])]) + if test "x${tcl_cv_struct_stat64}" = "xyes" ; then + AC_DEFINE(HAVE_STRUCT_STAT64, 1, [Is 'struct stat64' in ?]) + fi AC_CHECK_FUNCS(open64 lseek64) AC_MSG_CHECKING([for off64_t]) AC_CACHE_VAL(tcl_cv_type_off64_t,[ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[off64_t offset; Index: unix/tk.spec ================================================================== --- unix/tk.spec +++ unix/tk.spec @@ -2,19 +2,19 @@ %{!?directory:%define directory /usr/local} Name: tk Summary: Tk graphical toolkit for the Tcl scripting language. -Version: 9.0.1 +Version: 8.7b1 Release: 2 License: BSD Group: Development/Languages Source: http://prdownloads.sourceforge.net/tcl/tk%{version}-src.tar.gz URL: https://www.tcl-lang.org/ Buildroot: /var/tmp/%{name}%{version} -Buildrequires: XFree86-devel tcl >= 8.7.0 -Requires: tcl >= 8.7.0 +Buildrequires: XFree86-devel tcl >= 8.7b1 +Requires: tcl >= 8.7b1 %description The Tcl (Tool Command Language) provides a powerful platform for creating integration applications that tie together diverse applications, protocols, devices, and frameworks. When paired with Index: unix/tkAppInit.c ================================================================== --- unix/tkAppInit.c +++ unix/tkAppInit.c @@ -10,34 +10,15 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ -/* - * Explanation on following undef USE_TCL_STUBS by JN 2023-12-19 on the core list: - * What's going on is related to TIP #596: - * Stubs support for Embedding Tcl in other applications - * - * If an application using Tcl_Main() is compiled with USE_TCL_STUBS, - * Tcl_Main() will be replaced by a stub function, which loads - * libtcl9.0.so/tcl90.dll and then calls its Tcl_MainEx(). If - * libtcl9.0.so/tcl90.dll is not present (at runtime), a crash is what happens. - * - * So ... tkAppInit.c should not be compiled with USE_TCL_STUBS - * (unless you want to use the TIP #596 functionality) - * - * The proper solution is to make sure that Makefile.in doesn't use - * TCL_USE_STUBS when compiling tkAppInit.c. But that's a - * quite big re-organization just before a b1 release. Simpler - * is just to #undef'ine USE_TCL_STUBS, it has the same effect. - */ -#undef USE_TCL_STUBS #undef BUILD_tk #undef STATIC_BUILD #include "tk.h" #include "tkPort.h" -#if (TCL_MAJOR_VERSION < 9) && defined(TCL_MINOR_VERSION) && (TCL_MINOR_VERSION < 7) +#if TCL_MAJOR_VERSION < 9 && TCL_MINOR_VERSION < 7 # define Tcl_LibraryInitProc Tcl_PackageInitProc # define Tcl_StaticLibrary Tcl_StaticPackage #endif #ifdef TK_TEST @@ -105,11 +86,11 @@ int argc, /* Number of command-line arguments. */ char **argv) /* Values of command-line arguments. */ { #ifdef TK_LOCAL_MAIN_HOOK TK_LOCAL_MAIN_HOOK(&argc, &argv); -#elif TCL_MAJOR_VERSION > 8 || !defined(TCL_MINOR_VERSION) || TCL_MINOR_VERSION > 6 +#elif (TCL_MAJOR_VERSION > 8) || (TCL_MINOR_VERSION > 6) /* This doesn't work with Tcl 8.6 */ TclZipfs_AppHook(&argc, &argv); #endif Tk_Main(argc, argv, TK_LOCAL_APPINIT); @@ -183,13 +164,18 @@ * run interactively. Typically the startup file is "~/.apprc" where "app" * is the name of the application. If this line is deleted then no * user-specific startup file will be run under any conditions. */ +#if TCL_MAJOR_VERSION > 8 (void) Tcl_EvalEx(interp, "set tcl_rcFileName [file tildeexpand ~/.wishrc]", -1, TCL_EVAL_GLOBAL); +#else + Tcl_ObjSetVar2(interp, Tcl_NewStringObj("tcl_rcFileName", -1), NULL, + Tcl_NewStringObj("~/.wishrc", -1), TCL_GLOBAL_ONLY); +#endif return TCL_OK; } /* * Local Variables: Index: unix/tkConfig.h.in ================================================================== --- unix/tkConfig.h.in +++ unix/tkConfig.h.in @@ -64,10 +64,13 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Is 'struct dirent64' in ? */ #undef HAVE_STRUCT_DIRENT64 + +/* Is 'struct stat64' in ? */ +#undef HAVE_STRUCT_STAT64 /* Should we include ? */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ @@ -184,13 +187,10 @@ #endif /* Are we building with zipfs enabled? */ #undef ZIPFS_BUILD -/* Add the _FILE_OFFSET_BITS flag when building */ -#undef _FILE_OFFSET_BITS - /* Add the _ISOC99_SOURCE flag when building */ #undef _ISOC99_SOURCE /* Add the _LARGEFILE64_SOURCE flag when building */ #undef _LARGEFILE64_SOURCE @@ -202,13 +202,10 @@ #undef _POSIX_PTHREAD_SEMANTICS /* Do we want the reentrant OS API? */ #undef _REENTRANT -/* _TIME_BITS=64 enables 64-bit time_t. */ -#undef _TIME_BITS - /* Do we want to use the XOPEN network library? */ #undef _XOPEN_SOURCE /* Do we want to use the XOPEN network library? */ #undef _XOPEN_SOURCE_EXTENDED Index: unix/tkUnix.c ================================================================== --- unix/tkUnix.c +++ unix/tkUnix.c @@ -133,12 +133,10 @@ * None. * *---------------------------------------------------------------------- */ -extern int XUnionRegion(Region srca, Region srcb, Region dr_return); - void TkpCopyRegion( TkRegion dst, TkRegion src) { Index: unix/tkUnixButton.c ================================================================== --- unix/tkUnixButton.c +++ unix/tkUnixButton.c @@ -447,11 +447,10 @@ int haveImage = 0, haveText = 0; int imageWidth, imageHeight; int imageXOffset = 0, imageYOffset = 0; /* image information that will be used to * restrict disabled pixmap as well */ - int padX, padY, borderWidth, highlightWidth; butPtr->flags &= ~REDRAW_PENDING; if ((butPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) { return; } @@ -532,14 +531,14 @@ haveImage = 1; } imageWidth = width; imageHeight = height; - Tk_GetPixelsFromObj(NULL, tkwin, butPtr->padXObj, &padX); - Tk_GetPixelsFromObj(NULL, tkwin, butPtr->padYObj, &padY); - Tk_GetPixelsFromObj(NULL, tkwin, butPtr->borderWidthObj, &borderWidth); - Tk_GetPixelsFromObj(NULL, tkwin, butPtr->highlightWidthObj, &highlightWidth); + Tk_GetPixelsFromObj(NULL, tkwin, butPtr->padXPtr, &butPtr->padX); + Tk_GetPixelsFromObj(NULL, tkwin, butPtr->padYPtr, &butPtr->padY); + Tk_GetPixelsFromObj(NULL, tkwin, butPtr->borderWidthPtr, &butPtr->borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); haveText = (butPtr->textWidth != 0 && butPtr->textHeight != 0); if (butPtr->compound != COMPOUND_NONE && haveImage && haveText) { textXOffset = 0; @@ -553,15 +552,15 @@ /* * Image is above or below text. */ if (butPtr->compound == COMPOUND_TOP) { - textYOffset = height + padY; + textYOffset = height + butPtr->padY; } else { - imageYOffset = butPtr->textHeight + padY; + imageYOffset = butPtr->textHeight + butPtr->padY; } - fullHeight = height + butPtr->textHeight + padY; + fullHeight = height + butPtr->textHeight + butPtr->padY; fullWidth = (width > butPtr->textWidth ? width : butPtr->textWidth); textXOffset = (fullWidth - butPtr->textWidth)/2; imageXOffset = (fullWidth - width)/2; break; @@ -570,15 +569,15 @@ /* * Image is left or right of text. */ if (butPtr->compound == COMPOUND_LEFT) { - textXOffset = width + padX; + textXOffset = width + butPtr->padX; } else { - imageXOffset = butPtr->textWidth + padX; + imageXOffset = butPtr->textWidth + butPtr->padX; } - fullWidth = butPtr->textWidth + padX + width; + fullWidth = butPtr->textWidth + butPtr->padX + width; fullHeight = (height > butPtr->textHeight ? height : butPtr->textHeight); textYOffset = (fullHeight - butPtr->textHeight)/2; imageYOffset = (fullHeight - height)/2; break; @@ -598,11 +597,11 @@ break; case COMPOUND_NONE: break; } - TkComputeAnchor(butPtr->anchor, tkwin, padX, padY, + TkComputeAnchor(butPtr->anchor, tkwin, butPtr->padX, butPtr->padY, butPtr->indicatorSpace + fullWidth, fullHeight, &x, &y); x += butPtr->indicatorSpace; ShiftByOffset(butPtr, relief, &x, &y, width, height); imageXOffset += x; @@ -708,11 +707,11 @@ (unsigned int) width, (unsigned int) height, x, y, 1); XSetClipOrigin(butPtr->display, gc, 0, 0); } y += height/2; } else { - TkComputeAnchor(butPtr->anchor, tkwin, padX, padY, + TkComputeAnchor(butPtr->anchor, tkwin, butPtr->padX, butPtr->padY, butPtr->indicatorSpace + butPtr->textWidth, butPtr->textHeight, &x, &y); x += butPtr->indicatorSpace; ShiftByOffset(butPtr, relief, &x, &y, width, height); @@ -729,11 +728,11 @@ * x and y refer to the top-left corner of the text or image or bitmap. */ if ((butPtr->type == TYPE_CHECK_BUTTON || butPtr->type == TYPE_RADIO_BUTTON) && butPtr->indicatorOn - && butPtr->indicatorDiameter > 2 * borderWidth) { + && butPtr->indicatorDiameter > 2 * butPtr->borderWidth) { TkBorder *selBorder = (TkBorder *) butPtr->selectBorder; XColor *selColor = NULL; int btype = (butPtr->type == TYPE_CHECK_BUTTON ? CHECK_BUTTON : RADIO_BUTTON); @@ -791,11 +790,11 @@ * rings. We draw the focus and highlight rings using the highlight border * and highlight foreground color. */ if (relief != TK_RELIEF_FLAT) { - int inset = highlightWidth; + int inset = butPtr->highlightWidth; if (butPtr->defaultState == DEFAULT_ACTIVE) { /* * Draw the default ring with 2 pixels of space between the * default ring and the button and the default ring and the focus @@ -832,13 +831,13 @@ * Draw the button border. */ Tk_Draw3DRectangle(tkwin, pixmap, border, inset, inset, Tk_Width(tkwin) - 2 * inset, Tk_Height(tkwin) - 2 * inset, - borderWidth, relief); + butPtr->borderWidth, relief); } - if (highlightWidth > 0) { + if (butPtr->highlightWidth > 0) { if (butPtr->flags & GOT_FOCUS) { gc = Tk_GCForColor(butPtr->highlightColorPtr, pixmap); } else { gc = Tk_GCForColor(Tk_3DBorderColor(butPtr->highlightBorder), pixmap); @@ -848,14 +847,14 @@ * Make sure the focus ring shrink-wraps the actual button, not the * padding space left for a default ring. */ if (butPtr->defaultState == DEFAULT_NORMAL) { - TkDrawInsetFocusHighlight(tkwin, gc, highlightWidth, + TkDrawInsetFocusHighlight(tkwin, gc, butPtr->highlightWidth, pixmap, 5); } else { - Tk_DrawFocusHighlight(tkwin, gc, highlightWidth, pixmap); + Tk_DrawFocusHighlight(tkwin, gc, butPtr->highlightWidth, pixmap); } } /* * Copy the information from the off-screen pixmap onto the screen, then @@ -891,22 +890,17 @@ TkButton *butPtr) /* Button whose geometry may have changed. */ { int width, height, avgWidth, txtWidth, txtHeight; int haveImage = 0, haveText = 0; Tk_FontMetrics fm; - int padX, padY, borderWidth, highlightWidth, wrapLength; - int butPtrWidth, butPtrHeight; - - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->highlightWidthObj, &highlightWidth); - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->borderWidthObj, &borderWidth); - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padXObj, &padX); - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padYObj, &padY); - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->wrapLengthObj, &wrapLength); - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->widthObj, &butPtrWidth); - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->heightObj, &butPtrHeight); - - butPtr->inset = highlightWidth + borderWidth; + + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->borderWidthPtr, &butPtr->borderWidth); + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padXPtr, &butPtr->padX); + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padYPtr, &butPtr->padY); + + butPtr->inset = butPtr->highlightWidth + butPtr->borderWidth; /* * Leave room for the default ring if needed. */ @@ -931,11 +925,11 @@ if (haveImage == 0 || butPtr->compound != COMPOUND_NONE) { Tk_FreeTextLayout(butPtr->textLayout); butPtr->textLayout = Tk_ComputeTextLayout(butPtr->tkfont, - Tcl_GetString(butPtr->textPtr), TCL_INDEX_NONE, wrapLength, + Tcl_GetString(butPtr->textPtr), TCL_INDEX_NONE, butPtr->wrapLength, butPtr->justify, 0, &butPtr->textWidth, &butPtr->textHeight); txtWidth = butPtr->textWidth; txtHeight = butPtr->textHeight; avgWidth = Tk_TextWidth(butPtr->tkfont, "0", 1); @@ -956,20 +950,20 @@ case COMPOUND_BOTTOM: /* * Image is above or below text. */ - height += txtHeight + padY; + height += txtHeight + butPtr->padY; width = (width > txtWidth ? width : txtWidth); break; case COMPOUND_LEFT: case COMPOUND_RIGHT: /* * Image is left or right of text. */ - width += txtWidth + padX; + width += txtWidth + butPtr->padX; height = (height > txtHeight ? height : txtHeight); break; case COMPOUND_CENTER: /* * Image and text are superimposed. @@ -979,15 +973,15 @@ height = (height > txtHeight ? height : txtHeight); break; case COMPOUND_NONE: break; } - if (butPtrWidth > 0) { - width = butPtrWidth; + if (butPtr->width > 0) { + width = butPtr->width; } - if (butPtrHeight > 0) { - height = butPtrHeight; + if (butPtr->height > 0) { + height = butPtr->height; } if ((butPtr->type >= TYPE_CHECK_BUTTON) && butPtr->indicatorOn) { butPtr->indicatorSpace = height; if (butPtr->type == TYPE_CHECK_BUTTON) { @@ -995,19 +989,19 @@ } else { butPtr->indicatorDiameter = (75*height)/100; } } - width += 2 * padX; - height += 2 * padY; + width += 2 * butPtr->padX; + height += 2 * butPtr->padY; } else { if (haveImage) { - if (butPtrWidth > 0) { - width = butPtrWidth; + if (butPtr->width > 0) { + width = butPtr->width; } - if (butPtrHeight > 0) { - height = butPtrHeight; + if (butPtr->height > 0) { + height = butPtr->height; } if ((butPtr->type >= TYPE_CHECK_BUTTON) && butPtr->indicatorOn) { butPtr->indicatorSpace = height; if (butPtr->type == TYPE_CHECK_BUTTON) { @@ -1018,15 +1012,15 @@ } } else { width = txtWidth; height = txtHeight; - if (butPtrWidth > 0) { - width = butPtrWidth * avgWidth; + if (butPtr->width > 0) { + width = butPtr->width * avgWidth; } - if (butPtrHeight > 0) { - height = butPtrHeight * fm.linespace; + if (butPtr->height > 0) { + height = butPtr->height * fm.linespace; } if ((butPtr->type >= TYPE_CHECK_BUTTON) && butPtr->indicatorOn) { butPtr->indicatorDiameter = fm.linespace; butPtr->indicatorSpace = butPtr->indicatorDiameter + avgWidth; } @@ -1039,12 +1033,12 @@ * display can be offset by 1 pixel in either direction for the raised or * lowered effect. */ if ((butPtr->image == NULL) && (butPtr->bitmap == None)) { - width += 2 * padX; - height += 2 * padY; + width += 2 * butPtr->padX; + height += 2 * butPtr->padY; } if ((butPtr->type == TYPE_BUTTON) && !Tk_StrictMotif(butPtr->tkwin)) { width += 2; height += 2; } Index: unix/tkUnixDefault.h ================================================================== --- unix/tkUnixDefault.h +++ unix/tkUnixDefault.h @@ -250,11 +250,11 @@ #define DEF_MENU_ENTRY_ACCELERATOR NULL #define DEF_MENU_ENTRY_BG NULL #define DEF_MENU_ENTRY_BITMAP NULL #define DEF_MENU_ENTRY_COLUMN_BREAK "0" #define DEF_MENU_ENTRY_COMMAND NULL -#define DEF_MENU_ENTRY_COMPOUND "none" +#define DEF_MENU_ENTRY_COMPOUND "none" #define DEF_MENU_ENTRY_FG NULL #define DEF_MENU_ENTRY_FONT NULL #define DEF_MENU_ENTRY_HIDE_MARGIN "0" #define DEF_MENU_ENTRY_IMAGE NULL #define DEF_MENU_ENTRY_INDICATOR "1" @@ -349,12 +349,12 @@ #define DEF_MESSAGE_FONT "TkDefaultFont" #define DEF_MESSAGE_HIGHLIGHT_BG NORMAL_BG #define DEF_MESSAGE_HIGHLIGHT BLACK #define DEF_MESSAGE_HIGHLIGHT_WIDTH "0" #define DEF_MESSAGE_JUSTIFY "left" -#define DEF_MESSAGE_PADX NULL -#define DEF_MESSAGE_PADY NULL +#define DEF_MESSAGE_PADX "-1" +#define DEF_MESSAGE_PADY "-1" #define DEF_MESSAGE_RELIEF "flat" #define DEF_MESSAGE_TAKE_FOCUS "0" #define DEF_MESSAGE_TEXT "" #define DEF_MESSAGE_TEXT_VARIABLE "" #define DEF_MESSAGE_WIDTH "0" @@ -446,11 +446,11 @@ #define DEF_SCROLLBAR_BG_COLOR NORMAL_BG #define DEF_SCROLLBAR_BG_MONO WHITE #define DEF_SCROLLBAR_BORDER_WIDTH "1" #define DEF_SCROLLBAR_COMMAND "" #define DEF_SCROLLBAR_CURSOR "" -#define DEF_SCROLLBAR_EL_BORDER_WIDTH NULL +#define DEF_SCROLLBAR_EL_BORDER_WIDTH "-1" #define DEF_SCROLLBAR_HIGHLIGHT_BG NORMAL_BG #define DEF_SCROLLBAR_HIGHLIGHT BLACK #define DEF_SCROLLBAR_HIGHLIGHT_WIDTH "0" #define DEF_SCROLLBAR_JUMP "0" #define DEF_SCROLLBAR_ORIENT "vertical" Index: unix/tkUnixFont.c ================================================================== --- unix/tkUnixFont.c +++ unix/tkUnixFont.c @@ -236,10 +236,20 @@ 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); +#if TCL_MAJOR_VERSION < 9 +static int Ucs2beToUtfProc(void *clientData, const char*src, + int srcLen, int flags, Tcl_EncodingState*statePtr, + char *dst, int dstLen, int *srcReadPtr, + int *dstWrotePtr, int *dstCharsPtr); +static int UtfToUcs2beProc(void *clientData, const char*src, + int srcLen, int flags, Tcl_EncodingState*statePtr, + char *dst, int dstLen, int *srcReadPtr, + int *dstWrotePtr, int *dstCharsPtr); +#endif /* *------------------------------------------------------------------------- * * XLoadQueryFontNoXError -- @@ -329,10 +339,13 @@ { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); SubFont dummy; int i; +#if TCL_MAJOR_VERSION < 9 + Tcl_Encoding ucs2; +#endif if (tsdPtr->controlFamily.encoding == NULL) { Tcl_EncodingType type = {"X11ControlChars", ControlUtfProc, ControlUtfProc, NULL, NULL, 0}; tsdPtr->controlFamily.refCount = 2; @@ -349,10 +362,19 @@ /* * UCS-2BE is unicode (UCS-2) in big-endian format. Define this if * if it doesn't exist yet. It is used in iso10646 fonts. */ +#if TCL_MAJOR_VERSION < 9 + ucs2 = Tcl_GetEncoding(NULL, "ucs-2be"); + if (ucs2 == NULL) { + Tcl_EncodingType ucs2type = {"ucs-2be", Ucs2beToUtfProc, UtfToUcs2beProc, NULL, NULL, 2}; + Tcl_CreateEncoding(&ucs2type); + } else { + Tcl_FreeEncoding(ucs2); + } +#endif Tcl_CreateThreadExitHandler(FontPkgCleanup, NULL); } } /* @@ -418,11 +440,11 @@ for ( ; src < srcEnd; ) { if (dst > dstEnd) { result = TCL_CONVERT_NOSPACE; break; } - src += Tcl_UtfToUniChar(src, &ch); + src += TkUtfToUniChar(src, &ch); dst[0] = '\\'; if (((size_t)ch < sizeof(mapChars)) && (mapChars[ch] != 0)) { dst[1] = mapChars[ch]; dst += 2; } else if ((size_t)ch < 256) { @@ -451,10 +473,206 @@ *dstWrotePtr = dst - dstStart; *dstCharsPtr = dst - dstStart; return result; } +/* + *------------------------------------------------------------------------- + * + * Ucs2beToUtfProc -- + * + * Convert from UCS-2BE (big-endian 16-bit Unicode) to UTF-8. + * + * Results: + * Returns TCL_OK if conversion was successful. + * + * Side effects: + * None. + * + *------------------------------------------------------------------------- + */ + +#if TCL_MAJOR_VERSION < 9 +static int +Ucs2beToUtfProc( + TCL_UNUSED(void *), /* Not used. */ + const char *src, /* Source string in Unicode. */ + int srcLen, /* Source string length in bytes. */ + int flags, /* Conversion control flags. */ + TCL_UNUSED(Tcl_EncodingState *),/* Place for conversion routine to store state + * information used during a piecewise + * conversion. Contents of statePtr are + * initialized and/or reset by conversion + * routine under control of flags argument. */ + char *dst, /* Output buffer in which converted string is + * stored. */ + int dstLen, /* The maximum length of output buffer in + * bytes. */ + int *srcReadPtr, /* Filled with the number of bytes from the + * source string that were converted. This may + * be less than the original source length if + * there was a problem converting some source + * characters. */ + int *dstWrotePtr, /* Filled with the number of bytes that were + * stored in the output buffer as a result of + * the conversion. */ + int *dstCharsPtr) /* Filled with the number of characters that + * correspond to the bytes stored in the + * output buffer. */ +{ + const char *srcStart, *srcEnd; + const char *dstEnd, *dstStart; + int result, numChars, charLimit = INT_MAX; + unsigned short ch; + + if (flags & TCL_ENCODING_CHAR_LIMIT) { + charLimit = *dstCharsPtr; + } + result = TCL_OK; + + /* check alignment with ucs-2 (2 == sizeof(UCS-2)) */ + if ((srcLen % 2) != 0) { + result = TCL_CONVERT_MULTIBYTE; + srcLen--; + } + /* If last code point is a high surrogate, we cannot handle that yet */ + if ((srcLen >= 2) && ((src[srcLen - 2] & 0xFC) == 0xD8)) { + result = TCL_CONVERT_MULTIBYTE; + srcLen -= 2; + } + + srcStart = src; + srcEnd = src + srcLen; + + dstStart = dst; + dstEnd = dst + dstLen - 4; + + for (numChars = 0; src < srcEnd && numChars <= charLimit; numChars++) { + if (dst > dstEnd) { + result = TCL_CONVERT_NOSPACE; + break; + } + + ch = (src[0] & 0xFF) << 8 | (src[1] & 0xFF); + src += 2 /* sizeof(UTF-16) */; + + /* + * Special case for 1-byte utf chars for speed. Make sure we work with + * unsigned short-size data. + */ + if (ch && ch < 0x80) { + *dst++ = (ch & 0xFF); + } else { + dst += Tcl_UniCharToUtf(ch, dst); + } + } + + *srcReadPtr = src - srcStart; + *dstWrotePtr = dst - dstStart; + *dstCharsPtr = numChars; + return result; +} + +/* + *------------------------------------------------------------------------- + * + * UtfToUcs2beProc -- + * + * Convert from UTF-8 to UCS-2BE (fixed 2-byte encoding). + * + * Results: + * Returns TCL_OK if conversion was successful. + * + * Side effects: + * None. + * + *------------------------------------------------------------------------- + */ + +#if defined(USE_TCL_STUBS) +/* Since the UCS-2BE encoding is only used when Tk is dynamically loaded in Tcl 8.6, + * make sure that Tcl_UtfCharComplete is ALWAYS the pre-TIP #575 version, + * even though Tk is being compiled with -DTCL_NO_DEPRECATED! */ +# undef Tcl_UtfCharComplete +# define Tcl_UtfCharComplete ((int (*)(const char *, int))(void *)((&tclStubsPtr->tcl_PkgProvideEx)[326])) +#endif + +static int +UtfToUcs2beProc( + TCL_UNUSED(void *), /* TableEncodingData that specifies + * encoding. */ + const char *src, /* Source string in UTF-8. */ + int srcLen, /* Source string length in bytes. */ + int flags, /* Conversion control flags. */ + TCL_UNUSED(Tcl_EncodingState *),/* Place for conversion routine to store state + * information used during a piecewise + * conversion. Contents of statePtr are + * initialized and/or reset by conversion + * routine under control of flags argument. */ + char *dst, /* Output buffer in which converted string is + * stored. */ + int dstLen, /* The maximum length of output buffer in + * bytes. */ + int *srcReadPtr, /* Filled with the number of bytes from the + * source string that were converted. This may + * be less than the original source length if + * there was a problem converting some source + * characters. */ + int *dstWrotePtr, /* Filled with the number of bytes that were + * stored in the output buffer as a result of + * the conversion. */ + int *dstCharsPtr) /* Filled with the number of characters that + * correspond to the bytes stored in the + * output buffer. */ +{ + const char *srcStart, *srcEnd, *srcClose, *dstStart, *dstEnd; + int result, numChars; + int ch; + + srcStart = src; + srcEnd = src + srcLen; + srcClose = srcEnd; + if (!(flags & TCL_ENCODING_END)) { + srcClose -= 6; + } + + dstStart = dst; + dstEnd = dst + dstLen - 2 /* sizeof(UCS-2) */; + + result = TCL_OK; + for (numChars = 0; src < srcEnd; numChars++) { + if ((src > srcClose) && (!Tcl_UtfCharComplete(src, srcEnd - src))) { + /* + * If there is more string to follow, this will ensure that the + * last UTF-8 character in the source buffer hasn't been cut off. + */ + result = TCL_CONVERT_MULTIBYTE; + break; + } + if (dst > dstEnd) { + result = TCL_CONVERT_NOSPACE; + break; + } + src += TkUtfToUniChar(src, &ch); + if (ch > 0xFFFF) { + ch = 0xFFFD; + } + + /* + * Ensure big-endianness (store big bits first). + */ + + *dst++ = (char)((ch >> 8) & 0xFF); + *dst++ = (char)(ch & 0xFF); + } + *srcReadPtr = src - srcStart; + *dstWrotePtr = dst - dstStart; + *dstCharsPtr = numChars; + return result; +} +#endif + /* *--------------------------------------------------------------------------- * * TkpGetNativeFont -- * @@ -868,15 +1086,15 @@ */ curX = 0; end = source + numBytes; for (p = source; p < end; ) { - next = p + Tcl_UtfToUniChar(p, &ch); + next = p + TkUtfToUniChar(p, &ch); thisSubFontPtr = FindSubFontForChar(fontPtr, ch, &lastSubFontPtr); if (thisSubFontPtr != lastSubFontPtr) { familyPtr = lastSubFontPtr->familyPtr; - (void)Tcl_UtfToExternalDString(familyPtr->encoding, source, + Tcl_UtfToExternalDString(familyPtr->encoding, source, p - source, &runString); if (familyPtr->isTwoByteFont) { curX += XTextWidth16(lastSubFontPtr->fontStructPtr, (XChar2b *) Tcl_DStringValue(&runString), Tcl_DStringLength(&runString) / 2); @@ -890,11 +1108,11 @@ source = p; } p = next; } familyPtr = lastSubFontPtr->familyPtr; - (void)Tcl_UtfToExternalDString(familyPtr->encoding, source, p - source, + Tcl_UtfToExternalDString(familyPtr->encoding, source, p - source, &runString); if (familyPtr->isTwoByteFont) { curX += XTextWidth16(lastSubFontPtr->fontStructPtr, (XChar2b *) Tcl_DStringValue(&runString), Tcl_DStringLength(&runString) >> 1); @@ -915,11 +1133,11 @@ * How many chars will fit in the space allotted? This first version * may be inefficient because it measures every character * individually. */ - next = source + Tcl_UtfToUniChar(source, &ch); + next = source + TkUtfToUniChar(source, &ch); newX = curX = termX = 0; term = source; end = source + numBytes; @@ -950,11 +1168,11 @@ term = end; termX = curX; break; } - next += Tcl_UtfToUniChar(next, &ch); + next += TkUtfToUniChar(next, &ch); if ((ch < 256) && isspace(ch)) { if (sawNonSpace) { term = p; termX = curX; sawNonSpace = 0; @@ -975,17 +1193,17 @@ * desired span. The width returned will include the width of that * extra character. */ curX = newX; - p += Tcl_UtfToUniChar(p, &ch); + p += TkUtfToUniChar(p, &ch); } if ((flags & TK_AT_LEAST_ONE) && (term == source) && (p < end)) { term = p; termX = curX; if (term == source) { - term += Tcl_UtfToUniChar(term, &ch); + term += TkUtfToUniChar(term, &ch); termX = newX; } } else if ((p >= end) || !(flags & TK_WHOLE_WORDS)) { term = p; termX = curX; @@ -1000,15 +1218,15 @@ } /* *--------------------------------------------------------------------------- * - * TkpMeasureCharsInContext -- + * Tk_MeasureCharsInContext -- * * Determine the number of bytes from the string that will fit in the * given horizontal span. The measurement is done under the assumption - * that TkpDrawCharsInContext() will be used to actually display the + * that Tk_MeasureCharsInContext() will be used to actually display the * characters. * * This one is almost the same as Tk_MeasureChars(), but with access to * all the characters on the line for context. On X11 this context isn't * consulted, so we just call Tk_MeasureChars(). @@ -1023,11 +1241,11 @@ * *--------------------------------------------------------------------------- */ int -TkpMeasureCharsInContext( +Tk_MeasureCharsInContext( Tk_Font tkfont, /* Font in which characters will be drawn. */ const char *source, /* UTF-8 string to be displayed. Need not be * '\0' terminated. */ TCL_UNUSED(Tcl_Size), /* Maximum number of bytes to consider from * source string in all. */ @@ -1127,11 +1345,11 @@ end = source + numBytes; needWidth = fontPtr->font.fa.underline + fontPtr->font.fa.overstrike; for (p = source; p <= end; ) { if (p < end) { - next = p + Tcl_UtfToUniChar(p, &ch); + next = p + TkUtfToUniChar(p, &ch); thisSubFontPtr = FindSubFontForChar(fontPtr, ch, &lastSubFontPtr); } else { next = p + 1; thisSubFontPtr = lastSubFontPtr; } @@ -1139,11 +1357,11 @@ || (p == end) || (p-source > 200)) { if (p > source) { do_width = (needWidth || (p != end)) ? 1 : 0; familyPtr = lastSubFontPtr->familyPtr; - (void)Tcl_UtfToExternalDString(familyPtr->encoding, source, + Tcl_UtfToExternalDString(familyPtr->encoding, source, p - source, &runString); if (familyPtr->isTwoByteFont) { XDrawString16(display, drawable, gc, x, y, (XChar2b *) Tcl_DStringValue(&runString), Tcl_DStringLength(&runString) / 2); @@ -1191,18 +1409,18 @@ } /* *--------------------------------------------------------------------------- * - * TkpDrawCharsInContext -- + * Tk_DrawCharsInContext -- * * Draw a string of characters on the screen like Tk_DrawChars(), but * with access to all the characters on the line for context. On X11 this * context isn't consulted, so we just call Tk_DrawChars(). * * Note: TK_DRAW_IN_CONTEXT being currently defined only on macOS, this - * function is unused (and possibly unfinished). See [7655f65ae7]. + * function is unused. * * Results: * None. * * Side effects: @@ -1210,11 +1428,11 @@ * *--------------------------------------------------------------------------- */ void -TkpDrawCharsInContext( +Tk_DrawCharsInContext( Display *display, /* Display on which to draw. */ Drawable drawable, /* Window or pixmap in which to draw. */ GC gc, /* Graphics context for drawing characters. */ Tk_Font tkfont, /* Font in which characters will be drawn; * must be the same as font used in GC. */ @@ -2104,12 +2322,12 @@ end = (row + 1) << FONTMAP_SHIFT; for (i = row << FONTMAP_SHIFT; i < end; i++) { int hi, lo; - if (Tcl_UtfToExternal(NULL, encoding, src, Tcl_UniCharToUtf(i, src), - TCL_ENCODING_PROFILE_STRICT, NULL, buf, sizeof(buf), NULL, + if (Tcl_UtfToExternal(NULL, encoding, src, TkUniCharToUtf(i, src), + TCL_ENCODING_STOPONERROR, NULL, buf, sizeof(buf), NULL, NULL, NULL) != TCL_OK) { continue; } if (isTwoByteFont) { hi = ((unsigned char *) buf)[0]; @@ -2300,11 +2518,11 @@ if (numNames == 0) { return NULL; } nameListOrig = nameList; - srcLen = Tcl_UniCharToUtf(ch, src); + srcLen = TkUniCharToUtf(ch, src); want.fa = fontPtr->font.fa; want.xa = fontPtr->xa; want.fa.family = Tk_GetUid(faceName); @@ -2379,11 +2597,11 @@ Tcl_DStringAppend(&dsEncodings, (char *) &encoding, sizeof(encoding)); numEncodings++; } Tcl_UtfToExternal(NULL, encoding, src, srcLen, - TCL_ENCODING_PROFILE_STRICT, NULL, dst, sizeof(dst), &srcRead, + TCL_ENCODING_STOPONERROR, NULL, dst, sizeof(dst), &srcRead, &dstWrote, NULL); if (dstWrote == 0) { goto crossout; } Index: unix/tkUnixKey.c ================================================================== --- unix/tkUnixKey.c +++ unix/tkUnixKey.c @@ -194,11 +194,11 @@ len = (Tcl_Size)XLookupString(&eventPtr->xkey, Tcl_DStringValue(&buf), TCL_DSTRING_STATIC_SIZE, &kePtr->keysym, 0); Tcl_DStringValue(&buf)[len] = '\0'; if (len == 1) { - len = Tcl_UniCharToUtf((unsigned char) Tcl_DStringValue(&buf)[0], + len = TkUniCharToUtf((unsigned char) Tcl_DStringValue(&buf)[0], Tcl_DStringValue(dsPtr)); Tcl_DStringSetLength(dsPtr, len); } else { /* * len > 1 should only happen if someone has called XRebindKeysym. Index: unix/tkUnixMenu.c ================================================================== --- unix/tkUnixMenu.c +++ unix/tkUnixMenu.c @@ -351,17 +351,17 @@ mePtr->platformEntryData = (TkMenuPlatformEntryData) INT2PTR(mePtr->height); } } } else { - Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->borderWidthObj, + Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->borderWidthPtr, &borderWidth); *heightPtr = 0; *widthPtr = borderWidth; } } else { - Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->borderWidthObj, + Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->borderWidthPtr, &borderWidth); *heightPtr = 0; *widthPtr = borderWidth; } } @@ -499,11 +499,11 @@ if (menuPtr->menuType == MENUBAR) { return; } - Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->borderWidthObj, + Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->borderWidthPtr, &borderWidth); Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->activeBorderWidthPtr, &activeBorderWidth); if ((mePtr->type == CASCADE_ENTRY) && drawArrow) { arrowWidth *= scalingLevel; @@ -858,18 +858,18 @@ TCL_UNUSED(int), int height) { if (mePtr->labelPtr != NULL) { int len; - len = Tcl_GetCharLength(mePtr->labelPtr); + len = TkGetCharLength(mePtr->labelPtr); if (mePtr->underline < len && mePtr->underline >= -len) { int activeBorderWidth, leftEdge, ch; const char *label, *start, *end; label = Tcl_GetString(mePtr->labelPtr); - start = Tcl_UtfAtIndex(label, (mePtr->underline < 0) ? mePtr->underline + len : mePtr->underline); - end = start + Tcl_UtfToUniChar(start, &ch); + start = TkUtfAtIndex(label, (mePtr->underline < 0) ? mePtr->underline + len : mePtr->underline); + end = start + TkUtfToUniChar(start, &ch); Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->activeBorderWidthPtr, &activeBorderWidth); leftEdge = x + mePtr->indicatorSpace + activeBorderWidth; if (menuPtr->menuType == MENUBAR) { @@ -1119,11 +1119,11 @@ maxWindowWidth = Tk_Width(menuPtr->tkwin); if (maxWindowWidth == 1) { maxWindowWidth = 0x7FFFFFF; } currentRowHeight = 0; - Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->borderWidthObj, + Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->borderWidthPtr, &borderWidth); x = y = borderWidth; lastRowBreak = 0; /* @@ -1693,11 +1693,11 @@ if (menuPtr->tkwin == NULL) { return; } - Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->borderWidthObj, + Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->borderWidthPtr, &borderWidth); Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->activeBorderWidthPtr, &activeBorderWidth); x = y = borderWidth; indicatorSpace = labelWidth = accelWidth = 0; Index: unix/tkUnixMenubu.c ================================================================== --- unix/tkUnixMenubu.c +++ unix/tkUnixMenubu.c @@ -72,12 +72,10 @@ int imageXOffset, imageYOffset; int width = 0, height = 0; /* Image information that will be used to * restrict disabled pixmap as well */ int haveImage = 0, haveText = 0; - int padX, padY; - int mbPtrBorderWidth, highlightWidth; mbPtr->flags &= ~REDRAW_PENDING; if ((mbPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) { return; } @@ -123,26 +121,24 @@ textXOffset = 0; textYOffset = 0; fullWidth = 0; fullHeight = 0; - Tk_GetPixelsFromObj(NULL, mbPtr->tkwin, mbPtr->padXObj, &padX); - Tk_GetPixelsFromObj(NULL, mbPtr->tkwin, mbPtr->padYObj, &padY); if (mbPtr->compound != COMPOUND_NONE && haveImage && haveText) { switch ((enum compound) mbPtr->compound) { case COMPOUND_TOP: case COMPOUND_BOTTOM: /* * Image is above or below text. */ if (mbPtr->compound == COMPOUND_TOP) { - textYOffset = height + padY; + textYOffset = height + mbPtr->padY; } else { - imageYOffset = mbPtr->textHeight + padY; + imageYOffset = mbPtr->textHeight + mbPtr->padY; } - fullHeight = height + mbPtr->textHeight + padY; + fullHeight = height + mbPtr->textHeight + mbPtr->padY; fullWidth = (width > mbPtr->textWidth ? width : mbPtr->textWidth); textXOffset = (fullWidth - mbPtr->textWidth)/2; imageXOffset = (fullWidth - width)/2; break; case COMPOUND_LEFT: @@ -150,15 +146,15 @@ /* * Image is left or right of text. */ if (mbPtr->compound == COMPOUND_LEFT) { - textXOffset = width + padX; + textXOffset = width + mbPtr->padX; } else { - imageXOffset = mbPtr->textWidth + padX; + imageXOffset = mbPtr->textWidth + mbPtr->padX; } - fullWidth = mbPtr->textWidth + padX + width; + fullWidth = mbPtr->textWidth + mbPtr->padX + width; fullHeight = (height > mbPtr->textHeight ? height : mbPtr->textHeight); textYOffset = (fullHeight - mbPtr->textHeight)/2; imageYOffset = (fullHeight - height)/2; break; @@ -213,11 +209,11 @@ gc, 0, 0, (unsigned) width, (unsigned) height, x, y, 1); XSetClipOrigin(mbPtr->display, gc, 0, 0); } } else { - TkComputeAnchor(mbPtr->anchor, tkwin, padX, padY, + TkComputeAnchor(mbPtr->anchor, tkwin, mbPtr->padX, mbPtr->padY, mbPtr->textWidth + mbPtr->indicatorWidth, mbPtr->textHeight, &x, &y); Tk_DrawTextLayout(mbPtr->display, pixmap, gc, mbPtr->textLayout, x + textXOffset, y + textYOffset, 0, -1); Tk_UnderlineTextLayout(mbPtr->display, pixmap, gc, @@ -274,26 +270,24 @@ * Draw the border and traversal highlight last. This way, if the menu * button's contents overflow onto the border they'll be covered up by the * border. */ - Tk_GetPixelsFromObj(NULL, mbPtr->tkwin, mbPtr->borderWidthObj, &mbPtrBorderWidth); - Tk_GetPixelsFromObj(NULL, mbPtr->tkwin, mbPtr->highlightWidthObj, &highlightWidth); if (mbPtr->relief != TK_RELIEF_FLAT) { Tk_Draw3DRectangle(tkwin, pixmap, border, - highlightWidth, highlightWidth, - Tk_Width(tkwin) - 2 * highlightWidth, - Tk_Height(tkwin) - 2 * highlightWidth, - mbPtrBorderWidth, mbPtr->relief); + mbPtr->highlightWidth, mbPtr->highlightWidth, + Tk_Width(tkwin) - 2*mbPtr->highlightWidth, + Tk_Height(tkwin) - 2*mbPtr->highlightWidth, + mbPtr->borderWidth, mbPtr->relief); } - if (highlightWidth > 0) { + if (mbPtr->highlightWidth > 0) { if (mbPtr->flags & GOT_FOCUS) { gc = Tk_GCForColor(mbPtr->highlightColorPtr, pixmap); } else { gc = Tk_GCForColor(mbPtr->highlightBgColorPtr, pixmap); } - Tk_DrawFocusHighlight(tkwin, gc, highlightWidth, pixmap); + Tk_DrawFocusHighlight(tkwin, gc, mbPtr->highlightWidth, pixmap); } /* * Copy the information from the off-screen pixmap onto the screen, then * delete the pixmap. @@ -351,19 +345,12 @@ { int width, height, mm, pixels; int avgWidth, txtWidth, txtHeight; int haveImage = 0, haveText = 0; Tk_FontMetrics fm; - int borderWidth, highlightWidth, wrapLength; - int padX, padY; - - Tk_GetPixelsFromObj(NULL, mbPtr->tkwin, mbPtr->padXObj, &padX); - Tk_GetPixelsFromObj(NULL, mbPtr->tkwin, mbPtr->padYObj, &padY); - Tk_GetPixelsFromObj(NULL, mbPtr->tkwin, mbPtr->borderWidthObj, &borderWidth); - Tk_GetPixelsFromObj(NULL, mbPtr->tkwin, mbPtr->highlightWidthObj, &highlightWidth); - Tk_GetPixelsFromObj(NULL, mbPtr->tkwin, mbPtr->wrapLengthObj, &wrapLength); - mbPtr->inset = highlightWidth + borderWidth; + + mbPtr->inset = mbPtr->highlightWidth + mbPtr->borderWidth; width = 0; height = 0; txtWidth = 0; txtHeight = 0; @@ -379,11 +366,11 @@ if (haveImage == 0 || mbPtr->compound != COMPOUND_NONE) { Tk_FreeTextLayout(mbPtr->textLayout); mbPtr->textLayout = Tk_ComputeTextLayout(mbPtr->tkfont, mbPtr->textObj ? Tcl_GetString(mbPtr->textObj) : "", - TCL_INDEX_NONE, wrapLength, mbPtr->justify, 0, &mbPtr->textWidth, + TCL_INDEX_NONE, mbPtr->wrapLength, mbPtr->justify, 0, &mbPtr->textWidth, &mbPtr->textHeight); txtWidth = mbPtr->textWidth; txtHeight = mbPtr->textHeight; avgWidth = Tk_TextWidth(mbPtr->tkfont, "0", 1); Tk_GetFontMetrics(mbPtr->tkfont, &fm); @@ -403,20 +390,20 @@ case COMPOUND_BOTTOM: /* * Image is above or below text. */ - height += txtHeight + padY; + height += txtHeight + mbPtr->padY; width = (width > txtWidth ? width : txtWidth); break; case COMPOUND_LEFT: case COMPOUND_RIGHT: /* * Image is left or right of text. */ - width += txtWidth + padX; + width += txtWidth + mbPtr->padX; height = (height > txtHeight ? height : txtHeight); break; case COMPOUND_CENTER: /* * Image and text are superimposed. @@ -432,12 +419,12 @@ width = mbPtr->width; } if (mbPtr->height > 0) { height = mbPtr->height; } - width += 2 * padX; - height += 2 * padY; + width += 2*mbPtr->padX; + height += 2*mbPtr->padY; } else { if (haveImage) { if (mbPtr->width > 0) { width = mbPtr->width; } @@ -455,28 +442,28 @@ } } } if (! haveImage) { - width += 2 * padX; - height += 2 * padY; + width += 2*mbPtr->padX; + height += 2*mbPtr->padY; } if (mbPtr->indicatorOn) { mm = WidthMMOfScreen(Tk_Screen(mbPtr->tkwin)); pixels = WidthOfScreen(Tk_Screen(mbPtr->tkwin)); mbPtr->indicatorHeight= (INDICATOR_HEIGHT * pixels)/(10*mm); mbPtr->indicatorWidth = (INDICATOR_WIDTH * pixels)/(10*mm) - + 2 * mbPtr->indicatorHeight; + + 2*mbPtr->indicatorHeight; width += mbPtr->indicatorWidth; } else { mbPtr->indicatorHeight = 0; mbPtr->indicatorWidth = 0; } - Tk_GeometryRequest(mbPtr->tkwin, (int) (width + 2 * mbPtr->inset), - (int) (height + 2 * mbPtr->inset)); + Tk_GeometryRequest(mbPtr->tkwin, (int) (width + 2*mbPtr->inset), + (int) (height + 2*mbPtr->inset)); Tk_SetInternalBorder(mbPtr->tkwin, mbPtr->inset); } /* * Local Variables: Index: unix/tkUnixPort.h ================================================================== --- unix/tkUnixPort.h +++ unix/tkUnixPort.h @@ -143,10 +143,19 @@ #define TkSelUpdateClipboard(a,b) {} #ifndef __CYGWIN__ #define TkSetPixmapColormap(p,c) {} #endif +/* + * These calls implement native bitmaps which are not supported under + * UNIX. The macros eliminate the calls. + */ + +#define TkpDefineNativeBitmaps() +#define TkpCreateNativeBitmap(display, source) None +#define TkpGetNativeAppBitmap(display, name, w, h) None + /* * This macro stores a representation of the window handle in a string. * This should perhaps use the real size of an XID. */ Index: unix/tkUnixRFont.c ================================================================== --- unix/tkUnixRFont.c +++ unix/tkUnixRFont.c @@ -88,11 +88,11 @@ */ static Tcl_Size utf8ToUcs4(const char *source, FcChar32 *c, Tcl_Size numBytes) { if (numBytes >= 6) { - return Tcl_UtfToUniChar(source, (int *)c); + return TkUtfToUniChar(source, (int *)c); } return FcUtf8ToUcs4((const FcChar8 *)source, c, numBytes); } void @@ -752,11 +752,11 @@ curByte = 0; sawNonSpace = 0; while (numBytes > 0) { int unichar; - clen = Tcl_UtfToUniChar(source, &unichar); + clen = TkUtfToUniChar(source, &unichar); c = (FcChar32) unichar; if (clen <= 0) { /* * This can't happen (but see #1185640) @@ -828,11 +828,11 @@ *lengthPtr = curX; return curByte; } int -TkpMeasureCharsInContext( +Tk_MeasureCharsInContext( Tk_Font tkfont, const char *source, TCL_UNUSED(Tcl_Size), Tcl_Size rangeStart, Tcl_Size rangeLength, @@ -1346,18 +1346,18 @@ } /* *--------------------------------------------------------------------------- * - * TkpDrawCharsInContext -- + * Tk_DrawCharsInContext -- * * Draw a string of characters on the screen like Tk_DrawChars(), but * with access to all the characters on the line for context. On X11 this * context isn't consulted, so we just call Tk_DrawChars(). * * Note: TK_DRAW_IN_CONTEXT being currently defined only on macOS, this - * function is unused (and possibly unfinished). See [7655f65ae7]. + * function is unused. * * Results: * None. * * Side effects: @@ -1365,11 +1365,11 @@ * *--------------------------------------------------------------------------- */ void -TkpDrawCharsInContext( +Tk_DrawCharsInContext( Display *display, /* Display on which to draw. */ Drawable drawable, /* Window or pixmap in which to draw. */ GC gc, /* Graphics context for drawing characters. */ Tk_Font tkfont, /* Font in which characters will be drawn; * must be the same as font used in GC. */ Index: unix/tkUnixScale.c ================================================================== --- unix/tkUnixScale.c +++ unix/tkUnixScale.c @@ -112,24 +112,20 @@ { Tk_Window tkwin = scalePtr->tkwin; int x, y, width, height, shadowWidth; double tickValue, tickInterval = scalePtr->tickInterval; Tk_3DBorder sliderBorder; - int scaleWidth, borderWidth, sliderLength; /* * Display the information from left to right across the window. */ - Tk_GetPixelsFromObj(NULL, tkwin, scalePtr->widthObj, &scaleWidth); - Tk_GetPixelsFromObj(NULL, tkwin, scalePtr->borderWidthObj, &borderWidth); - Tk_GetPixelsFromObj(NULL, tkwin, scalePtr->sliderLengthObj, &sliderLength); if (!(scalePtr->flags & REDRAW_OTHER)) { drawnAreaPtr->x = scalePtr->vertTickRightX; drawnAreaPtr->y = scalePtr->inset; - drawnAreaPtr->width = scalePtr->vertTroughX + scaleWidth - + 2 * borderWidth - scalePtr->vertTickRightX; + drawnAreaPtr->width = scalePtr->vertTroughX + scalePtr->width + + 2 * scalePtr->borderWidth - scalePtr->vertTickRightX; drawnAreaPtr->height -= 2 * scalePtr->inset; } Tk_Fill3DRectangle(tkwin, drawable, scalePtr->bgBorder, drawnAreaPtr->x, drawnAreaPtr->y, drawnAreaPtr->width, drawnAreaPtr->height, 0, TK_RELIEF_FLAT); @@ -189,34 +185,34 @@ * Display the trough and the slider. */ Tk_Draw3DRectangle(tkwin, drawable, scalePtr->bgBorder, scalePtr->vertTroughX, scalePtr->inset, - scaleWidth + 2 * borderWidth, - Tk_Height(tkwin) - 2 * scalePtr->inset, borderWidth, + scalePtr->width + 2 * scalePtr->borderWidth, + Tk_Height(tkwin) - 2 * scalePtr->inset, scalePtr->borderWidth, TK_RELIEF_SUNKEN); XFillRectangle(scalePtr->display, drawable, scalePtr->troughGC, - scalePtr->vertTroughX + borderWidth, - scalePtr->inset + borderWidth, - (unsigned) scaleWidth, + scalePtr->vertTroughX + scalePtr->borderWidth, + scalePtr->inset + scalePtr->borderWidth, + (unsigned) scalePtr->width, (unsigned) (Tk_Height(tkwin) - 2 * scalePtr->inset - - 2 * borderWidth)); + - 2 * scalePtr->borderWidth)); if (scalePtr->state == STATE_ACTIVE) { sliderBorder = scalePtr->activeBorder; } else { sliderBorder = scalePtr->bgBorder; } - width = scaleWidth; - height = sliderLength / 2; - x = scalePtr->vertTroughX + borderWidth; + width = scalePtr->width; + height = scalePtr->sliderLength / 2; + x = scalePtr->vertTroughX + scalePtr->borderWidth; y = TkScaleValueToPixel(scalePtr, scalePtr->value) - height; - shadowWidth = borderWidth / 2; + shadowWidth = scalePtr->borderWidth / 2; if (shadowWidth == 0) { shadowWidth = 1; } Tk_Draw3DRectangle(tkwin, drawable, sliderBorder, x, y, width, - 2 * height, shadowWidth, scalePtr->sliderRelief); + 2*height, shadowWidth, scalePtr->sliderRelief); x += shadowWidth; y += shadowWidth; width -= 2 * shadowWidth; height -= shadowWidth; Tk_Fill3DRectangle(tkwin, drawable, sliderBorder, x, y, width, @@ -233,11 +229,12 @@ Tcl_Size labelLength; const char *label = Tcl_GetStringFromObj(scalePtr->labelObj, &labelLength); Tk_GetFontMetrics(scalePtr->tkfont, &fm); Tk_DrawChars(scalePtr->display, drawable, scalePtr->textGC, - scalePtr->tkfont, label, labelLength, scalePtr->vertLabelX, + scalePtr->tkfont, label, + labelLength, scalePtr->vertLabelX, scalePtr->inset + (3 * fm.ascent) / 2); } } /* @@ -332,25 +329,21 @@ { Tk_Window tkwin = scalePtr->tkwin; int x, y, width, height, shadowWidth; double tickInterval = scalePtr->tickInterval; Tk_3DBorder sliderBorder; - int scaleWidth, borderWidth, sliderLength; /* * Display the information from bottom to top across the window. */ - Tk_GetPixelsFromObj(NULL, tkwin, scalePtr->widthObj, &scaleWidth); - Tk_GetPixelsFromObj(NULL, tkwin, scalePtr->borderWidthObj, &borderWidth); - Tk_GetPixelsFromObj(NULL, tkwin, scalePtr->sliderLengthObj, &sliderLength); if (!(scalePtr->flags & REDRAW_OTHER)) { drawnAreaPtr->x = scalePtr->inset; drawnAreaPtr->y = scalePtr->horizValueY; drawnAreaPtr->width -= 2*scalePtr->inset; - drawnAreaPtr->height = scalePtr->horizTroughY + scaleWidth - + 2 * borderWidth - scalePtr->horizValueY; + drawnAreaPtr->height = scalePtr->horizTroughY + scalePtr->width + + 2 * scalePtr->borderWidth - scalePtr->horizValueY; } Tk_Fill3DRectangle(tkwin, drawable, scalePtr->bgBorder, drawnAreaPtr->x, drawnAreaPtr->y, drawnAreaPtr->width, drawnAreaPtr->height, 0, TK_RELIEF_FLAT); if (scalePtr->flags & REDRAW_OTHER) { @@ -418,28 +411,28 @@ y = scalePtr->horizTroughY; Tk_Draw3DRectangle(tkwin, drawable, scalePtr->bgBorder, scalePtr->inset, y, Tk_Width(tkwin) - 2 * scalePtr->inset, - scaleWidth + 2 * borderWidth, - borderWidth, TK_RELIEF_SUNKEN); + scalePtr->width + 2 * scalePtr->borderWidth, + scalePtr->borderWidth, TK_RELIEF_SUNKEN); XFillRectangle(scalePtr->display, drawable, scalePtr->troughGC, - scalePtr->inset + borderWidth, - y + borderWidth, + scalePtr->inset + scalePtr->borderWidth, + y + scalePtr->borderWidth, (unsigned) (Tk_Width(tkwin) - 2 * scalePtr->inset - - 2 * borderWidth), - (unsigned) scaleWidth); + - 2 * scalePtr->borderWidth), + (unsigned) scalePtr->width); if (scalePtr->state == STATE_ACTIVE) { sliderBorder = scalePtr->activeBorder; } else { sliderBorder = scalePtr->bgBorder; } - width = sliderLength / 2; - height = scaleWidth; + width = scalePtr->sliderLength / 2; + height = scalePtr->width; x = TkScaleValueToPixel(scalePtr, scalePtr->value) - width; - y += borderWidth; - shadowWidth = borderWidth / 2; + y += scalePtr->borderWidth; + shadowWidth = scalePtr->borderWidth / 2; if (shadowWidth == 0) { shadowWidth = 1; } Tk_Draw3DRectangle(tkwin, drawable, sliderBorder, x, y, 2*width, height, shadowWidth, scalePtr->sliderRelief); @@ -562,14 +555,13 @@ Pixmap pixmap; int result; char string[TCL_DOUBLE_SPACE]; XRectangle drawnArea; Tcl_DString buf; - int highlightWidth, borderWidth; scalePtr->flags &= ~REDRAW_PENDING; - if ((tkwin == NULL) || !Tk_IsMapped(tkwin)) { + if ((scalePtr->tkwin == NULL) || !Tk_IsMapped(scalePtr->tkwin)) { goto done; } /* * Invoke the scale's command if needed. @@ -633,30 +625,28 @@ /* * Now handle the part of redisplay that is the same for horizontal and * vertical scales: border and traversal highlight. */ - Tk_GetPixelsFromObj(NULL, tkwin, scalePtr->highlightWidthObj, &highlightWidth); - Tk_GetPixelsFromObj(NULL, tkwin, scalePtr->borderWidthObj, &borderWidth); if (scalePtr->flags & REDRAW_OTHER) { if (scalePtr->relief != TK_RELIEF_FLAT) { Tk_Draw3DRectangle(tkwin, pixmap, scalePtr->bgBorder, - highlightWidth, highlightWidth, - Tk_Width(tkwin) - 2 * highlightWidth, - Tk_Height(tkwin) - 2 * highlightWidth, - borderWidth, scalePtr->relief); + scalePtr->highlightWidth, scalePtr->highlightWidth, + Tk_Width(tkwin) - 2 * scalePtr->highlightWidth, + Tk_Height(tkwin) - 2 * scalePtr->highlightWidth, + scalePtr->borderWidth, scalePtr->relief); } - if (highlightWidth > 0) { + if (scalePtr->highlightWidth > 0) { GC gc; if (scalePtr->flags & GOT_FOCUS) { gc = Tk_GCForColor(scalePtr->highlightColorPtr, pixmap); } else { gc = Tk_GCForColor( Tk_3DBorderColor(scalePtr->highlightBorder), pixmap); } - Tk_DrawFocusHighlight(tkwin, gc, highlightWidth, pixmap); + Tk_DrawFocusHighlight(tkwin, gc, scalePtr->highlightWidth, pixmap); } } #ifndef TK_NO_DOUBLE_BUFFERING /* @@ -695,51 +685,48 @@ int TkpScaleElement( TkScale *scalePtr, /* Widget record for scale. */ int x, int y) /* Coordinates within scalePtr's window. */ { - int sliderFirst, width, borderWidth, sliderLength; + int sliderFirst; - Tk_GetPixelsFromObj(NULL, scalePtr->tkwin, scalePtr->widthObj, &width); - Tk_GetPixelsFromObj(NULL, scalePtr->tkwin, scalePtr->borderWidthObj, &borderWidth); - Tk_GetPixelsFromObj(NULL, scalePtr->tkwin, scalePtr->sliderLengthObj, &sliderLength); if (scalePtr->orient == ORIENT_VERTICAL) { if ((x < scalePtr->vertTroughX) - || (x >= (scalePtr->vertTroughX + 2 * borderWidth + - width))) { + || (x >= (scalePtr->vertTroughX + 2 * scalePtr->borderWidth + + scalePtr->width))) { return OTHER; } if ((y < scalePtr->inset) || (y >= (Tk_Height(scalePtr->tkwin) - scalePtr->inset))) { return OTHER; } sliderFirst = TkScaleValueToPixel(scalePtr, scalePtr->value) - - sliderLength/2; + - scalePtr->sliderLength/2; if (y < sliderFirst) { return TROUGH1; } - if (y < sliderFirst + sliderLength) { + if (y < sliderFirst + scalePtr->sliderLength) { return SLIDER; } return TROUGH2; } if ((y < scalePtr->horizTroughY) - || (y >= (scalePtr->horizTroughY + 2 * borderWidth + - width))) { + || (y >= (scalePtr->horizTroughY + 2 * scalePtr->borderWidth + + scalePtr->width))) { return OTHER; } if ((x < scalePtr->inset) || (x >= (Tk_Width(scalePtr->tkwin) - scalePtr->inset))) { return OTHER; } sliderFirst = TkScaleValueToPixel(scalePtr, scalePtr->value) - - sliderLength / 2; + - scalePtr->sliderLength/2; if (x < sliderFirst) { return TROUGH1; } - if (x < sliderFirst + sliderLength) { + if (x < sliderFirst + scalePtr->sliderLength) { return SLIDER; } return TROUGH2; } Index: unix/tkUnixScrlbr.c ================================================================== --- unix/tkUnixScrlbr.c +++ unix/tkUnixScrlbr.c @@ -100,27 +100,24 @@ TkScrollbar *scrollPtr = (TkScrollbar *)clientData; Tk_Window tkwin = scrollPtr->tkwin; XPoint points[7]; Tk_3DBorder border; int relief, width, elementBorderWidth; - int borderWidth, highlightWidth; Pixmap pixmap; if ((scrollPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) { goto done; } if (scrollPtr->vertical) { - width = Tk_Width(tkwin) - 2 * scrollPtr->inset; - } else { - width = Tk_Height(tkwin) - 2 * scrollPtr->inset; - } - Tk_GetPixelsFromObj(NULL, scrollPtr->tkwin, scrollPtr->borderWidthObj, &borderWidth); - if (scrollPtr->elementBorderWidthObj) { - Tk_GetPixelsFromObj(NULL, scrollPtr->tkwin, scrollPtr->elementBorderWidthObj, &elementBorderWidth); - } else { - elementBorderWidth = borderWidth; + width = Tk_Width(tkwin) - 2*scrollPtr->inset; + } else { + width = Tk_Height(tkwin) - 2*scrollPtr->inset; + } + elementBorderWidth = scrollPtr->elementBorderWidth; + if (elementBorderWidth < 0) { + elementBorderWidth = scrollPtr->borderWidth; } /* * In order to avoid screen flashes, this procedure redraws the scrollbar * in a pixmap, then copies the pixmap to the screen in a single @@ -129,31 +126,30 @@ */ pixmap = Tk_GetPixmap(scrollPtr->display, Tk_WindowId(tkwin), Tk_Width(tkwin), Tk_Height(tkwin), Tk_Depth(tkwin)); - Tk_GetPixelsFromObj(NULL, scrollPtr->tkwin, scrollPtr->highlightWidthObj, &highlightWidth); - if (highlightWidth > 0) { + if (scrollPtr->highlightWidth > 0) { GC gc; if (scrollPtr->flags & GOT_FOCUS) { gc = Tk_GCForColor(scrollPtr->highlightColorPtr, pixmap); } else { gc = Tk_GCForColor(scrollPtr->highlightBgColorPtr, pixmap); } - Tk_DrawFocusHighlight(tkwin, gc, highlightWidth, pixmap); + Tk_DrawFocusHighlight(tkwin, gc, scrollPtr->highlightWidth, pixmap); } Tk_Draw3DRectangle(tkwin, pixmap, scrollPtr->bgBorder, - highlightWidth, highlightWidth, - Tk_Width(tkwin) - 2 * highlightWidth, - Tk_Height(tkwin) - 2 * highlightWidth, - borderWidth, scrollPtr->relief); + scrollPtr->highlightWidth, scrollPtr->highlightWidth, + Tk_Width(tkwin) - 2*scrollPtr->highlightWidth, + Tk_Height(tkwin) - 2*scrollPtr->highlightWidth, + scrollPtr->borderWidth, scrollPtr->relief); XFillRectangle(scrollPtr->display, pixmap, ((UnixScrollbar*)scrollPtr)->troughGC, scrollPtr->inset, scrollPtr->inset, - (unsigned) (Tk_Width(tkwin) - 2 * scrollPtr->inset), - (unsigned) (Tk_Height(tkwin) - 2 * scrollPtr->inset)); + (unsigned) (Tk_Width(tkwin) - 2*scrollPtr->inset), + (unsigned) (Tk_Height(tkwin) - 2*scrollPtr->inset)); /* * Draw the top or left arrow. The coordinates of the polygon points * probably seem odd, but they were carefully chosen with respect to X's * rules for filling polygons. These point choices cause the arrows to @@ -284,26 +280,23 @@ TkScrollbar *scrollPtr) /* Scrollbar whose geometry may have * changed. */ { int width, fieldLength; - int borderWidth, highlightWidth; - Tk_GetPixelsFromObj(NULL, scrollPtr->tkwin, scrollPtr->borderWidthObj, &borderWidth); - Tk_GetPixelsFromObj(NULL, scrollPtr->tkwin, scrollPtr->highlightWidthObj, &highlightWidth); - scrollPtr->inset = highlightWidth + borderWidth; + scrollPtr->inset = scrollPtr->highlightWidth + scrollPtr->borderWidth; width = (scrollPtr->vertical) ? Tk_Width(scrollPtr->tkwin) : Tk_Height(scrollPtr->tkwin); /* * Next line assumes that the arrow area is a square. */ - scrollPtr->arrowLength = width - 2 * scrollPtr->inset + 1; + scrollPtr->arrowLength = width - 2*scrollPtr->inset + 1; fieldLength = (scrollPtr->vertical ? Tk_Height(scrollPtr->tkwin) : Tk_Width(scrollPtr->tkwin)) - - 2 * (scrollPtr->arrowLength + scrollPtr->inset); + - 2*(scrollPtr->arrowLength + scrollPtr->inset); if (fieldLength < 0) { fieldLength = 0; } scrollPtr->sliderFirst = fieldLength*scrollPtr->firstFraction; scrollPtr->sliderLast = fieldLength*scrollPtr->lastFraction; @@ -333,20 +326,19 @@ * Register the desired geometry for the window (leave enough space for * the two arrows plus a minimum-size slider, plus border around the whole * window, if any). Then arrange for the window to be redisplayed. */ - Tk_GetPixelsFromObj(NULL, scrollPtr->tkwin, scrollPtr->widthObj, &width); if (scrollPtr->vertical) { Tk_GeometryRequest(scrollPtr->tkwin, - width + 2 * scrollPtr->inset, - 2 * (scrollPtr->arrowLength + borderWidth + scrollPtr->width + 2*scrollPtr->inset, + 2*(scrollPtr->arrowLength + scrollPtr->borderWidth + scrollPtr->inset)); } else { Tk_GeometryRequest(scrollPtr->tkwin, - 2 * (scrollPtr->arrowLength + borderWidth - + scrollPtr->inset), width + 2 * scrollPtr->inset); + 2*(scrollPtr->arrowLength + scrollPtr->borderWidth + + scrollPtr->inset), scrollPtr->width + 2*scrollPtr->inset); } Tk_SetInternalBorder(scrollPtr->tkwin, scrollPtr->inset); } /* Index: win/Makefile.in ================================================================== --- win/Makefile.in +++ win/Makefile.in @@ -259,11 +259,11 @@ CC_SWITCHES = ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \ -I"${GENERIC_DIR_NATIVE}" -I"${WIN_DIR_NATIVE}" \ -I"${XLIB_DIR_NATIVE}" -I"${BITMAP_DIR_NATIVE}" \ -I"${TCL_GENERIC_NATIVE}" -I"${TCL_PLATFORM_NATIVE}" \ -${AC_FLAGS} $(NO_DEPRECATED_FLAGS) -DTCL_UTF_MAX=4 -DUSE_TCL_STUBS +${AC_FLAGS} $(NO_DEPRECATED_FLAGS) -DTCL_UTF_MAX=3 -DUSE_TCL_STUBS CC_OBJNAME = @CC_OBJNAME@ CC_EXENAME = @CC_EXENAME@ # Tk used to let the configure script choose which program to use @@ -279,10 +279,11 @@ winMain.$(OBJEXT) TKTEST_OBJS = \ tkSquare.$(OBJEXT) \ tkTest.$(OBJEXT) \ + tkOldTest.$(OBJEXT) \ tkWinTest.$(OBJEXT) XLIB_OBJS = \ xcolors.$(OBJEXT) \ xdraw.$(OBJEXT) \ @@ -671,12 +672,10 @@ $(TK_STUB_LIB_FILE) $(TCL_LIB_FILE) $(LIBS) \ wish.$(RES) $(CC_EXENAME) $(LDFLAGS_WINDOW) @VC_MANIFEST_EMBED_EXE@ @if test "${ZIPFS_BUILD}" = "2" ; then \ cat ${TK_ZIP_FILE} >> ${WISH}; \ - ${NATIVE_ZIP} -A ${WISH} \ - || echo 'ignore zip-error by adjust sfx process (not executable?)'; \ fi tktest: $(TKTEST) $(TKTEST): testMain.$(OBJEXT) $(TEST_DLL_FILE) @LIBRARIES@ $(TK_STUB_LIB_FILE) wish.$(RES) @@ -718,11 +717,11 @@ @$(RMDIR) $(TK_VFS_PATH)/demos -@if test "${ZIPFS_BUILD}" = "2" ; then \ cp ${TCL_BIN_DIR}/tclsh${TCLVER}s.exe ${TK_VFS_ROOT}/../${TK_ZIP_FILE} || cp ${TCL_BIN_DIR}/../bin/tclsh${TCLVER}s.exe ${TK_VFS_ROOT}/../${TK_ZIP_FILE}; \ (zip=`(realpath '${NATIVE_ZIP}' || readlink -m '${NATIVE_ZIP}') 2>/dev/null || \ (echo '${NATIVE_ZIP}' | sed "s?^\./?$$(pwd)/?")`; \ - cd ${TK_VFS_ROOT} && $$zip -J ../${TK_ZIP_FILE}) \ + cd ${TK_VFS_ROOT} && $$zip -A ../${TK_ZIP_FILE} && $$zip -J ../${TK_ZIP_FILE}) \ fi (zip=`(realpath '${NATIVE_ZIP}' || readlink -m '${NATIVE_ZIP}') 2>/dev/null || \ (echo '${NATIVE_ZIP}' | sed "s?^\./?$$(pwd)/?")`; \ cd ${TK_VFS_ROOT} && \ $$zip ${ZIP_PROG_OPTIONS} ../${TK_ZIP_FILE} ${ZIP_PROG_VFSSEARCH} >/dev/null && \ @@ -742,12 +741,10 @@ @$(RM) ${TK_DLL_FILE} @MAKE_DLL@ ${TK_OBJS} $(TK_RES) $(SHLIB_LD_LIBS) @VC_MANIFEST_EMBED_DLL@ @if test "${ZIPFS_BUILD}" = "1" ; then \ cat ${TK_ZIP_FILE} >> ${TK_DLL_FILE}; \ - ${NATIVE_ZIP} -A ${TK_DLL_FILE} \ - || echo 'ignore zip-error by adjust sfx process (not executable?)'; \ fi ${TK_LIB_FILE}: ${TK_OBJS} @$(RM) ${TK_LIB_FILE} @MAKE_LIB@ ${TK_OBJS} @@ -762,10 +759,13 @@ $(CC) -c $(CC_SWITCHES) -DTK_TEST -DUNICODE=1 -D_UNICODE=1 @DEPARG@ $(CC_OBJNAME) tkTest.$(OBJEXT): tkTest.c $(CC) -c $(CC_SWITCHES) @DEPARG@ $(CC_OBJNAME) +tkOldTest.$(OBJEXT): tkOldTest.c + $(CC) -c $(CC_SWITCHES) @DEPARG@ $(CC_OBJNAME) + tkWinTest.$(OBJEXT): tkWinTest.c $(CC) -c $(CC_SWITCHES) @DEPARG@ $(CC_OBJNAME) tkSquare.$(OBJEXT): tkSquare.c $(CC) -c $(CC_SWITCHES) @DEPARG@ $(CC_OBJNAME) Index: win/README ================================================================== --- win/README +++ win/README @@ -1,6 +1,6 @@ -Tk 9.0 for Windows +Tk 8.7 for Windows Originally by Scott Stanton while at Sun Microsystems Labs This is the directory where you configure and compile the Windows version of Tk. This directory also contains source files for Tk Index: win/configure ================================================================== --- win/configure +++ win/configure @@ -1,8 +1,8 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.72 for tk 9.0. +# Generated by GNU Autoconf 2.72 for tk 8.7. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, # Inc. # @@ -599,12 +599,12 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='tk' PACKAGE_TARNAME='tk' -PACKAGE_VERSION='9.0' -PACKAGE_STRING='tk 9.0' +PACKAGE_VERSION='8.7' +PACKAGE_STRING='tk 8.7' PACKAGE_BUGREPORT='' PACKAGE_URL='' ac_unique_file="../generic/tk.h" # Factoring default headers for most tests. @@ -1353,11 +1353,11 @@ # 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 9.0 to adapt to many kinds of systems. +'configure' configures tk 8.7 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. @@ -1415,11 +1415,11 @@ _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of tk 9.0:";; + short | recursive ) echo "Configuration of tk 8.7:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options @@ -1513,11 +1513,11 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -tk configure 9.0 +tk configure 8.7 generated by GNU Autoconf 2.72 Copyright (C) 2023 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. @@ -1723,11 +1723,11 @@ cat >config.log <<_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 9.0, which was +It was created by tk $as_me 8.7, which was generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw _ACEOF @@ -2405,14 +2405,14 @@ # The following define is needed when building with Cygwin since newer # versions of autoconf incorrectly set SHELL to /bin/bash instead of # /bin/sh. The bash shell seems to suffer from some strange failures. SHELL=/bin/sh -TK_VERSION=9.0 -TK_MAJOR_VERSION=9 -TK_MINOR_VERSION=0 -TK_PATCH_LEVEL=".1" +TK_VERSION=8.7 +TK_MAJOR_VERSION=8 +TK_MINOR_VERSION=7 +TK_PATCH_LEVEL="b1" VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION #------------------------------------------------------------------------ # Handle the --prefix=... option #------------------------------------------------------------------------ @@ -4089,14 +4089,19 @@ if test "${TCL_MAJOR_VERSION}" -lt 9 ; then -if test "${TCL_MINOR_VERSION}" -lt 7; then +if test "${TCL_MAJOR_VERSION}" != "${TK_MAJOR_VERSION}"; then + as_fn_error $? "${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. +Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.6+. +Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6 or better." "$LINENO" 5 +fi +if test "${TCL_MINOR_VERSION}" -lt 6; then as_fn_error $? "${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. -Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.7+. -Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.7 or better." "$LINENO" 5 +Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.6+. +Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6 or better." "$LINENO" 5 fi fi #-------------------------------------------------------------------- # The statements below define a collection of compile flags. This @@ -6562,11 +6567,11 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by tk $as_me 9.0, which was +This file was extended by tk $as_me 8.7, which was generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS @@ -6617,11 +6622,11 @@ ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -tk config.status 9.0 +tk config.status 8.7 configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" Copyright (C) 2023 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation Index: win/configure.ac ================================================================== --- win/configure.ac +++ win/configure.ac @@ -1,23 +1,23 @@ #! /bin/bash -norc # This file is an input file used by the GNU "autoconf" program to # generate the file "configure", which is run during Tk installation # to configure the system for the local environment. -AC_INIT([tk],[9.0]) +AC_INIT([tk],[8.7]) AC_CONFIG_SRCDIR([../generic/tk.h]) AC_PREREQ([2.69]) # The following define is needed when building with Cygwin since newer # versions of autoconf incorrectly set SHELL to /bin/bash instead of # /bin/sh. The bash shell seems to suffer from some strange failures. SHELL=/bin/sh -TK_VERSION=9.0 -TK_MAJOR_VERSION=9 -TK_MINOR_VERSION=0 -TK_PATCH_LEVEL=".1" +TK_VERSION=8.7 +TK_MAJOR_VERSION=8 +TK_MINOR_VERSION=7 +TK_PATCH_LEVEL="b1" VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION #------------------------------------------------------------------------ # Handle the --prefix=... option #------------------------------------------------------------------------ @@ -75,14 +75,19 @@ SC_PATH_TCLCONFIG($TK_PATCH_LEVEL) SC_LOAD_TCLCONFIG if test "${TCL_MAJOR_VERSION}" -lt 9 ; then -if test "${TCL_MINOR_VERSION}" -lt 7; then +if test "${TCL_MAJOR_VERSION}" != "${TK_MAJOR_VERSION}"; then + AC_MSG_ERROR([${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. +Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.6+. +Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6 or better.]) +fi +if test "${TCL_MINOR_VERSION}" -lt 6; then AC_MSG_ERROR([${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. -Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.7+. -Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.7 or better.]) +Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl 8.6+. +Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl 8.6 or better.]) fi fi #-------------------------------------------------------------------- # The statements below define a collection of compile flags. This Index: win/makefile.vc ================================================================== --- win/makefile.vc +++ win/makefile.vc @@ -149,10 +149,11 @@ TKTESTOBJS = \ $(TMP_DIR)\testMain.obj \ $(TMP_DIR)\tkSquare.obj \ $(TMP_DIR)\tkTest.obj \ + $(TMP_DIR)\tkOldTest.obj \ $(TMP_DIR)\tkWinTest.obj \ $(TMP_DIR)\tktest.res XLIBOBJS = \ $(TMP_DIR)\xcolors.obj \ @@ -334,11 +335,11 @@ # defined in rules.vc PRJ_INCLUDES = -I"$(BITMAPDIR)" -I"$(XLIBDIR)" CONFIG_DEFS =/DHAVE_SYS_TYPES_H=1 /DHAVE_SYS_STAT_H=1 \ /DHAVE_STRING_H=1 /DHAVE_MEMORY_H=1 \ - /DHAVE_STRINGS_H=1 /DTCL_UTF_MAX=4 \ + /DHAVE_STRINGS_H=1 /DTCL_UTF_MAX=3 \ !if $(TTK_SQUARE_WIDGET) /DTTK_SQUARE_WIDGET=1 \ !endif !if $(TK_NO_DEPRECATED) /DTK_NO_DEPRECATED=1 @@ -619,10 +620,13 @@ $(TMP_DIR)\tkUuid.h: $(ROOT)\manifest.uuid copy $(WIN_DIR)\tkUuid.h.in+$(ROOT)\manifest.uuid $(TMP_DIR)\tkUuid.h $(TMP_DIR)\tkTest.obj: $(GENERICDIR)\tkTest.c $(cc32) $(appcflags_nostubs) -Fo$@ $? + +$(TMP_DIR)\tkOldTest.obj: $(GENERICDIR)\tkOldTest.c + $(cc32) $(appcflags_nostubs) -Fo$@ $? $(TMP_DIR)\tkWinTest.obj: $(WIN_DIR)\tkWinTest.c $(cc32) $(appcflags_nostubs) -Fo$@ $? $(TMP_DIR)\tkSquare.obj: $(GENERICDIR)\tkSquare.c Index: win/rc/tktest.rc ================================================================== --- win/rc/tktest.rc +++ win/rc/tktest.rc @@ -6,10 +6,16 @@ #include // // build-up the name suffix that defines the type of build this is. // +#if TCL_THREADS +#define SUFFIX_THREADS "t" +#else +#define SUFFIX_THREADS "" +#endif + #if STATIC_BUILD #define SUFFIX_STATIC "s" #else #define SUFFIX_STATIC "" #endif @@ -18,11 +24,11 @@ #define SUFFIX_DEBUG "g" #else #define SUFFIX_DEBUG "" #endif -#define SUFFIX SUFFIX_STATIC SUFFIX_DEBUG +#define SUFFIX SUFFIX_THREADS SUFFIX_STATIC SUFFIX_DEBUG VS_VERSION_INFO VERSIONINFO FILEVERSION TK_MAJOR_VERSION,TK_MINOR_VERSION,TK_RELEASE_LEVEL,TK_RELEASE_SERIAL PRODUCTVERSION TK_MAJOR_VERSION,TK_MINOR_VERSION,TK_RELEASE_LEVEL,TK_RELEASE_SERIAL Index: win/tcl.m4 ================================================================== --- win/tcl.m4 +++ win/tcl.m4 @@ -983,17 +983,17 @@ # Defines the following vars: # TCL_BIN_DIR Full path to the tcl build dir. #------------------------------------------------------------------------ AC_DEFUN([SC_WITH_TCL], [ - if test -d ../../tcl9.0$1/win; then - TCL_BIN_DEFAULT=../../tcl9.0$1/win + if test -d ../../tcl8.7$1/win; then + TCL_BIN_DEFAULT=../../tcl8.7$1/win else - TCL_BIN_DEFAULT=../../tcl9.0/win + TCL_BIN_DEFAULT=../../tcl8.7/win fi - AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 9.0 binaries from DIR], + AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.7 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) fi if test ! -f $TCL_BIN_DIR/Makefile; then Index: win/tkWinButton.c ================================================================== --- win/tkWinButton.c +++ win/tkWinButton.c @@ -553,24 +553,23 @@ * and focus ring. */ int imageWidth, imageHeight; int imageXOffset = 0, imageYOffset = 0; /* Image information that will be used to * restrict disabled pixmap as well. */ - int padX, padY, borderWidth, highlightWidth; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); butPtr->flags &= ~REDRAW_PENDING; if ((butPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) { return; } - Tk_GetPixelsFromObj(NULL, tkwin, butPtr->borderWidthObj, &borderWidth); - Tk_GetPixelsFromObj(NULL, tkwin, butPtr->highlightWidthObj, &highlightWidth); - Tk_GetPixelsFromObj(NULL, tkwin, butPtr->padXObj, &padX); - Tk_GetPixelsFromObj(NULL, tkwin, butPtr->padYObj, &padY); + Tk_GetPixelsFromObj(NULL, tkwin, butPtr->borderWidthPtr, &butPtr->borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); + Tk_GetPixelsFromObj(NULL, tkwin, butPtr->padXPtr, &butPtr->padX); + Tk_GetPixelsFromObj(NULL, tkwin, butPtr->padYPtr, &butPtr->padY); border = butPtr->normalBorder; if ((butPtr->state == STATE_DISABLED) && (butPtr->disabledFg != NULL)) { gc = butPtr->disabledGC; } else if ((butPtr->state == STATE_ACTIVE) @@ -625,15 +624,15 @@ /* * Compute width of default ring and offset for pushed buttons. */ if (butPtr->type == TYPE_LABEL) { - defaultWidth = highlightWidth; + defaultWidth = butPtr->highlightWidth; offset = 0; } else if (butPtr->type == TYPE_BUTTON) { defaultWidth = ((butPtr->defaultState == DEFAULT_ACTIVE) - ? highlightWidth : 0); + ? butPtr->highlightWidth : 0); offset = 1; } else { defaultWidth = 0; if ((butPtr->type >= TYPE_CHECK_BUTTON) && !butPtr->indicatorOn) { offset = 1; @@ -679,15 +678,15 @@ /* * Image is above or below text. */ if (butPtr->compound == COMPOUND_TOP) { - textYOffset = height + padY; + textYOffset = height + butPtr->padY; } else { - imageYOffset = butPtr->textHeight + padY; + imageYOffset = butPtr->textHeight + butPtr->padY; } - fullHeight = height + butPtr->textHeight + padY; + fullHeight = height + butPtr->textHeight + butPtr->padY; fullWidth = (width > butPtr->textWidth ? width : butPtr->textWidth); textXOffset = (fullWidth - butPtr->textWidth)/2; imageXOffset = (fullWidth - width)/2; break; @@ -697,15 +696,15 @@ /* * Image is left or right of text. */ if (butPtr->compound == COMPOUND_LEFT) { - textXOffset = width + padX; + textXOffset = width + butPtr->padX; } else { - imageXOffset = butPtr->textWidth + padX; + imageXOffset = butPtr->textWidth + butPtr->padX; } - fullWidth = butPtr->textWidth + padX + width; + fullWidth = butPtr->textWidth + butPtr->padX + width; fullHeight = (height > butPtr->textHeight ? height : butPtr->textHeight); textYOffset = (fullHeight - butPtr->textHeight)/2; imageYOffset = (fullHeight - height)/2; break; @@ -725,11 +724,11 @@ imageYOffset = (fullHeight - height)/2; break; case COMPOUND_NONE: break; } - TkComputeAnchor(butPtr->anchor, tkwin, padX, padY, + TkComputeAnchor(butPtr->anchor, tkwin, butPtr->padX, butPtr->padY, butPtr->indicatorSpace + fullWidth, fullHeight, &x, &y); x += butPtr->indicatorSpace; if (relief == TK_RELIEF_SUNKEN) { x += offset; @@ -810,11 +809,11 @@ XCopyPlane(butPtr->display, butPtr->bitmap, pixmap, gc, 0, 0, (unsigned int) width, (unsigned int) height, x, y, 1); XSetClipOrigin(butPtr->display, gc, 0, 0); } } else { - TkComputeAnchor(butPtr->anchor, tkwin, padX, padY, + TkComputeAnchor(butPtr->anchor, tkwin, butPtr->padX, butPtr->padY, butPtr->indicatorSpace + butPtr->textWidth, butPtr->textHeight, &x, &y); x += butPtr->indicatorSpace; @@ -851,11 +850,11 @@ * button. */ if (drawRing && butPtr->flags & GOT_FOCUS && butPtr->type != TYPE_LABEL) { if (butPtr->type == TYPE_BUTTON || !butPtr->indicatorOn) { - int dottedWidth = borderWidth + 1 + defaultWidth; + int dottedWidth = butPtr->borderWidth + 1 + defaultWidth; TkWinDrawDottedRect(butPtr->display, pixmap, gc->foreground, dottedWidth, dottedWidth, Tk_Width(tkwin) - 2*dottedWidth, Tk_Height(tkwin) - 2*dottedWidth); } else { @@ -923,11 +922,11 @@ if (relief != TK_RELIEF_FLAT) { Tk_Draw3DRectangle(tkwin, pixmap, border, defaultWidth, defaultWidth, Tk_Width(tkwin) - 2 * defaultWidth, Tk_Height(tkwin) - 2 * defaultWidth, - borderWidth, relief); + butPtr->borderWidth, relief); } if (defaultWidth != 0) { int highlightColor; dc = TkWinGetDrawableDC(butPtr->display, pixmap, &state); @@ -993,24 +992,18 @@ int avgWidth; int minWidth; /* Vertical and horizontal dialog units size in pixels. */ double vDLU, hDLU; Tk_FontMetrics fm; - int borderWidth, highlightWidth, wrapLength; - int butPtrWidth, butPtrHeight; - int padX, padY; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->highlightWidthObj, &highlightWidth); - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->borderWidthObj, &borderWidth); - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->wrapLengthObj, &wrapLength); - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->widthObj, &butPtrWidth); - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->heightObj, &butPtrHeight); + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->borderWidthPtr, &butPtr->borderWidth); - butPtr->inset = highlightWidth + borderWidth; + butPtr->inset = butPtr->highlightWidth + butPtr->borderWidth; butPtr->indicatorSpace = 0; if (!tsdPtr->initialized) { InitBoxes(butPtr->tkwin); } @@ -1037,11 +1030,11 @@ * DLUs (based on font, not text) for some spacing calculations below). */ Tk_FreeTextLayout(butPtr->textLayout); butPtr->textLayout = Tk_ComputeTextLayout(butPtr->tkfont, - Tcl_GetString(butPtr->textPtr), TCL_INDEX_NONE, wrapLength, + Tcl_GetString(butPtr->textPtr), TCL_INDEX_NONE, butPtr->wrapLength, butPtr->justify, 0, &butPtr->textWidth, &butPtr->textHeight); txtWidth = butPtr->textWidth; txtHeight = butPtr->textHeight; haveText = (*(Tcl_GetString(butPtr->textPtr)) != '\0'); @@ -1085,12 +1078,12 @@ * The width is specified in characters. A character is, by * definition, 4 DLUs wide. 11 char * 4 DLU is 44 DLU + 6 DLU padding * = 50 DLU. Therefore, width = -11 -> MWUE compliant buttons. */ - if (butPtrWidth < 0) { - minWidth = -(butPtrWidth); /* Min width in chars */ + if (butPtr->width < 0) { + minWidth = -(butPtr->width); /* Min width in chars */ width = avgWidth * minWidth; /* Allow for characters */ width += (int)(0.5 + (6 * hDLU)); /* Add for padding */ } /* @@ -1097,11 +1090,11 @@ * If shrink-wrapping was requested (width = 0) or if the text is * wider than the default button width, adjust the button width up to * suit. */ - if (butPtrWidth == 0 + if (butPtr->width == 0 || (txtWidth + (int)(0.5 + (6 * hDLU)) > width)) { width = txtWidth + (int)(0.5 + (6 * hDLU)); } /* @@ -1198,12 +1191,12 @@ * new geometry is a combination of the image and text geometry. We only * honor the compound bit if the button has both text and an image, * because otherwise it is not really a compound button. */ - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padXObj, &padX); - Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padYObj, &padY); + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padXPtr, &butPtr->padX); + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padYPtr, &butPtr->padY); if (butPtr->compound != COMPOUND_NONE && haveImage && haveText) { switch ((enum compound) butPtr->compound) { case COMPOUND_TOP: case COMPOUND_BOTTOM: @@ -1212,11 +1205,11 @@ */ if (imgWidth > width) { width = imgWidth; } - height += imgHeight + padY; + height += imgHeight + butPtr->padY; break; case COMPOUND_LEFT: case COMPOUND_RIGHT: @@ -1225,12 +1218,12 @@ * * Only increase width of button if image doesn't fit in slack * space of default button width */ - if ((imgWidth + txtWidth + padX) > width) { - width = imgWidth + txtWidth + padX; + if ((imgWidth + txtWidth + butPtr->padX) > width) { + width = imgWidth + txtWidth + butPtr->padX; } if (imgHeight > height) { height = imgHeight; } @@ -1254,37 +1247,37 @@ /* * Fix up for minimum width. */ - if (butPtrWidth < 0) { + if (butPtr->width < 0) { /* * minWidth in pixels (because there's an image. */ - minWidth = -(butPtrWidth); + minWidth = -(butPtr->width); if (width < minWidth) { width = minWidth; } - } else if (butPtrWidth > 0) { - width = butPtrWidth; + } else if (butPtr->width > 0) { + width = butPtr->width; } - if (butPtrHeight > 0) { - height = butPtrHeight; + if (butPtr->height > 0) { + height = butPtr->height; } - width += 2 * padX; - height += 2 * padY; + width += 2 * butPtr->padX; + height += 2 * butPtr->padY; } else if (haveImage) { - if (butPtrWidth > 0) { - width = butPtrWidth; + if (butPtr->width > 0) { + width = butPtr->width; } else { width = imgWidth; } - if (butPtrHeight > 0) { - height = butPtrHeight; + if (butPtr->height > 0) { + height = butPtr->height; } else { height = imgHeight; } } else { /* @@ -1294,21 +1287,21 @@ /* * butPtr->width is in characters. We need to allow for that many * characters on the face, not in the over-all button width */ - if (butPtrWidth > 0) { - width = butPtrWidth * avgWidth; + if (butPtr->width > 0) { + width = butPtr->width * avgWidth; } /* * butPtr->height is in lines of text. We need to allow for that many * lines on the face, not in the over-all button height. */ - if (butPtrHeight > 0) { - height = butPtrHeight * fm.linespace; + if (butPtr->height > 0) { + height = butPtr->height * fm.linespace; /* * Make the same adjustments as above to get same height for e.g. * a one line text with -height 0 or 1. [Bug #565485] */ @@ -1324,12 +1317,12 @@ break; } } } - width += 2 * padX; - height += 2 * padY; + width += 2 * butPtr->padX; + height += 2 * butPtr->padY; } /* * Fix up width and height for indicator sizing and spacing. */ Index: win/tkWinColor.c ================================================================== --- win/tkWinColor.c +++ win/tkWinColor.c @@ -178,13 +178,13 @@ winColPtr->info.color = color; winColPtr->index = index; XAllocColor(Tk_Display(tkwin), Tk_Colormap(tkwin), &winColPtr->info.color); - return (TkColor *) winColPtr; + return (TkColor *)winColPtr; } - return (TkColor *) NULL; + return (TkColor *)NULL; } /* *---------------------------------------------------------------------- * Index: win/tkWinDefault.h ================================================================== --- win/tkWinDefault.h +++ win/tkWinDefault.h @@ -351,12 +351,12 @@ #define DEF_MESSAGE_FONT "TkDefaultFont" #define DEF_MESSAGE_HIGHLIGHT_BG NORMAL_BG #define DEF_MESSAGE_HIGHLIGHT HIGHLIGHT #define DEF_MESSAGE_HIGHLIGHT_WIDTH "0" #define DEF_MESSAGE_JUSTIFY "left" -#define DEF_MESSAGE_PADX NULL -#define DEF_MESSAGE_PADY NULL +#define DEF_MESSAGE_PADX "-1" +#define DEF_MESSAGE_PADY "-1" #define DEF_MESSAGE_RELIEF "flat" #define DEF_MESSAGE_TAKE_FOCUS "0" #define DEF_MESSAGE_TEXT "" #define DEF_MESSAGE_TEXT_VARIABLE "" #define DEF_MESSAGE_WIDTH "0" @@ -448,11 +448,11 @@ #define DEF_SCROLLBAR_BG_COLOR NORMAL_BG #define DEF_SCROLLBAR_BG_MONO WHITE #define DEF_SCROLLBAR_BORDER_WIDTH "0" #define DEF_SCROLLBAR_COMMAND "" #define DEF_SCROLLBAR_CURSOR "" -#define DEF_SCROLLBAR_EL_BORDER_WIDTH NULL +#define DEF_SCROLLBAR_EL_BORDER_WIDTH "-1" #define DEF_SCROLLBAR_HIGHLIGHT_BG NORMAL_BG #define DEF_SCROLLBAR_HIGHLIGHT HIGHLIGHT #define DEF_SCROLLBAR_HIGHLIGHT_WIDTH "0" #define DEF_SCROLLBAR_JUMP "0" #define DEF_SCROLLBAR_ORIENT "vertical" Index: win/tkWinDialog.c ================================================================== --- win/tkWinDialog.c +++ win/tkWinDialog.c @@ -2164,13 +2164,13 @@ { if (dlgFilterPtr != NULL) { DWORD dw; for (dw = 0; dw < count; ++dw) { if (dlgFilterPtr[dw].pszName != NULL) - ckfree((void *)dlgFilterPtr[dw].pszName); + ckfree((char *)dlgFilterPtr[dw].pszName); if (dlgFilterPtr[dw].pszSpec != NULL) - ckfree((void *)dlgFilterPtr[dw].pszSpec); + ckfree((char *)dlgFilterPtr[dw].pszSpec); } ckfree(dlgFilterPtr); } } Index: win/tkWinFont.c ================================================================== --- win/tkWinFont.c +++ win/tkWinFont.c @@ -843,11 +843,11 @@ moretomeasure = 0; curX = 0; start = source; end = start + numBytes; for (p = start; p < end; ) { - next = p + Tcl_UtfToUniChar(p, &ch); + next = p + TkUtfToUniChar(p, &ch); thisSubFontPtr = FindSubFontForChar(fontPtr, ch, &lastSubFontPtr); if (thisSubFontPtr != lastSubFontPtr) { familyPtr = lastSubFontPtr->familyPtr; WCHAR *wstr = (WCHAR *)Tcl_UtfToExternalDString(familyPtr->encoding, start, p - start, &runString); @@ -904,11 +904,11 @@ int lastSize = 0; familyPtr = lastSubFontPtr->familyPtr; Tcl_DStringInit(&runString); for (p = start; p < end; ) { - next = p + Tcl_UtfToUniChar(p, &ch); + next = p + TkUtfToUniChar(p, &ch); Tcl_UtfToExternal(NULL, familyPtr->encoding, p, (int) (next - p), TCL_ENCODING_PROFILE_TCL8, NULL, buf, sizeof(buf), NULL, &dstWrote, NULL); Tcl_DStringAppend(&runString,buf,dstWrote); size.cx = 0; @@ -959,11 +959,11 @@ end = p; p = source; ch = ' '; while (p < end) { - next = p + Tcl_UtfToUniChar(p, &ch2); + next = p + TkUtfToUniChar(p, &ch2); if ((ch != ' ') && (ch2 == ' ')) { lastWordBreak = p; } p = next; ch = ch2; @@ -986,15 +986,15 @@ } /* *--------------------------------------------------------------------------- * - * TkpMeasureCharsInContext -- + * Tk_MeasureCharsInContext -- * * Determine the number of bytes from the string that will fit in the * given horizontal span. The measurement is done under the assumption - * that TkpDrawCharsInContext() will be used to actually display the + * that Tk_MeasureCharsInContext() will be used to actually display the * characters. * * This one is almost the same as Tk_MeasureChars(), but with access to * all the characters on the line for context. On Windows this context * isn't consulted, so we just call Tk_MeasureChars(). @@ -1009,11 +1009,11 @@ * *--------------------------------------------------------------------------- */ int -TkpMeasureCharsInContext( +Tk_MeasureCharsInContext( Tk_Font tkfont, /* Font in which characters will be drawn. */ const char *source, /* UTF-8 string to be displayed. Need not be * '\0' terminated. */ TCL_UNUSED(Tcl_Size), /* Maximum number of bytes to consider from * source string in all. */ @@ -1353,18 +1353,18 @@ } /* *--------------------------------------------------------------------------- * - * TkpDrawCharsInContext -- + * Tk_DrawCharsInContext -- * * Draw a string of characters on the screen like Tk_DrawChars(), but * with access to all the characters on the line for context. On Windows * this context isn't consulted, so we just call Tk_DrawChars(). * * Note: TK_DRAW_IN_CONTEXT being currently defined only on macOS, this - * function is unused (and possibly unfinished). See [7655f65ae7]. + * function is unused. * * Results: * None. * * Side effects: @@ -1372,11 +1372,11 @@ * *--------------------------------------------------------------------------- */ void -TkpDrawCharsInContext( +Tk_DrawCharsInContext( Display *display, /* Display on which to draw. */ Drawable drawable, /* Window or pixmap in which to draw. */ GC gc, /* Graphics context for drawing characters. */ Tk_Font tkfont, /* Font in which characters will be drawn; * must be the same as font used in GC. */ @@ -1476,11 +1476,11 @@ oldFont = SelectFont(hdc, fontPtr, lastSubFontPtr, angle); GetTextMetricsW(hdc, &tm); end = source + numBytes; for (p = source; p < end; ) { - next = p + Tcl_UtfToUniChar(p, &ch); + next = p + TkUtfToUniChar(p, &ch); thisSubFontPtr = FindSubFontForChar(fontPtr, ch, &lastSubFontPtr); /* * The drawing API has a limit of 32767 pixels in one go. * To avoid spending time on a rare case we do not measure each char, @@ -2259,11 +2259,11 @@ */ end = (row + 1) << FONTMAP_SHIFT; for (i = row << FONTMAP_SHIFT; i < end; i++) { if (Tcl_UtfToExternal(NULL, encoding, src, - Tcl_UniCharToUtf(i, src), TCL_ENCODING_PROFILE_STRICT, NULL, + TkUniCharToUtf(i, src), TCL_ENCODING_STOPONERROR, NULL, buf, sizeof(buf), NULL, NULL, NULL) != TCL_OK) { continue; } bitOffset = i & (FONTMAP_BITSPERPAGE - 1); subFontPtr->fontMap[row][bitOffset >> 3] |= 1 << (bitOffset & 7); Index: win/tkWinGDI.c ================================================================== --- win/tkWinGDI.c +++ win/tkWinGDI.c @@ -3648,21 +3648,21 @@ char* varlink1 = (char*)ckalloc(100 * sizeof(char)); char** varlink2 = (char**)ckalloc(sizeof(char*)); *varlink2 = varlink1; WideCharToMultiByte(CP_UTF8, 0, localPrinterName, -1, varlink1, 0, NULL, NULL); - Tcl_LinkVar(interp, "::tk::print::printer_name", varlink2, + Tcl_LinkVar(interp, "::tk::print::printer_name", (char*)varlink2, TCL_LINK_STRING | TCL_LINK_READ_ONLY); - Tcl_LinkVar(interp, "::tk::print::copies", &copies, - TCL_LINK_INT | TCL_LINK_READ_ONLY); - Tcl_LinkVar(interp, "::tk::print::dpi_x", &dpi_x, - TCL_LINK_INT | TCL_LINK_READ_ONLY); - Tcl_LinkVar(interp, "::tk::print::dpi_y", &dpi_y, - TCL_LINK_INT | TCL_LINK_READ_ONLY); - Tcl_LinkVar(interp, "::tk::print::paper_width", &paper_width, - TCL_LINK_INT | TCL_LINK_READ_ONLY); - Tcl_LinkVar(interp, "::tk::print::paper_height", &paper_height, + Tcl_LinkVar(interp, "::tk::print::copies", (char*)&copies, + TCL_LINK_INT | TCL_LINK_READ_ONLY); + Tcl_LinkVar(interp, "::tk::print::dpi_x", (char*)&dpi_x, + TCL_LINK_INT | TCL_LINK_READ_ONLY); + Tcl_LinkVar(interp, "::tk::print::dpi_y", (char*)&dpi_y, + TCL_LINK_INT | TCL_LINK_READ_ONLY); + Tcl_LinkVar(interp, "::tk::print::paper_width", (char*)&paper_width, + TCL_LINK_INT | TCL_LINK_READ_ONLY); + Tcl_LinkVar(interp, "::tk::print::paper_height", (char*)&paper_height, TCL_LINK_INT | TCL_LINK_READ_ONLY); } return TCL_OK; } Index: win/tkWinKey.c ================================================================== --- win/tkWinKey.c +++ win/tkWinKey.c @@ -111,11 +111,11 @@ /* * Special case for WM_UNICHAR and win2000 multilingual IME input */ - len = Tcl_UniCharToUtf(keyEv->keycode, buf); + len = TkUniCharToUtf(keyEv->keycode, buf); Tcl_DStringAppend(dsPtr, buf, len); } else { /* * This is an event generated from generic code. It has no nchars or * trans_chars members. @@ -123,11 +123,11 @@ KeySym keysym = KeycodeToKeysym(keyEv->keycode, keyEv->state, 0); if (((keysym != NoSymbol) && (keysym > 0) && (keysym < 256)) || (keysym == XK_Return) || (keysym == XK_Tab)) { - len = Tcl_UniCharToUtf(keysym & 255, buf); + len = TkUniCharToUtf(keysym & 255, buf); Tcl_DStringAppend(dsPtr, buf, len); } } return Tcl_DStringValue(dsPtr); } Index: win/tkWinMenu.c ================================================================== --- win/tkWinMenu.c +++ win/tkWinMenu.c @@ -507,15 +507,15 @@ : Tcl_GetString(mePtr->labelPtr); const char *accel = ((menuPtr->menuType == MENUBAR) || (mePtr->accelPtr == NULL)) ? "" : Tcl_GetString(mePtr->accelPtr); const char *p, *next; Tcl_DString itemString; - Tcl_UniChar ch = 0; + int ch = 0; /* - * We have to construct the string with an ampersand preceeding the - * underline character, and a tab seperating the text and the accel + * We have to construct the string with an ampersand preceding the + * underline character, and a tab separating the text and the accel * text. We have to be careful with ampersands in the string. */ Tcl_DStringInit(&itemString); @@ -524,21 +524,21 @@ Tcl_DStringAppend(&itemString, "&", 1); } if (*p == '&') { Tcl_DStringAppend(&itemString, "&", 1); } - next = p + Tcl_UtfToUniChar(p, &ch); + next = p + TkUtfToUniChar(p, &ch); Tcl_DStringAppend(&itemString, p, (int) (next - p)); } ch = 0; if (mePtr->accelLength > 0) { Tcl_DStringAppend(&itemString, "\t", 1); for (p = accel, i = 0; *p != '\0'; i++, p = next) { if (*p == '&') { Tcl_DStringAppend(&itemString, "&", 1); } - next = p + Tcl_UtfToUniChar(p, &ch); + next = p + TkUtfToUniChar(p, &ch); Tcl_DStringAppend(&itemString, p, (int) (next - p)); } } itemText = (char *)ckalloc(Tcl_DStringLength(&itemString) + 1); @@ -1598,11 +1598,11 @@ *widthPtr = 0; } else { int borderWidth; Tk_GetPixelsFromObj(menuPtr->interp, menuPtr->tkwin, - menuPtr->borderWidthObj, &borderWidth); + menuPtr->borderWidthPtr, &borderWidth); *widthPtr = indicatorDimensions[1] - borderWidth; /* * Quite dubious about the above (why would borderWidth play a role?) * and about how indicatorDimensions[1] is obtained in SetDefaults(). @@ -1842,11 +1842,11 @@ } rect.top = y; rect.bottom = y + mePtr->height; Tk_GetPixelsFromObj(menuPtr->interp, menuPtr->tkwin, - menuPtr->borderWidthObj, &borderWidth); + menuPtr->borderWidthPtr, &borderWidth); Tk_GetPixelsFromObj(menuPtr->interp, menuPtr->tkwin, menuPtr->activeBorderWidthPtr, &activeBorderWidth); rect.left = borderWidth + activeBorderWidth + x; rect.right = mePtr->indicatorSpace + x; @@ -2102,20 +2102,22 @@ int height) /* Height of entry */ { if ((mePtr->underline >= 0) && (mePtr->labelPtr != NULL)) { int len; - len = Tcl_GetCharLength(mePtr->labelPtr); + len = TkGetCharLength(mePtr->labelPtr); if (mePtr->underline < len) { const char *label, *start, *end; - int ch; + int activeBorderWidth, ch; label = Tcl_GetString(mePtr->labelPtr); - start = Tcl_UtfAtIndex(label, mePtr->underline); - end = start + Tcl_UtfToUniChar(start, &ch); + start = TkUtfAtIndex(label, mePtr->underline); + end = start + TkUtfToUniChar(start, &ch); + Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, + menuPtr->activeBorderWidthPtr, &activeBorderWidth); Tk_UnderlineChars(menuPtr->display, d, - gc, tkfont, label, x + mePtr->indicatorSpace, + gc, tkfont, label, x + mePtr->indicatorSpace + activeBorderWidth, y + (height + fmPtr->ascent - fmPtr->descent) / 2, (int) (start - label), (int) (end - label)); } } } @@ -2988,11 +2990,11 @@ if (menuPtr->tkwin == NULL) { return; } Tk_GetPixelsFromObj(menuPtr->interp, menuPtr->tkwin, - menuPtr->borderWidthObj, &borderWidth); + menuPtr->borderWidthPtr, &borderWidth); x = y = borderWidth; indicatorSpace = labelWidth = accelWidth = 0; windowHeight = 0; /* Index: win/tkWinPort.h ================================================================== --- win/tkWinPort.h +++ win/tkWinPort.h @@ -122,6 +122,15 @@ */ #define TkpGetPixel(p) (((((p)->red >> 8) & 0xff) \ | ((p)->green & 0xff00) | (((p)->blue << 8) & 0xff0000)) | 0x20000000) +/* + * These calls implement native bitmaps which are not currently + * supported under Windows. The macros eliminate the calls. + */ + +#define TkpDefineNativeBitmaps() +#define TkpCreateNativeBitmap(display, source) None +#define TkpGetNativeAppBitmap(display, name, w, h) None + #endif /* _WINPORT */ Index: win/tkWinScrlbr.c ================================================================== --- win/tkWinScrlbr.c +++ win/tkWinScrlbr.c @@ -386,11 +386,10 @@ TkScrollbar *scrollPtr) /* Scrollbar whose geometry may have * changed. */ { int fieldLength, minThumbSize; - int width; /* * Windows doesn't use focus rings on scrollbars, but we still perform * basic sanity checks to appease backwards compatibility. */ @@ -439,17 +438,16 @@ * Register the desired geometry for the window (leave enough space for * the two arrows plus a minimum-size slider, plus border around the whole * window, if any). Then arrange for the window to be redisplayed. */ - Tk_GetPixelsFromObj(NULL, scrollPtr->tkwin, scrollPtr->widthObj, &width); if (scrollPtr->vertical) { Tk_GeometryRequest(scrollPtr->tkwin, - width, 2 * scrollPtr->arrowLength + minThumbSize); + scrollPtr->width, 2 * scrollPtr->arrowLength + minThumbSize); } else { Tk_GeometryRequest(scrollPtr->tkwin, - 2 * scrollPtr->arrowLength + minThumbSize, width); + 2 * scrollPtr->arrowLength + minThumbSize, scrollPtr->width); } Tk_SetInternalBorder(scrollPtr->tkwin, 0); } /* Index: win/tkWinX.c ================================================================== --- win/tkWinX.c +++ win/tkWinX.c @@ -659,11 +659,11 @@ if (ScreenOfDisplay(display, 0) != NULL) { if (DefaultVisualOfScreen(ScreenOfDisplay(display, 0)) != NULL) { ckfree(DefaultVisualOfScreen(ScreenOfDisplay(display, 0))); } if (RootWindowOfScreen(ScreenOfDisplay(display, 0)) != None) { - ckfree((void *)RootWindowOfScreen(ScreenOfDisplay(display, 0))); + ckfree((char *)RootWindowOfScreen(ScreenOfDisplay(display, 0))); } if (DefaultColormapOfScreen(ScreenOfDisplay(display, 0)) != None) { XFreeColormap(display, DefaultColormapOfScreen(ScreenOfDisplay(display, 0))); } ckfree(ScreenOfDisplay(display, 0)); Index: win/ttkWinTheme.c ================================================================== --- win/ttkWinTheme.c +++ win/ttkWinTheme.c @@ -613,11 +613,11 @@ TCL_UNUSED(Ttk_Padding *)) { ThumbElement *thumbPtr = (ThumbElement *)elementRecord; Ttk_Orient orient; - Ttk_GetOrientFromObj(NULL, thumbPtr->orientObj, &orient); + TtkGetOrientFromObj(NULL, thumbPtr->orientObj, &orient); if (orient == TTK_ORIENT_HORIZONTAL) { *widthPtr = GetSystemMetrics(SM_CXHTHUMB); *heightPtr = GetSystemMetrics(SM_CYHSCROLL); } else { *widthPtr = GetSystemMetrics(SM_CXVSCROLL); @@ -678,11 +678,11 @@ TCL_UNUSED(Ttk_Padding *)) { SliderElement *slider = (SliderElement *)elementRecord; Ttk_Orient orient; - Ttk_GetOrientFromObj(NULL, slider->orientObj, &orient); + TtkGetOrientFromObj(NULL, slider->orientObj, &orient); if (orient == TTK_ORIENT_HORIZONTAL) { *widthPtr = (GetSystemMetrics(SM_CXHTHUMB) / 2) | 1; *heightPtr = GetSystemMetrics(SM_CYHSCROLL); } else { *widthPtr = GetSystemMetrics(SM_CXVSCROLL); Index: win/ttkWinXPTheme.c ================================================================== --- win/ttkWinXPTheme.c +++ win/ttkWinXPTheme.c @@ -424,14 +424,14 @@ */ static void DestroyElementData(void *clientData) { ElementData *elementData = (ElementData *)clientData; if (elementData->info->flags & HEAP_ELEMENT) { - ckfree((void *)elementData->info->statemap); - ckfree((void *)elementData->info->className); - ckfree((void *)elementData->info->elementName); - ckfree((void *)elementData->info); + ckfree((char *)elementData->info->statemap); + ckfree((char *)elementData->info->className); + ckfree((char *)elementData->info->elementName); + ckfree((char *)elementData->info); } ckfree(clientData); } /* Index: win/winMain.c ================================================================== --- win/winMain.c +++ win/winMain.c @@ -10,37 +10,18 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ -/* - * Explanation on following undef USE_TCL_STUBS by JN 2023-12-19 on the core list: - * What's going on is related to TIP #596: - * Stubs support for Embedding Tcl in other applications - * - * If an application using Tcl_Main() is compiled with USE_TCL_STUBS, - * Tcl_Main() will be replaced by a stub function, which loads - * libtcl9.0.so/tcl90.dll and then calls its Tcl_MainEx(). If - * libtcl9.0.so/tcl90.dll is not present (at runtime), a crash is what happens. - * - * So ... tkAppInit.c should not be compiled with USE_TCL_STUBS - * (unless you want to use the TIP #596 functionality) - * - * The proper solution is to make sure that Makefile.in doesn't use - * TCL_USE_STUBS when compiling tkAppInit.c. But that's a - * quite big re-organization just before a b1 release. Simpler - * is just to #undef'ine USE_TCL_STUBS, it has the same effect. - */ -#undef USE_TCL_STUBS #include "tk.h" #define WIN32_LEAN_AND_MEAN #include #undef WIN32_LEAN_AND_MEAN #include #include #include -#if (TCL_MAJOR_VERSION < 9) && defined(TCL_MINOR_VERSION) && (TCL_MINOR_VERSION < 7) +#if TCL_MAJOR_VERSION < 9 && TCL_MINOR_VERSION < 7 # define Tcl_LibraryInitProc Tcl_PackageInitProc # define Tcl_StaticLibrary Tcl_StaticPackage #endif #if defined(__GNUC__) @@ -54,11 +35,11 @@ #ifdef TK_TEST extern Tcl_LibraryInitProc Tktest_Init; #endif /* TK_TEST */ #if !defined(TCL_USE_STATIC_PACKAGES) -# if TCL_MAJOR_VERSION > 8 || !defined(TCL_MINOR_VERSION) || TCL_MINOR_VERSION > 6 +# if TCL_MAJOR_VERSION > 8 || TCL_MINOR_VERSION > 6 # define TCL_USE_STATIC_PACKAGES 1 # else # define TCL_USE_STATIC_PACKAGES 0 # endif #endif @@ -189,11 +170,11 @@ } } #ifdef TK_LOCAL_MAIN_HOOK TK_LOCAL_MAIN_HOOK(&argc, &argv); -#elif defined(UNICODE) && ((TCL_MAJOR_VERSION > 8) || !defined(TCL_MINOR_VERSION) || (TCL_MINOR_VERSION > 6)) +#elif defined(UNICODE) && ((TCL_MAJOR_VERSION > 8) || (TCL_MINOR_VERSION > 6)) /* This doesn't work on Windows without UNICODE, neither does it work with Tcl 8.6 */ TclZipfs_AppHook(&argc, &argv); #endif Tk_Main(argc, argv, TK_LOCAL_APPINIT); @@ -281,13 +262,18 @@ * run interactively. Typically the startup file is "~/.apprc" where "app" * is the name of the application. If this line is deleted then no * user-specific startup file will be run under any conditions. */ +#if TCL_MAJOR_VERSION > 8 (void) Tcl_EvalEx(interp, "set tcl_rcFileName [file tildeexpand ~/wishrc.tcl]", -1, TCL_EVAL_GLOBAL); +#else + Tcl_ObjSetVar2(interp, Tcl_NewStringObj("tcl_rcFileName", -1), NULL, + Tcl_NewStringObj("~/wishrc.tcl", -1), TCL_GLOBAL_ONLY); +#endif return TCL_OK; } #if defined(TK_TEST) /* Index: xlib/X11/keysymdef.h ================================================================== --- xlib/X11/keysymdef.h +++ xlib/X11/keysymdef.h @@ -255,10 +255,19 @@ #define XK_Next 0xff56 /* Next */ #define XK_Page_Down 0xff56 /* deprecated alias for Next */ #define XK_End 0xff57 /* EOL */ #define XK_Begin 0xff58 /* BOL */ + +#ifndef TK_NO_DEPRECATED +/* Special Windows keyboard keys */ + +#define XK_Win_L 0xFF5B /* Left-hand Windows */ +#define XK_Win_R 0xFF5C /* Right-hand Windows */ +#define XK_App 0xFF5D /* Menu key */ +#endif + /* Misc functions */ #define XK_Select 0xff60 /* Select, mark */ #define XK_Print 0xff61 @@ -2580,5 +2589,20 @@ #define XK_Sinh_lu2 0x1000ddf /* U+0DDF SINHALA VOWEL SIGN GAYANUKITTA */ #define XK_Sinh_ruu2 0x1000df2 /* U+0DF2 SINHALA VOWEL SIGN DIGA GAETTA-PILLA */ #define XK_Sinh_luu2 0x1000df3 /* U+0DF3 SINHALA VOWEL SIGN DIGA GAYANUKITTA */ #define XK_Sinh_kunddaliya 0x1000df4 /* U+0DF4 SINHALA PUNCTUATION KUNDDALIYA */ #endif /* XK_SINHALA */ + +/* Multimedia keys, defined same as on Linux + * /usr/include/pkg/libxkbcommon/xkbcommon/xkbcommon-keysyms.h + */ + +#ifndef TK_NO_DEPRECATED +#define XK_XF86AudioLowerVolume 0x1008FF11 /* Volume control down */ +#define XK_XF86AudioMute 0x1008FF12 /* Mute sound from the system */ +#define XK_XF86AudioRaiseVolume 0x1008FF13 /* Volume control up */ +#define XK_XF86AudioPlay 0x1008FF14 /* Start playing of audio > */ +#define XK_XF86AudioStop 0x1008FF15 /* Stop playing audio */ +#define XK_XF86AudioPrev 0x1008FF16 /* Previous track */ +#define XK_XF86AudioNext 0x1008FF17 /* Next track */ +#endif /* !TK_NO_DEPRECATED */ +