Changeset 3038


Ignore:
Timestamp:
Jun 13, 2012 3:46:10 PM (12 years ago)
Author:
gah
Message:

intermediate updates for vtkcontourviewer

Location:
trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure

    r2890 r3038  
    11#! /bin/sh
    22# Guess values for system-dependent variables and create Makefiles.
    3 # Generated by GNU Autoconf 2.68 for Rappture 1.1.
     3# Generated by GNU Autoconf 2.69 for Rappture 1.1.
    44#
    55# Report bugs to <rappture@nanohub.org>.
    66#
    77#
    8 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
    9 # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
    10 # Foundation, Inc.
     8# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
    119#
    1210#
     
    137135(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
    138136
     137# Use a proper internal environment variable to ensure we don't fall
     138  # into an infinite loop, continuously re-executing ourselves.
     139  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
     140    _as_can_reexec=no; export _as_can_reexec;
     141    # We cannot yet assume a decent shell, so we have to provide a
     142# neutralization value for shells without unset; and this also
     143# works around shells that cannot unset nonexistent variables.
     144# Preserve -v and -x to the replacement shell.
     145BASH_ENV=/dev/null
     146ENV=/dev/null
     147(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
     148case $- in # ((((
     149  *v*x* | *x*v* ) as_opts=-vx ;;
     150  *v* ) as_opts=-v ;;
     151  *x* ) as_opts=-x ;;
     152  * ) as_opts= ;;
     153esac
     154exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
     155# Admittedly, this is quite paranoid, since all the known shells bail
     156# out after a failed `exec'.
     157$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
     158as_fn_exit 255
     159  fi
     160  # We don't want this to propagate to other subprocesses.
     161          { _as_can_reexec=; unset _as_can_reexec;}
    139162if test "x$CONFIG_SHELL" = x; then
    140163  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
     
    170193  exitcode=1; echo positional parameters were not saved.
    171194fi
    172 test x\$exitcode = x0 || exit 1"
     195test x\$exitcode = x0 || exit 1
     196test -x / || exit 1"
    173197  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
    174198  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
     
    215239
    216240      if test "x$CONFIG_SHELL" != x; then :
    217   # We cannot yet assume a decent shell, so we have to provide a
    218         # neutralization value for shells without unset; and this also
    219         # works around shells that cannot unset nonexistent variables.
    220         # Preserve -v and -x to the replacement shell.
    221         BASH_ENV=/dev/null
    222         ENV=/dev/null
    223         (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
    224         export CONFIG_SHELL
    225         case $- in # ((((
    226           *v*x* | *x*v* ) as_opts=-vx ;;
    227           *v* ) as_opts=-v ;;
    228           *x* ) as_opts=-x ;;
    229           * ) as_opts= ;;
    230         esac
    231         exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
     241  export CONFIG_SHELL
     242             # We cannot yet assume a decent shell, so we have to provide a
     243# neutralization value for shells without unset; and this also
     244# works around shells that cannot unset nonexistent variables.
     245# Preserve -v and -x to the replacement shell.
     246BASH_ENV=/dev/null
     247ENV=/dev/null
     248(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
     249case $- in # ((((
     250  *v*x* | *x*v* ) as_opts=-vx ;;
     251  *v* ) as_opts=-v ;;
     252  *x* ) as_opts=-x ;;
     253  * ) as_opts= ;;
     254esac
     255exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
     256# Admittedly, this is quite paranoid, since all the known shells bail
     257# out after a failed `exec'.
     258$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
     259exit 255
    232260fi
    233261
     
    332360
    333361} # as_fn_mkdir_p
     362
     363# as_fn_executable_p FILE
     364# -----------------------
     365# Test if FILE is an executable regular file.
     366as_fn_executable_p ()
     367{
     368  test -f "$1" && test -x "$1"
     369} # as_fn_executable_p
    334370# as_fn_append VAR VALUE
    335371# ----------------------
     
    453489    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
    454490
     491  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
     492  # already done that, so ensure we don't try to do so again and fall
     493  # in an infinite loop.  This has already happened in practice.
     494  _as_can_reexec=no; export _as_can_reexec
    455495  # Don't try to exec as it changes $[0], causing all sort of problems
    456496  # (the dirname of $[0] is not the place where we might find the
     
    487527    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
    488528    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
    489     # In both cases, we have to default to `cp -p'.
     529    # In both cases, we have to default to `cp -pR'.
    490530    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
    491       as_ln_s='cp -p'
     531      as_ln_s='cp -pR'
    492532  elif ln conf$$.file conf$$ 2>/dev/null; then
    493533    as_ln_s=ln
    494534  else
    495     as_ln_s='cp -p'
     535    as_ln_s='cp -pR'
    496536  fi
    497537else
    498   as_ln_s='cp -p'
     538  as_ln_s='cp -pR'
    499539fi
    500540rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
     
    508548fi
    509549
    510 if test -x / >/dev/null 2>&1; then
    511   as_test_x='test -x'
    512 else
    513   if ls -dL / >/dev/null 2>&1; then
    514     as_ls_L_option=L
    515   else
    516     as_ls_L_option=
    517   fi
    518   as_test_x='
    519     eval sh -c '\''
    520       if test -d "$1"; then
    521         test -d "$1/.";
    522       else
    523         case $1 in #(
    524         -*)set "./$1";;
    525         esac;
    526         case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
    527         ???[sx]*):;;*)false;;esac;fi
    528     '\'' sh
    529   '
    530 fi
    531 as_executable_p=$as_test_x
     550as_test_x='test -x'
     551as_executable_p=as_fn_executable_p
    532552
    533553# Sed expression to map a string onto a valid CPP name.
     
    12691289  if test "x$build_alias" = x; then
    12701290    cross_compiling=maybe
    1271     $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
    1272     If a cross compiler is detected then cross compile mode will be used" >&2
    12731291  elif test "x$build_alias" != "x$host_alias"; then
    12741292    cross_compiling=yes
     
    15341552  cat <<\_ACEOF
    15351553Rappture configure 1.1
    1536 generated by GNU Autoconf 2.68
    1537 
    1538 Copyright (C) 2010 Free Software Foundation, Inc.
     1554generated by GNU Autoconf 2.69
     1555
     1556Copyright (C) 2012 Free Software Foundation, Inc.
    15391557This configure script is free software; the Free Software Foundation
    15401558gives unlimited permission to copy, distribute and modify it.
     
    17671785       } && test -s conftest$ac_exeext && {
    17681786         test "$cross_compiling" = yes ||
    1769          $as_test_x conftest$ac_exeext
     1787         test -x conftest$ac_exeext
    17701788       }; then :
    17711789  ac_retval=0
     
    18801898       } && test -s conftest$ac_exeext && {
    18811899         test "$cross_compiling" = yes ||
    1882          $as_test_x conftest$ac_exeext
     1900         test -x conftest$ac_exeext
    18831901       }; then :
    18841902  ac_retval=0
     
    21842202{
    21852203static int test_array [1 - 2 * !(($2) >= 0)];
    2186 test_array [0] = 0
     2204test_array [0] = 0;
     2205return test_array [0];
    21872206
    21882207  ;
     
    22002219{
    22012220static int test_array [1 - 2 * !(($2) <= $ac_mid)];
    2202 test_array [0] = 0
     2221test_array [0] = 0;
     2222return test_array [0];
    22032223
    22042224  ;
     
    22262246{
    22272247static int test_array [1 - 2 * !(($2) < 0)];
    2228 test_array [0] = 0
     2248test_array [0] = 0;
     2249return test_array [0];
    22292250
    22302251  ;
     
    22422263{
    22432264static int test_array [1 - 2 * !(($2) >= $ac_mid)];
    2244 test_array [0] = 0
     2265test_array [0] = 0;
     2266return test_array [0];
    22452267
    22462268  ;
     
    22762298{
    22772299static int test_array [1 - 2 * !(($2) <= $ac_mid)];
    2278 test_array [0] = 0
     2300test_array [0] = 0;
     2301return test_array [0];
    22792302
    22802303  ;
     
    23492372
    23502373It was created by Rappture $as_me 1.1, which was
    2351 generated by GNU Autoconf 2.68.  Invocation command line was
     2374generated by GNU Autoconf 2.69.  Invocation command line was
    23522375
    23532376  $ $0 $@
     
    27992822    for ac_prog in ginstall scoinst install; do
    28002823      for ac_exec_ext in '' $ac_executable_extensions; do
    2801         if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
     2824        if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
    28022825          if test $ac_prog = install &&
    28032826            grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
     
    28732896  test -z "$as_dir" && as_dir=.
    28742897    for ac_exec_ext in '' $ac_executable_extensions; do
    2875   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     2898  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    28762899    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
    28772900    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    29132936  test -z "$as_dir" && as_dir=.
    29142937    for ac_exec_ext in '' $ac_executable_extensions; do
    2915   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     2938  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    29162939    ac_cv_prog_ac_ct_RANLIB="ranlib"
    29172940    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    29722995    for ac_prog in mkdir gmkdir; do
    29732996         for ac_exec_ext in '' $ac_executable_extensions; do
    2974            { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
     2997           as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
    29752998           case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
    29762999             'mkdir (GNU coreutils) '* | \
     
    30563079  test -z "$as_dir" && as_dir=.
    30573080    for ac_exec_ext in '' $ac_executable_extensions; do
    3058   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     3081  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    30593082    ac_cv_prog_CC="${ac_tool_prefix}gcc"
    30603083    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    30963119  test -z "$as_dir" && as_dir=.
    30973120    for ac_exec_ext in '' $ac_executable_extensions; do
    3098   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     3121  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    30993122    ac_cv_prog_ac_ct_CC="gcc"
    31003123    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    31493172  test -z "$as_dir" && as_dir=.
    31503173    for ac_exec_ext in '' $ac_executable_extensions; do
    3151   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     3174  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    31523175    ac_cv_prog_CC="${ac_tool_prefix}cc"
    31533176    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    31903213  test -z "$as_dir" && as_dir=.
    31913214    for ac_exec_ext in '' $ac_executable_extensions; do
    3192   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     3215  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    31933216    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
    31943217       ac_prog_rejected=yes
     
    32483271  test -z "$as_dir" && as_dir=.
    32493272    for ac_exec_ext in '' $ac_executable_extensions; do
    3250   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     3273  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    32513274    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
    32523275    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    32923315  test -z "$as_dir" && as_dir=.
    32933316    for ac_exec_ext in '' $ac_executable_extensions; do
    3294   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     3317  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    32953318    ac_cv_prog_ac_ct_CC="$ac_prog"
    32963319    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    37383761#include <stdarg.h>
    37393762#include <stdio.h>
    3740 #include <sys/types.h>
    3741 #include <sys/stat.h>
     3763struct stat;
    37423764/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
    37433765struct buf { int x; };
     
    38523874  test -z "$as_dir" && as_dir=.
    38533875    for ac_exec_ext in '' $ac_executable_extensions; do
    3854   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     3876  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    38553877    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
    38563878    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    38963918  test -z "$as_dir" && as_dir=.
    38973919    for ac_exec_ext in '' $ac_executable_extensions; do
    3898   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     3920  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    38993921    ac_cv_prog_ac_ct_CXX="$ac_prog"
    39003922    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    41054127  test -z "$as_dir" && as_dir=.
    41064128    for ac_exec_ext in '' $ac_executable_extensions; do
    4107   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     4129  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    41084130    ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
    41094131    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    41494171  test -z "$as_dir" && as_dir=.
    41504172    for ac_exec_ext in '' $ac_executable_extensions; do
    4151   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     4173  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    41524174    ac_cv_prog_ac_ct_F77="$ac_prog"
    41534175    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    44564478    for ac_exec_ext in '' $ac_executable_extensions; do
    44574479      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
    4458       { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
     4480      as_fn_executable_p "$ac_path_GREP" || continue
    44594481# Check for GNU ac_path_GREP and select it if it is found.
    44604482  # Check for GNU $ac_path_GREP
     
    45224544    for ac_exec_ext in '' $ac_executable_extensions; do
    45234545      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
    4524       { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
     4546      as_fn_executable_p "$ac_path_EGREP" || continue
    45254547# Check for GNU ac_path_EGREP and select it if it is found.
    45264548  # Check for GNU $ac_path_EGREP
     
    49594981
    49604982else
    4961   as_fn_error $? "ncursers library missing?" "$LINENO" 5
     4983  as_fn_error $? "ncurses library missing?" "$LINENO" 5
    49624984fi
    49634985
     
    56055627  test -z "$as_dir" && as_dir=.
    56065628    for ac_exec_ext in '' $ac_executable_extensions; do
    5607   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     5629  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    56085630    ac_cv_prog_AR="ar"
    56095631    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    73397361  test -z "$as_dir" && as_dir=.
    73407362    for ac_exec_ext in '' $ac_executable_extensions; do
    7341   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     7363  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    73427364    ac_cv_path_TCLSH="$as_dir/$ac_word$ac_exec_ext"
    73437365    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    73817403  test -z "$as_dir" && as_dir=.
    73827404    for ac_exec_ext in '' $ac_executable_extensions; do
    7383   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     7405  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    73847406    ac_cv_path_TCLSH="$as_dir/$ac_word$ac_exec_ext"
    73857407    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    74827504  test -z "$as_dir" && as_dir=.
    74837505    for ac_exec_ext in '' $ac_executable_extensions; do
    7484   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     7506  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    74857507    ac_cv_path_MATLAB="$as_dir/$ac_word$ac_exec_ext"
    74867508    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    75247546  test -z "$as_dir" && as_dir=.
    75257547    for ac_exec_ext in '' $ac_executable_extensions; do
    7526   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     7548  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    75277549    ac_cv_path_MATLAB="$as_dir/$ac_word$ac_exec_ext"
    75287550    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    75747596  test -z "$as_dir" && as_dir=.
    75757597    for ac_exec_ext in '' $ac_executable_extensions; do
    7576   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     7598  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    75777599    ac_cv_path_MEX="$as_dir/$ac_word$ac_exec_ext"
    75787600    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    76147636  test -z "$as_dir" && as_dir=.
    76157637    for ac_exec_ext in '' $ac_executable_extensions; do
    7616   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     7638  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    76177639    ac_cv_path_MEXEXT="$as_dir/$ac_word$ac_exec_ext"
    76187640    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    76657687  test -z "$as_dir" && as_dir=.
    76667688    for ac_exec_ext in '' $ac_executable_extensions; do
    7667   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     7689  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    76687690    ac_cv_path_MCC="$as_dir/$ac_word$ac_exec_ext"
    76697691    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    77277749  test -z "$as_dir" && as_dir=.
    77287750    for ac_exec_ext in '' $ac_executable_extensions; do
    7729   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     7751  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    77307752    ac_cv_path_OCTAVE="$as_dir/$ac_word$ac_exec_ext"
    77317753    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    77677789  test -z "$as_dir" && as_dir=.
    77687790    for ac_exec_ext in '' $ac_executable_extensions; do
    7769   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     7791  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    77707792    ac_cv_path_MKOCTFILE="$as_dir/$ac_word$ac_exec_ext"
    77717793    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    78547876  test -z "$as_dir" && as_dir=.
    78557877    for ac_exec_ext in '' $ac_executable_extensions; do
    7856   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     7878  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    78577879    ac_cv_path_mkoctfile3="$as_dir/$ac_word$ac_exec_ext"
    78587880    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    79147936  test -z "$as_dir" && as_dir=.
    79157937    for ac_exec_ext in '' $ac_executable_extensions; do
    7916   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     7938  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    79177939    ac_cv_path_mkoctfile2="$as_dir/$ac_word$ac_exec_ext"
    79187940    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    79888010  test -z "$as_dir" && as_dir=.
    79898011    for ac_exec_ext in '' $ac_executable_extensions; do
    7990   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     8012  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    79918013    ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
    79928014    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    80298051  test -z "$as_dir" && as_dir=.
    80308052    for ac_exec_ext in '' $ac_executable_extensions; do
    8031   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     8053  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    80328054    ac_cv_path_XSUBPP="$as_dir/$ac_word$ac_exec_ext"
    80338055    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    80708092  test -z "$as_dir" && as_dir=.
    80718093    for ac_exec_ext in '' $ac_executable_extensions; do
    8072   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     8094  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    80738095    ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
    80748096    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    81108132  test -z "$as_dir" && as_dir=.
    81118133    for ac_exec_ext in '' $ac_executable_extensions; do
    8112   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     8134  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    81138135    ac_cv_path_XSUBPP="$as_dir/$ac_word$ac_exec_ext"
    81148136    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    81928214  test -z "$as_dir" && as_dir=.
    81938215    for ac_exec_ext in '' $ac_executable_extensions; do
    8194   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     8216  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    81958217    ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
    81968218    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    82348256  test -z "$as_dir" && as_dir=.
    82358257    for ac_exec_ext in '' $ac_executable_extensions; do
    8236   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     8258  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    82378259    ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
    82388260    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    83558377  test -z "$as_dir" && as_dir=.
    83568378    for ac_exec_ext in '' $ac_executable_extensions; do
    8357   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     8379  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    83588380    ac_cv_path_JAVA="$as_dir/$ac_word$ac_exec_ext"
    83598381    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    83958417  test -z "$as_dir" && as_dir=.
    83968418    for ac_exec_ext in '' $ac_executable_extensions; do
    8397   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     8419  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    83988420    ac_cv_path_JAVAC="$as_dir/$ac_word$ac_exec_ext"
    83998421    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    84358457  test -z "$as_dir" && as_dir=.
    84368458    for ac_exec_ext in '' $ac_executable_extensions; do
    8437   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     8459  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    84388460    ac_cv_path_JAVAH="$as_dir/$ac_word$ac_exec_ext"
    84398461    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    84778499  test -z "$as_dir" && as_dir=.
    84788500    for ac_exec_ext in '' $ac_executable_extensions; do
    8479   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     8501  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    84808502    ac_cv_path_JAVA="$as_dir/$ac_word$ac_exec_ext"
    84818503    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    85188540  test -z "$as_dir" && as_dir=.
    85198541    for ac_exec_ext in '' $ac_executable_extensions; do
    8520   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     8542  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    85218543    ac_cv_path_JAVAC="$as_dir/$ac_word$ac_exec_ext"
    85228544    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    85598581  test -z "$as_dir" && as_dir=.
    85608582    for ac_exec_ext in '' $ac_executable_extensions; do
    8561   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     8583  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    85628584    ac_cv_path_JAVAH="$as_dir/$ac_word$ac_exec_ext"
    85638585    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    86478669  test -z "$as_dir" && as_dir=.
    86488670    for ac_exec_ext in '' $ac_executable_extensions; do
    8649   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     8671  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    86508672    ac_cv_path_R="$as_dir/$ac_word$ac_exec_ext"
    86518673    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    86898711  test -z "$as_dir" && as_dir=.
    86908712    for ac_exec_ext in '' $ac_executable_extensions; do
    8691   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     8713  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    86928714    ac_cv_path_R="$as_dir/$ac_word$ac_exec_ext"
    86938715    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    87488770  test -z "$as_dir" && as_dir=.
    87498771    for ac_exec_ext in '' $ac_executable_extensions; do
    8750   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     8772  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    87518773    ac_cv_path_RUBY="$as_dir/$ac_word$ac_exec_ext"
    87528774    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    87908812  test -z "$as_dir" && as_dir=.
    87918813    for ac_exec_ext in '' $ac_executable_extensions; do
    8792   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     8814  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    87938815    ac_cv_path_RUBY="$as_dir/$ac_word$ac_exec_ext"
    87948816    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    88408862    for ac_exec_ext in '' $ac_executable_extensions; do
    88418863      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
    8842       { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
     8864      as_fn_executable_p "$ac_path_SED" || continue
    88438865# Check for GNU ac_path_SED and select it if it is found.
    88448866  # Check for GNU $ac_path_SED
     
    89258947  test -z "$as_dir" && as_dir=.
    89268948    for ac_exec_ext in '' $ac_executable_extensions; do
    8927   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     8949  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
    89288950    ac_cv_prog_AWK="$ac_prog"
    89298951    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     
    1002610048fi
    1002710049
     10050  for ac_func in sws_getCachedContext
     10051do :
     10052  ac_fn_cxx_check_func "$LINENO" "sws_getCachedContext" "ac_cv_func_sws_getCachedContext"
     10053if test "x$ac_cv_func_sws_getCachedContext" = xyes; then :
     10054  cat >>confdefs.h <<_ACEOF
     10055#define HAVE_SWS_GETCACHEDCONTEXT 1
     10056_ACEOF
     10057
     10058fi
     10059done
     10060
     10061  for ac_func in img_convert
     10062do :
     10063  ac_fn_cxx_check_func "$LINENO" "img_convert" "ac_cv_func_img_convert"
     10064if test "x$ac_cv_func_img_convert" = xyes; then :
     10065  cat >>confdefs.h <<_ACEOF
     10066#define HAVE_IMG_CONVERT 1
     10067_ACEOF
     10068
     10069fi
     10070done
     10071
     10072  for ac_func in sws_scale
     10073do :
     10074  ac_fn_cxx_check_func "$LINENO" "sws_scale" "ac_cv_func_sws_scale"
     10075if test "x$ac_cv_func_sws_scale" = xyes; then :
     10076  cat >>confdefs.h <<_ACEOF
     10077#define HAVE_SWS_SCALE 1
     10078_ACEOF
     10079
     10080fi
     10081done
    1002810082
    1002910083  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
     
    1015210206
    1015310207
    10154 ac_config_files="$ac_config_files Makefile packages/Makefile src/Makefile src/core/Makefile src/core2/Makefile src/objects/Makefile src/objects/RpHash.h gui/Makefile gui/apps/Makefile gui/apps/about gui/apps/copy_rappture_examples gui/apps/encodedata gui/apps/rappture gui/apps/rappture-csh.env gui/apps/rappture.env gui/apps/rappture.use gui/apps/rerun gui/apps/simsim gui/apps/xmldiff gui/pkgIndex.tcl gui/scripts/Makefile gui/src/Makefile builder/Makefile builder/pkgIndex.tcl builder/scripts/Makefile tester/Makefile tester/pkgIndex.tcl tester/scripts/Makefile lang/Makefile lang/java/Makefile lang/java/rappture/Makefile lang/perl/Makefile lang/perl/Makefile.PL lang/python/Makefile lang/python/setup.py lang/matlab/Makefile lang/octave/Makefile lang/octave/octave2/Makefile lang/octave/octave3/Makefile lang/R/Makefile lang/ruby/Makefile lang/ruby/build.rb lang/tcl/Makefile lang/tcl/pkgIndex.tcl lang/tcl/src/Makefile lang/tcl/scripts/Makefile lang/tcl/tests/Makefile lib/Makefile examples/3D/Makefile examples/Makefile examples/app-fermi/2.0/Makefile examples/app-fermi/Makefile examples/app-fermi/cee/Makefile examples/app-fermi/fortran/Makefile examples/app-fermi/java/Makefile examples/app-fermi/matlab/Makefile examples/app-fermi/matlab/compiled/Makefile examples/app-fermi/matlab/uncompiled/Makefile examples/app-fermi/octave/octave2/Makefile examples/app-fermi/octave/octave3/Makefile examples/app-fermi/octave/Makefile examples/app-fermi/perl/Makefile examples/app-fermi/python/Makefile examples/app-fermi/ruby/Makefile examples/app-fermi/tcl/Makefile examples/app-fermi/wrapper/Makefile examples/app-fermi/wrapper/cee/Makefile examples/app-fermi/wrapper/perl/Makefile examples/app-fermi/wrapper/python/Makefile examples/app-fermi/wrapper/tcl/Makefile examples/app-fermi/R/Makefile examples/c-example/Makefile examples/canvas/Makefile examples/demo.bash examples/flow/Makefile examples/flow/demo1/Makefile examples/flow/demo2/Makefile examples/flow/demo3/Makefile examples/graph/Makefile examples/objects/Makefile examples/objects/axis/Makefile examples/objects/contour/Makefile examples/objects/curve/Makefile examples/objects/dxWriter/Makefile examples/objects/floatBuffer/Makefile examples/objects/histogram/Makefile examples/objects/library/Makefile examples/objects/number/Makefile examples/objects/path/Makefile examples/objects/plot/Makefile examples/objects/scatter/Makefile examples/objects/string/Makefile examples/objects/tree/Makefile examples/objects/xmlparser/Makefile examples/zoo/Makefile examples/zoo/binary/Makefile examples/zoo/boolean/Makefile examples/zoo/choice/Makefile examples/zoo/cloud/Makefile examples/zoo/cloud/matlab/Makefile examples/zoo/curve/Makefile examples/zoo/enable/Makefile examples/zoo/field/Makefile examples/zoo/group/Makefile examples/zoo/histogram/Makefile examples/zoo/image/Makefile examples/zoo/image/docs/Makefile examples/zoo/image/examples/Makefile examples/zoo/integer/Makefile examples/zoo/integer2/Makefile examples/zoo/loader/Makefile examples/zoo/loader/examples/Makefile examples/zoo/loadrun/Makefile examples/zoo/log/Makefile examples/zoo/note/Makefile examples/zoo/note/docs/Makefile examples/zoo/number/Makefile examples/zoo/number2/Makefile examples/zoo/parallelepiped/Makefile examples/zoo/periodicelement/Makefile examples/zoo/phase/Makefile examples/zoo/sequence/Makefile examples/zoo/sequence/examples/Makefile examples/zoo/string/Makefile examples/zoo/structure/Makefile examples/zoo/structure/examples/Makefile examples/zoo/table/Makefile examples/zoo/unirect2d/Makefile video/Makefile video/pkgIndex.tcl oldtest/Makefile oldtest/src/Makefile"
     10208ac_config_files="$ac_config_files Makefile packages/Makefile src/Makefile src/core/Makefile src/core2/Makefile src/objects/Makefile src/objects/RpHash.h gui/Makefile gui/apps/Makefile gui/apps/about gui/apps/copy_rappture_examples gui/apps/encodedata gui/apps/rappture gui/apps/rappture-csh.env gui/apps/rappture.env gui/apps/rappture.use gui/apps/rerun gui/apps/simsim gui/apps/xmldiff gui/pkgIndex.tcl gui/scripts/Makefile gui/src/Makefile builder/Makefile builder/pkgIndex.tcl builder/scripts/Makefile tester/Makefile tester/pkgIndex.tcl tester/scripts/Makefile lang/Makefile lang/java/Makefile lang/java/rappture/Makefile lang/perl/Makefile lang/perl/Makefile.PL lang/python/Makefile lang/python/setup.py lang/matlab/Makefile lang/octave/Makefile lang/octave/octave2/Makefile lang/octave/octave3/Makefile lang/R/Makefile lang/ruby/Makefile lang/ruby/build.rb lang/tcl/Makefile lang/tcl/pkgIndex.tcl lang/tcl/src/Makefile lang/tcl/scripts/Makefile lang/tcl/tests/Makefile lib/Makefile examples/3D/Makefile examples/Makefile examples/app-fermi/2.0/Makefile examples/app-fermi/Makefile examples/app-fermi/cee/Makefile examples/app-fermi/fortran/Makefile examples/app-fermi/java/Makefile examples/app-fermi/matlab/Makefile examples/app-fermi/matlab/compiled/Makefile examples/app-fermi/matlab/uncompiled/Makefile examples/app-fermi/octave/octave2/Makefile examples/app-fermi/octave/octave3/Makefile examples/app-fermi/octave/Makefile examples/app-fermi/perl/Makefile examples/app-fermi/python/Makefile examples/app-fermi/ruby/Makefile examples/app-fermi/tcl/Makefile examples/app-fermi/wrapper/Makefile examples/app-fermi/wrapper/cee/Makefile examples/app-fermi/wrapper/perl/Makefile examples/app-fermi/wrapper/python/Makefile examples/app-fermi/wrapper/tcl/Makefile examples/app-fermi/R/Makefile examples/c-example/Makefile examples/canvas/Makefile examples/demo.bash examples/flow/Makefile examples/flow/demo1/Makefile examples/flow/demo2/Makefile examples/flow/demo3/Makefile examples/graph/Makefile examples/objects/Makefile examples/objects/axis/Makefile examples/objects/contour/Makefile examples/objects/curve/Makefile examples/objects/dxWriter/Makefile examples/objects/floatBuffer/Makefile examples/objects/histogram/Makefile examples/objects/library/Makefile examples/objects/number/Makefile examples/objects/path/Makefile examples/objects/plot/Makefile examples/objects/scatter/Makefile examples/objects/string/Makefile examples/objects/tree/Makefile examples/objects/xmlparser/Makefile examples/zoo/Makefile examples/zoo/binary/Makefile examples/zoo/boolean/Makefile examples/zoo/choice/Makefile examples/zoo/cloud/Makefile examples/zoo/cloud/matlab/Makefile examples/zoo/curve/Makefile examples/zoo/enable/Makefile examples/zoo/field/Makefile examples/zoo/group/Makefile examples/zoo/histogram/Makefile examples/zoo/image/Makefile examples/zoo/image/docs/Makefile examples/zoo/image/examples/Makefile examples/zoo/integer/Makefile examples/zoo/integer2/Makefile examples/zoo/loader/Makefile examples/zoo/loader/examples/Makefile examples/zoo/log/Makefile examples/zoo/note/Makefile examples/zoo/note/docs/Makefile examples/zoo/number/Makefile examples/zoo/number2/Makefile examples/zoo/parallelepiped/Makefile examples/zoo/periodicelement/Makefile examples/zoo/phase/Makefile examples/zoo/sequence/Makefile examples/zoo/sequence/examples/Makefile examples/zoo/string/Makefile examples/zoo/structure/Makefile examples/zoo/structure/examples/Makefile examples/zoo/table/Makefile examples/zoo/unirect2d/Makefile video/Makefile video/pkgIndex.tcl oldtest/Makefile oldtest/src/Makefile"
    1015510209
    1015610210cat >confcache <<\_ACEOF
     
    1056210616    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
    1056310617    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
    10564     # In both cases, we have to default to `cp -p'.
     10618    # In both cases, we have to default to `cp -pR'.
    1056510619    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
    10566       as_ln_s='cp -p'
     10620      as_ln_s='cp -pR'
    1056710621  elif ln conf$$.file conf$$ 2>/dev/null; then
    1056810622    as_ln_s=ln
    1056910623  else
    10570     as_ln_s='cp -p'
     10624    as_ln_s='cp -pR'
    1057110625  fi
    1057210626else
    10573   as_ln_s='cp -p'
     10627  as_ln_s='cp -pR'
    1057410628fi
    1057510629rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
     
    1063110685fi
    1063210686
    10633 if test -x / >/dev/null 2>&1; then
    10634   as_test_x='test -x'
    10635 else
    10636   if ls -dL / >/dev/null 2>&1; then
    10637     as_ls_L_option=L
    10638   else
    10639     as_ls_L_option=
    10640   fi
    10641   as_test_x='
    10642     eval sh -c '\''
    10643       if test -d "$1"; then
    10644         test -d "$1/.";
    10645       else
    10646         case $1 in #(
    10647         -*)set "./$1";;
    10648         esac;
    10649         case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
    10650         ???[sx]*):;;*)false;;esac;fi
    10651     '\'' sh
    10652   '
    10653 fi
    10654 as_executable_p=$as_test_x
     10687
     10688# as_fn_executable_p FILE
     10689# -----------------------
     10690# Test if FILE is an executable regular file.
     10691as_fn_executable_p ()
     10692{
     10693  test -f "$1" && test -x "$1"
     10694} # as_fn_executable_p
     10695as_test_x='test -x'
     10696as_executable_p=as_fn_executable_p
    1065510697
    1065610698# Sed expression to map a string onto a valid CPP name.
     
    1067410716ac_log="
    1067510717This file was extended by Rappture $as_me 1.1, which was
    10676 generated by GNU Autoconf 2.68.  Invocation command line was
     10718generated by GNU Autoconf 2.69.  Invocation command line was
    1067710719
    1067810720  CONFIG_FILES    = $CONFIG_FILES
     
    1073610778ac_cs_version="\\
    1073710779Rappture config.status 1.1
    10738 configured by $0, generated by GNU Autoconf 2.68,
     10780configured by $0, generated by GNU Autoconf 2.69,
    1073910781  with options \\"\$ac_cs_config\\"
    1074010782
    10741 Copyright (C) 2010 Free Software Foundation, Inc.
     10783Copyright (C) 2012 Free Software Foundation, Inc.
    1074210784This config.status script is free software; the Free Software Foundation
    1074310785gives unlimited permission to copy, distribute and modify it."
     
    1083010872cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
    1083110873if \$ac_cs_recheck; then
    10832   set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
     10874  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
    1083310875  shift
    1083410876  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
     
    1097211014    "examples/zoo/loader/Makefile") CONFIG_FILES="$CONFIG_FILES examples/zoo/loader/Makefile" ;;
    1097311015    "examples/zoo/loader/examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/zoo/loader/examples/Makefile" ;;
    10974     "examples/zoo/loadrun/Makefile") CONFIG_FILES="$CONFIG_FILES examples/zoo/loadrun/Makefile" ;;
    1097511016    "examples/zoo/log/Makefile") CONFIG_FILES="$CONFIG_FILES examples/zoo/log/Makefile" ;;
    1097611017    "examples/zoo/note/Makefile") CONFIG_FILES="$CONFIG_FILES examples/zoo/note/Makefile" ;;
  • trunk/configure.in

    r3032 r3038  
    555555    examples/zoo/loader/Makefile
    556556    examples/zoo/loader/examples/Makefile
    557     examples/zoo/loadrun/Makefile
    558557    examples/zoo/log/Makefile
    559558    examples/zoo/note/Makefile
  • trunk/examples/zoo/Makefile.in

    r2301 r3038  
    2828                integer2 \
    2929                loader \
    30                 loadrun \
    3130                log \
    3231                note \
  • trunk/gui/scripts/drawingentry.tcl

    r3032 r3038  
    7070    private method ScreenY { y }
    7171    private method XmlGet { path }
     72    private method XmlGetSubst { path }
    7273    private method Withdraw {}
    7374}
     
    227228    }
    228229    # Coords
    229     set xcoords [XmlGet $cpath.xcoords]
     230    set xcoords [XmlGetSubst $cpath.xcoords]
    230231    set xcoords [string trim $xcoords]
    231     set ycoords [XmlGet $cpath.ycoords]
     232    set ycoords [XmlGetSubst $cpath.ycoords]
    232233    set ycoords [string trim $ycoords]
    233234    if { $ycoords == "" } {
     
    276277        if { [info exists attr2option($attr)] } {
    277278            set option $attr2option($attr)
    278             set value [XmlGet $cpath.$attr]
     279            set value [XmlGetSubst $cpath.$attr]
    279280            set options($option) $value
    280281        }
     
    312313        if { [info exists attr2option($attr)] } {
    313314            set option $attr2option($attr)
    314             set value [XmlGet $cpath.$attr]
     315            set value [XmlGetSubst $cpath.$attr]
    315316            set options($option) $value
    316317        } elseif { [string match "controls*" $attr] } {
    317             set value [XmlGet $cpath.$attr]
     318            set value [XmlGetSubst $cpath.$attr]
    318319            lappend _cname2controls($cname) $value
    319320            $_owner xml put $value.hide 1
     
    321322    }
    322323    # Coordinates
    323     set coords [XmlGet $cpath.coords]
     324    set coords [XmlGetSubst $cpath.coords]
    324325    set coords [ScreenCoords $coords]
    325326    if { $coords == "" } {
     
    360361    # Coords
    361362    set coords {}
    362     set coords [XmlGet $cpath.coords]
     363    set coords [XmlGetSubst $cpath.coords]
    363364    set coords [string trim $coords]
    364365    if { $coords == "" } {
     
    372373        if { [info exists attr2option($attr)] } {
    373374            set option $attr2option($attr)
    374             set value [XmlGet $cpath.$attr]
     375            set value [XmlGetSubst $cpath.$attr]
    375376            set options($option) $value
    376377        }
     
    402403        if { [info exists attr2option($attr)] } {
    403404            set option $attr2option($attr)
    404             set value [XmlGet $cpath.$attr]
     405            set value [XmlGetSubst $cpath.$attr]
    405406            set options($option) $value
    406407        }
     
    408409    # Coordinates
    409410    set coords {}
    410     set coords [XmlGet $cpath.coords]
     411    set coords [XmlGetSubst $cpath.coords]
    411412    set coords [string trim $coords]
    412413    if { $coords == "" } {
     
    433434        if { [info exists attr2option($attr)] } {
    434435            set option $attr2option($attr)
    435             set value [XmlGet $cpath.$attr]
     436            set value [XmlGetSubst $cpath.$attr]
    436437            set options($option) $value
    437438        }
    438439    }
    439     set contents [XmlGet $cpath.contents]
     440    set contents [XmlGetSubst $cpath.contents]
    440441    set img ""
    441442    if { [string compare -length 5 $contents "file:"] == 0 } {
     
    454455    }
    455456    # Coordinates
    456     set coords [XmlGet $cpath.coords]
     457    set coords [XmlGetSubst $cpath.coords]
    457458    set coords [ScreenCoords $coords]
    458459    if { [llength $coords] == 2 } {
    459460        foreach { x1 y1 } $coords break
    460         set w [XmlGet $cpath.width]
     461        set w [XmlGetSubst $cpath.width]
    461462        if { $w == "" || ![string is number $w] || $w <= 0.0 } {
    462463            set width [expr [image width $img] / 4]
     
    464465            set width [expr [ScreenX $w] - [ScreenX 0]]
    465466        }
    466         set h [XmlGet $cpath.height]
     467        set h [XmlGetSubst $cpath.height]
    467468        if { $h == "" || ![string is number $h] || $h <= 0.0 } {
    468469            set height [expr [image height $img] / 4]
     
    528529    }
    529530    # Coords
    530     set coords [XmlGet $cpath.coords]
     531    set coords [XmlGetSubst $cpath.coords]
    531532    set coords [string trim $coords]
    532533    if { $coords == "" } {
     
    543544        if { [info exists attr2option($attr)] } {
    544545            set option $attr2option($attr)
    545             set value [XmlGet $cpath.$attr]
     546            set value [XmlGetSubst $cpath.$attr]
    546547            set options($option) $value
    547548        }
     
    573574        if { [info exists attr2option($attr)] } {
    574575            set option $attr2option($attr)
    575             set value [XmlGet $cpath.$attr]
     576            set value [XmlGetSubst $cpath.$attr]
    576577            set options($option) $value
    577578        }
    578579    }
    579580    # Coordinates
    580     set coords [XmlGet $cpath.coords]
     581    set coords [XmlGetSubst $cpath.coords]
    581582    set coords [string trim $coords]
    582583    if { $coords == "" } {
     
    594595    array set attr2option {
    595596        "font"          "-font"
    596         "color"         "-fill"
     597        "color"         "-foreground"
    597598        "text"          "-text"
    598599        "anchor"        "-anchor"
     
    604605        -font {Arial 8}
    605606        -text {}
    606         -fill black
     607        -fill {}
    607608        -anchor c
    608609    }
     
    610611        if { [info exists attr2option($attr)] } {
    611612            set option $attr2option($attr)
    612             set value [XmlGet $cpath.$attr]
     613            if { $attr == "text" } {
     614                set value [XmlGet $cpath.$attr]
     615            } else {
     616                set value [XmlGetSubst $cpath.$attr]
     617            }
    613618            set options($option) $value
    614619        }
    615620    }
    616621    # Coords
    617     set coords [XmlGet $cpath.coords]
     622    set coords [XmlGetSubst $cpath.coords]
    618623    set coords [string trim $coords]
    619624    if { $coords == "" } {
     
    623628    }
    624629    set options(-tags) $cname
    625     set id [eval $itk_component(drawing) create text $coords]
     630    set img [Rappture::icon hotspot_normal]
     631    set options(-image) $img
     632    set img [Rappture::icon hotspot_active]
     633    set options(-activeimage) $img
     634    set id [eval $itk_component(drawing) create hotspot $coords]
    626635    set _cname2id($cname) $id
    627636    eval $itk_component(drawing) itemconfigure $id [array get options]
     
    899908        }
    900909        $_parser eval [list set $name $value]
     910        set ::$name $value
    901911    }
    902912}
     
    907917        return $value
    908918    }
     919    return $value
     920}
     921
     922itcl::body Rappture::DrawingEntry::XmlGetSubst { path } {
     923    set value [$_owner xml get $path]
     924    if { $_parser == "" } {
     925        return $value
     926    }
    909927    return [$_parser eval [list subst -nocommands $value]]
    910928}
    911 
    912 #
    913 # Rewrite --
    914 #
    915 #       Rewrite string into list of text and substitution variables.
    916 #       Also break on new lines.
    917 #
    918 itcl::body Rappture::DrawingEntry::ApplySubstitutions { string } {
    919     set cursor 0
    920     set list {}
    921     set lines [split $string \n]
    922     foreach line $lines {
    923         while 1 {
    924             set index [string first \$ $line $cursor]
    925             if { $index == -1 } {
    926                 # Take the rest of the line
    927                 lappend list "text" [string range $line $cursor end]
    928                 break
    929             }
    930             # Find the end of the variable
    931             incr cursor
    932             set c [string index $line $cursor]
    933             if { $c != "{" } {
    934                 lappend list "text" "\$"
    935                 continue
    936             }
    937             set index [string first "\}" $string $cursor]
    938             if { $index == -1 } {
    939                 error "missing } character in variable substitution."
    940             }
    941             set varName [string range $string $cursor [expr $index - 1]]
    942             set cursor [expr $index  + 1]
    943             # Check that it's a substitution variable
    944             if { ![info exists _name2path($varName)] } {
    945                 error "no substitution \"$varName\" found"
    946             }
    947             set path $_name2path($name)
    948             set w [$_owner widgetfor $path]
    949             if { $w != "" } {
    950                 set value [$w value]
    951             } else {
    952                 set value ""
    953             }
    954             lappend list "subst" $value
    955         }
    956         lappend list "text" "\n"
    957     }
    958     return $list
    959 }
  • trunk/gui/src/Makefile.in

    r2743 r3038  
    5151OBJS            = \
    5252                RapptureGUI_Init.o \
     53                RpCanvHotspot.o \
    5354                RpCanvPlacard.o \
    5455                RpDiffview.o \
  • trunk/gui/src/RapptureGUI_Init.c

    r2717 r3038  
    2323
    2424extern Tcl_AppInitProc Rappturegui_Init;
     25extern Tcl_AppInitProc RpCanvHotspot_Init;
    2526extern Tcl_AppInitProc RpCanvPlacard_Init;
     27extern Tcl_AppInitProc RpConvertDxToVtk_Init;
    2628extern Tcl_AppInitProc RpDiffview_Init;
    2729
     
    4850        return TCL_ERROR;
    4951    }
     52    if (RpCanvHotspot_Init(interp) != TCL_OK) {
     53        return TCL_ERROR;
     54    }
    5055    return TCL_OK;
    5156}
  • trunk/gui/src/RpCanvHotspot.c

    r3037 r3038  
    3939#define VAR_FLAGS (TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS)
    4040
     41#define REDRAW_PENDING          (1<<0)
     42#define LAYOUT_PENDING          (1<<1)
     43#define SUBST_PENDING           (1<<2)
     44
     45#undef ROUND
     46#define ROUND(x)        ((int)(((double)(x)) + (((x)<0.0) ? -0.5 : 0.5)))
     47
     48#define IMAGE_PAD       3
     49
    4150typedef struct _ItemSegment ItemSegment;
     51typedef struct _HotspotItem HotspotItem;
    4252
    4353/*
     
    4656 */
    4757struct _ItemSegment {
     58    HotspotItem *itemPtr;
    4859    ItemSegment *nextPtr;
    4960    int type;                           /* Image, normal text, or substituted
    5061                                         * text. */
    51     short int x, y;                     /* Location of image or text on
    52                                          * canvas. */
     62    short int x, y;                     /* Location of segment on canvas. */
     63    short int width, height;            /* Dimension of segment. */
    5364    Tk_TextLayout layout;               /* Layout of normal or substituted
    5465                                         * text */
    5566    int length;                         /* # of bytes in below string. */
    5667    int lineNum;                        /* Line where segment if located. */
    57     const char *subst;                  /* Substitututed text. */
    58     const char text[1];
     68    char *subst;                        /* Substitututed text. */
     69    char text[1];
    5970};
    6071
     
    6273 * Record for each hotspot item:
    6374 */
    64 typedef struct HotspotItem  {
    65     Tk_Item header;                     /* Generic stuff that's the same for
     75struct _HotspotItem  {
     76    Tk_Item base;                       /* Generic stuff that's the same for
    6677                                         * all types.  MUST BE FIRST IN
    6778                                         * STRUCTURE. */
     79    unsigned int flags;
    6880    Tcl_Interp *interp;                 /* Interp that owns this item */
     81    Display *display;
    6982    Tk_Window tkwin;                    /* Window that represents this
    7083                                         * canvas */
     
    88101                                         * (x,y) */
    89102    XColor *textColor;                  /* Color for normal text */
    90     XColor *substTextColor;             /* Color for substitututed text */
     103    XColor *substColor;                 /* Color for substitututed text */
    91104    XColor *outlineColor;               /* Color for outline of rectangle */
    92105    Tk_3DBorder border;                 /* If non-NULL, background color of
     
    99112    Tk_Font substFont;                  /* Font for drawing substituted text. */
    100113
    101     int width;                          /* Fixed width for hotspot (0 = not
    102                                          * set) */
    103     int maxWidth;                       /* Maximum overall width for
    104                                          * hotspot */
    105     int padding;                        /* Padding around text and images */
    106 
    107114    const char *imageName;              /* Name of normal hotspot image. */
    108115    const char *activeImageName;        /* Name of active hotspot image. */
     
    115122     * configuration settings above:
    116123     */
    117     Tk_Image image;                     /* Normal hotspot icon. */
    118     Tk_Image activeImage;               /* Active hotspot icon. */
    119124    GC normalGC;                        /* Graphics context for drawing
    120125                                         * text. */
    121     GC rectGC;                          /* Graphics context for rectangle
    122                                          * outline. */
    123126    GC substGC;                         /* GC for substituted text. */
     127    GC outlineGC;                       /* GC for outline? */
    124128    ItemSegment *firstPtr, *lastPtr;    /* List of hotspot segments. */
    125129    int width, height;                  /* Dimension of bounding box. */
    126 } HotspotItem;
     130    ItemSegment *activePtr;             /* Active segment. */
     131    short int maxImageWidth, maxImageHeight;
     132    int numLines;
     133};
    127134
    128135/*
     
    136143static Tk_ConfigSpec configSpecs[] = {
    137144    {TK_CONFIG_STRING, "-activeimage", "activeImage", (char*)NULL, (char*)NULL,
    138         Tk_Offset(HotspotItem, activeImage), TK_CONFIG_NULL_OK},
     145        Tk_Offset(HotspotItem, activeImageName), TK_CONFIG_NULL_OK},
    139146    {TK_CONFIG_ANCHOR, "-anchor", "anchor", (char*)NULL,
    140147        "center", Tk_Offset(HotspotItem, anchor),
    141148        TK_CONFIG_DONT_SET_DEFAULT},
    142     {TK_CONFIG_BORDER, "-background", "background", (char*)NULL,
     149    {TK_CONFIG_BORDER, "-background", (char *)NULL, (char*)NULL,
    143150        "", Tk_Offset(HotspotItem, border), TK_CONFIG_NULL_OK},
    144151    {TK_CONFIG_PIXELS, "-borderwidth", "borderWidth", (char*)NULL,
    145152        "0", Tk_Offset(HotspotItem, borderWidth), 0},
    146     {TK_CONFIG_SYNONYM, "-fill", "background", (char *) NULL, (char *) NULL,
    147         0, 0},
     153    {TK_CONFIG_BORDER, "-fill", (char *)NULL, (char*)NULL,
     154        "", Tk_Offset(HotspotItem, border), TK_CONFIG_NULL_OK},
    148155    {TK_CONFIG_FONT, "-font", "font", (char*)NULL,
    149         "helvetica -12", Tk_Offset(HotspotItem, tkfont), 0},
     156        "helvetica -12", Tk_Offset(HotspotItem, font), 0},
    150157    {TK_CONFIG_COLOR, "-foreground", "foreground", (char*)NULL,
    151158        "black", Tk_Offset(HotspotItem, textColor), 0},
    152159    {TK_CONFIG_FONT, "-substitutionfont", (char*)NULL, (char*)NULL,
    153         "helvetica -12", Tk_Offset(HotspotItem, substFont), TK_CONFIG_NULL_OK},
     160        "courier -12", Tk_Offset(HotspotItem, substFont), 0},
    154161    {TK_CONFIG_COLOR, "-substitutionforeground", (char*)NULL, (char*)NULL,
    155         "black", Tk_Offset(HotspotItem, substTextColor), TK_CONFIG_NULL_OK},
     162        "blue", Tk_Offset(HotspotItem, substColor), 0},
    156163    {TK_CONFIG_STRING, "-image", (char*)NULL, (char*)NULL, (char*)NULL,
    157         Tk_Offset(HotspotItem, image), 0},
     164        Tk_Offset(HotspotItem, imageName), 0},
    158165    {TK_CONFIG_COLOR, "-outline", (char*)NULL, (char*)NULL,
    159166        "", Tk_Offset(HotspotItem, outlineColor), TK_CONFIG_NULL_OK},
     
    171178 * Prototypes for procedures defined in this file
    172179 */
    173 static Tk_ItemCofigureProc ConfigureProc;
     180static Tk_ItemConfigureProc ConfigureProc;
    174181static Tk_ItemCreateProc CreateProc;
    175182static Tk_ItemDeleteProc DeleteProc;
     
    177184static Tk_ItemScaleProc ScaleProc;
    178185static Tk_ItemTranslateProc TranslateProc;
    179 static Tk_ItemCoordsProc CoordsProc;
     186static Tk_ItemCoordProc CoordsProc;
    180187static Tk_ItemAreaProc AreaProc;
    181188static Tk_ItemPointProc PointProc;
    182 static Tk_ItemPostscriptproc PostscriptProc;
     189static Tk_ItemPostscriptProc PostscriptProc;
    183190
    184191static Tk_ImageChangedProc ImageChangedProc;
     
    187194 * The structures below defines the canvas item type:
    188195 */
    189 Tk_ItemType rpHotspotType = {
     196static Tk_ItemType hotspotType = {
    190197    "hotspot",                          /* name */
    191198    sizeof(HotspotItem),                /* itemSize */
     
    412419} TkCanvas;
    413420
     421/* Forward declarations. */
     422static void ComputeBbox(HotspotItem *itemPtr);
     423
     424
     425static void
     426EventuallyRedraw(HotspotItem *itemPtr)
     427{
     428    if ((itemPtr->flags & REDRAW_PENDING) == 0) {
     429        itemPtr->flags |= REDRAW_PENDING;
     430        Tk_CanvasEventuallyRedraw(itemPtr->canvas, itemPtr->base.x1,
     431                itemPtr->base.y1, itemPtr->base.x2, itemPtr->base.y2);
     432    }
     433}
     434
     435static int
     436GetCoordFromObj(Tcl_Interp *interp, HotspotItem *itemPtr, Tcl_Obj *objPtr,
     437                double *valuePtr)
     438{
     439    const char *string;
     440
     441    string = Tcl_GetString(objPtr);
     442    return Tk_CanvasGetCoord(interp, itemPtr->canvas, string, valuePtr);
     443}
     444
     445
     446
     447/*
     448 *---------------------------------------------------------------------------
     449 *
     450 * TraceVarProc --
     451 *
     452 *      This procedure is invoked when someone changes the state variable
     453 *      associated with a radiobutton or checkbutton entry.  The entry's
     454 *      selected state is set to match the value of the variable.
     455 *
     456 * Results:
     457 *      NULL is always returned.
     458 *
     459 * Side effects:
     460 *      The combobox entry may become selected or deselected.
     461 *
     462 *---------------------------------------------------------------------------
     463 */
     464static char *
     465TraceVarProc(
     466    ClientData clientData,              /* Information about the item. */
     467    Tcl_Interp *interp,                 /* Interpreter containing variable. */
     468    const char *name1,                  /* First part of variable's name. */
     469    const char *name2,                  /* Second part of variable's name. */
     470    int flags)                          /* Describes what just happened. */
     471{
     472    HotspotItem *itemPtr = clientData;
     473
     474    if (flags & TCL_INTERP_DESTROYED) {
     475        return NULL;                    /* Interpreter is going away. */
     476
     477    }
     478    /*
     479     * If the variable is being unset, then re-establish the trace.
     480     */
     481    if (flags & TCL_TRACE_UNSETS) {
     482        if (flags & TCL_TRACE_DESTROYED) {
     483            Tcl_TraceVar(interp, name1, VAR_FLAGS, TraceVarProc, itemPtr);
     484        }
     485    }
     486    itemPtr->flags |= SUBST_PENDING;
     487    EventuallyRedraw(itemPtr);
     488    return NULL;                        /* Done. */
     489}
     490
     491/*
     492 * ----------------------------------------------------------------------
     493 *
     494 * ImageChangedProc --
     495 *
     496 *      This procedure is invoked by the image code whenever the manager
     497 *      for an image does something that affects the image's size or
     498 *      how it is displayed.
     499 *
     500 * Results:
     501 *      None.
     502 *
     503 * Side effects:
     504 *      Arranges for the canvas to get redisplayed.
     505 *
     506 * ----------------------------------------------------------------------
     507 */
     508static void
     509ImageChangedProc(clientData, x, y, width, height, imgWidth, imgHeight)
     510    ClientData clientData;              /* Pointer to canvas item for image. */
     511    int x, y;                           /* Upper left pixel (within image)
     512                                         * that must be redisplayed. */
     513    int width, height;                  /* Dimensions of area to redisplay
     514                                         * (may be <= 0). */
     515    int imgWidth, imgHeight;            /* New dimensions of image. */
     516{     
     517    HotspotItem *itemPtr = (HotspotItem *) clientData;
     518   
     519    itemPtr->flags |= LAYOUT_PENDING;
     520    EventuallyRedraw(itemPtr);
     521    return;
     522}
     523
     524static void
     525AddTextSegment(HotspotItem *itemPtr, const char *text, int length)
     526{
     527    ItemSegment *segPtr;
     528
     529    segPtr = (ItemSegment *)Tcl_Alloc(sizeof(ItemSegment) + length + 1);
     530    memset(segPtr, 0, sizeof(ItemSegment) + length + 1);
     531    segPtr->itemPtr = itemPtr;
     532    segPtr->lineNum = itemPtr->numLines;
     533    segPtr->type = SEGMENT_TYPE_TEXT;
     534    strncpy(segPtr->text, text, length);
     535    segPtr->text[length] = '\0';
     536    segPtr->length = length;
     537    segPtr->x = segPtr->y = 0;
     538    segPtr->nextPtr = NULL;
     539    if (itemPtr->firstPtr == NULL) {
     540        itemPtr->firstPtr = segPtr;
     541    }
     542    if (itemPtr->lastPtr == NULL) {
     543        itemPtr->lastPtr = segPtr;
     544    } else {
     545        itemPtr->lastPtr->nextPtr = segPtr;
     546        itemPtr->lastPtr = segPtr;
     547    }
     548}
     549
     550static void
     551AddVariableSegment(HotspotItem *itemPtr, const char *varName, int length)
     552{
     553    ItemSegment *segPtr;
     554    Tcl_Interp *interp;
     555
     556    segPtr = (ItemSegment *)Tcl_Alloc(sizeof(ItemSegment) + length + 1);
     557    memset(segPtr, 0, sizeof(ItemSegment) + length + 1);
     558    segPtr->itemPtr = itemPtr;
     559    segPtr->lineNum = itemPtr->numLines;
     560    segPtr->type = SEGMENT_TYPE_VARIABLE;
     561    memcpy(segPtr->text, varName, length);
     562    segPtr->text[length] = '\0';
     563    segPtr->length = length;
     564    interp = itemPtr->substInterp;
     565    if (interp == NULL) {
     566        interp = itemPtr->interp;
     567    }
     568    Tcl_TraceVar(interp, varName, VAR_FLAGS, TraceVarProc, itemPtr);
     569    segPtr->subst = NULL;
     570    segPtr->x = segPtr->y = 0;
     571    segPtr->nextPtr = NULL;
     572    if (itemPtr->firstPtr == NULL) {
     573        itemPtr->firstPtr = segPtr;
     574    }
     575    if (itemPtr->lastPtr == NULL) {
     576        itemPtr->lastPtr = segPtr;
     577    } else {
     578        itemPtr->lastPtr->nextPtr = segPtr;
     579        itemPtr->lastPtr = segPtr;
     580    }
     581}
     582
     583static void
     584AddHotspotSegment(HotspotItem *itemPtr)
     585{
     586    ItemSegment *segPtr;
     587
     588    segPtr = (ItemSegment *)Tcl_Alloc(sizeof(ItemSegment));
     589    memset(segPtr, 0, sizeof(ItemSegment));
     590    segPtr->itemPtr = itemPtr;
     591    segPtr->lineNum = itemPtr->numLines;
     592    segPtr->type = SEGMENT_TYPE_HOTSPOT;
     593    segPtr->text[0] = '\0';
     594    segPtr->length = 0;
     595    segPtr->x = segPtr->y = 0;
     596    segPtr->nextPtr = NULL;
     597    if (itemPtr->firstPtr == NULL) {
     598        itemPtr->firstPtr = segPtr;
     599    }
     600    if (itemPtr->lastPtr == NULL) {
     601        itemPtr->lastPtr = segPtr;
     602    } else {
     603        itemPtr->lastPtr->nextPtr = segPtr;
     604        itemPtr->lastPtr = segPtr;
     605    }
     606}
     607
     608static void
     609DestroySegment(ItemSegment *segPtr)
     610{
     611    HotspotItem *itemPtr;
     612
     613    itemPtr = segPtr->itemPtr;
     614    if (segPtr->layout != NULL) {
     615        Tk_FreeTextLayout(segPtr->layout);
     616    }
     617    if (segPtr->type == SEGMENT_TYPE_VARIABLE) {
     618        Tcl_UntraceVar(itemPtr->interp, segPtr->text, VAR_FLAGS, TraceVarProc,
     619                itemPtr);
     620    }
     621    if (segPtr->subst != NULL) {
     622        Tcl_Free((char *)segPtr->subst);
     623    }
     624    Tcl_Free((char *)segPtr);
     625}
     626
     627static void
     628DestroySegments(HotspotItem *itemPtr)
     629{
     630    ItemSegment *segPtr, *nextPtr;
     631
     632    for (segPtr = itemPtr->firstPtr; segPtr != NULL; segPtr = nextPtr) {
     633        nextPtr = segPtr->nextPtr;
     634        DestroySegment(segPtr);
     635    }
     636    itemPtr->firstPtr = itemPtr->lastPtr = NULL;
     637}
     638
     639static void
     640DoSubst(HotspotItem *itemPtr)
     641{
     642    ItemSegment *segPtr;
     643    Tcl_Interp *interp;
     644
     645    itemPtr->flags &= ~SUBST_PENDING;
     646    interp = itemPtr->substInterp;
     647    if (interp == NULL) {
     648        interp = itemPtr->interp;
     649    }
     650    for (segPtr = itemPtr->firstPtr; segPtr != NULL; segPtr = segPtr->nextPtr) {
     651        const char *value;
     652
     653        if (segPtr->type != SEGMENT_TYPE_VARIABLE) {
     654            continue;
     655        }
     656        value = Tcl_GetVar(interp, segPtr->text, TCL_GLOBAL_ONLY);
     657        if (value == NULL) {
     658            value = "???";
     659        }
     660        if (segPtr->subst != NULL) {
     661            Tcl_Free((char *)segPtr->subst);
     662        }
     663        segPtr->subst = Tcl_Alloc(strlen(value) + 1);
     664        strcpy(segPtr->subst, value);
     665    }
     666    itemPtr->flags |= LAYOUT_PENDING;
     667}
     668
     669static void
     670ComputeGeometry(HotspotItem *itemPtr)
     671{
     672    int x, y, w, h;
     673    ItemSegment *segPtr;
     674    int imgWidth, imgHeight;
     675    int maxWidth, maxHeight;
     676    Tk_Font tkFont;
     677    int justify;
     678    int wrapLength;
     679    int flags;
     680
     681    justify = TK_JUSTIFY_LEFT;
     682    wrapLength = 0;
     683    flags = 0;
     684    /* Collect the individual segment sizes. */
     685    imgWidth = itemPtr->maxImageWidth + 2 * IMAGE_PAD;
     686    imgHeight = itemPtr->maxImageHeight + 2 * IMAGE_PAD;
     687    for (segPtr = itemPtr->firstPtr; segPtr != NULL; segPtr = segPtr->nextPtr) {
     688        if (segPtr->layout != NULL) {
     689            Tk_FreeTextLayout(segPtr->layout);
     690        }
     691        switch (segPtr->type) {
     692        case SEGMENT_TYPE_HOTSPOT:
     693            w = imgWidth, h = imgHeight;
     694            break;
     695        case SEGMENT_TYPE_VARIABLE:
     696            tkFont = (itemPtr->substFont != NULL) ?
     697                itemPtr->substFont : itemPtr->font;
     698            segPtr->layout = Tk_ComputeTextLayout(tkFont, segPtr->subst,
     699                -1, wrapLength, justify, flags, &w, &h);
     700            break;
     701        case SEGMENT_TYPE_TEXT:
     702            segPtr->layout = Tk_ComputeTextLayout(itemPtr->font,
     703                segPtr->text, -1, wrapLength, justify, flags,
     704                &w, &h);
     705            break;
     706        default:
     707            Tcl_Panic("unknown hotspot segment type");
     708        }
     709        segPtr->width = w;
     710        segPtr->height = h;
     711#ifdef notdef
     712        fprintf(stderr, "ComputeGeometry: item=(%s) segment=%x (%s) type=%d w=%d h=%d lineNum=%d nextPtr=%x\n",
     713                itemPtr->text, segPtr, segPtr->text, segPtr->type, segPtr->width,
     714                segPtr->height, segPtr->lineNum, segPtr->nextPtr);
     715#endif
     716    }
     717    /* Compute the relative positions of the segments. */
     718    x = y = 0;
     719    maxWidth = maxHeight = 0;
     720    for (segPtr = itemPtr->firstPtr; segPtr != NULL; /*empty*/) {
     721        int maxHeight, lineNum;
     722        ItemSegment *startPtr;
     723
     724        maxHeight = 0;
     725        lineNum = segPtr->lineNum;
     726        startPtr = segPtr;
     727        x = 0;
     728        while ((segPtr != NULL) && (segPtr->lineNum == lineNum)) {
     729            if (segPtr->height > maxHeight) {
     730                maxHeight = segPtr->height;
     731            }
     732            segPtr->x = x;
     733            x += segPtr->width;
     734            segPtr = segPtr->nextPtr;
     735        }
     736        if (x > maxWidth) {
     737            maxWidth = x;
     738        }
     739        segPtr = startPtr;
     740        while ((segPtr != NULL) && (segPtr->lineNum == lineNum)) {
     741            segPtr->y = y + (maxHeight - segPtr->height) / 2;
     742            segPtr = segPtr->nextPtr;
     743        }
     744        y += maxHeight;
     745    }
     746    itemPtr->width = maxWidth;
     747    itemPtr->height = y;
     748}
     749
     750static int
     751ParseDescription(Tcl_Interp *interp, HotspotItem *itemPtr,
     752                const char *description)
     753{
     754    const char *p, *start;
     755
     756    if (itemPtr->firstPtr != NULL) {
     757        DestroySegments(itemPtr);
     758    }
     759    start = description;
     760    itemPtr->numLines = 1;
     761    for (p = description; *p != '\0'; p++) {
     762        if ((p[0] == '$') && (p[1] == '{')) {
     763            const char *varName;
     764            const char *q;
     765
     766            if (p > start) {
     767                /* Save the leading text. */
     768                AddTextSegment(itemPtr, start, p - start);
     769                start = p;
     770            }
     771            /* Start of substitution variable. */
     772            varName = p + 2;
     773            for (q = varName; q != '\0'; q++) {
     774                if (*q == '}') {
     775                    AddVariableSegment(itemPtr, varName, q - varName);
     776                    AddHotspotSegment(itemPtr);
     777                    p = q;
     778                    start = p + 1;
     779                    goto next;
     780                }
     781            }
     782            Tcl_AppendResult(interp, "back variable specification in \"",
     783                             description, "\"", (char *)NULL);
     784            return TCL_ERROR;
     785        } else if (p[0] == '\n') {
     786            if (p > start) {
     787                AddTextSegment(itemPtr, start, p - start);
     788                start = p + 1;
     789                itemPtr->numLines++;
     790            }
     791        }
     792    next:
     793        ;
     794    }
     795    if (p > start) {
     796        /* Save the trailing text. */
     797        AddTextSegment(itemPtr, start, p - start);
     798    }
     799    itemPtr->flags |= SUBST_PENDING;
     800    return TCL_OK;
     801}
    414802
    415803/*
     
    437825{
    438826    HotspotItem *itemPtr = (HotspotItem *)canvItemPtr;
    439     int i;
    440827    double x, y;
     828    Tk_Window tkwin;
    441829
    442830    tkwin = Tk_CanvasTkwin(canvas);
    443831    if (objc < 2) {
    444832        Tcl_AppendResult(interp, "wrong # args: should be \"",
    445             Tk_PathName(tkwin), " create ", itemPtr->typePtr->name,
     833            Tk_PathName(tkwin), " create ", canvItemPtr->typePtr->name,
    446834            " x y ?options?\"", (char *)NULL);
    447835        return TCL_ERROR;
     
    454842    itemPtr->activeImage = NULL;
    455843    itemPtr->activeImageName = NULL;
     844    itemPtr->activePtr = NULL;
    456845    itemPtr->anchor = TK_ANCHOR_CENTER;
    457846    itemPtr->border = NULL;
     
    459848    itemPtr->canvas = canvas;
    460849    itemPtr->display = Tk_Display(tkwin);
     850    itemPtr->firstPtr = NULL;
    461851    itemPtr->font = NULL;
     852    itemPtr->height = 0;
    462853    itemPtr->image = NULL;
    463854    itemPtr->imageName  = NULL;
    464855    itemPtr->interp = interp;
     856    itemPtr->lastPtr = NULL;
     857    itemPtr->maxImageWidth = itemPtr->maxImageHeight = 0;
    465858    itemPtr->normalGC = None;
     859    itemPtr->numLines = 0;
    466860    itemPtr->outlineColor = NULL;
    467861    itemPtr->outlineGC = None;
    468862    itemPtr->relief = TK_RELIEF_FLAT;
     863    itemPtr->substColor = NULL;
    469864    itemPtr->substFont = NULL;
    470865    itemPtr->substGC = None;
    471866    itemPtr->substInterp = interp;
    472     itemPtr->substTextColor = NULL;
     867    itemPtr->text = NULL;
    473868    itemPtr->textColor = NULL;
    474869    itemPtr->tkwin = tkwin;
    475870    itemPtr->width = 0;
     871    itemPtr->x = itemPtr->y = 0.0;
    476872
    477873    /* Process the arguments to fill in the item record. */
    478     if ((Tk_CanvasGetCoord(interp, canvas, objv[0], &x) != TCL_OK) ||
    479         (Tk_CanvasGetCoord(interp, canvas, objv[1], &y) != TCL_OK)) {
    480         DeleteProc(canvas, itemPtr, itemPtr->display);
     874    if ((GetCoordFromObj(interp, itemPtr, objv[0], &x) != TCL_OK) ||
     875        (GetCoordFromObj(interp, itemPtr, objv[1], &y) != TCL_OK)) {
     876        DeleteProc(canvas, canvItemPtr, itemPtr->display);
    481877        return TCL_ERROR;
    482878    }
    483879    itemPtr->x = x;
    484880    itemPtr->y = y;
    485     ComputeBbox(canvas, itemPtr);
     881    ComputeBbox(itemPtr);
    486882    if (ConfigureProc(interp, canvas, canvItemPtr, objc - 2, objv + 2, 0)
    487883        != TCL_OK) {
    488         DeleteProc(canvas, itemPtr, itemPtr->display);
     884        DeleteProc(canvas, canvItemPtr, itemPtr->display);
    489885        return TCL_ERROR;
    490886    }
     
    520916
    521917        listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL);
    522         Tcl_ListObjAppendElement(interp, obj, Tcl_NewDoubleObj(itemPtr->x));
    523         Tcl_ListObjAppendElement(interp, obj, Tcl_NewDoubleObj(itemPtr->y));
     918        Tcl_ListObjAppendElement(interp, listObjPtr,
     919                Tcl_NewDoubleObj(itemPtr->x));
     920        Tcl_ListObjAppendElement(interp, listObjPtr,
     921                Tcl_NewDoubleObj(itemPtr->y));
    524922        Tcl_SetObjResult(interp, listObjPtr);
    525923        return TCL_OK;
     
    532930            return TCL_ERROR;
    533931        }
    534         if ((Tk_CanvasGetCoordFromObj(interp, canvas, elv[0], &x) != TCL_OK) ||
    535             (Tk_CanvasGetCoordFromObj(interp, canvas, elv[1], &y) != TCL_OK)) {
     932        if ((GetCoordFromObj(interp, itemPtr, elv[0], &x) != TCL_OK) ||
     933            (GetCoordFromObj(interp, itemPtr, elv[1], &y) != TCL_OK)) {
    536934            return TCL_ERROR;
    537935        }
    538     } else (objc == 3) {
    539         if ((Tk_CanvasGetCoordFromObj(interp, canvas, objv[0], &x) != TCL_OK) ||
    540             (Tk_CanvasGetCoordFromObj(interp, canvas, objv[1], &y) != TCL_OK)) {
     936    } else if (objc == 3) {
     937        if ((GetCoordFromObj(interp, itemPtr, objv[0], &x) != TCL_OK) ||
     938            (GetCoordFromObj(interp, itemPtr, objv[1], &y) != TCL_OK)) {
    541939            return TCL_ERROR;
    542940        }
     
    550948    itemPtr->x = x;
    551949    itemPtr->y = y;
    552     ComputeBbox(canvas, itemPtr);
     950    ComputeBbox(itemPtr);
    553951    return TCL_OK;
    554952}
     
    597995    itemPtr->normalGC = newGC;
    598996
    599     /* Rectangle GC */
    600     mask = GCLineWidth | GCForeground;
    601     gcValues.foreground = itemPtr->lineColor->pixel;
    602     gcValues.line_width = 1;
    603     newGC = Tk_GetGC(tkwin, mask, &gcValues);
    604     if (itemPtr->rectGC != None) {
    605         Tk_FreeGC(Tk_Display(tkwin), itemPtr->rectGC);
    606     }
    607     itemPtr->rectGC = newGC;
     997    /* Outline GC */
     998    if (itemPtr->outlineColor != NULL) {
     999        mask = GCLineWidth | GCForeground;
     1000        gcValues.foreground = itemPtr->outlineColor->pixel;
     1001        gcValues.line_width = 1;
     1002        newGC = Tk_GetGC(tkwin, mask, &gcValues);
     1003        if (itemPtr->outlineGC != None) {
     1004            Tk_FreeGC(Tk_Display(tkwin), itemPtr->outlineGC);
     1005        }
     1006        itemPtr->outlineGC = newGC;
     1007    }
    6081008
    6091009    /* Substituted text GC. */
     
    6141014        gcValues.font = Tk_FontId(itemPtr->font);
    6151015    }
    616     if (itemPtr->substTextColor != NULL) {
    617         gcValues.foreground = itemPtr->substTextColor->pixel;
     1016    if (itemPtr->substColor != NULL) {
     1017        gcValues.foreground = itemPtr->substColor->pixel;
    6181018    } else {
    6191019        gcValues.foreground = itemPtr->textColor->pixel;
    6201020    }
    6211021    newGC = Tk_GetGC(tkwin, mask, &gcValues);
    622     if (itemPtr->normalGC != None) {
     1022    if (itemPtr->substGC != None) {
    6231023        Tk_FreeGC(Tk_Display(tkwin), itemPtr->substGC);
    6241024    }
     
    6751075    itemPtr->activeImage = tkImage;
    6761076
    677     Tk_SizeOfImage(itemPtr->image, &imgWidth, &ingHeight);
    678 
    6791077    if (itemPtr->text != NULL) {
    680         ParseDescription(itemPtr, itemPtr->text);
    681     }
    682     ComputeBbox(canvas, itemPtr);
     1078        if (ParseDescription(interp, itemPtr, itemPtr->text) != TCL_OK) {
     1079            return TCL_ERROR;
     1080        }
     1081    }
     1082    ComputeBbox(itemPtr);
    6831083    return TCL_OK;
    6841084}
     
    7061106        Tk_FreeColor(itemPtr->textColor);
    7071107    }
    708     if (itemPtr->substTextColor != NULL) {
    709         Tk_FreeColor(itemPtr->substTextColor);
     1108    if (itemPtr->substColor != NULL) {
     1109        Tk_FreeColor(itemPtr->substColor);
    7101110    }
    7111111    if (itemPtr->outlineColor != NULL) {
     
    7131113    }
    7141114    if (itemPtr->text != NULL) {
    715         Tcl_Free(itemPtr->text);
    716     }
    717     if (itemPtr->substText != NULL) {
    718         Tcl_Free(itemPtr->substText);
     1115        Tcl_Free((char *)itemPtr->text);
    7191116    }
    7201117    if (itemPtr->imageName != NULL) {
    721         Tcl_Free(itemPtr->imageName);
     1118        Tcl_Free((char *)itemPtr->imageName);
    7221119    }
    7231120    if (itemPtr->activeImageName != NULL) {
    724         Tcl_Free(itemPtr->activeImageName);
     1121        Tcl_Free((char *)itemPtr->activeImageName);
    7251122    }
    7261123    if (itemPtr->image != NULL ) {
     
    7391136        Tk_FreeGC(display, itemPtr->normalGC);
    7401137    }
    741     if (itemPtr->rectGC != None) {
    742         Tk_FreeGC(display, itemPtr->rectGC);
    743     }
    744     if (itemPtr->rectGC != None) {
    745         Tk_FreeGC(display, itemPtr->rectGC);
     1138    if (itemPtr->outlineGC != None) {
     1139        Tk_FreeGC(display, itemPtr->outlineGC);
    7461140    }
    7471141    if (itemPtr->substGC != None) {
     
    7511145}
    7521146
    753 /*
    754  * ------------------------------------------------------------------------
     1147
     1148/*
     1149 *---------------------------------------------------------------------------
     1150 *
     1151 * TranslateAnchor --
     1152 *
     1153 *      Translate the coordinates of a given bounding box based upon the
     1154 *      anchor specified.  The anchor indicates where the given xy position
     1155 *      is in relation to the bounding box.
     1156 *
     1157 *              nw --- n --- ne
     1158 *              |            |     x,y ---+
     1159 *              w   center   e      |     |
     1160 *              |            |      +-----+
     1161 *              sw --- s --- se
     1162 *
     1163 * Results:
     1164 *      The translated coordinates of the bounding box are returned.
     1165 *
     1166 *---------------------------------------------------------------------------
     1167 */
     1168static void
     1169TranslateAnchor(HotspotItem *itemPtr, int *xPtr, int *yPtr)
     1170{
     1171    int x, y;
     1172
     1173    x = *xPtr, y = *yPtr;
     1174    switch (itemPtr->anchor) {
     1175    case TK_ANCHOR_NW:          /* Upper left corner */
     1176        break;
     1177    case TK_ANCHOR_W:           /* Left center */
     1178        y -= (itemPtr->height / 2);
     1179        break;
     1180    case TK_ANCHOR_SW:          /* Lower left corner */
     1181        y -= itemPtr->height;
     1182        break;
     1183    case TK_ANCHOR_N:           /* Top center */
     1184        x -= (itemPtr->width / 2);
     1185        break;
     1186    case TK_ANCHOR_CENTER:      /* Centered */
     1187        x -= (itemPtr->width / 2);
     1188        y -= (itemPtr->height / 2);
     1189        break;
     1190    case TK_ANCHOR_S:           /* Bottom center */
     1191        x -= (itemPtr->width / 2);
     1192        y -= itemPtr->height;
     1193        break;
     1194    case TK_ANCHOR_NE:          /* Upper right corner */
     1195        x -= itemPtr->width;
     1196        break;
     1197    case TK_ANCHOR_E:           /* Right center */
     1198        x -= itemPtr->width;
     1199        y -= (itemPtr->height / 2);
     1200        break;
     1201    case TK_ANCHOR_SE:          /* Lower right corner */
     1202        x -= itemPtr->width;
     1203        y -= itemPtr->height;
     1204        break;
     1205    }
     1206    *xPtr = x;
     1207    *yPtr = y;
     1208}
     1209
     1210/*
     1211 * ------------------------------------------------------------------------
     1212 *
    7551213 *  ComputeBbox --
    7561214 *
    757  *    This procedure is invoked to compute the bounding box of
    758  *    all the pixels that may be drawn as part of a text item.
    759  *    In addition, it recomputes all of the geometry information
    760  *    used to display a text item or check for mouse hits.
     1215 *    This procedure is invoked to compute the bounding box of all the pixels
     1216 *    that may be drawn as part of a text item.  In addition, it recomputes
     1217 *    all of the geometry information used to display a text item or check for
     1218 *    mouse hits.
    7611219 *
    7621220 *  Results:
     
    7641222 *
    7651223 *  Side effects:
    766  *    The fields x1, y1, x2, and y2 are updated in the header
     1224 *    The fields x1, y1, x2, and y2 are updated in the base structure
    7671225 *    for itemPtr, and the linePtr structure is regenerated
    7681226 *    for itemPtr.
     1227 *
    7691228 * ------------------------------------------------------------------------
    7701229 */
    7711230static void
    772 ComputeBbox(Tk_Canvas canvas, HotspotItem *itemPtr)
    773 {
    774     int leftX, topY, width, height, maxwidth, ellw, ellh;
    775 
    776     /*
    777      * Get the layout for the hotspot text.
    778      */
    779     itemPtr->textDrawChars = itemPtr->textNumChars;
    780 
    781     Tk_FreeTextLayout(itemPtr->textLayout);
    782     itemPtr->textLayout = Tk_ComputeTextLayout(itemPtr->tkfont,
    783             itemPtr->text, itemPtr->textNumChars, -1,
    784             TK_JUSTIFY_LEFT, 0, &width, &height);
    785 
    786     itemPtr->textWidth = width;
    787 
    788     if (itemPtr->textColor == NULL) {
    789         width = height = 0;
     1231ComputeBbox(HotspotItem *itemPtr)
     1232{
     1233    int x, y;
     1234
     1235    x = ROUND(itemPtr->x);
     1236    y = ROUND(itemPtr->y);
     1237    TranslateAnchor(itemPtr,&x, &y);
     1238    itemPtr->base.x1 = x;
     1239    itemPtr->base.y1 = y;
     1240    itemPtr->base.x2 = x + itemPtr->width;
     1241    itemPtr->base.y2 = y + itemPtr->height;
     1242}
     1243
     1244static void
     1245DrawSegment(ItemSegment *segPtr, Drawable drawable, int x, int y)
     1246{
     1247    HotspotItem *itemPtr;
     1248
     1249    itemPtr = segPtr->itemPtr;
     1250    if (segPtr->type == SEGMENT_TYPE_HOTSPOT) {
     1251        Tk_Image tkImage;
     1252        int w, h;
     1253
     1254        tkImage = NULL;
     1255        if (itemPtr->activePtr == segPtr) {
     1256            tkImage = itemPtr->activeImage;
     1257        }
     1258        if (tkImage == NULL) {
     1259            tkImage = itemPtr->image;
     1260        }
     1261        Tk_SizeOfImage(tkImage, &w, &h);
     1262        Tk_RedrawImage(tkImage, 0, 0, w, h, drawable, x + segPtr->x + IMAGE_PAD,
     1263                y + segPtr->y + IMAGE_PAD);
    7901264    } else {
    791         width += 2*itemPtr->padding;
    792         height += 2*itemPtr->padding;
    793     }
    794 
    795     /*
    796      * If the current value has an image, add on its width.
    797      */
    798     if (itemPtr->imageLeft) {
    799         width += itemPtr->imageLeftW;
    800         if (itemPtr->textWidth > 0) {
    801             width += itemPtr->padding;
    802         }
    803         if (itemPtr->imageLeftH > height) {
    804             height = itemPtr->imageLeftH;
    805         }
    806     }
    807     if (itemPtr->imageRight) {
    808         width += itemPtr->imageRightW;
    809         if (itemPtr->textWidth > 0) {
    810             width += itemPtr->padding;
    811         }
    812         if (itemPtr->imageRightH > height) {
    813             height = itemPtr->imageRightH;
    814         }
    815     }
    816 
    817     /*
    818      * Add on extra size for the 3D border (if there is one).
    819      */
    820     if (itemPtr->borderWidth > 0) {
    821         width += 2*itemPtr->borderWidth;
    822         height += 2*itemPtr->borderWidth;
    823     }
    824 
    825     /*
    826      * If the overall width exceeds the -maxwidth, then we must
    827      * truncate the text to make it fit.
    828      */
    829     maxwidth = 0;
    830     if (itemPtr->maxWidth > 0 && itemPtr->width > 0) {
    831         maxwidth = (itemPtr->width < itemPtr->maxWidth) ? itemPtr->width : itemPtr->maxWidth;
    832     } else if (itemPtr->maxWidth > 0) {
    833         maxwidth = itemPtr->maxWidth;
    834     } else if (itemPtr->width > 0) {
    835         maxwidth = itemPtr->width;
    836     }
    837 
    838     if (maxwidth > 0 && width > maxwidth) {
    839         Tk_SizeOfBitmap(Tk_Display(itemPtr->tkwin), itemPtr->dots, &ellw, &ellh);
    840         width = maxwidth - 2*itemPtr->padding - 2*itemPtr->borderWidth - ellw;
    841         if (itemPtr->imageLeft) {
    842             width -= itemPtr->imageLeftW + itemPtr->padding;
    843         }
    844         if (itemPtr->imageRight) {
    845             width -= itemPtr->imageRightW + itemPtr->padding;
    846         }
    847         if (width < 0) { width = 0; }
    848 
    849         itemPtr->textDrawChars = Tk_MeasureChars(itemPtr->tkfont,
    850             itemPtr->text, itemPtr->textNumChars, width, /*flags*/ 0,
    851             &itemPtr->textWidth);
    852 
    853         /* recompute layout for truncated text */
    854         Tk_FreeTextLayout(itemPtr->textLayout);
    855         itemPtr->textLayout = Tk_ComputeTextLayout(itemPtr->tkfont,
    856                 itemPtr->text, itemPtr->textDrawChars, -1,
    857                 TK_JUSTIFY_LEFT, 0, NULL, NULL);
    858 
    859         width = maxwidth;  /* fit everything in this width */
    860     }
    861 
    862     /*
    863      * If there's a fixed -width, then use that instead.
    864      */
    865     if (itemPtr->width > 0) {
    866         width = itemPtr->width;
    867     }
    868 
    869     /*
    870      * Use overall geometry information to compute the top-left corner
    871      * of the bounding box for the text item.
    872      */
    873     leftX = (int) (itemPtr->x + 0.5);
    874     topY = (int) (itemPtr->y + 0.5);
    875     switch (itemPtr->anchor) {
    876         case TK_ANCHOR_NW:
    877         case TK_ANCHOR_N:
    878         case TK_ANCHOR_NE:
    879             break;
    880 
    881         case TK_ANCHOR_W:
    882         case TK_ANCHOR_CENTER:
    883         case TK_ANCHOR_E:
    884             topY -= height / 2;
    885             break;
    886 
    887         case TK_ANCHOR_SW:
    888         case TK_ANCHOR_S:
    889         case TK_ANCHOR_SE:
    890             topY -= height;
    891             break;
    892     }
    893     switch (itemPtr->anchor) {
    894         case TK_ANCHOR_NW:
    895         case TK_ANCHOR_W:
    896         case TK_ANCHOR_SW:
    897             break;
    898 
    899         case TK_ANCHOR_N:
    900         case TK_ANCHOR_CENTER:
    901         case TK_ANCHOR_S:
    902             leftX -= width / 2;
    903             break;
    904 
    905         case TK_ANCHOR_NE:
    906         case TK_ANCHOR_E:
    907         case TK_ANCHOR_SE:
    908             leftX -= width;
    909             break;
    910     }
    911 
    912     itemPtr->leftEdge  = leftX;
    913     itemPtr->rightEdge = leftX + width;
    914 
    915     /*
    916      * Last of all, update the bounding box for the item.
    917      */
    918     itemPtr->header.x1 = leftX;
    919     itemPtr->header.y1 = topY;
    920     itemPtr->header.x2 = leftX + width;
    921     itemPtr->header.y2 = topY + height;
     1265        GC gc;
     1266
     1267        gc = (segPtr->type == SEGMENT_TYPE_VARIABLE) ?
     1268            itemPtr->substGC : itemPtr->normalGC;
     1269        Tk_DrawTextLayout(Tk_Display(itemPtr->tkwin), drawable, gc,
     1270                segPtr->layout, x + segPtr->x, y + segPtr->y, 0, -1);
     1271    }
    9221272}
    9231273
     
    9431293{
    9441294    HotspotItem *itemPtr = (HotspotItem *) canvItemPtr;
    945     int imagew, delta, ellx, elly, ellw, ellh;
    946     short drawableX, drawableY;
    947     Tk_FontMetrics fm;
    948 
    949     if (itemPtr->gcText == None) {
    950         return;
    951     }
    952     Tk_CanvasDrawableCoords(canvas, (double)itemPtr->leftEdge,
    953             (double)itemPtr->header.y1, &canvasX, &canvasY);
    954 
    955     /*
    956      * If there's a background rectangle, draw it first.
    957      */
     1295    ItemSegment *segPtr;
     1296    short int cx, cy;
     1297
     1298    itemPtr->flags &= ~REDRAW_PENDING;
     1299    if (itemPtr->flags & SUBST_PENDING) {
     1300        DoSubst(itemPtr);
     1301    }
     1302    if (itemPtr->flags & LAYOUT_PENDING) {
     1303        ComputeGeometry(itemPtr);
     1304    }
     1305    Tk_CanvasDrawableCoords(canvas, itemPtr->x, itemPtr->y, &cx, &cy);
     1306    x = cx, y = cy;
     1307    TranslateAnchor(itemPtr, &x, &y);
     1308
    9581309    if (itemPtr->border != NULL) {
    959         Tk_Fill3DRectangle(itemPtr->tkwin, drawable, itemPtr->border,
    960             (int)canvasX, (int)canvasY,
    961             (int)(itemPtr->rightEdge - itemPtr->leftEdge),
    962             (int)(itemPtr->header.y2 - itemPtr->header.y1),
    963             itemPtr->borderWidth, itemPtr->relief);
    964     }
    965 
    966     if (itemPtr->outline != NULL) {
    967         XDrawRectangle(display, drawable, itemPtr->outlineGC,
    968             (int)canvasX, (int)canvasY,
    969             (unsigned int)(itemPtr->rightEdge - itemPtr->leftEdge - 1),
    970             (unsigned int)(itemPtr->header.y2 - itemPtr->header.y1 - 1));
    971     }
    972 
    973     /*
    974      * If there's a right-hand image, draw it first.
    975      */
    976     imagew = 0;
    977     if (itemPtr->imageRight) {
    978         Tk_CanvasDrawableCoords(canvas, (double)itemPtr->rightEdge,
    979                 (double)itemPtr->header.y1, &drawableX, &drawableY);
    980 
    981         delta = (itemPtr->header.y2 - itemPtr->header.y1)/2 - itemPtr->imageRightH/2;
    982         drawableX -= itemPtr->imageRightW + itemPtr->padding + itemPtr->borderWidth;
    983         Tk_RedrawImage(itemPtr->imageRight, 0, 0,
    984                        itemPtr->imageRightW, itemPtr->imageRightH,
    985                        drawable,
    986                        (int)drawableX, (int)(drawableY+delta));
    987         imagew += itemPtr->imageRightW;
    988     }
    989 
    990     /*
    991      * If there's a left-hand image, draw it next.
    992      */
    993     Tk_CanvasDrawableCoords(canvas, (double)itemPtr->leftEdge,
    994             (double)itemPtr->header.y1, &drawableX, &drawableY);
    995 
    996     drawableX += itemPtr->padding + itemPtr->borderWidth;
    997     drawableY += itemPtr->padding + itemPtr->borderWidth;
    998 
    999     if (itemPtr->imageLeft) {
    1000         delta = (itemPtr->header.y2 - itemPtr->header.y1)/2
    1001                        - itemPtr->imageLeftH/2 - itemPtr->padding
    1002                        - itemPtr->borderWidth;
    1003 
    1004         Tk_RedrawImage(itemPtr->imageLeft, 0, 0,
    1005                        itemPtr->imageLeftW, itemPtr->imageLeftH,
    1006                        drawable,
    1007                        (int)drawableX, (int)(drawableY+delta));
    1008         drawableX += itemPtr->imageLeftW + itemPtr->padding;
    1009         imagew += itemPtr->imageLeftW;
    1010     }
    1011 
    1012     /*
    1013      * Draw the text.
    1014      */
    1015     Tk_DrawTextLayout(display, drawable, itemPtr->gcText, itemPtr->textLayout,
    1016             drawableX, drawableY, 0, -1);
    1017 
    1018     if (itemPtr->textDrawChars < itemPtr->textNumChars
    1019           && itemPtr->rightEdge - itemPtr->leftEdge - imagew > ellw) {
    1020         Tk_SizeOfBitmap(Tk_Display(itemPtr->tkwin), itemPtr->dots, &ellw, &ellh);
    1021         Tk_GetFontMetrics(itemPtr->tkfont, &fm);
    1022         ellx = drawableX+itemPtr->textWidth;
    1023         elly = drawableY+fm.ascent-1;
    1024 
    1025         XSetClipMask(display, itemPtr->gcText, itemPtr->dots);
    1026         XSetClipOrigin(display, itemPtr->gcText, ellx, elly);
    1027 
    1028         XCopyPlane(display, itemPtr->dots, drawable, itemPtr->gcText, 0, 0,
    1029             (unsigned int)ellw, (unsigned int)ellh, ellx, elly, 1);
    1030 
    1031         XSetClipOrigin(display, itemPtr->gcText, 0, 0);
    1032         XSetClipMask(display, itemPtr->gcText, None);
     1310        Tk_Fill3DRectangle(itemPtr->tkwin, drawable, itemPtr->border, x, y,
     1311                itemPtr->width, itemPtr->height, itemPtr->borderWidth,
     1312                itemPtr->relief);
     1313    }
     1314    if (itemPtr->outlineColor != NULL) {
     1315        XDrawRectangle(display, drawable, itemPtr->outlineGC, x, y,
     1316                itemPtr->width, itemPtr->height);
     1317    }
     1318    for (segPtr = itemPtr->firstPtr; segPtr != NULL; segPtr = segPtr->nextPtr) {
     1319        fprintf(stderr, "Display: segment=(%s) type=%d x=%d y=%d (x=%d y=%d w=%d h=%d) lineNum=%d nextPtr=%x\n",
     1320                segPtr->text, segPtr->type, x, y, segPtr->x, segPtr->y,
     1321                segPtr->width, segPtr->height, segPtr->lineNum, segPtr->nextPtr);
     1322        DrawSegment(segPtr, drawable, x, y);
    10331323    }
    10341324}
     
    10391329 *  PointProc --
    10401330 *
    1041  *    Computes the distance from a given point to a given hotspot
    1042  *    item, in canvas units.
     1331 *    Computes the distance from a given point to a given hotspot item, in
     1332 *    canvas units.
    10431333 *
    10441334 *  Results:
     
    10571347{
    10581348    HotspotItem *itemPtr = (HotspotItem *)canvItemPtr;
    1059     double value, x1, y1, x2, y2, dx, dy;
    1060 
    1061     x1 = itemPtr->header.x1;
    1062     y1 = itemPtr->header.y1;
    1063     x2 = itemPtr->header.x2;
    1064     y2 = itemPtr->header.y2;
    1065     if (pointPtr[0] < x0) {
    1066         dx = x0 - pointPtr[0];
    1067     } else if (pointPtr[0] >= x1)  {
    1068         dx = pointPtr[0] + 1 - x1;
     1349    double x1, y1, x2, y2, dx, dy;
     1350
     1351    x1 = itemPtr->x;
     1352    y1 = itemPtr->y;
     1353    x2 = itemPtr->x + itemPtr->width;
     1354    y2 = itemPtr->y + itemPtr->height;
     1355    if (pointPtr[0] < x1) {
     1356        dx = x1 - pointPtr[0];
     1357    } else if (pointPtr[0] >= x2)  {
     1358        dx = pointPtr[0] + 1 - x2;
    10691359    } else {
    10701360        dx = 0;
    10711361    }
    1072     if (pointPtr[1] < y0) {
    1073         dy = y0 - pointPtr[1];
    1074     } else if (pointPtr[1] >= y1)  {
    1075         dy = pointPtr[1] + 1 - y1;
     1362    if (pointPtr[1] < y1) {
     1363        dy = y1 - pointPtr[1];
     1364    } else if (pointPtr[1] >= y2)  {
     1365        dy = pointPtr[1] + 1 - y2;
    10761366    } else {
    10771367        dy = 0;
     
    11031393{
    11041394    HotspotItem *itemPtr = (HotspotItem *)canvItemPtr;
    1105     int x0, y0, x1, y1;
    1106 
    1107     if ((itemPtr->border != NULL) || itemPtr->lineColor) {
    1108         /* have a rectangle -- compare directly against that */
    1109         x0 = itemPtr->leftEdge;
    1110         y0 = itemPtr->header.y1;
    1111         x1 = itemPtr->rightEdge;
    1112         y1 = itemPtr->header.y2;
    1113     }
    1114     else if (itemPtr->imageLeft || itemPtr->imageRight) {
    1115         /* have images -- compare against a rectangle around image/text */
    1116         x0 = itemPtr->leftEdge + itemPtr->padding + itemPtr->borderWidth;
    1117         y0 = itemPtr->header.y1 + itemPtr->padding + itemPtr->borderWidth;
    1118         x1 = itemPtr->rightEdge - itemPtr->padding - itemPtr->borderWidth;
    1119         y1 = itemPtr->header.y2 - itemPtr->padding - itemPtr->borderWidth;
    1120     }
    1121     else {
    1122         /* have only text -- compare against text layout */
    1123         return Tk_IntersectTextLayout(itemPtr->textLayout,
    1124             (int) (rectPtr[0] + 0.5) - (itemPtr->leftEdge + itemPtr->padding + itemPtr->borderWidth),
    1125             (int) (rectPtr[1] + 0.5) - (itemPtr->header.y1 + itemPtr->padding + itemPtr->borderWidth),
    1126             (int) (rectPtr[2] - rectPtr[0] + 0.5),
    1127             (int) (rectPtr[3] - rectPtr[1] + 0.5));
    1128     }
    1129 
    1130     /* compare against rectangle... */
    1131     if ((rectPtr[0] > x1) || (rectPtr[1] > y1) ||
    1132         (rectPtr[2] < x0) || (rectPtr[3] < y0)) {
    1133         return -1;                      /* completely outside */
    1134     }
    1135     if ((rectPtr[0] >= x0) && (rectPtr[1] >= y0) &&
    1136         (rectPtr[2] <= x1) && (rectPtr[3] <= y1)) {
    1137         return 1;                       /* completely inside */
    1138     }
    1139     return 0;                           /* must be overlapping */
     1395
     1396    /* Compare against bounding box... */
     1397    if ((rectPtr[0] > itemPtr->base.x2) || (rectPtr[1] > itemPtr->base.y2) ||
     1398        (rectPtr[2] < itemPtr->base.x1) || (rectPtr[3] < itemPtr->base.y1)) {
     1399        return -1;                      /* Completely outside. */
     1400    }
     1401    if ((rectPtr[0] >= itemPtr->base.x1) && (rectPtr[1] >= itemPtr->base.y1) &&
     1402        (rectPtr[2] <= itemPtr->base.x2) && (rectPtr[3] <= itemPtr->base.y2)) {
     1403        return 1;                       /* Completely inside. */
     1404    }
     1405    return 0;                           /* Must be overlapping */
    11401406}
    11411407
     
    11631429    HotspotItem *itemPtr = (HotspotItem *)canvItemPtr;
    11641430
    1165     itemPtr->x = x + scaleX * (itemPtr->x - x);
    1166     itemPtr->y = y + scaleY * (itemPtr->y - y);
    1167     ComputeBbox(canvas, itemPtr);
     1431    itemPtr->x += scaleX * (itemPtr->x - x);
     1432    itemPtr->y += scaleY * (itemPtr->y - y);
     1433    ComputeBbox(itemPtr);
    11681434    return;
    11691435}
     
    11711437/*
    11721438 * ------------------------------------------------------------------------
     1439 *
    11731440 *  TranslateProc --
    11741441 *
     
    11821449 *    and the bounding box is updated in the generic part of the
    11831450 *    item structure.
     1451 *
    11841452 * ------------------------------------------------------------------------
    11851453 */
     
    11911459    itemPtr->x += dx;
    11921460    itemPtr->y += dy;
    1193     ComputeBbox(canvas, itemPtr);
     1461    ComputeBbox(itemPtr);
    11941462}
    11951463
     
    12091477 *  Side effects:
    12101478 *    None.
     1479 *
    12111480 * ------------------------------------------------------------------------
    12121481 */
     
    12181487    Tk_Window canvasWin = Tk_CanvasTkwin(canvas);
    12191488
     1489#ifdef notdef
    12201490    int x, y;
    12211491    double xpos;
     
    12301500    }
    12311501
    1232     if (Tk_CanvasPsFont(interp, canvas, itemPtr->tkfont) != TCL_OK) {
     1502    if (Tk_CanvasPsFont(interp, canvas, itemPtr->font) != TCL_OK) {
    12331503        return TCL_ERROR;
    12341504    }
     
    12471517    if (itemPtr->imageLeft) {
    12481518      if(!prepass) {
    1249         delta = (itemPtr->header.y2 - itemPtr->header.y1)/2 - itemPtr->imageLeftH/2;
     1519        delta = (itemPtr->base.y2 - itemPtr->base.y1)/2 - itemPtr->imageLeftH/2;
    12501520        sprintf(buffer, "%.15g %.15g", xpos,
    12511521                Tk_CanvasPsY(canvas, itemPtr->y+delta+2));
     
    12801550
    12811551    if ( itemPtr->imageLeft ){
    1282       if (Tk_CanvasPsFont(interp, canvas, itemPtr->tkfont) != TCL_OK) {
     1552      if (Tk_CanvasPsFont(interp, canvas, itemPtr->font) != TCL_OK) {
    12831553        return TCL_ERROR;
    12841554      }
     
    13131583    justify = "0"; /* TK_JUSTIFY_LEFT */
    13141584
    1315     Tk_GetFontMetrics(itemPtr->tkfont, &fm);
     1585    Tk_GetFontMetrics(itemPtr->font, &fm);
    13161586    sprintf(buffer, "] %d %g %g %s %s DrawText\n",
    13171587            fm.linespace, x / -2.0, y / 2.0, justify,
    13181588            "false" /* stipple */);
    13191589    Tcl_AppendResult(interp, buffer, (char *) NULL);
    1320 
    1321     return TCL_OK;
    1322 }
    1323 
    1324 /*
    1325  * ----------------------------------------------------------------------
    1326  *
    1327  * ImageChangedProc --
    1328  *
    1329  *      This procedure is invoked by the image code whenever the manager
    1330  *      for an image does something that affects the image's size or
    1331  *      how it is displayed.
    1332  *
    1333  * Results:
    1334  *      None.
    1335  *
    1336  * Side effects:
    1337  *      Arranges for the canvas to get redisplayed.
    1338  *
    1339  * ----------------------------------------------------------------------
    1340  */
    1341 static void
    1342 ImageChangedProc(clientData, x, y, width, height, imgWidth, imgHeight)
    1343     ClientData clientData;              /* Pointer to canvas item for image. */
    1344     int x, y;                           /* Upper left pixel (within image)
    1345                                          * that must be redisplayed. */
    1346     int width, height;                  /* Dimensions of area to redisplay
    1347                                          * (may be <= 0). */
    1348     int imgWidth, imgHeight;            /* New dimensions of image. */
    1349 {     
    1350     HotspotItem *itemPtr = (HotspotItem *) clientData;
    1351    
    1352     ComputeGeometry(itemPtr);
    1353     Tk_CanvasEventuallyRedraw(itemPtr->canvas, itemPtr->header.x1,
    1354         itemPtr->header.y1, itemPtr->header.x2, itemPtr->header.y2);
    1355     return;
    1356 }
    1357 
    1358 static int
    1359 AddTextSegment(HotspotItem *itemPtr, const char *text, int length)
    1360 {
    1361     ItemSegment *segPtr;
    1362 
    1363     segPtr = Tcl_Alloc(sizeof(ItemSegment) + length + 1);
    1364     if (segPtr == NULL) {
    1365         Tcl_Panic("can't allocate text segent for hotspot");
    1366     }
    1367     segPtr->itemPtr = itemPtr;
    1368     segPtr->lineNum = itemPtr->numLines;
    1369     segPtr->type = SEGMENT_TYPE_TEXT;
    1370     memcpy(segPtr->text, text, length);
    1371     segPtr->text[length] = '\0';
    1372     segPtr->length = length;
    1373     segPtr->x = segPtr->y = 0;
    1374     segPtr->nextPtr = NULL;
    1375     if (itemPtr->firstPtr == NULL) {
    1376         itemPtr->firstPtr = segPtr;
    1377     }
    1378     if (itemPtr->lastPtr == NULL) {
    1379         itemPtr->lastPtr = segPtr;
    1380     } else {
    1381         itemPtr->lastPtr->nextPtr = segPtr;
    1382     }
    1383 }
    1384 
    1385 static int
    1386 AddVariableSegment(HotspotItem *itemPtr, const char *varName, int length)
    1387 {
    1388     ItemSegment *segPtr;
    1389     Tcl_Interp *interp;
    1390 
    1391     segPtr = Tcl_Alloc(sizeof(ItemSegment) + length + 1);
    1392     if (segPtr == NULL) {
    1393         Tcl_Panic("can't allocate variable segent for hotspot");
    1394     }
    1395     segPtr->itemPtr = itemPtr;
    1396     segPtr->lineNum = itemPtr->numLines;
    1397     segPtr->type = SEGMENT_TYPE_VARIABLE;
    1398     memcpy(segPtr->text, varName, length);
    1399     segPtr->text[length] = '\0';
    1400     segPtr->length = length;
    1401     interp = itemPtr->substInterp;
    1402     if (interp == NULL) {
    1403         interp = itemPtr->interp;
    1404     }
    1405     Tcl_TraceVar(interp, varName, VAR_FLAGS, TraceVarProc, itemPtr);
    1406     segPtr->subst = NULL;
    1407     segPtr->x = segPtr->y = 0;
    1408     segPtr->nextPtr = NULL;
    1409     if (itemPtr->firstPtr == NULL) {
    1410         itemPtr->firstPtr = segPtr;
    1411     }
    1412     if (itemPtr->lastPtr == NULL) {
    1413         itemPtr->lastPtr = segPtr;
    1414     } else {
    1415         itemPtr->lastPtr->nextPtr = segPtr;
    1416     }
    1417 }
    1418 
    1419 static int
    1420 AddHotspotSegment(HotspotItem *itemPtr)
    1421 {
    1422     ItemSegment *segPtr;
    1423 
    1424     segPtr = Tcl_Alloc(sizeof(ItemSegment));
    1425     if (segPtr == NULL) {
    1426         Tcl_Panic("can't allocate hotspot segent for hotspot");
    1427     }
    1428     segPtr->itemPtr = itemPtr;
    1429     segPtr->lineNum = itemPtr->numLines;
    1430     segPtr->type = SEGMENT_TYPE_HOTSPOT;
    1431     segPtr->text[0] = '\0';
    1432     segPtr->length = 0;
    1433     segPtr->x = segPtr->y = 0;
    1434     segPtr->nextPtr = NULL;
    1435     if (itemPtr->firstPtr == NULL) {
    1436         itemPtr->firstPtr = segPtr;
    1437     }
    1438     if (itemPtr->lastPtr == NULL) {
    1439         itemPtr->lastPtr = segPtr;
    1440     } else {
    1441         itemPtr->lastPtr->nextPtr = segPtr;
    1442     }
    1443 }
    1444 
    1445 static void
    1446 DestroySegment(HotspotItem *itemPtr, ItemSegment *segPtr)
    1447 {
    1448     if (segPtr->layout != NULL) {
    1449         Tk_FreeLayout(segPtr->layout);
    1450     }
    1451     if (segPtr->type == SEGMENT_TYPE_VARIABLE) {
    1452         Tcl_UntraceVar(itemPtr->interp, segPtr->text, flags, TraceVarProc,
    1453                 itemPtr);
    1454     }
    1455     if (segPtr->substText != NULL) {
    1456         Tcl_Free(segPtr->substText);
    1457     }
    1458     Tcl_Free(segPtr);
    1459 }
    1460 
    1461 static void
    1462 DestroySegments(HotspotItem *itemPtr)
    1463 {
    1464     ItemSegment *segPtr, nextPtr;
    1465 
    1466     for (segPtr = itemPtr->firstPtr; segPtr != NULL; segPtr = nextPtr) {
    1467         nextPtr = segPtr->nextPtr;
    1468         DestroySegment(segPtr);
    1469     }
    1470     itemPtr->firstPtr = itemPtr->lastPtr = NULL;
    1471 }
    1472 
    1473 static int
    1474 DoSubst(HotspotItem *itemPtr, const char *varName)
    1475 {
    1476     ItemSegment *segptr;
    1477 
    1478     for (segPtr = itemPtr->firstPtr; segPtr != NULL; segPtr = segPtr->nextPtr) {
    1479         const char *value;
    1480 
    1481         if (segPtr->type != SEGMENT_TYPE_VARIABLE) {
    1482             continue;
    1483         }
    1484         if ((varName != NULL) && (strcmp(segPtr->text, varName) != 0)) {
    1485             continue;
    1486         }
    1487 
    1488         value = Tcl_GetVar(itemPtr->substInterp, segPtr->text, TCL_GLOBAL_ONLY);
    1489         if (value == NULL) {
    1490             value = "???";
    1491         }
    1492         if (segPtr->subst != NULL) {
    1493             Tcl_Free(segPtr->subst);
    1494         }
    1495         segPtr->subst = Tcl_Alloc(strlen(value) + 1);
    1496         strcpy(segPtr->subst, value);
    1497     }
    1498 }
    1499 
    1500 static int
    1501 ComputeGeometry(HotspotItem *itemPtr)
    1502 {
    1503     int x, y, w, h;
    1504     ItemSegment *segPtr;
    1505     int imgWidth, imgHeight;
    1506     int maxWidth, maxHeight;
    1507 
    1508     /* Collect the individual segment sizes. */
    1509     imgWidth = itemPtr->maxImageWidth + 2 * IMAGE_PAD;
    1510     imgHeight = itemPtr->maxImageHeight + 2 * IMAGE_PAD;
    1511     for (segPtr = itemPtr->firstPtr; segPtr != NULL; segPtr = segPtr->nextPtr) {
    1512         if (segPtr->layout != NULL) {
    1513             Tk_FreeTextLayout(segPtr->layout);
    1514         }
    1515         switch (segPtr->type) {
    1516         case SEGMENT_TYPE_HOTSPOT:
    1517             w = imgWidth, h = imgHeight;
    1518             break;
    1519         case SEGMENT_TYPE_VARIABLE:
    1520             segPtr->layout = Tk_ComputeTextLayout(segPtr->substFont,
    1521                 segPtr->subst, segPtr->length, wrapLength, justify, flags,
    1522                 &w, &h);
    1523             break;
    1524         case SEGMENT_TYPE_TEXT:
    1525             segPtr->layout = Tk_ComputeTextLayout(segPtr->textFont,
    1526                 segPtr->text, segPtr->length, wrapLength, justify, flags,
    1527                 &w, &h);
    1528             break;
    1529         default:
    1530             Tcl_Panic("unknown hotspot segment type");
    1531         }
    1532         segPtr->width = w;
    1533         segPtr->height = h;
    1534     }
    1535     /* Compute the relative positions of the segments. */
    1536     x = y = 0;
    1537     maxWidth = maxHeight = 0;
    1538     for (segPtr = itemPtr->firstPtr; segPtr != NULL; segPtr = segPtr->nextPtr) {
    1539         int maxHeight, lineNum;
    1540         ItemSegment *startPtr;
    1541 
    1542         maxHeight = 0;
    1543         lineNum = segPtr->lineNum;
    1544         startPtr = segPtr;
    1545         x = 0;
    1546         while ((segPtr->lineNum == lineNum) && (segPtr != NULL)) {
    1547             if (segPtr->height > segPtr->maxHeight) {
    1548                 segPtr->maxHeight = segPtr->height;
    1549             }
    1550             segPtr = segPtr->nextPtr;
    1551             segPtr->x = x;
    1552             x += segPtr->width;
    1553         }
    1554         if (x > maxWidth) {
    1555             maxWidth = x;
    1556         }
    1557         segPtr = startPtr;
    1558         while ((segPtr->lineNum == lineNum) && (segPtr != NULL)) {
    1559             segPtr->y = (maxHeight - segPtr->height) / 2;
    1560         }
    1561         y += maxHeight;
    1562     }
    1563     itemPtr->width = maxWidth;
    1564     itemPtr->height = y;
    1565 }
    1566 
    1567 /*
    1568  *---------------------------------------------------------------------------
    1569  *
    1570  * TraceVarProc --
    1571  *
    1572  *      This procedure is invoked when someone changes the state variable
    1573  *      associated with a radiobutton or checkbutton entry.  The entry's
    1574  *      selected state is set to match the value of the variable.
    1575  *
    1576  * Results:
    1577  *      NULL is always returned.
    1578  *
    1579  * Side effects:
    1580  *      The combobox entry may become selected or deselected.
    1581  *
    1582  *---------------------------------------------------------------------------
    1583  */
    1584 static char *
    1585 TraceVarProc(
    1586     ClientData clientData,              /* Information about the item. */
    1587     Tcl_Interp *interp,                 /* Interpreter containing variable. */
    1588     const char *name1,                  /* First part of variable's name. */
    1589     const char *name2,                  /* Second part of variable's name. */
    1590     int flags)                          /* Describes what just happened. */
    1591 {
    1592     HotspotItem *itemPtr = clientData;
    1593     Tcl_Obj *objPtr;
    1594     int bool;
    1595 
    1596     if (flags & TCL_INTERP_DESTROYED) {
    1597         return NULL;                    /* Interpreter is going away. */
    1598 
    1599     }
    1600     /*
    1601      * If the variable is being unset, then re-establish the trace.
    1602      */
    1603     if (flags & TCL_TRACE_UNSETS) {
    1604         if (flags & TCL_TRACE_DESTROYED) {
    1605             Tcl_TraceVar(interp, name1, VAR_FLAGS, TraceVarProc, itemPtr);
    1606         }
    1607         goto done;
    1608     }
    1609     DoSubst(itemPtr, name1);
    1610     ComputeGeometry(itemPtr);
    1611     Tk_CanvasEventuallyRedraw(itemPtr->canvas, itemPtr->header.x1,
    1612         itemPtr->header.y1, itemPtr->header.x2, itemPtr->header.y2);
    1613     return NULL;                        /* Done. */
    1614 }
    1615 
    1616 static int
    1617 ParseDescription(HotspotItem *itemPtr, const char *description, int length)
    1618 {
    1619     const char *p, *pend, *start;
    1620 
    1621     if (itemPtr->firstPtr != NULL) {
    1622         DestroySegments(itemPtr);
    1623     }
    1624     start = description;
    1625     itemPtr->numLines = 1;
    1626     for (p = description, pend = p + length; p < pend; p++) {
    1627         if ((p[0] == '$') && (p[1] == '{')) {
    1628             const char *varName;
    1629             const char q;
    1630 
    1631             if (p > start) {
    1632                 /* Save the leading text. */
    1633                 AddTextSegment(itemPtr, start, p - start);
    1634                 start = p;
    1635             }
    1636             /* Start of substitution variable. */
    1637             varName = p + 2;
    1638             for (q = varName; q < pend; q++) {
    1639                 if (*q == '}') {
    1640                     AddVariableSegment(itemPtr, varName, q - varName);
    1641                     AddHotspotSegment(itemPtr);
    1642                     p = q;
    1643                     goto next;
    1644                 }
    1645             }
    1646             Tcl_AppendResult(interp, "back variable specification in \"",
    1647                              description, "\"", (char *)NULL);
    1648             return TCL_ERROR;
    1649         } else if (p[0] == '\n') {
    1650             if (p > start) {
    1651                 AddTextSegment(itemPtr, start, p - start);
    1652                 start = p + 1;
    1653                 itemPtr->numLines++;
    1654             }
    1655         }
    1656     next:
    1657     }
    1658     if (p > start) {
    1659         /* Save the trailing text. */
    1660         AddTextSegment(itemPtr, start, p - start);
    1661     }
    1662     DoSubst(itemPtr, NULL);
    1663     ComputeGeometry(itemPtr);
     1590#endif
    16641591    return TCL_OK;
    16651592}
     
    16801607    Tcl_Interp *interp;         /* interpreter being initialized */
    16811608{
    1682     Tk_CreateItemType(&rpHotspotType);
     1609    Tk_CreateItemType(&hotspotType);
    16831610    return TCL_OK;
    16841611}
Note: See TracChangeset for help on using the changeset viewer.