Changeset 3038
- Timestamp:
- Jun 13, 2012 3:46:10 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/configure
r2890 r3038 1 1 #! /bin/sh 2 2 # Guess values for system-dependent variables and create Makefiles. 3 # Generated by GNU Autoconf 2.6 8for Rappture 1.1.3 # Generated by GNU Autoconf 2.69 for Rappture 1.1. 4 4 # 5 5 # Report bugs to <rappture@nanohub.org>. 6 6 # 7 7 # 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. 11 9 # 12 10 # … … 137 135 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH 138 136 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. 145 BASH_ENV=/dev/null 146 ENV=/dev/null 147 (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV 148 case $- in # (((( 149 *v*x* | *x*v* ) as_opts=-vx ;; 150 *v* ) as_opts=-v ;; 151 *x* ) as_opts=-x ;; 152 * ) as_opts= ;; 153 esac 154 exec $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 158 as_fn_exit 255 159 fi 160 # We don't want this to propagate to other subprocesses. 161 { _as_can_reexec=; unset _as_can_reexec;} 139 162 if test "x$CONFIG_SHELL" = x; then 140 163 as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : … … 170 193 exitcode=1; echo positional parameters were not saved. 171 194 fi 172 test x\$exitcode = x0 || exit 1" 195 test x\$exitcode = x0 || exit 1 196 test -x / || exit 1" 173 197 as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO 174 198 as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO … … 215 239 216 240 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. 246 BASH_ENV=/dev/null 247 ENV=/dev/null 248 (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV 249 case $- in # (((( 250 *v*x* | *x*v* ) as_opts=-vx ;; 251 *v* ) as_opts=-v ;; 252 *x* ) as_opts=-x ;; 253 * ) as_opts= ;; 254 esac 255 exec $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 259 exit 255 232 260 fi 233 261 … … 332 360 333 361 } # as_fn_mkdir_p 362 363 # as_fn_executable_p FILE 364 # ----------------------- 365 # Test if FILE is an executable regular file. 366 as_fn_executable_p () 367 { 368 test -f "$1" && test -x "$1" 369 } # as_fn_executable_p 334 370 # as_fn_append VAR VALUE 335 371 # ---------------------- … … 453 489 { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } 454 490 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 455 495 # Don't try to exec as it changes $[0], causing all sort of problems 456 496 # (the dirname of $[0] is not the place where we might find the … … 487 527 # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. 488 528 # 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'. 490 530 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' 492 532 elif ln conf$$.file conf$$ 2>/dev/null; then 493 533 as_ln_s=ln 494 534 else 495 as_ln_s='cp -p '535 as_ln_s='cp -pR' 496 536 fi 497 537 else 498 as_ln_s='cp -p '538 as_ln_s='cp -pR' 499 539 fi 500 540 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file … … 508 548 fi 509 549 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 550 as_test_x='test -x' 551 as_executable_p=as_fn_executable_p 532 552 533 553 # Sed expression to map a string onto a valid CPP name. … … 1269 1289 if test "x$build_alias" = x; then 1270 1290 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" >&21273 1291 elif test "x$build_alias" != "x$host_alias"; then 1274 1292 cross_compiling=yes … … 1534 1552 cat <<\_ACEOF 1535 1553 Rappture configure 1.1 1536 generated by GNU Autoconf 2.6 81537 1538 Copyright (C) 201 0Free Software Foundation, Inc.1554 generated by GNU Autoconf 2.69 1555 1556 Copyright (C) 2012 Free Software Foundation, Inc. 1539 1557 This configure script is free software; the Free Software Foundation 1540 1558 gives unlimited permission to copy, distribute and modify it. … … 1767 1785 } && test -s conftest$ac_exeext && { 1768 1786 test "$cross_compiling" = yes || 1769 $as_test_x conftest$ac_exeext1787 test -x conftest$ac_exeext 1770 1788 }; then : 1771 1789 ac_retval=0 … … 1880 1898 } && test -s conftest$ac_exeext && { 1881 1899 test "$cross_compiling" = yes || 1882 $as_test_x conftest$ac_exeext1900 test -x conftest$ac_exeext 1883 1901 }; then : 1884 1902 ac_retval=0 … … 2184 2202 { 2185 2203 static int test_array [1 - 2 * !(($2) >= 0)]; 2186 test_array [0] = 0 2204 test_array [0] = 0; 2205 return test_array [0]; 2187 2206 2188 2207 ; … … 2200 2219 { 2201 2220 static int test_array [1 - 2 * !(($2) <= $ac_mid)]; 2202 test_array [0] = 0 2221 test_array [0] = 0; 2222 return test_array [0]; 2203 2223 2204 2224 ; … … 2226 2246 { 2227 2247 static int test_array [1 - 2 * !(($2) < 0)]; 2228 test_array [0] = 0 2248 test_array [0] = 0; 2249 return test_array [0]; 2229 2250 2230 2251 ; … … 2242 2263 { 2243 2264 static int test_array [1 - 2 * !(($2) >= $ac_mid)]; 2244 test_array [0] = 0 2265 test_array [0] = 0; 2266 return test_array [0]; 2245 2267 2246 2268 ; … … 2276 2298 { 2277 2299 static int test_array [1 - 2 * !(($2) <= $ac_mid)]; 2278 test_array [0] = 0 2300 test_array [0] = 0; 2301 return test_array [0]; 2279 2302 2280 2303 ; … … 2349 2372 2350 2373 It was created by Rappture $as_me 1.1, which was 2351 generated by GNU Autoconf 2.6 8. Invocation command line was2374 generated by GNU Autoconf 2.69. Invocation command line was 2352 2375 2353 2376 $ $0 $@ … … 2799 2822 for ac_prog in ginstall scoinst install; do 2800 2823 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"; }; then2824 if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then 2802 2825 if test $ac_prog = install && 2803 2826 grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then … … 2873 2896 test -z "$as_dir" && as_dir=. 2874 2897 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"; }; then2898 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 2876 2899 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" 2877 2900 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 2913 2936 test -z "$as_dir" && as_dir=. 2914 2937 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"; }; then2938 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 2916 2939 ac_cv_prog_ac_ct_RANLIB="ranlib" 2917 2940 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 2972 2995 for ac_prog in mkdir gmkdir; do 2973 2996 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"; }|| continue2997 as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue 2975 2998 case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 2976 2999 'mkdir (GNU coreutils) '* | \ … … 3056 3079 test -z "$as_dir" && as_dir=. 3057 3080 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"; }; then3081 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 3059 3082 ac_cv_prog_CC="${ac_tool_prefix}gcc" 3060 3083 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 3096 3119 test -z "$as_dir" && as_dir=. 3097 3120 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"; }; then3121 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 3099 3122 ac_cv_prog_ac_ct_CC="gcc" 3100 3123 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 3149 3172 test -z "$as_dir" && as_dir=. 3150 3173 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"; }; then3174 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 3152 3175 ac_cv_prog_CC="${ac_tool_prefix}cc" 3153 3176 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 3190 3213 test -z "$as_dir" && as_dir=. 3191 3214 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"; }; then3215 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 3193 3216 if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then 3194 3217 ac_prog_rejected=yes … … 3248 3271 test -z "$as_dir" && as_dir=. 3249 3272 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"; }; then3273 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 3251 3274 ac_cv_prog_CC="$ac_tool_prefix$ac_prog" 3252 3275 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 3292 3315 test -z "$as_dir" && as_dir=. 3293 3316 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"; }; then3317 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 3295 3318 ac_cv_prog_ac_ct_CC="$ac_prog" 3296 3319 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 3738 3761 #include <stdarg.h> 3739 3762 #include <stdio.h> 3740 #include <sys/types.h> 3741 #include <sys/stat.h> 3763 struct stat; 3742 3764 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ 3743 3765 struct buf { int x; }; … … 3852 3874 test -z "$as_dir" && as_dir=. 3853 3875 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"; }; then3876 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 3855 3877 ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" 3856 3878 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 3896 3918 test -z "$as_dir" && as_dir=. 3897 3919 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"; }; then3920 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 3899 3921 ac_cv_prog_ac_ct_CXX="$ac_prog" 3900 3922 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 4105 4127 test -z "$as_dir" && as_dir=. 4106 4128 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"; }; then4129 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 4108 4130 ac_cv_prog_F77="$ac_tool_prefix$ac_prog" 4109 4131 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 4149 4171 test -z "$as_dir" && as_dir=. 4150 4172 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"; }; then4173 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 4152 4174 ac_cv_prog_ac_ct_F77="$ac_prog" 4153 4175 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 4456 4478 for ac_exec_ext in '' $ac_executable_extensions; do 4457 4479 ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" 4458 { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; }|| continue4480 as_fn_executable_p "$ac_path_GREP" || continue 4459 4481 # Check for GNU ac_path_GREP and select it if it is found. 4460 4482 # Check for GNU $ac_path_GREP … … 4522 4544 for ac_exec_ext in '' $ac_executable_extensions; do 4523 4545 ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" 4524 { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; }|| continue4546 as_fn_executable_p "$ac_path_EGREP" || continue 4525 4547 # Check for GNU ac_path_EGREP and select it if it is found. 4526 4548 # Check for GNU $ac_path_EGREP … … 4959 4981 4960 4982 else 4961 as_fn_error $? "ncurse rs library missing?" "$LINENO" 54983 as_fn_error $? "ncurses library missing?" "$LINENO" 5 4962 4984 fi 4963 4985 … … 5605 5627 test -z "$as_dir" && as_dir=. 5606 5628 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"; }; then5629 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 5608 5630 ac_cv_prog_AR="ar" 5609 5631 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 7339 7361 test -z "$as_dir" && as_dir=. 7340 7362 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"; }; then7363 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 7342 7364 ac_cv_path_TCLSH="$as_dir/$ac_word$ac_exec_ext" 7343 7365 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 7381 7403 test -z "$as_dir" && as_dir=. 7382 7404 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"; }; then7405 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 7384 7406 ac_cv_path_TCLSH="$as_dir/$ac_word$ac_exec_ext" 7385 7407 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 7482 7504 test -z "$as_dir" && as_dir=. 7483 7505 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"; }; then7506 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 7485 7507 ac_cv_path_MATLAB="$as_dir/$ac_word$ac_exec_ext" 7486 7508 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 7524 7546 test -z "$as_dir" && as_dir=. 7525 7547 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"; }; then7548 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 7527 7549 ac_cv_path_MATLAB="$as_dir/$ac_word$ac_exec_ext" 7528 7550 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 7574 7596 test -z "$as_dir" && as_dir=. 7575 7597 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"; }; then7598 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 7577 7599 ac_cv_path_MEX="$as_dir/$ac_word$ac_exec_ext" 7578 7600 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 7614 7636 test -z "$as_dir" && as_dir=. 7615 7637 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"; }; then7638 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 7617 7639 ac_cv_path_MEXEXT="$as_dir/$ac_word$ac_exec_ext" 7618 7640 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 7665 7687 test -z "$as_dir" && as_dir=. 7666 7688 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"; }; then7689 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 7668 7690 ac_cv_path_MCC="$as_dir/$ac_word$ac_exec_ext" 7669 7691 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 7727 7749 test -z "$as_dir" && as_dir=. 7728 7750 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"; }; then7751 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 7730 7752 ac_cv_path_OCTAVE="$as_dir/$ac_word$ac_exec_ext" 7731 7753 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 7767 7789 test -z "$as_dir" && as_dir=. 7768 7790 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"; }; then7791 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 7770 7792 ac_cv_path_MKOCTFILE="$as_dir/$ac_word$ac_exec_ext" 7771 7793 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 7854 7876 test -z "$as_dir" && as_dir=. 7855 7877 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"; }; then7878 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 7857 7879 ac_cv_path_mkoctfile3="$as_dir/$ac_word$ac_exec_ext" 7858 7880 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 7914 7936 test -z "$as_dir" && as_dir=. 7915 7937 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"; }; then7938 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 7917 7939 ac_cv_path_mkoctfile2="$as_dir/$ac_word$ac_exec_ext" 7918 7940 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 7988 8010 test -z "$as_dir" && as_dir=. 7989 8011 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"; }; then8012 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 7991 8013 ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" 7992 8014 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 8029 8051 test -z "$as_dir" && as_dir=. 8030 8052 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"; }; then8053 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 8032 8054 ac_cv_path_XSUBPP="$as_dir/$ac_word$ac_exec_ext" 8033 8055 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 8070 8092 test -z "$as_dir" && as_dir=. 8071 8093 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"; }; then8094 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 8073 8095 ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" 8074 8096 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 8110 8132 test -z "$as_dir" && as_dir=. 8111 8133 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"; }; then8134 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 8113 8135 ac_cv_path_XSUBPP="$as_dir/$ac_word$ac_exec_ext" 8114 8136 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 8192 8214 test -z "$as_dir" && as_dir=. 8193 8215 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"; }; then8216 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 8195 8217 ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" 8196 8218 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 8234 8256 test -z "$as_dir" && as_dir=. 8235 8257 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"; }; then8258 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 8237 8259 ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" 8238 8260 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 8355 8377 test -z "$as_dir" && as_dir=. 8356 8378 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"; }; then8379 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 8358 8380 ac_cv_path_JAVA="$as_dir/$ac_word$ac_exec_ext" 8359 8381 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 8395 8417 test -z "$as_dir" && as_dir=. 8396 8418 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"; }; then8419 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 8398 8420 ac_cv_path_JAVAC="$as_dir/$ac_word$ac_exec_ext" 8399 8421 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 8435 8457 test -z "$as_dir" && as_dir=. 8436 8458 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"; }; then8459 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 8438 8460 ac_cv_path_JAVAH="$as_dir/$ac_word$ac_exec_ext" 8439 8461 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 8477 8499 test -z "$as_dir" && as_dir=. 8478 8500 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"; }; then8501 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 8480 8502 ac_cv_path_JAVA="$as_dir/$ac_word$ac_exec_ext" 8481 8503 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 8518 8540 test -z "$as_dir" && as_dir=. 8519 8541 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"; }; then8542 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 8521 8543 ac_cv_path_JAVAC="$as_dir/$ac_word$ac_exec_ext" 8522 8544 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 8559 8581 test -z "$as_dir" && as_dir=. 8560 8582 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"; }; then8583 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 8562 8584 ac_cv_path_JAVAH="$as_dir/$ac_word$ac_exec_ext" 8563 8585 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 8647 8669 test -z "$as_dir" && as_dir=. 8648 8670 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"; }; then8671 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 8650 8672 ac_cv_path_R="$as_dir/$ac_word$ac_exec_ext" 8651 8673 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 8689 8711 test -z "$as_dir" && as_dir=. 8690 8712 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"; }; then8713 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 8692 8714 ac_cv_path_R="$as_dir/$ac_word$ac_exec_ext" 8693 8715 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 8748 8770 test -z "$as_dir" && as_dir=. 8749 8771 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"; }; then8772 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 8751 8773 ac_cv_path_RUBY="$as_dir/$ac_word$ac_exec_ext" 8752 8774 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 8790 8812 test -z "$as_dir" && as_dir=. 8791 8813 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"; }; then8814 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 8793 8815 ac_cv_path_RUBY="$as_dir/$ac_word$ac_exec_ext" 8794 8816 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 8840 8862 for ac_exec_ext in '' $ac_executable_extensions; do 8841 8863 ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" 8842 { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; }|| continue8864 as_fn_executable_p "$ac_path_SED" || continue 8843 8865 # Check for GNU ac_path_SED and select it if it is found. 8844 8866 # Check for GNU $ac_path_SED … … 8925 8947 test -z "$as_dir" && as_dir=. 8926 8948 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"; }; then8949 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 8928 8950 ac_cv_prog_AWK="$ac_prog" 8929 8951 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 … … 10026 10048 fi 10027 10049 10050 for ac_func in sws_getCachedContext 10051 do : 10052 ac_fn_cxx_check_func "$LINENO" "sws_getCachedContext" "ac_cv_func_sws_getCachedContext" 10053 if test "x$ac_cv_func_sws_getCachedContext" = xyes; then : 10054 cat >>confdefs.h <<_ACEOF 10055 #define HAVE_SWS_GETCACHEDCONTEXT 1 10056 _ACEOF 10057 10058 fi 10059 done 10060 10061 for ac_func in img_convert 10062 do : 10063 ac_fn_cxx_check_func "$LINENO" "img_convert" "ac_cv_func_img_convert" 10064 if test "x$ac_cv_func_img_convert" = xyes; then : 10065 cat >>confdefs.h <<_ACEOF 10066 #define HAVE_IMG_CONVERT 1 10067 _ACEOF 10068 10069 fi 10070 done 10071 10072 for ac_func in sws_scale 10073 do : 10074 ac_fn_cxx_check_func "$LINENO" "sws_scale" "ac_cv_func_sws_scale" 10075 if test "x$ac_cv_func_sws_scale" = xyes; then : 10076 cat >>confdefs.h <<_ACEOF 10077 #define HAVE_SWS_SCALE 1 10078 _ACEOF 10079 10080 fi 10081 done 10028 10082 10029 10083 cat confdefs.h - <<_ACEOF >conftest.$ac_ext … … 10152 10206 10153 10207 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/lo adrun/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"10208 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/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" 10155 10209 10156 10210 cat >confcache <<\_ACEOF … … 10562 10616 # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. 10563 10617 # 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'. 10565 10619 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' 10567 10621 elif ln conf$$.file conf$$ 2>/dev/null; then 10568 10622 as_ln_s=ln 10569 10623 else 10570 as_ln_s='cp -p '10624 as_ln_s='cp -pR' 10571 10625 fi 10572 10626 else 10573 as_ln_s='cp -p '10627 as_ln_s='cp -pR' 10574 10628 fi 10575 10629 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file … … 10631 10685 fi 10632 10686 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. 10691 as_fn_executable_p () 10692 { 10693 test -f "$1" && test -x "$1" 10694 } # as_fn_executable_p 10695 as_test_x='test -x' 10696 as_executable_p=as_fn_executable_p 10655 10697 10656 10698 # Sed expression to map a string onto a valid CPP name. … … 10674 10716 ac_log=" 10675 10717 This file was extended by Rappture $as_me 1.1, which was 10676 generated by GNU Autoconf 2.6 8. Invocation command line was10718 generated by GNU Autoconf 2.69. Invocation command line was 10677 10719 10678 10720 CONFIG_FILES = $CONFIG_FILES … … 10736 10778 ac_cs_version="\\ 10737 10779 Rappture config.status 1.1 10738 configured by $0, generated by GNU Autoconf 2.6 8,10780 configured by $0, generated by GNU Autoconf 2.69, 10739 10781 with options \\"\$ac_cs_config\\" 10740 10782 10741 Copyright (C) 201 0Free Software Foundation, Inc.10783 Copyright (C) 2012 Free Software Foundation, Inc. 10742 10784 This config.status script is free software; the Free Software Foundation 10743 10785 gives unlimited permission to copy, distribute and modify it." … … 10830 10872 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 10831 10873 if \$ac_cs_recheck; then 10832 set X '$SHELL''$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion10874 set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion 10833 10875 shift 10834 10876 \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 … … 10972 11014 "examples/zoo/loader/Makefile") CONFIG_FILES="$CONFIG_FILES examples/zoo/loader/Makefile" ;; 10973 11015 "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" ;;10975 11016 "examples/zoo/log/Makefile") CONFIG_FILES="$CONFIG_FILES examples/zoo/log/Makefile" ;; 10976 11017 "examples/zoo/note/Makefile") CONFIG_FILES="$CONFIG_FILES examples/zoo/note/Makefile" ;; -
trunk/configure.in
r3032 r3038 555 555 examples/zoo/loader/Makefile 556 556 examples/zoo/loader/examples/Makefile 557 examples/zoo/loadrun/Makefile558 557 examples/zoo/log/Makefile 559 558 examples/zoo/note/Makefile -
trunk/examples/zoo/Makefile.in
r2301 r3038 28 28 integer2 \ 29 29 loader \ 30 loadrun \31 30 log \ 32 31 note \ -
trunk/gui/scripts/drawingentry.tcl
r3032 r3038 70 70 private method ScreenY { y } 71 71 private method XmlGet { path } 72 private method XmlGetSubst { path } 72 73 private method Withdraw {} 73 74 } … … 227 228 } 228 229 # Coords 229 set xcoords [XmlGet $cpath.xcoords]230 set xcoords [XmlGetSubst $cpath.xcoords] 230 231 set xcoords [string trim $xcoords] 231 set ycoords [XmlGet $cpath.ycoords]232 set ycoords [XmlGetSubst $cpath.ycoords] 232 233 set ycoords [string trim $ycoords] 233 234 if { $ycoords == "" } { … … 276 277 if { [info exists attr2option($attr)] } { 277 278 set option $attr2option($attr) 278 set value [XmlGet $cpath.$attr]279 set value [XmlGetSubst $cpath.$attr] 279 280 set options($option) $value 280 281 } … … 312 313 if { [info exists attr2option($attr)] } { 313 314 set option $attr2option($attr) 314 set value [XmlGet $cpath.$attr]315 set value [XmlGetSubst $cpath.$attr] 315 316 set options($option) $value 316 317 } elseif { [string match "controls*" $attr] } { 317 set value [XmlGet $cpath.$attr]318 set value [XmlGetSubst $cpath.$attr] 318 319 lappend _cname2controls($cname) $value 319 320 $_owner xml put $value.hide 1 … … 321 322 } 322 323 # Coordinates 323 set coords [XmlGet $cpath.coords]324 set coords [XmlGetSubst $cpath.coords] 324 325 set coords [ScreenCoords $coords] 325 326 if { $coords == "" } { … … 360 361 # Coords 361 362 set coords {} 362 set coords [XmlGet $cpath.coords]363 set coords [XmlGetSubst $cpath.coords] 363 364 set coords [string trim $coords] 364 365 if { $coords == "" } { … … 372 373 if { [info exists attr2option($attr)] } { 373 374 set option $attr2option($attr) 374 set value [XmlGet $cpath.$attr]375 set value [XmlGetSubst $cpath.$attr] 375 376 set options($option) $value 376 377 } … … 402 403 if { [info exists attr2option($attr)] } { 403 404 set option $attr2option($attr) 404 set value [XmlGet $cpath.$attr]405 set value [XmlGetSubst $cpath.$attr] 405 406 set options($option) $value 406 407 } … … 408 409 # Coordinates 409 410 set coords {} 410 set coords [XmlGet $cpath.coords]411 set coords [XmlGetSubst $cpath.coords] 411 412 set coords [string trim $coords] 412 413 if { $coords == "" } { … … 433 434 if { [info exists attr2option($attr)] } { 434 435 set option $attr2option($attr) 435 set value [XmlGet $cpath.$attr]436 set value [XmlGetSubst $cpath.$attr] 436 437 set options($option) $value 437 438 } 438 439 } 439 set contents [XmlGet $cpath.contents]440 set contents [XmlGetSubst $cpath.contents] 440 441 set img "" 441 442 if { [string compare -length 5 $contents "file:"] == 0 } { … … 454 455 } 455 456 # Coordinates 456 set coords [XmlGet $cpath.coords]457 set coords [XmlGetSubst $cpath.coords] 457 458 set coords [ScreenCoords $coords] 458 459 if { [llength $coords] == 2 } { 459 460 foreach { x1 y1 } $coords break 460 set w [XmlGet $cpath.width]461 set w [XmlGetSubst $cpath.width] 461 462 if { $w == "" || ![string is number $w] || $w <= 0.0 } { 462 463 set width [expr [image width $img] / 4] … … 464 465 set width [expr [ScreenX $w] - [ScreenX 0]] 465 466 } 466 set h [XmlGet $cpath.height]467 set h [XmlGetSubst $cpath.height] 467 468 if { $h == "" || ![string is number $h] || $h <= 0.0 } { 468 469 set height [expr [image height $img] / 4] … … 528 529 } 529 530 # Coords 530 set coords [XmlGet $cpath.coords]531 set coords [XmlGetSubst $cpath.coords] 531 532 set coords [string trim $coords] 532 533 if { $coords == "" } { … … 543 544 if { [info exists attr2option($attr)] } { 544 545 set option $attr2option($attr) 545 set value [XmlGet $cpath.$attr]546 set value [XmlGetSubst $cpath.$attr] 546 547 set options($option) $value 547 548 } … … 573 574 if { [info exists attr2option($attr)] } { 574 575 set option $attr2option($attr) 575 set value [XmlGet $cpath.$attr]576 set value [XmlGetSubst $cpath.$attr] 576 577 set options($option) $value 577 578 } 578 579 } 579 580 # Coordinates 580 set coords [XmlGet $cpath.coords]581 set coords [XmlGetSubst $cpath.coords] 581 582 set coords [string trim $coords] 582 583 if { $coords == "" } { … … 594 595 array set attr2option { 595 596 "font" "-font" 596 "color" "-f ill"597 "color" "-foreground" 597 598 "text" "-text" 598 599 "anchor" "-anchor" … … 604 605 -font {Arial 8} 605 606 -text {} 606 -fill black607 -fill {} 607 608 -anchor c 608 609 } … … 610 611 if { [info exists attr2option($attr)] } { 611 612 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 } 613 618 set options($option) $value 614 619 } 615 620 } 616 621 # Coords 617 set coords [XmlGet $cpath.coords]622 set coords [XmlGetSubst $cpath.coords] 618 623 set coords [string trim $coords] 619 624 if { $coords == "" } { … … 623 628 } 624 629 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] 626 635 set _cname2id($cname) $id 627 636 eval $itk_component(drawing) itemconfigure $id [array get options] … … 899 908 } 900 909 $_parser eval [list set $name $value] 910 set ::$name $value 901 911 } 902 912 } … … 907 917 return $value 908 918 } 919 return $value 920 } 921 922 itcl::body Rappture::DrawingEntry::XmlGetSubst { path } { 923 set value [$_owner xml get $path] 924 if { $_parser == "" } { 925 return $value 926 } 909 927 return [$_parser eval [list subst -nocommands $value]] 910 928 } 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 0920 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 line927 lappend list "text" [string range $line $cursor end]928 break929 }930 # Find the end of the variable931 incr cursor932 set c [string index $line $cursor]933 if { $c != "{" } {934 lappend list "text" "\$"935 continue936 }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 variable944 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" $value955 }956 lappend list "text" "\n"957 }958 return $list959 } -
trunk/gui/src/Makefile.in
r2743 r3038 51 51 OBJS = \ 52 52 RapptureGUI_Init.o \ 53 RpCanvHotspot.o \ 53 54 RpCanvPlacard.o \ 54 55 RpDiffview.o \ -
trunk/gui/src/RapptureGUI_Init.c
r2717 r3038 23 23 24 24 extern Tcl_AppInitProc Rappturegui_Init; 25 extern Tcl_AppInitProc RpCanvHotspot_Init; 25 26 extern Tcl_AppInitProc RpCanvPlacard_Init; 27 extern Tcl_AppInitProc RpConvertDxToVtk_Init; 26 28 extern Tcl_AppInitProc RpDiffview_Init; 27 29 … … 48 50 return TCL_ERROR; 49 51 } 52 if (RpCanvHotspot_Init(interp) != TCL_OK) { 53 return TCL_ERROR; 54 } 50 55 return TCL_OK; 51 56 } -
trunk/gui/src/RpCanvHotspot.c
r3037 r3038 39 39 #define VAR_FLAGS (TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS) 40 40 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 41 50 typedef struct _ItemSegment ItemSegment; 51 typedef struct _HotspotItem HotspotItem; 42 52 43 53 /* … … 46 56 */ 47 57 struct _ItemSegment { 58 HotspotItem *itemPtr; 48 59 ItemSegment *nextPtr; 49 60 int type; /* Image, normal text, or substituted 50 61 * text. */ 51 short int x, y; /* Location of image or text on52 * canvas. */62 short int x, y; /* Location of segment on canvas. */ 63 short int width, height; /* Dimension of segment. */ 53 64 Tk_TextLayout layout; /* Layout of normal or substituted 54 65 * text */ 55 66 int length; /* # of bytes in below string. */ 56 67 int lineNum; /* Line where segment if located. */ 57 c onst char *subst; /* Substitututed text. */58 c onst char text[1];68 char *subst; /* Substitututed text. */ 69 char text[1]; 59 70 }; 60 71 … … 62 73 * Record for each hotspot item: 63 74 */ 64 typedef structHotspotItem {65 Tk_Item header; /* Generic stuff that's the same for75 struct _HotspotItem { 76 Tk_Item base; /* Generic stuff that's the same for 66 77 * all types. MUST BE FIRST IN 67 78 * STRUCTURE. */ 79 unsigned int flags; 68 80 Tcl_Interp *interp; /* Interp that owns this item */ 81 Display *display; 69 82 Tk_Window tkwin; /* Window that represents this 70 83 * canvas */ … … 88 101 * (x,y) */ 89 102 XColor *textColor; /* Color for normal text */ 90 XColor *subst TextColor;/* Color for substitututed text */103 XColor *substColor; /* Color for substitututed text */ 91 104 XColor *outlineColor; /* Color for outline of rectangle */ 92 105 Tk_3DBorder border; /* If non-NULL, background color of … … 99 112 Tk_Font substFont; /* Font for drawing substituted text. */ 100 113 101 int width; /* Fixed width for hotspot (0 = not102 * set) */103 int maxWidth; /* Maximum overall width for104 * hotspot */105 int padding; /* Padding around text and images */106 107 114 const char *imageName; /* Name of normal hotspot image. */ 108 115 const char *activeImageName; /* Name of active hotspot image. */ … … 115 122 * configuration settings above: 116 123 */ 117 Tk_Image image; /* Normal hotspot icon. */118 Tk_Image activeImage; /* Active hotspot icon. */119 124 GC normalGC; /* Graphics context for drawing 120 125 * text. */ 121 GC rectGC; /* Graphics context for rectangle122 * outline. */123 126 GC substGC; /* GC for substituted text. */ 127 GC outlineGC; /* GC for outline? */ 124 128 ItemSegment *firstPtr, *lastPtr; /* List of hotspot segments. */ 125 129 int width, height; /* Dimension of bounding box. */ 126 } HotspotItem; 130 ItemSegment *activePtr; /* Active segment. */ 131 short int maxImageWidth, maxImageHeight; 132 int numLines; 133 }; 127 134 128 135 /* … … 136 143 static Tk_ConfigSpec configSpecs[] = { 137 144 {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}, 139 146 {TK_CONFIG_ANCHOR, "-anchor", "anchor", (char*)NULL, 140 147 "center", Tk_Offset(HotspotItem, anchor), 141 148 TK_CONFIG_DONT_SET_DEFAULT}, 142 {TK_CONFIG_BORDER, "-background", "background", (char*)NULL,149 {TK_CONFIG_BORDER, "-background", (char *)NULL, (char*)NULL, 143 150 "", Tk_Offset(HotspotItem, border), TK_CONFIG_NULL_OK}, 144 151 {TK_CONFIG_PIXELS, "-borderwidth", "borderWidth", (char*)NULL, 145 152 "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}, 148 155 {TK_CONFIG_FONT, "-font", "font", (char*)NULL, 149 "helvetica -12", Tk_Offset(HotspotItem, tkfont), 0},156 "helvetica -12", Tk_Offset(HotspotItem, font), 0}, 150 157 {TK_CONFIG_COLOR, "-foreground", "foreground", (char*)NULL, 151 158 "black", Tk_Offset(HotspotItem, textColor), 0}, 152 159 {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}, 154 161 {TK_CONFIG_COLOR, "-substitutionforeground", (char*)NULL, (char*)NULL, 155 "bl ack", Tk_Offset(HotspotItem, substTextColor), TK_CONFIG_NULL_OK},162 "blue", Tk_Offset(HotspotItem, substColor), 0}, 156 163 {TK_CONFIG_STRING, "-image", (char*)NULL, (char*)NULL, (char*)NULL, 157 Tk_Offset(HotspotItem, image ), 0},164 Tk_Offset(HotspotItem, imageName), 0}, 158 165 {TK_CONFIG_COLOR, "-outline", (char*)NULL, (char*)NULL, 159 166 "", Tk_Offset(HotspotItem, outlineColor), TK_CONFIG_NULL_OK}, … … 171 178 * Prototypes for procedures defined in this file 172 179 */ 173 static Tk_ItemCo figureProc ConfigureProc;180 static Tk_ItemConfigureProc ConfigureProc; 174 181 static Tk_ItemCreateProc CreateProc; 175 182 static Tk_ItemDeleteProc DeleteProc; … … 177 184 static Tk_ItemScaleProc ScaleProc; 178 185 static Tk_ItemTranslateProc TranslateProc; 179 static Tk_ItemCoord sProc CoordsProc;186 static Tk_ItemCoordProc CoordsProc; 180 187 static Tk_ItemAreaProc AreaProc; 181 188 static Tk_ItemPointProc PointProc; 182 static Tk_ItemPostscript proc PostscriptProc;189 static Tk_ItemPostscriptProc PostscriptProc; 183 190 184 191 static Tk_ImageChangedProc ImageChangedProc; … … 187 194 * The structures below defines the canvas item type: 188 195 */ 189 Tk_ItemType rpHotspotType = {196 static Tk_ItemType hotspotType = { 190 197 "hotspot", /* name */ 191 198 sizeof(HotspotItem), /* itemSize */ … … 412 419 } TkCanvas; 413 420 421 /* Forward declarations. */ 422 static void ComputeBbox(HotspotItem *itemPtr); 423 424 425 static void 426 EventuallyRedraw(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 435 static int 436 GetCoordFromObj(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 */ 464 static char * 465 TraceVarProc( 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 */ 508 static void 509 ImageChangedProc(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 524 static void 525 AddTextSegment(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 550 static void 551 AddVariableSegment(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 583 static void 584 AddHotspotSegment(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 608 static void 609 DestroySegment(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 627 static void 628 DestroySegments(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 639 static void 640 DoSubst(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 669 static void 670 ComputeGeometry(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 750 static int 751 ParseDescription(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 } 414 802 415 803 /* … … 437 825 { 438 826 HotspotItem *itemPtr = (HotspotItem *)canvItemPtr; 439 int i;440 827 double x, y; 828 Tk_Window tkwin; 441 829 442 830 tkwin = Tk_CanvasTkwin(canvas); 443 831 if (objc < 2) { 444 832 Tcl_AppendResult(interp, "wrong # args: should be \"", 445 Tk_PathName(tkwin), " create ", itemPtr->typePtr->name,833 Tk_PathName(tkwin), " create ", canvItemPtr->typePtr->name, 446 834 " x y ?options?\"", (char *)NULL); 447 835 return TCL_ERROR; … … 454 842 itemPtr->activeImage = NULL; 455 843 itemPtr->activeImageName = NULL; 844 itemPtr->activePtr = NULL; 456 845 itemPtr->anchor = TK_ANCHOR_CENTER; 457 846 itemPtr->border = NULL; … … 459 848 itemPtr->canvas = canvas; 460 849 itemPtr->display = Tk_Display(tkwin); 850 itemPtr->firstPtr = NULL; 461 851 itemPtr->font = NULL; 852 itemPtr->height = 0; 462 853 itemPtr->image = NULL; 463 854 itemPtr->imageName = NULL; 464 855 itemPtr->interp = interp; 856 itemPtr->lastPtr = NULL; 857 itemPtr->maxImageWidth = itemPtr->maxImageHeight = 0; 465 858 itemPtr->normalGC = None; 859 itemPtr->numLines = 0; 466 860 itemPtr->outlineColor = NULL; 467 861 itemPtr->outlineGC = None; 468 862 itemPtr->relief = TK_RELIEF_FLAT; 863 itemPtr->substColor = NULL; 469 864 itemPtr->substFont = NULL; 470 865 itemPtr->substGC = None; 471 866 itemPtr->substInterp = interp; 472 itemPtr-> substTextColor= NULL;867 itemPtr->text = NULL; 473 868 itemPtr->textColor = NULL; 474 869 itemPtr->tkwin = tkwin; 475 870 itemPtr->width = 0; 871 itemPtr->x = itemPtr->y = 0.0; 476 872 477 873 /* 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); 481 877 return TCL_ERROR; 482 878 } 483 879 itemPtr->x = x; 484 880 itemPtr->y = y; 485 ComputeBbox( canvas,itemPtr);881 ComputeBbox(itemPtr); 486 882 if (ConfigureProc(interp, canvas, canvItemPtr, objc - 2, objv + 2, 0) 487 883 != TCL_OK) { 488 DeleteProc(canvas, itemPtr, itemPtr->display);884 DeleteProc(canvas, canvItemPtr, itemPtr->display); 489 885 return TCL_ERROR; 490 886 } … … 520 916 521 917 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)); 524 922 Tcl_SetObjResult(interp, listObjPtr); 525 923 return TCL_OK; … … 532 930 return TCL_ERROR; 533 931 } 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)) { 536 934 return TCL_ERROR; 537 935 } 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)) { 541 939 return TCL_ERROR; 542 940 } … … 550 948 itemPtr->x = x; 551 949 itemPtr->y = y; 552 ComputeBbox( canvas,itemPtr);950 ComputeBbox(itemPtr); 553 951 return TCL_OK; 554 952 } … … 597 995 itemPtr->normalGC = newGC; 598 996 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 } 608 1008 609 1009 /* Substituted text GC. */ … … 614 1014 gcValues.font = Tk_FontId(itemPtr->font); 615 1015 } 616 if (itemPtr->subst TextColor != NULL) {617 gcValues.foreground = itemPtr->subst TextColor->pixel;1016 if (itemPtr->substColor != NULL) { 1017 gcValues.foreground = itemPtr->substColor->pixel; 618 1018 } else { 619 1019 gcValues.foreground = itemPtr->textColor->pixel; 620 1020 } 621 1021 newGC = Tk_GetGC(tkwin, mask, &gcValues); 622 if (itemPtr-> normalGC != None) {1022 if (itemPtr->substGC != None) { 623 1023 Tk_FreeGC(Tk_Display(tkwin), itemPtr->substGC); 624 1024 } … … 675 1075 itemPtr->activeImage = tkImage; 676 1076 677 Tk_SizeOfImage(itemPtr->image, &imgWidth, &ingHeight);678 679 1077 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); 683 1083 return TCL_OK; 684 1084 } … … 706 1106 Tk_FreeColor(itemPtr->textColor); 707 1107 } 708 if (itemPtr->subst TextColor != NULL) {709 Tk_FreeColor(itemPtr->subst TextColor);1108 if (itemPtr->substColor != NULL) { 1109 Tk_FreeColor(itemPtr->substColor); 710 1110 } 711 1111 if (itemPtr->outlineColor != NULL) { … … 713 1113 } 714 1114 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); 719 1116 } 720 1117 if (itemPtr->imageName != NULL) { 721 Tcl_Free( itemPtr->imageName);1118 Tcl_Free((char *)itemPtr->imageName); 722 1119 } 723 1120 if (itemPtr->activeImageName != NULL) { 724 Tcl_Free( itemPtr->activeImageName);1121 Tcl_Free((char *)itemPtr->activeImageName); 725 1122 } 726 1123 if (itemPtr->image != NULL ) { … … 739 1136 Tk_FreeGC(display, itemPtr->normalGC); 740 1137 } 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); 746 1140 } 747 1141 if (itemPtr->substGC != None) { … … 751 1145 } 752 1146 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 */ 1168 static void 1169 TranslateAnchor(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 * 755 1213 * ComputeBbox -- 756 1214 * 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 information760 * used to display a text item or check formouse 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. 761 1219 * 762 1220 * Results: … … 764 1222 * 765 1223 * Side effects: 766 * The fields x1, y1, x2, and y2 are updated in the header1224 * The fields x1, y1, x2, and y2 are updated in the base structure 767 1225 * for itemPtr, and the linePtr structure is regenerated 768 1226 * for itemPtr. 1227 * 769 1228 * ------------------------------------------------------------------------ 770 1229 */ 771 1230 static 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; 1231 ComputeBbox(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 1244 static void 1245 DrawSegment(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); 790 1264 } 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 } 922 1272 } 923 1273 … … 943 1293 { 944 1294 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 958 1309 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); 1033 1323 } 1034 1324 } … … 1039 1329 * PointProc -- 1040 1330 * 1041 * Computes the distance from a given point to a given hotspot 1042 * item, incanvas units.1331 * Computes the distance from a given point to a given hotspot item, in 1332 * canvas units. 1043 1333 * 1044 1334 * Results: … … 1057 1347 { 1058 1348 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] < x 0) {1066 dx = x 0- pointPtr[0];1067 } else if (pointPtr[0] >= x 1) {1068 dx = pointPtr[0] + 1 - x 1;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; 1069 1359 } else { 1070 1360 dx = 0; 1071 1361 } 1072 if (pointPtr[1] < y 0) {1073 dy = y 0- pointPtr[1];1074 } else if (pointPtr[1] >= y 1) {1075 dy = pointPtr[1] + 1 - y 1;1362 if (pointPtr[1] < y1) { 1363 dy = y1 - pointPtr[1]; 1364 } else if (pointPtr[1] >= y2) { 1365 dy = pointPtr[1] + 1 - y2; 1076 1366 } else { 1077 1367 dy = 0; … … 1103 1393 { 1104 1394 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 */ 1140 1406 } 1141 1407 … … 1163 1429 HotspotItem *itemPtr = (HotspotItem *)canvItemPtr; 1164 1430 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); 1168 1434 return; 1169 1435 } … … 1171 1437 /* 1172 1438 * ------------------------------------------------------------------------ 1439 * 1173 1440 * TranslateProc -- 1174 1441 * … … 1182 1449 * and the bounding box is updated in the generic part of the 1183 1450 * item structure. 1451 * 1184 1452 * ------------------------------------------------------------------------ 1185 1453 */ … … 1191 1459 itemPtr->x += dx; 1192 1460 itemPtr->y += dy; 1193 ComputeBbox( canvas,itemPtr);1461 ComputeBbox(itemPtr); 1194 1462 } 1195 1463 … … 1209 1477 * Side effects: 1210 1478 * None. 1479 * 1211 1480 * ------------------------------------------------------------------------ 1212 1481 */ … … 1218 1487 Tk_Window canvasWin = Tk_CanvasTkwin(canvas); 1219 1488 1489 #ifdef notdef 1220 1490 int x, y; 1221 1491 double xpos; … … 1230 1500 } 1231 1501 1232 if (Tk_CanvasPsFont(interp, canvas, itemPtr-> tkfont) != TCL_OK) {1502 if (Tk_CanvasPsFont(interp, canvas, itemPtr->font) != TCL_OK) { 1233 1503 return TCL_ERROR; 1234 1504 } … … 1247 1517 if (itemPtr->imageLeft) { 1248 1518 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; 1250 1520 sprintf(buffer, "%.15g %.15g", xpos, 1251 1521 Tk_CanvasPsY(canvas, itemPtr->y+delta+2)); … … 1280 1550 1281 1551 if ( itemPtr->imageLeft ){ 1282 if (Tk_CanvasPsFont(interp, canvas, itemPtr-> tkfont) != TCL_OK) {1552 if (Tk_CanvasPsFont(interp, canvas, itemPtr->font) != TCL_OK) { 1283 1553 return TCL_ERROR; 1284 1554 } … … 1313 1583 justify = "0"; /* TK_JUSTIFY_LEFT */ 1314 1584 1315 Tk_GetFontMetrics(itemPtr-> tkfont, &fm);1585 Tk_GetFontMetrics(itemPtr->font, &fm); 1316 1586 sprintf(buffer, "] %d %g %g %s %s DrawText\n", 1317 1587 fm.linespace, x / -2.0, y / 2.0, justify, 1318 1588 "false" /* stipple */); 1319 1589 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 1664 1591 return TCL_OK; 1665 1592 } … … 1680 1607 Tcl_Interp *interp; /* interpreter being initialized */ 1681 1608 { 1682 Tk_CreateItemType(& rpHotspotType);1609 Tk_CreateItemType(&hotspotType); 1683 1610 return TCL_OK; 1684 1611 }
Note: See TracChangeset
for help on using the changeset viewer.