# HG changeset patch # User mhessling@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1207551585 0 # Node ID fb59f9eeeecd0f95e358bfe329dea8f96d92f6d6 # Parent 46c261153aa42c62403d5517b8a86633fcf344aa SUpport for embedded mozilla/firefox widget diff -r 46c261153aa4 -r fb59f9eeeecd Makefile.in --- a/Makefile.in Sun Apr 06 10:25:36 2008 +0000 +++ b/Makefile.in Mon Apr 07 06:59:45 2008 +0000 @@ -8,7 +8,7 @@ INCPATH = -I.. -I. -I$(srcdir) TARGET = dw SRCS = $(srcdir)/$(DW_SRC)/dw.c -OBJECTS = dw.o +OBJECTS = dw.o browser.o SRCS2 = $(srcdir)compat.c OBJECTS2= compat.o TARGET2 = dwcompat @@ -102,6 +102,9 @@ dw.o: $(srcdir)/$(DW_SRC)/dw.c $(CC) -c $(INCPATH) $(CCFLAGS) -o $@ $(srcdir)/$(DW_SRC)/dw.c +browser.o: $(srcdir)/$(DW_SRC)/browser.cpp + $(CXX) -c $(INCPATH) $(CCFLAGS) -o $@ $(srcdir)/$(DW_SRC)/browser.cpp + compat.o: $(srcdir)/compat.c $(CC) -c $(INCPATH) $(CCFLAGS) -o $@ $(srcdir)/compat.c @@ -109,7 +112,7 @@ $(CC) -c $(INCPATH) $(CCFLAGS) -o $@ $(srcdir)/ci.c dwtest.o: $(srcdir)/dwtest.c - $(CC) -c $(INCPATH) $(CCFLAGS) -o $@ $(srcdir)/dwtest.c + $(CC) -c $(INCPATH) $(CCFLAGS) -o $@ $(srcdir)/dwtest.c ci: ci.o $(CC) -o ci ci.o -L$(PREFIX)/lib -ldw -ldwcompat $(LFLAGS) diff -r 46c261153aa4 -r fb59f9eeeecd configure --- a/configure Sun Apr 06 10:25:36 2008 +0000 +++ b/configure Mon Apr 07 06:59:45 2008 +0000 @@ -1,78 +1,35 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.53. +# Generated by GNU Autoconf 2.61. # -# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - - ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## -# Be Bourne compatible +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi - -# NLS nuisances. -# Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - -(set +x; test -n "`(LANG=C; export LANG) 2>&1`") && - { $as_unset LANG || test "${LANG+set}" != set; } || - { LANG=C; export LANG; } -(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && - { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || - { LC_ALL=C; export LC_ALL; } -(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && - { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || - { LC_TIME=C; export LC_TIME; } -(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && - { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || - { LC_CTYPE=C; export LC_CTYPE; } -(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && - { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || - { LANGUAGE=C; export LANGUAGE; } -(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && - { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || - { LC_COLLATE=C; export LC_COLLATE; } -(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && - { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || - { LC_NUMERIC=C; export LC_NUMERIC; } -(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && - { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || - { LC_MESSAGES=C; export LC_MESSAGES; } - - -# Name of the executable. -as_me=`(basename "$0") 2>/dev/null || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - -# PATH needs CR, and LINENO needs CR and PATH. + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' @@ -82,175 +39,536 @@ # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conftest.sh - echo "exit 0" >>conftest.sh - chmod +x conftest.sh - if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi - rm -f conftest.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + rm -f conf$$.sh +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no +fi + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in + case $as_dir in /*) - if ("$as_dir/$as_base" -c ' + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || + chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file - -as_executable_p="test -f" +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" - - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } - +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + + +exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` -exec 6>&1 - # # Initializations. # ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= @@ -262,40 +580,132 @@ # Factoring default headers for most tests. ac_includes_default="\ #include -#if HAVE_SYS_TYPES_H +#ifdef HAVE_SYS_TYPES_H # include #endif -#if HAVE_SYS_STAT_H +#ifdef HAVE_SYS_STAT_H # include #endif -#if STDC_HEADERS +#ifdef STDC_HEADERS # include # include #else -# if HAVE_STDLIB_H +# ifdef HAVE_STDLIB_H # include # endif #endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif -#if HAVE_STRINGS_H +#ifdef HAVE_STRINGS_H # include #endif -#if HAVE_INTTYPES_H +#ifdef HAVE_INTTYPES_H # include -#else -# if HAVE_STDINT_H -# include -# endif #endif -#if HAVE_UNISTD_H +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H # include #endif" +ac_subst_vars='SHELL +PATH_SEPARATOR +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +DW_MAJOR_VERSION +DW_MINOR_VERSION +DW_SUB_VERSION +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +CXX +CXXFLAGS +ac_ct_CXX +MAKE +INSTALL_PROGRAM +INSTALL_SCRIPT +INSTALL_DATA +CPP +GREP +EGREP +PKG_CFG +GLIB_CONFIG +GLIB_CFLAGS +GLIB_LIBS +GTK_CONFIG +GTK_CFLAGS +GTK_LIBS +IMLIB_CONFIG +GDK_IMLIB_CFLAGS +GDK_IMLIB_LIBS +INCLUDES +RM +LN +CP +MV +MKDIR +SHAREDFLAG +SOSUFFIX +DW_SRC +DW_DEFINE +LIBOBJS +LTLIBOBJS' +ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CXX +CXXFLAGS +CCC +CPP' + # Initialize some variables set by options. ac_init_help= @@ -322,34 +732,48 @@ # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' +datarootdir='${prefix}/share' +datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' ac_prev= +ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" + eval $ac_prev=\$ac_option ac_prev= continue fi - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_option in + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; @@ -371,33 +795,45 @@ --config-cache | -C) cache_file=config.cache ;; - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) + -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -424,6 +860,12 @@ -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; @@ -448,13 +890,16 @@ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) + | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) @@ -519,6 +964,16 @@ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; @@ -571,24 +1026,20 @@ -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. @@ -619,8 +1070,7 @@ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" + eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) @@ -640,27 +1090,19 @@ { (exit 1); exit 1; }; } fi -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix +# Be sure to have absolute directory names. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir do - eval ac_val=$`echo $ac_var` + eval ac_val=\$$ac_var case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' @@ -687,71 +1129,76 @@ test "$silent" = yes && exec 6>/dev/null +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then + if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } - fi -fi -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done # # Report the --help message. @@ -780,14 +1227,11 @@ -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] -_ACEOF - - cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -800,15 +1244,22 @@ --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -841,94 +1292,97 @@ CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CXX C++ compiler command + CXXFLAGS C++ compiler flags CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF +ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. - ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue + test -d "$ac_dir" || continue ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } done fi -test -n "$ac_init_help" && exit 0 +test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF - -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -Free Software Foundation, Inc. +configure +generated by GNU Autoconf 2.61 + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF - exit 0 -fi -exec 5>config.log -cat >&5 <<_ACEOF + exit +fi +cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.53. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF +exec 5>>config.log { cat <<_ASUNAME ## --------- ## @@ -947,7 +1401,7 @@ /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` @@ -961,6 +1415,7 @@ test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done +IFS=$as_save_IFS } >&5 @@ -976,37 +1431,62 @@ # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= -ac_sep= -for ac_arg +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 do - case $ac_arg in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n ) continue ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - ac_sep=" " ;; - esac - # Get rid of the leading space. + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args '$ac_arg'" + ;; + esac + done done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo + cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## @@ -1014,21 +1494,70 @@ _ASBOX echo # The following way of writing the cache mishandles newlines in values, -{ +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; -} + esac | + sort +) + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" + done | sort echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------------- ## +## File substitutions. ## +## ------------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## @@ -1036,26 +1565,24 @@ ## ----------- ## _ASBOX echo - sed "/^$/d" confdefs.h + cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core core.* *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status - ' 0 +' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h +rm -f -r conftest* confdefs.h # Predefined preprocessor variables. @@ -1086,14 +1613,17 @@ # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" +fi +shift +for ac_site_file +do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} @@ -1109,8 +1639,8 @@ { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; esac fi else @@ -1122,12 +1652,11 @@ # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do +for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 @@ -1140,20 +1669,19 @@ ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1170,6 +1698,22 @@ { (exit 1); exit 1; }; } fi + + + + + + + + + + + + + + + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -1177,22 +1721,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - - - - - - - - - - - - - ac_config_headers="$ac_config_headers config.h" @@ -1218,8 +1746,8 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1232,32 +1760,34 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1270,36 +1800,51 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1312,74 +1857,34 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi - fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1393,7 +1898,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -1404,6 +1909,7 @@ fi done done +IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. @@ -1414,31 +1920,30 @@ # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - set dummy "$as_dir/$ac_word" ${1+"$@"} - shift - ac_cv_prog_CC="$@" + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1451,36 +1956,38 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1493,68 +2000,97 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + test -n "$ac_ct_CC" && break done - CC=$ac_ct_CC -fi - -fi - - -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH" >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH" >&2;} + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 +echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" - -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + int main () { @@ -1564,62 +2100,107 @@ } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe" +ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -echo "$as_me:$LINENO: checking for C compiler default output" >&5 -echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -for ac_file in `ls a_out.exe a.exe conftest.exe 2>/dev/null; - ls a.out conftest 2>/dev/null; - ls a.* conftest.* 2>/dev/null`; do + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb | *.xSYM ) ;; - a.out ) # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool --akim. - export ac_cv_exeext - break;; - * ) break;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; esac done -else +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi + +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } +if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables" >&5 -echo "$as_me: error: C compiler cannot create executables" >&2;} +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 - -# Check the compiler produces executables we can run. If not, either + +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -1629,29 +2210,36 @@ cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'." >&5 +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'." >&2;} +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - -rm -f a.out a.exe conftest$ac_cv_exeext +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + +rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } + +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then @@ -1659,43 +2247,42 @@ # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. -for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext - break;; + break;; * ) break;; esac done else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link" >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link" >&2;} + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" - -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + int main () { @@ -1705,47 +2292,53 @@ } _ACEOF rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile" >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile" >&2;} +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" - -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + int main () { @@ -1758,48 +2351,55 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_compiler_gnu=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" - -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + int main () { @@ -1809,27 +2409,118 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_prog_cc_g=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -1845,123 +2536,485 @@ CFLAGS= fi fi -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - ''\ - '#include ' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -#include -$ac_declaration -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; int main () { -exit (42); +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; +esac + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +echo "$as_me:$LINENO: checking for C++ compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; } +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -continue -fi -rm -f conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -$ac_declaration -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; } +GXX=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; } +if test "${ac_cv_prog_cxx_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + int main () { -exit (42); + ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CXXFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest.$ac_ext +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -1971,8 +3024,8 @@ # Extract the first word of "gmake", so it can be a program name with args. set dummy gmake; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_MAKE+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1985,30 +3038,32 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_MAKE="gmake" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi MAKE=$ac_cv_prog_MAKE if test -n "$MAKE"; then - echo "$as_me:$LINENO: result: $MAKE" >&5 -echo "${ECHO_T}$MAKE" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi + { echo "$as_me:$LINENO: result: $MAKE" >&5 +echo "${ECHO_T}$MAKE" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + if test x"$MAKE" = x; then - # Extract the first word of "make", so it can be a program name with args. + # Extract the first word of "make", so it can be a program name with args. set dummy make; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_MAKE+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2021,51 +3076,59 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_MAKE="make" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi MAKE=$ac_cv_prog_MAKE if test -n "$MAKE"; then - echo "$as_me:$LINENO: result: $MAKE" >&5 -echo "${ECHO_T}$MAKE" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi + { echo "$as_me:$LINENO: result: $MAKE" >&5 +echo "${ECHO_T}$MAKE" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + fi ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break - elif test -f $ac_dir/install.sh; then + elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break - elif test -f $ac_dir/shtool; then + elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 -echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -2078,9 +3141,10 @@ # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2094,6 +3158,7 @@ case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. @@ -2101,40 +3166,41 @@ # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi done done ;; esac done +IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is - # removed, or if the path is relative. + # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -2153,8 +3219,8 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2171,73 +3237,87 @@ do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -#include - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Passes both tests. ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -2255,80 +3335,94 @@ else ac_cv_prog_CPP=$CPP fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -#include - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Passes both tests. ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -2337,8 +3431,10 @@ if $ac_preproc_ok; then : else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check" >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi @@ -2349,55 +3445,232 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_GREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_GREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_GREP=$GREP +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_EGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_EGREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_EGREP=$EGREP +fi + + + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include #include #include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_header_stdc=no -fi -rm -f conftest.err conftest.$ac_ext +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_stdc=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "memchr" >/dev/null 2>&1; then + $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no @@ -2409,13 +3682,16 @@ if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "free" >/dev/null 2>&1; then + $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no @@ -2430,16 +3706,21 @@ : else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include +#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else -# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif @@ -2450,19 +3731,28 @@ int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); + || toupper (i) != TOUPPER (i)) + return 2; + return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2470,16 +3760,19 @@ else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -2496,23 +3789,20 @@ ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 -echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 +echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include <$ac_hdr> -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -2523,27 +3813,35 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -eval "$as_ac_Header=no" -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 @@ -2555,220 +3853,170 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then - echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for library containing opendir" >&5 +echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS -ac_cv_search_opendir=no cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" - -/* Override any gcc2 internal prototype to avoid an error. */ +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char opendir (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { -opendir (); +return opendir (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +for ac_lib in '' dir; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_opendir="none required" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_opendir=$ac_res else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search_opendir" = no; then - for ac_lib in dir; do - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char opendir (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -int -main () -{ -opendir (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_opendir="-l$ac_lib" -break -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - done -fi +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_opendir+set}" = set; then + break +fi +done +if test "${ac_cv_search_opendir+set}" = set; then + : +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$ac_cv_search_opendir" >&6 -if test "$ac_cv_search_opendir" != no; then - test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" - -fi - -else - echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +echo "${ECHO_T}$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +else + { echo "$as_me:$LINENO: checking for library containing opendir" >&5 +echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS -ac_cv_search_opendir=no cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" - -/* Override any gcc2 internal prototype to avoid an error. */ +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char opendir (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { -opendir (); +return opendir (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +for ac_lib in '' x; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_opendir="none required" + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_opendir=$ac_res else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search_opendir" = no; then - for ac_lib in x; do - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char opendir (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -int -main () -{ -opendir (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_opendir="-l$ac_lib" -break -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - done -fi +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_opendir+set}" = set; then + break +fi +done +if test "${ac_cv_search_opendir+set}" = set; then + : +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$ac_cv_search_opendir" >&6 -if test "$ac_cv_search_opendir" != no; then - test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" +{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +echo "${ECHO_T}$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi @@ -2785,43 +4033,54 @@ for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h + inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -eval "$as_ac_Header=no" -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -2836,105 +4095,131 @@ for ac_header in unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; - no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -2950,105 +4235,131 @@ for ac_header in sys/stat.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; - no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -3065,70 +4376,88 @@ for ac_func in pipe do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); -char (*f) (); - -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me #endif + int main () { -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -f = $ac_func; -#endif - +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -eval "$as_ac_var=no" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 @@ -3146,70 +4475,88 @@ for ac_func in connect do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); -char (*f) (); - -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me #endif + int main () { -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -f = $ac_func; -#endif - +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -eval "$as_ac_var=no" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 @@ -3219,366 +4566,402 @@ done if test x"$ac_cv_func_connect" = x"no"; then - if test -z "$libsocket"; then - echo "$as_me:$LINENO: checking for socket in -lsocket" >&5 -echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6 + if test -z "$libsocket"; then + { echo "$as_me:$LINENO: checking for socket in -lsocket" >&5 +echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6; } if test "${ac_cv_lib_socket_socket+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" - -/* Override any gcc2 internal prototype to avoid an error. */ +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char socket (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { -socket (); +return socket (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_socket_socket=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_socket_socket=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_socket_socket=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5 -echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5 +echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6; } if test $ac_cv_lib_socket_socket = yes; then LIBS="$LIBS -lsocket" fi - fi - - if test -z "$libinet"; then - echo "$as_me:$LINENO: checking for socket in -linet" >&5 -echo $ECHO_N "checking for socket in -linet... $ECHO_C" >&6 + fi + + if test -z "$libinet"; then + { echo "$as_me:$LINENO: checking for socket in -linet" >&5 +echo $ECHO_N "checking for socket in -linet... $ECHO_C" >&6; } if test "${ac_cv_lib_inet_socket+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-linet $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" - -/* Override any gcc2 internal prototype to avoid an error. */ +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char socket (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { -socket (); +return socket (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_inet_socket=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_inet_socket=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_inet_socket=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_inet_socket" >&5 -echo "${ECHO_T}$ac_cv_lib_inet_socket" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_inet_socket" >&5 +echo "${ECHO_T}$ac_cv_lib_inet_socket" >&6; } if test $ac_cv_lib_inet_socket = yes; then libnsl=1; LIBS="$LIBS -linet -lnsl_s" fi - fi - - if test -z "$libnsl"; then - echo "$as_me:$LINENO: checking for gethostname in -lnsl" >&5 -echo $ECHO_N "checking for gethostname in -lnsl... $ECHO_C" >&6 + fi + + if test -z "$libnsl"; then + { echo "$as_me:$LINENO: checking for gethostname in -lnsl" >&5 +echo $ECHO_N "checking for gethostname in -lnsl... $ECHO_C" >&6; } if test "${ac_cv_lib_nsl_gethostname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" - -/* Override any gcc2 internal prototype to avoid an error. */ +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char gethostname (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { -gethostname (); +return gethostname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_nsl_gethostname=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_nsl_gethostname=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_nsl_gethostname=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostname" >&5 -echo "${ECHO_T}$ac_cv_lib_nsl_gethostname" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostname" >&5 +echo "${ECHO_T}$ac_cv_lib_nsl_gethostname" >&6; } if test $ac_cv_lib_nsl_gethostname = yes; then LIBS="$LIBS -lnsl" fi - fi -fi - -echo "$as_me:$LINENO: checking for getpwnam in -lsun" >&5 -echo $ECHO_N "checking for getpwnam in -lsun... $ECHO_C" >&6 + fi +fi + +{ echo "$as_me:$LINENO: checking for getpwnam in -lsun" >&5 +echo $ECHO_N "checking for getpwnam in -lsun... $ECHO_C" >&6; } if test "${ac_cv_lib_sun_getpwnam+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsun $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" - -/* Override any gcc2 internal prototype to avoid an error. */ +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char getpwnam (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { -getpwnam (); +return getpwnam (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_sun_getpwnam=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_sun_getpwnam=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_sun_getpwnam=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_sun_getpwnam" >&5 -echo "${ECHO_T}$ac_cv_lib_sun_getpwnam" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_sun_getpwnam" >&5 +echo "${ECHO_T}$ac_cv_lib_sun_getpwnam" >&6; } if test $ac_cv_lib_sun_getpwnam = yes; then LIBS="$LIBS -lsun" fi -echo "$as_me:$LINENO: checking for inet_addr in -ldgc" >&5 -echo $ECHO_N "checking for inet_addr in -ldgc... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for inet_addr in -ldgc" >&5 +echo $ECHO_N "checking for inet_addr in -ldgc... $ECHO_C" >&6; } if test "${ac_cv_lib_dgc_inet_addr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldgc $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" - -/* Override any gcc2 internal prototype to avoid an error. */ +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char inet_addr (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { -inet_addr (); +return inet_addr (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_dgc_inet_addr=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_dgc_inet_addr=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dgc_inet_addr=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dgc_inet_addr" >&5 -echo "${ECHO_T}$ac_cv_lib_dgc_inet_addr" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dgc_inet_addr" >&5 +echo "${ECHO_T}$ac_cv_lib_dgc_inet_addr" >&6; } if test $ac_cv_lib_dgc_inet_addr = yes; then LIBS="$LIBS -ldgc" fi -echo "$as_me:$LINENO: checking for gethostbyname in -lresolv" >&5 -echo $ECHO_N "checking for gethostbyname in -lresolv... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for gethostbyname in -lresolv" >&5 +echo $ECHO_N "checking for gethostbyname in -lresolv... $ECHO_C" >&6; } if test "${ac_cv_lib_resolv_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lresolv $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" - -/* Override any gcc2 internal prototype to avoid an error. */ +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char gethostbyname (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { -gethostbyname (); +return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_resolv_gethostbyname=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_resolv_gethostbyname=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_resolv_gethostbyname=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_gethostbyname" >&5 -echo "${ECHO_T}$ac_cv_lib_resolv_gethostbyname" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_lib_resolv_gethostbyname" >&6; } if test $ac_cv_lib_resolv_gethostbyname = yes; then LIBS="$LIBS -lresolv" fi @@ -3587,16 +4970,16 @@ OPSYSTEM=`uname -s` if test $OPSYSTEM = "Darwin"; then - DW_SRC=mac - DW_DEFINE=__MAC__ - SHAREDFLAG=-dynamiclib - SOSUFFIX=dylib - LIBS="$LIBS -framework Carbon" -else - # Extract the first word of "pkg-config", so it can be a program name with args. + DW_SRC=mac + DW_DEFINE=__MAC__ + SHAREDFLAG=-dynamiclib + SOSUFFIX=dylib + LIBS="$LIBS -framework Carbon" +else + # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_PKG_CFG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3609,64 +4992,66 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_PKG_CFG="pkg-config" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi PKG_CFG=$ac_cv_prog_PKG_CFG if test -n "$PKG_CFG"; then - echo "$as_me:$LINENO: result: $PKG_CFG" >&5 -echo "${ECHO_T}$PKG_CFG" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - if test x"$PKG_CFG" != x; then - GTK_LIBS=`$PKG_CFG --silence-errors --libs gtk+-2.0 gthread-2.0` - MOZEMBED_LIBS=`$PKG_CFG --silence-errors --libs firefox-gtkmozembed` - MOZEMBED_CFLAGS=`$PKG_CFG --silence-errors --cflags firefox-gtkmozembed` - RPATH=`$PKG_CFG --silence-errors --libs-only-L firefox-gtkmozembed | cut -b 3-` - if test x"$MOZEMBED_LIBS" = x; then - MOZEMBED_LIBS=`$PKG_CFG --silence-errors --libs mozilla-gtkmozembed` - MOZEMBED_CFLAGS=`$PKG_CFG --silence-errors --cflags mozilla-gtkmozembed` - RPATH=`$PKG_CFG --silence-errors --libs-only-L mozilla-gtkmozembed | cut -b 3-` - fi - if test x"$RPATH" != x; then - RPATH="-Wl,-R$RPATH" - fi - fi - - if test x"$GTK_LIBS" = x; then - -# Check whether --with-glib-prefix or --without-glib-prefix was given. + { echo "$as_me:$LINENO: result: $PKG_CFG" >&5 +echo "${ECHO_T}$PKG_CFG" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + if test x"$PKG_CFG" != x; then + GTK_LIBS=`$PKG_CFG --silence-errors --libs gtk+-2.0 gthread-2.0` + MOZEMBED_LIBS=`$PKG_CFG --silence-errors --libs firefox-gtkmozembed` + MOZEMBED_CFLAGS=`$PKG_CFG --silence-errors --cflags firefox-gtkmozembed` + RPATH=`$PKG_CFG --silence-errors --libs-only-L firefox-gtkmozembed | cut -b 3-` + if test x"$MOZEMBED_LIBS" = x; then + MOZEMBED_LIBS=`$PKG_CFG --silence-errors --libs mozilla-gtkmozembed` + MOZEMBED_CFLAGS=`$PKG_CFG --silence-errors --cflags mozilla-gtkmozembed` + RPATH=`$PKG_CFG --silence-errors --libs-only-L mozilla-gtkmozembed | cut -b 3-` + fi + if test x"$RPATH" != x; then + RPATH="-Wl,-R$RPATH" + fi + fi + + if test x"$GTK_LIBS" = x; then + +# Check whether --with-glib-prefix was given. if test "${with_glib_prefix+set}" = set; then - withval="$with_glib_prefix" - glib_config_prefix="$withval" + withval=$with_glib_prefix; glib_config_prefix="$withval" else glib_config_prefix="" -fi; - -# Check whether --with-glib-exec-prefix or --without-glib-exec-prefix was given. +fi + + +# Check whether --with-glib-exec-prefix was given. if test "${with_glib_exec_prefix+set}" = set; then - withval="$with_glib_exec_prefix" - glib_config_exec_prefix="$withval" + withval=$with_glib_exec_prefix; glib_config_exec_prefix="$withval" else glib_config_exec_prefix="" -fi; -# Check whether --enable-glibtest or --disable-glibtest was given. +fi + +# Check whether --enable-glibtest was given. if test "${enable_glibtest+set}" = set; then - enableval="$enable_glibtest" - + enableval=$enable_glibtest; else enable_glibtest=yes -fi; +fi + if test x$glib_config_exec_prefix != x ; then glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix" @@ -3695,8 +5080,8 @@ # Extract the first word of "glib-config", so it can be a program name with args. set dummy glib-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_GLIB_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3711,31 +5096,32 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GLIB_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_GLIB_CONFIG" && ac_cv_path_GLIB_CONFIG="no" ;; esac fi GLIB_CONFIG=$ac_cv_path_GLIB_CONFIG - if test -n "$GLIB_CONFIG"; then - echo "$as_me:$LINENO: result: $GLIB_CONFIG" >&5 -echo "${ECHO_T}$GLIB_CONFIG" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi + { echo "$as_me:$LINENO: result: $GLIB_CONFIG" >&5 +echo "${ECHO_T}$GLIB_CONFIG" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + min_glib_version=1.2.0 - echo "$as_me:$LINENO: checking for GLIB - version >= $min_glib_version" >&5 -echo $ECHO_N "checking for GLIB - version >= $min_glib_version... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for GLIB - version >= $min_glib_version" >&5 +echo $ECHO_N "checking for GLIB - version >= $min_glib_version... $ECHO_C" >&6; } no_glib="" if test "$GLIB_CONFIG" = "no" ; then no_glib=yes @@ -3758,8 +5144,11 @@ echo $ac_n "cross compiling; assumed OK... $ac_c" else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include @@ -3835,13 +5224,22 @@ _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3849,23 +5247,26 @@ else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ( exit $ac_status ) no_glib=yes fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_glib" = x ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } : else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } if test "$GLIB_CONFIG" = "no" ; then echo "*** The glib-config script installed by GLIB could not be found" echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in" @@ -3879,18 +5280,15 @@ CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$LIBS $GLIB_LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -3900,17 +5298,23 @@ } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GLIB or finding the wrong" echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" @@ -3922,13 +5326,16 @@ echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 - echo "*** The test program failed to compile or link. See the file config.log for the" +sed 's/^/| /' conftest.$ac_ext >&5 + + echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GLIB was incorrectly installed" echo "*** or that you have moved GLIB since it was installed. In the latter case, you" echo "*** may want to edit the glib-config script: $GLIB_CONFIG" fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi @@ -3948,28 +5355,28 @@ rm -f conf.glibtest -# Check whether --with-gtk-prefix or --without-gtk-prefix was given. +# Check whether --with-gtk-prefix was given. if test "${with_gtk_prefix+set}" = set; then - withval="$with_gtk_prefix" - gtk_config_prefix="$withval" + withval=$with_gtk_prefix; gtk_config_prefix="$withval" else gtk_config_prefix="" -fi; - -# Check whether --with-gtk-exec-prefix or --without-gtk-exec-prefix was given. +fi + + +# Check whether --with-gtk-exec-prefix was given. if test "${with_gtk_exec_prefix+set}" = set; then - withval="$with_gtk_exec_prefix" - gtk_config_exec_prefix="$withval" + withval=$with_gtk_exec_prefix; gtk_config_exec_prefix="$withval" else gtk_config_exec_prefix="" -fi; -# Check whether --enable-gtktest or --disable-gtktest was given. +fi + +# Check whether --enable-gtktest was given. if test "${enable_gtktest+set}" = set; then - enableval="$enable_gtktest" - + enableval=$enable_gtktest; else enable_gtktest=yes -fi; +fi + for module in . gthread do @@ -3995,8 +5402,8 @@ # Extract the first word of "gtk-config", so it can be a program name with args. set dummy gtk-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_GTK_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4011,31 +5418,32 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GTK_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_GTK_CONFIG" && ac_cv_path_GTK_CONFIG="no" ;; esac fi GTK_CONFIG=$ac_cv_path_GTK_CONFIG - if test -n "$GTK_CONFIG"; then - echo "$as_me:$LINENO: result: $GTK_CONFIG" >&5 -echo "${ECHO_T}$GTK_CONFIG" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi + { echo "$as_me:$LINENO: result: $GTK_CONFIG" >&5 +echo "${ECHO_T}$GTK_CONFIG" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + min_gtk_version=1.2.0 - echo "$as_me:$LINENO: checking for GTK - version >= $min_gtk_version" >&5 -echo $ECHO_N "checking for GTK - version >= $min_gtk_version... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for GTK - version >= $min_gtk_version" >&5 +echo $ECHO_N "checking for GTK - version >= $min_gtk_version... $ECHO_C" >&6; } no_gtk="" if test "$GTK_CONFIG" = "no" ; then no_gtk=yes @@ -4058,8 +5466,11 @@ echo $ac_n "cross compiling; assumed OK... $ac_c" else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include @@ -4137,13 +5548,22 @@ _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4151,23 +5571,26 @@ else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ( exit $ac_status ) no_gtk=yes fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_gtk" = x ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } : else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } if test "$GTK_CONFIG" = "no" ; then echo "*** The gtk-config script installed by GTK could not be found" echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in" @@ -4181,18 +5604,15 @@ CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4202,17 +5622,23 @@ } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GTK or finding the wrong" echo "*** version of GTK. If it is not finding GTK, you'll need to set your" @@ -4224,13 +5650,16 @@ echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 - echo "*** The test program failed to compile or link. See the file config.log for the" +sed 's/^/| /' conftest.$ac_ext >&5 + + echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GTK was incorrectly installed" echo "*** or that you have moved GTK since it was installed. In the latter case, you" echo "*** may want to edit the gtk-config script: $GTK_CONFIG" fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi @@ -4250,28 +5679,28 @@ rm -f conf.gtktest -# Check whether --with-imlib-prefix or --without-imlib-prefix was given. +# Check whether --with-imlib-prefix was given. if test "${with_imlib_prefix+set}" = set; then - withval="$with_imlib_prefix" - imlib_prefix="$withval" + withval=$with_imlib_prefix; imlib_prefix="$withval" else imlib_prefix="" -fi; - -# Check whether --with-imlib-exec-prefix or --without-imlib-exec-prefix was given. +fi + + +# Check whether --with-imlib-exec-prefix was given. if test "${with_imlib_exec_prefix+set}" = set; then - withval="$with_imlib_exec_prefix" - imlib_exec_prefix="$withval" + withval=$with_imlib_exec_prefix; imlib_exec_prefix="$withval" else imlib_exec_prefix="" -fi; -# Check whether --enable-imlibtest or --disable-imlibtest was given. +fi + +# Check whether --enable-imlibtest was given. if test "${enable_imlibtest+set}" = set; then - enableval="$enable_imlibtest" - + enableval=$enable_imlibtest; else enable_imlibtest=yes -fi; +fi + if test x$imlib_exec_prefix != x ; then imlib_args="$imlib_args --exec-prefix=$imlib_exec_prefix" @@ -4288,8 +5717,8 @@ # Extract the first word of "imlib-config", so it can be a program name with args. set dummy imlib-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_IMLIB_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4304,31 +5733,32 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_IMLIB_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_IMLIB_CONFIG" && ac_cv_path_IMLIB_CONFIG="no" ;; esac fi IMLIB_CONFIG=$ac_cv_path_IMLIB_CONFIG - if test -n "$IMLIB_CONFIG"; then - echo "$as_me:$LINENO: result: $IMLIB_CONFIG" >&5 -echo "${ECHO_T}$IMLIB_CONFIG" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi + { echo "$as_me:$LINENO: result: $IMLIB_CONFIG" >&5 +echo "${ECHO_T}$IMLIB_CONFIG" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + min_imlib_version=1.9.4 - echo "$as_me:$LINENO: checking for IMLIB - version >= $min_imlib_version" >&5 -echo $ECHO_N "checking for IMLIB - version >= $min_imlib_version... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for IMLIB - version >= $min_imlib_version" >&5 +echo $ECHO_N "checking for IMLIB - version >= $min_imlib_version... $ECHO_C" >&6; } no_imlib="" if test "$IMLIB_CONFIG" = "no" ; then no_imlib=yes @@ -4352,8 +5782,11 @@ echo $ac_n "cross compiling; assumed OK... $ac_c" else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include @@ -4395,13 +5828,22 @@ _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4409,26 +5851,29 @@ else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ( exit $ac_status ) no_imlib=yes fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_imlib" = x ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<\_ACEOF #define USE_IMLIB 1 _ACEOF else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } if test "$IMLIB_CONFIG" = "no" ; then echo "*** The imlib-config script installed by IMLIB could not be found" echo "*** If IMLIB was installed in PREFIX, make sure PREFIX/bin is in" @@ -4442,18 +5887,15 @@ CFLAGS="$CFLAGS $GDK_IMLIB_CFLAGS" LIBS="$LIBS $GDK_IMLIB_LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4463,17 +5905,23 @@ } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding IMLIB or finding the wrong" echo "*** version of IMLIB. If it is not finding IMLIB, you'll need to set your" @@ -4485,13 +5933,16 @@ echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 - echo "*** The test program failed to compile or link. See the file config.log for the" +sed 's/^/| /' conftest.$ac_ext >&5 + + echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means IMLIB was incorrectly installed" echo "*** or that you have moved IMLIB since it was installed. In the latter case, you" echo "*** may want to edit the imlib-config script: $IMLIB_CONFIG" fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi @@ -4506,111 +5957,135 @@ rm -f conf.gdkimlibtest - else - GTK_CFLAGS=`$PKG_CFG --cflags gtk+-2.0 gthread-2.0` - GTK_LIBS=`$PKG_CFG --libs gtk+-2.0 gthread-2.0` - fi + else + GTK_CFLAGS=`$PKG_CFG --cflags gtk+-2.0 gthread-2.0` + GTK_LIBS=`$PKG_CFG --libs gtk+-2.0 gthread-2.0` + fi fi if test "${ac_cv_header_pthread_h+set}" = set; then - echo "$as_me:$LINENO: checking for pthread.h" >&5 -echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for pthread.h" >&5 +echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; } if test "${ac_cv_header_pthread_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 -echo "${ECHO_T}$ac_cv_header_pthread_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 +echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking pthread.h usability" >&5 -echo $ECHO_N "checking pthread.h usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking pthread.h usability" >&5 +echo $ECHO_N "checking pthread.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking pthread.h presence" >&5 -echo $ECHO_N "checking pthread.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking pthread.h presence" >&5 +echo $ECHO_N "checking pthread.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) { echo "$as_me:$LINENO: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;};; - no:yes ) + { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: pthread.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) { echo "$as_me:$LINENO: WARNING: pthread.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: pthread.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: pthread.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: pthread.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: pthread.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: pthread.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: pthread.h: in the future, the compiler will take precedence" >&2;} + + ;; esac -echo "$as_me:$LINENO: checking for pthread.h" >&5 -echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for pthread.h" >&5 +echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; } if test "${ac_cv_header_pthread_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_pthread_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 -echo "${ECHO_T}$ac_cv_header_pthread_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 +echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; } fi if test $ac_cv_header_pthread_h = yes; then @@ -4622,184 +6097,202 @@ fi -echo "$as_me:$LINENO: checking for pthread_attr_init in -lpthread" >&5 -echo $ECHO_N "checking for pthread_attr_init in -lpthread... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for pthread_attr_init in -lpthread" >&5 +echo $ECHO_N "checking for pthread_attr_init in -lpthread... $ECHO_C" >&6; } if test "${ac_cv_lib_pthread_pthread_attr_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" - -/* Override any gcc2 internal prototype to avoid an error. */ +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char pthread_attr_init (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { -pthread_attr_init (); +return pthread_attr_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_pthread_pthread_attr_init=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_pthread_pthread_attr_init=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_pthread_pthread_attr_init=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_attr_init" >&5 -echo "${ECHO_T}$ac_cv_lib_pthread_pthread_attr_init" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_attr_init" >&5 +echo "${ECHO_T}$ac_cv_lib_pthread_pthread_attr_init" >&6; } if test $ac_cv_lib_pthread_pthread_attr_init = yes; then PTHREAD_LIBS="-lpthread" else - echo "$as_me:$LINENO: checking for pthread_attr_init in -lpthreads" >&5 -echo $ECHO_N "checking for pthread_attr_init in -lpthreads... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for pthread_attr_init in -lpthreads" >&5 +echo $ECHO_N "checking for pthread_attr_init in -lpthreads... $ECHO_C" >&6; } if test "${ac_cv_lib_pthreads_pthread_attr_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthreads $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" - -/* Override any gcc2 internal prototype to avoid an error. */ +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char pthread_attr_init (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { -pthread_attr_init (); +return pthread_attr_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_pthreads_pthread_attr_init=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_pthreads_pthread_attr_init=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_pthreads_pthread_attr_init=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_attr_init" >&5 -echo "${ECHO_T}$ac_cv_lib_pthreads_pthread_attr_init" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_attr_init" >&5 +echo "${ECHO_T}$ac_cv_lib_pthreads_pthread_attr_init" >&6; } if test $ac_cv_lib_pthreads_pthread_attr_init = yes; then PTHREAD_LIBS="-lpthreads" else - echo "$as_me:$LINENO: checking for pthread_attr_init in -lc_r" >&5 -echo $ECHO_N "checking for pthread_attr_init in -lc_r... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for pthread_attr_init in -lc_r" >&5 +echo $ECHO_N "checking for pthread_attr_init in -lc_r... $ECHO_C" >&6; } if test "${ac_cv_lib_c_r_pthread_attr_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" - -/* Override any gcc2 internal prototype to avoid an error. */ +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char pthread_attr_init (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { -pthread_attr_init (); +return pthread_attr_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_c_r_pthread_attr_init=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_c_r_pthread_attr_init=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_c_r_pthread_attr_init=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_attr_init" >&5 -echo "${ECHO_T}$ac_cv_lib_c_r_pthread_attr_init" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_attr_init" >&5 +echo "${ECHO_T}$ac_cv_lib_c_r_pthread_attr_init" >&6; } if test $ac_cv_lib_c_r_pthread_attr_init = yes; then PTHREAD_LIBS="-lc_r" else - { { echo "$as_me:$LINENO: error: pthread library not found. HandyFTP cannot build without it. - " >&5 -echo "$as_me: error: pthread library not found. HandyFTP cannot build without it. - " >&2;} + { { echo "$as_me:$LINENO: error: pthread library not found. dwindows cannot build without it. + " >&5 +echo "$as_me: error: pthread library not found. dwindows cannot build without it. + " >&2;} { (exit 1); exit 1; }; } fi @@ -4814,63 +6307,69 @@ CFLAGS="$CFLAGS $GTK_CFLAGS $GDK_IMLIB_FLAGS $MOZEMBED_CFLAGS" if test x"$MOZEMBED_LIBS" != x; then - SAVE_LIBS="$LIBS" - LIBS="$LIBS $GTK_LIBS $PTHREAD_LIBS $GDK_IMLIB_LIBS $MOZEMBED_LIBS" - echo "$as_me:$LINENO: checking for gtk_moz_embed_new in -lgtkembedmoz" >&5 -echo $ECHO_N "checking for gtk_moz_embed_new in -lgtkembedmoz... $ECHO_C" >&6 + SAVE_LIBS="$LIBS" + LIBS="$RPATH $LIBS $GTK_LIBS $PTHREAD_LIBS $GDK_IMLIB_LIBS $MOZEMBED_LIBS" + { echo "$as_me:$LINENO: checking for gtk_moz_embed_new in -lgtkembedmoz" >&5 +echo $ECHO_N "checking for gtk_moz_embed_new in -lgtkembedmoz... $ECHO_C" >&6; } if test "${ac_cv_lib_gtkembedmoz_gtk_moz_embed_new+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgtkembedmoz $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" - -/* Override any gcc2 internal prototype to avoid an error. */ +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char gtk_moz_embed_new (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { -gtk_moz_embed_new (); +return gtk_moz_embed_new (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_gtkembedmoz_gtk_moz_embed_new=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_gtkembedmoz_gtk_moz_embed_new=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_gtkembedmoz_gtk_moz_embed_new=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_gtkembedmoz_gtk_moz_embed_new" >&5 -echo "${ECHO_T}$ac_cv_lib_gtkembedmoz_gtk_moz_embed_new" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_gtkembedmoz_gtk_moz_embed_new" >&5 +echo "${ECHO_T}$ac_cv_lib_gtkembedmoz_gtk_moz_embed_new" >&6; } if test $ac_cv_lib_gtkembedmoz_gtk_moz_embed_new = yes; then cat >>confdefs.h <<\_ACEOF #define USE_GTKMOZEMBED 1 @@ -4878,10 +6377,10 @@ fi - LIBS="$SAVE_LIBS" -fi - -LIBS="$RPATH $LIBS $GTK_LIBS $PTHREAD_LIBS $GDK_IMLIB_LIBS" + LIBS="$SAVE_LIBS" +fi + +LIBS="$RPATH $LIBS $GTK_LIBS $PTHREAD_LIBS $GDK_IMLIB_LIBS $MOZEMBED_LIBS" RM="rm -f" LN="ln -s" @@ -4914,7 +6413,7 @@ # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # -# `ac_cv_env_foo' variables (set or unset) will be overriden when +# `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. @@ -4922,39 +6421,58 @@ # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. +# So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -{ +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} | + esac | + sort +) | sed ' + /^ac_cv_env_/b end t clear - : clear + :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if cmp -s $cache_file confcache; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - echo "not updating unwritable cache $cache_file" + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -4963,23 +6481,24 @@ # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - DEFS=-DHAVE_CONFIG_H +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files @@ -4994,70 +6513,36 @@ # configure, is in config.log if it exists. debug=false +ac_cs_recheck=false +ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF - ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## -# Be Bourne compatible +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi - -# NLS nuisances. -# Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - -(set +x; test -n "`(LANG=C; export LANG) 2>&1`") && - { $as_unset LANG || test "${LANG+set}" != set; } || - { LANG=C; export LANG; } -(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && - { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || - { LC_ALL=C; export LC_ALL; } -(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && - { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || - { LC_TIME=C; export LC_TIME; } -(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && - { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || - { LC_CTYPE=C; export LC_CTYPE; } -(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && - { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || - { LANGUAGE=C; export LANGUAGE; } -(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && - { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || - { LC_COLLATE=C; export LC_COLLATE; } -(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && - { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || - { LC_NUMERIC=C; export LC_NUMERIC; } -(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && - { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || - { LC_MESSAGES=C; export LC_MESSAGES; } - - -# Name of the executable. -as_me=`(basename "$0") 2>/dev/null || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - -# PATH needs CR, and LINENO needs CR and PATH. + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' @@ -5067,170 +6552,255 @@ # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conftest.sh - echo "exit 0" >>conftest.sh - chmod +x conftest.sh - if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi - rm -f conftest.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + rm -f conf$$.sh +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + + as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file - -as_executable_p="test -f" +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" - - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + exec 6>&1 -# Open the log real soon, to keep \$[0] and so on meaningful, and to +# Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - +# values after options handling. +ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.53. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -5238,30 +6808,19 @@ CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 -_ACEOF - +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi +config_files="$ac_config_files" +config_headers="$ac_config_headers" + +_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF - ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. @@ -5269,13 +6828,14 @@ Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit - -V, --version print version number, then exit + -V, --version print version number and configuration settings, then exit + -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] - instantiate the configuration file FILE + instantiate the configuration file FILE --header=FILE[:TEMPLATE] - instantiate the configuration header FILE + instantiate the configuration header FILE Configuration files: $config_files @@ -5284,20 +6844,21 @@ $config_headers Report bugs to ." -_ACEOF - + +_ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.53, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" - -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. +configured by $0, generated by GNU Autoconf 2.61, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir -INSTALL="$INSTALL" + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -5308,82 +6869,104 @@ do case $1 in --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` - shift - set dummy "$ac_option" "$ac_optarg" ${1+"$@"} - shift + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: ;; - -*);; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_need_defaults=false;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; esac - case $1 in + case $ac_option in # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion" - exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;; -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} + { echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - shift - CONFIG_FILES="$CONFIG_FILES $1" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - shift - CONFIG_HEADERS="$CONFIG_HEADERS $1" - ac_need_defaults=false;; + echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; - *) ac_config_targets="$ac_config_targets $1" ;; + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; esac shift done -_ACEOF - - - - +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. for ac_config_target in $ac_config_targets do - case "$ac_config_target" in - # Handling of arguments. - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "dw-config" ) CONFIG_FILES="$CONFIG_FILES dw-config" ;; - "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "dw-config") CONFIG_FILES="$CONFIG_FILES dw-config" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done + # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely @@ -5393,279 +6976,394 @@ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi -# Create a temporary directory, and hook for its removal unless debugging. +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. $debug || { - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } - # Create a (secure) tmp directory for tmp files. -: ${TMPDIR=/tmp} + { - tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=$TMPDIR/cs$$-$RANDOM - (umask 077 && mkdir $tmp) + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") } || { - echo "$me: cannot create a temporary directory in $TMPDIR" >&2 + echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - # -# CONFIG_FILES section. +# Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@DW_MAJOR_VERSION@,$DW_MAJOR_VERSION,;t t -s,@DW_MINOR_VERSION@,$DW_MINOR_VERSION,;t t -s,@DW_SUB_VERSION@,$DW_SUB_VERSION,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@MAKE@,$MAKE,;t t -s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s,@INSTALL_DATA@,$INSTALL_DATA,;t t -s,@CPP@,$CPP,;t t -s,@PKG_CFG@,$PKG_CFG,;t t -s,@GLIB_CONFIG@,$GLIB_CONFIG,;t t -s,@GLIB_CFLAGS@,$GLIB_CFLAGS,;t t -s,@GLIB_LIBS@,$GLIB_LIBS,;t t -s,@GTK_CONFIG@,$GTK_CONFIG,;t t -s,@GTK_CFLAGS@,$GTK_CFLAGS,;t t -s,@GTK_LIBS@,$GTK_LIBS,;t t -s,@IMLIB_CONFIG@,$IMLIB_CONFIG,;t t -s,@GDK_IMLIB_CFLAGS@,$GDK_IMLIB_CFLAGS,;t t -s,@GDK_IMLIB_LIBS@,$GDK_IMLIB_LIBS,;t t -s,@INCLUDES@,$INCLUDES,;t t -s,@RM@,$RM,;t t -s,@LN@,$LN,;t t -s,@CP@,$CP,;t t -s,@MV@,$MV,;t t -s,@MKDIR@,$MKDIR,;t t -s,@SHAREDFLAG@,$SHAREDFLAG,;t t -s,@SOSUFFIX@,$SOSUFFIX,;t t -s,@DW_SRC@,$DW_SRC,;t t -s,@DW_DEFINE@,$DW_DEFINE,;t t -CEOF - -_ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag +if test -n "$CONFIG_FILES"; then + +_ACEOF + + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +DW_MAJOR_VERSION!$DW_MAJOR_VERSION$ac_delim +DW_MINOR_VERSION!$DW_MINOR_VERSION$ac_delim +DW_SUB_VERSION!$DW_SUB_VERSION$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +CXX!$CXX$ac_delim +CXXFLAGS!$CXXFLAGS$ac_delim +ac_ct_CXX!$ac_ct_CXX$ac_delim +MAKE!$MAKE$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +CPP!$CPP$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +PKG_CFG!$PKG_CFG$ac_delim +GLIB_CONFIG!$GLIB_CONFIG$ac_delim +GLIB_CFLAGS!$GLIB_CFLAGS$ac_delim +GLIB_LIBS!$GLIB_LIBS$ac_delim +GTK_CONFIG!$GTK_CONFIG$ac_delim +GTK_CFLAGS!$GTK_CFLAGS$ac_delim +GTK_LIBS!$GTK_LIBS$ac_delim +IMLIB_CONFIG!$IMLIB_CONFIG$ac_delim +GDK_IMLIB_CFLAGS!$GDK_IMLIB_CFLAGS$ac_delim +GDK_IMLIB_LIBS!$GDK_IMLIB_LIBS$ac_delim +INCLUDES!$INCLUDES$ac_delim +RM!$RM$ac_delim +LN!$LN$ac_delim +CP!$CP$ac_delim +MV!$MV$ac_delim +MKDIR!$MKDIR$ac_delim +SHAREDFLAG!$SHAREDFLAG$ac_delim +SOSUFFIX!$SOSUFFIX$ac_delim +DW_SRC!$DW_SRC$ac_delim +DW_DEFINE!$DW_DEFINE$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 79; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof +_ACEOF + + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF +fi # test -n "$CONFIG_FILES" + + +for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat - fi -fi # test -n "$CONFIG_FILES" - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; - esac - - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { case "$ac_dir" in - [\\/]* | ?:[\\/]* ) as_incr_dir=;; - *) as_incr_dir=.;; -esac -as_dummy="$ac_dir" -for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do - case $as_mkdir_dir in - # Skip DOS drivespec - ?:) as_incr_dir=$as_mkdir_dir ;; - *) - as_incr_dir=$as_incr_dir/$as_mkdir_dir - test -d "$as_incr_dir" || - mkdir "$as_incr_dir" || - { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; } + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac ;; esac -done; } - + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` - +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac - - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo $f;; - *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } -_ACEOF +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub @@ -5673,246 +7371,137 @@ cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -s,@INSTALL@,$ac_INSTALL,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi - -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -# -# CONFIG_HEADER section. -# - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='[ ].*$,\1#\2' -ac_dC=' ' -ac_dD=',;t' -# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='$,\1#\2define\3' -ac_uC=' ' -ac_uD=',;t' - -for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac - - test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo $f;; - *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } - # Remove the trailing spaces. - sed 's/[ ]*$//' $ac_file_inputs >$tmp/in - -_ACEOF - -# Transform confdefs.h into two sed scripts, `conftest.defines' and -# `conftest.undefs', that substitutes the proper values into -# config.h.in to produce config.h. The first handles `#define' -# templates, and the second `#undef' templates. -# And first: Protect against being on the right side of a sed subst in -# config.status. Protect against being in an unquoted here document -# in config.status. -rm -f conftest.defines conftest.undefs -# Using a here document instead of a string reduces the quoting nightmare. -# Putting comments in sed scripts is not portable. -# -# `end' is used to avoid that the second main sed command (meant for -# 0-ary CPP macros) applies to n-ary macro definitions. -# See the Autoconf documentation for `clear'. -cat >confdef2sed.sed <<\_ACEOF -s/[\\&,]/\\&/g -s,[\\$`],\\&,g -t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp -t end -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp -: end -_ACEOF -# If some macros were called several times there might be several times -# the same #defines, which is useless. Nevertheless, we may not want to -# sort them, since we want the *last* AC-DEFINE to be honored. -uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines -sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs -rm -f confdef2sed.sed - -# This sed command replaces #undef with comments. This is necessary, for + ;; + :H) + # + # CONFIG_HEADER + # +_ACEOF + +# Transform confdefs.h into a sed script `conftest.defines', that +# substitutes the proper values into config.h.in to produce config.h. +rm -f conftest.defines conftest.tail +# First, append a space to every undef/define line, to ease matching. +echo 's/$/ /' >conftest.defines +# Then, protect against being on the right side of a sed subst, or in +# an unquoted here document, in config.status. If some macros were +# called several times there might be several #defines for the same +# symbol, which is useless. But do not sort them, since the last +# AC_DEFINE must be honored. +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where +# NAME is the cpp macro being defined, VALUE is the value it is being given. +# PARAMS is the parameter list in the macro definition--in most cases, it's +# just an empty string. +ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' +ac_dB='\\)[ (].*,\\1define\\2' +ac_dC=' ' +ac_dD=' ,' + +uniq confdefs.h | + sed -n ' + t rset + :rset + s/^[ ]*#[ ]*define[ ][ ]*// + t ok + d + :ok + s/[\\&,]/\\&/g + s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p + s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p + ' >>conftest.defines + +# Remove the space that was appended to ease matching. +# Then replace #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. -cat >>conftest.undefs <<\_ACEOF -s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, -_ACEOF - -# Break up conftest.defines because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS -echo ' if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS -echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS -echo ' :' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.defines >/dev/null +# (The regexp can be short, since the line contains either #define or #undef.) +echo 's/ $// +s,^[ #]*u.*,/* & */,' >>conftest.defines + +# Break up conftest.defines: +ac_max_sed_lines=50 + +# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" +# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" +# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" +# et cetera. +ac_in='$ac_file_inputs' +ac_out='"$tmp/out1"' +ac_nxt='"$tmp/out2"' + +while : do - # Write a limited-size here document to $tmp/defines.sed. - echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#define' lines. - echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + # Write a here document: + cat >>$CONFIG_STATUS <<_ACEOF + # First, check the format of the line: + cat >"\$tmp/defines.sed" <<\\CEOF +/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def +/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def +b +:def +_ACEOF + sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF - sed -f $tmp/defines.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS + ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in + sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail + grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done -rm -f conftest.defines -echo ' fi # egrep' >>$CONFIG_STATUS -echo >>$CONFIG_STATUS - -# Break up conftest.undefs because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #undef templates' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.undefs >/dev/null -do - # Write a limited-size here document to $tmp/undefs.sed. - echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#undef' - echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS - echo 'CEOF - sed -f $tmp/undefs.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail - rm -f conftest.undefs - mv conftest.tail conftest.undefs -done -rm -f conftest.undefs - +rm -f conftest.defines conftest.tail + +echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - echo "/* Generated by configure. */" >$tmp/config.h - else - echo "/* $ac_file. Generated by configure. */" >$tmp/config.h - fi - cat $tmp/in >>$tmp/config.h - rm -f $tmp/in if test x"$ac_file" != x-; then - if cmp -s $ac_file $tmp/config.h 2>/dev/null; then + echo "/* $configure_input */" >"$tmp/config.h" + cat "$ac_result" >>"$tmp/config.h" + if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { case "$ac_dir" in - [\\/]* | ?:[\\/]* ) as_incr_dir=;; - *) as_incr_dir=.;; -esac -as_dummy="$ac_dir" -for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do - case $as_mkdir_dir in - # Skip DOS drivespec - ?:) as_incr_dir=$as_mkdir_dir ;; - *) - as_incr_dir=$as_incr_dir/$as_mkdir_dir - test -d "$as_incr_dir" || - mkdir "$as_incr_dir" || - { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; } - ;; - esac -done; } - rm -f $ac_file - mv $tmp/config.h $ac_file + mv "$tmp/config.h" $ac_file fi else - cat $tmp/config.h - rm -f $tmp/config.h + echo "/* $configure_input */" + cat "$ac_result" fi -done -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF + rm -f "$tmp/out12" + ;; + + + esac + +done # for ac_tag + { (exit 0); exit 0; } _ACEOF @@ -5930,8 +7519,11 @@ # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null - $SHELL $CONFIG_STATUS || ac_cs_success=false + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. diff -r 46c261153aa4 -r fb59f9eeeecd configure.in --- a/configure.in Sun Apr 06 10:25:36 2008 +0000 +++ b/configure.in Mon Apr 07 06:59:45 2008 +0000 @@ -16,10 +16,11 @@ INCLUDES="-I." AC_PROG_CC +AC_PROG_CXX AC_CHECK_PROG(MAKE, gmake, gmake) if test x"$MAKE" = x; then - AC_CHECK_PROG(MAKE, make, make) + AC_CHECK_PROG(MAKE, make, make) fi AC_PROG_INSTALL @@ -31,22 +32,22 @@ AC_CHECK_HEADERS(unistd.h) AC_CHECK_HEADERS(sys/stat.h) -AC_CHECK_FUNCS(pipe, AC_DEFINE(HAVE_PIPE,1,Determine whether we have the pipe function)) +AC_CHECK_FUNCS(pipe, AC_DEFINE(HAVE_PIPE,1,Determine whether we have the pipe function)) AC_CHECK_FUNCS(connect) if test x"$ac_cv_func_connect" = x"no"; then - if test -z "$libsocket"; then - AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket",) - fi + if test -z "$libsocket"; then + AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket",) + fi - dnl this is for isc. need the nsl_s library as well. - if test -z "$libinet"; then - AC_CHECK_LIB(inet, socket, libnsl=1; LIBS="$LIBS -linet -lnsl_s",) - fi + dnl this is for isc. need the nsl_s library as well. + if test -z "$libinet"; then + AC_CHECK_LIB(inet, socket, libnsl=1; LIBS="$LIBS -linet -lnsl_s",) + fi - if test -z "$libnsl"; then - AC_CHECK_LIB(nsl, gethostname, LIBS="$LIBS -lnsl",) - fi + if test -z "$libnsl"; then + AC_CHECK_LIB(nsl, gethostname, LIBS="$LIBS -lnsl",) + fi fi AC_CHECK_LIB(sun, getpwnam, LIBS="$LIBS -lsun",) @@ -56,58 +57,64 @@ OPSYSTEM=`uname -s` if test $OPSYSTEM = "Darwin"; then - DW_SRC=mac - DW_DEFINE=__MAC__ - SHAREDFLAG=-dynamiclib - SOSUFFIX=dylib - LIBS="$LIBS -framework Carbon" + DW_SRC=mac + DW_DEFINE=__MAC__ + SHAREDFLAG=-dynamiclib + SOSUFFIX=dylib + LIBS="$LIBS -framework Carbon" else - AC_CHECK_PROG(PKG_CFG, pkg-config, pkg-config) - if test x"$PKG_CFG" != x; then - GTK_LIBS=`$PKG_CFG --silence-errors --libs gtk+-2.0 gthread-2.0` - MOZEMBED_LIBS=`$PKG_CFG --silence-errors --libs firefox-gtkmozembed` - MOZEMBED_CFLAGS=`$PKG_CFG --silence-errors --cflags firefox-gtkmozembed` - RPATH=`$PKG_CFG --silence-errors --libs-only-L firefox-gtkmozembed | cut -b 3-` - if test x"$MOZEMBED_LIBS" = x; then - MOZEMBED_LIBS=`$PKG_CFG --silence-errors --libs mozilla-gtkmozembed` - MOZEMBED_CFLAGS=`$PKG_CFG --silence-errors --cflags mozilla-gtkmozembed` - RPATH=`$PKG_CFG --silence-errors --libs-only-L mozilla-gtkmozembed | cut -b 3-` - fi - if test x"$RPATH" != x; then - RPATH="-Wl,-R$RPATH" - fi - fi + AC_CHECK_PROG(PKG_CFG, pkg-config, pkg-config) + if test x"$PKG_CFG" != x; then + GTK_LIBS=`$PKG_CFG --silence-errors --libs gtk+-2.0 gthread-2.0` + MOZEMBED_LIBS=`$PKG_CFG --silence-errors --libs firefox-gtkmozembed` + MOZEMBED_CFLAGS=`$PKG_CFG --silence-errors --cflags firefox-gtkmozembed` + RPATH=`$PKG_CFG --silence-errors --libs-only-L firefox-gtkmozembed | cut -b 3-` + if test x"$MOZEMBED_LIBS" = x; then + MOZEMBED_LIBS=`$PKG_CFG --silence-errors --libs mozilla-gtkmozembed` + MOZEMBED_CFLAGS=`$PKG_CFG --silence-errors --cflags mozilla-gtkmozembed` + RPATH=`$PKG_CFG --silence-errors --libs-only-L mozilla-gtkmozembed | cut -b 3-` + fi + if test x"$RPATH" != x; then + RPATH="-Wl,-R$RPATH" + fi + fi - if test x"$GTK_LIBS" = x; then - AM_PATH_GLIB(1.2.0,,AC_MSG_ERROR(AC_MSG_ERROR(Cannot find GLIB: Is glib-config in path?))) - AM_PATH_GTK(1.2.0,,AC_MSG_ERROR(AC_MSG_ERROR(Cannot find GTK: Is gtk-config in path?)), gthread) - AM_PATH_GDK_IMLIB(1.9.4, AC_DEFINE(USE_IMLIB), AC_MSG_ERROR(IMLIB not found or too old. Dynamic Windows cannot build without it.)) - else - GTK_CFLAGS=`$PKG_CFG --cflags gtk+-2.0 gthread-2.0` - GTK_LIBS=`$PKG_CFG --libs gtk+-2.0 gthread-2.0` - fi + if test x"$GTK_LIBS" = x; then + AM_PATH_GLIB(1.2.0,,AC_MSG_ERROR(AC_MSG_ERROR(Cannot find GLIB: Is glib-config in path?))) + AM_PATH_GTK(1.2.0,,AC_MSG_ERROR(AC_MSG_ERROR(Cannot find GTK: Is gtk-config in path?)), gthread) + AM_PATH_GDK_IMLIB(1.9.4, AC_DEFINE(USE_IMLIB), AC_MSG_ERROR(IMLIB not found or too old. Dynamic Windows cannot build without it.)) + else + GTK_CFLAGS=`$PKG_CFG --cflags gtk+-2.0 gthread-2.0` + GTK_LIBS=`$PKG_CFG --libs gtk+-2.0 gthread-2.0` + fi fi AC_CHECK_HEADER(pthread.h,,AC_MSG_ERROR([pthread header not found. Dynamic Windows cannot build without it.])) -AC_CHECK_LIB(pthread, pthread_attr_init, PTHREAD_LIBS="-lpthread", -AC_CHECK_LIB(pthreads, pthread_attr_init, PTHREAD_LIBS="-lpthreads", - AC_CHECK_LIB(c_r, pthread_attr_init, PTHREAD_LIBS="-lc_r", - AC_MSG_ERROR(pthread library not found. dwindows cannot build without it. - ) - ) - ) -) +AC_CHECK_LIB(pthread, + pthread_attr_init, + PTHREAD_LIBS="-lpthread", + AC_CHECK_LIB(pthreads, + pthread_attr_init, + PTHREAD_LIBS="-lpthreads", + AC_CHECK_LIB(c_r, + pthread_attr_init, + PTHREAD_LIBS="-lc_r", + AC_MSG_ERROR(pthread library not found. dwindows cannot build without it. + ) + ) + ) + ) CFLAGS="$CFLAGS $GTK_CFLAGS $GDK_IMLIB_FLAGS $MOZEMBED_CFLAGS" if test x"$MOZEMBED_LIBS" != x; then - SAVE_LIBS="$LIBS" - LIBS="$LIBS $GTK_LIBS $PTHREAD_LIBS $GDK_IMLIB_LIBS $MOZEMBED_LIBS" - AC_CHECK_LIB(gtkembedmoz,gtk_moz_embed_new,AC_DEFINE(USE_GTKMOZEMBED),) - LIBS="$SAVE_LIBS" + SAVE_LIBS="$LIBS" + LIBS="$RPATH $LIBS $GTK_LIBS $PTHREAD_LIBS $GDK_IMLIB_LIBS $MOZEMBED_LIBS" + AC_CHECK_LIB(gtkembedmoz,gtk_moz_embed_new,AC_DEFINE(USE_GTKMOZEMBED),) + LIBS="$SAVE_LIBS" fi -LIBS="$RPATH $LIBS $GTK_LIBS $PTHREAD_LIBS $GDK_IMLIB_LIBS" +LIBS="$RPATH $LIBS $GTK_LIBS $PTHREAD_LIBS $GDK_IMLIB_LIBS $MOZEMBED_LIBS" RM="rm -f" LN="ln -s" diff -r 46c261153aa4 -r fb59f9eeeecd gtk/browser.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gtk/browser.cpp Mon Apr 07 06:59:45 2008 +0000 @@ -0,0 +1,52 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#define MOZILLA_INTERNAL_API + +#include +#include +#include +#include "nsIDOMMouseEvent.h" + +/** + * Takes a pointer to a mouse event and returns the mouse + * button number or -1 on error. + */ +extern "C" gint mozilla_get_mouse_event_button(gpointer event) +{ + gint button = 0; + glong x,y; + + g_return_val_if_fail (event, -1); + + /* the following lines were found in the Galeon source */ + nsIDOMMouseEvent *aMouseEvent = (nsIDOMMouseEvent *) event; + aMouseEvent->GetButton ((PRUint16 *) &button); + aMouseEvent->GetClientX ((PRInt32 *) &x); + aMouseEvent->GetClientY ((PRInt32 *) &y); + + + /* for some reason we get different numbers on PPC, this fixes + * that up... -- MattA */ + if (button == 65536) + { + button = 1; + } + else if (button == 131072) + { + button = 2; + } + + return button; +} +extern "C" gint mozilla_get_mouse_location( gpointer event, glong *x, glong *y) +{ + g_return_val_if_fail (event, -1); + + /* the following lines were found in the Galeon source */ + nsIDOMMouseEvent *aMouseEvent = (nsIDOMMouseEvent *) event; + aMouseEvent->GetClientX ((PRInt32 *) x); + aMouseEvent->GetClientY ((PRInt32 *) y); + return 0; +} diff -r 46c261153aa4 -r fb59f9eeeecd gtk/dw.c --- a/gtk/dw.c Sun Apr 06 10:25:36 2008 +0000 +++ b/gtk/dw.c Mon Apr 07 06:59:45 2008 +0000 @@ -43,6 +43,11 @@ #include "gtk/messagebox_information.xpm" #include "gtk/messagebox_question.xpm" +#ifdef USE_GTKMOZEMBED +extern gint mozilla_get_mouse_event_button(gpointer event); +extern gint mozilla_get_mouse_location( gpointer event, glong *x, glong *y); +#endif + /* These are used for resource management */ #if defined(DW_RESOURCES) && !defined(BUILD_DLL) extern DWResources _resources; @@ -50,22 +55,22 @@ GdkColor _colors[] = { - { 0, 0x0000, 0x0000, 0x0000 }, /* 0 black */ - { 0, 0xbbbb, 0x0000, 0x0000 }, /* 1 red */ - { 0, 0x0000, 0xbbbb, 0x0000 }, /* 2 green */ - { 0, 0xaaaa, 0xaaaa, 0x0000 }, /* 3 yellow */ - { 0, 0x0000, 0x0000, 0xcccc }, /* 4 blue */ - { 0, 0xbbbb, 0x0000, 0xbbbb }, /* 5 magenta */ - { 0, 0x0000, 0xbbbb, 0xbbbb }, /* 6 cyan */ - { 0, 0xbbbb, 0xbbbb, 0xbbbb }, /* 7 white */ - { 0, 0x7777, 0x7777, 0x7777 }, /* 8 grey */ - { 0, 0xffff, 0x0000, 0x0000 }, /* 9 bright red */ - { 0, 0x0000, 0xffff, 0x0000 }, /* 10 bright green */ - { 0, 0xeeee, 0xeeee, 0x0000 }, /* 11 bright yellow */ - { 0, 0x0000, 0x0000, 0xffff }, /* 12 bright blue */ - { 0, 0xffff, 0x0000, 0xffff }, /* 13 bright magenta */ - { 0, 0x0000, 0xeeee, 0xeeee }, /* 14 bright cyan */ - { 0, 0xffff, 0xffff, 0xffff }, /* 15 bright white */ + { 0, 0x0000, 0x0000, 0x0000 }, /* 0 black */ + { 0, 0xbbbb, 0x0000, 0x0000 }, /* 1 red */ + { 0, 0x0000, 0xbbbb, 0x0000 }, /* 2 green */ + { 0, 0xaaaa, 0xaaaa, 0x0000 }, /* 3 yellow */ + { 0, 0x0000, 0x0000, 0xcccc }, /* 4 blue */ + { 0, 0xbbbb, 0x0000, 0xbbbb }, /* 5 magenta */ + { 0, 0x0000, 0xbbbb, 0xbbbb }, /* 6 cyan */ + { 0, 0xbbbb, 0xbbbb, 0xbbbb }, /* 7 white */ + { 0, 0x7777, 0x7777, 0x7777 }, /* 8 grey */ + { 0, 0xffff, 0x0000, 0x0000 }, /* 9 bright red */ + { 0, 0x0000, 0xffff, 0x0000 }, /* 10 bright green */ + { 0, 0xeeee, 0xeeee, 0x0000 }, /* 11 bright yellow */ + { 0, 0x0000, 0x0000, 0xffff }, /* 12 bright blue */ + { 0, 0xffff, 0x0000, 0xffff }, /* 13 bright magenta */ + { 0, 0x0000, 0xeeee, 0xeeee }, /* 14 bright cyan */ + { 0, 0xffff, 0xffff, 0xffff }, /* 15 bright white */ }; #define NUM_EXTS 5 @@ -148,16 +153,18 @@ void (*_gtk_moz_embed_render_data)(GtkMozEmbed *, const char *, guint32, const char *, const char *) = NULL; GtkWidget *(*_gtk_moz_embed_new)(void) = NULL; GtkType (*_dw_moz_embed_get_type)(void) = NULL; +gboolean (*_gtk_moz_embed_can_go_back)(GtkMozEmbed *) = NULL; +gboolean (*_gtk_moz_embed_can_go_forward)(GtkMozEmbed *) = NULL; #endif typedef struct { - GdkPixmap *pixmap; - GdkBitmap *mask; - int used; - unsigned long width, height; -#if GTK_MAJOR_VERSION > 1 - GdkPixbuf *pixbuf; + GdkPixmap *pixmap; + GdkBitmap *mask; + int used; + unsigned long width, height; +#if GTK_MAJOR_VERSION > 1 + GdkPixbuf *pixbuf; #endif } DWPrivatePixmap; @@ -166,18 +173,18 @@ typedef struct { - void *func; - char name[30]; + void *func; + char name[30]; } SignalList; typedef struct { - HWND window; - void *func; - gpointer data; - gint cid; - void *intfunc; + HWND window; + void *func; + gpointer data; + gint cid; + void *intfunc; } SignalHandler; @@ -185,25 +192,25 @@ /* A list of signal forwarders, to account for paramater differences. */ static SignalList SignalTranslate[SIGNALMAX] = { - { _configure_event, DW_SIGNAL_CONFIGURE }, - { _key_press_event, DW_SIGNAL_KEY_PRESS }, - { _button_press_event, DW_SIGNAL_BUTTON_PRESS }, - { _button_release_event, DW_SIGNAL_BUTTON_RELEASE }, - { _motion_notify_event, DW_SIGNAL_MOTION_NOTIFY }, - { _delete_event, DW_SIGNAL_DELETE }, - { _expose_event, DW_SIGNAL_EXPOSE }, - { _activate_event, "activate" }, - { _generic_event, DW_SIGNAL_CLICKED }, - { _container_select_event, DW_SIGNAL_ITEM_ENTER }, - { _container_context_event, DW_SIGNAL_ITEM_CONTEXT }, - { _tree_context_event, "tree-context" }, - { _item_select_event, DW_SIGNAL_LIST_SELECT }, - { _tree_select_event, DW_SIGNAL_ITEM_SELECT }, - { _set_focus_event, DW_SIGNAL_SET_FOCUS }, - { _value_changed_event, DW_SIGNAL_VALUE_CHANGED }, - { _switch_page_event, DW_SIGNAL_SWITCH_PAGE }, - { _column_click_event, DW_SIGNAL_COLUMN_CLICK }, - { _tree_expand_event, DW_SIGNAL_TREE_EXPAND } + { _configure_event, DW_SIGNAL_CONFIGURE }, + { _key_press_event, DW_SIGNAL_KEY_PRESS }, + { _button_press_event, DW_SIGNAL_BUTTON_PRESS }, + { _button_release_event, DW_SIGNAL_BUTTON_RELEASE }, + { _motion_notify_event, DW_SIGNAL_MOTION_NOTIFY }, + { _delete_event, DW_SIGNAL_DELETE }, + { _expose_event, DW_SIGNAL_EXPOSE }, + { _activate_event, "activate" }, + { _generic_event, DW_SIGNAL_CLICKED }, + { _container_select_event, DW_SIGNAL_ITEM_ENTER }, + { _container_context_event, DW_SIGNAL_ITEM_CONTEXT }, + { _tree_context_event, "tree-context" }, + { _item_select_event, DW_SIGNAL_LIST_SELECT }, + { _tree_select_event, DW_SIGNAL_ITEM_SELECT }, + { _set_focus_event, DW_SIGNAL_SET_FOCUS }, + { _value_changed_event, DW_SIGNAL_VALUE_CHANGED }, + { _switch_page_event, DW_SIGNAL_SWITCH_PAGE }, + { _column_click_event, DW_SIGNAL_COLUMN_CLICK }, + { _tree_expand_event, DW_SIGNAL_TREE_EXPAND } }; /* Alignment flags */ @@ -224,25 +231,25 @@ enum _GtkMdiChildState { - CHILD_NORMAL, - CHILD_MAXIMIZED, - CHILD_ICONIFIED + CHILD_NORMAL, + CHILD_MAXIMIZED, + CHILD_ICONIFIED }; struct _GtkMdi { - GtkContainer container; - GList *children; - - GdkPoint drag_start; - gint drag_button; + GtkContainer container; + GList *children; + + GdkPoint drag_start; + gint drag_button; }; struct _GtkMdiClass { - GtkContainerClass parent_class; - - void (*mdi) (GtkMdi * mdi); + GtkContainerClass parent_class; + + void (*mdi) (GtkMdi * mdi); }; #include "gtk/maximize.xpm" @@ -261,17 +268,17 @@ struct _GtkMdiChild { - GtkWidget *widget; - - GtkWidget *child; - GtkMdi *mdi; - - gint x; - gint y; + GtkWidget *widget; + + GtkWidget *child; + GtkMdi *mdi; + + gint x; + gint y; gint width; - gint height; - - GtkMdiChildState state; + gint height; + + GtkMdiChildState state; }; static void gtk_mdi_class_init(GtkMdiClass *klass); @@ -297,28 +304,28 @@ static GtkType gtk_mdi_get_type(void) { - static GType mdi_type = 0; - - if (!mdi_type) - { - - static const GTypeInfo mdi_info = - { - sizeof (GtkMdiClass), - NULL, - NULL, - (GClassInitFunc) gtk_mdi_class_init, - NULL, - NULL, - sizeof (GtkMdi), - 0, - (GInstanceInitFunc) gtk_mdi_init, - }; - - mdi_type = g_type_register_static (GTK_TYPE_CONTAINER, "GtkMdi", &mdi_info, 0); - } - - return mdi_type; + static GType mdi_type = 0; + + if (!mdi_type) + { + + static const GTypeInfo mdi_info = + { + sizeof (GtkMdiClass), + NULL, + NULL, + (GClassInitFunc) gtk_mdi_class_init, + NULL, + NULL, + sizeof (GtkMdi), + 0, + (GInstanceInitFunc) gtk_mdi_init, + }; + + mdi_type = g_type_register_static (GTK_TYPE_CONTAINER, "GtkMdi", &mdi_info, 0); + } + + return mdi_type; } /* Local data */ @@ -326,1498 +333,1498 @@ static void gtk_mdi_class_init(GtkMdiClass *class) { - GObjectClass *object_class; - GtkWidgetClass *widget_class; - GtkContainerClass *container_class; - - object_class = (GObjectClass *) class; - widget_class = (GtkWidgetClass *) class; - container_class = (GtkContainerClass *) class; - - parent_class = gtk_type_class (GTK_TYPE_CONTAINER); - - widget_class->realize = gtk_mdi_realize; - widget_class->expose_event = gtk_mdi_expose; - widget_class->size_request = gtk_mdi_size_request; - widget_class->size_allocate = gtk_mdi_size_allocate; - - container_class->add = gtk_mdi_add; - container_class->remove = gtk_mdi_remove_true; - container_class->forall = gtk_mdi_forall; - class->mdi = NULL; + GObjectClass *object_class; + GtkWidgetClass *widget_class; + GtkContainerClass *container_class; + + object_class = (GObjectClass *) class; + widget_class = (GtkWidgetClass *) class; + container_class = (GtkContainerClass *) class; + + parent_class = gtk_type_class (GTK_TYPE_CONTAINER); + + widget_class->realize = gtk_mdi_realize; + widget_class->expose_event = gtk_mdi_expose; + widget_class->size_request = gtk_mdi_size_request; + widget_class->size_allocate = gtk_mdi_size_allocate; + + container_class->add = gtk_mdi_add; + container_class->remove = gtk_mdi_remove_true; + container_class->forall = gtk_mdi_forall; + class->mdi = NULL; } static void gtk_mdi_init(GtkMdi *mdi) { - mdi->drag_button = -1; - mdi->children = NULL; + mdi->drag_button = -1; + mdi->children = NULL; } static GtkWidget *gtk_mdi_new(void) { - GtkWidget *mdi; - GdkColor background; - - mdi = GTK_WIDGET (g_object_new (gtk_mdi_get_type (), NULL)); - gdk_color_parse (GTK_MDI_BACKGROUND, &background); - gtk_widget_modify_bg (mdi, GTK_STATE_NORMAL, &background); - - return mdi; + GtkWidget *mdi; + GdkColor background; + + mdi = GTK_WIDGET (g_object_new (gtk_mdi_get_type (), NULL)); + gdk_color_parse (GTK_MDI_BACKGROUND, &background); + gtk_widget_modify_bg (mdi, GTK_STATE_NORMAL, &background); + + return mdi; } static void gtk_mdi_put(GtkMdi *mdi, GtkWidget *child_widget, gint x, gint y, GtkWidget *label) { - GtkMdiChild *child; - - GtkWidget *table; - GtkWidget *button[3]; - - GtkWidget *child_box; - GtkWidget *top_event_box; - GtkWidget *bottom_event_box; - GtkWidget *child_widget_box; - GtkWidget *image; - - GdkColor color; - gint i, j; - GdkCursor *cursor; - GdkColormap *colormap; - GdkPixmap *pixmap; - GdkBitmap *mask; - GtkStyle *style; - - child_box = gtk_event_box_new (); - child_widget_box = gtk_event_box_new (); - top_event_box = gtk_event_box_new (); - bottom_event_box = gtk_event_box_new (); - table = gtk_table_new (4, 7, FALSE); - gtk_table_set_row_spacings (GTK_TABLE (table), 1); - gtk_table_set_col_spacings (GTK_TABLE (table), 1); - gtk_table_set_row_spacing (GTK_TABLE (table), 3, 0); - gtk_table_set_col_spacing (GTK_TABLE (table), 6, 0); - gtk_table_set_row_spacing (GTK_TABLE (table), 2, 0); - gtk_table_set_col_spacing (GTK_TABLE (table), 5, 0); - - for (i = 0; i < 3; i++) - { - button[i] = gtk_event_box_new (); - gtk_widget_set_events (button[0], GDK_BUTTON_PRESS_MASK); - } - - gdk_color_parse (GTK_MDI_LABEL_BACKGROUND, &color); - - gtk_widget_modify_bg (top_event_box, GTK_STATE_NORMAL, &color); - gtk_widget_modify_bg (bottom_event_box, GTK_STATE_NORMAL, &color); - gtk_widget_modify_bg (child_box, GTK_STATE_NORMAL, &color); - for (i = GTK_STATE_NORMAL; i < GTK_STATE_ACTIVE; i++) - { - for (j = 0; j < 3; j++) - { - gtk_widget_modify_bg (button[j], i, &color); - } - } - gdk_color_parse (GTK_MDI_LABEL_FOREGROUND, &color); - gtk_widget_modify_fg (label, GTK_STATE_NORMAL, &color); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - - gtk_container_add (GTK_CONTAINER (top_event_box), label); - gtk_container_add (GTK_CONTAINER (child_widget_box), child_widget); - gtk_widget_set_size_request (bottom_event_box, 2, 2); - - - style = gtk_widget_get_default_style (); - colormap = gdk_colormap_get_system (); - pixmap = gdk_pixmap_colormap_create_from_xpm_d (NULL, colormap, &mask, - &style->bg[GTK_STATE_NORMAL], - (gchar **) minimize_xpm); - image = gtk_image_new_from_pixmap (pixmap, mask); - gtk_widget_show(image); - gtk_container_add (GTK_CONTAINER (button[0]), image); - pixmap = gdk_pixmap_colormap_create_from_xpm_d (GTK_WIDGET (mdi)->window, colormap, &mask, - &style->bg[GTK_STATE_NORMAL], - (gchar **) maximize_xpm); - image = gtk_image_new_from_pixmap (pixmap, mask); - gtk_widget_show(image); - gtk_container_add (GTK_CONTAINER (button[1]), image); - pixmap = gdk_pixmap_colormap_create_from_xpm_d (GTK_WIDGET (mdi)->window, colormap, &mask, - &style->bg[GTK_STATE_NORMAL], - (gchar **) kill_xpm); - image = gtk_image_new_from_pixmap (pixmap, mask); - gtk_widget_show(image); - gtk_container_add (GTK_CONTAINER (button[2]), image); - - gtk_table_attach (GTK_TABLE (table), child_widget_box, 1, 6, 2, 3, - GTK_EXPAND | GTK_SHRINK | GTK_FILL, - GTK_EXPAND | GTK_SHRINK | GTK_FILL, - 0, 0); - gtk_table_attach (GTK_TABLE (table), top_event_box, 1, 2, 1, 2, - GTK_FILL | GTK_EXPAND | GTK_SHRINK, - 0, - 0, 0); - gtk_table_attach (GTK_TABLE (table), bottom_event_box, 6, 7, 3, 4, - 0, - 0, - 0, 0); - gtk_table_attach (GTK_TABLE (table), button[0], 2, 3, 1, 2, - 0, - 0, - 0, 0); - gtk_table_attach (GTK_TABLE (table), button[1], 3, 4, 1, 2, - 0, - 0, - 0, 0); - gtk_table_attach (GTK_TABLE (table), button[2], 4, 5, 1, 2, - 0, - 0, - 0, 0); - - gtk_container_add (GTK_CONTAINER (child_box), table); - - child = g_new (GtkMdiChild, 1); - child->widget = child_box; - child->x = x; - child->y = y; - child->width = -1; - child->height = -1; - child->child = child_widget; - child->mdi = mdi; - child->state = CHILD_NORMAL; - - gtk_widget_set_parent (child_box, GTK_WIDGET (mdi)); - mdi->children = g_list_append (mdi->children, child); - - gtk_widget_show (child_box); - gtk_widget_show (table); - gtk_widget_show (top_event_box); - gtk_widget_show (bottom_event_box); - gtk_widget_show (child_widget_box); - for (i = 0; i < 3; i++) - { - gtk_widget_show (button[i]); - } - - cursor = gdk_cursor_new (GDK_HAND1); - gtk_widget_realize (top_event_box); - gdk_window_set_cursor (top_event_box->window, cursor); - cursor = gdk_cursor_new (GDK_BOTTOM_RIGHT_CORNER); - gtk_widget_realize (bottom_event_box); - gdk_window_set_cursor (bottom_event_box->window, cursor); - - g_signal_connect (G_OBJECT (top_event_box), "event", - G_CALLBACK (move_child_callback), - child); - g_signal_connect (G_OBJECT (bottom_event_box), "event", - G_CALLBACK (resize_child_callback), - child); - g_signal_connect (G_OBJECT (button[0]), "button_press_event", - G_CALLBACK (iconify_child_callback), - child); - g_signal_connect (G_OBJECT (button[1]), "button_press_event", - G_CALLBACK (maximize_child_callback), - child); - g_signal_connect (G_OBJECT (button[2]), "button_press_event", - G_CALLBACK (kill_child_callback), - child); + GtkMdiChild *child; + + GtkWidget *table; + GtkWidget *button[3]; + + GtkWidget *child_box; + GtkWidget *top_event_box; + GtkWidget *bottom_event_box; + GtkWidget *child_widget_box; + GtkWidget *image; + + GdkColor color; + gint i, j; + GdkCursor *cursor; + GdkColormap *colormap; + GdkPixmap *pixmap; + GdkBitmap *mask; + GtkStyle *style; + + child_box = gtk_event_box_new (); + child_widget_box = gtk_event_box_new (); + top_event_box = gtk_event_box_new (); + bottom_event_box = gtk_event_box_new (); + table = gtk_table_new (4, 7, FALSE); + gtk_table_set_row_spacings (GTK_TABLE (table), 1); + gtk_table_set_col_spacings (GTK_TABLE (table), 1); + gtk_table_set_row_spacing (GTK_TABLE (table), 3, 0); + gtk_table_set_col_spacing (GTK_TABLE (table), 6, 0); + gtk_table_set_row_spacing (GTK_TABLE (table), 2, 0); + gtk_table_set_col_spacing (GTK_TABLE (table), 5, 0); + + for (i = 0; i < 3; i++) + { + button[i] = gtk_event_box_new (); + gtk_widget_set_events (button[0], GDK_BUTTON_PRESS_MASK); + } + + gdk_color_parse (GTK_MDI_LABEL_BACKGROUND, &color); + + gtk_widget_modify_bg (top_event_box, GTK_STATE_NORMAL, &color); + gtk_widget_modify_bg (bottom_event_box, GTK_STATE_NORMAL, &color); + gtk_widget_modify_bg (child_box, GTK_STATE_NORMAL, &color); + for (i = GTK_STATE_NORMAL; i < GTK_STATE_ACTIVE; i++) + { + for (j = 0; j < 3; j++) + { + gtk_widget_modify_bg (button[j], i, &color); + } + } + gdk_color_parse (GTK_MDI_LABEL_FOREGROUND, &color); + gtk_widget_modify_fg (label, GTK_STATE_NORMAL, &color); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + + gtk_container_add (GTK_CONTAINER (top_event_box), label); + gtk_container_add (GTK_CONTAINER (child_widget_box), child_widget); + gtk_widget_set_size_request (bottom_event_box, 2, 2); + + + style = gtk_widget_get_default_style (); + colormap = gdk_colormap_get_system (); + pixmap = gdk_pixmap_colormap_create_from_xpm_d (NULL, colormap, &mask, + &style->bg[GTK_STATE_NORMAL], + (gchar **) minimize_xpm); + image = gtk_image_new_from_pixmap (pixmap, mask); + gtk_widget_show(image); + gtk_container_add (GTK_CONTAINER (button[0]), image); + pixmap = gdk_pixmap_colormap_create_from_xpm_d (GTK_WIDGET (mdi)->window, colormap, &mask, + &style->bg[GTK_STATE_NORMAL], + (gchar **) maximize_xpm); + image = gtk_image_new_from_pixmap (pixmap, mask); + gtk_widget_show(image); + gtk_container_add (GTK_CONTAINER (button[1]), image); + pixmap = gdk_pixmap_colormap_create_from_xpm_d (GTK_WIDGET (mdi)->window, colormap, &mask, + &style->bg[GTK_STATE_NORMAL], + (gchar **) kill_xpm); + image = gtk_image_new_from_pixmap (pixmap, mask); + gtk_widget_show(image); + gtk_container_add (GTK_CONTAINER (button[2]), image); + + gtk_table_attach (GTK_TABLE (table), child_widget_box, 1, 6, 2, 3, + GTK_EXPAND | GTK_SHRINK | GTK_FILL, + GTK_EXPAND | GTK_SHRINK | GTK_FILL, + 0, 0); + gtk_table_attach (GTK_TABLE (table), top_event_box, 1, 2, 1, 2, + GTK_FILL | GTK_EXPAND | GTK_SHRINK, + 0, + 0, 0); + gtk_table_attach (GTK_TABLE (table), bottom_event_box, 6, 7, 3, 4, + 0, + 0, + 0, 0); + gtk_table_attach (GTK_TABLE (table), button[0], 2, 3, 1, 2, + 0, + 0, + 0, 0); + gtk_table_attach (GTK_TABLE (table), button[1], 3, 4, 1, 2, + 0, + 0, + 0, 0); + gtk_table_attach (GTK_TABLE (table), button[2], 4, 5, 1, 2, + 0, + 0, + 0, 0); + + gtk_container_add (GTK_CONTAINER (child_box), table); + + child = g_new (GtkMdiChild, 1); + child->widget = child_box; + child->x = x; + child->y = y; + child->width = -1; + child->height = -1; + child->child = child_widget; + child->mdi = mdi; + child->state = CHILD_NORMAL; + + gtk_widget_set_parent (child_box, GTK_WIDGET (mdi)); + mdi->children = g_list_append (mdi->children, child); + + gtk_widget_show (child_box); + gtk_widget_show (table); + gtk_widget_show (top_event_box); + gtk_widget_show (bottom_event_box); + gtk_widget_show (child_widget_box); + for (i = 0; i < 3; i++) + { + gtk_widget_show (button[i]); + } + + cursor = gdk_cursor_new (GDK_HAND1); + gtk_widget_realize (top_event_box); + gdk_window_set_cursor (top_event_box->window, cursor); + cursor = gdk_cursor_new (GDK_BOTTOM_RIGHT_CORNER); + gtk_widget_realize (bottom_event_box); + gdk_window_set_cursor (bottom_event_box->window, cursor); + + g_signal_connect (G_OBJECT (top_event_box), "event", + G_CALLBACK (move_child_callback), + child); + g_signal_connect (G_OBJECT (bottom_event_box), "event", + G_CALLBACK (resize_child_callback), + child); + g_signal_connect (G_OBJECT (button[0]), "button_press_event", + G_CALLBACK (iconify_child_callback), + child); + g_signal_connect (G_OBJECT (button[1]), "button_press_event", + G_CALLBACK (maximize_child_callback), + child); + g_signal_connect (G_OBJECT (button[2]), "button_press_event", + G_CALLBACK (kill_child_callback), + child); } static void gtk_mdi_move(GtkMdi *mdi, GtkWidget *widget, gint x, gint y) { - GtkMdiChild *child; - - g_return_if_fail (GTK_IS_MDI (mdi)); - g_return_if_fail (GTK_IS_WIDGET (widget)); - - child = get_child (mdi, widget); - g_return_if_fail (child); - - child->x = x; - child->y = y; - if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (mdi)) - gtk_widget_queue_resize (GTK_WIDGET (widget)); + GtkMdiChild *child; + + g_return_if_fail (GTK_IS_MDI (mdi)); + g_return_if_fail (GTK_IS_WIDGET (widget)); + + child = get_child (mdi, widget); + g_return_if_fail (child); + + child->x = x; + child->y = y; + if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (mdi)) + gtk_widget_queue_resize (GTK_WIDGET (widget)); } static void gtk_mdi_get_pos(GtkMdi *mdi, GtkWidget *widget, gint *x, gint *y) { - GtkMdiChild *child; - - g_return_if_fail (GTK_IS_MDI (mdi)); - g_return_if_fail (GTK_IS_WIDGET (widget)); - - child = get_child (mdi, widget); - g_return_if_fail (child); - - *x = child->x; - *y = child->y; + GtkMdiChild *child; + + g_return_if_fail (GTK_IS_MDI (mdi)); + g_return_if_fail (GTK_IS_WIDGET (widget)); + + child = get_child (mdi, widget); + g_return_if_fail (child); + + *x = child->x; + *y = child->y; } static void gtk_mdi_tile(GtkMdi *mdi) { - int i, n; - int width, height; - GList *children; - GtkMdiChild *child; - - g_return_if_fail (GTK_IS_MDI (mdi)); - - children = mdi->children; - n = g_list_length (children); - width = GTK_WIDGET (mdi)->allocation.width; - height = GTK_WIDGET (mdi)->allocation.height / n; - for (i = 0; i < n; i++) - { - child = (GtkMdiChild *) children->data; - children = children->next; - child->x = 0; - child->y = i * height; - gtk_widget_set_size_request (child->widget, width, height); - child->state = CHILD_NORMAL; - child->width = -1; - child->height = -1; - } - if (GTK_WIDGET_VISIBLE (GTK_WIDGET (mdi))) - gtk_widget_queue_resize (GTK_WIDGET (mdi)); - return; + int i, n; + int width, height; + GList *children; + GtkMdiChild *child; + + g_return_if_fail (GTK_IS_MDI (mdi)); + + children = mdi->children; + n = g_list_length (children); + width = GTK_WIDGET (mdi)->allocation.width; + height = GTK_WIDGET (mdi)->allocation.height / n; + for (i = 0; i < n; i++) + { + child = (GtkMdiChild *) children->data; + children = children->next; + child->x = 0; + child->y = i * height; + gtk_widget_set_size_request (child->widget, width, height); + child->state = CHILD_NORMAL; + child->width = -1; + child->height = -1; + } + if (GTK_WIDGET_VISIBLE (GTK_WIDGET (mdi))) + gtk_widget_queue_resize (GTK_WIDGET (mdi)); + return; } static void gtk_mdi_cascade(GtkMdi *mdi) { - int i, n; - int width, height; - GList *children; - GtkMdiChild *child; - - g_return_if_fail (GTK_IS_MDI (mdi)); - if (!GTK_WIDGET_VISIBLE (GTK_WIDGET (mdi))) - return; - - children = mdi->children; - n = g_list_length (children); - width = GTK_WIDGET (mdi)->allocation.width / (2 * n - 1); - height = GTK_WIDGET (mdi)->allocation.height / (2 * n - 1); - for (i = 0; i < n; i++) - { - child = (GtkMdiChild *) children->data; - children = children->next; - child->x = i * width; - child->y = i * height; - gtk_widget_set_size_request (child->widget, width * n, height * n); - child->state = CHILD_NORMAL; - child->width = -1; - child->height = -1; - } - if (GTK_WIDGET_VISIBLE (GTK_WIDGET (mdi))) - gtk_widget_queue_resize (GTK_WIDGET (mdi)); - return; + int i, n; + int width, height; + GList *children; + GtkMdiChild *child; + + g_return_if_fail (GTK_IS_MDI (mdi)); + if (!GTK_WIDGET_VISIBLE (GTK_WIDGET (mdi))) + return; + + children = mdi->children; + n = g_list_length (children); + width = GTK_WIDGET (mdi)->allocation.width / (2 * n - 1); + height = GTK_WIDGET (mdi)->allocation.height / (2 * n - 1); + for (i = 0; i < n; i++) + { + child = (GtkMdiChild *) children->data; + children = children->next; + child->x = i * width; + child->y = i * height; + gtk_widget_set_size_request (child->widget, width * n, height * n); + child->state = CHILD_NORMAL; + child->width = -1; + child->height = -1; + } + if (GTK_WIDGET_VISIBLE (GTK_WIDGET (mdi))) + gtk_widget_queue_resize (GTK_WIDGET (mdi)); + return; } static GtkMdiChildState gtk_mdi_get_state(GtkMdi *mdi, GtkWidget *widget) { - GtkMdiChild *child; - - g_return_val_if_fail (GTK_IS_MDI (mdi), CHILD_NORMAL); - g_return_val_if_fail (GTK_IS_WIDGET (widget), CHILD_NORMAL); - - child = get_child (mdi, widget); - g_return_val_if_fail (child, CHILD_NORMAL); - - return child->state; + GtkMdiChild *child; + + g_return_val_if_fail (GTK_IS_MDI (mdi), CHILD_NORMAL); + g_return_val_if_fail (GTK_IS_WIDGET (widget), CHILD_NORMAL); + + child = get_child (mdi, widget); + g_return_val_if_fail (child, CHILD_NORMAL); + + return child->state; } static void gtk_mdi_set_state(GtkMdi *mdi, GtkWidget *widget, GtkMdiChildState state) { - GtkMdiChild *child; - - g_return_if_fail (GTK_IS_MDI (mdi)); - g_return_if_fail (GTK_IS_WIDGET (widget)); - - child = get_child (mdi, widget); - g_return_if_fail (child); - - child->state = state; - if (GTK_WIDGET_VISIBLE (child->widget) && GTK_WIDGET_VISIBLE (mdi)) - gtk_widget_queue_resize (GTK_WIDGET (child->widget)); + GtkMdiChild *child; + + g_return_if_fail (GTK_IS_MDI (mdi)); + g_return_if_fail (GTK_IS_WIDGET (widget)); + + child = get_child (mdi, widget); + g_return_if_fail (child); + + child->state = state; + if (GTK_WIDGET_VISIBLE (child->widget) && GTK_WIDGET_VISIBLE (mdi)) + gtk_widget_queue_resize (GTK_WIDGET (child->widget)); } static void gtk_mdi_remove(GtkMdi *mdi, GtkWidget *widget) { - GtkMdiChild *child; - - g_return_if_fail (GTK_IS_MDI (mdi)); - child = get_child (mdi, widget); - g_return_if_fail (child); - gtk_mdi_remove_true (GTK_CONTAINER (mdi), child->widget); + GtkMdiChild *child; + + g_return_if_fail (GTK_IS_MDI (mdi)); + child = get_child (mdi, widget); + g_return_if_fail (child); + gtk_mdi_remove_true (GTK_CONTAINER (mdi), child->widget); } static void gtk_mdi_realize(GtkWidget *widget) { - GtkMdi *mdi; - GdkWindowAttr attributes; - gint attributes_mask; - - mdi = GTK_MDI (widget); - - g_return_if_fail (widget != NULL); - g_return_if_fail (GTK_IS_MDI (mdi)); - - GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED); - - attributes.x = widget->allocation.x; - attributes.y = widget->allocation.y; - attributes.width = widget->allocation.width; - attributes.height = widget->allocation.height; - attributes.wclass = GDK_INPUT_OUTPUT; - attributes.window_type = GDK_WINDOW_CHILD; - attributes.event_mask = gtk_widget_get_events (widget) | - GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | - GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | - GDK_POINTER_MOTION_HINT_MASK; - attributes.visual = gtk_widget_get_visual (widget); - attributes.colormap = gtk_widget_get_colormap (widget); - - attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP; - widget->window = gdk_window_new (widget->parent->window, &attributes, attributes_mask); - - widget->style = gtk_style_attach (widget->style, widget->window); - - gdk_window_set_user_data (widget->window, widget); - - gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL); + GtkMdi *mdi; + GdkWindowAttr attributes; + gint attributes_mask; + + mdi = GTK_MDI (widget); + + g_return_if_fail (widget != NULL); + g_return_if_fail (GTK_IS_MDI (mdi)); + + GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED); + + attributes.x = widget->allocation.x; + attributes.y = widget->allocation.y; + attributes.width = widget->allocation.width; + attributes.height = widget->allocation.height; + attributes.wclass = GDK_INPUT_OUTPUT; + attributes.window_type = GDK_WINDOW_CHILD; + attributes.event_mask = gtk_widget_get_events (widget) | + GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | + GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | + GDK_POINTER_MOTION_HINT_MASK; + attributes.visual = gtk_widget_get_visual (widget); + attributes.colormap = gtk_widget_get_colormap (widget); + + attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP; + widget->window = gdk_window_new (widget->parent->window, &attributes, attributes_mask); + + widget->style = gtk_style_attach (widget->style, widget->window); + + gdk_window_set_user_data (widget->window, widget); + + gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL); } static void gtk_mdi_size_request (GtkWidget *widget, GtkRequisition *requisition) { - GtkMdi *mdi; - GtkMdiChild *child; - GList *children; - GtkRequisition child_requisition; - - mdi = GTK_MDI (widget); - requisition->width = GTK_MDI_DEFAULT_WIDTH; - requisition->height = GTK_MDI_DEFAULT_HEIGHT; - - children = mdi->children; - while (children) - { - child = children->data; - children = children->next; - - if (GTK_WIDGET_VISIBLE (child->widget)) - { - gtk_widget_size_request (child->widget, &child_requisition); - } - } + GtkMdi *mdi; + GtkMdiChild *child; + GList *children; + GtkRequisition child_requisition; + + mdi = GTK_MDI (widget); + requisition->width = GTK_MDI_DEFAULT_WIDTH; + requisition->height = GTK_MDI_DEFAULT_HEIGHT; + + children = mdi->children; + while (children) + { + child = children->data; + children = children->next; + + if (GTK_WIDGET_VISIBLE (child->widget)) + { + gtk_widget_size_request (child->widget, &child_requisition); + } + } } static void gtk_mdi_size_allocate(GtkWidget *widget, GtkAllocation *allocation) { - GtkMdi *mdi; - GtkMdiChild *child; - GtkAllocation child_allocation; - GtkRequisition child_requisition; - GList *children; - - mdi = GTK_MDI (widget); - - widget->allocation = *allocation; - - if (GTK_WIDGET_REALIZED (widget)) - gdk_window_move_resize (widget->window, - allocation->x, - allocation->y, - allocation->width, - allocation->height); - - - children = mdi->children; - while (children) - { - child = children->data; - children = children->next; - - if (GTK_WIDGET_VISIBLE (child->widget)) - { - gtk_widget_get_child_requisition (child->widget, &child_requisition); - child_allocation.x = 0; - child_allocation.y = 0; - switch (child->state) - { - case CHILD_NORMAL: - { - if ((child->width < 0) && (child->height < 0)) - { - child_allocation.width = child_requisition.width; - child_allocation.height = child_requisition.height; - } - else - { - child_allocation.width = child->width; - child_allocation.height = child->height; - child->width = -1; - child->height = -1; - } - child_allocation.x += child->x; - child_allocation.y += child->y; - break; - } - case CHILD_MAXIMIZED: - { - if ((child->width < 0) && (child->height < 0)) - { - child->width = child_requisition.width; - child->height = child_requisition.height; - } - child_allocation.width = allocation->width; - child_allocation.height = allocation->height; - } - break; - case CHILD_ICONIFIED: - { - if ((child->width < 0) && (child->height < 0)) - { - child->width = child_requisition.width; - child->height = child_requisition.height; - } - child_allocation.x += child->x; - child_allocation.y += child->y; - child_allocation.width = child_requisition.width; - child_allocation.height = GTK_MDI_MIN_HEIGHT; - break; - } - } - gtk_widget_size_allocate (child->widget, &child_allocation); - } - } + GtkMdi *mdi; + GtkMdiChild *child; + GtkAllocation child_allocation; + GtkRequisition child_requisition; + GList *children; + + mdi = GTK_MDI (widget); + + widget->allocation = *allocation; + + if (GTK_WIDGET_REALIZED (widget)) + gdk_window_move_resize (widget->window, + allocation->x, + allocation->y, + allocation->width, + allocation->height); + + + children = mdi->children; + while (children) + { + child = children->data; + children = children->next; + + if (GTK_WIDGET_VISIBLE (child->widget)) + { + gtk_widget_get_child_requisition (child->widget, &child_requisition); + child_allocation.x = 0; + child_allocation.y = 0; + switch (child->state) + { + case CHILD_NORMAL: + { + if ((child->width < 0) && (child->height < 0)) + { + child_allocation.width = child_requisition.width; + child_allocation.height = child_requisition.height; + } + else + { + child_allocation.width = child->width; + child_allocation.height = child->height; + child->width = -1; + child->height = -1; + } + child_allocation.x += child->x; + child_allocation.y += child->y; + break; + } + case CHILD_MAXIMIZED: + { + if ((child->width < 0) && (child->height < 0)) + { + child->width = child_requisition.width; + child->height = child_requisition.height; + } + child_allocation.width = allocation->width; + child_allocation.height = allocation->height; + } + break; + case CHILD_ICONIFIED: + { + if ((child->width < 0) && (child->height < 0)) + { + child->width = child_requisition.width; + child->height = child_requisition.height; + } + child_allocation.x += child->x; + child_allocation.y += child->y; + child_allocation.width = child_requisition.width; + child_allocation.height = GTK_MDI_MIN_HEIGHT; + break; + } + } + gtk_widget_size_allocate (child->widget, &child_allocation); + } + } } static gint gtk_mdi_expose(GtkWidget *widget, GdkEventExpose *event) { - GtkMdiChild *child; - GList *children; - GtkMdi *mdi; - - g_return_val_if_fail (widget != NULL, FALSE); - g_return_val_if_fail (GTK_IS_MDI (widget), FALSE); - g_return_val_if_fail (event != NULL, FALSE); - - mdi = GTK_MDI (widget); - for (children = mdi->children; children; children = children->next) - { - child = (GtkMdiChild *) children->data; - gtk_container_propagate_expose (GTK_CONTAINER (mdi), - child->widget, - event); - } - return FALSE; + GtkMdiChild *child; + GList *children; + GtkMdi *mdi; + + g_return_val_if_fail (widget != NULL, FALSE); + g_return_val_if_fail (GTK_IS_MDI (widget), FALSE); + g_return_val_if_fail (event != NULL, FALSE); + + mdi = GTK_MDI (widget); + for (children = mdi->children; children; children = children->next) + { + child = (GtkMdiChild *) children->data; + gtk_container_propagate_expose (GTK_CONTAINER (mdi), + child->widget, + event); + } + return FALSE; } static void gtk_mdi_add(GtkContainer *container, GtkWidget *widget) { - GtkWidget *label; - label = gtk_label_new (""); - gtk_mdi_put (GTK_MDI (container), widget, 0, 0, label); + GtkWidget *label; + label = gtk_label_new (""); + gtk_mdi_put (GTK_MDI (container), widget, 0, 0, label); } static void gtk_mdi_remove_true(GtkContainer *container, GtkWidget *widget) { - GtkMdi *mdi; - GtkMdiChild *child = NULL; - GList *children; - - mdi = GTK_MDI (container); - - children = mdi->children; - while (children) - { - child = children->data; - if (child->widget == widget) - break; - - children = children->next; - } - - if(child) - { - gtk_widget_unparent (child->widget); - g_free (child); - } - mdi->children = g_list_remove_link (mdi->children, children); - g_list_free (children); + GtkMdi *mdi; + GtkMdiChild *child = NULL; + GList *children; + + mdi = GTK_MDI (container); + + children = mdi->children; + while (children) + { + child = children->data; + if (child->widget == widget) + break; + + children = children->next; + } + + if(child) + { + gtk_widget_unparent (child->widget); + g_free (child); + } + mdi->children = g_list_remove_link (mdi->children, children); + g_list_free (children); } static void gtk_mdi_forall(GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data) { - GtkMdi *mdi; - GtkMdiChild *child; - GList *children; - - g_return_if_fail (callback != NULL); - - mdi = GTK_MDI (container); - - children = mdi->children; - while (children) - { - child = children->data; - children = children->next; - - (*callback) (child->widget, callback_data); - } + GtkMdi *mdi; + GtkMdiChild *child; + GList *children; + + g_return_if_fail (callback != NULL); + + mdi = GTK_MDI (container); + + children = mdi->children; + while (children) + { + child = children->data; + children = children->next; + + (*callback) (child->widget, callback_data); + } } static gboolean move_child_callback(GtkWidget *widget, GdkEvent *event, gpointer data) { - GtkMdi *mdi; - GtkMdiChild *child; - - child = (GtkMdiChild *) data; - mdi = child->mdi; - - g_return_val_if_fail (GTK_IS_MDI (mdi), FALSE); - g_return_val_if_fail (GTK_IS_EVENT_BOX (widget), FALSE); - - - switch (event->type) - { - case GDK_2BUTTON_PRESS: - { - gdk_window_raise (child->widget->window); - } - case GDK_BUTTON_PRESS: - if (child->state == CHILD_MAXIMIZED) - return FALSE; - if (mdi->drag_button < 0) - { - if (gdk_pointer_grab (event->button.window, - FALSE, - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | - GDK_BUTTON_RELEASE_MASK, - NULL, - NULL, - event->button.time) != GDK_GRAB_SUCCESS) - return FALSE; - - mdi->drag_button = event->button.button; - - mdi->drag_start.x = event->button.x; - mdi->drag_start.y = event->button.y; - } - break; - - case GDK_BUTTON_RELEASE: - if (mdi->drag_button < 0) - return FALSE; - - if (mdi->drag_button == event->button.button) - { - int x, y; - - gdk_pointer_ungrab (event->button.time); - mdi->drag_button = -1; - - x = event->button.x + child->x - mdi->drag_start.x; - y = event->button.y + child->y - mdi->drag_start.y; - - gtk_mdi_move (mdi, child->child, x, y); - } - break; - - case GDK_MOTION_NOTIFY: - { - int x, y; - - if (mdi->drag_button < 0) - return FALSE; - - gdk_window_get_pointer (widget->window, &x, &y, NULL); - - - x = x - mdi->drag_start.x + child->x; - y = y - mdi->drag_start.y + child->y; - - - gtk_mdi_move (mdi, child->child, x, y); - } - break; - - default: - break; - } - - return FALSE; + GtkMdi *mdi; + GtkMdiChild *child; + + child = (GtkMdiChild *) data; + mdi = child->mdi; + + g_return_val_if_fail (GTK_IS_MDI (mdi), FALSE); + g_return_val_if_fail (GTK_IS_EVENT_BOX (widget), FALSE); + + + switch (event->type) + { + case GDK_2BUTTON_PRESS: + { + gdk_window_raise (child->widget->window); + } + case GDK_BUTTON_PRESS: + if (child->state == CHILD_MAXIMIZED) + return FALSE; + if (mdi->drag_button < 0) + { + if (gdk_pointer_grab (event->button.window, + FALSE, + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | + GDK_BUTTON_RELEASE_MASK, + NULL, + NULL, + event->button.time) != GDK_GRAB_SUCCESS) + return FALSE; + + mdi->drag_button = event->button.button; + + mdi->drag_start.x = event->button.x; + mdi->drag_start.y = event->button.y; + } + break; + + case GDK_BUTTON_RELEASE: + if (mdi->drag_button < 0) + return FALSE; + + if (mdi->drag_button == event->button.button) + { + int x, y; + + gdk_pointer_ungrab (event->button.time); + mdi->drag_button = -1; + + x = event->button.x + child->x - mdi->drag_start.x; + y = event->button.y + child->y - mdi->drag_start.y; + + gtk_mdi_move (mdi, child->child, x, y); + } + break; + + case GDK_MOTION_NOTIFY: + { + int x, y; + + if (mdi->drag_button < 0) + return FALSE; + + gdk_window_get_pointer (widget->window, &x, &y, NULL); + + + x = x - mdi->drag_start.x + child->x; + y = y - mdi->drag_start.y + child->y; + + + gtk_mdi_move (mdi, child->child, x, y); + } + break; + + default: + break; + } + + return FALSE; } static gboolean resize_child_callback(GtkWidget *widget, GdkEvent *event, gpointer data) { - GtkMdi *mdi; - GtkMdiChild *child; - - child = (GtkMdiChild *) data; - mdi = child->mdi; - - g_return_val_if_fail (GTK_IS_MDI (mdi), FALSE); - g_return_val_if_fail (GTK_IS_EVENT_BOX (widget), FALSE); - - switch (event->type) - { - case GDK_BUTTON_PRESS: - if (mdi->drag_button < 0) - { - if (gdk_pointer_grab (event->button.window, - FALSE, - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | - GDK_BUTTON_RELEASE_MASK, - NULL, - NULL, - event->button.time) != GDK_GRAB_SUCCESS) - return FALSE; - - mdi->drag_button = event->button.button; - if ((child->state == CHILD_MAXIMIZED) || (child->state == CHILD_ICONIFIED)) - { - child->state = CHILD_NORMAL; - child->x = child->widget->allocation.x; - child->y = child->widget->allocation.y; - child->width = child->widget->allocation.width; - child->height = child->widget->allocation.height; - } - - } - break; - - case GDK_BUTTON_RELEASE: - if (mdi->drag_button < 0) - return FALSE; - - if (mdi->drag_button == event->button.button) - { - int width, height; - - gdk_pointer_ungrab (event->button.time); - mdi->drag_button = -1; - - width = event->button.x + widget->allocation.x; - height = event->button.y + widget->allocation.y; - - width = MAX (width, GTK_MDI_MIN_WIDTH); - height = MAX (height, GTK_MDI_MIN_HEIGHT); - - gtk_widget_set_size_request (child->widget, width, height); - gtk_widget_queue_resize (child->widget); - } - break; - - case GDK_MOTION_NOTIFY: - { - int x, y; - int width, height; - - if (mdi->drag_button < 0) - return FALSE; - - gdk_window_get_pointer (widget->window, &x, &y, NULL); - - width = x + widget->allocation.x; - height = y + widget->allocation.y; - - width = MAX (width, GTK_MDI_MIN_WIDTH); - height = MAX (height, GTK_MDI_MIN_HEIGHT); - - gtk_widget_set_size_request (child->widget, width, height); - gtk_widget_queue_resize (child->widget); - } - break; - - default: - break; - } - - return FALSE; + GtkMdi *mdi; + GtkMdiChild *child; + + child = (GtkMdiChild *) data; + mdi = child->mdi; + + g_return_val_if_fail (GTK_IS_MDI (mdi), FALSE); + g_return_val_if_fail (GTK_IS_EVENT_BOX (widget), FALSE); + + switch (event->type) + { + case GDK_BUTTON_PRESS: + if (mdi->drag_button < 0) + { + if (gdk_pointer_grab (event->button.window, + FALSE, + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | + GDK_BUTTON_RELEASE_MASK, + NULL, + NULL, + event->button.time) != GDK_GRAB_SUCCESS) + return FALSE; + + mdi->drag_button = event->button.button; + if ((child->state == CHILD_MAXIMIZED) || (child->state == CHILD_ICONIFIED)) + { + child->state = CHILD_NORMAL; + child->x = child->widget->allocation.x; + child->y = child->widget->allocation.y; + child->width = child->widget->allocation.width; + child->height = child->widget->allocation.height; + } + + } + break; + + case GDK_BUTTON_RELEASE: + if (mdi->drag_button < 0) + return FALSE; + + if (mdi->drag_button == event->button.button) + { + int width, height; + + gdk_pointer_ungrab (event->button.time); + mdi->drag_button = -1; + + width = event->button.x + widget->allocation.x; + height = event->button.y + widget->allocation.y; + + width = MAX (width, GTK_MDI_MIN_WIDTH); + height = MAX (height, GTK_MDI_MIN_HEIGHT); + + gtk_widget_set_size_request (child->widget, width, height); + gtk_widget_queue_resize (child->widget); + } + break; + + case GDK_MOTION_NOTIFY: + { + int x, y; + int width, height; + + if (mdi->drag_button < 0) + return FALSE; + + gdk_window_get_pointer (widget->window, &x, &y, NULL); + + width = x + widget->allocation.x; + height = y + widget->allocation.y; + + width = MAX (width, GTK_MDI_MIN_WIDTH); + height = MAX (height, GTK_MDI_MIN_HEIGHT); + + gtk_widget_set_size_request (child->widget, width, height); + gtk_widget_queue_resize (child->widget); + } + break; + + default: + break; + } + + return FALSE; } static gboolean iconify_child_callback (GtkWidget *widget, GdkEvent *event, gpointer data) { - GtkMdiChild *child; - child = (GtkMdiChild *) data; - if (child->state == CHILD_ICONIFIED) - { - child->state = CHILD_NORMAL; - } - else - { - child->state = CHILD_ICONIFIED; - } - if (GTK_WIDGET_VISIBLE (child->widget)) - gtk_widget_queue_resize (GTK_WIDGET (child->widget)); - return FALSE; + GtkMdiChild *child; + child = (GtkMdiChild *) data; + if (child->state == CHILD_ICONIFIED) + { + child->state = CHILD_NORMAL; + } + else + { + child->state = CHILD_ICONIFIED; + } + if (GTK_WIDGET_VISIBLE (child->widget)) + gtk_widget_queue_resize (GTK_WIDGET (child->widget)); + return FALSE; } static gboolean maximize_child_callback (GtkWidget *widget, GdkEvent * event, gpointer data) { - GtkMdiChild *child; - child = (GtkMdiChild *) data; - if (child->state == CHILD_MAXIMIZED) - { - child->state = CHILD_NORMAL; - } - else - { - child->state = CHILD_MAXIMIZED; - } - if (GTK_WIDGET_VISIBLE (child->widget)) - gtk_widget_queue_resize (GTK_WIDGET (child->widget)); - return FALSE; + GtkMdiChild *child; + child = (GtkMdiChild *) data; + if (child->state == CHILD_MAXIMIZED) + { + child->state = CHILD_NORMAL; + } + else + { + child->state = CHILD_MAXIMIZED; + } + if (GTK_WIDGET_VISIBLE (child->widget)) + gtk_widget_queue_resize (GTK_WIDGET (child->widget)); + return FALSE; } static gboolean kill_child_callback (GtkWidget *widget, GdkEvent *event, gpointer data) { - GtkMdiChild *child; - GtkMdi *mdi; - - child = (GtkMdiChild *) data; - mdi = child->mdi; - - g_return_val_if_fail (GTK_IS_MDI (mdi), FALSE); - - gtk_mdi_remove_true (GTK_CONTAINER (mdi), child->widget); - return FALSE; + GtkMdiChild *child; + GtkMdi *mdi; + + child = (GtkMdiChild *) data; + mdi = child->mdi; + + g_return_val_if_fail (GTK_IS_MDI (mdi), FALSE); + + gtk_mdi_remove_true (GTK_CONTAINER (mdi), child->widget); + return FALSE; } static GtkMdiChild *get_child (GtkMdi *mdi, GtkWidget *widget) { - GList *children; - - children = mdi->children; - while (children) - { - GtkMdiChild *child; - - child = children->data; - children = children->next; - - if (child->child == widget) - return child; - } - - return NULL; + GList *children; + + children = mdi->children; + while (children) + { + GtkMdiChild *child; + + child = children->data; + children = children->next; + + if (child->child == widget) + return child; + } + + return NULL; } #endif static void _dw_msleep(long period) { #ifdef __sun__ - /* usleep() isn't threadsafe on Solaris */ - struct timespec req; - - req.tv_sec = 0; - req.tv_nsec = period * 10000000; - - nanosleep(&req, NULL); + /* usleep() isn't threadsafe on Solaris */ + struct timespec req; + + req.tv_sec = 0; + req.tv_nsec = period * 10000000; + + nanosleep(&req, NULL); #else - usleep(period * 1000); + usleep(period * 1000); #endif } /* Finds the translation function for a given signal name */ static void *_findsigfunc(char *signame) { - int z; - - for(z=0;zbutton; - - if(event->button == 3) - mybutton = 2; - else if(event->button == 2) - mybutton = 3; - - retval = buttonfunc(work.window, event->x, event->y, mybutton, work.data); - } - return retval; + SignalHandler work = _get_signal_handler(widget, data); + int retval = FALSE; + + if(work.window) + { + int (*buttonfunc)(HWND, int, int, int, void *) = work.func; + int mybutton = event->button; + + if(event->button == 3) + mybutton = 2; + else if(event->button == 2) + mybutton = 3; + + retval = buttonfunc(work.window, event->x, event->y, mybutton, work.data); + } + return retval; } static gint _button_release_event(GtkWidget *widget, GdkEventButton *event, gpointer data) { - SignalHandler work = _get_signal_handler(widget, data); - int retval = FALSE; - - if(work.window) - { - int (*buttonfunc)(HWND, int, int, int, void *) = work.func; - int mybutton = event->button; - - if(event->button == 3) - mybutton = 2; - else if(event->button == 2) - mybutton = 3; - - retval = buttonfunc(work.window, event->x, event->y, mybutton, work.data); - } - return retval; + SignalHandler work = _get_signal_handler(widget, data); + int retval = FALSE; + + if(work.window) + { + int (*buttonfunc)(HWND, int, int, int, void *) = work.func; + int mybutton = event->button; + + if(event->button == 3) + mybutton = 2; + else if(event->button == 2) + mybutton = 3; + + retval = buttonfunc(work.window, event->x, event->y, mybutton, work.data); + } + return retval; } static gint _motion_notify_event(GtkWidget *widget, GdkEventMotion *event, gpointer data) { - SignalHandler work = _get_signal_handler(widget, data); - int retval = FALSE; - - if(work.window) - { - int (*motionfunc)(HWND, int, int, int, void *) = work.func; - int keys = 0, x, y; - GdkModifierType state; - - if (event->is_hint) - gdk_window_get_pointer (event->window, &x, &y, &state); - else - { - x = event->x; - y = event->y; - state = event->state; - } - - if (state & GDK_BUTTON1_MASK) - keys = DW_BUTTON1_MASK; - if (state & GDK_BUTTON3_MASK) - keys |= DW_BUTTON2_MASK; - if (state & GDK_BUTTON2_MASK) - keys |= DW_BUTTON3_MASK; - - retval = motionfunc(work.window, x, y, keys, work.data); - } - return retval; + SignalHandler work = _get_signal_handler(widget, data); + int retval = FALSE; + + if(work.window) + { + int (*motionfunc)(HWND, int, int, int, void *) = work.func; + int keys = 0, x, y; + GdkModifierType state; + + if (event->is_hint) + gdk_window_get_pointer (event->window, &x, &y, &state); + else + { + x = event->x; + y = event->y; + state = event->state; + } + + if (state & GDK_BUTTON1_MASK) + keys = DW_BUTTON1_MASK; + if (state & GDK_BUTTON3_MASK) + keys |= DW_BUTTON2_MASK; + if (state & GDK_BUTTON2_MASK) + keys |= DW_BUTTON3_MASK; + + retval = motionfunc(work.window, x, y, keys, work.data); + } + return retval; } static gint _delete_event(GtkWidget *widget, GdkEvent *event, gpointer data) { - SignalHandler work = _get_signal_handler(widget, data); - int retval = FALSE; - - if(work.window) - { - int (*closefunc)(HWND, void *) = work.func; - - retval = closefunc(work.window, work.data); - } - return retval; + SignalHandler work = _get_signal_handler(widget, data); + int retval = FALSE; + + if(work.window) + { + int (*closefunc)(HWND, void *) = work.func; + + retval = closefunc(work.window, work.data); + } + return retval; } static gint _key_press_event(GtkWidget *widget, GdkEventKey *event, gpointer data) { - SignalHandler work = _get_signal_handler(widget, data); - int retval = FALSE; - - if(work.window) - { - int (*keypressfunc)(HWND, char, int, int, void *) = work.func; - - retval = keypressfunc(work.window, *event->string, event->keyval, - event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_MOD1_MASK), work.data); - } - return retval; + SignalHandler work = _get_signal_handler(widget, data); + int retval = FALSE; + + if(work.window) + { + int (*keypressfunc)(HWND, char, int, int, void *) = work.func; + + retval = keypressfunc(work.window, *event->string, event->keyval, + event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_MOD1_MASK), work.data); + } + return retval; } static gint _generic_event(GtkWidget *widget, gpointer data) { - SignalHandler work = _get_signal_handler(widget, data); - int retval = FALSE; - - if(work.window) - { - int (*genericfunc)(HWND, void *) = work.func; - - retval = genericfunc(work.window, work.data); - } - return retval; + SignalHandler work = _get_signal_handler(widget, data); + int retval = FALSE; + + if(work.window) + { + int (*genericfunc)(HWND, void *) = work.func; + + retval = genericfunc(work.window, work.data); + } + return retval; } static gint _activate_event(GtkWidget *widget, gpointer data) { - SignalHandler work = _get_signal_handler(widget, data); - int retval = FALSE; - - if(work.window && !_dw_ignore_click) - { - int (*activatefunc)(HWND, void *) = work.func; - - retval = activatefunc(popup ? popup : work.window, work.data); - } - return retval; + SignalHandler work = _get_signal_handler(widget, data); + int retval = FALSE; + + if(work.window && !_dw_ignore_click) + { + int (*activatefunc)(HWND, void *) = work.func; + + retval = activatefunc(popup ? popup : work.window, work.data); + } + return retval; } static gint _configure_event(GtkWidget *widget, GdkEventConfigure *event, gpointer data) { - SignalHandler work = _get_signal_handler(widget, data); - int retval = FALSE; - - if(work.window) - { - int (*sizefunc)(HWND, int, int, void *) = work.func; - - retval = sizefunc(work.window, event->width, event->height, work.data); - } - return retval; + SignalHandler work = _get_signal_handler(widget, data); + int retval = FALSE; + + if(work.window) + { + int (*sizefunc)(HWND, int, int, void *) = work.func; + + retval = sizefunc(work.window, event->width, event->height, work.data); + } + return retval; } static gint _expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer data) { - SignalHandler work = _get_signal_handler(widget, data); - int retval = FALSE; - - if(work.window) - { - DWExpose exp; - int (*exposefunc)(HWND, DWExpose *, void *) = work.func; - - exp.x = event->area.x; - exp.y = event->area.y; - exp.width = event->area.width; - exp.height = event->area.height; - retval = exposefunc(work.window, &exp, work.data); - } - return retval; + SignalHandler work = _get_signal_handler(widget, data); + int retval = FALSE; + + if(work.window) + { + DWExpose exp; + int (*exposefunc)(HWND, DWExpose *, void *) = work.func; + + exp.x = event->area.x; + exp.y = event->area.y; + exp.width = event->area.width; + exp.height = event->area.height; + retval = exposefunc(work.window, &exp, work.data); + } + return retval; } static gint _item_select_event(GtkWidget *widget, GtkWidget *child, gpointer data) { - SignalHandler work = _get_signal_handler(widget, data); - static int _dw_recursing = 0; - int retval = FALSE; - - if(_dw_recursing) - return FALSE; - - if(work.window) - { - int (*selectfunc)(HWND, int, void *) = work.func; - GList *list; - int item = 0; - - _dw_recursing = 1; - - if(GTK_IS_COMBO(work.window)) - list = GTK_LIST(GTK_COMBO(work.window)->list)->children; - else if(GTK_IS_LIST(widget)) - list = GTK_LIST(widget)->children; - else - return FALSE; - - while(list) - { - if(list->data == (gpointer)child) - { - if(!gtk_object_get_data(GTK_OBJECT(work.window), "_dw_appending")) - { - gtk_object_set_data(GTK_OBJECT(work.window), "_dw_item", (gpointer)item); - if(selectfunc) - retval = selectfunc(work.window, item, work.data); - } - break; - } - item++; - list = list->next; - } - _dw_recursing = 0; - } - return retval; + SignalHandler work = _get_signal_handler(widget, data); + static int _dw_recursing = 0; + int retval = FALSE; + + if(_dw_recursing) + return FALSE; + + if(work.window) + { + int (*selectfunc)(HWND, int, void *) = work.func; + GList *list; + int item = 0; + + _dw_recursing = 1; + + if(GTK_IS_COMBO(work.window)) + list = GTK_LIST(GTK_COMBO(work.window)->list)->children; + else if(GTK_IS_LIST(widget)) + list = GTK_LIST(widget)->children; + else + return FALSE; + + while(list) + { + if(list->data == (gpointer)child) + { + if(!gtk_object_get_data(GTK_OBJECT(work.window), "_dw_appending")) + { + gtk_object_set_data(GTK_OBJECT(work.window), "_dw_item", GINT_TO_POINTER(item)); + if(selectfunc) + retval = selectfunc(work.window, item, work.data); + } + break; + } + item++; + list = list->next; + } + _dw_recursing = 0; + } + return retval; } static gint _container_context_event(GtkWidget *widget, GdkEventButton *event, gpointer data) { - SignalHandler work = _get_signal_handler(widget, data); - int retval = FALSE; - - if(work.window) - { - if(event->button == 3) - { - int (*contextfunc)(HWND, char *, int, int, void *, void *) = work.func; - char *text; - int row, col; - - gtk_clist_get_selection_info(GTK_CLIST(widget), event->x, event->y, &row, &col); - - text = (char *)gtk_clist_get_row_data(GTK_CLIST(widget), row); - retval = contextfunc(work.window, text, event->x, event->y, work.data, NULL); - } - } - return retval; + SignalHandler work = _get_signal_handler(widget, data); + int retval = FALSE; + + if(work.window) + { + if(event->button == 3) + { + int (*contextfunc)(HWND, char *, int, int, void *, void *) = work.func; + char *text; + int row, col; + + gtk_clist_get_selection_info(GTK_CLIST(widget), event->x, event->y, &row, &col); + + text = (char *)gtk_clist_get_row_data(GTK_CLIST(widget), row); + retval = contextfunc(work.window, text, event->x, event->y, work.data, NULL); + } + } + return retval; } static gint _tree_context_event(GtkWidget *widget, GdkEventButton *event, gpointer data) { - SignalHandler work = _get_signal_handler(widget, data); - int retval = FALSE; - - if(work.window) - { - if(event->button == 3) - { -#if GTK_MAJOR_VERSION > 1 - int (*contextfunc)(HWND, char *, int, int, void *, void *) = work.func; - char *text = NULL; - void *itemdata = NULL; - - if(widget && GTK_IS_TREE_VIEW(widget)) - { - GtkTreeSelection *sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(widget)); - GtkTreeIter iter; - - if(sel && gtk_tree_selection_get_selected(sel, NULL, &iter)) - { - GtkTreeModel *store = (GtkTreeModel *)gtk_object_get_data(GTK_OBJECT(widget), "_dw_tree_store"); - gtk_tree_model_get(store, &iter, 0, &text, 2, &itemdata, -1); - } - } - - retval = contextfunc(work.window, text, event->x, event->y, work.data, itemdata); + SignalHandler work = _get_signal_handler(widget, data); + int retval = FALSE; + + if(work.window) + { + if(event->button == 3) + { +#if GTK_MAJOR_VERSION > 1 + int (*contextfunc)(HWND, char *, int, int, void *, void *) = work.func; + char *text = NULL; + void *itemdata = NULL; + + if(widget && GTK_IS_TREE_VIEW(widget)) + { + GtkTreeSelection *sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(widget)); + GtkTreeIter iter; + + if(sel && gtk_tree_selection_get_selected(sel, NULL, &iter)) + { + GtkTreeModel *store = (GtkTreeModel *)gtk_object_get_data(GTK_OBJECT(widget), "_dw_tree_store"); + gtk_tree_model_get(store, &iter, 0, &text, 2, &itemdata, -1); + } + } + + retval = contextfunc(work.window, text, event->x, event->y, work.data, itemdata); #else - int (*contextfunc)(HWND, char *, int, int, void *, void *) = work.func; - char *text = (char *)gtk_object_get_data(GTK_OBJECT(widget), "_dw_text"); - void *itemdata = (void *)gtk_object_get_data(GTK_OBJECT(widget), "_dw_itemdata"); - - if(widget != work.window) - { - GtkWidget *tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(work.window)); - - if(tree && GTK_IS_TREE(tree)) - { - GtkWidget *lastselect = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_lastselect"); - - if(lastselect && GTK_IS_TREE_ITEM(lastselect)) - { - text = (char *)gtk_object_get_data(GTK_OBJECT(lastselect), "_dw_text"); - itemdata = (void *)gtk_object_get_data(GTK_OBJECT(lastselect), "_dw_itemdata"); - } - } - } - - retval = contextfunc(work.window, text, event->x, event->y, work.data, itemdata); -#endif - } - } - return retval; + int (*contextfunc)(HWND, char *, int, int, void *, void *) = work.func; + char *text = (char *)gtk_object_get_data(GTK_OBJECT(widget), "_dw_text"); + void *itemdata = (void *)gtk_object_get_data(GTK_OBJECT(widget), "_dw_itemdata"); + + if(widget != work.window) + { + GtkWidget *tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(work.window)); + + if(tree && GTK_IS_TREE(tree)) + { + GtkWidget *lastselect = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_lastselect"); + + if(lastselect && GTK_IS_TREE_ITEM(lastselect)) + { + text = (char *)gtk_object_get_data(GTK_OBJECT(lastselect), "_dw_text"); + itemdata = (void *)gtk_object_get_data(GTK_OBJECT(lastselect), "_dw_itemdata"); + } + } + } + + retval = contextfunc(work.window, text, event->x, event->y, work.data, itemdata); +#endif + } + } + return retval; } #if GTK_MAJOR_VERSION > 1 static gint _tree_select_event(GtkTreeSelection *sel, gpointer data) { - GtkWidget *item, *widget = (GtkWidget *)gtk_tree_selection_get_tree_view(sel); - int retval = FALSE; - - if(widget) - { - SignalHandler work = _get_signal_handler(widget, data); - - if(work.window) - { - int (*treeselectfunc)(HWND, HTREEITEM, char *, void *, void *) = work.func; - GtkTreeIter iter; - char *text = NULL; - void *itemdata = NULL; - - if(gtk_tree_selection_get_selected(sel, NULL, &iter)) - { - GtkTreeModel *store = (GtkTreeModel *)gtk_object_get_data(GTK_OBJECT(widget), "_dw_tree_store"); - gtk_tree_model_get(store, &iter, 0, &text, 2, &itemdata, 3, &item, -1); - retval = treeselectfunc(work.window, (HTREEITEM)item, text, work.data, itemdata); - } - } - } - return retval; + GtkWidget *item, *widget = (GtkWidget *)gtk_tree_selection_get_tree_view(sel); + int retval = FALSE; + + if(widget) + { + SignalHandler work = _get_signal_handler(widget, data); + + if(work.window) + { + int (*treeselectfunc)(HWND, HTREEITEM, char *, void *, void *) = work.func; + GtkTreeIter iter; + char *text = NULL; + void *itemdata = NULL; + + if(gtk_tree_selection_get_selected(sel, NULL, &iter)) + { + GtkTreeModel *store = (GtkTreeModel *)gtk_object_get_data(GTK_OBJECT(widget), "_dw_tree_store"); + gtk_tree_model_get(store, &iter, 0, &text, 2, &itemdata, 3, &item, -1); + retval = treeselectfunc(work.window, (HTREEITEM)item, text, work.data, itemdata); + } + } + } + return retval; } static gint _tree_expand_event(GtkTreeView *widget, GtkTreeIter *iter, GtkTreePath *path, gpointer data) { - SignalHandler work = _get_signal_handler((GtkWidget *)widget, data); - int retval = FALSE; - - if(!_dw_ignore_expand && work.window) - { - int (*treeexpandfunc)(HWND, HTREEITEM, void *) = work.func; - retval = treeexpandfunc(work.window, (HTREEITEM)iter, work.data); - } - return retval; + SignalHandler work = _get_signal_handler((GtkWidget *)widget, data); + int retval = FALSE; + + if(!_dw_ignore_expand && work.window) + { + int (*treeexpandfunc)(HWND, HTREEITEM, void *) = work.func; + retval = treeexpandfunc(work.window, (HTREEITEM)iter, work.data); + } + return retval; } #else static gint _tree_select_event(GtkTree *tree, GtkWidget *child, gpointer data) { - SignalHandler work = _get_signal_handler((GtkWidget *)tree, data); - GtkWidget *treeroot = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(child), "_dw_tree"); - int retval = FALSE; - - if(treeroot && GTK_IS_TREE(treeroot)) - { - GtkWidget *lastselect = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(treeroot), "_dw_lastselect"); - if(lastselect && GTK_IS_TREE_ITEM(lastselect)) - gtk_tree_item_deselect(GTK_TREE_ITEM(lastselect)); - gtk_object_set_data(GTK_OBJECT(treeroot), "_dw_lastselect", (gpointer)child); - } - - if(work.window) - { - int (*treeselectfunc)(HWND, HTREEITEM, char *, void *, void *) = work.func; - char *text = (char *)gtk_object_get_data(GTK_OBJECT(child), "_dw_text"); - void *itemdata = (void *)gtk_object_get_data(GTK_OBJECT(child), "_dw_itemdata"); - retval = treeselectfunc(work.window, (HTREEITEM)child, text, work.data, itemdata); - } - return retval; + SignalHandler work = _get_signal_handler((GtkWidget *)tree, data); + GtkWidget *treeroot = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(child), "_dw_tree"); + int retval = FALSE; + + if(treeroot && GTK_IS_TREE(treeroot)) + { + GtkWidget *lastselect = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(treeroot), "_dw_lastselect"); + if(lastselect && GTK_IS_TREE_ITEM(lastselect)) + gtk_tree_item_deselect(GTK_TREE_ITEM(lastselect)); + gtk_object_set_data(GTK_OBJECT(treeroot), "_dw_lastselect", (gpointer)child); + } + + if(work.window) + { + int (*treeselectfunc)(HWND, HTREEITEM, char *, void *, void *) = work.func; + char *text = (char *)gtk_object_get_data(GTK_OBJECT(child), "_dw_text"); + void *itemdata = (void *)gtk_object_get_data(GTK_OBJECT(child), "_dw_itemdata"); + retval = treeselectfunc(work.window, (HTREEITEM)child, text, work.data, itemdata); + } + return retval; } static gint _tree_expand_event(GtkTreeItem *treeitem, gpointer data) { - SignalHandler work = _get_signal_handler((GtkWidget *)treeitem, data); - int retval = FALSE; - - if(!_dw_ignore_expand && work.window) - { - int (*treeexpandfunc)(HWND, HTREEITEM, void *) = work.func; - retval = treeexpandfunc(work.window, (HTREEITEM)treeitem, work.data); - } - return retval; + SignalHandler work = _get_signal_handler((GtkWidget *)treeitem, data); + int retval = FALSE; + + if(!_dw_ignore_expand && work.window) + { + int (*treeexpandfunc)(HWND, HTREEITEM, void *) = work.func; + retval = treeexpandfunc(work.window, (HTREEITEM)treeitem, work.data); + } + return retval; } #endif static gint _container_select_event(GtkWidget *widget, GdkEventButton *event, gpointer data) { - SignalHandler work = _get_signal_handler(widget, data); - int retval = FALSE; - - if(work.window) - { - if(event->button == 1 && event->type == GDK_2BUTTON_PRESS) - { - int (*contextfunc)(HWND, char *, void *) = work.func; - char *text; - int row, col; - - gtk_clist_get_selection_info(GTK_CLIST(widget), event->x, event->y, &row, &col); - - text = (char *)gtk_clist_get_row_data(GTK_CLIST(widget), row); - retval = contextfunc(work.window, text, work.data); - gtk_object_set_data(GTK_OBJECT(widget), "_dw_double_click", (gpointer)1); - } - } - return retval; + SignalHandler work = _get_signal_handler(widget, data); + int retval = FALSE; + + if(work.window) + { + if(event->button == 1 && event->type == GDK_2BUTTON_PRESS) + { + int (*contextfunc)(HWND, char *, void *) = work.func; + char *text; + int row, col; + + gtk_clist_get_selection_info(GTK_CLIST(widget), event->x, event->y, &row, &col); + + text = (char *)gtk_clist_get_row_data(GTK_CLIST(widget), row); + retval = contextfunc(work.window, text, work.data); + gtk_object_set_data(GTK_OBJECT(widget), "_dw_double_click", GINT_TO_POINTER(1)); + } + } + return retval; } static gint _container_enter_event(GtkWidget *widget, GdkEventKey *event, gpointer data) { - SignalHandler work = _get_signal_handler(widget, data); - int retval = FALSE; - - if(work.window && event->keyval == VK_RETURN) - { - int (*contextfunc)(HWND, char *, void *) = work.func; - char *text; - - text = (char *)gtk_clist_get_row_data(GTK_CLIST(widget), GTK_CLIST(widget)->focus_row); - retval = contextfunc(work.window, text, work.data); - } - return retval; + SignalHandler work = _get_signal_handler(widget, data); + int retval = FALSE; + + if(work.window && event->keyval == VK_RETURN) + { + int (*contextfunc)(HWND, char *, void *) = work.func; + char *text; + + text = (char *)gtk_clist_get_row_data(GTK_CLIST(widget), GTK_CLIST(widget)->focus_row); + retval = contextfunc(work.window, text, work.data); + } + return retval; } /* Return the logical page id from the physical page id */ int _get_logical_page(HWND handle, unsigned long pageid) { - int z; - GtkWidget **pagearray = gtk_object_get_data(GTK_OBJECT(handle), "_dw_pagearray"); - GtkWidget *thispage = gtk_notebook_get_nth_page(GTK_NOTEBOOK(handle), pageid); - - if(pagearray && thispage) - { - for(z=0;z<256;z++) - { - if(thispage == pagearray[z]) - return z; - } - } - return 256; + int z; + GtkWidget **pagearray = gtk_object_get_data(GTK_OBJECT(handle), "_dw_pagearray"); + GtkWidget *thispage = gtk_notebook_get_nth_page(GTK_NOTEBOOK(handle), pageid); + + if(pagearray && thispage) + { + for(z=0;z<256;z++) + { + if(thispage == pagearray[z]) + return z; + } + } + return 256; } static gint _switch_page_event(GtkNotebook *notebook, GtkNotebookPage *page, guint page_num, gpointer data) { - SignalHandler work = _get_signal_handler((GtkWidget *)notebook, data); - int retval = FALSE; - - if(work.window) - { - int (*switchpagefunc)(HWND, unsigned long, void *) = work.func; - retval = switchpagefunc(work.window, _get_logical_page(GTK_WIDGET(notebook), page_num), work.data); - } - return retval; + SignalHandler work = _get_signal_handler((GtkWidget *)notebook, data); + int retval = FALSE; + + if(work.window) + { + int (*switchpagefunc)(HWND, unsigned long, void *) = work.func; + retval = switchpagefunc(work.window, _get_logical_page(GTK_WIDGET(notebook), page_num), work.data); + } + return retval; } static gint _column_click_event(GtkWidget *widget, gint column_num, gpointer data) { - SignalHandler work = _get_signal_handler(widget, data); - int retval = FALSE; - - if(work.window) - { - int (*clickcolumnfunc)(HWND, int, void *) = work.func; - retval = clickcolumnfunc(work.window, column_num, work.data); - } - return retval; + SignalHandler work = _get_signal_handler(widget, data); + int retval = FALSE; + + if(work.window) + { + int (*clickcolumnfunc)(HWND, int, void *) = work.func; + retval = clickcolumnfunc(work.window, column_num, work.data); + } + return retval; } static gint _container_select_row(GtkWidget *widget, gint row, gint column, GdkEventButton *event, gpointer data) { - SignalHandler work = _get_signal_handler(widget, data); - char *rowdata = gtk_clist_get_row_data(GTK_CLIST(widget), row); - int (*contextfunc)(HWND, HWND, char *, void *, void *) = work.func; - - if(!work.window) - return TRUE; - - if(gtk_object_get_data(GTK_OBJECT(widget), "_dw_double_click")) - { - gtk_object_set_data(GTK_OBJECT(widget), "_dw_double_click", (gpointer)0); - return TRUE; - } - return contextfunc(work.window, 0, rowdata, work.data, 0);; + SignalHandler work = _get_signal_handler(widget, data); + char *rowdata = gtk_clist_get_row_data(GTK_CLIST(widget), row); + int (*contextfunc)(HWND, HWND, char *, void *, void *) = work.func; + + if(!work.window) + return TRUE; + + if(gtk_object_get_data(GTK_OBJECT(widget), "_dw_double_click")) + { + gtk_object_set_data(GTK_OBJECT(widget), "_dw_double_click", GINT_TO_POINTER(0)); + return TRUE; + } + return contextfunc(work.window, 0, rowdata, work.data, 0);; } static int _round_value(gfloat val) { - int newval = (int)val; - - if(val >= 0.5 + (gfloat)newval) - newval++; - - return newval; + int newval = (int)val; + + if(val >= 0.5 + (gfloat)newval) + newval++; + + return newval; } static gint _value_changed_event(GtkAdjustment *adjustment, gpointer data) { - int max = _round_value(adjustment->upper); - int val = _round_value(adjustment->value); - GtkWidget *slider = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(adjustment), "_dw_slider"); - GtkWidget *spinbutton = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(adjustment), "_dw_spinbutton"); - GtkWidget *scrollbar = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(adjustment), "_dw_scrollbar"); - - if(slider) - { - SignalHandler work = _get_signal_handler((GtkWidget *)adjustment, data); - - if(work.window) - { - int (*valuechangedfunc)(HWND, int, void *) = work.func; - - if(GTK_IS_VSCALE(slider)) - valuechangedfunc(work.window, (max - val) - 1, work.data); - else - valuechangedfunc(work.window, val, work.data); - } - } - else if(scrollbar || spinbutton) - { - SignalHandler work = _get_signal_handler((GtkWidget *)adjustment, data); - - if(work.window) - { - int (*valuechangedfunc)(HWND, int, void *) = work.func; - - valuechangedfunc(work.window, val, work.data); - } - } - return FALSE; + int max = _round_value(adjustment->upper); + int val = _round_value(adjustment->value); + GtkWidget *slider = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(adjustment), "_dw_slider"); + GtkWidget *spinbutton = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(adjustment), "_dw_spinbutton"); + GtkWidget *scrollbar = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(adjustment), "_dw_scrollbar"); + + if(slider) + { + SignalHandler work = _get_signal_handler((GtkWidget *)adjustment, data); + + if(work.window) + { + int (*valuechangedfunc)(HWND, int, void *) = work.func; + + if(GTK_IS_VSCALE(slider)) + valuechangedfunc(work.window, (max - val) - 1, work.data); + else + valuechangedfunc(work.window, val, work.data); + } + } + else if(scrollbar || spinbutton) + { + SignalHandler work = _get_signal_handler((GtkWidget *)adjustment, data); + + if(work.window) + { + int (*valuechangedfunc)(HWND, int, void *) = work.func; + + valuechangedfunc(work.window, val, work.data); + } + } + return FALSE; } static gint _default_key_press_event(GtkWidget *widget, GdkEventKey *event, gpointer data) { - GtkWidget *next = (GtkWidget *)data; - - if(next) - { - if(event->keyval == GDK_Return) - { - if(GTK_IS_BUTTON(next)) - gtk_signal_emit_by_name(GTK_OBJECT(next), "clicked"); - else - gtk_widget_grab_focus(next); - } - } - return FALSE; + GtkWidget *next = (GtkWidget *)data; + + if(next) + { + if(event->keyval == GDK_Return) + { + if(GTK_IS_BUTTON(next)) + gtk_signal_emit_by_name(GTK_OBJECT(next), "clicked"); + else + gtk_widget_grab_focus(next); + } + } + return FALSE; } static GdkPixmap *_find_private_pixmap(GdkBitmap **bitmap, long id, unsigned long *userwidth, unsigned long *userheight) { - if(id < _PixmapCount && _PixmapArray[id].used) - { - *bitmap = _PixmapArray[id].mask; - if(userwidth) - *userwidth = _PixmapArray[id].width; - if(userheight) - *userheight = _PixmapArray[id].height; - return _PixmapArray[id].pixmap; - } - return NULL; + if(id < _PixmapCount && _PixmapArray[id].used) + { + *bitmap = _PixmapArray[id].mask; + if(userwidth) + *userwidth = _PixmapArray[id].width; + if(userheight) + *userheight = _PixmapArray[id].height; + return _PixmapArray[id].pixmap; + } + return NULL; } static GdkPixmap *_find_pixmap(GdkBitmap **bitmap, long id, HWND handle, unsigned long *userwidth, unsigned long *userheight) { - char *data = NULL; - int z; - - if(id & (1 << 31)) - return _find_private_pixmap(bitmap, (id & 0xFFFFFF), userwidth, userheight); - - for(z=0;z<_resources.resource_max;z++) - { - if(_resources.resource_id[z] == id) - { - data = _resources.resource_data[z]; - break; - } - } - - if(data) - { - GdkPixmap *icon_pixmap = NULL; -#if GTK_MAJOR_VERSION > 1 - GdkPixbuf *icon_pixbuf = gdk_pixbuf_new_from_xpm_data((const char **)data); - - if(userwidth) - *userwidth = gdk_pixbuf_get_width(icon_pixbuf); - if(userheight) - *userheight = gdk_pixbuf_get_height(icon_pixbuf); - - gdk_pixbuf_render_pixmap_and_mask(icon_pixbuf, &icon_pixmap, bitmap, 1); - g_object_unref(icon_pixbuf); + char *data = NULL; + int z; + + if(id & (1 << 31)) + return _find_private_pixmap(bitmap, (id & 0xFFFFFF), userwidth, userheight); + + for(z=0;z<_resources.resource_max;z++) + { + if(_resources.resource_id[z] == id) + { + data = _resources.resource_data[z]; + break; + } + } + + if(data) + { + GdkPixmap *icon_pixmap = NULL; +#if GTK_MAJOR_VERSION > 1 + GdkPixbuf *icon_pixbuf = gdk_pixbuf_new_from_xpm_data((const char **)data); + + if(userwidth) + *userwidth = gdk_pixbuf_get_width(icon_pixbuf); + if(userheight) + *userheight = gdk_pixbuf_get_height(icon_pixbuf); + + gdk_pixbuf_render_pixmap_and_mask(icon_pixbuf, &icon_pixmap, bitmap, 1); + g_object_unref(icon_pixbuf); #elif defined(USE_IMLIB) - gdk_imlib_data_to_pixmap((char **)data, &icon_pixmap, bitmap); + gdk_imlib_data_to_pixmap((char **)data, &icon_pixmap, bitmap); #else - icon_pixmap = gdk_pixmap_create_from_xpm_d(handle->window, bitmap, &_colors[DW_CLR_PALEGRAY], (char **)data); -#endif - return icon_pixmap; - } - return NULL; + icon_pixmap = gdk_pixmap_create_from_xpm_d(handle->window, bitmap, &_colors[DW_CLR_PALEGRAY], (char **)data); +#endif + return icon_pixmap; + } + return NULL; } #if GTK_MAJOR_VERSION > 1 static GdkPixbuf *_find_private_pixbuf(long id) { - if(id < _PixmapCount && _PixmapArray[id].used) - return _PixmapArray[id].pixbuf; - return NULL; + if(id < _PixmapCount && _PixmapArray[id].used) + return _PixmapArray[id].pixbuf; + return NULL; } static GdkPixbuf *_find_pixbuf(long id) { - char *data = NULL; - int z; - - if(id & (1 << 31)) - return _find_private_pixbuf((id & 0xFFFFFF)); - - for(z=0;z<_resources.resource_max;z++) - { - if(_resources.resource_id[z] == id) - { - data = _resources.resource_data[z]; - break; - } - } - - if(data) - return gdk_pixbuf_new_from_xpm_data((const char **)data); - return NULL; + char *data = NULL; + int z; + + if(id & (1 << 31)) + return _find_private_pixbuf((id & 0xFFFFFF)); + + for(z=0;z<_resources.resource_max;z++) + { + if(_resources.resource_id[z] == id) + { + data = _resources.resource_data[z]; + break; + } + } + + if(data) + return gdk_pixbuf_new_from_xpm_data((const char **)data); + return NULL; } #endif @@ -1835,137 +1842,102 @@ sizehints.flags = (PBaseSize|PMinSize|PResizeInc); XSetWMNormalHints (GDK_DISPLAY(), - GDK_WINDOW_XWINDOW (GTK_WIDGET (window)->window), - &sizehints); + GDK_WINDOW_XWINDOW (GTK_WIDGET (window)->window), + &sizehints); gdk_flush (); } /* Find the index of a given thread */ static int _find_thread_index(DWTID tid) { - int z; - - for(z=0;z -static char _dw_mozdir[1024]; - void init_mozembed(void) { - void *handle = NULL; - FILE *fp = popen("pkg-config --libs-only-L mozilla-gtkmozembed", "r"); - - /* First we try to get the correct location - * from pkg-config. - */ - if(fp) - { - fgets(_dw_mozdir, 1024, fp); - - if(_dw_mozdir[0] == '-' && _dw_mozdir[1] == 'L') - { - int x, len = strlen(_dw_mozdir); - - for(x=len;x>0;x--) - { - if(!isalpha(_dw_mozdir[x]) && !isdigit(_dw_mozdir[x]) && _dw_mozdir[x] != '/') - _dw_mozdir[x] = 0; - } - strncat(_dw_mozdir, "/libgtkembedmoz.so", 1024); - handle = dlopen(&_dw_mozdir[2], RTLD_NOW); - } - fclose(fp); - } - /* Try the default path */ - if(!handle) - { - strncpy(_dw_mozdir, "libgtkembedmoz.so", 1024); - handle = dlopen(_dw_mozdir, RTLD_NOW); - } - /* Finally try some common locations */ - if(!handle) - { - strncpy(_dw_mozdir, "/usr/X11R6/lib/mozilla/libgtkembedmoz.so", 1024); - handle = dlopen(_dw_mozdir, RTLD_NOW); - } - if(!handle) - { - strncpy(_dw_mozdir, "/usr/lib/mozilla/libgtkembedmoz.so", 1024); - handle = dlopen(_dw_mozdir, RTLD_NOW); - } - if(!handle) - { - strncpy(_dw_mozdir, "/usr/local/lib/mozilla/libgtkembedmoz.so", 1024); - handle = dlopen(_dw_mozdir, RTLD_NOW); - } - - /* If we loaded it, grab the symbols we want */ - if(handle) - { - _gtk_moz_embed_go_back = dlsym(handle, "gtk_moz_embed_go_back"); - _gtk_moz_embed_go_forward = dlsym(handle, "gtk_moz_embed_go_forward"); - _gtk_moz_embed_load_url = dlsym(handle, "gtk_moz_embed_load_url"); - _gtk_moz_embed_reload = dlsym(handle, "gtk_moz_embed_reload"); - _gtk_moz_embed_stop_load = dlsym(handle, "gtk_moz_embed_stop_load"); - _gtk_moz_embed_render_data = dlsym(handle, "gtk_moz_embed_render_data"); - _dw_moz_embed_get_type = dlsym(handle, "gtk_moz_embed_get_type"); - _gtk_moz_embed_new = dlsym(handle, "gtk_moz_embed_new"); - } - else - _dw_mozdir[0] = 0; + void *handle = NULL; + gchar *profile; + handle = dlopen( "libgtkembedmoz.so", RTLD_LAZY ); + + /* If we loaded it, grab the symbols we want */ + if ( handle ) + { + _gtk_moz_embed_go_back = dlsym(handle, "gtk_moz_embed_go_back"); + _gtk_moz_embed_go_forward = dlsym(handle, "gtk_moz_embed_go_forward"); + _gtk_moz_embed_load_url = dlsym(handle, "gtk_moz_embed_load_url"); + _gtk_moz_embed_reload = dlsym(handle, "gtk_moz_embed_reload"); + _gtk_moz_embed_stop_load = dlsym(handle, "gtk_moz_embed_stop_load"); + _gtk_moz_embed_render_data = dlsym(handle, "gtk_moz_embed_render_data"); + _dw_moz_embed_get_type = dlsym(handle, "gtk_moz_embed_get_type"); + _gtk_moz_embed_new = dlsym(handle, "gtk_moz_embed_new"); + _gtk_moz_embed_can_go_back = dlsym(handle, "gtk_moz_embed_can_go_back"); + _gtk_moz_embed_can_go_forward = dlsym(handle, "gtk_moz_embed_can_go_forward"); + gtk_moz_embed_set_comp_path( "/usr/lib/mozilla"); + gtk_moz_embed_set_comp_path( "/usr/lib/firefox"); + profile = g_build_filename(g_get_home_dir(), ".dwindows/mozilla", NULL); + + /* initialize profile */ + gtk_moz_embed_set_profile_path(profile, "dwindows"); + g_free(profile); + + /* startup done */ + gtk_moz_embed_push_startup(); + } } #endif @@ -1977,47 +1949,47 @@ */ int dw_int_init(DWResources *res, int newthread, int *argc, char **argv[]) { - int z; - char *tmp; - - if(res) - { - _resources.resource_max = res->resource_max; - _resources.resource_id = res->resource_id; - _resources.resource_data = res->resource_data; - } - gtk_set_locale(); - g_thread_init(NULL); -#if GTK_MAJOR_VERSION > 1 - gdk_threads_init(); -#endif - - gtk_init(argc, argv); + int z; + char *tmp; + + if(res) + { + _resources.resource_max = res->resource_max; + _resources.resource_id = res->resource_id; + _resources.resource_data = res->resource_data; + } + gtk_set_locale(); + g_thread_init(NULL); +#if GTK_MAJOR_VERSION > 1 + gdk_threads_init(); +#endif + + gtk_init(argc, argv); #ifdef USE_IMLIB - gdk_imlib_init(); -#endif - /* Add colors to the system colormap */ - _dw_cmap = gdk_colormap_get_system(); - for(z=0;z<16;z++) - gdk_color_alloc(_dw_cmap, &_colors[z]); - - tmp = getenv("DW_BORDER_WIDTH"); - if(tmp) - _dw_border_width = atoi(tmp); - tmp = getenv("DW_BORDER_HEIGHT"); - if(tmp) - _dw_border_height = atoi(tmp); - - for(z=0;zeve = dw_event_new(); - dw_event_reset(tmp->eve); - tmp->data = data; - tmp->done = FALSE; - tmp->method = FALSE; - tmp->result = NULL; + DWDialog *tmp = malloc(sizeof(DWDialog)); + + tmp->eve = dw_event_new(); + dw_event_reset(tmp->eve); + tmp->data = data; + tmp->done = FALSE; + tmp->method = FALSE; + tmp->result = NULL; return tmp; } @@ -2126,13 +2098,13 @@ */ int dw_dialog_dismiss(DWDialog *dialog, void *result) { - dialog->result = result; - if(dialog->method) - gtk_main_quit(); - else - dw_event_post(dialog->eve); - dialog->done = TRUE; - return 0; + dialog->result = result; + if(dialog->method) + gtk_main_quit(); + else + dw_event_post(dialog->eve); + dialog->done = TRUE; + return 0; } /* @@ -2143,86 +2115,86 @@ */ void *dw_dialog_wait(DWDialog *dialog) { - void *tmp; - int newprocess = 0; - - /* _dw_thread will be -1 if dw_main hasn't been run yet. */ - if(_dw_thread == (pthread_t)-1) - { - _dw_thread = pthread_self(); - newprocess = 1; - gdk_threads_enter(); - } - - if(pthread_self() == _dw_thread) - { - dialog->method = TRUE; - gtk_main(); - } - else - { - dialog->method = FALSE; - dw_event_wait(dialog->eve, -1); - } - - if(newprocess) - { - _dw_thread = (pthread_t)-1; - gdk_threads_leave(); - } - - dw_event_close(&dialog->eve); - tmp = dialog->result; - free(dialog); - return tmp; + void *tmp; + int newprocess = 0; + + /* _dw_thread will be -1 if dw_main hasn't been run yet. */ + if(_dw_thread == (pthread_t)-1) + { + _dw_thread = pthread_self(); + newprocess = 1; + gdk_threads_enter(); + } + + if(pthread_self() == _dw_thread) + { + dialog->method = TRUE; + gtk_main(); + } + else + { + dialog->method = FALSE; + dw_event_wait(dialog->eve, -1); + } + + if(newprocess) + { + _dw_thread = (pthread_t)-1; + gdk_threads_leave(); + } + + dw_event_close(&dialog->eve); + tmp = dialog->result; + free(dialog); + return tmp; } static int _dw_ok_func(HWND window, void *data) { - DWDialog *dwwait = (DWDialog *)data; - - if(!dwwait) - return FALSE; - - dw_window_destroy((HWND)dwwait->data); - dw_dialog_dismiss((DWDialog *)data, (void *)DW_MB_RETURN_OK); - return FALSE; + DWDialog *dwwait = (DWDialog *)data; + + if(!dwwait) + return FALSE; + + dw_window_destroy((HWND)dwwait->data); + dw_dialog_dismiss((DWDialog *)data, (void *)DW_MB_RETURN_OK); + return FALSE; } int _dw_yes_func(HWND window, void *data) { - DWDialog *dwwait = (DWDialog *)data; - - if(!dwwait) - return FALSE; - - dw_window_destroy((HWND)dwwait->data); - dw_dialog_dismiss((DWDialog *)data, (void *)DW_MB_RETURN_YES); - return FALSE; + DWDialog *dwwait = (DWDialog *)data; + + if(!dwwait) + return FALSE; + + dw_window_destroy((HWND)dwwait->data); + dw_dialog_dismiss((DWDialog *)data, (void *)DW_MB_RETURN_YES); + return FALSE; } int _dw_no_func(HWND window, void *data) { - DWDialog *dwwait = (DWDialog *)data; - - if(!dwwait) - return FALSE; - - dw_window_destroy((HWND)dwwait->data); - dw_dialog_dismiss((DWDialog *)data, (void *)DW_MB_RETURN_NO); - return FALSE; + DWDialog *dwwait = (DWDialog *)data; + + if(!dwwait) + return FALSE; + + dw_window_destroy((HWND)dwwait->data); + dw_dialog_dismiss((DWDialog *)data, (void *)DW_MB_RETURN_NO); + return FALSE; } int _dw_cancel_func(HWND window, void *data) { - DWDialog *dwwait = (DWDialog *)data; - - if(!dwwait) - return FALSE; - - dw_window_destroy((HWND)dwwait->data); - dw_dialog_dismiss((DWDialog *)data, (void *)DW_MB_RETURN_CANCEL); - return FALSE; + DWDialog *dwwait = (DWDialog *)data; + + if(!dwwait) + return FALSE; + + dw_window_destroy((HWND)dwwait->data); + dw_dialog_dismiss((DWDialog *)data, (void *)DW_MB_RETURN_CANCEL); + return FALSE; } /* @@ -2235,147 +2207,147 @@ */ int dw_messagebox(char *title, int flags, char *format, ...) { - HWND entrywindow, texttargetbox, imagetextbox, mainbox, okbutton, nobutton, yesbutton, cancelbutton, buttonbox, stext; - ULONG flStyle = DW_FCF_TITLEBAR | DW_FCF_SHELLPOSITION | DW_FCF_DLGBORDER; - DWDialog *dwwait; - va_list args; - char outbuf[1000]; - char **xpm_data = NULL; - int x, y, extra_width=0,text_width,text_height; - int width,height; - - va_start(args, format); - vsprintf(outbuf, format, args); - va_end(args); - - entrywindow = dw_window_new(HWND_DESKTOP, title, flStyle); - mainbox = dw_box_new(DW_VERT, 10); - dw_box_pack_start(entrywindow, mainbox, 0, 0, TRUE, TRUE, 0); - - /* determine if an icon is to be used - if so we need another HORZ box */ - if((flags & DW_MB_ERROR) | (flags & DW_MB_WARNING) | (flags & DW_MB_INFORMATION) | (flags & DW_MB_QUESTION)) - { - imagetextbox = dw_box_new(DW_HORZ, 0); - dw_box_pack_start(mainbox, imagetextbox, 0, 0, TRUE, TRUE, 2); - texttargetbox = imagetextbox; - } - else - { - imagetextbox = NULL; - texttargetbox = mainbox; - } - - if(flags & DW_MB_ERROR) - xpm_data = (char **)_dw_messagebox_error; - else if(flags & DW_MB_WARNING) - xpm_data = (char **)_dw_messagebox_warning; - else if(flags & DW_MB_INFORMATION) - xpm_data = (char **)_dw_messagebox_information; - else if(flags & DW_MB_QUESTION) - xpm_data = (char **)_dw_messagebox_question; - - if(xpm_data) - extra_width = 32; - - if(texttargetbox == imagetextbox) - { - GdkPixmap *icon_pixmap = NULL; - GdkBitmap *bitmap = NULL; - HWND handle = dw_bitmap_new( 100 ); -#if GTK_MAJOR_VERSION > 1 - GdkPixbuf *icon_pixbuf = gdk_pixbuf_new_from_xpm_data((const char **)xpm_data); - - gdk_pixbuf_render_pixmap_and_mask(icon_pixbuf, &icon_pixmap, &bitmap, 1); - g_object_unref(icon_pixbuf); + HWND entrywindow, texttargetbox, imagetextbox, mainbox, okbutton, nobutton, yesbutton, cancelbutton, buttonbox, stext; + ULONG flStyle = DW_FCF_TITLEBAR | DW_FCF_SHELLPOSITION | DW_FCF_DLGBORDER; + DWDialog *dwwait; + va_list args; + char outbuf[1000]; + char **xpm_data = NULL; + int x, y, extra_width=0,text_width,text_height; + int width,height; + + va_start(args, format); + vsprintf(outbuf, format, args); + va_end(args); + + entrywindow = dw_window_new(HWND_DESKTOP, title, flStyle); + mainbox = dw_box_new(DW_VERT, 10); + dw_box_pack_start(entrywindow, mainbox, 0, 0, TRUE, TRUE, 0); + + /* determine if an icon is to be used - if so we need another HORZ box */ + if((flags & DW_MB_ERROR) | (flags & DW_MB_WARNING) | (flags & DW_MB_INFORMATION) | (flags & DW_MB_QUESTION)) + { + imagetextbox = dw_box_new(DW_HORZ, 0); + dw_box_pack_start(mainbox, imagetextbox, 0, 0, TRUE, TRUE, 2); + texttargetbox = imagetextbox; + } + else + { + imagetextbox = NULL; + texttargetbox = mainbox; + } + + if(flags & DW_MB_ERROR) + xpm_data = (char **)_dw_messagebox_error; + else if(flags & DW_MB_WARNING) + xpm_data = (char **)_dw_messagebox_warning; + else if(flags & DW_MB_INFORMATION) + xpm_data = (char **)_dw_messagebox_information; + else if(flags & DW_MB_QUESTION) + xpm_data = (char **)_dw_messagebox_question; + + if(xpm_data) + extra_width = 32; + + if(texttargetbox == imagetextbox) + { + GdkPixmap *icon_pixmap = NULL; + GdkBitmap *bitmap = NULL; + HWND handle = dw_bitmap_new( 100 ); +#if GTK_MAJOR_VERSION > 1 + GdkPixbuf *icon_pixbuf = gdk_pixbuf_new_from_xpm_data((const char **)xpm_data); + + gdk_pixbuf_render_pixmap_and_mask(icon_pixbuf, &icon_pixmap, &bitmap, 1); + g_object_unref(icon_pixbuf); #elif defined(USE_IMLIB) - gdk_imlib_data_to_pixmap((char **)xpm_data, &icon_pixmap, &bitmap); + gdk_imlib_data_to_pixmap((char **)xpm_data, &icon_pixmap, &bitmap); #else - icon_pixmap = gdk_pixmap_create_from_xpm_d(handle->window, &bitmap, &_colors[DW_CLR_PALEGRAY], (char **)xpm_data); -#endif - -#if GTK_MAJOR_VERSION > 1 - gtk_image_set_from_pixmap(GTK_IMAGE(handle), icon_pixmap, bitmap); + icon_pixmap = gdk_pixmap_create_from_xpm_d(handle->window, &bitmap, &_colors[DW_CLR_PALEGRAY], (char **)xpm_data); +#endif + +#if GTK_MAJOR_VERSION > 1 + gtk_image_set_from_pixmap(GTK_IMAGE(handle), icon_pixmap, bitmap); #else - gtk_pixmap_set(GTK_PIXMAP(handle), icon_pixmap, bitmap); -#endif - - dw_box_pack_start( texttargetbox, handle, 32, 32, FALSE, FALSE, 2); - } - - /* Create text */ - text_width = 240; - text_height = 0; - stext = dw_text_new(outbuf, 0); - dw_window_set_style(stext, DW_DT_WORDBREAK, DW_DT_WORDBREAK); - dw_font_text_extents_get(stext, NULL, outbuf, &width, &height); - height = height+3; - if(width < text_width) - text_height = height*2; - else if(width < text_width*2) - text_height = height*3; - else if(width < text_width*3) - text_height = height*4; - else /* width > (3*text_width) */ - { - text_width = (width / 3) + 60; - text_height = height*4; - } - dw_box_pack_start(texttargetbox, stext, text_width, text_height, TRUE, TRUE, 2); - - /* Buttons */ - buttonbox = dw_box_new(DW_HORZ, 10); - - dw_box_pack_start(mainbox, buttonbox, 0, 0, TRUE, FALSE, 0); - - dwwait = dw_dialog_new((void *)entrywindow); - - /* which buttons ? */ - if(flags & DW_MB_OK) - { - okbutton = dw_button_new("Ok", 1001L); - dw_box_pack_start(buttonbox, okbutton, 50, 30, TRUE, FALSE, 2); - dw_signal_connect(okbutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(_dw_ok_func), (void *)dwwait); - } - else if(flags & DW_MB_OKCANCEL) - { - okbutton = dw_button_new("Ok", 1001L); - dw_box_pack_start(buttonbox, okbutton, 50, 30, TRUE, FALSE, 2); - dw_signal_connect(okbutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(_dw_ok_func), (void *)dwwait); - cancelbutton = dw_button_new("Cancel", 1002L); - dw_box_pack_start(buttonbox, cancelbutton, 50, 30, TRUE, FALSE, 2); - dw_signal_connect(cancelbutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(_dw_cancel_func), (void *)dwwait); - } - else if(flags & DW_MB_YESNO) - { - yesbutton = dw_button_new("Yes", 1001L); - dw_box_pack_start(buttonbox, yesbutton, 50, 30, TRUE, FALSE, 2); - dw_signal_connect(yesbutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(_dw_yes_func), (void *)dwwait); - nobutton = dw_button_new("No", 1002L); - dw_box_pack_start(buttonbox, nobutton, 50, 30, TRUE, FALSE, 2); - dw_signal_connect(nobutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(_dw_no_func), (void *)dwwait); - } - else if(flags & DW_MB_YESNOCANCEL) - { - yesbutton = dw_button_new("Yes", 1001L); - dw_box_pack_start(buttonbox, yesbutton, 50, 30, TRUE, FALSE, 2); - dw_signal_connect(yesbutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(_dw_yes_func), (void *)dwwait); - nobutton = dw_button_new("No", 1002L); - dw_box_pack_start(buttonbox, nobutton, 50, 30, TRUE, FALSE, 2); - dw_signal_connect(nobutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(_dw_no_func), (void *)dwwait); - cancelbutton = dw_button_new("Cancel", 1003L); - dw_box_pack_start(buttonbox, cancelbutton, 50, 30, TRUE, FALSE, 2); - dw_signal_connect(cancelbutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(_dw_cancel_func), (void *)dwwait); - } - - height = max(50,text_height)+100; - x = (dw_screen_width() - (text_width+60+extra_width))/2; - y = (dw_screen_height() - height)/2; - - dw_window_set_pos_size(entrywindow, x, y, (text_width+60+extra_width), height); - - dw_window_show(entrywindow); - - return (int)dw_dialog_wait(dwwait); + gtk_pixmap_set(GTK_PIXMAP(handle), icon_pixmap, bitmap); +#endif + + dw_box_pack_start( texttargetbox, handle, 32, 32, FALSE, FALSE, 2); + } + + /* Create text */ + text_width = 240; + text_height = 0; + stext = dw_text_new(outbuf, 0); + dw_window_set_style(stext, DW_DT_WORDBREAK, DW_DT_WORDBREAK); + dw_font_text_extents_get(stext, NULL, outbuf, &width, &height); + height = height+3; + if(width < text_width) + text_height = height*2; + else if(width < text_width*2) + text_height = height*3; + else if(width < text_width*3) + text_height = height*4; + else /* width > (3*text_width) */ + { + text_width = (width / 3) + 60; + text_height = height*4; + } + dw_box_pack_start(texttargetbox, stext, text_width, text_height, TRUE, TRUE, 2); + + /* Buttons */ + buttonbox = dw_box_new(DW_HORZ, 10); + + dw_box_pack_start(mainbox, buttonbox, 0, 0, TRUE, FALSE, 0); + + dwwait = dw_dialog_new((void *)entrywindow); + + /* which buttons ? */ + if(flags & DW_MB_OK) + { + okbutton = dw_button_new("Ok", 1001L); + dw_box_pack_start(buttonbox, okbutton, 50, 30, TRUE, FALSE, 2); + dw_signal_connect(okbutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(_dw_ok_func), (void *)dwwait); + } + else if(flags & DW_MB_OKCANCEL) + { + okbutton = dw_button_new("Ok", 1001L); + dw_box_pack_start(buttonbox, okbutton, 50, 30, TRUE, FALSE, 2); + dw_signal_connect(okbutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(_dw_ok_func), (void *)dwwait); + cancelbutton = dw_button_new("Cancel", 1002L); + dw_box_pack_start(buttonbox, cancelbutton, 50, 30, TRUE, FALSE, 2); + dw_signal_connect(cancelbutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(_dw_cancel_func), (void *)dwwait); + } + else if(flags & DW_MB_YESNO) + { + yesbutton = dw_button_new("Yes", 1001L); + dw_box_pack_start(buttonbox, yesbutton, 50, 30, TRUE, FALSE, 2); + dw_signal_connect(yesbutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(_dw_yes_func), (void *)dwwait); + nobutton = dw_button_new("No", 1002L); + dw_box_pack_start(buttonbox, nobutton, 50, 30, TRUE, FALSE, 2); + dw_signal_connect(nobutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(_dw_no_func), (void *)dwwait); + } + else if(flags & DW_MB_YESNOCANCEL) + { + yesbutton = dw_button_new("Yes", 1001L); + dw_box_pack_start(buttonbox, yesbutton, 50, 30, TRUE, FALSE, 2); + dw_signal_connect(yesbutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(_dw_yes_func), (void *)dwwait); + nobutton = dw_button_new("No", 1002L); + dw_box_pack_start(buttonbox, nobutton, 50, 30, TRUE, FALSE, 2); + dw_signal_connect(nobutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(_dw_no_func), (void *)dwwait); + cancelbutton = dw_button_new("Cancel", 1003L); + dw_box_pack_start(buttonbox, cancelbutton, 50, 30, TRUE, FALSE, 2); + dw_signal_connect(cancelbutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(_dw_cancel_func), (void *)dwwait); + } + + height = max(50,text_height)+100; + x = (dw_screen_width() - (text_width+60+extra_width))/2; + y = (dw_screen_height() - height)/2; + + dw_window_set_pos_size(entrywindow, x, y, (text_width+60+extra_width), height); + + dw_window_show(entrywindow); + + return (int)dw_dialog_wait(dwwait); } /* @@ -2385,29 +2357,29 @@ */ int dw_window_minimize(HWND handle) { - int _locked_by_me = FALSE; -#if GTK_MAJOR_VERSION > 1 - GtkWidget *mdi = NULL; -#endif - - if(!handle) - return 0; - - DW_MUTEX_LOCK; -#if GTK_MAJOR_VERSION > 1 - if((mdi = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_mdi")) && GTK_IS_MDI(mdi)) - { - gtk_mdi_set_state(GTK_MDI(mdi), handle, CHILD_ICONIFIED); - } - else -#endif - { - XIconifyWindow(GDK_WINDOW_XDISPLAY(GTK_WIDGET(handle)->window), - GDK_WINDOW_XWINDOW(GTK_WIDGET(handle)->window), - DefaultScreen (GDK_DISPLAY ())); - } - DW_MUTEX_UNLOCK; - return 0; + int _locked_by_me = FALSE; +#if GTK_MAJOR_VERSION > 1 + GtkWidget *mdi = NULL; +#endif + + if(!handle) + return 0; + + DW_MUTEX_LOCK; +#if GTK_MAJOR_VERSION > 1 + if((mdi = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_mdi")) && GTK_IS_MDI(mdi)) + { + gtk_mdi_set_state(GTK_MDI(mdi), handle, CHILD_ICONIFIED); + } + else +#endif + { + XIconifyWindow(GDK_WINDOW_XDISPLAY(GTK_WIDGET(handle)->window), + GDK_WINDOW_XWINDOW(GTK_WIDGET(handle)->window), + DefaultScreen (GDK_DISPLAY ())); + } + DW_MUTEX_UNLOCK; + return 0; } /* @@ -2417,15 +2389,15 @@ */ int dw_window_raise(HWND handle) { - int _locked_by_me = FALSE; - - if(!handle) - return 0; - - DW_MUTEX_LOCK; - gdk_window_raise(GTK_WIDGET(handle)->window); - DW_MUTEX_UNLOCK; - return 0; + int _locked_by_me = FALSE; + + if(!handle) + return 0; + + DW_MUTEX_LOCK; + gdk_window_raise(GTK_WIDGET(handle)->window); + DW_MUTEX_UNLOCK; + return 0; } /* @@ -2435,15 +2407,15 @@ */ int dw_window_lower(HWND handle) { - int _locked_by_me = FALSE; - - if(!handle) - return 0; - - DW_MUTEX_LOCK; - gdk_window_lower(GTK_WIDGET(handle)->window); - DW_MUTEX_UNLOCK; - return 0; + int _locked_by_me = FALSE; + + if(!handle) + return 0; + + DW_MUTEX_LOCK; + gdk_window_lower(GTK_WIDGET(handle)->window); + DW_MUTEX_UNLOCK; + return 0; } /* @@ -2453,48 +2425,48 @@ */ int dw_window_show(HWND handle) { - int _locked_by_me = FALSE; - GtkWidget *defaultitem; -#if GTK_MAJOR_VERSION > 1 - GtkWidget *mdi; -#endif - - if(!handle) - return 0; - - DW_MUTEX_LOCK; - gtk_widget_show(handle); -#if GTK_MAJOR_VERSION > 1 - if((mdi = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_mdi")) && GTK_IS_MDI(mdi)) - { - gtk_mdi_set_state(GTK_MDI(mdi), handle, CHILD_NORMAL); - } - else -#endif - { - if(GTK_WIDGET(handle)->window) - { - int width = (int)gtk_object_get_data(GTK_OBJECT(handle), "_dw_width"); - int height = (int)gtk_object_get_data(GTK_OBJECT(handle), "_dw_height"); - - if(width && height) - { - gtk_widget_set_usize(handle, width, height); - gtk_object_set_data(GTK_OBJECT(handle), "_dw_width", 0); - gtk_object_set_data(GTK_OBJECT(handle), "_dw_height", 0); - } - - gdk_window_raise(GTK_WIDGET(handle)->window); - gdk_flush(); - gdk_window_show(GTK_WIDGET(handle)->window); - gdk_flush(); - } - defaultitem = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_defaultitem"); - if(defaultitem) - gtk_widget_grab_focus(defaultitem); - } - DW_MUTEX_UNLOCK; - return 0; + int _locked_by_me = FALSE; + GtkWidget *defaultitem; +#if GTK_MAJOR_VERSION > 1 + GtkWidget *mdi; +#endif + + if (!handle) + return 0; + + DW_MUTEX_LOCK; + gtk_widget_show(handle); +#if GTK_MAJOR_VERSION > 1 + if ((mdi = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_mdi")) && GTK_IS_MDI(mdi)) + { + gtk_mdi_set_state(GTK_MDI(mdi), handle, CHILD_NORMAL); + } + else +#endif + { + if (GTK_WIDGET(handle)->window) + { + int width = (int)gtk_object_get_data(GTK_OBJECT(handle), "_dw_width"); + int height = (int)gtk_object_get_data(GTK_OBJECT(handle), "_dw_height"); + + if (width && height) + { + gtk_widget_set_usize(handle, width, height); + gtk_object_set_data(GTK_OBJECT(handle), "_dw_width", GINT_TO_POINTER(0)); + gtk_object_set_data(GTK_OBJECT(handle), "_dw_height", GINT_TO_POINTER(0)); + } + + gdk_window_raise(GTK_WIDGET(handle)->window); + gdk_flush(); + gdk_window_show(GTK_WIDGET(handle)->window); + gdk_flush(); + } + defaultitem = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_defaultitem"); + if (defaultitem) + gtk_widget_grab_focus(defaultitem); + } + DW_MUTEX_UNLOCK; + return 0; } /* @@ -2504,25 +2476,25 @@ */ int dw_window_hide(HWND handle) { - int _locked_by_me = FALSE; -#if GTK_MAJOR_VERSION > 1 - GtkWidget *mdi = NULL; -#endif - - if(!handle) - return 0; - - DW_MUTEX_LOCK; -#if GTK_MAJOR_VERSION > 1 - if((mdi = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_mdi")) && GTK_IS_MDI(mdi)) - { - gtk_mdi_set_state(GTK_MDI(mdi), handle, CHILD_ICONIFIED); - } - else -#endif - gtk_widget_hide(handle); - DW_MUTEX_UNLOCK; - return 0; + int _locked_by_me = FALSE; +#if GTK_MAJOR_VERSION > 1 + GtkWidget *mdi = NULL; +#endif + + if(!handle) + return 0; + + DW_MUTEX_LOCK; +#if GTK_MAJOR_VERSION > 1 + if((mdi = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_mdi")) && GTK_IS_MDI(mdi)) + { + gtk_mdi_set_state(GTK_MDI(mdi), handle, CHILD_ICONIFIED); + } + else +#endif + gtk_widget_hide(handle); + DW_MUTEX_UNLOCK; + return 0; } /* @@ -2532,32 +2504,32 @@ */ int dw_window_destroy(HWND handle) { - int _locked_by_me = FALSE; -#if GTK_MAJOR_VERSION > 1 - GtkWidget *mdi = NULL; -#endif - - if(!handle) - return 0; - - DW_MUTEX_LOCK; -#if GTK_MAJOR_VERSION > 1 - if((mdi = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_mdi")) && GTK_IS_MDI(mdi)) - { - gtk_mdi_remove(GTK_MDI(mdi), handle); - } -#endif - if(GTK_IS_WIDGET(handle)) - { - GtkWidget *eventbox = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_eventbox"); - - if(eventbox && GTK_IS_WIDGET(eventbox)) - gtk_widget_destroy(eventbox); - else - gtk_widget_destroy(handle); - } - DW_MUTEX_UNLOCK; - return 0; + int _locked_by_me = FALSE; +#if GTK_MAJOR_VERSION > 1 + GtkWidget *mdi = NULL; +#endif + + if(!handle) + return 0; + + DW_MUTEX_LOCK; +#if GTK_MAJOR_VERSION > 1 + if((mdi = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_mdi")) && GTK_IS_MDI(mdi)) + { + gtk_mdi_remove(GTK_MDI(mdi), handle); + } +#endif + if(GTK_IS_WIDGET(handle)) + { + GtkWidget *eventbox = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_eventbox"); + + if(eventbox && GTK_IS_WIDGET(eventbox)) + gtk_widget_destroy(eventbox); + else + gtk_widget_destroy(handle); + } + DW_MUTEX_UNLOCK; + return 0; } /* Causes entire window to be invalidated and redrawn. @@ -2576,39 +2548,39 @@ */ void dw_window_reparent(HWND handle, HWND newparent) { - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - gdk_window_reparent(GTK_WIDGET(handle)->window, newparent ? GTK_WIDGET(newparent)->window : GDK_ROOT_PARENT(), 0, 0); - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + gdk_window_reparent(GTK_WIDGET(handle)->window, newparent ? GTK_WIDGET(newparent)->window : GDK_ROOT_PARENT(), 0, 0); + DW_MUTEX_UNLOCK; } static int _set_font(HWND handle, char *fontname) { - int retval = FALSE; + int retval = FALSE; #if GTK_MAJOR_VERSION < 2 - GtkStyle *style; - GdkFont *font = NULL; - - font = gdk_font_load(fontname); - - if(font) - { - style = gtk_widget_get_style(handle); - style->font = font; - gtk_widget_set_style(handle, style); - retval = TRUE; - } + GtkStyle *style; + GdkFont *font = NULL; + + font = gdk_font_load(fontname); + + if(font) + { + style = gtk_widget_get_style(handle); + style->font = font; + gtk_widget_set_style(handle, style); + retval = TRUE; + } #else - PangoFontDescription *font = pango_font_description_from_string(fontname); - - if(font) - { - gtk_widget_modify_font(handle, font); - pango_font_description_free(font); - } -#endif - return retval; + PangoFontDescription *font = pango_font_description_from_string(fontname); + + if(font) + { + gtk_widget_modify_font(handle, font); + pango_font_description_free(font); + } +#endif + return retval; } /* @@ -2620,180 +2592,180 @@ int dw_window_set_font(HWND handle, char *fontname) { #if GTK_MAJOR_VERSION > 1 - PangoFontDescription *pfont; + PangoFontDescription *pfont; #else - GdkFont *gdkfont; -#endif - GtkWidget *handle2 = handle; - char *font; - int _locked_by_me = FALSE; - gpointer data; - - DW_MUTEX_LOCK; - if(GTK_IS_SCROLLED_WINDOW(handle)) - { - GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - if(tmp) - handle2 = tmp; - } - font = strdup(fontname); + GdkFont *gdkfont; +#endif + GtkWidget *handle2 = handle; + char *font; + int _locked_by_me = FALSE; + gpointer data; + + DW_MUTEX_LOCK; + if(GTK_IS_SCROLLED_WINDOW(handle)) + { + GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + if(tmp) + handle2 = tmp; + } + font = strdup(fontname); #if GTK_MAJOR_VERSION < 2 - /* Free old font if it exists */ - gdkfont = (GdkFont *)gtk_object_get_data(GTK_OBJECT(handle2), "_dw_gdkfont"); - if(gdkfont) - gdk_font_unref(gdkfont); - gdkfont = gdk_font_load(fontname); - if(!gdkfont) - gdkfont = gdk_font_load("fixed"); - gtk_object_set_data(GTK_OBJECT(handle2), "_dw_gdkfont", (gpointer)gdkfont); -#endif - - /* Free old font name if one is allocated */ - data = gtk_object_get_data(GTK_OBJECT(handle2), "_dw_fontname"); - if(data) - free(data); - - gtk_object_set_data(GTK_OBJECT(handle2), "_dw_fontname", (gpointer)font); -#if GTK_MAJOR_VERSION > 1 - pfont = pango_font_description_from_string(fontname); - - if(pfont) - { - gtk_widget_modify_font(handle2, pfont); - pango_font_description_free(pfont); - } -#endif - DW_MUTEX_UNLOCK; - return TRUE; + /* Free old font if it exists */ + gdkfont = (GdkFont *)gtk_object_get_data(GTK_OBJECT(handle2), "_dw_gdkfont"); + if(gdkfont) + gdk_font_unref(gdkfont); + gdkfont = gdk_font_load(fontname); + if(!gdkfont) + gdkfont = gdk_font_load("fixed"); + gtk_object_set_data(GTK_OBJECT(handle2), "_dw_gdkfont", (gpointer)gdkfont); +#endif + + /* Free old font name if one is allocated */ + data = gtk_object_get_data(GTK_OBJECT(handle2), "_dw_fontname"); + if(data) + free(data); + + gtk_object_set_data(GTK_OBJECT(handle2), "_dw_fontname", (gpointer)font); +#if GTK_MAJOR_VERSION > 1 + pfont = pango_font_description_from_string(fontname); + + if(pfont) + { + gtk_widget_modify_font(handle2, pfont); + pango_font_description_free(pfont); + } +#endif + DW_MUTEX_UNLOCK; + return TRUE; } void _free_gdk_colors(HWND handle) { - GdkColor *old = (GdkColor *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_foregdk"); - - if(old) - free(old); - - old = (GdkColor *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_backgdk"); - - if(old) - free(old); + GdkColor *old = (GdkColor *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_foregdk"); + + if(old) + free(old); + + old = (GdkColor *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_backgdk"); + + if(old) + free(old); } /* Free old color pointers and allocate new ones */ static void _save_gdk_colors(HWND handle, GdkColor fore, GdkColor back) { - GdkColor *foregdk = malloc(sizeof(GdkColor)); - GdkColor *backgdk = malloc(sizeof(GdkColor)); - - _free_gdk_colors(handle); - - *foregdk = fore; - *backgdk = back; - - gtk_object_set_data(GTK_OBJECT(handle), "_dw_foregdk", (gpointer)foregdk); - gtk_object_set_data(GTK_OBJECT(handle), "_dw_backgdk", (gpointer)backgdk); + GdkColor *foregdk = malloc(sizeof(GdkColor)); + GdkColor *backgdk = malloc(sizeof(GdkColor)); + + _free_gdk_colors(handle); + + *foregdk = fore; + *backgdk = back; + + gtk_object_set_data(GTK_OBJECT(handle), "_dw_foregdk", (gpointer)foregdk); + gtk_object_set_data(GTK_OBJECT(handle), "_dw_backgdk", (gpointer)backgdk); } static int _set_color(HWND handle, unsigned long fore, unsigned long back) { - /* Remember that each color component in X11 use 16 bit no matter - * what the destination display supports. (and thus GDK) - */ - GdkColor forecolor, backcolor; + /* Remember that each color component in X11 use 16 bit no matter + * what the destination display supports. (and thus GDK) + */ + GdkColor forecolor, backcolor; #if GTK_MAJOR_VERSION < 2 - GtkStyle *style = gtk_style_copy(gtk_widget_get_style(handle)); -#endif - - if(fore & DW_RGB_COLOR) - { - forecolor.pixel = 0; - forecolor.red = DW_RED_VALUE(fore) << 8; - forecolor.green = DW_GREEN_VALUE(fore) << 8; - forecolor.blue = DW_BLUE_VALUE(fore) << 8; - - gdk_color_alloc(_dw_cmap, &forecolor); - -#if GTK_MAJOR_VERSION > 1 - gtk_widget_modify_text(handle, 0, &forecolor); - gtk_widget_modify_text(handle, 1, &forecolor); - gtk_widget_modify_fg(handle, 0, &forecolor); - gtk_widget_modify_fg(handle, 1, &forecolor); + GtkStyle *style = gtk_style_copy(gtk_widget_get_style(handle)); +#endif + + if(fore & DW_RGB_COLOR) + { + forecolor.pixel = 0; + forecolor.red = DW_RED_VALUE(fore) << 8; + forecolor.green = DW_GREEN_VALUE(fore) << 8; + forecolor.blue = DW_BLUE_VALUE(fore) << 8; + + gdk_color_alloc(_dw_cmap, &forecolor); + +#if GTK_MAJOR_VERSION > 1 + gtk_widget_modify_text(handle, 0, &forecolor); + gtk_widget_modify_text(handle, 1, &forecolor); + gtk_widget_modify_fg(handle, 0, &forecolor); + gtk_widget_modify_fg(handle, 1, &forecolor); #else - if(style) - style->text[0] = style->text[1] = style->fg[0] = style->fg[1] = forecolor; -#endif - } - else if(fore != DW_CLR_DEFAULT) - { - forecolor = _colors[fore]; - -#if GTK_MAJOR_VERSION > 1 - gtk_widget_modify_text(handle, 0, &_colors[fore]); - gtk_widget_modify_text(handle, 1, &_colors[fore]); - gtk_widget_modify_fg(handle, 0, &_colors[fore]); - gtk_widget_modify_fg(handle, 1, &_colors[fore]); + if(style) + style->text[0] = style->text[1] = style->fg[0] = style->fg[1] = forecolor; +#endif + } + else if(fore != DW_CLR_DEFAULT) + { + forecolor = _colors[fore]; + +#if GTK_MAJOR_VERSION > 1 + gtk_widget_modify_text(handle, 0, &_colors[fore]); + gtk_widget_modify_text(handle, 1, &_colors[fore]); + gtk_widget_modify_fg(handle, 0, &_colors[fore]); + gtk_widget_modify_fg(handle, 1, &_colors[fore]); #else - if(style) - style->text[0] = style->text[1] = style->fg[0] = style->fg[1] = _colors[fore]; -#endif - } - if(back & DW_RGB_COLOR) - { - backcolor.pixel = 0; - backcolor.red = DW_RED_VALUE(back) << 8; - backcolor.green = DW_GREEN_VALUE(back) << 8; - backcolor.blue = DW_BLUE_VALUE(back) << 8; - - gdk_color_alloc(_dw_cmap, &backcolor); - -#if GTK_MAJOR_VERSION > 1 - gtk_widget_modify_base(handle, 0, &backcolor); - gtk_widget_modify_base(handle, 1, &backcolor); - gtk_widget_modify_bg(handle, 0, &backcolor); - gtk_widget_modify_bg(handle, 1, &backcolor); + if(style) + style->text[0] = style->text[1] = style->fg[0] = style->fg[1] = _colors[fore]; +#endif + } + if(back & DW_RGB_COLOR) + { + backcolor.pixel = 0; + backcolor.red = DW_RED_VALUE(back) << 8; + backcolor.green = DW_GREEN_VALUE(back) << 8; + backcolor.blue = DW_BLUE_VALUE(back) << 8; + + gdk_color_alloc(_dw_cmap, &backcolor); + +#if GTK_MAJOR_VERSION > 1 + gtk_widget_modify_base(handle, 0, &backcolor); + gtk_widget_modify_base(handle, 1, &backcolor); + gtk_widget_modify_bg(handle, 0, &backcolor); + gtk_widget_modify_bg(handle, 1, &backcolor); #else - if(style) - style->base[0] = style->base[1] = style->bg[0] = style->bg[1] = backcolor; -#endif - } - else if(back != DW_CLR_DEFAULT) - { - backcolor = _colors[back]; - -#if GTK_MAJOR_VERSION > 1 - gtk_widget_modify_base(handle, 0, &_colors[back]); - gtk_widget_modify_base(handle, 1, &_colors[back]); - gtk_widget_modify_bg(handle, 0, &_colors[back]); - gtk_widget_modify_bg(handle, 1, &_colors[back]); + if(style) + style->base[0] = style->base[1] = style->bg[0] = style->bg[1] = backcolor; +#endif + } + else if(back != DW_CLR_DEFAULT) + { + backcolor = _colors[back]; + +#if GTK_MAJOR_VERSION > 1 + gtk_widget_modify_base(handle, 0, &_colors[back]); + gtk_widget_modify_base(handle, 1, &_colors[back]); + gtk_widget_modify_bg(handle, 0, &_colors[back]); + gtk_widget_modify_bg(handle, 1, &_colors[back]); #else - if(style) - style->base[0] = style->base[1] = style->bg[0] = style->bg[1] = _colors[back]; -#endif - } - - _save_gdk_colors(handle, forecolor, backcolor); - - if(GTK_IS_CLIST(handle)) - { - int z, rowcount = (int)gtk_object_get_data(GTK_OBJECT(handle), "_dw_rowcount"); - - for(z=0;zbase[0] = style->base[1] = style->bg[0] = style->bg[1] = _colors[back]; +#endif + } + + _save_gdk_colors(handle, forecolor, backcolor); + + if(GTK_IS_CLIST(handle)) + { + int z, rowcount = (int)gtk_object_get_data(GTK_OBJECT(handle), "_dw_rowcount"); + + for(z=0;zwindow, TRUE, GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_PRESS_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK, NULL, NULL, GDK_CURRENT_TIME); - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + gdk_pointer_grab(handle->window, TRUE, GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_PRESS_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK, NULL, NULL, GDK_CURRENT_TIME); + DW_MUTEX_UNLOCK; } /* @@ -2862,25 +2834,25 @@ */ void dw_window_set_pointer(HWND handle, int pointertype) { - int _locked_by_me = FALSE; - GdkCursor *cursor; - - DW_MUTEX_LOCK; - if(pointertype & (1 << 31)) - { - GdkBitmap *bitmap = NULL; - GdkPixmap *pixmap = _find_private_pixmap(&bitmap, (pointertype & 0xFFFFFF), NULL, NULL); - cursor = gdk_cursor_new_from_pixmap(pixmap, (GdkPixmap *)bitmap, &_colors[DW_CLR_WHITE], &_colors[DW_CLR_BLACK], 8, 8); - } - else if(!pointertype) - cursor = NULL; - else - cursor = gdk_cursor_new(pointertype); - if(handle && handle->window) - gdk_window_set_cursor(handle->window, cursor); - if(cursor) - gdk_cursor_destroy(cursor); - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; + GdkCursor *cursor; + + DW_MUTEX_LOCK; + if(pointertype & (1 << 31)) + { + GdkBitmap *bitmap = NULL; + GdkPixmap *pixmap = _find_private_pixmap(&bitmap, (pointertype & 0xFFFFFF), NULL, NULL); + cursor = gdk_cursor_new_from_pixmap(pixmap, (GdkPixmap *)bitmap, &_colors[DW_CLR_WHITE], &_colors[DW_CLR_BLACK], 8, 8); + } + else if(!pointertype) + cursor = NULL; + else + cursor = gdk_cursor_new(pointertype); + if(handle && handle->window) + gdk_window_set_cursor(handle->window, cursor); + if(cursor) + gdk_cursor_destroy(cursor); + DW_MUTEX_UNLOCK; } /* @@ -2888,11 +2860,11 @@ */ void dw_window_release(void) { - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - gdk_pointer_ungrab(GDK_CURRENT_TIME); - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + gdk_pointer_ungrab(GDK_CURRENT_TIME); + DW_MUTEX_UNLOCK; } /* @@ -2904,75 +2876,75 @@ */ HWND dw_window_new(HWND hwndOwner, char *title, unsigned long flStyle) { - GtkWidget *tmp; - int _locked_by_me = FALSE; - int flags = 0; - - DW_MUTEX_LOCK; -#if GTK_MAJOR_VERSION > 1 - if(hwndOwner && GTK_IS_MDI(hwndOwner)) - { - GtkWidget *label; - - tmp = dw_box_new(DW_VERT, 0); - - label = gtk_label_new(title); - gtk_widget_show(label); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_mdi_child", (gpointer)1); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_mdi_title", (gpointer)label); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_mdi", (gpointer)hwndOwner); - - gtk_mdi_put(GTK_MDI(hwndOwner), tmp, 100, 75, label); - } - else -#endif - { - last_window = tmp = gtk_window_new(GTK_WINDOW_TOPLEVEL); - - gtk_window_set_title(GTK_WINDOW(tmp), title); - if(!(flStyle & DW_FCF_SIZEBORDER)) - gtk_window_set_policy(GTK_WINDOW(tmp), FALSE, FALSE, TRUE); - - gtk_widget_realize(tmp); - - if(flStyle & DW_FCF_TITLEBAR) - flags |= GDK_DECOR_TITLE; - - if(flStyle & DW_FCF_MINMAX) - flags |= GDK_DECOR_MINIMIZE | GDK_DECOR_MAXIMIZE; - - if(flStyle & DW_FCF_SIZEBORDER) - flags |= GDK_DECOR_RESIZEH | GDK_DECOR_BORDER; - - if(flStyle & DW_FCF_BORDER || flStyle & DW_FCF_DLGBORDER) - flags |= GDK_DECOR_BORDER; - - if(flStyle & DW_FCF_MAXIMIZE) - { - flags &= ~DW_FCF_MAXIMIZE; -#if GTK_MAJOR_VERSION > 1 - gtk_window_maximize(GTK_WINDOW(tmp)); -#endif - } - if(flStyle & DW_FCF_MINIMIZE) - { - flags &= ~DW_FCF_MINIMIZE; -#if GTK_MAJOR_VERSION > 1 - gtk_window_iconify(GTK_WINDOW(tmp)); -#endif - } - - gdk_window_set_decorations(tmp->window, flags); - - if(hwndOwner) - gdk_window_reparent(GTK_WIDGET(tmp)->window, GTK_WIDGET(hwndOwner)->window, 0, 0); - - if(flStyle & DW_FCF_SIZEBORDER) - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_size", (gpointer)1); - } - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_style", (gpointer)flStyle); - DW_MUTEX_UNLOCK; - return tmp; + GtkWidget *tmp; + int _locked_by_me = FALSE; + int flags = 0; + + DW_MUTEX_LOCK; +#if GTK_MAJOR_VERSION > 1 + if(hwndOwner && GTK_IS_MDI(hwndOwner)) + { + GtkWidget *label; + + tmp = dw_box_new(DW_VERT, 0); + + label = gtk_label_new(title); + gtk_widget_show(label); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_mdi_child", GINT_TO_POINTER(1)); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_mdi_title", (gpointer)label); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_mdi", (gpointer)hwndOwner); + + gtk_mdi_put(GTK_MDI(hwndOwner), tmp, 100, 75, label); + } + else +#endif + { + last_window = tmp = gtk_window_new(GTK_WINDOW_TOPLEVEL); + + gtk_window_set_title(GTK_WINDOW(tmp), title); + if(!(flStyle & DW_FCF_SIZEBORDER)) + gtk_window_set_policy(GTK_WINDOW(tmp), FALSE, FALSE, TRUE); + + gtk_widget_realize(tmp); + + if(flStyle & DW_FCF_TITLEBAR) + flags |= GDK_DECOR_TITLE; + + if(flStyle & DW_FCF_MINMAX) + flags |= GDK_DECOR_MINIMIZE | GDK_DECOR_MAXIMIZE; + + if(flStyle & DW_FCF_SIZEBORDER) + flags |= GDK_DECOR_RESIZEH | GDK_DECOR_BORDER; + + if(flStyle & DW_FCF_BORDER || flStyle & DW_FCF_DLGBORDER) + flags |= GDK_DECOR_BORDER; + + if(flStyle & DW_FCF_MAXIMIZE) + { + flags &= ~DW_FCF_MAXIMIZE; +#if GTK_MAJOR_VERSION > 1 + gtk_window_maximize(GTK_WINDOW(tmp)); +#endif + } + if(flStyle & DW_FCF_MINIMIZE) + { + flags &= ~DW_FCF_MINIMIZE; +#if GTK_MAJOR_VERSION > 1 + gtk_window_iconify(GTK_WINDOW(tmp)); +#endif + } + + gdk_window_set_decorations(tmp->window, flags); + + if(hwndOwner) + gdk_window_reparent(GTK_WIDGET(tmp)->window, GTK_WIDGET(hwndOwner)->window, 0, 0); + + if(flStyle & DW_FCF_SIZEBORDER) + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_size", GINT_TO_POINTER(1)); + } + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_style", GINT_TO_POINTER(flStyle)); + DW_MUTEX_UNLOCK; + return tmp; } /* @@ -2983,20 +2955,20 @@ */ HWND dw_box_new(int type, int pad) { - GtkWidget *tmp, *eventbox; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - tmp = gtk_table_new(1, 1, FALSE); - eventbox = gtk_event_box_new(); - - gtk_widget_show(eventbox); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_eventbox", (gpointer)eventbox); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_boxtype", (gpointer)type); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_boxpad", (gpointer)pad); - gtk_widget_show(tmp); - DW_MUTEX_UNLOCK; - return tmp; + GtkWidget *tmp, *eventbox; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + tmp = gtk_table_new(1, 1, FALSE); + eventbox = gtk_event_box_new(); + + gtk_widget_show(eventbox); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_eventbox", (gpointer)eventbox); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_boxtype", GINT_TO_POINTER(type)); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_boxpad", GINT_TO_POINTER(pad)); + gtk_widget_show(tmp); + DW_MUTEX_UNLOCK; + return tmp; } /* @@ -3008,23 +2980,23 @@ */ HWND dw_groupbox_new(int type, int pad, char *title) { - GtkWidget *tmp, *frame; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - frame = gtk_frame_new(NULL); - gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_ETCHED_IN); - gtk_frame_set_label(GTK_FRAME(frame), title && *title ? title : NULL); - tmp = gtk_table_new(1, 1, FALSE); - gtk_container_border_width(GTK_CONTAINER(tmp), pad); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_boxtype", (gpointer)type); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_boxpad", (gpointer)pad); - gtk_object_set_data(GTK_OBJECT(frame), "_dw_boxhandle", (gpointer)tmp); - gtk_container_add(GTK_CONTAINER(frame), tmp); - gtk_widget_show(tmp); - gtk_widget_show(frame); - DW_MUTEX_UNLOCK; - return frame; + GtkWidget *tmp, *frame; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + frame = gtk_frame_new(NULL); + gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_ETCHED_IN); + gtk_frame_set_label(GTK_FRAME(frame), title && *title ? title : NULL); + tmp = gtk_table_new(1, 1, FALSE); + gtk_container_border_width(GTK_CONTAINER(tmp), pad); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_boxtype", GINT_TO_POINTER(type)); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_boxpad", GINT_TO_POINTER(pad)); + gtk_object_set_data(GTK_OBJECT(frame), "_dw_boxhandle", (gpointer)tmp); + gtk_container_add(GTK_CONTAINER(frame), tmp); + gtk_widget_show(tmp); + gtk_widget_show(frame); + DW_MUTEX_UNLOCK; + return frame; } /* @@ -3034,18 +3006,18 @@ */ HWND dw_mdi_new(unsigned long id) { - GtkWidget *tmp; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; -#if GTK_MAJOR_VERSION > 1 - tmp = gtk_mdi_new(); + GtkWidget *tmp; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; +#if GTK_MAJOR_VERSION > 1 + tmp = gtk_mdi_new(); #else - tmp = gtk_vbox_new(FALSE, 0); -#endif - gtk_widget_show(tmp); - DW_MUTEX_UNLOCK; - return tmp; + tmp = gtk_vbox_new(FALSE, 0); +#endif + gtk_widget_show(tmp); + DW_MUTEX_UNLOCK; + return tmp; } /* @@ -3056,35 +3028,35 @@ HWND dw_bitmap_new(unsigned long id) { #if GTK_MAJOR_VERSION < 2 - GdkPixmap *pixmap = NULL; - GdkBitmap *bitmap = NULL; - static char * test_xpm[] = { - "1 1 2 1", - " c None", - ". c #FFFFFF", - "."}; -#endif - GtkWidget *tmp; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; -#if GTK_MAJOR_VERSION > 1 - tmp = gtk_image_new(); + GdkPixmap *pixmap = NULL; + GdkBitmap *bitmap = NULL; + static char * test_xpm[] = { + "1 1 2 1", + " c None", + ". c #FFFFFF", + "."}; +#endif + GtkWidget *tmp; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; +#if GTK_MAJOR_VERSION > 1 + tmp = gtk_image_new(); #elif defined(USE_IMLIB) - gdk_imlib_data_to_pixmap(test_xpm, &pixmap, &bitmap); + gdk_imlib_data_to_pixmap(test_xpm, &pixmap, &bitmap); #else - gtk_widget_realize(last_window); - - if(last_window) - pixmap = gdk_pixmap_create_from_xpm_d(last_window->window, &bitmap, &_colors[DW_CLR_PALEGRAY], test_xpm); + gtk_widget_realize(last_window); + + if(last_window) + pixmap = gdk_pixmap_create_from_xpm_d(last_window->window, &bitmap, &_colors[DW_CLR_PALEGRAY], test_xpm); #endif #if GTK_MAJOR_VERSION < 2 - tmp = gtk_pixmap_new(pixmap, bitmap); -#endif - gtk_widget_show(tmp); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", (gpointer)id); - DW_MUTEX_UNLOCK; - return tmp; + tmp = gtk_pixmap_new(pixmap, bitmap); +#endif + gtk_widget_show(tmp); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", GINT_TO_POINTER(id)); + DW_MUTEX_UNLOCK; + return tmp; } /* @@ -3095,24 +3067,24 @@ */ HWND dw_notebook_new(unsigned long id, int top) { - GtkWidget *tmp, **pagearray = calloc(sizeof(GtkWidget *), 256); - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - tmp = gtk_notebook_new(); - if(top) - gtk_notebook_set_tab_pos(GTK_NOTEBOOK(tmp), GTK_POS_TOP); - else - gtk_notebook_set_tab_pos(GTK_NOTEBOOK(tmp), GTK_POS_BOTTOM); - gtk_notebook_set_scrollable(GTK_NOTEBOOK(tmp), TRUE); + GtkWidget *tmp, **pagearray = calloc(sizeof(GtkWidget *), 256); + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + tmp = gtk_notebook_new(); + if(top) + gtk_notebook_set_tab_pos(GTK_NOTEBOOK(tmp), GTK_POS_TOP); + else + gtk_notebook_set_tab_pos(GTK_NOTEBOOK(tmp), GTK_POS_BOTTOM); + gtk_notebook_set_scrollable(GTK_NOTEBOOK(tmp), TRUE); #if 0 - gtk_notebook_popup_enable(GTK_NOTEBOOK(tmp)); -#endif - gtk_widget_show(tmp); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", (gpointer)id); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_pagearray", (gpointer)pagearray); - DW_MUTEX_UNLOCK; - return tmp; + gtk_notebook_popup_enable(GTK_NOTEBOOK(tmp)); +#endif + gtk_widget_show(tmp); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", GINT_TO_POINTER(id)); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_pagearray", (gpointer)pagearray); + DW_MUTEX_UNLOCK; + return tmp; } /* @@ -3123,44 +3095,48 @@ */ HMENUI dw_menu_new(unsigned long id) { - int _locked_by_me = FALSE; - GtkAccelGroup *accel_group; - HMENUI tmp; - - DW_MUTEX_LOCK; - tmp = gtk_menu_new(); - gtk_widget_show(tmp); - accel_group = gtk_accel_group_new(); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", (gpointer)id); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_accel", (gpointer)accel_group); - DW_MUTEX_UNLOCK; - return tmp; + int _locked_by_me = FALSE; + GtkAccelGroup *accel_group; + HMENUI tmp; + + DW_MUTEX_LOCK; + tmp = gtk_menu_new(); + gtk_widget_show(tmp); + accel_group = gtk_accel_group_new(); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", GINT_TO_POINTER(id)); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_accel", (gpointer)accel_group); + DW_MUTEX_UNLOCK; + return tmp; } /* * Create a menubar on a window. * Parameters: * location: Handle of a window frame to be attached to. + * If there is no box already packed into the "location", the menu will not appear + * so tell the user. */ HMENUI dw_menubar_new(HWND location) { - GtkWidget *box; - int _locked_by_me = FALSE; - GtkAccelGroup *accel_group; - HMENUI tmp; - - DW_MUTEX_LOCK; - tmp = gtk_menu_bar_new(); - box = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(location)); - gtk_widget_show(tmp); - accel_group = gtk_accel_group_new(); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_accel", (gpointer)accel_group); - - if(box) - gtk_box_pack_end(GTK_BOX(box), tmp, FALSE, FALSE, 0); - - DW_MUTEX_UNLOCK; - return tmp; + GtkWidget *box; + int _locked_by_me = FALSE; + GtkAccelGroup *accel_group; + HMENUI tmp; + + DW_MUTEX_LOCK; + tmp = gtk_menu_bar_new(); + box = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(location)); + gtk_widget_show(tmp); + accel_group = gtk_accel_group_new(); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_accel", (gpointer)accel_group); + + if (box) + gtk_box_pack_end(GTK_BOX(box), tmp, FALSE, FALSE, 0); + else + fprintf(stderr,"dw_menubar_new(): Coding error: You MUST pack a box into the window in which this menubar is to be added BEFORE calling this function.\n"); + + DW_MUTEX_UNLOCK; + return tmp; } /* @@ -3170,38 +3146,38 @@ */ void dw_menu_destroy(HMENUI *menu) { - if(menu && *menu) - { - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - gtk_widget_destroy(*menu); - *menu = NULL; - DW_MUTEX_UNLOCK; - } + if(menu && *menu) + { + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + gtk_widget_destroy(*menu); + *menu = NULL; + DW_MUTEX_UNLOCK; + } } char _removetilde(char *dest, char *src) { - int z, cur=0; - char accel = '\0'; - - for(z=0;zchild), tempbuf); + GtkWidget *tmphandle; + char accel, *tempbuf = malloc(strlen(title)+1); + int _locked_by_me = FALSE, submenucount; + guint tmp_key; + GtkAccelGroup *accel_group; + + if (!menu) + { + free(tempbuf); + return NULL; + } + + DW_MUTEX_LOCK; + accel = _removetilde(tempbuf, title); + + accel_group = (GtkAccelGroup *)gtk_object_get_data(GTK_OBJECT(menu), "_dw_accel"); + submenucount = (int)gtk_object_get_data(GTK_OBJECT(menu), "_dw_submenucount"); + + if (strlen(tempbuf) == 0) + tmphandle=gtk_menu_item_new(); + else + { + if (check) + { + char numbuf[10]; + if (accel && accel_group) + { + tmphandle = gtk_check_menu_item_new_with_label(""); + tmp_key = gtk_label_parse_uline(GTK_LABEL(GTK_BIN(tmphandle)->child), tempbuf); #if 0 /* This isn't working right */ - gtk_widget_add_accelerator(tmphandle, "activate", accel_group, tmp_key, GDK_MOD1_MASK, 0); -#endif - } - else - tmphandle=gtk_check_menu_item_new_with_label(tempbuf); - gtk_check_menu_item_set_show_toggle(GTK_CHECK_MENU_ITEM(tmphandle), TRUE); - sprintf(numbuf, "%lu", id); - gtk_object_set_data(GTK_OBJECT(menu), numbuf, (gpointer)tmphandle); - } - else - { - if(accel && accel_group) - { - tmphandle=gtk_menu_item_new_with_label(""); - tmp_key = gtk_label_parse_uline(GTK_LABEL(GTK_BIN(tmphandle)->child), tempbuf); + gtk_widget_add_accelerator(tmphandle, "activate", accel_group, tmp_key, GDK_MOD1_MASK, 0); +#endif + } + else + tmphandle = gtk_check_menu_item_new_with_label(tempbuf); + gtk_check_menu_item_set_show_toggle(GTK_CHECK_MENU_ITEM(tmphandle), TRUE); + sprintf(numbuf, "%lu", id); + gtk_object_set_data(GTK_OBJECT(menu), numbuf, (gpointer)tmphandle); + } + else + { + char numbuf[10]; + if (accel && accel_group) + { + tmphandle=gtk_menu_item_new_with_label(""); + tmp_key = gtk_label_parse_uline(GTK_LABEL(GTK_BIN(tmphandle)->child), tempbuf); #if 0 /* This isn't working right */ - gtk_widget_add_accelerator(tmphandle, "activate", accel_group, tmp_key, GDK_MOD1_MASK, 0); -#endif - } - else - tmphandle=gtk_menu_item_new_with_label(tempbuf); - } - } - - gtk_widget_show(tmphandle); - - if(submenu) - { - char tempbuf[100]; - - sprintf(tempbuf, "_dw_submenu%d", submenucount); - submenucount++; - gtk_menu_item_set_submenu(GTK_MENU_ITEM(tmphandle), submenu); - gtk_object_set_data(GTK_OBJECT(menu), tempbuf, (gpointer)submenu); - gtk_object_set_data(GTK_OBJECT(menu), "_dw_submenucount", (gpointer)submenucount); - } - - if(GTK_IS_MENU_BAR(menu)) - gtk_menu_bar_append(GTK_MENU_BAR(menu), tmphandle); - else - gtk_menu_append(GTK_MENU(menu), tmphandle); - - gtk_object_set_data(GTK_OBJECT(tmphandle), "_dw_id", (gpointer)id); - free(tempbuf); - DW_MUTEX_UNLOCK; - return tmphandle; + gtk_widget_add_accelerator(tmphandle, "activate", accel_group, tmp_key, GDK_MOD1_MASK, 0); +#endif + } + else + tmphandle=gtk_menu_item_new_with_label(tempbuf); + sprintf(numbuf, "%lu", id); + gtk_object_set_data(GTK_OBJECT(menu), numbuf, (gpointer)tmphandle); + } + } + + gtk_widget_show(tmphandle); + + if (submenu) + { + char tempbuf[100]; + + sprintf(tempbuf, "_dw_submenu%d", submenucount); + submenucount++; + gtk_menu_item_set_submenu(GTK_MENU_ITEM(tmphandle), submenu); + gtk_object_set_data(GTK_OBJECT(menu), tempbuf, (gpointer)submenu); + gtk_object_set_data(GTK_OBJECT(menu), "_dw_submenucount", (gpointer)submenucount); + } + + if (GTK_IS_MENU_BAR(menu)) + gtk_menu_bar_append(GTK_MENU_BAR(menu), tmphandle); + else + gtk_menu_append(GTK_MENU(menu), tmphandle); + + gtk_object_set_data(GTK_OBJECT(tmphandle), "_dw_id", GINT_TO_POINTER(id)); + free(tempbuf); + /* + * Set flags + */ + if ( check && (flags & DW_MIS_CHECKED) ) + { + _dw_ignore_click = 1; + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(tmphandle), 1); + _dw_ignore_click = 0; + } + + if ( flags & DW_MIS_DISABLED ) + gtk_widget_set_sensitive( tmphandle, FALSE ); + + DW_MUTEX_UNLOCK; + return tmphandle; } GtkWidget *_find_submenu_id(GtkWidget *start, char *name) { - GtkWidget *tmp; - int z, submenucount = (int)gtk_object_get_data(GTK_OBJECT(start), "_dw_submenucount"); - - if((tmp = gtk_object_get_data(GTK_OBJECT(start), name))) - return tmp; - - for(z=0;zactive != check) - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(tmphandle), check); - _dw_ignore_click = 0; - } - DW_MUTEX_UNLOCK; + char numbuf[10]; + GtkWidget *tmphandle; + int _locked_by_me = FALSE; + + if(!menu) + return; + + DW_MUTEX_LOCK; + sprintf(numbuf, "%lu", id); + tmphandle = _find_submenu_id(menu, numbuf); + + if(tmphandle) + { + _dw_ignore_click = 1; + if(GTK_CHECK_MENU_ITEM(tmphandle)->active != check) + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(tmphandle), check); + _dw_ignore_click = 0; + } + DW_MUTEX_UNLOCK; +} + +/* + * Sets the state of a menu item. + * Parameters: + * menu: The handle the the existing menu. + * id: Menuitem id. + * state: TRUE for checked FALSE for not checked. + */ +void dw_menu_item_set_state(HMENUI menu, unsigned long id, unsigned long state) +{ + char numbuf[10]; + GtkWidget *tmphandle; + int check; + int _locked_by_me = FALSE; + + if(!menu) + return; + + DW_MUTEX_LOCK; + sprintf(numbuf, "%lu", id); + tmphandle = _find_submenu_id(menu, numbuf); + + if ( (state & DW_MIS_CHECKED) || (state & DW_MIS_UNCHECKED) ) + { + if ( state & DW_MIS_CHECKED ) + check = 1; + else + check = 0; + + if (tmphandle) + { + _dw_ignore_click = 1; + if(GTK_CHECK_MENU_ITEM(tmphandle)->active != check) + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(tmphandle), check); + _dw_ignore_click = 0; + } + } + if ( (state & DW_MIS_ENABLED) || (state & DW_MIS_DISABLED) ) + { + if (tmphandle ) + { + _dw_ignore_click = 1; + if ( state & DW_MIS_ENABLED ) + gtk_widget_set_sensitive( tmphandle, TRUE ); + else + gtk_widget_set_sensitive( tmphandle, FALSE ); + _dw_ignore_click = 0; + } + } + DW_MUTEX_UNLOCK; } /* @@ -3359,17 +3402,17 @@ */ void dw_menu_popup(HMENUI *menu, HWND parent, int x, int y) { - int _locked_by_me = FALSE; - - if(!menu || !*menu) - return; - - popup = parent; - - DW_MUTEX_LOCK; - gtk_menu_popup(GTK_MENU(*menu), NULL, NULL, NULL, NULL, 1, GDK_CURRENT_TIME); - *menu = NULL; - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; + + if(!menu || !*menu) + return; + + popup = parent; + + DW_MUTEX_LOCK; + gtk_menu_popup(GTK_MENU(*menu), NULL, NULL, NULL, NULL, 1, GDK_CURRENT_TIME); + *menu = NULL; + DW_MUTEX_UNLOCK; } @@ -3381,15 +3424,15 @@ */ void dw_pointer_query_pos(long *x, long *y) { - GdkModifierType state; - int gx, gy; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - gdk_window_get_pointer (GDK_ROOT_PARENT(), &gx, &gy, &state); - *x = gx; - *y = gy; - DW_MUTEX_UNLOCK; + GdkModifierType state; + int gx, gy; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + gdk_window_get_pointer (GDK_ROOT_PARENT(), &gx, &gy, &state); + *x = gx; + *y = gy; + DW_MUTEX_UNLOCK; } /* @@ -3400,11 +3443,11 @@ */ void dw_pointer_set_pos(long x, long y) { - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - XWarpPointer(GDK_DISPLAY(), None, GDK_ROOT_WINDOW(), 0,0,0,0, x, y); - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + XWarpPointer(GDK_DISPLAY(), None, GDK_ROOT_WINDOW(), 0,0,0,0, x, y); + DW_MUTEX_UNLOCK; } /* @@ -3415,20 +3458,20 @@ */ HWND dw_container_new(unsigned long id, int multi) { - GtkWidget *tmp; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - tmp = gtk_scrolled_window_new (NULL, NULL); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (tmp), - GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); - - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_multi", (gpointer)multi); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", (gpointer)id); - gtk_widget_show(tmp); - - DW_MUTEX_UNLOCK; - return tmp; + GtkWidget *tmp; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + tmp = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (tmp), + GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); + + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_multi", GINT_TO_POINTER(multi)); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", GINT_TO_POINTER(id)); + gtk_widget_show(tmp); + + DW_MUTEX_UNLOCK; + return tmp; } /* @@ -3439,62 +3482,62 @@ */ HWND dw_tree_new(ULONG id) { - GtkWidget *tmp, *tree; -#if GTK_MAJOR_VERSION > 1 - GtkTreeStore *store; - GtkTreeViewColumn *col; - GtkCellRenderer *rend; - GtkTreeSelection *sel; -#endif - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - tmp = gtk_scrolled_window_new(NULL, NULL); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (tmp), - GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", (gpointer)id); - gtk_widget_show(tmp); -#if GTK_MAJOR_VERSION > 1 - store = gtk_tree_store_new(4, G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_POINTER, G_TYPE_POINTER); - tree = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); - gtk_object_set_data(GTK_OBJECT(tree), "_dw_tree_store", (gpointer)store); - col = gtk_tree_view_column_new(); - - rend = gtk_cell_renderer_pixbuf_new(); - gtk_tree_view_column_pack_start(col, rend, FALSE); - gtk_tree_view_column_add_attribute(col, rend, "pixbuf", 1); - rend = gtk_cell_renderer_text_new(); - gtk_tree_view_column_pack_start(col, rend, TRUE); - gtk_tree_view_column_add_attribute(col, rend, "text", 0); - - gtk_tree_view_append_column(GTK_TREE_VIEW (tree), col); - gtk_tree_view_set_expander_column(GTK_TREE_VIEW(tree), col); - gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(tree), FALSE); - - sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree)); - gtk_tree_selection_set_mode(sel, GTK_SELECTION_SINGLE); + GtkWidget *tmp, *tree; +#if GTK_MAJOR_VERSION > 1 + GtkTreeStore *store; + GtkTreeViewColumn *col; + GtkCellRenderer *rend; + GtkTreeSelection *sel; +#endif + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + tmp = gtk_scrolled_window_new(NULL, NULL); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (tmp), + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", GINT_TO_POINTER(id)); + gtk_widget_show(tmp); +#if GTK_MAJOR_VERSION > 1 + store = gtk_tree_store_new(4, G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_POINTER, G_TYPE_POINTER); + tree = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); + gtk_object_set_data(GTK_OBJECT(tree), "_dw_tree_store", (gpointer)store); + col = gtk_tree_view_column_new(); + + rend = gtk_cell_renderer_pixbuf_new(); + gtk_tree_view_column_pack_start(col, rend, FALSE); + gtk_tree_view_column_add_attribute(col, rend, "pixbuf", 1); + rend = gtk_cell_renderer_text_new(); + gtk_tree_view_column_pack_start(col, rend, TRUE); + gtk_tree_view_column_add_attribute(col, rend, "text", 0); + + gtk_tree_view_append_column(GTK_TREE_VIEW (tree), col); + gtk_tree_view_set_expander_column(GTK_TREE_VIEW(tree), col); + gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(tree), FALSE); + + sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree)); + gtk_tree_selection_set_mode(sel, GTK_SELECTION_SINGLE); #else - tree = gtk_tree_new(); -#endif - if(!tree) - { - gtk_widget_destroy(tmp); - DW_MUTEX_UNLOCK; - return FALSE; - } - gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(tmp), tree); + tree = gtk_tree_new(); +#endif + if(!tree) + { + gtk_widget_destroy(tmp); + DW_MUTEX_UNLOCK; + return FALSE; + } + gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(tmp), tree); #if GTK_MAJOR_VERSION < 2 - /* Set the selection mode */ - gtk_tree_set_selection_mode (GTK_TREE(tree), GTK_SELECTION_SINGLE); - gtk_tree_set_view_mode(GTK_TREE(tree), GTK_TREE_VIEW_ITEM); -#endif - - gtk_object_set_user_data(GTK_OBJECT(tmp), (gpointer)tree); - gtk_widget_show(tree); - - DW_MUTEX_UNLOCK; - return tmp; + /* Set the selection mode */ + gtk_tree_set_selection_mode (GTK_TREE(tree), GTK_SELECTION_SINGLE); + gtk_tree_set_view_mode(GTK_TREE(tree), GTK_TREE_VIEW_ITEM); +#endif + + gtk_object_set_user_data(GTK_OBJECT(tmp), (gpointer)tree); + gtk_widget_show(tree); + + DW_MUTEX_UNLOCK; + return tmp; } @@ -3506,19 +3549,19 @@ */ HWND dw_text_new(char *text, unsigned long id) { - GtkWidget *tmp; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - tmp = gtk_label_new(text); - - /* Left and centered */ - gtk_misc_set_alignment(GTK_MISC(tmp), 0.0f, 0.5f); - gtk_widget_show(tmp); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", (gpointer)id); - gtk_misc_set_alignment(GTK_MISC(tmp), DW_LEFT, DW_LEFT); - DW_MUTEX_UNLOCK; - return tmp; + GtkWidget *tmp; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + tmp = gtk_label_new(text); + + /* Left and centered */ + gtk_misc_set_alignment(GTK_MISC(tmp), 0.0f, 0.5f); + gtk_widget_show(tmp); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", GINT_TO_POINTER(id)); + gtk_misc_set_alignment(GTK_MISC(tmp), DW_LEFT, DW_LEFT); + DW_MUTEX_UNLOCK; + return tmp; } /* @@ -3529,23 +3572,23 @@ */ HWND dw_status_text_new(char *text, ULONG id) { - GtkWidget *tmp, *frame; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - frame = gtk_frame_new(NULL); - gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_ETCHED_IN); - tmp = gtk_label_new(text); - gtk_container_add(GTK_CONTAINER(frame), tmp); - gtk_widget_show(tmp); - gtk_widget_show(frame); - - /* Left and centered */ - gtk_misc_set_alignment(GTK_MISC(tmp), 0.0f, 0.5f); - gtk_object_set_data(GTK_OBJECT(frame), "_dw_id", (gpointer)id); - gtk_object_set_data(GTK_OBJECT(frame), "_dw_label", (gpointer)tmp); - DW_MUTEX_UNLOCK; - return frame; + GtkWidget *tmp, *frame; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + frame = gtk_frame_new(NULL); + gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_ETCHED_IN); + tmp = gtk_label_new(text); + gtk_container_add(GTK_CONTAINER(frame), tmp); + gtk_widget_show(tmp); + gtk_widget_show(frame); + + /* Left and centered */ + gtk_misc_set_alignment(GTK_MISC(tmp), 0.0f, 0.5f); + gtk_object_set_data(GTK_OBJECT(frame), "_dw_id", GINT_TO_POINTER(id)); + gtk_object_set_data(GTK_OBJECT(frame), "_dw_label", (gpointer)tmp); + DW_MUTEX_UNLOCK; + return frame; } /* @@ -3555,37 +3598,37 @@ */ HWND dw_mle_new(unsigned long id) { - GtkWidget *tmp, *tmpbox, *scroller; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; -#if GTK_MAJOR_VERSION > 1 - tmpbox = gtk_scrolled_window_new (NULL, NULL); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(tmpbox), - GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); - gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(tmpbox), GTK_SHADOW_ETCHED_IN); - tmp = gtk_text_view_new(); - gtk_container_add (GTK_CONTAINER(tmpbox), tmp); - gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(tmp), GTK_WRAP_NONE); - - scroller = NULL; + GtkWidget *tmp, *tmpbox, *scroller; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; +#if GTK_MAJOR_VERSION > 1 + tmpbox = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(tmpbox), + GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(tmpbox), GTK_SHADOW_ETCHED_IN); + tmp = gtk_text_view_new(); + gtk_container_add (GTK_CONTAINER(tmpbox), tmp); + gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(tmp), GTK_WRAP_NONE); + + scroller = NULL; #else - tmpbox = gtk_hbox_new(FALSE, 0); - tmp = gtk_text_new(NULL, NULL); - gtk_text_set_word_wrap(GTK_TEXT(tmp), FALSE); - gtk_text_set_line_wrap(GTK_TEXT(tmp), FALSE); - scroller = gtk_vscrollbar_new(GTK_TEXT(tmp)->vadj); - GTK_WIDGET_UNSET_FLAGS(scroller, GTK_CAN_FOCUS); - gtk_box_pack_start(GTK_BOX(tmpbox), tmp, TRUE, TRUE, 0); - gtk_box_pack_start(GTK_BOX(tmpbox), scroller, FALSE, TRUE, 0); - gtk_widget_show(scroller); -#endif - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", (gpointer)id); - gtk_object_set_user_data(GTK_OBJECT(tmpbox), (gpointer)tmp); - gtk_widget_show(tmp); - gtk_widget_show(tmpbox); - DW_MUTEX_UNLOCK; - return tmpbox; + tmpbox = gtk_hbox_new(FALSE, 0); + tmp = gtk_text_new(NULL, NULL); + gtk_text_set_word_wrap(GTK_TEXT(tmp), FALSE); + gtk_text_set_line_wrap(GTK_TEXT(tmp), FALSE); + scroller = gtk_vscrollbar_new(GTK_TEXT(tmp)->vadj); + GTK_WIDGET_UNSET_FLAGS(scroller, GTK_CAN_FOCUS); + gtk_box_pack_start(GTK_BOX(tmpbox), tmp, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(tmpbox), scroller, FALSE, TRUE, 0); + gtk_widget_show(scroller); +#endif + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", GINT_TO_POINTER(id)); + gtk_object_set_user_data(GTK_OBJECT(tmpbox), (gpointer)tmp); + gtk_widget_show(tmp); + gtk_widget_show(tmpbox); + DW_MUTEX_UNLOCK; + return tmpbox; } /* @@ -3596,19 +3639,19 @@ */ HWND dw_entryfield_new(char *text, unsigned long id) { - GtkWidget *tmp; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - tmp = gtk_entry_new(); - - gtk_entry_set_text(GTK_ENTRY(tmp), text); - - gtk_widget_show(tmp); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", (gpointer)id); - - DW_MUTEX_UNLOCK; - return tmp; + GtkWidget *tmp; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + tmp = gtk_entry_new(); + + gtk_entry_set_text(GTK_ENTRY(tmp), text); + + gtk_widget_show(tmp); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", GINT_TO_POINTER(id)); + + DW_MUTEX_UNLOCK; + return tmp; } /* @@ -3619,20 +3662,20 @@ */ HWND dw_entryfield_password_new(char *text, ULONG id) { - GtkWidget *tmp; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - tmp = gtk_entry_new(); - - gtk_entry_set_visibility(GTK_ENTRY(tmp), FALSE); - gtk_entry_set_text(GTK_ENTRY(tmp), text); - - gtk_widget_show(tmp); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", (gpointer)id); - - DW_MUTEX_UNLOCK; - return tmp; + GtkWidget *tmp; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + tmp = gtk_entry_new(); + + gtk_entry_set_visibility(GTK_ENTRY(tmp), FALSE); + gtk_entry_set_text(GTK_ENTRY(tmp), text); + + gtk_widget_show(tmp); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", GINT_TO_POINTER(id)); + + DW_MUTEX_UNLOCK; + return tmp; } /* @@ -3643,23 +3686,23 @@ */ HWND dw_combobox_new(char *text, unsigned long id) { - GtkWidget *tmp; - int sigid, _locked_by_me = FALSE; - gint cid; - - DW_MUTEX_LOCK; - tmp = gtk_combo_new(); - gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(tmp)->entry), text); - gtk_combo_set_use_arrows(GTK_COMBO(tmp), TRUE); - gtk_object_set_user_data(GTK_OBJECT(tmp), NULL); - gtk_widget_show(tmp); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", (gpointer)id); - - sigid = _set_signal_handler(GTK_COMBO(tmp)->list, tmp, NULL, NULL, NULL); - cid = gtk_signal_connect(GTK_OBJECT(GTK_COMBO(tmp)->list), "select_child", GTK_SIGNAL_FUNC(_item_select_event), (gpointer)sigid); - _set_signal_handler_id(GTK_COMBO(tmp)->list, sigid, cid); - DW_MUTEX_UNLOCK; - return tmp; + GtkWidget *tmp; + int sigid, _locked_by_me = FALSE; + gint cid; + + DW_MUTEX_LOCK; + tmp = gtk_combo_new(); + gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(tmp)->entry), text); + gtk_combo_set_use_arrows(GTK_COMBO(tmp), TRUE); + gtk_object_set_user_data(GTK_OBJECT(tmp), NULL); + gtk_widget_show(tmp); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", GINT_TO_POINTER(id)); + + sigid = _set_signal_handler(GTK_COMBO(tmp)->list, tmp, NULL, NULL, NULL); + cid = gtk_signal_connect(GTK_OBJECT(GTK_COMBO(tmp)->list), "select_child", GTK_SIGNAL_FUNC(_item_select_event), (gpointer)sigid); + _set_signal_handler_id(GTK_COMBO(tmp)->list, sigid, cid); + DW_MUTEX_UNLOCK; + return tmp; } /* @@ -3670,15 +3713,15 @@ */ HWND dw_button_new(char *text, unsigned long id) { - GtkWidget *tmp; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - tmp = gtk_button_new_with_label(text); - gtk_widget_show(tmp); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", (gpointer)id); - DW_MUTEX_UNLOCK; - return tmp; + GtkWidget *tmp; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + tmp = gtk_button_new_with_label(text); + gtk_widget_show(tmp); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", GINT_TO_POINTER(id)); + DW_MUTEX_UNLOCK; + return tmp; } /* @@ -3689,30 +3732,30 @@ */ HWND dw_bitmapbutton_new(char *text, unsigned long id) { - GtkWidget *tmp; - GtkWidget *bitmap; + GtkWidget *tmp; + GtkWidget *bitmap; GtkTooltips *tooltips; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - tmp = gtk_button_new(); - bitmap = dw_bitmap_new(id); - - if(bitmap) - { - dw_window_set_bitmap(bitmap, id, NULL); - gtk_container_add (GTK_CONTAINER(tmp), bitmap); - } - gtk_widget_show(tmp); - if(text) - { - tooltips = gtk_tooltips_new(); - gtk_tooltips_set_tip(tooltips, tmp, text, NULL); - gtk_object_set_data(GTK_OBJECT(tmp), "tooltip", (gpointer)tooltips); - } - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", (gpointer)id); - DW_MUTEX_UNLOCK; - return tmp; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + tmp = gtk_button_new(); + bitmap = dw_bitmap_new(id); + + if(bitmap) + { + dw_window_set_bitmap(bitmap, id, NULL); + gtk_container_add (GTK_CONTAINER(tmp), bitmap); + } + gtk_widget_show(tmp); + if(text) + { + tooltips = gtk_tooltips_new(); + gtk_tooltips_set_tip(tooltips, tmp, text, NULL); + gtk_object_set_data(GTK_OBJECT(tmp), "tooltip", (gpointer)tooltips); + } + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", GINT_TO_POINTER(id)); + DW_MUTEX_UNLOCK; + return tmp; } /* @@ -3737,9 +3780,9 @@ DW_MUTEX_LOCK; - /* Create box for image and label */ - box = gtk_hbox_new (FALSE, 0); - gtk_container_set_border_width (GTK_CONTAINER (box), 2); + /* Create box for image and label */ + box = gtk_hbox_new (FALSE, 0); + gtk_container_set_border_width (GTK_CONTAINER (box), 2); /* Now on to the image stuff */ bitmap = dw_bitmap_new(id); @@ -3771,7 +3814,7 @@ gtk_tooltips_set_tip( tooltips, button, text, NULL ); gtk_object_set_data( GTK_OBJECT(button), "tooltip", (gpointer)tooltips ); } - gtk_object_set_data( GTK_OBJECT(button), "_dw_id", (gpointer)id ); + gtk_object_set_data( GTK_OBJECT(button), "_dw_id", GINT_TO_POINTER(id) ); DW_MUTEX_UNLOCK; return button; } @@ -3808,7 +3851,7 @@ gtk_tooltips_set_tip(tooltips, tmp, text, NULL); gtk_object_set_data(GTK_OBJECT(tmp), "tooltip", (gpointer)tooltips); } - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", (gpointer)id); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", GINT_TO_POINTER(id)); DW_MUTEX_UNLOCK; return tmp; } @@ -3821,21 +3864,21 @@ */ HWND dw_spinbutton_new(char *text, unsigned long id) { - GtkAdjustment *adj; - GtkWidget *tmp; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - adj = (GtkAdjustment *)gtk_adjustment_new (1.0, 0.0, 100.0, 1.0, 5.0, 0.0); - tmp = gtk_spin_button_new (adj, 0, 0); - gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(tmp), TRUE); - gtk_spin_button_set_wrap(GTK_SPIN_BUTTON(tmp), TRUE); - gtk_widget_show(tmp); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_adjustment", (gpointer)adj); - gtk_object_set_data(GTK_OBJECT(adj), "_dw_spinbutton", (gpointer)tmp); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", (gpointer)id); - DW_MUTEX_UNLOCK; - return tmp; + GtkAdjustment *adj; + GtkWidget *tmp; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + adj = (GtkAdjustment *)gtk_adjustment_new (1.0, 0.0, 100.0, 1.0, 5.0, 0.0); + tmp = gtk_spin_button_new (adj, 0, 0); + gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(tmp), TRUE); + gtk_spin_button_set_wrap(GTK_SPIN_BUTTON(tmp), TRUE); + gtk_widget_show(tmp); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_adjustment", (gpointer)adj); + gtk_object_set_data(GTK_OBJECT(adj), "_dw_spinbutton", (gpointer)tmp); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", GINT_TO_POINTER(id)); + DW_MUTEX_UNLOCK; + return tmp; } /* @@ -3846,17 +3889,17 @@ */ HWND dw_radiobutton_new(char *text, ULONG id) { - /* This will have to be fixed in the future. */ - GtkWidget *tmp; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - tmp = gtk_radio_button_new_with_label(NULL, text); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", (gpointer)id); - gtk_widget_show(tmp); - - DW_MUTEX_UNLOCK; - return tmp; + /* This will have to be fixed in the future. */ + GtkWidget *tmp; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + tmp = gtk_radio_button_new_with_label(NULL, text); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", GINT_TO_POINTER(id)); + gtk_widget_show(tmp); + + DW_MUTEX_UNLOCK; + return tmp; } /* @@ -3868,24 +3911,24 @@ */ HWND dw_slider_new(int vertical, int increments, ULONG id) { - GtkWidget *tmp; - GtkAdjustment *adjustment; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - adjustment = (GtkAdjustment *)gtk_adjustment_new(0, 0, (gfloat)increments, 1, 1, 1); - if(vertical) - tmp = gtk_vscale_new(adjustment); - else - tmp = gtk_hscale_new(adjustment); - gtk_widget_show(tmp); - gtk_scale_set_draw_value(GTK_SCALE(tmp), 0); - gtk_scale_set_digits(GTK_SCALE(tmp), 0); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_adjustment", (gpointer)adjustment); - gtk_object_set_data(GTK_OBJECT(adjustment), "_dw_slider", (gpointer)tmp); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", (gpointer)id); - DW_MUTEX_UNLOCK; - return tmp; + GtkWidget *tmp; + GtkAdjustment *adjustment; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + adjustment = (GtkAdjustment *)gtk_adjustment_new(0, 0, (gfloat)increments, 1, 1, 1); + if(vertical) + tmp = gtk_vscale_new(adjustment); + else + tmp = gtk_hscale_new(adjustment); + gtk_widget_show(tmp); + gtk_scale_set_draw_value(GTK_SCALE(tmp), 0); + gtk_scale_set_digits(GTK_SCALE(tmp), 0); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_adjustment", (gpointer)adjustment); + gtk_object_set_data(GTK_OBJECT(adjustment), "_dw_slider", (gpointer)tmp); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", GINT_TO_POINTER(id)); + DW_MUTEX_UNLOCK; + return tmp; } /* @@ -3897,23 +3940,23 @@ */ HWND dw_scrollbar_new(int vertical, ULONG id) { - GtkWidget *tmp; - GtkAdjustment *adjustment; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - adjustment = (GtkAdjustment *)gtk_adjustment_new(0, 0, 0, 1, 1, 1); - if(vertical) - tmp = gtk_vscrollbar_new(adjustment); - else - tmp = gtk_hscrollbar_new(adjustment); - GTK_WIDGET_UNSET_FLAGS(tmp, GTK_CAN_FOCUS); - gtk_widget_show(tmp); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_adjustment", (gpointer)adjustment); - gtk_object_set_data(GTK_OBJECT(adjustment), "_dw_scrollbar", (gpointer)tmp); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", (gpointer)id); - DW_MUTEX_UNLOCK; - return tmp; + GtkWidget *tmp; + GtkAdjustment *adjustment; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + adjustment = (GtkAdjustment *)gtk_adjustment_new(0, 0, 0, 1, 1, 1); + if(vertical) + tmp = gtk_vscrollbar_new(adjustment); + else + tmp = gtk_hscrollbar_new(adjustment); + GTK_WIDGET_UNSET_FLAGS(tmp, GTK_CAN_FOCUS); + gtk_widget_show(tmp); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_adjustment", (gpointer)adjustment); + gtk_object_set_data(GTK_OBJECT(adjustment), "_dw_scrollbar", (gpointer)tmp); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", GINT_TO_POINTER(id)); + DW_MUTEX_UNLOCK; + return tmp; } /* @@ -3923,15 +3966,15 @@ */ HWND dw_percent_new(unsigned long id) { - GtkWidget *tmp; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - tmp = gtk_progress_bar_new(); - gtk_widget_show(tmp); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", (gpointer)id); - DW_MUTEX_UNLOCK; - return tmp; + GtkWidget *tmp; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + tmp = gtk_progress_bar_new(); + gtk_widget_show(tmp); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", GINT_TO_POINTER(id)); + DW_MUTEX_UNLOCK; + return tmp; } /* @@ -3942,15 +3985,15 @@ */ HWND dw_checkbox_new(char *text, unsigned long id) { - GtkWidget *tmp; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - tmp = gtk_check_button_new_with_label(text); - gtk_widget_show(tmp); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", (gpointer)id); - DW_MUTEX_UNLOCK; - return tmp; + GtkWidget *tmp; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + tmp = gtk_check_button_new_with_label(text); + gtk_widget_show(tmp); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", GINT_TO_POINTER(id)); + DW_MUTEX_UNLOCK; + return tmp; } /* @@ -3961,26 +4004,26 @@ */ HWND dw_listbox_new(unsigned long id, int multi) { - GtkWidget *tmp, *list; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - tmp = gtk_scrolled_window_new(NULL, NULL); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (tmp), - GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); - - list = gtk_list_new(); - gtk_list_set_selection_mode(GTK_LIST(list), multi ? GTK_SELECTION_MULTIPLE : GTK_SELECTION_SINGLE); - - gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(tmp), - list); - gtk_object_set_user_data(GTK_OBJECT(tmp), list); - gtk_widget_show(list); - gtk_widget_show(tmp); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", (gpointer)id); - - DW_MUTEX_UNLOCK; - return tmp; + GtkWidget *tmp, *list; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + tmp = gtk_scrolled_window_new(NULL, NULL); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (tmp), + GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); + + list = gtk_list_new(); + gtk_list_set_selection_mode(GTK_LIST(list), multi ? GTK_SELECTION_MULTIPLE : GTK_SELECTION_SINGLE); + + gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(tmp), + list); + gtk_object_set_user_data(GTK_OBJECT(tmp), list); + gtk_widget_show(list); + gtk_widget_show(tmp); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", GINT_TO_POINTER(id)); + + DW_MUTEX_UNLOCK; + return tmp; } /* @@ -3991,17 +4034,17 @@ */ void dw_window_set_icon(HWND handle, unsigned long id) { - GdkBitmap *bitmap = NULL; - GdkPixmap *icon_pixmap; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - icon_pixmap = _find_pixmap(&bitmap, id, handle, NULL, NULL); - - if(handle->window && icon_pixmap) - gdk_window_set_icon(handle->window, NULL, icon_pixmap, bitmap); - - DW_MUTEX_UNLOCK; + GdkBitmap *bitmap = NULL; + GdkPixmap *icon_pixmap; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + icon_pixmap = _find_pixmap(&bitmap, id, handle, NULL, NULL); + + if(handle->window && icon_pixmap) + gdk_window_set_icon(handle->window, NULL, icon_pixmap, bitmap); + + DW_MUTEX_UNLOCK; } /* @@ -4180,38 +4223,38 @@ */ void dw_window_set_text(HWND handle, char *text) { - int _locked_by_me = FALSE; - GtkWidget *tmp; - - DW_MUTEX_LOCK; - if((tmp = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_mdi_title"))) - handle = tmp; - if(GTK_IS_ENTRY(handle)) - gtk_entry_set_text(GTK_ENTRY(handle), text); - else if(GTK_IS_COMBO(handle)) - gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(handle)->entry), text); - else if(GTK_IS_LABEL(handle)) - gtk_label_set_text(GTK_LABEL(handle), text); - else if(GTK_IS_BUTTON(handle)) - { + int _locked_by_me = FALSE; + GtkWidget *tmp; + + DW_MUTEX_LOCK; + if((tmp = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_mdi_title"))) + handle = tmp; + if(GTK_IS_ENTRY(handle)) + gtk_entry_set_text(GTK_ENTRY(handle), text); + else if(GTK_IS_COMBO(handle)) + gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(handle)->entry), text); + else if(GTK_IS_LABEL(handle)) + gtk_label_set_text(GTK_LABEL(handle), text); + else if(GTK_IS_BUTTON(handle)) + { #if GTK_MAJOR_VERSION < 2 - GtkWidget *label = GTK_BUTTON(handle)->child; - - if(GTK_IS_LABEL(label)) - gtk_label_set_text(GTK_LABEL(label), text); + GtkWidget *label = GTK_BUTTON(handle)->child; + + if(GTK_IS_LABEL(label)) + gtk_label_set_text(GTK_LABEL(label), text); #else - gtk_button_set_label(GTK_BUTTON(handle), text); -#endif - } - else if(GTK_WIDGET_TOPLEVEL(handle)) - gtk_window_set_title(GTK_WINDOW(handle), text); - else if(GTK_IS_FRAME(handle)) - { - GtkWidget *tmp = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_label"); - if(tmp && GTK_IS_LABEL(tmp)) - gtk_label_set_text(GTK_LABEL(tmp), text); - } - DW_MUTEX_UNLOCK; + gtk_button_set_label(GTK_BUTTON(handle), text); +#endif + } + else if(GTK_WIDGET_TOPLEVEL(handle)) + gtk_window_set_title(GTK_WINDOW(handle), text); + else if(GTK_IS_FRAME(handle)) + { + GtkWidget *tmp = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_label"); + if(tmp && GTK_IS_LABEL(tmp)) + gtk_label_set_text(GTK_LABEL(tmp), text); + } + DW_MUTEX_UNLOCK; } /* @@ -4224,20 +4267,20 @@ char *dw_window_get_text(HWND handle) { #if GTK_MAJOR_VERSION > 1 - const char *possible = ""; + const char *possible = ""; #else - char *possible = ""; -#endif - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - if(GTK_IS_ENTRY(handle)) - possible = gtk_entry_get_text(GTK_ENTRY(handle)); - else if(GTK_IS_COMBO(handle)) - possible = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(handle)->entry)); - - DW_MUTEX_UNLOCK; - return strdup(possible); + char *possible = ""; +#endif + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + if(GTK_IS_ENTRY(handle)) + possible = gtk_entry_get_text(GTK_ENTRY(handle)); + else if(GTK_IS_COMBO(handle)) + possible = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(handle)->entry)); + + DW_MUTEX_UNLOCK; + return strdup(possible); } /* @@ -4247,11 +4290,11 @@ */ void dw_window_disable(HWND handle) { - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - gtk_widget_set_sensitive(handle, FALSE); - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + gtk_widget_set_sensitive(handle, FALSE); + DW_MUTEX_UNLOCK; } /* @@ -4261,11 +4304,11 @@ */ void dw_window_enable(HWND handle) { - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - gtk_widget_set_sensitive(handle, TRUE); - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + gtk_widget_set_sensitive(handle, TRUE); + DW_MUTEX_UNLOCK; } /* @@ -4276,51 +4319,51 @@ */ HWND API dw_window_from_id(HWND handle, int id) { - GList *orig = NULL, *list = NULL; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - if(handle && GTK_IS_CONTAINER(handle)) - { -#if GTK_MAJOR_VERSION > 1 - orig = list = gtk_container_get_children(GTK_CONTAINER(handle)); + GList *orig = NULL, *list = NULL; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + if(handle && GTK_IS_CONTAINER(handle)) + { +#if GTK_MAJOR_VERSION > 1 + orig = list = gtk_container_get_children(GTK_CONTAINER(handle)); #else - orig = list = gtk_container_children(GTK_CONTAINER(handle)); -#endif - } - while(list) - { - if(GTK_IS_WIDGET(list->data)) - { - if(id == (int)gtk_object_get_data(GTK_OBJECT(list->data), "_dw_id")) - { - HWND ret = (HWND)list->data; - g_list_free(orig); - DW_MUTEX_UNLOCK; - return ret; - } - } - list = list->next; - } - if(orig) - g_list_free(orig); - DW_MUTEX_UNLOCK; + orig = list = gtk_container_children(GTK_CONTAINER(handle)); +#endif + } + while(list) + { + if(GTK_IS_WIDGET(list->data)) + { + if(id == (int)gtk_object_get_data(GTK_OBJECT(list->data), "_dw_id")) + { + HWND ret = (HWND)list->data; + g_list_free(orig); + DW_MUTEX_UNLOCK; + return ret; + } + } + list = list->next; + } + if(orig) + g_list_free(orig); + DW_MUTEX_UNLOCK; return 0L; } void _strip_cr(char *dest, char *src) { - int z, x = 0; - - for(z=0;z 1 - if(GTK_IS_SCROLLED_WINDOW(handle)) + unsigned int tmppoint = startpoint; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; +#if GTK_MAJOR_VERSION > 1 + if(GTK_IS_SCROLLED_WINDOW(handle)) #else - if(GTK_IS_BOX(handle)) -#endif - { - GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - -#if GTK_MAJOR_VERSION > 1 - if(tmp && GTK_IS_TEXT_VIEW(tmp)) - { - char *impbuf = malloc(strlen(buffer)+1); - GtkTextBuffer *tbuffer; - GtkTextIter iter; - - _strip_cr(impbuf, buffer); - - tbuffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (tmp)); - gtk_text_buffer_get_iter_at_offset(tbuffer, &iter, startpoint); - gtk_text_buffer_place_cursor(tbuffer, &iter); - gtk_text_buffer_insert_at_cursor(tbuffer, impbuf, -1); - tmppoint = (startpoint > -1 ? startpoint : 0) + strlen(impbuf); - free(impbuf); - } + if(GTK_IS_BOX(handle)) +#endif + { + GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + +#if GTK_MAJOR_VERSION > 1 + if(tmp && GTK_IS_TEXT_VIEW(tmp)) + { + char *impbuf = malloc(strlen(buffer)+1); + GtkTextBuffer *tbuffer; + GtkTextIter iter; + + _strip_cr(impbuf, buffer); + + tbuffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (tmp)); + gtk_text_buffer_get_iter_at_offset(tbuffer, &iter, startpoint); + gtk_text_buffer_place_cursor(tbuffer, &iter); + gtk_text_buffer_insert_at_cursor(tbuffer, impbuf, -1); + tmppoint = (startpoint > -1 ? startpoint : 0) + strlen(impbuf); + free(impbuf); + } #else - GdkFont *font = (GdkFont *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_gdkfont"); - - if(tmp && GTK_IS_TEXT(tmp)) - { - GdkColor *fore = (GdkColor *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_foregdk"); - GdkColor *back = (GdkColor *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_backgdk"); - char *impbuf = malloc(strlen(buffer)+1); - - _strip_cr(impbuf, buffer); - - gtk_text_set_point(GTK_TEXT(tmp), startpoint < 0 ? 0 : startpoint); - gtk_text_insert(GTK_TEXT(tmp), font, fore, back, impbuf, -1); - tmppoint = gtk_text_get_point(GTK_TEXT(tmp)); - free(impbuf); - } -#endif - } - DW_MUTEX_UNLOCK; - return tmppoint; + GdkFont *font = (GdkFont *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_gdkfont"); + + if(tmp && GTK_IS_TEXT(tmp)) + { + GdkColor *fore = (GdkColor *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_foregdk"); + GdkColor *back = (GdkColor *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_backgdk"); + char *impbuf = malloc(strlen(buffer)+1); + + _strip_cr(impbuf, buffer); + + gtk_text_set_point(GTK_TEXT(tmp), startpoint < 0 ? 0 : startpoint); + gtk_text_insert(GTK_TEXT(tmp), font, fore, back, impbuf, -1); + tmppoint = gtk_text_get_point(GTK_TEXT(tmp)); + free(impbuf); + } +#endif + } + DW_MUTEX_UNLOCK; + return tmppoint; } /* @@ -4392,59 +4435,59 @@ */ void dw_mle_export(HWND handle, char *buffer, int startpoint, int length) { - int _locked_by_me = FALSE; - gchar *text; - - DW_MUTEX_LOCK; - /* force the return value to nul in case the following tests fail */ - if(buffer) - buffer[0] = '\0'; -#if GTK_MAJOR_VERSION > 1 - if(GTK_IS_SCROLLED_WINDOW(handle)) + int _locked_by_me = FALSE; + gchar *text; + + DW_MUTEX_LOCK; + /* force the return value to nul in case the following tests fail */ + if(buffer) + buffer[0] = '\0'; +#if GTK_MAJOR_VERSION > 1 + if(GTK_IS_SCROLLED_WINDOW(handle)) #else - if(GTK_IS_BOX(handle)) -#endif - { - GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - -#if GTK_MAJOR_VERSION > 1 - if(tmp && GTK_IS_TEXT_VIEW(tmp)) - { - GtkTextBuffer *tbuffer; - GtkTextIter start, end; - - tbuffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (tmp)); - gtk_text_buffer_get_iter_at_offset(tbuffer, &start, startpoint); - gtk_text_buffer_get_iter_at_offset(tbuffer, &end, startpoint + length); - text = gtk_text_iter_get_text(&start, &end); - if(text) /* Should this get freed? */ - { - if(buffer) - strcpy(buffer, text); - } - } + if(GTK_IS_BOX(handle)) +#endif + { + GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + +#if GTK_MAJOR_VERSION > 1 + if(tmp && GTK_IS_TEXT_VIEW(tmp)) + { + GtkTextBuffer *tbuffer; + GtkTextIter start, end; + + tbuffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (tmp)); + gtk_text_buffer_get_iter_at_offset(tbuffer, &start, startpoint); + gtk_text_buffer_get_iter_at_offset(tbuffer, &end, startpoint + length); + text = gtk_text_iter_get_text(&start, &end); + if(text) /* Should this get freed? */ + { + if(buffer) + strcpy(buffer, text); + } + } #else - if(tmp && GTK_IS_TEXT(tmp)) - { - text = gtk_editable_get_chars(GTK_EDITABLE(&(GTK_TEXT(tmp)->editable)), 0, -1); /* get the complete contents */ - if(text) - { - if(buffer) - { - len = strlen(text); - if(startpoint < len) - { - max = min(length, len - startpoint); - memcpy(buffer, &text[startpoint], max); - buffer[max] = '\0'; - } - } - g_free(text); - } - } -#endif - } - DW_MUTEX_UNLOCK; + if(tmp && GTK_IS_TEXT(tmp)) + { + text = gtk_editable_get_chars(GTK_EDITABLE(&(GTK_TEXT(tmp)->editable)), 0, -1); /* get the complete contents */ + if(text) + { + if(buffer) + { + len = strlen(text); + if(startpoint < len) + { + max = min(length, len - startpoint); + memcpy(buffer, &text[startpoint], max); + buffer[max] = '\0'; + } + } + g_free(text); + } + } +#endif + } + DW_MUTEX_UNLOCK; } /* @@ -4456,61 +4499,61 @@ */ void dw_mle_get_size(HWND handle, unsigned long *bytes, unsigned long *lines) { - int _locked_by_me = FALSE; - - if(bytes) - *bytes = 0; - if(lines) - *lines = 0; - - DW_MUTEX_LOCK; -#if GTK_MAJOR_VERSION > 1 - if(GTK_IS_SCROLLED_WINDOW(handle)) - { - GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - - if(tmp && GTK_IS_TEXT_VIEW(tmp)) - { - GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(tmp)); - - if(bytes) - *bytes = gtk_text_buffer_get_char_count(buffer) + 1; - if(lines) - *lines = gtk_text_buffer_get_line_count(buffer) + 1; - } - } + int _locked_by_me = FALSE; + + if(bytes) + *bytes = 0; + if(lines) + *lines = 0; + + DW_MUTEX_LOCK; +#if GTK_MAJOR_VERSION > 1 + if(GTK_IS_SCROLLED_WINDOW(handle)) + { + GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + + if(tmp && GTK_IS_TEXT_VIEW(tmp)) + { + GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(tmp)); + + if(bytes) + *bytes = gtk_text_buffer_get_char_count(buffer) + 1; + if(lines) + *lines = gtk_text_buffer_get_line_count(buffer) + 1; + } + } #else - if(GTK_IS_BOX(handle)) - { - GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - - if(tmp && GTK_IS_TEXT(tmp)) - { - if(bytes) - *bytes = gtk_text_get_length(GTK_TEXT(tmp)) + 1; - if(lines) - { - gchar *text; - - *lines = 0; - text = gtk_editable_get_chars(GTK_EDITABLE(&(GTK_TEXT(tmp)->editable)), 0, gtk_text_get_length(GTK_TEXT(tmp))); - - if(text) - { - int z, len = strlen(text); - - for(z=0;zeditable)), 0, gtk_text_get_length(GTK_TEXT(tmp))); + + if(text) + { + int z, len = strlen(text); + + for(z=0;z 1 - if(GTK_IS_SCROLLED_WINDOW(handle)) + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; +#if GTK_MAJOR_VERSION > 1 + if(GTK_IS_SCROLLED_WINDOW(handle)) #else - if(GTK_IS_BOX(handle)) -#endif - { - GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - -#if GTK_MAJOR_VERSION > 1 - if(tmp && GTK_IS_TEXT_VIEW(tmp)) - { - GtkTextBuffer *tbuffer; - GtkTextIter start, end; - - tbuffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (tmp)); - gtk_text_buffer_get_iter_at_offset(tbuffer, &start, startpoint); - gtk_text_buffer_get_iter_at_offset(tbuffer, &end, startpoint + length); - gtk_text_buffer_delete(tbuffer, &start, &end); - } + if(GTK_IS_BOX(handle)) +#endif + { + GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + +#if GTK_MAJOR_VERSION > 1 + if(tmp && GTK_IS_TEXT_VIEW(tmp)) + { + GtkTextBuffer *tbuffer; + GtkTextIter start, end; + + tbuffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (tmp)); + gtk_text_buffer_get_iter_at_offset(tbuffer, &start, startpoint); + gtk_text_buffer_get_iter_at_offset(tbuffer, &end, startpoint + length); + gtk_text_buffer_delete(tbuffer, &start, &end); + } #else - if(tmp && GTK_IS_TEXT(tmp)) - { - gtk_text_set_point(GTK_TEXT(tmp), startpoint); - gtk_text_forward_delete(GTK_TEXT(tmp), length); - } -#endif - } - DW_MUTEX_UNLOCK; + if(tmp && GTK_IS_TEXT(tmp)) + { + gtk_text_set_point(GTK_TEXT(tmp), startpoint); + gtk_text_forward_delete(GTK_TEXT(tmp), length); + } +#endif + } + DW_MUTEX_UNLOCK; } /* @@ -4562,36 +4605,36 @@ */ void dw_mle_clear(HWND handle) { - int length, _locked_by_me = FALSE; - - DW_MUTEX_LOCK; -#if GTK_MAJOR_VERSION > 1 - if(GTK_IS_SCROLLED_WINDOW(handle)) - { - GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - - if(tmp && GTK_IS_TEXT_VIEW(tmp)) - { - GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(tmp)); - - length = -1; - gtk_text_buffer_set_text(buffer, "", length); - } - } + int length, _locked_by_me = FALSE; + + DW_MUTEX_LOCK; +#if GTK_MAJOR_VERSION > 1 + if(GTK_IS_SCROLLED_WINDOW(handle)) + { + GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + + if(tmp && GTK_IS_TEXT_VIEW(tmp)) + { + GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(tmp)); + + length = -1; + gtk_text_buffer_set_text(buffer, "", length); + } + } #else - if(GTK_IS_BOX(handle)) - { - GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - - if(tmp && GTK_IS_TEXT(tmp)) - { - length = gtk_text_get_length(GTK_TEXT(tmp)); - gtk_text_set_point(GTK_TEXT(tmp), 0); - gtk_text_forward_delete(GTK_TEXT(tmp), length); - } - } -#endif - DW_MUTEX_UNLOCK; + if(GTK_IS_BOX(handle)) + { + GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + + if(tmp && GTK_IS_TEXT(tmp)) + { + length = gtk_text_get_length(GTK_TEXT(tmp)); + gtk_text_set_point(GTK_TEXT(tmp), 0); + gtk_text_forward_delete(GTK_TEXT(tmp), length); + } + } +#endif + DW_MUTEX_UNLOCK; } /* @@ -4602,58 +4645,58 @@ */ void dw_mle_set_visible(HWND handle, int line) { - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; -#if GTK_MAJOR_VERSION > 1 - if(GTK_IS_SCROLLED_WINDOW(handle)) - { - GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - - if(tmp && GTK_IS_TEXT_VIEW(tmp)) - { - GtkTextBuffer *tbuffer; - GtkTextIter iter; - GtkTextMark *mark = (GtkTextMark *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_mark"); - - tbuffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (tmp)); - gtk_text_buffer_get_iter_at_offset(tbuffer, &iter, 0); - gtk_text_iter_set_line(&iter, line); - if(!mark) - { - mark = gtk_text_buffer_create_mark(tbuffer, NULL, &iter, FALSE); - gtk_object_set_data(GTK_OBJECT(handle), "_dw_mark", (gpointer)mark); - } - else - gtk_text_buffer_move_mark(tbuffer, mark, &iter); - gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW(tmp), mark, - 0, FALSE, 0, 0); - } - } + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; +#if GTK_MAJOR_VERSION > 1 + if(GTK_IS_SCROLLED_WINDOW(handle)) + { + GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + + if(tmp && GTK_IS_TEXT_VIEW(tmp)) + { + GtkTextBuffer *tbuffer; + GtkTextIter iter; + GtkTextMark *mark = (GtkTextMark *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_mark"); + + tbuffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (tmp)); + gtk_text_buffer_get_iter_at_offset(tbuffer, &iter, 0); + gtk_text_iter_set_line(&iter, line); + if(!mark) + { + mark = gtk_text_buffer_create_mark(tbuffer, NULL, &iter, FALSE); + gtk_object_set_data(GTK_OBJECT(handle), "_dw_mark", (gpointer)mark); + } + else + gtk_text_buffer_move_mark(tbuffer, mark, &iter); + gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW(tmp), mark, + 0, FALSE, 0, 0); + } + } #else - if(GTK_IS_BOX(handle)) - { - GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - - if(tmp && GTK_IS_TEXT(tmp)) - { - unsigned long lines; - float pos, ratio; - - dw_mle_get_size(handle, NULL, &lines); - - if(lines) - { - ratio = (float)line/(float)lines; - - pos = (ratio * (float)(GTK_TEXT(tmp)->vadj->upper - GTK_TEXT(tmp)->vadj->lower)) + GTK_TEXT(tmp)->vadj->lower; - - gtk_adjustment_set_value(GTK_TEXT(tmp)->vadj, pos); - } - } - } -#endif - DW_MUTEX_UNLOCK; + if(GTK_IS_BOX(handle)) + { + GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + + if(tmp && GTK_IS_TEXT(tmp)) + { + unsigned long lines; + float pos, ratio; + + dw_mle_get_size(handle, NULL, &lines); + + if(lines) + { + ratio = (float)line/(float)lines; + + pos = (ratio * (float)(GTK_TEXT(tmp)->vadj->upper - GTK_TEXT(tmp)->vadj->lower)) + GTK_TEXT(tmp)->vadj->lower; + + gtk_adjustment_set_value(GTK_TEXT(tmp)->vadj, pos); + } + } + } +#endif + DW_MUTEX_UNLOCK; } /* @@ -4664,27 +4707,27 @@ */ void dw_mle_set_editable(HWND handle, int state) { - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; -#if GTK_MAJOR_VERSION > 1 - if(GTK_IS_SCROLLED_WINDOW(handle)) - { - GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - - if(tmp && GTK_IS_TEXT_VIEW(tmp)) - gtk_text_view_set_editable(GTK_TEXT_VIEW(tmp), state); - } + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; +#if GTK_MAJOR_VERSION > 1 + if(GTK_IS_SCROLLED_WINDOW(handle)) + { + GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + + if(tmp && GTK_IS_TEXT_VIEW(tmp)) + gtk_text_view_set_editable(GTK_TEXT_VIEW(tmp), state); + } #else - if(GTK_IS_BOX(handle)) - { - GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - - if(tmp && GTK_IS_TEXT(tmp)) - gtk_text_set_editable(GTK_TEXT(tmp), state); - } -#endif - DW_MUTEX_UNLOCK; + if(GTK_IS_BOX(handle)) + { + GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + + if(tmp && GTK_IS_TEXT(tmp)) + gtk_text_set_editable(GTK_TEXT(tmp), state); + } +#endif + DW_MUTEX_UNLOCK; } /* @@ -4695,30 +4738,30 @@ */ void dw_mle_set_word_wrap(HWND handle, int state) { - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; -#if GTK_MAJOR_VERSION > 1 - if(GTK_IS_SCROLLED_WINDOW(handle)) - { - GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - - if(tmp && GTK_IS_TEXT_VIEW(tmp)) - gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(tmp), GTK_WRAP_WORD); - } + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; +#if GTK_MAJOR_VERSION > 1 + if(GTK_IS_SCROLLED_WINDOW(handle)) + { + GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + + if(tmp && GTK_IS_TEXT_VIEW(tmp)) + gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(tmp), GTK_WRAP_WORD); + } #else - if(GTK_IS_BOX(handle)) - { - GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - - if(tmp && GTK_IS_TEXT(tmp)) - { - gtk_text_set_word_wrap(GTK_TEXT(tmp), state); - gtk_text_set_line_wrap(GTK_TEXT(tmp), state); - } - } -#endif - DW_MUTEX_UNLOCK; + if(GTK_IS_BOX(handle)) + { + GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + + if(tmp && GTK_IS_TEXT(tmp)) + { + gtk_text_set_word_wrap(GTK_TEXT(tmp), state); + gtk_text_set_line_wrap(GTK_TEXT(tmp), state); + } + } +#endif + DW_MUTEX_UNLOCK; } /* @@ -4729,58 +4772,58 @@ */ void dw_mle_set_cursor(HWND handle, int point) { - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; -#if GTK_MAJOR_VERSION > 1 - if(GTK_IS_SCROLLED_WINDOW(handle)) + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; +#if GTK_MAJOR_VERSION > 1 + if(GTK_IS_SCROLLED_WINDOW(handle)) #else - if(GTK_IS_BOX(handle)) -#endif - { - GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - -#if GTK_MAJOR_VERSION > 1 - if(tmp && GTK_IS_TEXT_VIEW(tmp)) - { - GtkTextBuffer *tbuffer; - GtkTextIter iter; - GtkTextMark *mark = (GtkTextMark *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_mark"); - - tbuffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (tmp)); - gtk_text_buffer_get_iter_at_offset(tbuffer, &iter, point); - if(!mark) - { - mark = gtk_text_buffer_create_mark(tbuffer, NULL, &iter, FALSE); - gtk_object_set_data(GTK_OBJECT(handle), "_dw_mark", (gpointer)mark); - } - else - gtk_text_buffer_move_mark(tbuffer, mark, &iter); - gtk_text_buffer_place_cursor(tbuffer, &iter); - gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW(tmp), mark, - 0, FALSE, 0, 0); - } + if(GTK_IS_BOX(handle)) +#endif + { + GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + +#if GTK_MAJOR_VERSION > 1 + if(tmp && GTK_IS_TEXT_VIEW(tmp)) + { + GtkTextBuffer *tbuffer; + GtkTextIter iter; + GtkTextMark *mark = (GtkTextMark *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_mark"); + + tbuffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (tmp)); + gtk_text_buffer_get_iter_at_offset(tbuffer, &iter, point); + if(!mark) + { + mark = gtk_text_buffer_create_mark(tbuffer, NULL, &iter, FALSE); + gtk_object_set_data(GTK_OBJECT(handle), "_dw_mark", (gpointer)mark); + } + else + gtk_text_buffer_move_mark(tbuffer, mark, &iter); + gtk_text_buffer_place_cursor(tbuffer, &iter); + gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW(tmp), mark, + 0, FALSE, 0, 0); + } #else - if(tmp && GTK_IS_TEXT(tmp)) - { - unsigned long chars; - float pos, ratio; - - dw_mle_get_size(handle, &chars, NULL); - - if(chars) - { - ratio = (float)point/(float)chars; - - pos = (ratio * (float)(GTK_TEXT(tmp)->vadj->upper - GTK_TEXT(tmp)->vadj->lower)) + GTK_TEXT(tmp)->vadj->lower; - - gtk_adjustment_set_value(GTK_TEXT(tmp)->vadj, pos); - } - gtk_text_set_point(GTK_TEXT(tmp), point); - } -#endif - } - DW_MUTEX_UNLOCK; + if(tmp && GTK_IS_TEXT(tmp)) + { + unsigned long chars; + float pos, ratio; + + dw_mle_get_size(handle, &chars, NULL); + + if(chars) + { + ratio = (float)point/(float)chars; + + pos = (ratio * (float)(GTK_TEXT(tmp)->vadj->upper - GTK_TEXT(tmp)->vadj->lower)) + GTK_TEXT(tmp)->vadj->lower; + + gtk_adjustment_set_value(GTK_TEXT(tmp)->vadj, pos); + } + gtk_text_set_point(GTK_TEXT(tmp), point); + } +#endif + } + DW_MUTEX_UNLOCK; } /* @@ -4793,71 +4836,71 @@ */ int dw_mle_search(HWND handle, char *text, int point, unsigned long flags) { - int _locked_by_me = FALSE, retval = 0; - - DW_MUTEX_LOCK; -#if GTK_MAJOR_VERSION > 1 - if(GTK_IS_SCROLLED_WINDOW(handle)) + int _locked_by_me = FALSE, retval = 0; + + DW_MUTEX_LOCK; +#if GTK_MAJOR_VERSION > 1 + if(GTK_IS_SCROLLED_WINDOW(handle)) #else - if(GTK_IS_BOX(handle)) -#endif - { - GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - -#if GTK_MAJOR_VERSION > 1 - if(tmp && GTK_IS_TEXT_VIEW(tmp)) - { - GtkTextBuffer *tbuffer; - GtkTextIter iter, found; - - tbuffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (tmp)); - gtk_text_buffer_get_iter_at_offset(tbuffer, &iter, point); - gtk_text_iter_forward_search(&iter, text, GTK_TEXT_SEARCH_TEXT_ONLY, &found, NULL, NULL); - retval = gtk_text_iter_get_offset(&found); - } + if(GTK_IS_BOX(handle)) +#endif + { + GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + +#if GTK_MAJOR_VERSION > 1 + if(tmp && GTK_IS_TEXT_VIEW(tmp)) + { + GtkTextBuffer *tbuffer; + GtkTextIter iter, found; + + tbuffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (tmp)); + gtk_text_buffer_get_iter_at_offset(tbuffer, &iter, point); + gtk_text_iter_forward_search(&iter, text, GTK_TEXT_SEARCH_TEXT_ONLY, &found, NULL, NULL); + retval = gtk_text_iter_get_offset(&found); + } #else - if(tmp && GTK_IS_TEXT(tmp)) - { - int len = gtk_text_get_length(GTK_TEXT(tmp)); - gchar *tmpbuf; - - tmpbuf = gtk_editable_get_chars(GTK_EDITABLE(&(GTK_TEXT(tmp)->editable)), 0, len); - if(tmpbuf) - { - int z, textlen; - - textlen = strlen(text); - - if(flags & DW_MLE_CASESENSITIVE) - { - for(z=point;z<(len-textlen) && !retval;z++) - { - if(strncmp(&tmpbuf[z], text, textlen) == 0) - retval = z + textlen; - } - } - else - { - for(z=point;z<(len-textlen) && !retval;z++) - { - if(strncasecmp(&tmpbuf[z], text, textlen) == 0) - retval = z + textlen; - } - } - - if(retval) - { - gtk_text_set_point(GTK_TEXT(tmp), retval - textlen); - gtk_editable_select_region(&(GTK_TEXT(tmp)->editable), retval - textlen, retval); - } - - g_free(tmpbuf); - } - } -#endif - } - DW_MUTEX_UNLOCK; - return retval; + if(tmp && GTK_IS_TEXT(tmp)) + { + int len = gtk_text_get_length(GTK_TEXT(tmp)); + gchar *tmpbuf; + + tmpbuf = gtk_editable_get_chars(GTK_EDITABLE(&(GTK_TEXT(tmp)->editable)), 0, len); + if(tmpbuf) + { + int z, textlen; + + textlen = strlen(text); + + if(flags & DW_MLE_CASESENSITIVE) + { + for(z=point;z<(len-textlen) && !retval;z++) + { + if(strncmp(&tmpbuf[z], text, textlen) == 0) + retval = z + textlen; + } + } + else + { + for(z=point;z<(len-textlen) && !retval;z++) + { + if(strncasecmp(&tmpbuf[z], text, textlen) == 0) + retval = z + textlen; + } + } + + if(retval) + { + gtk_text_set_point(GTK_TEXT(tmp), retval - textlen); + gtk_editable_select_region(&(GTK_TEXT(tmp)->editable), retval - textlen, retval); + } + + g_free(tmpbuf); + } + } +#endif + } + DW_MUTEX_UNLOCK; + return retval; } /* @@ -4868,19 +4911,19 @@ void dw_mle_freeze(HWND handle) { #if GTK_MAJOR_VERSION < 2 - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - if(GTK_IS_BOX(handle)) - { - GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - - if(tmp && GTK_IS_TEXT(tmp)) - { - gtk_text_freeze(GTK_TEXT(tmp)); - } - } - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + if(GTK_IS_BOX(handle)) + { + GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + + if(tmp && GTK_IS_TEXT(tmp)) + { + gtk_text_freeze(GTK_TEXT(tmp)); + } + } + DW_MUTEX_UNLOCK; #endif } @@ -4892,19 +4935,19 @@ void dw_mle_thaw(HWND handle) { #if GTK_MAJOR_VERSION < 2 - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - if(GTK_IS_BOX(handle)) - { - GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - - if(tmp && GTK_IS_TEXT(tmp)) - { - gtk_text_thaw(GTK_TEXT(tmp)); - } - } - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + if(GTK_IS_BOX(handle)) + { + GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + + if(tmp && GTK_IS_TEXT(tmp)) + { + gtk_text_thaw(GTK_TEXT(tmp)); + } + } + DW_MUTEX_UNLOCK; #endif } @@ -4916,11 +4959,11 @@ */ void dw_percent_set_pos(HWND handle, unsigned int position) { - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - gtk_progress_bar_update(GTK_PROGRESS_BAR(handle), (gfloat)position/100); - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + gtk_progress_bar_update(GTK_PROGRESS_BAR(handle), (gfloat)position/100); + DW_MUTEX_UNLOCK; } /* @@ -4930,26 +4973,26 @@ */ unsigned int dw_slider_get_pos(HWND handle) { - int val = 0, _locked_by_me = FALSE; - GtkAdjustment *adjustment; - - if(!handle) - return 0; - - DW_MUTEX_LOCK; - adjustment = (GtkAdjustment *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_adjustment"); - if(adjustment) - { - int max = _round_value(adjustment->upper) - 1; - int thisval = _round_value(adjustment->value); - - if(GTK_IS_VSCALE(handle)) - val = max - thisval; + int val = 0, _locked_by_me = FALSE; + GtkAdjustment *adjustment; + + if(!handle) + return 0; + + DW_MUTEX_LOCK; + adjustment = (GtkAdjustment *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_adjustment"); + if(adjustment) + { + int max = _round_value(adjustment->upper) - 1; + int thisval = _round_value(adjustment->value); + + if(GTK_IS_VSCALE(handle)) + val = max - thisval; else - val = thisval; - } - DW_MUTEX_UNLOCK; - return val; + val = thisval; + } + DW_MUTEX_UNLOCK; + return val; } /* @@ -4960,24 +5003,24 @@ */ void dw_slider_set_pos(HWND handle, unsigned int position) { - int _locked_by_me = FALSE; - GtkAdjustment *adjustment; - - if(!handle) - return; - - DW_MUTEX_LOCK; - adjustment = (GtkAdjustment *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_adjustment"); - if(adjustment) - { - int max = _round_value(adjustment->upper) - 1; - - if(GTK_IS_VSCALE(handle)) - gtk_adjustment_set_value(adjustment, (gfloat)(max - position)); + int _locked_by_me = FALSE; + GtkAdjustment *adjustment; + + if(!handle) + return; + + DW_MUTEX_LOCK; + adjustment = (GtkAdjustment *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_adjustment"); + if(adjustment) + { + int max = _round_value(adjustment->upper) - 1; + + if(GTK_IS_VSCALE(handle)) + gtk_adjustment_set_value(adjustment, (gfloat)(max - position)); else - gtk_adjustment_set_value(adjustment, (gfloat)position); - } - DW_MUTEX_UNLOCK; + gtk_adjustment_set_value(adjustment, (gfloat)position); + } + DW_MUTEX_UNLOCK; } /* @@ -4987,18 +5030,18 @@ */ unsigned int dw_scrollbar_get_pos(HWND handle) { - int val = 0, _locked_by_me = FALSE; - GtkAdjustment *adjustment; - - if(!handle) - return 0; - - DW_MUTEX_LOCK; - adjustment = (GtkAdjustment *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_adjustment"); - if(adjustment) - val = _round_value(adjustment->value); - DW_MUTEX_UNLOCK; - return val; + int val = 0, _locked_by_me = FALSE; + GtkAdjustment *adjustment; + + if(!handle) + return 0; + + DW_MUTEX_LOCK; + adjustment = (GtkAdjustment *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_adjustment"); + if(adjustment) + val = _round_value(adjustment->value); + DW_MUTEX_UNLOCK; + return val; } /* @@ -5009,17 +5052,17 @@ */ void dw_scrollbar_set_pos(HWND handle, unsigned int position) { - int _locked_by_me = FALSE; - GtkAdjustment *adjustment; - - if(!handle) - return; - - DW_MUTEX_LOCK; - adjustment = (GtkAdjustment *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_adjustment"); - if(adjustment) - gtk_adjustment_set_value(adjustment, (gfloat)position); - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; + GtkAdjustment *adjustment; + + if(!handle) + return; + + DW_MUTEX_LOCK; + adjustment = (GtkAdjustment *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_adjustment"); + if(adjustment) + gtk_adjustment_set_value(adjustment, (gfloat)position); + DW_MUTEX_UNLOCK; } /* @@ -5031,20 +5074,20 @@ */ void API dw_scrollbar_set_range(HWND handle, unsigned int range, unsigned int visible) { - int _locked_by_me = FALSE; - GtkAdjustment *adjustment; - - if(!handle) - return; - - DW_MUTEX_LOCK; - adjustment = (GtkAdjustment *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_adjustment"); - if(adjustment) - { - adjustment->upper = (gdouble)range; - adjustment->page_increment = adjustment->page_size = (gdouble)visible; - } - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; + GtkAdjustment *adjustment; + + if(!handle) + return; + + DW_MUTEX_LOCK; + adjustment = (GtkAdjustment *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_adjustment"); + if(adjustment) + { + adjustment->upper = (gdouble)range; + adjustment->page_increment = adjustment->page_size = (gdouble)visible; + } + DW_MUTEX_UNLOCK; } /* @@ -5055,11 +5098,11 @@ */ void dw_spinbutton_set_pos(HWND handle, long position) { - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - gtk_spin_button_set_value(GTK_SPIN_BUTTON(handle), (gfloat)position); - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + gtk_spin_button_set_value(GTK_SPIN_BUTTON(handle), (gfloat)position); + DW_MUTEX_UNLOCK; } /* @@ -5071,15 +5114,15 @@ */ void dw_spinbutton_set_limits(HWND handle, long upper, long lower) { - long curval; - GtkAdjustment *adj; - int _locked_by_me = FALSE; - - curval = dw_spinbutton_get_pos(handle); - DW_MUTEX_LOCK; - adj = (GtkAdjustment *)gtk_adjustment_new((gfloat)curval, (gfloat)lower, (gfloat)upper, 1.0, 5.0, 0.0); - gtk_spin_button_set_adjustment(GTK_SPIN_BUTTON(handle), adj); - DW_MUTEX_UNLOCK; + long curval; + GtkAdjustment *adj; + int _locked_by_me = FALSE; + + curval = dw_spinbutton_get_pos(handle); + DW_MUTEX_LOCK; + adj = (GtkAdjustment *)gtk_adjustment_new((gfloat)curval, (gfloat)lower, (gfloat)upper, 1.0, 5.0, 0.0); + gtk_spin_button_set_adjustment(GTK_SPIN_BUTTON(handle), adj); + DW_MUTEX_UNLOCK; } /* @@ -5090,11 +5133,11 @@ */ void dw_entryfield_set_limit(HWND handle, ULONG limit) { - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - gtk_entry_set_max_length(GTK_ENTRY(handle), limit); - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + gtk_entry_set_max_length(GTK_ENTRY(handle), limit); + DW_MUTEX_UNLOCK; } /* @@ -5104,14 +5147,14 @@ */ long dw_spinbutton_get_pos(HWND handle) { - long retval; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - retval = (long)gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(handle)); - DW_MUTEX_UNLOCK; - - return retval; + long retval; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + retval = (long)gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(handle)); + DW_MUTEX_UNLOCK; + + return retval; } /* @@ -5121,14 +5164,14 @@ */ int dw_checkbox_get(HWND handle) { - int retval; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - retval = GTK_TOGGLE_BUTTON(handle)->active; - DW_MUTEX_UNLOCK; - - return retval; + int retval; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + retval = GTK_TOGGLE_BUTTON(handle)->active; + DW_MUTEX_UNLOCK; + + return retval; } /* @@ -5139,11 +5182,11 @@ */ void dw_checkbox_set(HWND handle, int value) { - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(handle), value); - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(handle), value); + DW_MUTEX_UNLOCK; } /* @@ -5159,144 +5202,144 @@ HTREEITEM dw_tree_insert_after(HWND handle, HTREEITEM item, char *title, unsigned long icon, HTREEITEM parent, void *itemdata) { #if GTK_MAJOR_VERSION > 1 - GtkWidget *tree; - GtkTreeIter *iter; - GtkTreeStore *store; - GdkPixbuf *pixbuf; - HTREEITEM retval = 0; - int _locked_by_me = FALSE; - - if(!handle) - return NULL; - - DW_MUTEX_LOCK; - if((tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle))) - && GTK_IS_TREE_VIEW(tree) && - (store = (GtkTreeStore *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_store"))) - { - iter = (GtkTreeIter *)malloc(sizeof(GtkTreeIter)); - - pixbuf = _find_pixbuf(icon); - - gtk_tree_store_insert_after(store, iter, (GtkTreeIter *)parent, (GtkTreeIter *)item); - gtk_tree_store_set (store, iter, 0, title, 1, pixbuf, 2, itemdata, 3, iter, -1); - if(pixbuf && !(icon & (1 << 31))) - g_object_unref(pixbuf); - retval = (HTREEITEM)iter; - } - DW_MUTEX_UNLOCK; - - return retval; + GtkWidget *tree; + GtkTreeIter *iter; + GtkTreeStore *store; + GdkPixbuf *pixbuf; + HTREEITEM retval = 0; + int _locked_by_me = FALSE; + + if(!handle) + return NULL; + + DW_MUTEX_LOCK; + if((tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle))) + && GTK_IS_TREE_VIEW(tree) && + (store = (GtkTreeStore *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_store"))) + { + iter = (GtkTreeIter *)malloc(sizeof(GtkTreeIter)); + + pixbuf = _find_pixbuf(icon); + + gtk_tree_store_insert_after(store, iter, (GtkTreeIter *)parent, (GtkTreeIter *)item); + gtk_tree_store_set (store, iter, 0, title, 1, pixbuf, 2, itemdata, 3, iter, -1); + if(pixbuf && !(icon & (1 << 31))) + g_object_unref(pixbuf); + retval = (HTREEITEM)iter; + } + DW_MUTEX_UNLOCK; + + return retval; #else - GtkWidget *newitem, *tree, *subtree, *label, *hbox, *pixmap; - GdkPixmap *gdkpix; - GdkBitmap *gdkbmp = NULL; - int position = -1; - int _locked_by_me = FALSE; - - if(!handle) - return NULL; - - DW_MUTEX_LOCK; - tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - if(!tree || !GTK_IS_TREE(tree)) - { - DW_MUTEX_UNLOCK; - return NULL; - } - - if(item && GTK_IS_TREE_ITEM(item)) - position = gtk_tree_child_position(GTK_TREE(tree), item); - - position++; - - newitem = gtk_tree_item_new(); - label = gtk_label_new(title); - gtk_object_set_data(GTK_OBJECT(newitem), "_dw_text", (gpointer)strdup(title)); - gtk_object_set_data(GTK_OBJECT(newitem), "_dw_itemdata", (gpointer)itemdata); - gtk_object_set_data(GTK_OBJECT(newitem), "_dw_tree", (gpointer)tree); - gtk_object_set_data(GTK_OBJECT(newitem), "_dw_parent", (gpointer)parent); - hbox = gtk_hbox_new(FALSE, 2); - gtk_object_set_data(GTK_OBJECT(newitem), "_dw_hbox", (gpointer)hbox); - gdkpix = _find_pixmap(&gdkbmp, icon, hbox, NULL, NULL); - gtk_container_add(GTK_CONTAINER(newitem), hbox); - if(gdkpix) - { - pixmap = gtk_pixmap_new(gdkpix, gdkbmp); - gtk_box_pack_start(GTK_BOX(hbox), pixmap, FALSE, TRUE, 0); - gtk_widget_show(pixmap); - } - gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, TRUE, 0); - gtk_widget_show(label); - gtk_widget_show(hbox); - - { - void *thisfunc = (void *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_item_expand_func"); - void *mydata = (void *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_item_expand_data"); - SignalHandler work = _get_signal_handler(tree, mydata); - - if(thisfunc && work.window) - { - int sigid = _set_signal_handler(newitem, work.window, work.func, work.data, thisfunc); - gint cid =gtk_signal_connect(GTK_OBJECT(newitem), "expand", GTK_SIGNAL_FUNC(thisfunc),(gpointer)sigid); - _set_signal_handler_id(newitem, sigid, cid); - } - } - - _dw_ignore_expand = 1; - if(parent) - { - subtree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(parent)); - if(!subtree || !GTK_IS_TREE(subtree)) - { - void *thisfunc = (void *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_select_child_func"); - void *mydata = (void *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_select_child_data"); - SignalHandler work = _get_signal_handler(tree, mydata); - - subtree = gtk_tree_new(); - - if(thisfunc && work.window) - { - int sigid = _set_signal_handler(subtree, work.window, work.func, work.data, thisfunc); - gint cid =gtk_signal_connect(GTK_OBJECT(subtree), "select-child", GTK_SIGNAL_FUNC(thisfunc),(gpointer)sigid); - _set_signal_handler_id(subtree, sigid, cid); - } - - thisfunc = (void *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_container_context_func"); - mydata = (void *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_container_context_data"); - work = _get_signal_handler(tree, mydata); - - if(thisfunc && work.window) - { - int sigid = _set_signal_handler(subtree, work.window, work.func, work.data, thisfunc); - gint cid =gtk_signal_connect(GTK_OBJECT(subtree), "button_press_event", GTK_SIGNAL_FUNC(thisfunc),(gpointer)sigid); - _set_signal_handler_id(subtree, sigid, cid); - } - - gtk_object_set_user_data(GTK_OBJECT(parent), subtree); - gtk_tree_set_selection_mode(GTK_TREE(subtree), GTK_SELECTION_SINGLE); - gtk_tree_set_view_mode(GTK_TREE(subtree), GTK_TREE_VIEW_ITEM); - gtk_tree_item_set_subtree(GTK_TREE_ITEM(parent), subtree); - gtk_object_set_data(GTK_OBJECT(subtree), "_dw_parentitem", (gpointer)parent); - gtk_tree_item_collapse(GTK_TREE_ITEM(parent)); - gtk_widget_show(subtree); - gtk_tree_item_expand(GTK_TREE_ITEM(parent)); - gtk_tree_item_collapse(GTK_TREE_ITEM(parent)); - } - gtk_object_set_data(GTK_OBJECT(newitem), "_dw_parenttree", (gpointer)subtree); - gtk_tree_insert(GTK_TREE(subtree), newitem, position); - } - else - { - gtk_object_set_data(GTK_OBJECT(newitem), "_dw_parenttree", (gpointer)tree); - gtk_tree_insert(GTK_TREE(tree), newitem, position); - } - gtk_tree_item_expand(GTK_TREE_ITEM(newitem)); - gtk_tree_item_collapse(GTK_TREE_ITEM(newitem)); - gtk_widget_show(newitem); - _dw_ignore_expand = 0; - DW_MUTEX_UNLOCK; - return (HTREEITEM)newitem; + GtkWidget *newitem, *tree, *subtree, *label, *hbox, *pixmap; + GdkPixmap *gdkpix; + GdkBitmap *gdkbmp = NULL; + int position = -1; + int _locked_by_me = FALSE; + + if(!handle) + return NULL; + + DW_MUTEX_LOCK; + tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + if(!tree || !GTK_IS_TREE(tree)) + { + DW_MUTEX_UNLOCK; + return NULL; + } + + if(item && GTK_IS_TREE_ITEM(item)) + position = gtk_tree_child_position(GTK_TREE(tree), item); + + position++; + + newitem = gtk_tree_item_new(); + label = gtk_label_new(title); + gtk_object_set_data(GTK_OBJECT(newitem), "_dw_text", (gpointer)strdup(title)); + gtk_object_set_data(GTK_OBJECT(newitem), "_dw_itemdata", (gpointer)itemdata); + gtk_object_set_data(GTK_OBJECT(newitem), "_dw_tree", (gpointer)tree); + gtk_object_set_data(GTK_OBJECT(newitem), "_dw_parent", (gpointer)parent); + hbox = gtk_hbox_new(FALSE, 2); + gtk_object_set_data(GTK_OBJECT(newitem), "_dw_hbox", (gpointer)hbox); + gdkpix = _find_pixmap(&gdkbmp, icon, hbox, NULL, NULL); + gtk_container_add(GTK_CONTAINER(newitem), hbox); + if(gdkpix) + { + pixmap = gtk_pixmap_new(gdkpix, gdkbmp); + gtk_box_pack_start(GTK_BOX(hbox), pixmap, FALSE, TRUE, 0); + gtk_widget_show(pixmap); + } + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, TRUE, 0); + gtk_widget_show(label); + gtk_widget_show(hbox); + + { + void *thisfunc = (void *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_item_expand_func"); + void *mydata = (void *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_item_expand_data"); + SignalHandler work = _get_signal_handler(tree, mydata); + + if(thisfunc && work.window) + { + int sigid = _set_signal_handler(newitem, work.window, work.func, work.data, thisfunc); + gint cid =gtk_signal_connect(GTK_OBJECT(newitem), "expand", GTK_SIGNAL_FUNC(thisfunc),(gpointer)sigid); + _set_signal_handler_id(newitem, sigid, cid); + } + } + + _dw_ignore_expand = 1; + if(parent) + { + subtree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(parent)); + if(!subtree || !GTK_IS_TREE(subtree)) + { + void *thisfunc = (void *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_select_child_func"); + void *mydata = (void *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_select_child_data"); + SignalHandler work = _get_signal_handler(tree, mydata); + + subtree = gtk_tree_new(); + + if(thisfunc && work.window) + { + int sigid = _set_signal_handler(subtree, work.window, work.func, work.data, thisfunc); + gint cid =gtk_signal_connect(GTK_OBJECT(subtree), "select-child", GTK_SIGNAL_FUNC(thisfunc),(gpointer)sigid); + _set_signal_handler_id(subtree, sigid, cid); + } + + thisfunc = (void *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_container_context_func"); + mydata = (void *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_container_context_data"); + work = _get_signal_handler(tree, mydata); + + if(thisfunc && work.window) + { + int sigid = _set_signal_handler(subtree, work.window, work.func, work.data, thisfunc); + gint cid =gtk_signal_connect(GTK_OBJECT(subtree), "button_press_event", GTK_SIGNAL_FUNC(thisfunc),(gpointer)sigid); + _set_signal_handler_id(subtree, sigid, cid); + } + + gtk_object_set_user_data(GTK_OBJECT(parent), subtree); + gtk_tree_set_selection_mode(GTK_TREE(subtree), GTK_SELECTION_SINGLE); + gtk_tree_set_view_mode(GTK_TREE(subtree), GTK_TREE_VIEW_ITEM); + gtk_tree_item_set_subtree(GTK_TREE_ITEM(parent), subtree); + gtk_object_set_data(GTK_OBJECT(subtree), "_dw_parentitem", (gpointer)parent); + gtk_tree_item_collapse(GTK_TREE_ITEM(parent)); + gtk_widget_show(subtree); + gtk_tree_item_expand(GTK_TREE_ITEM(parent)); + gtk_tree_item_collapse(GTK_TREE_ITEM(parent)); + } + gtk_object_set_data(GTK_OBJECT(newitem), "_dw_parenttree", (gpointer)subtree); + gtk_tree_insert(GTK_TREE(subtree), newitem, position); + } + else + { + gtk_object_set_data(GTK_OBJECT(newitem), "_dw_parenttree", (gpointer)tree); + gtk_tree_insert(GTK_TREE(tree), newitem, position); + } + gtk_tree_item_expand(GTK_TREE_ITEM(newitem)); + gtk_tree_item_collapse(GTK_TREE_ITEM(newitem)); + gtk_widget_show(newitem); + _dw_ignore_expand = 0; + DW_MUTEX_UNLOCK; + return (HTREEITEM)newitem; #endif } @@ -5312,137 +5355,137 @@ HTREEITEM dw_tree_insert(HWND handle, char *title, unsigned long icon, HTREEITEM parent, void *itemdata) { #if GTK_MAJOR_VERSION > 1 - GtkWidget *tree; - GtkTreeIter *iter; - GtkTreeStore *store; - GdkPixbuf *pixbuf; - HTREEITEM retval = 0; - int _locked_by_me = FALSE; - - if(!handle) - return NULL; - - DW_MUTEX_LOCK; - if((tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle))) - && GTK_IS_TREE_VIEW(tree) && - (store = (GtkTreeStore *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_store"))) - { - iter = (GtkTreeIter *)malloc(sizeof(GtkTreeIter)); - - pixbuf = _find_pixbuf(icon); - - gtk_tree_store_append (store, iter, (GtkTreeIter *)parent); - gtk_tree_store_set (store, iter, 0, title, 1, pixbuf, 2, itemdata, 3, iter, -1); - if(pixbuf && !(icon & (1 << 31))) - g_object_unref(pixbuf); - retval = (HTREEITEM)iter; - } - DW_MUTEX_UNLOCK; - - return retval; + GtkWidget *tree; + GtkTreeIter *iter; + GtkTreeStore *store; + GdkPixbuf *pixbuf; + HTREEITEM retval = 0; + int _locked_by_me = FALSE; + + if(!handle) + return NULL; + + DW_MUTEX_LOCK; + if((tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle))) + && GTK_IS_TREE_VIEW(tree) && + (store = (GtkTreeStore *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_store"))) + { + iter = (GtkTreeIter *)malloc(sizeof(GtkTreeIter)); + + pixbuf = _find_pixbuf(icon); + + gtk_tree_store_append (store, iter, (GtkTreeIter *)parent); + gtk_tree_store_set (store, iter, 0, title, 1, pixbuf, 2, itemdata, 3, iter, -1); + if(pixbuf && !(icon & (1 << 31))) + g_object_unref(pixbuf); + retval = (HTREEITEM)iter; + } + DW_MUTEX_UNLOCK; + + return retval; #else - GtkWidget *item, *tree, *subtree, *label, *hbox, *pixmap; - GdkPixmap *gdkpix; - GdkBitmap *gdkbmp = NULL; - int _locked_by_me = FALSE; - - if(!handle) - return NULL; - - DW_MUTEX_LOCK; - tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - if(!tree || !GTK_IS_TREE(tree)) - { - DW_MUTEX_UNLOCK; - return NULL; - } - item = gtk_tree_item_new(); - label = gtk_label_new(title); - gtk_object_set_data(GTK_OBJECT(item), "_dw_text", (gpointer)strdup(title)); - gtk_object_set_data(GTK_OBJECT(item), "_dw_itemdata", (gpointer)itemdata); - gtk_object_set_data(GTK_OBJECT(item), "_dw_tree", (gpointer)tree); - gtk_object_set_data(GTK_OBJECT(item), "_dw_parent", (gpointer)parent); - hbox = gtk_hbox_new(FALSE, 2); - gtk_object_set_data(GTK_OBJECT(item), "_dw_hbox", (gpointer)hbox); - gdkpix = _find_pixmap(&gdkbmp, icon, hbox, NULL, NULL); - gtk_container_add(GTK_CONTAINER(item), hbox); - if(gdkpix) - { - pixmap = gtk_pixmap_new(gdkpix, gdkbmp); - gtk_box_pack_start(GTK_BOX(hbox), pixmap, FALSE, TRUE, 0); - gtk_widget_show(pixmap); - } - gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, TRUE, 0); - gtk_widget_show(label); - gtk_widget_show(hbox); - - { - void *thisfunc = (void *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_item_expand_func"); - void *mydata = (void *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_item_expand_data"); - SignalHandler work = _get_signal_handler(tree, mydata); - - if(thisfunc && work.window) - { - int sigid = _set_signal_handler(item, work.window, work.func, work.data, thisfunc); - gint cid =gtk_signal_connect(GTK_OBJECT(item), "expand", GTK_SIGNAL_FUNC(thisfunc),(gpointer)sigid); - _set_signal_handler_id(item, sigid, cid); - } - } - - _dw_ignore_expand = 1; - if(parent) - { - subtree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(parent)); - if(!subtree || !GTK_IS_TREE(subtree)) - { - void *thisfunc = (void *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_select_child_func"); - void *mydata = (void *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_select_child_data"); - SignalHandler work = _get_signal_handler(tree, mydata); - - subtree = gtk_tree_new(); - - if(thisfunc && work.window) - { - int sigid = _set_signal_handler(subtree, work.window, work.func, work.data, thisfunc); - gint cid =gtk_signal_connect(GTK_OBJECT(subtree), "select-child", GTK_SIGNAL_FUNC(thisfunc),(gpointer)sigid); - _set_signal_handler_id(subtree, sigid, cid); - } - - thisfunc = (void *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_container_context_func"); - mydata = (void *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_container_context_data"); - work = _get_signal_handler(tree, mydata); - - if(thisfunc && work.window) - { - int sigid = _set_signal_handler(subtree, work.window, work.func, work.data, thisfunc); - gint cid =gtk_signal_connect(GTK_OBJECT(subtree), "button_press_event", GTK_SIGNAL_FUNC(thisfunc),(gpointer)sigid); - _set_signal_handler_id(subtree, sigid, cid); - } - - gtk_object_set_user_data(GTK_OBJECT(parent), subtree); - gtk_tree_set_selection_mode(GTK_TREE(subtree), GTK_SELECTION_SINGLE); - gtk_tree_set_view_mode(GTK_TREE(subtree), GTK_TREE_VIEW_ITEM); - gtk_tree_item_set_subtree(GTK_TREE_ITEM(parent), subtree); - gtk_object_set_data(GTK_OBJECT(subtree), "_dw_parentitem", (gpointer)parent); - gtk_tree_item_collapse(GTK_TREE_ITEM(parent)); - gtk_widget_show(subtree); - gtk_tree_item_expand(GTK_TREE_ITEM(parent)); - gtk_tree_item_collapse(GTK_TREE_ITEM(parent)); - } - gtk_object_set_data(GTK_OBJECT(item), "_dw_parenttree", (gpointer)subtree); - gtk_tree_append(GTK_TREE(subtree), item); - } - else - { - gtk_object_set_data(GTK_OBJECT(item), "_dw_parenttree", (gpointer)tree); - gtk_tree_append(GTK_TREE(tree), item); - } - gtk_tree_item_expand(GTK_TREE_ITEM(item)); - gtk_tree_item_collapse(GTK_TREE_ITEM(item)); - gtk_widget_show(item); - _dw_ignore_expand = 0; - DW_MUTEX_UNLOCK; - return (HTREEITEM)item; + GtkWidget *item, *tree, *subtree, *label, *hbox, *pixmap; + GdkPixmap *gdkpix; + GdkBitmap *gdkbmp = NULL; + int _locked_by_me = FALSE; + + if(!handle) + return NULL; + + DW_MUTEX_LOCK; + tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + if(!tree || !GTK_IS_TREE(tree)) + { + DW_MUTEX_UNLOCK; + return NULL; + } + item = gtk_tree_item_new(); + label = gtk_label_new(title); + gtk_object_set_data(GTK_OBJECT(item), "_dw_text", (gpointer)strdup(title)); + gtk_object_set_data(GTK_OBJECT(item), "_dw_itemdata", (gpointer)itemdata); + gtk_object_set_data(GTK_OBJECT(item), "_dw_tree", (gpointer)tree); + gtk_object_set_data(GTK_OBJECT(item), "_dw_parent", (gpointer)parent); + hbox = gtk_hbox_new(FALSE, 2); + gtk_object_set_data(GTK_OBJECT(item), "_dw_hbox", (gpointer)hbox); + gdkpix = _find_pixmap(&gdkbmp, icon, hbox, NULL, NULL); + gtk_container_add(GTK_CONTAINER(item), hbox); + if(gdkpix) + { + pixmap = gtk_pixmap_new(gdkpix, gdkbmp); + gtk_box_pack_start(GTK_BOX(hbox), pixmap, FALSE, TRUE, 0); + gtk_widget_show(pixmap); + } + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, TRUE, 0); + gtk_widget_show(label); + gtk_widget_show(hbox); + + { + void *thisfunc = (void *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_item_expand_func"); + void *mydata = (void *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_item_expand_data"); + SignalHandler work = _get_signal_handler(tree, mydata); + + if(thisfunc && work.window) + { + int sigid = _set_signal_handler(item, work.window, work.func, work.data, thisfunc); + gint cid =gtk_signal_connect(GTK_OBJECT(item), "expand", GTK_SIGNAL_FUNC(thisfunc),(gpointer)sigid); + _set_signal_handler_id(item, sigid, cid); + } + } + + _dw_ignore_expand = 1; + if(parent) + { + subtree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(parent)); + if(!subtree || !GTK_IS_TREE(subtree)) + { + void *thisfunc = (void *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_select_child_func"); + void *mydata = (void *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_select_child_data"); + SignalHandler work = _get_signal_handler(tree, mydata); + + subtree = gtk_tree_new(); + + if(thisfunc && work.window) + { + int sigid = _set_signal_handler(subtree, work.window, work.func, work.data, thisfunc); + gint cid =gtk_signal_connect(GTK_OBJECT(subtree), "select-child", GTK_SIGNAL_FUNC(thisfunc),(gpointer)sigid); + _set_signal_handler_id(subtree, sigid, cid); + } + + thisfunc = (void *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_container_context_func"); + mydata = (void *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_container_context_data"); + work = _get_signal_handler(tree, mydata); + + if(thisfunc && work.window) + { + int sigid = _set_signal_handler(subtree, work.window, work.func, work.data, thisfunc); + gint cid =gtk_signal_connect(GTK_OBJECT(subtree), "button_press_event", GTK_SIGNAL_FUNC(thisfunc),(gpointer)sigid); + _set_signal_handler_id(subtree, sigid, cid); + } + + gtk_object_set_user_data(GTK_OBJECT(parent), subtree); + gtk_tree_set_selection_mode(GTK_TREE(subtree), GTK_SELECTION_SINGLE); + gtk_tree_set_view_mode(GTK_TREE(subtree), GTK_TREE_VIEW_ITEM); + gtk_tree_item_set_subtree(GTK_TREE_ITEM(parent), subtree); + gtk_object_set_data(GTK_OBJECT(subtree), "_dw_parentitem", (gpointer)parent); + gtk_tree_item_collapse(GTK_TREE_ITEM(parent)); + gtk_widget_show(subtree); + gtk_tree_item_expand(GTK_TREE_ITEM(parent)); + gtk_tree_item_collapse(GTK_TREE_ITEM(parent)); + } + gtk_object_set_data(GTK_OBJECT(item), "_dw_parenttree", (gpointer)subtree); + gtk_tree_append(GTK_TREE(subtree), item); + } + else + { + gtk_object_set_data(GTK_OBJECT(item), "_dw_parenttree", (gpointer)tree); + gtk_tree_append(GTK_TREE(tree), item); + } + gtk_tree_item_expand(GTK_TREE_ITEM(item)); + gtk_tree_item_collapse(GTK_TREE_ITEM(item)); + gtk_widget_show(item); + _dw_ignore_expand = 0; + DW_MUTEX_UNLOCK; + return (HTREEITEM)item; #endif } @@ -5457,58 +5500,58 @@ void dw_tree_item_change(HWND handle, HTREEITEM item, char *title, unsigned long icon) { #if GTK_MAJOR_VERSION > 1 - GtkWidget *tree; - GtkTreeStore *store; - GdkPixbuf *pixbuf; - int _locked_by_me = FALSE; - - if(!handle) - return; - - DW_MUTEX_LOCK; - if((tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle))) - && GTK_IS_TREE_VIEW(tree) && - (store = (GtkTreeStore *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_store"))) - { - pixbuf = _find_pixbuf(icon); - - gtk_tree_store_set(store, (GtkTreeIter *)item, 0, title, 1, pixbuf, -1); - if(pixbuf && !(icon & (1 << 31))) - g_object_unref(pixbuf); - } - DW_MUTEX_UNLOCK; + GtkWidget *tree; + GtkTreeStore *store; + GdkPixbuf *pixbuf; + int _locked_by_me = FALSE; + + if(!handle) + return; + + DW_MUTEX_LOCK; + if((tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle))) + && GTK_IS_TREE_VIEW(tree) && + (store = (GtkTreeStore *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_store"))) + { + pixbuf = _find_pixbuf(icon); + + gtk_tree_store_set(store, (GtkTreeIter *)item, 0, title, 1, pixbuf, -1); + if(pixbuf && !(icon & (1 << 31))) + g_object_unref(pixbuf); + } + DW_MUTEX_UNLOCK; #else - GtkWidget *label, *hbox, *pixmap; - GdkPixmap *gdkpix; - GdkBitmap *gdkbmp = NULL; - char *oldtext; - int _locked_by_me = FALSE; - - if(!handle || !item) - return; - - DW_MUTEX_LOCK; - oldtext = (char *)gtk_object_get_data(GTK_OBJECT(item), "_dw_text"); - if(oldtext) - free(oldtext); - label = gtk_label_new(title); - gtk_object_set_data(GTK_OBJECT(item), "_dw_text", (gpointer)strdup(title)); - hbox = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(item), "_dw_hbox"); - gtk_widget_destroy(hbox); - hbox = gtk_hbox_new(FALSE, 2); - gtk_object_set_data(GTK_OBJECT(item), "_dw_hbox", (gpointer)hbox); - gdkpix = _find_pixmap(&gdkbmp, icon, hbox, NULL, NULL); - gtk_container_add(GTK_CONTAINER(item), hbox); - if(gdkpix) - { - pixmap = gtk_pixmap_new(gdkpix, gdkbmp); - gtk_box_pack_start(GTK_BOX(hbox), pixmap, FALSE, TRUE, 0); - gtk_widget_show(pixmap); - } - gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, TRUE, 0); - gtk_widget_show(label); - gtk_widget_show(hbox); - DW_MUTEX_UNLOCK; + GtkWidget *label, *hbox, *pixmap; + GdkPixmap *gdkpix; + GdkBitmap *gdkbmp = NULL; + char *oldtext; + int _locked_by_me = FALSE; + + if(!handle || !item) + return; + + DW_MUTEX_LOCK; + oldtext = (char *)gtk_object_get_data(GTK_OBJECT(item), "_dw_text"); + if(oldtext) + free(oldtext); + label = gtk_label_new(title); + gtk_object_set_data(GTK_OBJECT(item), "_dw_text", (gpointer)strdup(title)); + hbox = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(item), "_dw_hbox"); + gtk_widget_destroy(hbox); + hbox = gtk_hbox_new(FALSE, 2); + gtk_object_set_data(GTK_OBJECT(item), "_dw_hbox", (gpointer)hbox); + gdkpix = _find_pixmap(&gdkbmp, icon, hbox, NULL, NULL); + gtk_container_add(GTK_CONTAINER(item), hbox); + if(gdkpix) + { + pixmap = gtk_pixmap_new(gdkpix, gdkbmp); + gtk_box_pack_start(GTK_BOX(hbox), pixmap, FALSE, TRUE, 0); + gtk_widget_show(pixmap); + } + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, TRUE, 0); + gtk_widget_show(label); + gtk_widget_show(hbox); + DW_MUTEX_UNLOCK; #endif } @@ -5522,28 +5565,28 @@ void dw_tree_item_set_data(HWND handle, HTREEITEM item, void *itemdata) { #if GTK_MAJOR_VERSION > 1 - GtkWidget *tree; - GtkTreeStore *store; - int _locked_by_me = FALSE; - - if(!handle || !item) - return; - - DW_MUTEX_LOCK; - if((tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle))) - && GTK_IS_TREE_VIEW(tree) && - (store = (GtkTreeStore *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_store"))) - gtk_tree_store_set(store, (GtkTreeIter *)item, 2, itemdata, -1); - DW_MUTEX_UNLOCK; + GtkWidget *tree; + GtkTreeStore *store; + int _locked_by_me = FALSE; + + if(!handle || !item) + return; + + DW_MUTEX_LOCK; + if((tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle))) + && GTK_IS_TREE_VIEW(tree) && + (store = (GtkTreeStore *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_store"))) + gtk_tree_store_set(store, (GtkTreeIter *)item, 2, itemdata, -1); + DW_MUTEX_UNLOCK; #else - int _locked_by_me = FALSE; - - if(!handle || !item) - return; - - DW_MUTEX_LOCK; - gtk_object_set_data(GTK_OBJECT(item), "_dw_itemdata", (gpointer)itemdata); - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; + + if(!handle || !item) + return; + + DW_MUTEX_LOCK; + gtk_object_set_data(GTK_OBJECT(item), "_dw_itemdata", (gpointer)itemdata); + DW_MUTEX_UNLOCK; #endif } @@ -5555,28 +5598,28 @@ */ char * API dw_tree_get_title(HWND handle, HTREEITEM item) { - int _locked_by_me = FALSE; - char *text = NULL; -#if GTK_MAJOR_VERSION > 1 - GtkWidget *tree; - GtkTreeModel *store; -#endif - - if(!handle || !item) - return text; - - DW_MUTEX_LOCK; -#if GTK_MAJOR_VERSION > 1 - tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - - if(tree && GTK_IS_TREE_VIEW(tree) && - (store = (GtkTreeModel *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_store"))) - gtk_tree_model_get(store, (GtkTreeIter *)item, 0, &text, -1); + int _locked_by_me = FALSE; + char *text = NULL; +#if GTK_MAJOR_VERSION > 1 + GtkWidget *tree; + GtkTreeModel *store; +#endif + + if(!handle || !item) + return text; + + DW_MUTEX_LOCK; +#if GTK_MAJOR_VERSION > 1 + tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + + if(tree && GTK_IS_TREE_VIEW(tree) && + (store = (GtkTreeModel *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_store"))) + gtk_tree_model_get(store, (GtkTreeIter *)item, 0, &text, -1); #else - text = (char *)gtk_object_get_data(GTK_OBJECT(item), "_dw_text"); -#endif - DW_MUTEX_UNLOCK; - return text; + text = (char *)gtk_object_get_data(GTK_OBJECT(item), "_dw_text"); +#endif + DW_MUTEX_UNLOCK; + return text; } /* @@ -5587,35 +5630,35 @@ */ HTREEITEM API dw_tree_get_parent(HWND handle, HTREEITEM item) { - int _locked_by_me = FALSE; - HTREEITEM parent = (HTREEITEM)0; -#if GTK_MAJOR_VERSION > 1 - GtkWidget *tree; - GtkTreeModel *store; -#endif - - if(!handle || !item) - return parent; - - DW_MUTEX_LOCK; -#if GTK_MAJOR_VERSION > 1 - tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - - if(tree && GTK_IS_TREE_VIEW(tree) && - (store = (GtkTreeModel *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_store"))) - { - GtkTreeIter *p = malloc(sizeof(GtkTreeIter)); - - if(gtk_tree_model_iter_parent(store, p, (GtkTreeIter *)item)) - parent = p; - else - free(p); - } + int _locked_by_me = FALSE; + HTREEITEM parent = (HTREEITEM)0; +#if GTK_MAJOR_VERSION > 1 + GtkWidget *tree; + GtkTreeModel *store; +#endif + + if(!handle || !item) + return parent; + + DW_MUTEX_LOCK; +#if GTK_MAJOR_VERSION > 1 + tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + + if(tree && GTK_IS_TREE_VIEW(tree) && + (store = (GtkTreeModel *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_store"))) + { + GtkTreeIter *p = malloc(sizeof(GtkTreeIter)); + + if(gtk_tree_model_iter_parent(store, p, (GtkTreeIter *)item)) + parent = p; + else + free(p); + } #else - parent = (HTREEITEM)gtk_object_get_data(GTK_OBJECT(item), "_dw_parent"); -#endif - DW_MUTEX_UNLOCK; - return parent; + parent = (HTREEITEM)gtk_object_get_data(GTK_OBJECT(item), "_dw_parent"); +#endif + DW_MUTEX_UNLOCK; + return parent; } /* @@ -5626,32 +5669,32 @@ */ void *dw_tree_item_get_data(HWND handle, HTREEITEM item) { - void *ret = NULL; -#if GTK_MAJOR_VERSION > 1 - GtkWidget *tree; - GtkTreeModel *store; - int _locked_by_me = FALSE; - - if(!handle || !item) - return NULL; - - DW_MUTEX_LOCK; - if((tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle))) - && GTK_IS_TREE_VIEW(tree) && - (store = (GtkTreeModel *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_store"))) - gtk_tree_model_get(store, (GtkTreeIter *)item, 2, &ret, -1); - DW_MUTEX_UNLOCK; + void *ret = NULL; +#if GTK_MAJOR_VERSION > 1 + GtkWidget *tree; + GtkTreeModel *store; + int _locked_by_me = FALSE; + + if(!handle || !item) + return NULL; + + DW_MUTEX_LOCK; + if((tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle))) + && GTK_IS_TREE_VIEW(tree) && + (store = (GtkTreeModel *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_store"))) + gtk_tree_model_get(store, (GtkTreeIter *)item, 2, &ret, -1); + DW_MUTEX_UNLOCK; #else - int _locked_by_me = FALSE; - - if(!handle || !item) - return NULL; - - DW_MUTEX_LOCK; - ret = (void *)gtk_object_get_data(GTK_OBJECT(item), "_dw_itemdata"); - DW_MUTEX_UNLOCK; -#endif - return ret; + int _locked_by_me = FALSE; + + if(!handle || !item) + return NULL; + + DW_MUTEX_LOCK; + ret = (void *)gtk_object_get_data(GTK_OBJECT(item), "_dw_itemdata"); + DW_MUTEX_UNLOCK; +#endif + return ret; } /* @@ -5663,61 +5706,61 @@ void dw_tree_item_select(HWND handle, HTREEITEM item) { #if GTK_MAJOR_VERSION > 1 - GtkWidget *tree; - GtkTreeStore *store; - int _locked_by_me = FALSE; - - if(!handle || !item) - return; - - DW_MUTEX_LOCK; - if((tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle))) - && GTK_IS_TREE_VIEW(tree) && - (store = (GtkTreeStore *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_store"))) - { - GtkTreePath *path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), (GtkTreeIter *)item); - GtkTreeSelection *sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree)); - - gtk_tree_view_set_cursor(GTK_TREE_VIEW(tree), path, NULL, FALSE); - gtk_tree_selection_select_iter(sel, (GtkTreeIter *)item); - gtk_tree_path_free(path); - } - DW_MUTEX_UNLOCK; + GtkWidget *tree; + GtkTreeStore *store; + int _locked_by_me = FALSE; + + if(!handle || !item) + return; + + DW_MUTEX_LOCK; + if((tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle))) + && GTK_IS_TREE_VIEW(tree) && + (store = (GtkTreeStore *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_store"))) + { + GtkTreePath *path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), (GtkTreeIter *)item); + GtkTreeSelection *sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree)); + + gtk_tree_view_set_cursor(GTK_TREE_VIEW(tree), path, NULL, FALSE); + gtk_tree_selection_select_iter(sel, (GtkTreeIter *)item); + gtk_tree_path_free(path); + } + DW_MUTEX_UNLOCK; #else - GtkWidget *lastselect, *tree; - int _locked_by_me = FALSE; - - if(!handle || !item) - return; - - DW_MUTEX_LOCK; - tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - lastselect = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_lastselect"); - if(lastselect && GTK_IS_TREE_ITEM(lastselect)) - gtk_tree_item_deselect(GTK_TREE_ITEM(lastselect)); - gtk_tree_item_select(GTK_TREE_ITEM(item)); - gtk_object_set_data(GTK_OBJECT(tree), "_dw_lastselect", (gpointer)item); - DW_MUTEX_UNLOCK; + GtkWidget *lastselect, *tree; + int _locked_by_me = FALSE; + + if(!handle || !item) + return; + + DW_MUTEX_LOCK; + tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + lastselect = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_lastselect"); + if(lastselect && GTK_IS_TREE_ITEM(lastselect)) + gtk_tree_item_deselect(GTK_TREE_ITEM(lastselect)); + gtk_tree_item_select(GTK_TREE_ITEM(item)); + gtk_object_set_data(GTK_OBJECT(tree), "_dw_lastselect", (gpointer)item); + DW_MUTEX_UNLOCK; #endif } #if GTK_MAJOR_VERSION > 1 static void _dw_recursive_free(GtkTreeModel *store, GtkTreeIter parent) { - void *data; - GtkTreeIter iter; - - gtk_tree_model_get(store, &parent, 3, &data, -1); - if(data) - free(data); - gtk_tree_store_set(GTK_TREE_STORE(store), &parent, 3, NULL, -1); - - if(gtk_tree_model_iter_children(store, &iter, &parent)) - { - do { - _dw_recursive_free(GTK_TREE_MODEL(store), iter); - } while(gtk_tree_model_iter_next(GTK_TREE_MODEL(store), &iter)); - } + void *data; + GtkTreeIter iter; + + gtk_tree_model_get(store, &parent, 3, &data, -1); + if(data) + free(data); + gtk_tree_store_set(GTK_TREE_STORE(store), &parent, 3, NULL, -1); + + if(gtk_tree_model_iter_children(store, &iter, &parent)) + { + do { + _dw_recursive_free(GTK_TREE_MODEL(store), iter); + } while(gtk_tree_model_iter_next(GTK_TREE_MODEL(store), &iter)); + } } #endif @@ -5729,46 +5772,46 @@ void dw_tree_clear(HWND handle) { #if GTK_MAJOR_VERSION > 1 - GtkWidget *tree; - GtkTreeStore *store; - int _locked_by_me = FALSE; - - if(!handle) - return; - - DW_MUTEX_LOCK; - if((tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle))) - && GTK_IS_TREE_VIEW(tree) && - (store = (GtkTreeStore *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_store"))) - { - GtkTreeIter iter; - - if(gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter)) - { - do { - _dw_recursive_free(GTK_TREE_MODEL(store), iter); - } while(gtk_tree_model_iter_next(GTK_TREE_MODEL(store), &iter)); - } - gtk_tree_store_clear(store); - } - DW_MUTEX_UNLOCK; + GtkWidget *tree; + GtkTreeStore *store; + int _locked_by_me = FALSE; + + if(!handle) + return; + + DW_MUTEX_LOCK; + if((tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle))) + && GTK_IS_TREE_VIEW(tree) && + (store = (GtkTreeStore *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_store"))) + { + GtkTreeIter iter; + + if(gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter)) + { + do { + _dw_recursive_free(GTK_TREE_MODEL(store), iter); + } while(gtk_tree_model_iter_next(GTK_TREE_MODEL(store), &iter)); + } + gtk_tree_store_clear(store); + } + DW_MUTEX_UNLOCK; #else - GtkWidget *tree; - int _locked_by_me = FALSE; - - if(!handle) - return; - - DW_MUTEX_LOCK; - tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - if(!tree || !GTK_IS_TREE(tree)) - { - DW_MUTEX_UNLOCK; - return; - } - gtk_object_set_data(GTK_OBJECT(tree), "_dw_lastselect", NULL); - gtk_tree_clear_items(GTK_TREE(tree), 0, 1000000); - DW_MUTEX_UNLOCK; + GtkWidget *tree; + int _locked_by_me = FALSE; + + if(!handle) + return; + + DW_MUTEX_LOCK; + tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + if(!tree || !GTK_IS_TREE(tree)) + { + DW_MUTEX_UNLOCK; + return; + } + gtk_object_set_data(GTK_OBJECT(tree), "_dw_lastselect", NULL); + gtk_tree_clear_items(GTK_TREE(tree), 0, 1000000); + DW_MUTEX_UNLOCK; #endif } @@ -5781,35 +5824,35 @@ void dw_tree_item_expand(HWND handle, HTREEITEM item) { #if GTK_MAJOR_VERSION > 1 - GtkWidget *tree; - GtkTreeStore *store; - int _locked_by_me = FALSE; - - if(!handle) - return; - - DW_MUTEX_LOCK; - if((tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle))) - && GTK_IS_TREE_VIEW(tree) && - (store = (GtkTreeStore *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_store"))) - { - GtkTreePath *path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), (GtkTreeIter *)item); - gtk_tree_view_expand_row(GTK_TREE_VIEW(tree), path, FALSE); - gtk_tree_path_free(path); - } - DW_MUTEX_UNLOCK; + GtkWidget *tree; + GtkTreeStore *store; + int _locked_by_me = FALSE; + + if(!handle) + return; + + DW_MUTEX_LOCK; + if((tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle))) + && GTK_IS_TREE_VIEW(tree) && + (store = (GtkTreeStore *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_store"))) + { + GtkTreePath *path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), (GtkTreeIter *)item); + gtk_tree_view_expand_row(GTK_TREE_VIEW(tree), path, FALSE); + gtk_tree_path_free(path); + } + DW_MUTEX_UNLOCK; #else - int _locked_by_me = FALSE; - - if(!handle || !item) - return; - - DW_MUTEX_LOCK; - _dw_ignore_expand = 1; - if(GTK_IS_TREE_ITEM(item)) - gtk_tree_item_expand(GTK_TREE_ITEM(item)); - _dw_ignore_expand = 0; - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; + + if(!handle || !item) + return; + + DW_MUTEX_LOCK; + _dw_ignore_expand = 1; + if(GTK_IS_TREE_ITEM(item)) + gtk_tree_item_expand(GTK_TREE_ITEM(item)); + _dw_ignore_expand = 0; + DW_MUTEX_UNLOCK; #endif } @@ -5822,33 +5865,33 @@ void dw_tree_item_collapse(HWND handle, HTREEITEM item) { #if GTK_MAJOR_VERSION > 1 - GtkWidget *tree; - GtkTreeStore *store; - int _locked_by_me = FALSE; - - if(!handle) - return; - - DW_MUTEX_LOCK; - if((tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle))) - && GTK_IS_TREE_VIEW(tree) && - (store = (GtkTreeStore *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_store"))) - { - GtkTreePath *path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), (GtkTreeIter *)item); - gtk_tree_view_collapse_row(GTK_TREE_VIEW(tree), path); - gtk_tree_path_free(path); - } - DW_MUTEX_UNLOCK; + GtkWidget *tree; + GtkTreeStore *store; + int _locked_by_me = FALSE; + + if(!handle) + return; + + DW_MUTEX_LOCK; + if((tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle))) + && GTK_IS_TREE_VIEW(tree) && + (store = (GtkTreeStore *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_store"))) + { + GtkTreePath *path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), (GtkTreeIter *)item); + gtk_tree_view_collapse_row(GTK_TREE_VIEW(tree), path); + gtk_tree_path_free(path); + } + DW_MUTEX_UNLOCK; #else - int _locked_by_me = FALSE; - - if(!handle || !item) - return; - - DW_MUTEX_LOCK; - if(GTK_IS_TREE_ITEM(item)) - gtk_tree_item_collapse(GTK_TREE_ITEM(item)); - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; + + if(!handle || !item) + return; + + DW_MUTEX_LOCK; + if(GTK_IS_TREE_ITEM(item)) + gtk_tree_item_collapse(GTK_TREE_ITEM(item)); + DW_MUTEX_UNLOCK; #endif } @@ -5861,101 +5904,101 @@ void dw_tree_item_delete(HWND handle, HTREEITEM item) { #if GTK_MAJOR_VERSION > 1 - GtkWidget *tree; - GtkTreeStore *store; - int _locked_by_me = FALSE; - - if(!handle) - return; - - DW_MUTEX_LOCK; - if((tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle))) - && GTK_IS_TREE_VIEW(tree) && - (store = (GtkTreeStore *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_store"))) - { - gtk_tree_store_remove(store, (GtkTreeIter *)item); - free(item); - } - DW_MUTEX_UNLOCK; + GtkWidget *tree; + GtkTreeStore *store; + int _locked_by_me = FALSE; + + if(!handle) + return; + + DW_MUTEX_LOCK; + if((tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle))) + && GTK_IS_TREE_VIEW(tree) && + (store = (GtkTreeStore *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_tree_store"))) + { + gtk_tree_store_remove(store, (GtkTreeIter *)item); + free(item); + } + DW_MUTEX_UNLOCK; #else - GtkWidget *tree, *lastselect, *parenttree; - int _locked_by_me = FALSE; - - if(!handle || !item || !GTK_IS_WIDGET(handle) || !GTK_IS_WIDGET(item)) - return; - - DW_MUTEX_LOCK; - tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - if(!tree || !GTK_IS_TREE(tree)) - { - DW_MUTEX_UNLOCK; - return; - } - - lastselect = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_lastselect"); - - parenttree = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(item), "_dw_parenttree"); - - if(lastselect == item) - { - gtk_tree_item_deselect(GTK_TREE_ITEM(lastselect)); - gtk_object_set_data(GTK_OBJECT(tree), "_dw_lastselect", NULL); - } - - if(parenttree && GTK_IS_WIDGET(parenttree)) - gtk_container_remove(GTK_CONTAINER(parenttree), item); - DW_MUTEX_UNLOCK; + GtkWidget *tree, *lastselect, *parenttree; + int _locked_by_me = FALSE; + + if(!handle || !item || !GTK_IS_WIDGET(handle) || !GTK_IS_WIDGET(item)) + return; + + DW_MUTEX_LOCK; + tree = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + if(!tree || !GTK_IS_TREE(tree)) + { + DW_MUTEX_UNLOCK; + return; + } + + lastselect = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(tree), "_dw_lastselect"); + + parenttree = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(item), "_dw_parenttree"); + + if(lastselect == item) + { + gtk_tree_item_deselect(GTK_TREE_ITEM(lastselect)); + gtk_object_set_data(GTK_OBJECT(tree), "_dw_lastselect", NULL); + } + + if(parenttree && GTK_IS_WIDGET(parenttree)) + gtk_container_remove(GTK_CONTAINER(parenttree), item); + DW_MUTEX_UNLOCK; #endif } static int _dw_container_setup(HWND handle, unsigned long *flags, char **titles, int count, int separator, int extra) { - GtkWidget *clist; - char numbuf[10]; - int z, multi; - int _locked_by_me = FALSE; - GtkJustification justification; - - DW_MUTEX_LOCK; + GtkWidget *clist; + char numbuf[10]; + int z, multi; + int _locked_by_me = FALSE; + GtkJustification justification; + + DW_MUTEX_LOCK; clist = gtk_clist_new_with_titles(count, (gchar **)titles); - if(!clist) - { - DW_MUTEX_UNLOCK; - return FALSE; - } - multi = (int)gtk_object_get_data(GTK_OBJECT(handle), "_dw_multi"); - gtk_object_set_data(GTK_OBJECT(handle), "_dw_multi", (gpointer)multi); - - gtk_clist_set_column_auto_resize(GTK_CLIST(clist), 0, TRUE); - if(multi) - gtk_clist_set_selection_mode(GTK_CLIST(clist), GTK_SELECTION_EXTENDED); - else - gtk_clist_set_selection_mode(GTK_CLIST(clist), GTK_SELECTION_SINGLE); - gtk_container_add(GTK_CONTAINER(handle), clist); - gtk_object_set_user_data(GTK_OBJECT(handle), (gpointer)clist); - gtk_widget_show(clist); - gtk_object_set_data(GTK_OBJECT(clist), "_dw_colcount", (gpointer)count); + if(!clist) + { + DW_MUTEX_UNLOCK; + return FALSE; + } + multi = (int)gtk_object_get_data(GTK_OBJECT(handle), "_dw_multi"); + gtk_object_set_data(GTK_OBJECT(handle), "_dw_multi", GINT_TO_POINTER(multi)); + + gtk_clist_set_column_auto_resize(GTK_CLIST(clist), 0, TRUE); + if(multi) + gtk_clist_set_selection_mode(GTK_CLIST(clist), GTK_SELECTION_EXTENDED); + else + gtk_clist_set_selection_mode(GTK_CLIST(clist), GTK_SELECTION_SINGLE); + gtk_container_add(GTK_CONTAINER(handle), clist); + gtk_object_set_user_data(GTK_OBJECT(handle), (gpointer)clist); + gtk_widget_show(clist); + gtk_object_set_data(GTK_OBJECT(clist), "_dw_colcount", GINT_TO_POINTER(count)); if(extra) - gtk_clist_set_column_width(GTK_CLIST(clist), 1, 120); - - for(z=0;z 1) - gtk_clist_set_column_width(GTK_CLIST(clist), z, 50); - sprintf(numbuf, "%d", z); - gtk_object_set_data(GTK_OBJECT(clist), numbuf, (gpointer)flags[z]); - if(flags[z]&DW_CFA_RIGHT) - justification = GTK_JUSTIFY_RIGHT; - else if(flags[z]&DW_CFA_CENTER) - justification = GTK_JUSTIFY_CENTER; - else - justification = GTK_JUSTIFY_LEFT; - gtk_clist_set_column_justification(GTK_CLIST(clist),z,justification); - } - - DW_MUTEX_UNLOCK; - return TRUE; + gtk_clist_set_column_width(GTK_CLIST(clist), 1, 120); + + for(z=0;z 1) + gtk_clist_set_column_width(GTK_CLIST(clist), z, 50); + sprintf(numbuf, "%d", z); + gtk_object_set_data(GTK_OBJECT(clist), numbuf, GINT_TO_POINTER(flags[z])); + if(flags[z]&DW_CFA_RIGHT) + justification = GTK_JUSTIFY_RIGHT; + else if(flags[z]&DW_CFA_CENTER) + justification = GTK_JUSTIFY_CENTER; + else + justification = GTK_JUSTIFY_LEFT; + gtk_clist_set_column_justification(GTK_CLIST(clist),z,justification); + } + + DW_MUTEX_UNLOCK; + return TRUE; } /* @@ -5970,7 +6013,7 @@ */ int dw_container_setup(HWND handle, unsigned long *flags, char **titles, int count, int separator) { - return _dw_container_setup(handle, flags, titles, count, separator, 0); + return _dw_container_setup(handle, flags, titles, count, separator, 0); } /* @@ -5983,21 +6026,21 @@ */ int dw_filesystem_setup(HWND handle, unsigned long *flags, char **titles, int count) { - char **newtitles = malloc(sizeof(char *) * (count + 1)); - unsigned long *newflags = malloc(sizeof(unsigned long) * (count + 1)); - - newtitles[0] = "Filename"; - - newflags[0] = DW_CFA_STRINGANDICON | DW_CFA_LEFT | DW_CFA_HORZSEPARATOR; - - memcpy(&newtitles[1], titles, sizeof(char *) * count); - memcpy(&newflags[1], flags, sizeof(unsigned long) * count); - - _dw_container_setup(handle, newflags, newtitles, count + 1, 1, 1); - - free(newtitles); - free(newflags); - return TRUE; + char **newtitles = malloc(sizeof(char *) * (count + 1)); + unsigned long *newflags = malloc(sizeof(unsigned long) * (count + 1)); + + newtitles[0] = "Filename"; + + newflags[0] = DW_CFA_STRINGANDICON | DW_CFA_LEFT | DW_CFA_HORZSEPARATOR; + + memcpy(&newtitles[1], titles, sizeof(char *) * count); + memcpy(&newflags[1], flags, sizeof(unsigned long) * count); + + _dw_container_setup(handle, newflags, newtitles, count + 1, 1, 1); + + free(newtitles); + free(newflags); + return TRUE; } /* @@ -6010,7 +6053,7 @@ */ unsigned long dw_icon_load(unsigned long module, unsigned long id) { - return id; + return id; } /* @@ -6223,42 +6266,42 @@ */ void dw_icon_free(unsigned long handle) { - /* If it is a private icon, find the item - * free the associated structures and set - * the entry to unused. - */ - if(handle & (1 << 31)) - { - unsigned long id = handle & 0xFFFFFF; - - if(id < _PixmapCount && _PixmapArray[id].used) - { -#if GTK_MAJOR_VERSION > 1 - if(_PixmapArray[id].pixbuf) - { - g_object_unref(_PixmapArray[id].pixbuf); - _PixmapArray[id].pixbuf = NULL; - } -#endif - if(_PixmapArray[id].mask) - { - gdk_bitmap_unref(_PixmapArray[id].mask); - _PixmapArray[id].mask = NULL; - } - if(_PixmapArray[id].pixmap) - { - gdk_pixmap_unref(_PixmapArray[id].pixmap); - _PixmapArray[id].pixmap = NULL; - } - _PixmapArray[id].used = 0; - } - } + /* If it is a private icon, find the item + * free the associated structures and set + * the entry to unused. + */ + if(handle & (1 << 31)) + { + unsigned long id = handle & 0xFFFFFF; + + if(id < _PixmapCount && _PixmapArray[id].used) + { +#if GTK_MAJOR_VERSION > 1 + if(_PixmapArray[id].pixbuf) + { + g_object_unref(_PixmapArray[id].pixbuf); + _PixmapArray[id].pixbuf = NULL; + } +#endif + if(_PixmapArray[id].mask) + { + gdk_bitmap_unref(_PixmapArray[id].mask); + _PixmapArray[id].mask = NULL; + } + if(_PixmapArray[id].pixmap) + { + gdk_pixmap_unref(_PixmapArray[id].pixmap); + _PixmapArray[id].pixmap = NULL; + } + _PixmapArray[id].used = 0; + } + } } /* Clears a CList selection and associated selection list */ void _dw_unselect(GtkWidget *clist) { - gtk_clist_unselect_all(GTK_CLIST(clist)); + gtk_clist_unselect_all(GTK_CLIST(clist)); } /* @@ -6269,48 +6312,48 @@ */ void *dw_container_alloc(HWND handle, int rowcount) { - int z, count = 0, prevrowcount = 0; - GtkWidget *clist; - GdkColor *fore, *back; - char **blah; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - clist = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - if(!clist) - { - DW_MUTEX_UNLOCK; - return NULL; - } - - count = (int)gtk_object_get_data(GTK_OBJECT(clist), "_dw_colcount"); - prevrowcount = (int)gtk_object_get_data(GTK_OBJECT(clist), "_dw_rowcount"); - - if(!count) - { - DW_MUTEX_UNLOCK; - return NULL; - } - - blah = malloc(sizeof(char *) * count); - memset(blah, 0, sizeof(char *) * count); - - fore = (GdkColor *)gtk_object_get_data(GTK_OBJECT(clist), "_dw_foregdk"); - back = (GdkColor *)gtk_object_get_data(GTK_OBJECT(clist), "_dw_backgdk"); - gtk_clist_freeze(GTK_CLIST(clist)); - for(z=0;zvalue = adj->lower; - break; - case DW_SCROLL_BOTTOM: - adj->value = adj->upper; - break; - } - gtk_clist_set_vadjustment(GTK_CLIST(clist), adj); - } - } - DW_MUTEX_UNLOCK; + GtkAdjustment *adj; + GtkWidget *clist; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + clist = (GtkWidget*)gtk_object_get_user_data(GTK_OBJECT(handle)); + if(clist && GTK_IS_CLIST(clist)) + { + adj = gtk_clist_get_vadjustment(GTK_CLIST(clist)); + if(adj) + { + switch(direction) + { + case DW_SCROLL_TOP: + adj->value = adj->lower; + break; + case DW_SCROLL_BOTTOM: + adj->value = adj->upper; + break; + } + gtk_clist_set_vadjustment(GTK_CLIST(clist), adj); + } + } + DW_MUTEX_UNLOCK; } /* @@ -6692,42 +6735,42 @@ */ char *dw_container_query_start(HWND handle, unsigned long flags) { - GtkWidget *clist; - GList *list; - char *retval = NULL; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - clist = (GtkWidget*)gtk_object_get_user_data(GTK_OBJECT(handle)); - - if(!clist) - { - DW_MUTEX_UNLOCK; - return NULL; - } - - /* These should be separate but right now this will work */ - if(flags & DW_CRA_SELECTED) - { - list = GTK_CLIST(clist)->selection; - - if(list) - { - gtk_object_set_data(GTK_OBJECT(clist), "_dw_querypos", (gpointer)1); - retval = (char *)gtk_clist_get_row_data(GTK_CLIST(clist), GPOINTER_TO_UINT(list->data)); - } - } - else if(flags & DW_CRA_CURSORED) - { - retval = (char *)gtk_clist_get_row_data(GTK_CLIST(clist), GTK_CLIST(clist)->focus_row); - } - else - { - retval = (char *)gtk_clist_get_row_data(GTK_CLIST(clist), 0); - gtk_object_set_data(GTK_OBJECT(clist), "_dw_querypos", (gpointer)1); - } - DW_MUTEX_UNLOCK; - return retval; + GtkWidget *clist; + GList *list; + char *retval = NULL; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + clist = (GtkWidget*)gtk_object_get_user_data(GTK_OBJECT(handle)); + + if(!clist) + { + DW_MUTEX_UNLOCK; + return NULL; + } + + /* These should be separate but right now this will work */ + if(flags & DW_CRA_SELECTED) + { + list = GTK_CLIST(clist)->selection; + + if(list) + { + gtk_object_set_data(GTK_OBJECT(clist), "_dw_querypos", GINT_TO_POINTER(1)); + retval = (char *)gtk_clist_get_row_data(GTK_CLIST(clist), GPOINTER_TO_UINT(list->data)); + } + } + else if(flags & DW_CRA_CURSORED) + { + retval = (char *)gtk_clist_get_row_data(GTK_CLIST(clist), GTK_CLIST(clist)->focus_row); + } + else + { + retval = (char *)gtk_clist_get_row_data(GTK_CLIST(clist), 0); + gtk_object_set_data(GTK_OBJECT(clist), "_dw_querypos", GINT_TO_POINTER(1)); + } + DW_MUTEX_UNLOCK; + return retval; } /* @@ -6740,56 +6783,56 @@ */ char *dw_container_query_next(HWND handle, unsigned long flags) { - GtkWidget *clist; - GList *list; - char *retval = NULL; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - clist = (GtkWidget*)gtk_object_get_user_data(GTK_OBJECT(handle)); - - if(!clist) - { - DW_MUTEX_UNLOCK; - return NULL; - } - - /* These should be separate but right now this will work */ - if(flags & DW_CRA_SELECTED) - { - list = GTK_CLIST(clist)->selection; - - if(list) - { - int counter = 0, pos = (int)gtk_object_get_data(GTK_OBJECT(clist), "_dw_querypos"); - gtk_object_set_data(GTK_OBJECT(clist), "_dw_querypos", (gpointer)pos+1); - - while(list && counter < pos) - { - list = list->next; - counter++; - } - - if(list) - retval = (char *)gtk_clist_get_row_data(GTK_CLIST(clist), GPOINTER_TO_UINT(list->data)); - } - } - else if(flags & DW_CRA_CURSORED) - { - /* There will only be one item cursored, - * retrieve it with dw_container_query_start() - */ - retval = NULL; - } - else - { - int pos = (int)gtk_object_get_data(GTK_OBJECT(clist), "_dw_querypos"); - - retval = (char *)gtk_clist_get_row_data(GTK_CLIST(clist), pos); - gtk_object_set_data(GTK_OBJECT(clist), "_dw_querypos", (gpointer)pos+1); - } - DW_MUTEX_UNLOCK; - return retval; + GtkWidget *clist; + GList *list; + char *retval = NULL; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + clist = (GtkWidget*)gtk_object_get_user_data(GTK_OBJECT(handle)); + + if(!clist) + { + DW_MUTEX_UNLOCK; + return NULL; + } + + /* These should be separate but right now this will work */ + if(flags & DW_CRA_SELECTED) + { + list = GTK_CLIST(clist)->selection; + + if(list) + { + int counter = 0, pos = (int)gtk_object_get_data(GTK_OBJECT(clist), "_dw_querypos"); + gtk_object_set_data(GTK_OBJECT(clist), "_dw_querypos", GINT_TO_POINTER(pos+1)); + + while(list && counter < pos) + { + list = list->next; + counter++; + } + + if(list) + retval = (char *)gtk_clist_get_row_data(GTK_CLIST(clist), GPOINTER_TO_UINT(list->data)); + } + } + else if(flags & DW_CRA_CURSORED) + { + /* There will only be one item cursored, + * retrieve it with dw_container_query_start() + */ + retval = NULL; + } + else + { + int pos = (int)gtk_object_get_data(GTK_OBJECT(clist), "_dw_querypos"); + + retval = (char *)gtk_clist_get_row_data(GTK_CLIST(clist), pos); + gtk_object_set_data(GTK_OBJECT(clist), "_dw_querypos", GINT_TO_POINTER(pos+1)); + } + DW_MUTEX_UNLOCK; + return retval; } /* @@ -6800,41 +6843,41 @@ */ void dw_container_cursor(HWND handle, char *text) { - int _locked_by_me = FALSE; - GtkWidget *clist; - int rowcount, z; - char *rowdata; - - DW_MUTEX_LOCK; - clist = (GtkWidget*)gtk_object_get_user_data(GTK_OBJECT(handle)); - - if(!clist) - { - DW_MUTEX_UNLOCK; - return; - } - rowcount = (int)gtk_object_get_data(GTK_OBJECT(clist), "_dw_rowcount"); - - for(z=0;zupper - adj->lower) * ((gfloat)z/(gfloat)rowcount)) + adj->lower; - gtk_adjustment_set_value(adj, pos); - DW_MUTEX_UNLOCK; - return; - } - } - - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; + GtkWidget *clist; + int rowcount, z; + char *rowdata; + + DW_MUTEX_LOCK; + clist = (GtkWidget*)gtk_object_get_user_data(GTK_OBJECT(handle)); + + if(!clist) + { + DW_MUTEX_UNLOCK; + return; + } + rowcount = (int)gtk_object_get_data(GTK_OBJECT(clist), "_dw_rowcount"); + + for(z=0;zupper - adj->lower) * ((gfloat)z/(gfloat)rowcount)) + adj->lower; + gtk_adjustment_set_value(adj, pos); + DW_MUTEX_UNLOCK; + return; + } + } + + DW_MUTEX_UNLOCK; } /* @@ -6845,39 +6888,39 @@ */ void dw_container_delete_row(HWND handle, char *text) { - int _locked_by_me = FALSE; - GtkWidget *clist; - int rowcount, z; - char *rowdata; - - DW_MUTEX_LOCK; - clist = (GtkWidget*)gtk_object_get_user_data(GTK_OBJECT(handle)); - - if(!clist) - { - DW_MUTEX_UNLOCK; - return; - } - rowcount = (int)gtk_object_get_data(GTK_OBJECT(clist), "_dw_rowcount"); - - for(z=0;z 1 - GdkColor color; + GdkColor color; #else - gdouble colors[4]; -#endif - unsigned long dw_color; - GtkColorSelection *colorsel; - - if(!dwwait) - return FALSE; - - colorsel = GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(dwwait->data)->colorsel); -#if GTK_MAJOR_VERSION > 1 - gtk_color_selection_get_current_color(colorsel, &color); + gdouble colors[4]; +#endif + unsigned long dw_color; + GtkColorSelection *colorsel; + + if(!dwwait) + return FALSE; + + colorsel = GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(dwwait->data)->colorsel); +#if GTK_MAJOR_VERSION > 1 + gtk_color_selection_get_current_color(colorsel, &color); #else - gtk_color_selection_get_color(colorsel, colors); -#endif - gtk_widget_destroy(GTK_WIDGET(dwwait->data)); - _dw_color_active = 0; -#if GTK_MAJOR_VERSION > 1 - dw_color = DW_RGB( (color.red & 0xFF), (color.green & 0xFF), (color.blue & 0xFF)); + gtk_color_selection_get_color(colorsel, colors); +#endif + gtk_widget_destroy(GTK_WIDGET(dwwait->data)); + _dw_color_active = 0; +#if GTK_MAJOR_VERSION > 1 + dw_color = DW_RGB( (color.red & 0xFF), (color.green & 0xFF), (color.blue & 0xFF)); #else - dw_color = DW_RGB( (int)(colors[0] * 255), (int)(colors[1] * 255), (int)(colors[2] * 255)); -#endif - dw_dialog_dismiss(dwwait, (void *)dw_color); - return FALSE; + dw_color = DW_RGB( (int)(colors[0] * 255), (int)(colors[1] * 255), (int)(colors[2] * 255)); +#endif + dw_dialog_dismiss(dwwait, (void *)dw_color); + return FALSE; } /* Internal function to handle the color Cancel press */ static gint _gtk_color_cancel(GtkWidget *widget, DWDialog *dwwait) { - if(!dwwait) - return FALSE; - - gtk_widget_destroy(GTK_WIDGET(dwwait->data)); - _dw_color_active = 0; - dw_dialog_dismiss(dwwait, (void *)-1); - return FALSE; + if(!dwwait) + return FALSE; + + gtk_widget_destroy(GTK_WIDGET(dwwait->data)); + _dw_color_active = 0; + dw_dialog_dismiss(dwwait, (void *)-1); + return FALSE; } /* Allows the user to choose a color using the system's color chooser dialog. @@ -7061,76 +7104,76 @@ */ unsigned long API dw_color_choose(unsigned long value) { - GtkWidget *colorw; - int _locked_by_me = FALSE; - DWDialog *dwwait; - GtkColorSelection *colorsel; -#if GTK_MAJOR_VERSION > 1 - GdkColor color = _internal_color(value); + GtkWidget *colorw; + int _locked_by_me = FALSE; + DWDialog *dwwait; + GtkColorSelection *colorsel; +#if GTK_MAJOR_VERSION > 1 + GdkColor color = _internal_color(value); #else - gdouble colors[4]; -#endif - unsigned long dw_color; - - DW_MUTEX_LOCK; - - /* The DW mutex should be sufficient for - * insuring no thread changes this unknowingly. - */ - if(_dw_color_active) - { - DW_MUTEX_UNLOCK; - return value; - } - - _dw_color_active = 1; - - colorw = gtk_color_selection_dialog_new("Select Color"); - - dwwait = dw_dialog_new((void *)colorw); - - gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(colorw)->ok_button), "clicked", (GtkSignalFunc) _gtk_color_ok, dwwait); - gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(colorw)->cancel_button), "clicked", (GtkSignalFunc) _gtk_color_cancel, dwwait); - - colorsel = GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(colorw)->colorsel); -#if GTK_MAJOR_VERSION > 1 - gtk_color_selection_set_previous_color(colorsel,&color); - gtk_color_selection_set_current_color(colorsel,&color); - gtk_color_selection_set_has_palette(colorsel,TRUE); + gdouble colors[4]; +#endif + unsigned long dw_color; + + DW_MUTEX_LOCK; + + /* The DW mutex should be sufficient for + * insuring no thread changes this unknowingly. + */ + if(_dw_color_active) + { + DW_MUTEX_UNLOCK; + return value; + } + + _dw_color_active = 1; + + colorw = gtk_color_selection_dialog_new("Select Color"); + + dwwait = dw_dialog_new((void *)colorw); + + gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(colorw)->ok_button), "clicked", (GtkSignalFunc) _gtk_color_ok, dwwait); + gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(colorw)->cancel_button), "clicked", (GtkSignalFunc) _gtk_color_cancel, dwwait); + + colorsel = GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(colorw)->colorsel); +#if GTK_MAJOR_VERSION > 1 + gtk_color_selection_set_previous_color(colorsel,&color); + gtk_color_selection_set_current_color(colorsel,&color); + gtk_color_selection_set_has_palette(colorsel,TRUE); #else - colors[0] = ((gdouble)DW_RED_VALUE(value) / (gdouble)255); - colors[1] = ((gdouble)DW_GREEN_VALUE(value) / (gdouble)255); - colors[2] = ((gdouble)DW_BLUE_VALUE(value) / (gdouble)255); - gtk_color_selection_set_color(colorsel, colors); -#endif - - gtk_widget_show(colorw); - - dw_color = (unsigned long)dw_dialog_wait(dwwait); - if ((unsigned long)dw_color == -1) - dw_color = value; - DW_MUTEX_UNLOCK; - return (unsigned long)dw_color; -/* - dw_messagebox("Not implemented", DW_MB_OK|DW_MB_INFORMATION, "This feature not yet supported."); - return value; + colors[0] = ((gdouble)DW_RED_VALUE(value) / (gdouble)255); + colors[1] = ((gdouble)DW_GREEN_VALUE(value) / (gdouble)255); + colors[2] = ((gdouble)DW_BLUE_VALUE(value) / (gdouble)255); + gtk_color_selection_set_color(colorsel, colors); +#endif + + gtk_widget_show(colorw); + + dw_color = (unsigned long)dw_dialog_wait(dwwait); + if ((unsigned long)dw_color == -1) + dw_color = value; + DW_MUTEX_UNLOCK; + return (unsigned long)dw_color; +/* + dw_messagebox("Not implemented", DW_MB_OK|DW_MB_INFORMATION, "This feature not yet supported."); + return value; */ } GdkGC *_set_colors(GdkWindow *window) { - GdkGC *gc = NULL; - int index = _find_thread_index(dw_thread_id()); - - if(!window) - return NULL; - gc = gdk_gc_new(window); - if(gc) - { - gdk_gc_set_foreground(gc, &_foreground[index]); - gdk_gc_set_background(gc, &_background[index]); - } - return gc; + GdkGC *gc = NULL; + int index = _find_thread_index(dw_thread_id()); + + if(!window) + return NULL; + gc = gdk_gc_new(window); + if(gc) + { + gdk_gc_set_foreground(gc, &_foreground[index]); + gdk_gc_set_background(gc, &_background[index]); + } + return gc; } /* Draw a point on a window (preferably a render window). @@ -7142,20 +7185,20 @@ */ void dw_draw_point(HWND handle, HPIXMAP pixmap, int x, int y) { - int _locked_by_me = FALSE; - GdkGC *gc = NULL; - - DW_MUTEX_LOCK; - if(handle) - gc = _set_colors(handle->window); - else if(pixmap) - gc = _set_colors(pixmap->pixmap); - if(gc) - { - gdk_draw_point(handle ? handle->window : pixmap->pixmap, gc, x, y); - gdk_gc_unref(gc); - } - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; + GdkGC *gc = NULL; + + DW_MUTEX_LOCK; + if(handle) + gc = _set_colors(handle->window); + else if(pixmap) + gc = _set_colors(pixmap->pixmap); + if(gc) + { + gdk_draw_point(handle ? handle->window : pixmap->pixmap, gc, x, y); + gdk_gc_unref(gc); + } + DW_MUTEX_UNLOCK; } /* Draw a line on a window (preferably a render window). @@ -7169,20 +7212,20 @@ */ void dw_draw_line(HWND handle, HPIXMAP pixmap, int x1, int y1, int x2, int y2) { - int _locked_by_me = FALSE; - GdkGC *gc = NULL; - - DW_MUTEX_LOCK; - if(handle) - gc = _set_colors(handle->window); - else if(pixmap) - gc = _set_colors(pixmap->pixmap); - if(gc) - { - gdk_draw_line(handle ? handle->window : pixmap->pixmap, gc, x1, y1, x2, y2); - gdk_gc_unref(gc); - } - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; + GdkGC *gc = NULL; + + DW_MUTEX_LOCK; + if(handle) + gc = _set_colors(handle->window); + else if(pixmap) + gc = _set_colors(pixmap->pixmap); + if(gc) + { + gdk_draw_line(handle ? handle->window : pixmap->pixmap, gc, x1, y1, x2, y2); + gdk_gc_unref(gc); + } + DW_MUTEX_UNLOCK; } /* Draw a rectangle on a window (preferably a render window). @@ -7196,20 +7239,20 @@ */ void dw_draw_rect(HWND handle, HPIXMAP pixmap, int fill, int x, int y, int width, int height) { - int _locked_by_me = FALSE; - GdkGC *gc = NULL; - - DW_MUTEX_LOCK; - if(handle) - gc = _set_colors(handle->window); - else if(pixmap) - gc = _set_colors(pixmap->pixmap); - if(gc) - { - gdk_draw_rectangle(handle ? handle->window : pixmap->pixmap, gc, fill, x, y, width, height); - gdk_gc_unref(gc); - } - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; + GdkGC *gc = NULL; + + DW_MUTEX_LOCK; + if(handle) + gc = _set_colors(handle->window); + else if(pixmap) + gc = _set_colors(pixmap->pixmap); + if(gc) + { + gdk_draw_rectangle(handle ? handle->window : pixmap->pixmap, gc, fill, x, y, width, height); + gdk_gc_unref(gc); + } + DW_MUTEX_UNLOCK; } /* Draw text on a window (preferably a render window). @@ -7222,96 +7265,96 @@ */ void dw_draw_text(HWND handle, HPIXMAP pixmap, int x, int y, char *text) { - int _locked_by_me = FALSE; - GdkGC *gc = NULL; -#if GTK_MAJOR_VERSION > 1 - PangoFontDescription *font; + int _locked_by_me = FALSE; + GdkGC *gc = NULL; +#if GTK_MAJOR_VERSION > 1 + PangoFontDescription *font; #else - GdkFont *font; -#endif - char *fontname = "fixed"; - - if(!text) - return; - - DW_MUTEX_LOCK; - if(handle) - { - fontname = (char *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_fontname"); - gc = _set_colors(handle->window); - } - else if(pixmap) - { - fontname = (char *)gtk_object_get_data(GTK_OBJECT(pixmap->handle), "_dw_fontname"); - gc = _set_colors(pixmap->pixmap); - } - if(gc) - { -#if GTK_MAJOR_VERSION > 1 - font = pango_font_description_from_string(fontname); - if(font) - { - PangoContext *context = gdk_pango_context_get(); - - if(context) - { - PangoLayout *layout = pango_layout_new(context); - - if(layout) - { - int index = _find_thread_index(dw_thread_id()); - - gdk_pango_context_set_colormap(context, _dw_cmap); - pango_layout_set_font_description(layout, font); - pango_layout_set_text(layout, text, strlen(text)); - - if(_transparent[index]) - gdk_draw_layout(handle ? handle->window : pixmap->pixmap, gc, x, y, layout); - else - gdk_draw_layout_with_colors(handle ? handle->window : pixmap->pixmap, gc, x, y, layout, &_foreground[index], &_background[index]); - - g_object_unref(layout); - } - g_object_unref(context); - } - pango_font_description_free(font); - } + GdkFont *font; +#endif + char *fontname = "fixed"; + + if(!text) + return; + + DW_MUTEX_LOCK; + if(handle) + { + fontname = (char *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_fontname"); + gc = _set_colors(handle->window); + } + else if(pixmap) + { + fontname = (char *)gtk_object_get_data(GTK_OBJECT(pixmap->handle), "_dw_fontname"); + gc = _set_colors(pixmap->pixmap); + } + if(gc) + { +#if GTK_MAJOR_VERSION > 1 + font = pango_font_description_from_string(fontname); + if(font) + { + PangoContext *context = gdk_pango_context_get(); + + if(context) + { + PangoLayout *layout = pango_layout_new(context); + + if(layout) + { + int index = _find_thread_index(dw_thread_id()); + + gdk_pango_context_set_colormap(context, _dw_cmap); + pango_layout_set_font_description(layout, font); + pango_layout_set_text(layout, text, strlen(text)); + + if(_transparent[index]) + gdk_draw_layout(handle ? handle->window : pixmap->pixmap, gc, x, y, layout); + else + gdk_draw_layout_with_colors(handle ? handle->window : pixmap->pixmap, gc, x, y, layout, &_foreground[index], &_background[index]); + + g_object_unref(layout); + } + g_object_unref(context); + } + pango_font_description_free(font); + } #else - font = gdk_font_load(fontname); - if(!font) - font = gdk_font_load("fixed"); - if(font) - { - gint ascent, descent, width, junk_ascent, junk_descent, junk_width; - int index = _find_thread_index(dw_thread_id()); - - /* gdk_text_extents() calculates ascent and descent based on the string, so - * a string without a character with a descent or without an ascent will have - * incorrect ascent/descent values - */ - gdk_text_extents(font, text, strlen(text), NULL, NULL, &width, &junk_ascent, &junk_descent); - /* force ascent/descent to be maximum values */ - gdk_text_extents(font, "(g", 2, NULL, NULL, &junk_width, &ascent, &descent); - if(!_transparent[index]) - { - GdkGC *gc2 = NULL; - - gc2 = gdk_gc_new(handle ? handle->window : pixmap->pixmap); - if(gc2) - { - gdk_gc_set_foreground(gc2, &_background[index]); - gdk_gc_set_background(gc2, &_background[index]); - } - gdk_draw_rectangle(handle ? handle->window : pixmap->pixmap, gc2, TRUE, x, y, width, ascent + descent + 1); - gdk_gc_unref(gc2); - } - gdk_draw_text(handle ? handle->window : pixmap->pixmap, font, gc, x, y + ascent + 1, text, strlen(text)); - gdk_font_unref(font); - } -#endif - gdk_gc_unref(gc); - } - DW_MUTEX_UNLOCK; + font = gdk_font_load(fontname); + if(!font) + font = gdk_font_load("fixed"); + if(font) + { + gint ascent, descent, width, junk_ascent, junk_descent, junk_width; + int index = _find_thread_index(dw_thread_id()); + + /* gdk_text_extents() calculates ascent and descent based on the string, so + * a string without a character with a descent or without an ascent will have + * incorrect ascent/descent values + */ + gdk_text_extents(font, text, strlen(text), NULL, NULL, &width, &junk_ascent, &junk_descent); + /* force ascent/descent to be maximum values */ + gdk_text_extents(font, "(g", 2, NULL, NULL, &junk_width, &ascent, &descent); + if(!_transparent[index]) + { + GdkGC *gc2 = NULL; + + gc2 = gdk_gc_new(handle ? handle->window : pixmap->pixmap); + if(gc2) + { + gdk_gc_set_foreground(gc2, &_background[index]); + gdk_gc_set_background(gc2, &_background[index]); + } + gdk_draw_rectangle(handle ? handle->window : pixmap->pixmap, gc2, TRUE, x, y, width, ascent + descent + 1); + gdk_gc_unref(gc2); + } + gdk_draw_text(handle ? handle->window : pixmap->pixmap, font, gc, x, y + ascent + 1, text, strlen(text)); + gdk_font_unref(font); + } +#endif + gdk_gc_unref(gc); + } + DW_MUTEX_UNLOCK; } /* Query the width and height of a text string. @@ -7324,67 +7367,67 @@ */ void dw_font_text_extents_get(HWND handle, HPIXMAP pixmap, char *text, int *width, int *height) { - int _locked_by_me = FALSE; -#if GTK_MAJOR_VERSION > 1 - PangoFontDescription *font; + int _locked_by_me = FALSE; +#if GTK_MAJOR_VERSION > 1 + PangoFontDescription *font; #else - GdkFont *font; -#endif - char *fontname = NULL; - - if(!text) - return; - - DW_MUTEX_LOCK; - if(handle) - fontname = (char *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_fontname"); - else if(pixmap) - fontname = (char *)gtk_object_get_data(GTK_OBJECT(pixmap->handle), "_dw_fontname"); - -#if GTK_MAJOR_VERSION > 1 - font = pango_font_description_from_string(fontname ? fontname : "monospace 10"); - if(font) - { - PangoContext *context = gdk_pango_context_get(); - - if(context) - { - PangoLayout *layout = pango_layout_new(context); - - if(layout) - { - PangoRectangle rect; - - pango_layout_set_font_description(layout, font); - pango_layout_set_text(layout, text, -1); - pango_layout_get_pixel_extents(layout, NULL, &rect); - - if(width) - *width = rect.width; - if(height) - *height = rect.height; - - g_object_unref(layout); - } - g_object_unref(context); - } - pango_font_description_free(font); - } + GdkFont *font; +#endif + char *fontname = NULL; + + if(!text) + return; + + DW_MUTEX_LOCK; + if(handle) + fontname = (char *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_fontname"); + else if(pixmap) + fontname = (char *)gtk_object_get_data(GTK_OBJECT(pixmap->handle), "_dw_fontname"); + +#if GTK_MAJOR_VERSION > 1 + font = pango_font_description_from_string(fontname ? fontname : "monospace 10"); + if(font) + { + PangoContext *context = gdk_pango_context_get(); + + if(context) + { + PangoLayout *layout = pango_layout_new(context); + + if(layout) + { + PangoRectangle rect; + + pango_layout_set_font_description(layout, font); + pango_layout_set_text(layout, text, -1); + pango_layout_get_pixel_extents(layout, NULL, &rect); + + if(width) + *width = rect.width; + if(height) + *height = rect.height; + + g_object_unref(layout); + } + g_object_unref(context); + } + pango_font_description_free(font); + } #else - font = gdk_font_load(fontname ? fontname : "fixed"); - if(!font) - font = gdk_font_load("fixed"); - if(font) - { - if(width) - *width = gdk_string_width(font, text); - if(height) - *height = gdk_string_height(font, text); - gdk_font_unref(font); - } -#endif - DW_MUTEX_UNLOCK; + font = gdk_font_load(fontname ? fontname : "fixed"); + if(!font) + font = gdk_font_load("fixed"); + if(font) + { + if(width) + *width = gdk_string_width(font, text); + if(height) + *height = gdk_string_height(font, text); + gdk_font_unref(font); + } +#endif + DW_MUTEX_UNLOCK; } /* @@ -7399,23 +7442,23 @@ */ HPIXMAP dw_pixmap_new(HWND handle, unsigned long width, unsigned long height, int depth) { - int _locked_by_me = FALSE; - HPIXMAP pixmap; - - if (!(pixmap = calloc(1,sizeof(struct _hpixmap)))) - return NULL; - - if (!depth) - depth = -1; - - pixmap->width = width; pixmap->height = height; - - - DW_MUTEX_LOCK; - pixmap->handle = handle; - pixmap->pixmap = gdk_pixmap_new(handle->window, width, height, depth); - DW_MUTEX_UNLOCK; - return pixmap; + int _locked_by_me = FALSE; + HPIXMAP pixmap; + + if (!(pixmap = calloc(1,sizeof(struct _hpixmap)))) + return NULL; + + if (!depth) + depth = -1; + + pixmap->width = width; pixmap->height = height; + + + DW_MUTEX_LOCK; + pixmap->handle = handle; + pixmap->pixmap = gdk_pixmap_new(handle->window, width, height, depth); + DW_MUTEX_UNLOCK; + return pixmap; } /* @@ -7563,25 +7606,25 @@ */ HPIXMAP dw_pixmap_grab(HWND handle, ULONG id) { - GdkBitmap *bitmap = NULL; - HPIXMAP pixmap; - int _locked_by_me = FALSE; - - if (!(pixmap = calloc(1,sizeof(struct _hpixmap)))) - return NULL; - - - DW_MUTEX_LOCK; - pixmap->pixmap = _find_pixmap(&bitmap, id, handle, &pixmap->width, &pixmap->height); - if(pixmap->pixmap) - { + GdkBitmap *bitmap = NULL; + HPIXMAP pixmap; + int _locked_by_me = FALSE; + + if (!(pixmap = calloc(1,sizeof(struct _hpixmap)))) + return NULL; + + + DW_MUTEX_LOCK; + pixmap->pixmap = _find_pixmap(&bitmap, id, handle, &pixmap->width, &pixmap->height); + if(pixmap->pixmap) + { #if GTK_MAJOR_VERSION < 2 - GdkPixmapPrivate *pvt = (GdkPixmapPrivate *)pixmap->pixmap; - pixmap->width = pvt->width; pixmap->height = pvt->height; -#endif - } - DW_MUTEX_UNLOCK; - return pixmap; + GdkPixmapPrivate *pvt = (GdkPixmapPrivate *)pixmap->pixmap; + pixmap->width = pvt->width; pixmap->height = pvt->height; +#endif + } + DW_MUTEX_UNLOCK; + return pixmap; } /* Call this after drawing to the screen to make sure @@ -7590,11 +7633,11 @@ void dw_flush(void) { #if GTK_MAJOR_VERSION < 2 - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - gdk_flush(); - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + gdk_flush(); + DW_MUTEX_UNLOCK; #endif } @@ -7606,12 +7649,12 @@ */ void dw_pixmap_destroy(HPIXMAP pixmap) { - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - gdk_pixmap_unref(pixmap->pixmap); - free(pixmap); - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + gdk_pixmap_unref(pixmap->pixmap); + free(pixmap); + DW_MUTEX_UNLOCK; } /* @@ -7630,33 +7673,33 @@ */ void dw_pixmap_bitblt(HWND dest, HPIXMAP destp, int xdest, int ydest, int width, int height, HWND src, HPIXMAP srcp, int xsrc, int ysrc) { - /* Ok, these #ifdefs are going to get a bit confusing because - * when using gdk-pixbuf, pixmaps are really pixbufs, so we - * have to use the pixbuf functions on them, and thus convoluting - * the code here a bit. -Brian - */ - int _locked_by_me = FALSE; - GdkGC *gc = NULL; - - if((!dest && (!destp || !destp->pixmap)) || (!src && (!srcp || !srcp->pixmap))) - return; - - DW_MUTEX_LOCK; - if(dest) - gc = _set_colors(dest->window); - else if(src) - gc = _set_colors(src->window); - else if(destp) - gc = gdk_gc_new(destp->pixmap); - else if(srcp) - gc = gdk_gc_new(srcp->pixmap); - - if(gc) - { - gdk_draw_pixmap(dest ? dest->window : destp->pixmap, gc, src ? src->window : srcp->pixmap, xsrc, ysrc, xdest, ydest, width, height); - gdk_gc_unref(gc); - } - DW_MUTEX_UNLOCK; + /* Ok, these #ifdefs are going to get a bit confusing because + * when using gdk-pixbuf, pixmaps are really pixbufs, so we + * have to use the pixbuf functions on them, and thus convoluting + * the code here a bit. -Brian + */ + int _locked_by_me = FALSE; + GdkGC *gc = NULL; + + if((!dest && (!destp || !destp->pixmap)) || (!src && (!srcp || !srcp->pixmap))) + return; + + DW_MUTEX_LOCK; + if(dest) + gc = _set_colors(dest->window); + else if(src) + gc = _set_colors(src->window); + else if(destp) + gc = gdk_gc_new(destp->pixmap); + else if(srcp) + gc = gdk_gc_new(srcp->pixmap); + + if(gc) + { + gdk_draw_pixmap(dest ? dest->window : destp->pixmap, gc, src ? src->window : srcp->pixmap, xsrc, ysrc, xdest, ydest, width, height); + gdk_gc_unref(gc); + } + DW_MUTEX_UNLOCK; } /* @@ -7667,22 +7710,22 @@ */ void dw_beep(int freq, int dur) { - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - gdk_beep(); - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + gdk_beep(); + DW_MUTEX_UNLOCK; } void _my_strlwr(char *buf) { - int z, len = strlen(buf); - - for(z=0;z= 'A' && buf[z] <= 'Z') - buf[z] -= 'A' - 'a'; - } + int z, len = strlen(buf); + + for(z=0;z= 'A' && buf[z] <= 'Z') + buf[z] -= 'A' - 'a'; + } } /* Open a shared library and return a handle. @@ -7693,38 +7736,38 @@ */ int dw_module_load(char *name, HMOD *handle) { - int len; - char *newname; - char errorbuf[1024]; - - - if(!handle) - return -1; - - if((len = strlen(name)) == 0) - return -1; - - /* Lenth + "lib" + ".so" + NULL */ - newname = malloc(len + 7); - - if(!newname) - return -1; - - sprintf(newname, "lib%s.so", name); - _my_strlwr(newname); - - *handle = dlopen(newname, RTLD_NOW); - if(*handle == NULL) - { - strncpy(errorbuf, dlerror(), 1024); - printf("%s\n", errorbuf); - sprintf(newname, "lib%s.so", name); - *handle = dlopen(newname, RTLD_NOW); - } - - free(newname); - - return (NULL == *handle) ? -1 : 0; + int len; + char *newname; + char errorbuf[1024]; + + + if(!handle) + return -1; + + if((len = strlen(name)) == 0) + return -1; + + /* Lenth + "lib" + ".so" + NULL */ + newname = malloc(len + 7); + + if(!newname) + return -1; + + sprintf(newname, "lib%s.so", name); + _my_strlwr(newname); + + *handle = dlopen(newname, RTLD_NOW); + if(*handle == NULL) + { + strncpy(errorbuf, dlerror(), 1024); + printf("%s\n", errorbuf); + sprintf(newname, "lib%s.so", name); + *handle = dlopen(newname, RTLD_NOW); + } + + free(newname); + + return (NULL == *handle) ? -1 : 0; } /* Queries the address of a symbol within open handle. @@ -7736,14 +7779,14 @@ */ int dw_module_symbol(HMOD handle, char *name, void**func) { - if(!func || !name) - return -1; - - if(strlen(name) == 0) - return -1; - - *func = (void*)dlsym(handle, name); - return (NULL == *func); + if(!func || !name) + return -1; + + if(strlen(name) == 0) + return -1; + + *func = (void*)dlsym(handle, name); + return (NULL == *func); } /* Frees the shared library previously opened. @@ -7752,9 +7795,9 @@ */ int dw_module_close(HMOD handle) { - if(handle) - return dlclose(handle); - return 0; + if(handle) + return dlclose(handle); + return 0; } /* @@ -7762,10 +7805,10 @@ */ HMTX dw_mutex_new(void) { - HMTX mutex = malloc(sizeof(pthread_mutex_t)); - - pthread_mutex_init(mutex, NULL); - return mutex; + HMTX mutex = malloc(sizeof(pthread_mutex_t)); + + pthread_mutex_init(mutex, NULL); + return mutex; } /* @@ -7775,11 +7818,11 @@ */ void dw_mutex_close(HMTX mutex) { - if(mutex) - { - pthread_mutex_destroy(mutex); - free(mutex); - } + if(mutex) + { + pthread_mutex_destroy(mutex); + free(mutex); + } } /* @@ -7789,17 +7832,17 @@ */ void dw_mutex_lock(HMTX mutex) { - /* If we are being called from an event handler we must release - * the GTK mutex so we don't deadlock. - */ - if(pthread_self() == _dw_thread) - gdk_threads_leave(); - - pthread_mutex_lock(mutex); - - /* And of course relock it when we have acquired the mutext */ - if(pthread_self() == _dw_thread) - gdk_threads_enter(); + /* If we are being called from an event handler we must release + * the GTK mutex so we don't deadlock. + */ + if(pthread_self() == _dw_thread) + gdk_threads_leave(); + + pthread_mutex_lock(mutex); + + /* And of course relock it when we have acquired the mutext */ + if(pthread_self() == _dw_thread) + gdk_threads_enter(); } /* @@ -7809,7 +7852,7 @@ */ void dw_mutex_unlock(HMTX mutex) { - pthread_mutex_unlock(mutex); + pthread_mutex_unlock(mutex); } /* @@ -7817,24 +7860,24 @@ */ HEV dw_event_new(void) { - HEV eve = (HEV)malloc(sizeof(struct _dw_unix_event)); - - if(!eve) - return NULL; - - /* We need to be careful here, mutexes on Linux are - * FAST by default but are error checking on other - * systems such as FreeBSD and OS/2, perhaps others. - */ - pthread_mutex_init (&(eve->mutex), NULL); - pthread_mutex_lock (&(eve->mutex)); - pthread_cond_init (&(eve->event), NULL); - - pthread_mutex_unlock (&(eve->mutex)); - eve->alive = 1; - eve->posted = 0; - - return eve; + HEV eve = (HEV)malloc(sizeof(struct _dw_unix_event)); + + if(!eve) + return NULL; + + /* We need to be careful here, mutexes on Linux are + * FAST by default but are error checking on other + * systems such as FreeBSD and OS/2, perhaps others. + */ + pthread_mutex_init (&(eve->mutex), NULL); + pthread_mutex_lock (&(eve->mutex)); + pthread_cond_init (&(eve->event), NULL); + + pthread_mutex_unlock (&(eve->mutex)); + eve->alive = 1; + eve->posted = 0; + + return eve; } /* @@ -7844,15 +7887,15 @@ */ int dw_event_reset (HEV eve) { - if(!eve) - return FALSE; - - pthread_mutex_lock (&(eve->mutex)); - pthread_cond_broadcast (&(eve->event)); - pthread_cond_init (&(eve->event), NULL); - eve->posted = 0; - pthread_mutex_unlock (&(eve->mutex)); - return 0; + if(!eve) + return FALSE; + + pthread_mutex_lock (&(eve->mutex)); + pthread_cond_broadcast (&(eve->event)); + pthread_cond_init (&(eve->event), NULL); + eve->posted = 0; + pthread_mutex_unlock (&(eve->mutex)); + return 0; } /* @@ -7863,14 +7906,14 @@ */ int dw_event_post (HEV eve) { - if(!eve) - return FALSE; - - pthread_mutex_lock (&(eve->mutex)); - pthread_cond_broadcast (&(eve->event)); - eve->posted = 1; - pthread_mutex_unlock (&(eve->mutex)); - return 0; + if(!eve) + return FALSE; + + pthread_mutex_lock (&(eve->mutex)); + pthread_cond_broadcast (&(eve->event)); + eve->posted = 1; + pthread_mutex_unlock (&(eve->mutex)); + return 0; } /* @@ -7881,27 +7924,27 @@ */ int dw_event_wait(HEV eve, unsigned long timeout) { - int rc; - struct timeval now; - struct timespec timeo; - - if(!eve) - return FALSE; - - if(eve->posted) - return 0; - - pthread_mutex_lock (&(eve->mutex)); - gettimeofday(&now, 0); - timeo.tv_sec = now.tv_sec + (timeout / 1000); - timeo.tv_nsec = now.tv_usec * 1000; - rc = pthread_cond_timedwait (&(eve->event), &(eve->mutex), &timeo); - pthread_mutex_unlock (&(eve->mutex)); - if(!rc) - return 1; - if(rc == ETIMEDOUT) - return -1; - return 0; + int rc; + struct timeval now; + struct timespec timeo; + + if(!eve) + return FALSE; + + if(eve->posted) + return 0; + + pthread_mutex_lock (&(eve->mutex)); + gettimeofday(&now, 0); + timeo.tv_sec = now.tv_sec + (timeout / 1000); + timeo.tv_nsec = now.tv_usec * 1000; + rc = pthread_cond_timedwait (&(eve->event), &(eve->mutex), &timeo); + pthread_mutex_unlock (&(eve->mutex)); + if(!rc) + return 1; + if(rc == ETIMEDOUT) + return -1; + return 0; } /* @@ -7911,168 +7954,168 @@ */ int dw_event_close(HEV *eve) { - if(!eve || !(*eve)) - return FALSE; - - pthread_mutex_lock (&((*eve)->mutex)); - pthread_cond_destroy (&((*eve)->event)); - pthread_mutex_unlock (&((*eve)->mutex)); - pthread_mutex_destroy (&((*eve)->mutex)); - free(*eve); - *eve = NULL; - - return TRUE; + if(!eve || !(*eve)) + return FALSE; + + pthread_mutex_lock (&((*eve)->mutex)); + pthread_cond_destroy (&((*eve)->event)); + pthread_mutex_unlock (&((*eve)->mutex)); + pthread_mutex_destroy (&((*eve)->mutex)); + free(*eve); + *eve = NULL; + + return TRUE; } struct _seminfo { - int fd; - int waiting; + int fd; + int waiting; }; static void _handle_sem(int *tmpsock) { - fd_set rd; - struct _seminfo *array = (struct _seminfo *)malloc(sizeof(struct _seminfo)); - int listenfd = tmpsock[0]; - int bytesread, connectcount = 1, maxfd, z, posted = 0; - char command; - sigset_t mask; - - sigfillset(&mask); /* Mask all allowed signals */ - pthread_sigmask(SIG_BLOCK, &mask, NULL); - - /* problems */ - if(tmpsock[1] == -1) - { - free(array); - return; - } - - array[0].fd = tmpsock[1]; - array[0].waiting = 0; - - /* Free the memory allocated in dw_named_event_new. */ - free(tmpsock); - - while(1) - { - FD_ZERO(&rd); - FD_SET(listenfd, &rd); - - maxfd = listenfd; - - /* Added any connections to the named event semaphore */ - for(z=0;z maxfd) - maxfd = array[z].fd; - - FD_SET(array[z].fd, &rd); - } - - if(select(maxfd+1, &rd, NULL, NULL, NULL) == -1) - return; - - if(FD_ISSET(listenfd, &rd)) - { - struct _seminfo *newarray; + fd_set rd; + struct _seminfo *array = (struct _seminfo *)malloc(sizeof(struct _seminfo)); + int listenfd = tmpsock[0]; + int bytesread, connectcount = 1, maxfd, z, posted = 0; + char command; + sigset_t mask; + + sigfillset(&mask); /* Mask all allowed signals */ + pthread_sigmask(SIG_BLOCK, &mask, NULL); + + /* problems */ + if(tmpsock[1] == -1) + { + free(array); + return; + } + + array[0].fd = tmpsock[1]; + array[0].waiting = 0; + + /* Free the memory allocated in dw_named_event_new. */ + free(tmpsock); + + while(1) + { + FD_ZERO(&rd); + FD_SET(listenfd, &rd); + + maxfd = listenfd; + + /* Added any connections to the named event semaphore */ + for(z=0;z maxfd) + maxfd = array[z].fd; + + FD_SET(array[z].fd, &rd); + } + + if(select(maxfd+1, &rd, NULL, NULL, NULL) == -1) + return; + + if(FD_ISSET(listenfd, &rd)) + { + struct _seminfo *newarray; int newfd = accept(listenfd, 0, 0); - if(newfd > -1) - { - /* Add new connections to the set */ - newarray = (struct _seminfo *)malloc(sizeof(struct _seminfo)*(connectcount+1)); - memcpy(newarray, array, sizeof(struct _seminfo)*(connectcount)); - - newarray[connectcount].fd = newfd; - newarray[connectcount].waiting = 0; - - connectcount++; - - /* Replace old array with new one */ - free(array); - array = newarray; - } - } - - /* Handle any events posted to the semaphore */ - for(z=0;z -1) + { + /* Add new connections to the set */ + newarray = (struct _seminfo *)malloc(sizeof(struct _seminfo)*(connectcount+1)); + memcpy(newarray, array, sizeof(struct _seminfo)*(connectcount)); + + newarray[connectcount].fd = newfd; + newarray[connectcount].waiting = 0; + + connectcount++; + + /* Replace old array with new one */ + free(array); + array = newarray; + } + } + + /* Handle any events posted to the semaphore */ + for(z=0;z -1) - close(tmpsock[0]); - if(tmpsock[1] > -1) - close(tmpsock[1]); - if(ev > -1) - close(ev); - free(tmpsock); - return NULL; - } - - /* Create a thread to handle this event semaphore */ - pthread_create(&dwthread, NULL, (void *)_handle_sem, (void *)tmpsock); - return (HEV)ev; + struct sockaddr_un un; + int ev, *tmpsock = (int *)malloc(sizeof(int)*2); + DWTID dwthread; + + if(!tmpsock) + return NULL; + + tmpsock[0] = socket(AF_UNIX, SOCK_STREAM, 0); + ev = socket(AF_UNIX, SOCK_STREAM, 0); + memset(&un, 0, sizeof(un)); + un.sun_family=AF_UNIX; + mkdir("/tmp/.dw", S_IWGRP|S_IWOTH); + strcpy(un.sun_path, "/tmp/.dw/"); + strcat(un.sun_path, name); + + /* just to be safe, this should be changed + * to support multiple instances. + */ + remove(un.sun_path); + + bind(tmpsock[0], (struct sockaddr *)&un, sizeof(un)); + listen(tmpsock[0], 0); + connect(ev, (struct sockaddr *)&un, sizeof(un)); + tmpsock[1] = accept(tmpsock[0], 0, 0); + + if(tmpsock[0] < 0 || tmpsock[1] < 0 || ev < 0) + { + if(tmpsock[0] > -1) + close(tmpsock[0]); + if(tmpsock[1] > -1) + close(tmpsock[1]); + if(ev > -1) + close(ev); + free(tmpsock); + return NULL; + } + + /* Create a thread to handle this event semaphore */ + pthread_create(&dwthread, NULL, (void *)_handle_sem, (void *)tmpsock); + return (HEV)ev; } /* Open an already existing named event semaphore. @@ -8136,17 +8179,17 @@ */ HEV dw_named_event_get(char *name) { - struct sockaddr_un un; - int ev = socket(AF_UNIX, SOCK_STREAM, 0); - if(ev < 0) - return NULL; - - un.sun_family=AF_UNIX; - mkdir("/tmp/.dw", S_IWGRP|S_IWOTH); - strcpy(un.sun_path, "/tmp/.dw/"); - strcat(un.sun_path, name); - connect(ev, (struct sockaddr *)&un, sizeof(un)); - return (HEV)ev; + struct sockaddr_un un; + int ev = socket(AF_UNIX, SOCK_STREAM, 0); + if(ev < 0) + return NULL; + + un.sun_family=AF_UNIX; + mkdir("/tmp/.dw", S_IWGRP|S_IWOTH); + strcpy(un.sun_path, "/tmp/.dw/"); + strcat(un.sun_path, name); + connect(ev, (struct sockaddr *)&un, sizeof(un)); + return (HEV)ev; } /* Resets the event semaphore so threads who call wait @@ -8157,15 +8200,15 @@ */ int dw_named_event_reset(HEV eve) { - /* signal reset */ - char tmp = (char)0; - - if((int)eve < 0) - return 0; - - if(write((int)eve, &tmp, 1) == 1) - return 0; - return 1; + /* signal reset */ + char tmp = (char)0; + + if((int)eve < 0) + return 0; + + if(write((int)eve, &tmp, 1) == 1) + return 0; + return 1; } /* Sets the posted state of an event semaphore, any threads @@ -8177,15 +8220,15 @@ int dw_named_event_post(HEV eve) { - /* signal post */ - char tmp = (char)1; - - if((int)eve < 0) - return 0; - - if(write((int)eve, &tmp, 1) == 1) - return 0; - return 1; + /* signal post */ + char tmp = (char)1; + + if((int)eve < 0) + return 0; + + if(write((int)eve, &tmp, 1) == 1) + return 0; + return 1; } /* Waits on the specified semaphore until it becomes @@ -8198,48 +8241,48 @@ */ int dw_named_event_wait(HEV eve, unsigned long timeout) { - fd_set rd; - struct timeval tv, *useme; - int retval = 0; - char tmp; - - if((int)eve < 0) - return DW_ERROR_NON_INIT; - - /* Set the timout or infinite */ - if(timeout == -1) - useme = NULL; - else - { - tv.tv_sec = timeout / 1000; - tv.tv_usec = timeout % 1000; - - useme = &tv; - } - - FD_ZERO(&rd); - FD_SET((int)eve, &rd); - - /* Signal wait */ - tmp = (char)2; - write((int)eve, &tmp, 1); - - retval = select((int)eve+1, &rd, NULL, NULL, useme); - - /* Signal done waiting. */ - tmp = (char)3; - write((int)eve, &tmp, 1); - - if(retval == 0) - return DW_ERROR_TIMEOUT; - else if(retval == -1) - return DW_ERROR_INTERRUPT; - - /* Clear the entry from the pipe so - * we don't loop endlessly. :) - */ - read((int)eve, &tmp, 1); - return 0; + fd_set rd; + struct timeval tv, *useme; + int retval = 0; + char tmp; + + if((int)eve < 0) + return DW_ERROR_NON_INIT; + + /* Set the timout or infinite */ + if(timeout == -1) + useme = NULL; + else + { + tv.tv_sec = timeout / 1000; + tv.tv_usec = timeout % 1000; + + useme = &tv; + } + + FD_ZERO(&rd); + FD_SET((int)eve, &rd); + + /* Signal wait */ + tmp = (char)2; + write((int)eve, &tmp, 1); + + retval = select((int)eve+1, &rd, NULL, NULL, useme); + + /* Signal done waiting. */ + tmp = (char)3; + write((int)eve, &tmp, 1); + + if(retval == 0) + return DW_ERROR_TIMEOUT; + else if(retval == -1) + return DW_ERROR_INTERRUPT; + + /* Clear the entry from the pipe so + * we don't loop endlessly. :) + */ + read((int)eve, &tmp, 1); + return 0; } /* Release this semaphore, if there are no more open @@ -8250,11 +8293,11 @@ */ int dw_named_event_close(HEV eve) { - /* Finally close the domain socket, - * cleanup will continue in _handle_sem. - */ - close((int)eve); - return 0; + /* Finally close the domain socket, + * cleanup will continue in _handle_sem. + */ + close((int)eve); + return 0; } /* @@ -8262,15 +8305,15 @@ */ void _dwthreadstart(void *data) { - void (*threadfunc)(void *) = NULL; - void **tmp = (void **)data; - - threadfunc = (void (*)(void *))tmp[0]; - - _dw_thread_add(dw_thread_id()); - threadfunc(tmp[1]); - _dw_thread_remove(dw_thread_id()); - free(tmp); + void (*threadfunc)(void *) = NULL; + void **tmp = (void **)data; + + threadfunc = (void (*)(void *))tmp[0]; + + _dw_thread_add(dw_thread_id()); + threadfunc(tmp[1]); + _dw_thread_remove(dw_thread_id()); + free(tmp); } /* @@ -8283,36 +8326,36 @@ */ HSHM dw_named_memory_new(void **dest, int size, char *name) { - char namebuf[1024]; - struct _dw_unix_shm *handle = malloc(sizeof(struct _dw_unix_shm)); - - mkdir("/tmp/.dw", S_IWGRP|S_IWOTH); - sprintf(namebuf, "/tmp/.dw/%s", name); - - if((handle->fd = open(namebuf, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR)) < 0) - { - free(handle); - return NULL; - } - - ftruncate(handle->fd, size); - - /* attach the shared memory segment to our process's address space. */ - *dest = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, handle->fd, 0); - - if(*dest == MAP_FAILED) - { - close(handle->fd); - *dest = NULL; - free(handle); - return NULL; - } - - handle->size = size; - handle->sid = getsid(0); - handle->path = strdup(namebuf); - - return handle; + char namebuf[1024]; + struct _dw_unix_shm *handle = malloc(sizeof(struct _dw_unix_shm)); + + mkdir("/tmp/.dw", S_IWGRP|S_IWOTH); + sprintf(namebuf, "/tmp/.dw/%s", name); + + if((handle->fd = open(namebuf, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR)) < 0) + { + free(handle); + return NULL; + } + + ftruncate(handle->fd, size); + + /* attach the shared memory segment to our process's address space. */ + *dest = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, handle->fd, 0); + + if(*dest == MAP_FAILED) + { + close(handle->fd); + *dest = NULL; + free(handle); + return NULL; + } + + handle->size = size; + handle->sid = getsid(0); + handle->path = strdup(namebuf); + + return handle; } /* @@ -8324,34 +8367,34 @@ */ HSHM dw_named_memory_get(void **dest, int size, char *name) { - char namebuf[1024]; - struct _dw_unix_shm *handle = malloc(sizeof(struct _dw_unix_shm)); - - mkdir("/tmp/.dw", S_IWGRP|S_IWOTH); - sprintf(namebuf, "/tmp/.dw/%s", name); - - if((handle->fd = open(namebuf, O_RDWR)) < 0) - { - free(handle); - return NULL; - } - - /* attach the shared memory segment to our process's address space. */ - *dest = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, handle->fd, 0); - - if(*dest == MAP_FAILED) - { - close(handle->fd); - *dest = NULL; - free(handle); - return NULL; - } - - handle->size = size; - handle->sid = -1; - handle->path = NULL; - - return handle; + char namebuf[1024]; + struct _dw_unix_shm *handle = malloc(sizeof(struct _dw_unix_shm)); + + mkdir("/tmp/.dw", S_IWGRP|S_IWOTH); + sprintf(namebuf, "/tmp/.dw/%s", name); + + if((handle->fd = open(namebuf, O_RDWR)) < 0) + { + free(handle); + return NULL; + } + + /* attach the shared memory segment to our process's address space. */ + *dest = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, handle->fd, 0); + + if(*dest == MAP_FAILED) + { + close(handle->fd); + *dest = NULL; + free(handle); + return NULL; + } + + handle->size = size; + handle->sid = -1; + handle->path = NULL; + + return handle; } /* @@ -8362,20 +8405,20 @@ */ int dw_named_memory_free(HSHM handle, void *ptr) { - struct _dw_unix_shm *h = handle; - int rc = munmap(ptr, h->size); - - close(h->fd); - if(h->path) - { - /* Only remove the actual file if we are the - * creator of the file. - */ - if(h->sid != -1 && h->sid == getsid(0)) - remove(h->path); - free(h->path); - } - return rc; + struct _dw_unix_shm *h = handle; + int rc = munmap(ptr, h->size); + + close(h->fd); + if(h->path) + { + /* Only remove the actual file if we are the + * creator of the file. + */ + if(h->sid != -1 && h->sid == getsid(0)) + remove(h->path); + free(h->path); + } + return rc; } /* * Creates a new thread with a starting point of func. @@ -8386,14 +8429,14 @@ */ DWTID dw_thread_new(void *func, void *data, int stack) { - DWTID gtkthread; - void **tmp = malloc(sizeof(void *) * 2); - - tmp[0] = func; - tmp[1] = data; - - pthread_create(>kthread, NULL, (void *)_dwthreadstart, (void *)tmp); - return gtkthread; + DWTID gtkthread; + void **tmp = malloc(sizeof(void *) * 2); + + tmp[0] = func; + tmp[1] = data; + + pthread_create(>kthread, NULL, (void *)_dwthreadstart, (void *)tmp); + return gtkthread; } /* @@ -8401,7 +8444,7 @@ */ void dw_thread_end(void) { - pthread_exit(NULL); + pthread_exit(NULL); } /* @@ -8409,7 +8452,7 @@ */ DWTID dw_thread_id(void) { - return (DWTID)pthread_self(); + return (DWTID)pthread_self(); } /* @@ -8419,7 +8462,7 @@ */ void dw_exit(int exitcode) { - exit(exitcode); + exit(exitcode); } #define DW_EXPAND (GTK_EXPAND | GTK_SHRINK | GTK_FILL) @@ -8437,134 +8480,134 @@ */ void dw_box_pack_end(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad) { - int warn = FALSE, _locked_by_me = FALSE; - GtkWidget *tmp, *tmpitem; - - if(!box) - return; - - /* - * If you try and pack an item into itself VERY bad things can happen; like at least an - * infinite loop on GTK! Lets be safe! - */ - if(box == item) - { - dw_messagebox("dw_box_pack_end()", DW_MB_OK|DW_MB_ERROR, "Danger! Danger! Will Robinson; box and item are the same!"); - return; - } - - DW_MUTEX_LOCK; - - if((tmp = gtk_object_get_data(GTK_OBJECT(box), "_dw_boxhandle"))) - box = tmp; - - if(!item) - { - item = gtk_label_new(""); - gtk_widget_show_all(item); - } - - tmpitem = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(item), "_dw_boxhandle"); - - if(GTK_IS_TABLE(box)) - { - int boxcount = (int)gtk_object_get_data(GTK_OBJECT(box), "_dw_boxcount"); - int boxtype = (int)gtk_object_get_data(GTK_OBJECT(box), "_dw_boxtype"); - - /* If the item being packed is a box, then we use it's padding - * instead of the padding specified on the pack line, this is - * due to a bug in the OS/2 and Win32 renderer and a limitation - * of the GtkTable class. - */ - if(GTK_IS_TABLE(item) || (tmpitem && GTK_IS_TABLE(tmpitem))) - { - GtkWidget *eventbox = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(item), "_dw_eventbox"); - - /* NOTE: I left in the ability to pack boxes with a size, - * this eliminates that by forcing the size to 0. - */ - height = width = 0; - - if(eventbox) - { - int boxpad = (int)gtk_object_get_data(GTK_OBJECT(item), "_dw_boxpad"); - gtk_container_add(GTK_CONTAINER(eventbox), item); - gtk_container_border_width(GTK_CONTAINER(eventbox), boxpad); - item = eventbox; - } - } - else - { - /* Only show warning if item is not a box */ - warn = TRUE; - } - - if(boxtype == DW_VERT) - gtk_table_resize(GTK_TABLE(box), boxcount + 1, 1); - else - gtk_table_resize(GTK_TABLE(box), 1, boxcount + 1); - - gtk_table_attach(GTK_TABLE(box), item, 0, 1, 0, 1, hsize ? DW_EXPAND : 0, vsize ? DW_EXPAND : 0, pad, pad); - gtk_object_set_data(GTK_OBJECT(box), "_dw_boxcount", (gpointer)boxcount + 1); - gtk_widget_set_usize(item, width, height); - if(GTK_IS_RADIO_BUTTON(item)) - { - GSList *group; - GtkWidget *groupstart = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(box), "_dw_group"); - - if(groupstart) - { - group = gtk_radio_button_group(GTK_RADIO_BUTTON(groupstart)); - gtk_radio_button_set_group(GTK_RADIO_BUTTON(item), group); - } - else - gtk_object_set_data(GTK_OBJECT(box), "_dw_group", (gpointer)item); - } - } - else - { - GtkWidget *vbox = gtk_vbox_new(FALSE, 0); - - if(GTK_IS_TABLE(item) || (tmpitem && GTK_IS_TABLE(tmpitem))) - { - GtkWidget *eventbox = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(item), "_dw_eventbox"); - - /* NOTE: I left in the ability to pack boxes with a size, - * this eliminates that by forcing the size to 0. - */ - height = width = 0; - - if(eventbox) - { - int boxpad = (int)gtk_object_get_data(GTK_OBJECT(item), "_dw_boxpad"); - gtk_container_add(GTK_CONTAINER(eventbox), item); - gtk_container_border_width(GTK_CONTAINER(eventbox), boxpad); - item = eventbox; - } - } - else - { - /* Only show warning if item is not a box */ - warn = TRUE; - } - - gtk_container_border_width(GTK_CONTAINER(box), pad); - gtk_container_add(GTK_CONTAINER(box), vbox); - gtk_box_pack_end(GTK_BOX(vbox), item, TRUE, TRUE, 0); - gtk_widget_show(vbox); - - gtk_widget_set_usize(item, width, height); - gtk_object_set_user_data(GTK_OBJECT(box), vbox); - } - DW_MUTEX_UNLOCK; - - if(warn) - { - if ( width == 0 && hsize == FALSE ) - dw_messagebox("dw_box_pack_end()", DW_MB_OK|DW_MB_ERROR, "Width and expand Horizonal both unset for box: %x item: %x",box,item); - if ( height == 0 && vsize == FALSE ) - dw_messagebox("dw_box_pack_end()", DW_MB_OK|DW_MB_ERROR, "Height and expand Vertical both unset for box: %x item: %x",box,item); - } + int warn = FALSE, _locked_by_me = FALSE; + GtkWidget *tmp, *tmpitem; + + if(!box) + return; + + /* + * If you try and pack an item into itself VERY bad things can happen; like at least an + * infinite loop on GTK! Lets be safe! + */ + if(box == item) + { + dw_messagebox("dw_box_pack_end()", DW_MB_OK|DW_MB_ERROR, "Danger! Danger! Will Robinson; box and item are the same!"); + return; + } + + DW_MUTEX_LOCK; + + if((tmp = gtk_object_get_data(GTK_OBJECT(box), "_dw_boxhandle"))) + box = tmp; + + if(!item) + { + item = gtk_label_new(""); + gtk_widget_show_all(item); + } + + tmpitem = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(item), "_dw_boxhandle"); + + if(GTK_IS_TABLE(box)) + { + int boxcount = (int)gtk_object_get_data(GTK_OBJECT(box), "_dw_boxcount"); + int boxtype = (int)gtk_object_get_data(GTK_OBJECT(box), "_dw_boxtype"); + + /* If the item being packed is a box, then we use it's padding + * instead of the padding specified on the pack line, this is + * due to a bug in the OS/2 and Win32 renderer and a limitation + * of the GtkTable class. + */ + if(GTK_IS_TABLE(item) || (tmpitem && GTK_IS_TABLE(tmpitem))) + { + GtkWidget *eventbox = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(item), "_dw_eventbox"); + + /* NOTE: I left in the ability to pack boxes with a size, + * this eliminates that by forcing the size to 0. + */ + height = width = 0; + + if(eventbox) + { + int boxpad = (int)gtk_object_get_data(GTK_OBJECT(item), "_dw_boxpad"); + gtk_container_add(GTK_CONTAINER(eventbox), item); + gtk_container_border_width(GTK_CONTAINER(eventbox), boxpad); + item = eventbox; + } + } + else + { + /* Only show warning if item is not a box */ + warn = TRUE; + } + + if(boxtype == DW_VERT) + gtk_table_resize(GTK_TABLE(box), boxcount + 1, 1); + else + gtk_table_resize(GTK_TABLE(box), 1, boxcount + 1); + + gtk_table_attach(GTK_TABLE(box), item, 0, 1, 0, 1, hsize ? DW_EXPAND : 0, vsize ? DW_EXPAND : 0, pad, pad); + gtk_object_set_data(GTK_OBJECT(box), "_dw_boxcount", GINT_TO_POINTER(boxcount + 1)); + gtk_widget_set_usize(item, width, height); + if(GTK_IS_RADIO_BUTTON(item)) + { + GSList *group; + GtkWidget *groupstart = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(box), "_dw_group"); + + if(groupstart) + { + group = gtk_radio_button_group(GTK_RADIO_BUTTON(groupstart)); + gtk_radio_button_set_group(GTK_RADIO_BUTTON(item), group); + } + else + gtk_object_set_data(GTK_OBJECT(box), "_dw_group", (gpointer)item); + } + } + else + { + GtkWidget *vbox = gtk_vbox_new(FALSE, 0); + + if(GTK_IS_TABLE(item) || (tmpitem && GTK_IS_TABLE(tmpitem))) + { + GtkWidget *eventbox = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(item), "_dw_eventbox"); + + /* NOTE: I left in the ability to pack boxes with a size, + * this eliminates that by forcing the size to 0. + */ + height = width = 0; + + if(eventbox) + { + int boxpad = (int)gtk_object_get_data(GTK_OBJECT(item), "_dw_boxpad"); + gtk_container_add(GTK_CONTAINER(eventbox), item); + gtk_container_border_width(GTK_CONTAINER(eventbox), boxpad); + item = eventbox; + } + } + else + { + /* Only show warning if item is not a box */ + warn = TRUE; + } + + gtk_container_border_width(GTK_CONTAINER(box), pad); + gtk_container_add(GTK_CONTAINER(box), vbox); + gtk_box_pack_end(GTK_BOX(vbox), item, TRUE, TRUE, 0); + gtk_widget_show(vbox); + + gtk_widget_set_usize(item, width, height); + gtk_object_set_user_data(GTK_OBJECT(box), vbox); + } + DW_MUTEX_UNLOCK; + + if(warn) + { + if ( width == 0 && hsize == FALSE ) + dw_messagebox("dw_box_pack_end()", DW_MB_OK|DW_MB_ERROR, "Width and expand Horizonal both unset for box: %x item: %x",box,item); + if ( height == 0 && vsize == FALSE ) + dw_messagebox("dw_box_pack_end()", DW_MB_OK|DW_MB_ERROR, "Height and expand Vertical both unset for box: %x item: %x",box,item); + } } /* @@ -8596,8 +8639,8 @@ gtk_window_set_default_size(GTK_WINDOW(handle), default_width , default_height ); if(!gtk_object_get_data(GTK_OBJECT(handle), "_dw_size")) { - gtk_object_set_data(GTK_OBJECT(handle), "_dw_width", (gpointer)default_width ); - gtk_object_set_data(GTK_OBJECT(handle), "_dw_height", (gpointer)default_height ); + gtk_object_set_data(GTK_OBJECT(handle), "_dw_width", GINT_TO_POINTER(default_width) ); + gtk_object_set_data(GTK_OBJECT(handle), "_dw_height", GINT_TO_POINTER(default_height) ); } } else @@ -8610,13 +8653,13 @@ */ int dw_screen_width(void) { - int retval; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - retval = gdk_screen_width(); - DW_MUTEX_UNLOCK; - return retval; + int retval; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + retval = gdk_screen_width(); + DW_MUTEX_UNLOCK; + return retval; } /* @@ -8624,27 +8667,27 @@ */ int dw_screen_height(void) { - int retval; - int _locked_by_me = FALSE; - - DW_MUTEX_UNLOCK; - retval = gdk_screen_height(); - DW_MUTEX_UNLOCK; - return retval; + int retval; + int _locked_by_me = FALSE; + + DW_MUTEX_UNLOCK; + retval = gdk_screen_height(); + DW_MUTEX_UNLOCK; + return retval; } /* This should return the current color depth */ unsigned long dw_color_depth_get(void) { - int retval; - GdkVisual *vis; - int _locked_by_me = FALSE; - - DW_MUTEX_UNLOCK; - vis = gdk_visual_get_system(); - retval = vis->depth; - DW_MUTEX_UNLOCK; - return retval; + int retval; + GdkVisual *vis; + int _locked_by_me = FALSE; + + DW_MUTEX_UNLOCK; + vis = gdk_visual_get_system(); + retval = vis->depth; + DW_MUTEX_UNLOCK; + return retval; } /* @@ -8656,24 +8699,24 @@ */ void dw_window_set_pos(HWND handle, unsigned long x, unsigned long y) { - int _locked_by_me = FALSE; -#if GTK_MAJOR_VERSION > 1 - GtkWidget *mdi; -#endif - - DW_MUTEX_LOCK; -#if GTK_MAJOR_VERSION > 1 - if((mdi = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_mdi")) && GTK_IS_MDI(mdi)) - { - gtk_mdi_move(GTK_MDI(mdi), handle, x, y); - } - else -#endif - { - if(handle && handle->window) - gdk_window_move(handle->window, x, y); - } - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; +#if GTK_MAJOR_VERSION > 1 + GtkWidget *mdi; +#endif + + DW_MUTEX_LOCK; +#if GTK_MAJOR_VERSION > 1 + if((mdi = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_mdi")) && GTK_IS_MDI(mdi)) + { + gtk_mdi_move(GTK_MDI(mdi), handle, x, y); + } + else +#endif + { + if(handle && handle->window) + gdk_window_move(handle->window, x, y); + } + DW_MUTEX_UNLOCK; } /* @@ -8687,35 +8730,35 @@ */ void dw_window_set_pos_size(HWND handle, unsigned long x, unsigned long y, unsigned long width, unsigned long height) { - int _locked_by_me = FALSE; -#if GTK_MAJOR_VERSION > 1 - GtkWidget *mdi; -#endif - - if(!handle) - return; - - DW_MUTEX_LOCK; -#if GTK_MAJOR_VERSION > 1 - if((mdi = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_mdi")) && GTK_IS_MDI(mdi)) - { - gtk_mdi_move(GTK_MDI(mdi), handle, x, y); - } - else -#endif - { - if(GTK_IS_WINDOW(handle)) - { - dw_window_set_size(handle, width, height); - gtk_widget_set_uposition(handle, x, y); - } - else if(handle->window) - { - gdk_window_resize(handle->window, width, height); - gdk_window_move(handle->window, x, y); - } - } - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; +#if GTK_MAJOR_VERSION > 1 + GtkWidget *mdi; +#endif + + if(!handle) + return; + + DW_MUTEX_LOCK; +#if GTK_MAJOR_VERSION > 1 + if((mdi = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_mdi")) && GTK_IS_MDI(mdi)) + { + gtk_mdi_move(GTK_MDI(mdi), handle, x, y); + } + else +#endif + { + if(GTK_IS_WINDOW(handle)) + { + dw_window_set_size(handle, width, height); + gtk_widget_set_uposition(handle, x, y); + } + else if(handle->window) + { + gdk_window_resize(handle->window, width, height); + gdk_window_move(handle->window, x, y); + } + } + DW_MUTEX_UNLOCK; } /* @@ -8729,51 +8772,51 @@ */ void dw_window_get_pos_size(HWND handle, ULONG *x, ULONG *y, ULONG *width, ULONG *height) { - int _locked_by_me = FALSE; - gint gx, gy, gwidth, gheight, gdepth; -#if GTK_MAJOR_VERSION > 1 - GtkWidget *mdi; -#endif - - DW_MUTEX_LOCK; -#if GTK_MAJOR_VERSION > 1 - if((mdi = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_mdi")) && GTK_IS_MDI(mdi)) - { - gint myx=0, myy=0; - - gtk_mdi_get_pos(GTK_MDI(mdi), handle, &myx, &myy); - *x = myx; - *y = myy; - } - else -#endif - { - if(handle && handle->window) - { - - gdk_window_get_geometry(handle->window, &gx, &gy, &gwidth, &gheight, &gdepth); - gdk_window_get_root_origin(handle->window, &gx, &gy); - if(x) - *x = gx; - if(y) - *y = gy; - if(GTK_IS_WINDOW(handle)) - { - if(width) - *width = gwidth + _dw_border_width; - if(height) - *height = gheight + _dw_border_height; - } - else - { - if(width) - *width = gwidth; - if(height) - *height = gheight; - } - } - } - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; + gint gx, gy, gwidth, gheight, gdepth; +#if GTK_MAJOR_VERSION > 1 + GtkWidget *mdi; +#endif + + DW_MUTEX_LOCK; +#if GTK_MAJOR_VERSION > 1 + if((mdi = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_mdi")) && GTK_IS_MDI(mdi)) + { + gint myx=0, myy=0; + + gtk_mdi_get_pos(GTK_MDI(mdi), handle, &myx, &myy); + *x = myx; + *y = myy; + } + else +#endif + { + if(handle && handle->window) + { + + gdk_window_get_geometry(handle->window, &gx, &gy, &gwidth, &gheight, &gdepth); + gdk_window_get_root_origin(handle->window, &gx, &gy); + if(x) + *x = gx; + if(y) + *y = gy; + if(GTK_IS_WINDOW(handle)) + { + if(width) + *width = gwidth + _dw_border_width; + if(height) + *height = gheight + _dw_border_height; + } + else + { + if(width) + *width = gwidth; + if(height) + *height = gheight; + } + } + } + DW_MUTEX_UNLOCK; } /* @@ -8785,42 +8828,42 @@ */ void dw_window_set_style(HWND handle, unsigned long style, unsigned long mask) { - GtkWidget *handle2 = handle; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - if(GTK_IS_SCROLLED_WINDOW(handle)) - { - GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - if(tmp) - handle2 = tmp; - } - else if(GTK_IS_FRAME(handle)) - { - GtkWidget *tmp = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_label"); - if(tmp && GTK_IS_LABEL(tmp)) - handle2 = tmp; - } - if(GTK_IS_LABEL(handle2)) - { - if(style & DW_DT_CENTER || style & DW_DT_VCENTER) - { - gfloat x, y; - - x = y = DW_LEFT; - - if(style & DW_DT_CENTER) - x = DW_CENTER; - - if(style & DW_DT_VCENTER) - y = DW_CENTER; - - gtk_misc_set_alignment(GTK_MISC(handle2), x, y); - } - if(style & DW_DT_WORDBREAK) - gtk_label_set_line_wrap(GTK_LABEL(handle), TRUE); - } - DW_MUTEX_UNLOCK; + GtkWidget *handle2 = handle; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + if(GTK_IS_SCROLLED_WINDOW(handle)) + { + GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + if(tmp) + handle2 = tmp; + } + else if(GTK_IS_FRAME(handle)) + { + GtkWidget *tmp = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_label"); + if(tmp && GTK_IS_LABEL(tmp)) + handle2 = tmp; + } + if(GTK_IS_LABEL(handle2)) + { + if(style & DW_DT_CENTER || style & DW_DT_VCENTER) + { + gfloat x, y; + + x = y = DW_LEFT; + + if(style & DW_DT_CENTER) + x = DW_CENTER; + + if(style & DW_DT_VCENTER) + y = DW_CENTER; + + gtk_misc_set_alignment(GTK_MISC(handle2), x, y); + } + if(style & DW_DT_WORDBREAK) + gtk_label_set_line_wrap(GTK_LABEL(handle), TRUE); + } + DW_MUTEX_UNLOCK; } /* @@ -8832,57 +8875,57 @@ */ unsigned long dw_notebook_page_new(HWND handle, unsigned long flags, int front) { - int z; - int _locked_by_me = FALSE; - GtkWidget **pagearray; - - DW_MUTEX_LOCK; - pagearray = (GtkWidget **)gtk_object_get_data(GTK_OBJECT(handle), "_dw_pagearray"); - - if(pagearray) - { - for(z=0;z<256;z++) - { - if(!pagearray[z]) - { - char text[100]; - int num = z; - - if(front) - num |= 1 << 16; - - sprintf(text, "_dw_page%d", z); - /* Save the real id and the creation flags */ - gtk_object_set_data(GTK_OBJECT(handle), text, (gpointer)num); - DW_MUTEX_UNLOCK; - return z; - } - } - } - DW_MUTEX_UNLOCK; - - /* Hopefully this won't happen. */ - return 256; + int z; + int _locked_by_me = FALSE; + GtkWidget **pagearray; + + DW_MUTEX_LOCK; + pagearray = (GtkWidget **)gtk_object_get_data(GTK_OBJECT(handle), "_dw_pagearray"); + + if(pagearray) + { + for(z=0;z<256;z++) + { + if(!pagearray[z]) + { + char text[100]; + int num = z; + + if(front) + num |= 1 << 16; + + sprintf(text, "_dw_page%d", z); + /* Save the real id and the creation flags */ + gtk_object_set_data(GTK_OBJECT(handle), text, GINT_TO_POINTER(num)); + DW_MUTEX_UNLOCK; + return z; + } + } + } + DW_MUTEX_UNLOCK; + + /* Hopefully this won't happen. */ + return 256; } /* Return the physical page id from the logical page id */ int _get_physical_page(HWND handle, unsigned long pageid) { - int z; - GtkWidget *thispage, **pagearray = gtk_object_get_data(GTK_OBJECT(handle), "_dw_pagearray"); - - if(pagearray) - { - for(z=0;z<256;z++) - { - if((thispage = gtk_notebook_get_nth_page(GTK_NOTEBOOK(handle), z))) - { - if(thispage == pagearray[pageid]) - return z; - } - } - } - return 256; + int z; + GtkWidget *thispage, **pagearray = gtk_object_get_data(GTK_OBJECT(handle), "_dw_pagearray"); + + if(pagearray) + { + for(z=0;z<256;z++) + { + if((thispage = gtk_notebook_get_nth_page(GTK_NOTEBOOK(handle), z))) + { + if(thispage == pagearray[pageid]) + return z; + } + } + } + return 256; } /* @@ -8893,18 +8936,18 @@ */ void dw_notebook_page_destroy(HWND handle, unsigned int pageid) { - int realpage, _locked_by_me = FALSE; - GtkWidget **pagearray; - - DW_MUTEX_LOCK; - realpage = _get_physical_page(handle, pageid); - if(realpage > -1 && realpage < 256) - { - gtk_notebook_remove_page(GTK_NOTEBOOK(handle), realpage); - if((pagearray = gtk_object_get_data(GTK_OBJECT(handle), "_dw_pagearray"))) - pagearray[pageid] = NULL; - } - DW_MUTEX_UNLOCK; + int realpage, _locked_by_me = FALSE; + GtkWidget **pagearray; + + DW_MUTEX_LOCK; + realpage = _get_physical_page(handle, pageid); + if(realpage > -1 && realpage < 256) + { + gtk_notebook_remove_page(GTK_NOTEBOOK(handle), realpage); + if((pagearray = gtk_object_get_data(GTK_OBJECT(handle), "_dw_pagearray"))) + pagearray[pageid] = NULL; + } + DW_MUTEX_UNLOCK; } /* @@ -8914,14 +8957,14 @@ */ unsigned long dw_notebook_page_get(HWND handle) { - int retval, phys; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - phys = gtk_notebook_get_current_page(GTK_NOTEBOOK(handle)); - retval = _get_logical_page(handle, phys); - DW_MUTEX_UNLOCK; - return retval; + int retval, phys; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + phys = gtk_notebook_get_current_page(GTK_NOTEBOOK(handle)); + retval = _get_logical_page(handle, phys); + DW_MUTEX_UNLOCK; + return retval; } /* @@ -8932,13 +8975,13 @@ */ void dw_notebook_page_set(HWND handle, unsigned int pageid) { - int realpage, _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - realpage = _get_physical_page(handle, pageid); - if(realpage > -1 && realpage < 256) - gtk_notebook_set_page(GTK_NOTEBOOK(handle), pageid); - DW_MUTEX_UNLOCK; + int realpage, _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + realpage = _get_physical_page(handle, pageid); + if(realpage > -1 && realpage < 256) + gtk_notebook_set_page(GTK_NOTEBOOK(handle), pageid); + DW_MUTEX_UNLOCK; } @@ -8951,28 +8994,28 @@ */ void dw_notebook_page_set_text(HWND handle, unsigned long pageid, char *text) { - GtkWidget *child; - int realpage, _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - realpage = _get_physical_page(handle, pageid); - if(realpage < 0 || realpage > 255) - { - char ptext[100]; - int num; - - sprintf(ptext, "_dw_page%d", (int)pageid); - num = (int)gtk_object_get_data(GTK_OBJECT(handle), ptext); - realpage = 0xFF & num; - } - - if(realpage > -1 && realpage < 256) - { - child = gtk_notebook_get_nth_page(GTK_NOTEBOOK(handle), realpage); - if(child) - gtk_notebook_set_tab_label_text(GTK_NOTEBOOK(handle), child, text); - } - DW_MUTEX_UNLOCK; + GtkWidget *child; + int realpage, _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + realpage = _get_physical_page(handle, pageid); + if(realpage < 0 || realpage > 255) + { + char ptext[100]; + int num; + + sprintf(ptext, "_dw_page%d", (int)pageid); + num = (int)gtk_object_get_data(GTK_OBJECT(handle), ptext); + realpage = 0xFF & num; + } + + if(realpage > -1 && realpage < 256) + { + child = gtk_notebook_get_nth_page(GTK_NOTEBOOK(handle), realpage); + if(child) + gtk_notebook_set_tab_label_text(GTK_NOTEBOOK(handle), child, text); + } + DW_MUTEX_UNLOCK; } /* @@ -8984,7 +9027,7 @@ */ void dw_notebook_page_set_status_text(HWND handle, unsigned long pageid, char *text) { - /* TODO (if possible) */ + /* TODO (if possible) */ } /* @@ -8996,58 +9039,58 @@ */ void dw_notebook_pack(HWND handle, unsigned long pageid, HWND page) { - GtkWidget *label, *child, *oldlabel, **pagearray; - gchar *text = NULL; - int num, z, realpage = -1, pad, _locked_by_me = FALSE; - char ptext[100]; - - DW_MUTEX_LOCK; - sprintf(ptext, "_dw_page%d", (int)pageid); - num = (int)gtk_object_get_data(GTK_OBJECT(handle), ptext); - gtk_object_set_data(GTK_OBJECT(handle), ptext, NULL); - pagearray = (GtkWidget **)gtk_object_get_data(GTK_OBJECT(handle), "_dw_pagearray"); - - if(!pagearray) - { - DW_MUTEX_UNLOCK; - return; - } - - /* The page already exists... so get it's current page */ - if(pagearray[pageid]) - { - for(z=0;z<256;z++) - { - child = gtk_notebook_get_nth_page(GTK_NOTEBOOK(handle), z); - if(child == pagearray[pageid]) - { - oldlabel = gtk_notebook_get_tab_label(GTK_NOTEBOOK(handle), child); - if(oldlabel) - gtk_label_get(GTK_LABEL(oldlabel), &text); - gtk_notebook_remove_page(GTK_NOTEBOOK(handle), z); - realpage = z; - break; - } - } - } - - pagearray[pageid] = page; - - label = gtk_label_new(text ? text : ""); - - if(GTK_IS_TABLE(page)) - { - pad = (int)gtk_object_get_data(GTK_OBJECT(page), "_dw_boxpad"); - gtk_container_border_width(GTK_CONTAINER(page), pad); - } - - if(realpage != -1) - gtk_notebook_insert_page(GTK_NOTEBOOK(handle), page, label, realpage); - else if(num & ~(0xFF)) - gtk_notebook_insert_page(GTK_NOTEBOOK(handle), page, label, 0); - else - gtk_notebook_insert_page(GTK_NOTEBOOK(handle), page, label, 256); - DW_MUTEX_UNLOCK; + GtkWidget *label, *child, *oldlabel, **pagearray; + gchar *text = NULL; + int num, z, realpage = -1, pad, _locked_by_me = FALSE; + char ptext[100]; + + DW_MUTEX_LOCK; + sprintf(ptext, "_dw_page%d", (int)pageid); + num = (int)gtk_object_get_data(GTK_OBJECT(handle), ptext); + gtk_object_set_data(GTK_OBJECT(handle), ptext, NULL); + pagearray = (GtkWidget **)gtk_object_get_data(GTK_OBJECT(handle), "_dw_pagearray"); + + if(!pagearray) + { + DW_MUTEX_UNLOCK; + return; + } + + /* The page already exists... so get it's current page */ + if(pagearray[pageid]) + { + for(z=0;z<256;z++) + { + child = gtk_notebook_get_nth_page(GTK_NOTEBOOK(handle), z); + if(child == pagearray[pageid]) + { + oldlabel = gtk_notebook_get_tab_label(GTK_NOTEBOOK(handle), child); + if(oldlabel) + gtk_label_get(GTK_LABEL(oldlabel), &text); + gtk_notebook_remove_page(GTK_NOTEBOOK(handle), z); + realpage = z; + break; + } + } + } + + pagearray[pageid] = page; + + label = gtk_label_new(text ? text : ""); + + if(GTK_IS_TABLE(page)) + { + pad = (int)gtk_object_get_data(GTK_OBJECT(page), "_dw_boxpad"); + gtk_container_border_width(GTK_CONTAINER(page), pad); + } + + if(realpage != -1) + gtk_notebook_insert_page(GTK_NOTEBOOK(handle), page, label, realpage); + else if(num & ~(0xFF)) + gtk_notebook_insert_page(GTK_NOTEBOOK(handle), page, label, 0); + else + gtk_notebook_insert_page(GTK_NOTEBOOK(handle), page, label, 256); + DW_MUTEX_UNLOCK; } /* @@ -9058,52 +9101,52 @@ */ void dw_listbox_append(HWND handle, char *text) { - GtkWidget *handle2 = handle; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - if(GTK_IS_SCROLLED_WINDOW(handle)) - { - GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - if(tmp) - handle2 = tmp; - } - gtk_object_set_data(GTK_OBJECT(handle), "_dw_appending", (gpointer)1); - if(GTK_IS_LIST(handle2)) - { - GtkWidget *list_item; - GList *tmp; - char *font = (char *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_font"); - GdkColor *fore = (GdkColor *)gtk_object_get_data(GTK_OBJECT(handle2), "_dw_foregdk"); - GdkColor *back = (GdkColor *)gtk_object_get_data(GTK_OBJECT(handle2), "_dw_backgdk"); - - list_item=gtk_list_item_new_with_label(text); - - if(font) - _set_font(GTK_LIST_ITEM(list_item)->item.bin.child, font); - if(fore && back) - _set_color(GTK_LIST_ITEM(list_item)->item.bin.child, - DW_RGB(fore->red, fore->green, fore->blue), - DW_RGB(back->red, back->green, back->blue)); - - tmp = g_list_append(NULL, list_item); - gtk_widget_show(list_item); - gtk_list_append_items(GTK_LIST(handle2),tmp); - } - else if(GTK_IS_COMBO(handle2)) - { - GList *tmp = (GList *)gtk_object_get_user_data(GTK_OBJECT(handle2)); - char *addtext = strdup(text); - - if(addtext) - { - tmp = g_list_append(tmp, addtext); - gtk_object_set_user_data(GTK_OBJECT(handle2), tmp); - gtk_combo_set_popdown_strings(GTK_COMBO(handle2), tmp); - } - } - gtk_object_set_data(GTK_OBJECT(handle), "_dw_appending", NULL); - DW_MUTEX_UNLOCK; + GtkWidget *handle2 = handle; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + if(GTK_IS_SCROLLED_WINDOW(handle)) + { + GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + if(tmp) + handle2 = tmp; + } + gtk_object_set_data(GTK_OBJECT(handle), "_dw_appending", GINT_TO_POINTER(1)); + if(GTK_IS_LIST(handle2)) + { + GtkWidget *list_item; + GList *tmp; + char *font = (char *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_font"); + GdkColor *fore = (GdkColor *)gtk_object_get_data(GTK_OBJECT(handle2), "_dw_foregdk"); + GdkColor *back = (GdkColor *)gtk_object_get_data(GTK_OBJECT(handle2), "_dw_backgdk"); + + list_item=gtk_list_item_new_with_label(text); + + if(font) + _set_font(GTK_LIST_ITEM(list_item)->item.bin.child, font); + if(fore && back) + _set_color(GTK_LIST_ITEM(list_item)->item.bin.child, + DW_RGB(fore->red, fore->green, fore->blue), + DW_RGB(back->red, back->green, back->blue)); + + tmp = g_list_append(NULL, list_item); + gtk_widget_show(list_item); + gtk_list_append_items(GTK_LIST(handle2),tmp); + } + else if(GTK_IS_COMBO(handle2)) + { + GList *tmp = (GList *)gtk_object_get_user_data(GTK_OBJECT(handle2)); + char *addtext = strdup(text); + + if(addtext) + { + tmp = g_list_append(tmp, addtext); + gtk_object_set_user_data(GTK_OBJECT(handle2), tmp); + gtk_combo_set_popdown_strings(GTK_COMBO(handle2), tmp); + } + } + gtk_object_set_data(GTK_OBJECT(handle), "_dw_appending", NULL); + DW_MUTEX_UNLOCK; } /* @@ -9115,54 +9158,54 @@ */ void dw_listbox_list_append(HWND handle, char **text, int count) { - GtkWidget *handle2 = handle; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - if(GTK_IS_SCROLLED_WINDOW(handle)) - { - GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - if(tmp) - handle2 = tmp; - } - gtk_object_set_data(GTK_OBJECT(handle), "_dw_appending", (gpointer)1); - if(GTK_IS_LIST(handle2)) - { - GtkWidget *list_item; - GList *tmp; - char *font = (char *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_font"); - GdkColor *fore = (GdkColor *)gtk_object_get_data(GTK_OBJECT(handle2), "_dw_foregdk"); - GdkColor *back = (GdkColor *)gtk_object_get_data(GTK_OBJECT(handle2), "_dw_backgdk"); - - list_item=gtk_list_item_new_with_label(*text); - - if(font) - _set_font(GTK_LIST_ITEM(list_item)->item.bin.child, font); - if(fore && back) - _set_color(GTK_LIST_ITEM(list_item)->item.bin.child, - DW_RGB(fore->red, fore->green, fore->blue), - DW_RGB(back->red, back->green, back->blue)); - - tmp = g_list_append(NULL, list_item); - gtk_widget_show(list_item); - gtk_list_append_items(GTK_LIST(handle2),tmp); - } - else if(GTK_IS_COMBO(handle2)) - { - GList *tmp = (GList *)gtk_object_get_user_data(GTK_OBJECT(handle2)); - char *addtext; - int i; - - for (i=0;iitem.bin.child, font); + if(fore && back) + _set_color(GTK_LIST_ITEM(list_item)->item.bin.child, + DW_RGB(fore->red, fore->green, fore->blue), + DW_RGB(back->red, back->green, back->blue)); + + tmp = g_list_append(NULL, list_item); + gtk_widget_show(list_item); + gtk_list_append_items(GTK_LIST(handle2),tmp); + } + else if(GTK_IS_COMBO(handle2)) + { + GList *tmp = (GList *)gtk_object_get_user_data(GTK_OBJECT(handle2)); + char *addtext; + int i; + + for (i=0;idata) - free(list->data); - list=list->next; - } - g_list_free(tmp); - } - gtk_object_set_user_data(GTK_OBJECT(handle2), NULL); - } - else if(GTK_IS_LIST(handle2)) - { - int count = dw_listbox_count(handle); - - gtk_list_clear_items(GTK_LIST(handle2), 0, count - 1); - } - DW_MUTEX_UNLOCK; + GtkWidget *handle2 = handle; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + if(GTK_IS_SCROLLED_WINDOW(handle)) + { + GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + if(tmp) + handle2 = tmp; + } + if(GTK_IS_COMBO(handle2)) + { + GList *list, *tmp = (GList *)gtk_object_get_user_data(GTK_OBJECT(handle2)); + + if(tmp) + { + list = tmp; + while(list) + { + if(list->data) + free(list->data); + list=list->next; + } + g_list_free(tmp); + } + gtk_object_set_user_data(GTK_OBJECT(handle2), NULL); + } + else if(GTK_IS_LIST(handle2)) + { + int count = dw_listbox_count(handle); + + gtk_list_clear_items(GTK_LIST(handle2), 0, count - 1); + } + DW_MUTEX_UNLOCK; } /* @@ -9215,32 +9258,32 @@ */ int dw_listbox_count(HWND handle) { - GtkWidget *handle2 = handle; + GtkWidget *handle2 = handle; int retval = 0; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - if(GTK_IS_SCROLLED_WINDOW(handle)) - { - GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - if(tmp) - handle2 = tmp; - } - else if(GTK_IS_COMBO(handle)) - { - handle2 = GTK_COMBO(handle)->list; - } - if(GTK_IS_LIST(handle2)) - { - GList *list = GTK_LIST(handle2)->children; - while(list) - { - list = list->next; - retval++; - } - } - DW_MUTEX_UNLOCK; - return retval; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + if(GTK_IS_SCROLLED_WINDOW(handle)) + { + GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + if(tmp) + handle2 = tmp; + } + else if(GTK_IS_COMBO(handle)) + { + handle2 = GTK_COMBO(handle)->list; + } + if(GTK_IS_LIST(handle2)) + { + GList *list = GTK_LIST(handle2)->children; + while(list) + { + list = list->next; + retval++; + } + } + DW_MUTEX_UNLOCK; + return retval; } /* @@ -9251,32 +9294,32 @@ */ void dw_listbox_set_top(HWND handle, int top) { - GtkWidget *handle2 = handle; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - if(GTK_IS_SCROLLED_WINDOW(handle)) - { - GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - if(tmp) - handle2 = tmp; - } - if(GTK_IS_LIST(handle2)) - { - int count = dw_listbox_count(handle); - GtkAdjustment *adj = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(handle)); - float pos, ratio; - - if(count) - { - ratio = (float)top/(float)count; - - pos = (ratio * (float)(adj->upper - adj->lower)) + adj->lower; - - gtk_adjustment_set_value(adj, pos); - } - } - DW_MUTEX_UNLOCK; + GtkWidget *handle2 = handle; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + if(GTK_IS_SCROLLED_WINDOW(handle)) + { + GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + if(tmp) + handle2 = tmp; + } + if(GTK_IS_LIST(handle2)) + { + int count = dw_listbox_count(handle); + GtkAdjustment *adj = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(handle)); + float pos, ratio; + + if(count) + { + ratio = (float)top/(float)count; + + pos = (ratio * (float)(adj->upper - adj->lower)) + adj->lower; + + gtk_adjustment_set_value(adj, pos); + } + } + DW_MUTEX_UNLOCK; } /* @@ -9289,59 +9332,59 @@ */ void dw_listbox_get_text(HWND handle, unsigned int index, char *buffer, unsigned int length) { - GtkWidget *handle2 = handle; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - if(GTK_IS_SCROLLED_WINDOW(handle)) - { - GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - if(tmp) - handle2 = tmp; - } - else if(GTK_IS_COMBO(handle)) - { - handle2 = GTK_COMBO(handle)->list; - } - if(GTK_IS_LIST(handle2)) - { - int counter = 0; - GList *list = GTK_LIST(handle2)->children; - - while(list) - { - if(counter == index) - { - gchar *text = ""; - - if(GTK_IS_LIST_ITEM(list->data)) - { - GtkListItem *li = GTK_LIST_ITEM(list->data); - - if(GTK_IS_ITEM(&(li->item))) - { - GtkItem *i = &(li->item); - - if(GTK_IS_BIN(&(i->bin))) - { - GtkBin *b = &(i->bin); - - if(GTK_IS_LABEL(b->child)) - gtk_label_get(GTK_LABEL(b->child), &text); - } - } - } - else if(GTK_IS_COMBO(handle) && list->data) - text = (gchar *)list->data; - - strncpy(buffer, (char *)text, length); - break; - } - list = list->next; - counter++; - } - } - DW_MUTEX_UNLOCK; + GtkWidget *handle2 = handle; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + if(GTK_IS_SCROLLED_WINDOW(handle)) + { + GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + if(tmp) + handle2 = tmp; + } + else if(GTK_IS_COMBO(handle)) + { + handle2 = GTK_COMBO(handle)->list; + } + if(GTK_IS_LIST(handle2)) + { + int counter = 0; + GList *list = GTK_LIST(handle2)->children; + + while(list) + { + if(counter == index) + { + gchar *text = ""; + + if(GTK_IS_LIST_ITEM(list->data)) + { + GtkListItem *li = GTK_LIST_ITEM(list->data); + + if(GTK_IS_ITEM(&(li->item))) + { + GtkItem *i = &(li->item); + + if(GTK_IS_BIN(&(i->bin))) + { + GtkBin *b = &(i->bin); + + if(GTK_IS_LABEL(b->child)) + gtk_label_get(GTK_LABEL(b->child), &text); + } + } + } + else if(GTK_IS_COMBO(handle) && list->data) + text = (gchar *)list->data; + + strncpy(buffer, (char *)text, length); + break; + } + list = list->next; + counter++; + } + } + DW_MUTEX_UNLOCK; } /* @@ -9353,74 +9396,74 @@ */ void dw_listbox_set_text(HWND handle, unsigned int index, char *buffer) { - GtkWidget *handle2 = handle; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - if(GTK_IS_SCROLLED_WINDOW(handle)) - { - GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - if(tmp) - handle2 = tmp; - } - else if(GTK_IS_COMBO(handle)) - { - handle2 = GTK_COMBO(handle)->list; - } - if(GTK_IS_LIST(handle2)) - { - int counter = 0; - GList *list = GTK_LIST(handle2)->children; - - while(list) - { - if(counter == index) - { - - if(GTK_IS_LIST_ITEM(list->data)) - { - GtkListItem *li = GTK_LIST_ITEM(list->data); - - if(GTK_IS_ITEM(&(li->item))) - { - GtkItem *i = &(li->item); - - if(GTK_IS_BIN(&(i->bin))) - { - GtkBin *b = &(i->bin); - - if(GTK_IS_LABEL(b->child)) - gtk_label_set_text(GTK_LABEL(b->child), buffer); - } - } - } - else if(GTK_IS_COMBO(handle)) - { - if(list->data) - g_free(list->data); - list->data = g_strdup(buffer); - } - break; - } - list = list->next; - counter++; - } - } - DW_MUTEX_UNLOCK; + GtkWidget *handle2 = handle; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + if(GTK_IS_SCROLLED_WINDOW(handle)) + { + GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + if(tmp) + handle2 = tmp; + } + else if(GTK_IS_COMBO(handle)) + { + handle2 = GTK_COMBO(handle)->list; + } + if(GTK_IS_LIST(handle2)) + { + int counter = 0; + GList *list = GTK_LIST(handle2)->children; + + while(list) + { + if(counter == index) + { + + if(GTK_IS_LIST_ITEM(list->data)) + { + GtkListItem *li = GTK_LIST_ITEM(list->data); + + if(GTK_IS_ITEM(&(li->item))) + { + GtkItem *i = &(li->item); + + if(GTK_IS_BIN(&(i->bin))) + { + GtkBin *b = &(i->bin); + + if(GTK_IS_LABEL(b->child)) + gtk_label_set_text(GTK_LABEL(b->child), buffer); + } + } + } + else if(GTK_IS_COMBO(handle)) + { + if(list->data) + g_free(list->data); + list->data = g_strdup(buffer); + } + break; + } + list = list->next; + counter++; + } + } + DW_MUTEX_UNLOCK; } #if GTK_MAJOR_VERSION < 2 /* Check if a GList item is in another GList */ static int _dw_in_list(GList *item, GList *list) { - while(list) - { - if(list->data == item->data) - return TRUE; - - list = list->next; - } - return FALSE; + while(list) + { + if(list->data == item->data) + return TRUE; + + list = list->next; + } + return FALSE; } #endif @@ -9432,58 +9475,58 @@ */ int dw_listbox_selected_multi(HWND handle, int where) { - GtkWidget *handle2 = handle; - int retval = DW_LIT_NONE; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - if(GTK_IS_SCROLLED_WINDOW(handle)) - { - GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - if(tmp) - handle2 = tmp; - } - if(GTK_IS_LIST(handle2)) - { -#if GTK_MAJOR_VERSION > 1 - int counter = 0; - GList *list = GTK_LIST(handle2)->children; - - while(list) - { - GtkItem *item = (GtkItem *)list->data; - - if(item && - item->bin.container.widget.state == GTK_STATE_SELECTED - && counter > where) - { - retval = counter; - break; - } - - - list = list->next; - counter++; - } + GtkWidget *handle2 = handle; + int retval = DW_LIT_NONE; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + if(GTK_IS_SCROLLED_WINDOW(handle)) + { + GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + if(tmp) + handle2 = tmp; + } + if(GTK_IS_LIST(handle2)) + { +#if GTK_MAJOR_VERSION > 1 + int counter = 0; + GList *list = GTK_LIST(handle2)->children; + + while(list) + { + GtkItem *item = (GtkItem *)list->data; + + if(item && + item->bin.container.widget.state == GTK_STATE_SELECTED + && counter > where) + { + retval = counter; + break; + } + + + list = list->next; + counter++; + } #else - int counter = 0; - GList *list = GTK_LIST(handle2)->children; - - while(list) - { - if(counter > where && _dw_in_list(list, GTK_LIST(handle2)->selection)) - { - retval = counter; - break; - } - - list = list->next; - counter++; - } -#endif - } - DW_MUTEX_UNLOCK; - return retval; + int counter = 0; + GList *list = GTK_LIST(handle2)->children; + + while(list) + { + if(counter > where && _dw_in_list(list, GTK_LIST(handle2)->selection)) + { + retval = counter; + break; + } + + list = list->next; + counter++; + } +#endif + } + DW_MUTEX_UNLOCK; + return retval; } /* @@ -9493,63 +9536,63 @@ */ unsigned int dw_listbox_selected(HWND handle) { - GtkWidget *handle2 = handle; - int retval = DW_LIT_NONE; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - if(GTK_IS_SCROLLED_WINDOW(handle)) - { - GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - if(tmp) - handle2 = tmp; - } - else if(GTK_IS_COMBO(handle)) - { - retval = (unsigned int)gtk_object_get_data(GTK_OBJECT(handle), "_dw_item"); - DW_MUTEX_UNLOCK; - return retval; - } - if(GTK_IS_LIST(handle2)) - { - int counter = 0; - GList *list = GTK_LIST(handle2)->children; -#if GTK_MAJOR_VERSION > 1 - - while(list) - { - GtkItem *item = (GtkItem *)list->data; - - if(item && item->bin.container.widget.state == GTK_STATE_SELECTED) - { - retval = counter; - break; - } - - list = list->next; - counter++; - } + GtkWidget *handle2 = handle; + int retval = DW_LIT_NONE; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + if(GTK_IS_SCROLLED_WINDOW(handle)) + { + GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + if(tmp) + handle2 = tmp; + } + else if(GTK_IS_COMBO(handle)) + { + retval = (unsigned int)gtk_object_get_data(GTK_OBJECT(handle), "_dw_item"); + DW_MUTEX_UNLOCK; + return retval; + } + if(GTK_IS_LIST(handle2)) + { + int counter = 0; + GList *list = GTK_LIST(handle2)->children; +#if GTK_MAJOR_VERSION > 1 + + while(list) + { + GtkItem *item = (GtkItem *)list->data; + + if(item && item->bin.container.widget.state == GTK_STATE_SELECTED) + { + retval = counter; + break; + } + + list = list->next; + counter++; + } #else - GList *selection = GTK_LIST(handle2)->selection; - - if(selection) - { - while(list) - { - if(list->data == selection->data) - { - retval = counter; - break; - } - - list = list->next; - counter++; - } - } -#endif - } - DW_MUTEX_UNLOCK; - return retval; + GList *selection = GTK_LIST(handle2)->selection; + + if(selection) + { + while(list) + { + if(list->data == selection->data) + { + retval = counter; + break; + } + + list = list->next; + counter++; + } + } +#endif + } + DW_MUTEX_UNLOCK; + return retval; } /* @@ -9561,28 +9604,28 @@ */ void dw_listbox_select(HWND handle, int index, int state) { - GtkWidget *handle2 = handle; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - if(GTK_IS_SCROLLED_WINDOW(handle)) - { - GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - if(tmp) - handle2 = tmp; - } - else if(GTK_IS_COMBO(handle)) - { - handle2 = GTK_COMBO(handle)->list; - } - if(GTK_IS_LIST(handle2)) - { - if(state) - gtk_list_select_item(GTK_LIST(handle2), index); - else - gtk_list_unselect_item(GTK_LIST(handle2), index); - } - DW_MUTEX_UNLOCK; + GtkWidget *handle2 = handle; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + if(GTK_IS_SCROLLED_WINDOW(handle)) + { + GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + if(tmp) + handle2 = tmp; + } + else if(GTK_IS_COMBO(handle)) + { + handle2 = GTK_COMBO(handle)->list; + } + if(GTK_IS_LIST(handle2)) + { + if(state) + gtk_list_select_item(GTK_LIST(handle2), index); + else + gtk_list_unselect_item(GTK_LIST(handle2), index); + } + DW_MUTEX_UNLOCK; } /* @@ -9593,69 +9636,69 @@ */ void dw_listbox_delete(HWND handle, int index) { - GtkWidget *handle2 = handle; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - if(GTK_IS_SCROLLED_WINDOW(handle)) - { - GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); - if(tmp) - handle2 = tmp; - } - else if(GTK_IS_COMBO(handle)) - { - handle2 = GTK_COMBO(handle)->list; - } - if(GTK_IS_LIST(handle2)) -{ - gtk_list_clear_items(GTK_LIST(handle2), index, index+1); -} - DW_MUTEX_UNLOCK; + GtkWidget *handle2 = handle; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + if(GTK_IS_SCROLLED_WINDOW(handle)) + { + GtkWidget *tmp = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + if(tmp) + handle2 = tmp; + } + else if(GTK_IS_COMBO(handle)) + { + handle2 = GTK_COMBO(handle)->list; + } + if(GTK_IS_LIST(handle2)) +{ + gtk_list_clear_items(GTK_LIST(handle2), index, index+1); +} + DW_MUTEX_UNLOCK; } /* Reposition the bar according to the percentage */ static gint _splitbar_size_allocate(GtkWidget *widget, GtkAllocation *event, gpointer data) { - float *percent = (float *)gtk_object_get_data(GTK_OBJECT(widget), "_dw_percent"); - int lastwidth = (int)gtk_object_get_data(GTK_OBJECT(widget), "_dw_lastwidth"); - int lastheight = (int)gtk_object_get_data(GTK_OBJECT(widget), "_dw_lastheight"); - - /* Prevent infinite recursion ;) */ - if(!percent || (lastwidth == event->width && lastheight == event->height)) - return FALSE; - - lastwidth = event->width; lastheight = event->height; - - gtk_object_set_data(GTK_OBJECT(widget), "_dw_lastwidth", (gpointer)lastwidth); - gtk_object_set_data(GTK_OBJECT(widget), "_dw_lastheight", (gpointer)lastheight); - - if(GTK_IS_HPANED(widget)) - gtk_paned_set_position(GTK_PANED(widget), (int)(event->width * (*percent / 100.0))); - if(GTK_IS_VPANED(widget)) - gtk_paned_set_position(GTK_PANED(widget), (int)(event->height * (*percent / 100.0))); - gtk_object_set_data(GTK_OBJECT(widget), "_dw_waiting", NULL); - return FALSE; + float *percent = (float *)gtk_object_get_data(GTK_OBJECT(widget), "_dw_percent"); + int lastwidth = (int)gtk_object_get_data(GTK_OBJECT(widget), "_dw_lastwidth"); + int lastheight = (int)gtk_object_get_data(GTK_OBJECT(widget), "_dw_lastheight"); + + /* Prevent infinite recursion ;) */ + if(!percent || (lastwidth == event->width && lastheight == event->height)) + return FALSE; + + lastwidth = event->width; lastheight = event->height; + + gtk_object_set_data(GTK_OBJECT(widget), "_dw_lastwidth", GINT_TO_POINTER(lastwidth)); + gtk_object_set_data(GTK_OBJECT(widget), "_dw_lastheight", GINT_TO_POINTER(lastheight)); + + if(GTK_IS_HPANED(widget)) + gtk_paned_set_position(GTK_PANED(widget), (int)(event->width * (*percent / 100.0))); + if(GTK_IS_VPANED(widget)) + gtk_paned_set_position(GTK_PANED(widget), (int)(event->height * (*percent / 100.0))); + gtk_object_set_data(GTK_OBJECT(widget), "_dw_waiting", NULL); + return FALSE; } #if GTK_MAJOR_VERSION > 1 /* Figure out the new percentage */ static void _splitbar_accept_position(GObject *object, GParamSpec *pspec, gpointer data) { - GtkWidget *widget = (GtkWidget *)data; - float *percent = (float *)gtk_object_get_data(GTK_OBJECT(widget), "_dw_percent"); - int size = 0, position = gtk_paned_get_position(GTK_PANED(widget)); - - if(!percent || gtk_object_get_data(GTK_OBJECT(widget), "_dw_waiting")) - return; - - if(GTK_IS_VPANED(widget)) - size = widget->allocation.height; - else if(GTK_IS_HPANED(widget)) - size = widget->allocation.width; - - if(size > 0) - *percent = ((float)(position * 100) / (float)size); + GtkWidget *widget = (GtkWidget *)data; + float *percent = (float *)gtk_object_get_data(GTK_OBJECT(widget), "_dw_percent"); + int size = 0, position = gtk_paned_get_position(GTK_PANED(widget)); + + if(!percent || gtk_object_get_data(GTK_OBJECT(widget), "_dw_waiting")) + return; + + if(GTK_IS_VPANED(widget)) + size = widget->allocation.height; + else if(GTK_IS_HPANED(widget)) + size = widget->allocation.width; + + if(size > 0) + *percent = ((float)(position * 100) / (float)size); } #endif @@ -9670,30 +9713,30 @@ */ HWND dw_splitbar_new(int type, HWND topleft, HWND bottomright, unsigned long id) { - GtkWidget *tmp = NULL; - int _locked_by_me = FALSE; - float *percent = malloc(sizeof(float)); - - DW_MUTEX_LOCK; - if(type == DW_HORZ) - tmp = gtk_hpaned_new(); - else - tmp = gtk_vpaned_new(); - gtk_paned_add1(GTK_PANED(tmp), topleft); - gtk_paned_add2(GTK_PANED(tmp), bottomright); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", (gpointer)id); - *percent = 50.0; - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_percent", (gpointer)percent); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_waiting", (gpointer)1); - gtk_signal_connect(GTK_OBJECT(tmp), "size-allocate", GTK_SIGNAL_FUNC(_splitbar_size_allocate), NULL); -#if GTK_MAJOR_VERSION > 1 - g_signal_connect(G_OBJECT(tmp), "notify::position", (GCallback)_splitbar_accept_position, (gpointer)tmp); + GtkWidget *tmp = NULL; + int _locked_by_me = FALSE; + float *percent = malloc(sizeof(float)); + + DW_MUTEX_LOCK; + if(type == DW_HORZ) + tmp = gtk_hpaned_new(); + else + tmp = gtk_vpaned_new(); + gtk_paned_add1(GTK_PANED(tmp), topleft); + gtk_paned_add2(GTK_PANED(tmp), bottomright); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", GINT_TO_POINTER(id)); + *percent = 50.0; + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_percent", (gpointer)percent); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_waiting", GINT_TO_POINTER(1)); + gtk_signal_connect(GTK_OBJECT(tmp), "size-allocate", GTK_SIGNAL_FUNC(_splitbar_size_allocate), NULL); +#if GTK_MAJOR_VERSION > 1 + g_signal_connect(G_OBJECT(tmp), "notify::position", (GCallback)_splitbar_accept_position, (gpointer)tmp); #else - gtk_paned_set_handle_size(GTK_PANED(tmp), 3); -#endif - gtk_widget_show(tmp); - DW_MUTEX_UNLOCK; - return tmp; + gtk_paned_set_handle_size(GTK_PANED(tmp), 3); +#endif + gtk_widget_show(tmp); + DW_MUTEX_UNLOCK; + return tmp; } /* @@ -9703,23 +9746,23 @@ */ void dw_splitbar_set(HWND handle, float percent) { - float *mypercent = (float *)dw_window_get_data(handle, "_dw_percent"); - int size = 0, position; - - if(GTK_IS_VPANED(handle)) - size = handle->allocation.height; - else if(GTK_IS_HPANED(handle)) - size = handle->allocation.width; - - if(mypercent) - *mypercent = percent; - - if(size > 10) - { - position = (int)((float)size * (percent / 100.0)); - - gtk_paned_set_position(GTK_PANED(handle), position); - } + float *mypercent = (float *)dw_window_get_data(handle, "_dw_percent"); + int size = 0, position; + + if(GTK_IS_VPANED(handle)) + size = handle->allocation.height; + else if(GTK_IS_HPANED(handle)) + size = handle->allocation.width; + + if(mypercent) + *mypercent = percent; + + if(size > 10) + { + position = (int)((float)size * (percent / 100.0)); + + gtk_paned_set_position(GTK_PANED(handle), position); + } } /* @@ -9729,11 +9772,11 @@ */ float dw_splitbar_get(HWND handle) { - float *percent = (float *)dw_window_get_data(handle, "_dw_percent"); - - if(percent) - return *percent; - return 0.0; + float *percent = (float *)dw_window_get_data(handle, "_dw_percent"); + + if(percent) + return *percent; + return 0.0; } /* @@ -9745,26 +9788,26 @@ */ HWND dw_calendar_new(unsigned long id) { - GtkWidget *tmp; - int _locked_by_me = FALSE; - GtkCalendarDisplayOptions flags; - time_t now; - struct tm *tmdata; - - DW_MUTEX_LOCK; - tmp = gtk_calendar_new(); - gtk_widget_show(tmp); - gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", (gpointer)id); - /* select today */ - flags = GTK_CALENDAR_WEEK_START_MONDAY|GTK_CALENDAR_SHOW_HEADING|GTK_CALENDAR_SHOW_DAY_NAMES; - gtk_calendar_display_options( GTK_CALENDAR(tmp), flags ); - now = time( NULL ); - tmdata = localtime( & now ); - gtk_calendar_select_month( GTK_CALENDAR(tmp), tmdata->tm_mon, 1900+tmdata->tm_year ); - gtk_calendar_select_day( GTK_CALENDAR(tmp), tmdata->tm_mday ); - - DW_MUTEX_UNLOCK; - return tmp; + GtkWidget *tmp; + int _locked_by_me = FALSE; + GtkCalendarDisplayOptions flags; + time_t now; + struct tm *tmdata; + + DW_MUTEX_LOCK; + tmp = gtk_calendar_new(); + gtk_widget_show(tmp); + gtk_object_set_data(GTK_OBJECT(tmp), "_dw_id", GINT_TO_POINTER(id)); + /* select today */ + flags = GTK_CALENDAR_WEEK_START_MONDAY|GTK_CALENDAR_SHOW_HEADING|GTK_CALENDAR_SHOW_DAY_NAMES; + gtk_calendar_display_options( GTK_CALENDAR(tmp), flags ); + now = time( NULL ); + tmdata = localtime( & now ); + gtk_calendar_select_month( GTK_CALENDAR(tmp), tmdata->tm_mon, 1900+tmdata->tm_year ); + gtk_calendar_select_day( GTK_CALENDAR(tmp), tmdata->tm_mday ); + + DW_MUTEX_UNLOCK; + return tmp; } /* @@ -9775,16 +9818,16 @@ */ void dw_calendar_set_date(HWND handle, unsigned int year, unsigned int month, unsigned int day) { - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - if(GTK_IS_CALENDAR(handle)) - { - gtk_calendar_select_month(GTK_CALENDAR(handle),month-1,year); - gtk_calendar_select_day(GTK_CALENDAR(handle), day); - } - DW_MUTEX_UNLOCK; - return; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + if(GTK_IS_CALENDAR(handle)) + { + gtk_calendar_select_month(GTK_CALENDAR(handle),month-1,year); + gtk_calendar_select_day(GTK_CALENDAR(handle), day); + } + DW_MUTEX_UNLOCK; + return; } /* @@ -9794,16 +9837,16 @@ */ void dw_calendar_get_date(HWND handle, unsigned int *year, unsigned int *month, unsigned int *day) { - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - if(GTK_IS_CALENDAR(handle)) - { - gtk_calendar_get_date(GTK_CALENDAR(handle),year,month,day); - *month = *month + 1; - } - DW_MUTEX_UNLOCK; - return; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + if(GTK_IS_CALENDAR(handle)) + { + gtk_calendar_get_date(GTK_CALENDAR(handle),year,month,day); + *month = *month + 1; + } + DW_MUTEX_UNLOCK; + return; } /* @@ -9819,143 +9862,145 @@ */ void dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad) { - int warn = FALSE, _locked_by_me = FALSE; - GtkWidget *tmp, *tmpitem; - - if(!box) - return; - - /* - * If you try and pack an item into itself VERY bad things can happen; like at least an - * infinite loop on GTK! Lets be safe! - */ - if(box == item) - { - dw_messagebox("dw_box_pack_start()", DW_MB_OK|DW_MB_ERROR, "Danger! Danger! Will Robinson; box and item are the same!"); - return; - } - - DW_MUTEX_LOCK; - - if((tmp = gtk_object_get_data(GTK_OBJECT(box), "_dw_boxhandle"))) - box = tmp; - - if(!item) - { - item = gtk_label_new(""); - gtk_widget_show_all(item); - } - - tmpitem = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(item), "_dw_boxhandle"); - - if(GTK_IS_TABLE(box)) - { - int boxcount = (int)gtk_object_get_data(GTK_OBJECT(box), "_dw_boxcount"); - int boxtype = (int)gtk_object_get_data(GTK_OBJECT(box), "_dw_boxtype"); - int x, y; - - /* If the item being packed is a box, then we use it's padding - * instead of the padding specified on the pack line, this is - * due to a bug in the OS/2 and Win32 renderer and a limitation - * of the GtkTable class. - */ - if(GTK_IS_TABLE(item) || (tmpitem && GTK_IS_TABLE(tmpitem))) - { - GtkWidget *eventbox = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(item), "_dw_eventbox"); - - /* NOTE: I left in the ability to pack boxes with a size, - * this eliminates that by forcing the size to 0. - */ - height = width = 0; - - if(eventbox) - { - int boxpad = (int)gtk_object_get_data(GTK_OBJECT(item), "_dw_boxpad"); - gtk_container_add(GTK_CONTAINER(eventbox), item); - gtk_container_border_width(GTK_CONTAINER(eventbox), boxpad); - item = eventbox; - } - } - else - { - /* Only show warning if item is not a box */ - warn = TRUE; - } - - if(boxtype == DW_VERT) - { - x = 0; - y = boxcount; - gtk_table_resize(GTK_TABLE(box), boxcount + 1, 1); - } - else - { - x = boxcount; - y = 0; - gtk_table_resize(GTK_TABLE(box), 1, boxcount + 1); - } - - gtk_table_attach(GTK_TABLE(box), item, x, x + 1, y, y + 1, hsize ? DW_EXPAND : 0, vsize ? DW_EXPAND : 0, pad, pad); - gtk_object_set_data(GTK_OBJECT(box), "_dw_boxcount", (gpointer)boxcount + 1); - gtk_widget_set_usize(item, width, height); - if(GTK_IS_RADIO_BUTTON(item)) - { - GSList *group; - GtkWidget *groupstart = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(box), "_dw_group"); - - if(groupstart) - { - group = gtk_radio_button_group(GTK_RADIO_BUTTON(groupstart)); - gtk_radio_button_set_group(GTK_RADIO_BUTTON(item), group); - } - else - gtk_object_set_data(GTK_OBJECT(box), "_dw_group", (gpointer)item); - } - } - else - { - GtkWidget *vbox = gtk_vbox_new(FALSE, 0); - - if(GTK_IS_TABLE(item) || (tmpitem && GTK_IS_TABLE(tmpitem))) - { - GtkWidget *eventbox = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(item), "_dw_eventbox"); - - /* NOTE: I left in the ability to pack boxes with a size, - * this eliminates that by forcing the size to 0. - */ - height = width = 0; - - if(eventbox) - { - int boxpad = (int)gtk_object_get_data(GTK_OBJECT(item), "_dw_boxpad"); - gtk_container_add(GTK_CONTAINER(eventbox), item); - gtk_container_border_width(GTK_CONTAINER(eventbox), boxpad); - item = eventbox; - } - } - else - { - /* Only show warning if item is not a box */ - warn = TRUE; - } - - gtk_container_border_width(GTK_CONTAINER(box), pad); - gtk_container_add(GTK_CONTAINER(box), vbox); - gtk_box_pack_end(GTK_BOX(vbox), item, TRUE, TRUE, 0); - gtk_widget_show(vbox); - - gtk_widget_set_usize(item, width, height); - gtk_object_set_user_data(GTK_OBJECT(box), vbox); - } - DW_MUTEX_UNLOCK; - - if(warn) - { - if ( width == 0 && hsize == FALSE ) - dw_messagebox("dw_box_pack_start()", DW_MB_OK|DW_MB_ERROR, "Width and expand Horizonal both unset for box: %x item: %x",box,item); - if ( height == 0 && vsize == FALSE ) - dw_messagebox("dw_box_pack_start()", DW_MB_OK|DW_MB_ERROR, "Height and expand Vertical both unset for box: %x item: %x",box,item); - } + int warn = FALSE, _locked_by_me = FALSE; + GtkWidget *tmp, *tmpitem; + + if ( !box ) + return; + + /* + * If you try and pack an item into itself VERY bad things can happen; like at least an + * infinite loop on GTK! Lets be safe! + */ + if ( box == item ) + { + dw_messagebox( "dw_box_pack_start()", DW_MB_OK|DW_MB_ERROR, "Danger! Danger! Will Robinson; box and item are the same!" ); + return; + } + + DW_MUTEX_LOCK; + + if ((tmp = gtk_object_get_data(GTK_OBJECT(box), "_dw_boxhandle"))) + box = tmp; + + if (!item) + { + item = gtk_label_new(""); + gtk_widget_show_all(item); + } + + tmpitem = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(item), "_dw_boxhandle"); + + if (GTK_IS_TABLE(box)) + { + int boxcount = (int)gtk_object_get_data(GTK_OBJECT(box), "_dw_boxcount"); + int boxtype = (int)gtk_object_get_data(GTK_OBJECT(box), "_dw_boxtype"); + int x, y; + + /* If the item being packed is a box, then we use it's padding + * instead of the padding specified on the pack line, this is + * due to a bug in the OS/2 and Win32 renderer and a limitation + * of the GtkTable class. + */ + if (GTK_IS_TABLE(item) || (tmpitem && GTK_IS_TABLE(tmpitem))) + { + GtkWidget *eventbox = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(item), "_dw_eventbox"); + + /* NOTE: I left in the ability to pack boxes with a size, + * this eliminates that by forcing the size to 0. + */ + height = width = 0; + + if (eventbox) + { + int boxpad = (int)gtk_object_get_data(GTK_OBJECT(item), "_dw_boxpad"); + gtk_container_add(GTK_CONTAINER(eventbox), item); + gtk_container_border_width(GTK_CONTAINER(eventbox), boxpad); + item = eventbox; + } + } + else + { + /* Only show warning if item is not a box */ + warn = TRUE; + } + + if (boxtype == DW_VERT) + { + x = 0; + y = boxcount; + gtk_table_resize(GTK_TABLE(box), boxcount + 1, 1); + } + else + { + x = boxcount; + y = 0; + gtk_table_resize(GTK_TABLE(box), 1, boxcount + 1); + } + + gtk_table_attach(GTK_TABLE(box), item, x, x + 1, y, y + 1, hsize ? DW_EXPAND : 0, vsize ? DW_EXPAND : 0, pad, pad); + gtk_object_set_data(GTK_OBJECT(box), "_dw_boxcount", GINT_TO_POINTER(boxcount + 1)); + gtk_widget_set_usize(item, width, height); + if (GTK_IS_RADIO_BUTTON(item)) + { + GSList *group; + GtkWidget *groupstart = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(box), "_dw_group"); + + if (groupstart) + { + group = gtk_radio_button_group(GTK_RADIO_BUTTON(groupstart)); + gtk_radio_button_set_group(GTK_RADIO_BUTTON(item), group); + } + else + { + gtk_object_set_data(GTK_OBJECT(box), "_dw_group", (gpointer)item); + } + } + } + else + { + GtkWidget *vbox = gtk_vbox_new(FALSE, 0); + + if (GTK_IS_TABLE(item) || (tmpitem && GTK_IS_TABLE(tmpitem))) + { + GtkWidget *eventbox = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(item), "_dw_eventbox"); + + /* NOTE: I left in the ability to pack boxes with a size, + * this eliminates that by forcing the size to 0. + */ + height = width = 0; + + if (eventbox) + { + int boxpad = (int)gtk_object_get_data(GTK_OBJECT(item), "_dw_boxpad"); + gtk_container_add(GTK_CONTAINER(eventbox), item); + gtk_container_border_width(GTK_CONTAINER(eventbox), boxpad); + item = eventbox; + } + } + else + { + /* Only show warning if item is not a box */ + warn = TRUE; + } + + gtk_container_border_width(GTK_CONTAINER(box), pad); + gtk_container_add(GTK_CONTAINER(box), vbox); + gtk_box_pack_end(GTK_BOX(vbox), item, TRUE, TRUE, 0); + gtk_widget_show(vbox); + + gtk_widget_set_usize(item, width, height); + gtk_object_set_user_data(GTK_OBJECT(box), vbox); + } + DW_MUTEX_UNLOCK; + + if (warn) + { + if ( width == 0 && hsize == FALSE ) + dw_messagebox("dw_box_pack_start()", DW_MB_OK|DW_MB_ERROR, "Width and expand Horizonal both unset for box: %x item: %x",box,item); + if ( height == 0 && vsize == FALSE ) + dw_messagebox("dw_box_pack_start()", DW_MB_OK|DW_MB_ERROR, "Height and expand Vertical both unset for box: %x item: %x",box,item); + } } /* @@ -9966,14 +10011,14 @@ */ void dw_window_default(HWND window, HWND defaultitem) { - int _locked_by_me = FALSE; - - if(!window) - return; - - DW_MUTEX_LOCK; - gtk_object_set_data(GTK_OBJECT(window), "_dw_defaultitem", (gpointer)defaultitem); - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; + + if(!window) + return; + + DW_MUTEX_LOCK; + gtk_object_set_data(GTK_OBJECT(window), "_dw_defaultitem", (gpointer)defaultitem); + DW_MUTEX_UNLOCK; } /* @@ -9984,14 +10029,14 @@ */ void dw_window_click_default(HWND window, HWND next) { - int _locked_by_me = FALSE; - - if(!window) - return; - - DW_MUTEX_LOCK; - gtk_signal_connect(GTK_OBJECT(window), "key_press_event", GTK_SIGNAL_FUNC(_default_key_press_event), next); - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; + + if(!window) + return; + + DW_MUTEX_LOCK; + gtk_signal_connect(GTK_OBJECT(window), "key_press_event", GTK_SIGNAL_FUNC(_default_key_press_event), next); + DW_MUTEX_UNLOCK; } /* @@ -10001,200 +10046,200 @@ */ void dw_environment_query(DWEnv *env) { - struct utsname name; - char tempbuf[100]; - int len, z; - - uname(&name); - strcpy(env->osName, name.sysname); - strcpy(tempbuf, name.release); - - env->MajorBuild = env->MinorBuild = 0; - - len = strlen(tempbuf); - - strcpy(env->buildDate, __DATE__); - strcpy(env->buildTime, __TIME__); - env->DWMajorVersion = DW_MAJOR_VERSION; - env->DWMinorVersion = DW_MINOR_VERSION; - env->DWSubVersion = DW_SUB_VERSION; - - for(z=1;zMajorVersion = atoi(&tempbuf[z-1]); - env->MinorVersion = atoi(&tempbuf[z+1]); - return; - } - } - env->MajorVersion = atoi(tempbuf); - env->MinorVersion = 0; + struct utsname name; + char tempbuf[100]; + int len, z; + + uname(&name); + strcpy(env->osName, name.sysname); + strcpy(tempbuf, name.release); + + env->MajorBuild = env->MinorBuild = 0; + + len = strlen(tempbuf); + + strcpy(env->buildDate, __DATE__); + strcpy(env->buildTime, __TIME__); + env->DWMajorVersion = DW_MAJOR_VERSION; + env->DWMinorVersion = DW_MINOR_VERSION; + env->DWSubVersion = DW_SUB_VERSION; + + for(z=1;zMajorVersion = atoi(&tempbuf[z-1]); + env->MinorVersion = atoi(&tempbuf[z+1]); + return; + } + } + env->MajorVersion = atoi(tempbuf); + env->MinorVersion = 0; } /* Internal function to handle the file OK press */ static gint _gtk_file_ok(GtkWidget *widget, DWDialog *dwwait) { #if GTK_MAJOR_VERSION > 1 - const char *tmp; + const char *tmp; #else - char *tmp; -#endif - char *tmpdup=NULL; - - if(!dwwait) - return FALSE; - - if((tmp = gtk_file_selection_get_filename(GTK_FILE_SELECTION(dwwait->data)))) - tmpdup = strdup(tmp); - gtk_widget_destroy(GTK_WIDGET(dwwait->data)); - _dw_file_active = 0; - dw_dialog_dismiss(dwwait, (void *)tmpdup); - return FALSE; + char *tmp; +#endif + char *tmpdup=NULL; + + if(!dwwait) + return FALSE; + + if((tmp = gtk_file_selection_get_filename(GTK_FILE_SELECTION(dwwait->data)))) + tmpdup = strdup(tmp); + gtk_widget_destroy(GTK_WIDGET(dwwait->data)); + _dw_file_active = 0; + dw_dialog_dismiss(dwwait, (void *)tmpdup); + return FALSE; } /* Internal function to handle the file Cancel press */ static gint _gtk_file_cancel(GtkWidget *widget, DWDialog *dwwait) { - if(!dwwait) - return FALSE; - - gtk_widget_destroy(GTK_WIDGET(dwwait->data)); - _dw_file_active = 0; - dw_dialog_dismiss(dwwait, NULL); - return FALSE; + if(!dwwait) + return FALSE; + + gtk_widget_destroy(GTK_WIDGET(dwwait->data)); + _dw_file_active = 0; + dw_dialog_dismiss(dwwait, NULL); + return FALSE; } /* The next few functions are support functions for the UNIX folder browser */ static void _populate_directory(HWND tree, HTREEITEM parent, char *path) { - struct dirent *dent; - HTREEITEM item; - DIR *hdir; - - if((hdir = opendir(path))) - { - while((dent = readdir(hdir))) - { - if(strcmp(dent->d_name, ".") && strcmp(dent->d_name, "..")) - { - int len = strlen(path); - char *folder = malloc(len + strlen(dent->d_name) + 2); - struct stat bleah; - HTREEITEM tempitem; - - strcpy(folder, path); - strcpy(&folder[len], dent->d_name); - - stat(folder, &bleah); - - if(S_IFDIR & bleah.st_mode) - { - item = dw_tree_insert(tree, dent->d_name, 0, parent, (void *)parent); - tempitem = dw_tree_insert(tree, "", 0, item, 0); - dw_tree_item_set_data(tree, item, (void *)tempitem); - } - - free(folder); - } - } - closedir(hdir); - } + struct dirent *dent; + HTREEITEM item; + DIR *hdir; + + if((hdir = opendir(path))) + { + while((dent = readdir(hdir))) + { + if(strcmp(dent->d_name, ".") && strcmp(dent->d_name, "..")) + { + int len = strlen(path); + char *folder = malloc(len + strlen(dent->d_name) + 2); + struct stat bleah; + HTREEITEM tempitem; + + strcpy(folder, path); + strcpy(&folder[len], dent->d_name); + + stat(folder, &bleah); + + if(S_IFDIR & bleah.st_mode) + { + item = dw_tree_insert(tree, dent->d_name, 0, parent, (void *)parent); + tempitem = dw_tree_insert(tree, "", 0, item, 0); + dw_tree_item_set_data(tree, item, (void *)tempitem); + } + + free(folder); + } + } + closedir(hdir); + } } static int DWSIGNAL _dw_folder_ok_func(HWND window, void *data) { - DWDialog *dwwait = (DWDialog *)data; - void *treedata; - - if(!dwwait) - return FALSE; - - treedata = dw_window_get_data((HWND)dwwait->data, "_dw_tree_selected"); - dw_window_destroy((HWND)dwwait->data); - dw_dialog_dismiss(dwwait, treedata); - return FALSE; + DWDialog *dwwait = (DWDialog *)data; + void *treedata; + + if(!dwwait) + return FALSE; + + treedata = dw_window_get_data((HWND)dwwait->data, "_dw_tree_selected"); + dw_window_destroy((HWND)dwwait->data); + dw_dialog_dismiss(dwwait, treedata); + return FALSE; } static int DWSIGNAL _dw_folder_cancel_func(HWND window, void *data) { - DWDialog *dwwait = (DWDialog *)data; - - if(!dwwait) - return FALSE; - - dw_window_destroy((HWND)dwwait->data); - dw_dialog_dismiss(dwwait, NULL); - return FALSE; + DWDialog *dwwait = (DWDialog *)data; + + if(!dwwait) + return FALSE; + + dw_window_destroy((HWND)dwwait->data); + dw_dialog_dismiss(dwwait, NULL); + return FALSE; } static char *_tree_folder(HWND tree, HTREEITEM item) { - char *folder=strdup(""); - HTREEITEM parent = item; - - while(parent) - { - char *temp, *text = dw_tree_get_title(tree, parent); - - if(text) - { - temp = malloc(strlen(text) + strlen(folder) + 3); - strcpy(temp, text); - if(strcmp(text, "/")) - strcat(temp, "/"); - strcat(temp, folder); - free(folder); - folder = temp; - } - parent = dw_tree_get_parent(tree, parent); - } - return folder; + char *folder=strdup(""); + HTREEITEM parent = item; + + while(parent) + { + char *temp, *text = dw_tree_get_title(tree, parent); + + if(text) + { + temp = malloc(strlen(text) + strlen(folder) + 3); + strcpy(temp, text); + if(strcmp(text, "/")) + strcat(temp, "/"); + strcat(temp, folder); + free(folder); + folder = temp; + } + parent = dw_tree_get_parent(tree, parent); + } + return folder; } static int DWSIGNAL _item_select(HWND window, HTREEITEM item, char *text, void *data, void *itemdata) { - DWDialog *dwwait = (DWDialog *)data; - char *treedata = (char *)dw_window_get_data((HWND)dwwait->data, "_dw_tree_selected"); - - text = text; itemdata = itemdata; - if(treedata) - free(treedata); - - treedata = _tree_folder(window, item); - dw_window_set_data((HWND)dwwait->data, "_dw_tree_selected", (void *)treedata); - - return FALSE; + DWDialog *dwwait = (DWDialog *)data; + char *treedata = (char *)dw_window_get_data((HWND)dwwait->data, "_dw_tree_selected"); + + text = text; itemdata = itemdata; + if(treedata) + free(treedata); + + treedata = _tree_folder(window, item); + dw_window_set_data((HWND)dwwait->data, "_dw_tree_selected", (void *)treedata); + + return FALSE; } static int DWSIGNAL _tree_expand(HWND window, HTREEITEM item, void *data) { - DWDialog *dwwait = (DWDialog *)data; - HWND tree = (HWND)dw_window_get_data((HWND)dwwait->data, "_dw_tree"); - HTREEITEM tempitem = (HTREEITEM)dw_tree_item_get_data(tree, item); - - if(tempitem) - { - char *folder = _tree_folder(tree, item); - - dw_tree_item_set_data(tree, item, 0); - - if(*folder) - _populate_directory(tree, item, folder); - -#if GTK_MAJOR_VERSION > 1 - /* FIXME: GTK 1.x tree control goes crazy when - * I delete the temporary item. The subtree - * it sits on ceases to be valid and attempts - * to delete or recreate it fail horribly. - */ - dw_tree_item_delete(tree, tempitem); -#endif - free(folder); - } - - return FALSE; + DWDialog *dwwait = (DWDialog *)data; + HWND tree = (HWND)dw_window_get_data((HWND)dwwait->data, "_dw_tree"); + HTREEITEM tempitem = (HTREEITEM)dw_tree_item_get_data(tree, item); + + if(tempitem) + { + char *folder = _tree_folder(tree, item); + + dw_tree_item_set_data(tree, item, 0); + + if(*folder) + _populate_directory(tree, item, folder); + +#if GTK_MAJOR_VERSION > 1 + /* FIXME: GTK 1.x tree control goes crazy when + * I delete the temporary item. The subtree + * it sits on ceases to be valid and attempts + * to delete or recreate it fail horribly. + */ + dw_tree_item_delete(tree, tempitem); +#endif + free(folder); + } + + return FALSE; } /* @@ -10211,80 +10256,80 @@ */ char *dw_file_browse(char *title, char *defpath, char *ext, int flags) { - GtkWidget *filew; - int _locked_by_me = FALSE; - DWDialog *dwwait; - - if(flags == DW_DIRECTORY_OPEN) - { - HWND window, hbox, vbox, tree, button; - HTREEITEM item, tempitem; - - window = dw_window_new( HWND_DESKTOP, title, DW_FCF_SHELLPOSITION | DW_FCF_TITLEBAR | DW_FCF_SIZEBORDER | DW_FCF_MINMAX); - - vbox = dw_box_new(DW_VERT, 5); - - dw_box_pack_start(window, vbox, 0, 0, TRUE, TRUE, 0); - - tree = dw_tree_new(60); - - dw_box_pack_start(vbox, tree, 1, 1, TRUE, TRUE, 0); - dw_window_set_data(window, "_dw_tree", (void *)tree); - - hbox = dw_box_new(DW_HORZ, 0); - - dw_box_pack_start(vbox, hbox, 0, 0, TRUE, FALSE, 0); - - dwwait = dw_dialog_new((void *)window); - - dw_signal_connect(tree, DW_SIGNAL_ITEM_SELECT, DW_SIGNAL_FUNC(_item_select), (void *)dwwait); - dw_signal_connect(tree, DW_SIGNAL_TREE_EXPAND, DW_SIGNAL_FUNC(_tree_expand), (void *)dwwait); - - button = dw_button_new("Ok", 1001L); - dw_box_pack_start(hbox, button, 50, 30, TRUE, FALSE, 3); - dw_signal_connect(button, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(_dw_folder_ok_func), (void *)dwwait); - - button = dw_button_new("Cancel", 1002L); - dw_box_pack_start(hbox, button, 50, 30, TRUE, FALSE, 3); - dw_signal_connect(button, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(_dw_folder_cancel_func), (void *)dwwait); - - item = dw_tree_insert(tree, "/", 0, NULL, 0); - tempitem = dw_tree_insert(tree, "", 0, item, 0); - dw_tree_item_set_data(tree, item, (void *)tempitem); - - dw_window_set_size(window, 225, 300); - dw_window_show(window); - } - else - { - DW_MUTEX_LOCK; - - /* The DW mutex should be sufficient for - * insuring no thread changes this unknowingly. - */ - if(_dw_file_active) - { - DW_MUTEX_UNLOCK; - return NULL; - } - - _dw_file_active = 1; - - filew = gtk_file_selection_new(title); - - dwwait = dw_dialog_new((void *)filew); - - gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(filew)->ok_button), "clicked", (GtkSignalFunc) _gtk_file_ok, dwwait); - gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(filew)->cancel_button), "clicked", (GtkSignalFunc) _gtk_file_cancel, dwwait); - - if(defpath) - gtk_file_selection_set_filename(GTK_FILE_SELECTION(filew), defpath); - - gtk_widget_show(filew); - - DW_MUTEX_UNLOCK; - } - return (char *)dw_dialog_wait(dwwait); + GtkWidget *filew; + int _locked_by_me = FALSE; + DWDialog *dwwait; + + if(flags == DW_DIRECTORY_OPEN) + { + HWND window, hbox, vbox, tree, button; + HTREEITEM item, tempitem; + + window = dw_window_new( HWND_DESKTOP, title, DW_FCF_SHELLPOSITION | DW_FCF_TITLEBAR | DW_FCF_SIZEBORDER | DW_FCF_MINMAX); + + vbox = dw_box_new(DW_VERT, 5); + + dw_box_pack_start(window, vbox, 0, 0, TRUE, TRUE, 0); + + tree = dw_tree_new(60); + + dw_box_pack_start(vbox, tree, 1, 1, TRUE, TRUE, 0); + dw_window_set_data(window, "_dw_tree", (void *)tree); + + hbox = dw_box_new(DW_HORZ, 0); + + dw_box_pack_start(vbox, hbox, 0, 0, TRUE, FALSE, 0); + + dwwait = dw_dialog_new((void *)window); + + dw_signal_connect(tree, DW_SIGNAL_ITEM_SELECT, DW_SIGNAL_FUNC(_item_select), (void *)dwwait); + dw_signal_connect(tree, DW_SIGNAL_TREE_EXPAND, DW_SIGNAL_FUNC(_tree_expand), (void *)dwwait); + + button = dw_button_new("Ok", 1001L); + dw_box_pack_start(hbox, button, 50, 30, TRUE, FALSE, 3); + dw_signal_connect(button, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(_dw_folder_ok_func), (void *)dwwait); + + button = dw_button_new("Cancel", 1002L); + dw_box_pack_start(hbox, button, 50, 30, TRUE, FALSE, 3); + dw_signal_connect(button, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(_dw_folder_cancel_func), (void *)dwwait); + + item = dw_tree_insert(tree, "/", 0, NULL, 0); + tempitem = dw_tree_insert(tree, "", 0, item, 0); + dw_tree_item_set_data(tree, item, (void *)tempitem); + + dw_window_set_size(window, 225, 300); + dw_window_show(window); + } + else + { + DW_MUTEX_LOCK; + + /* The DW mutex should be sufficient for + * insuring no thread changes this unknowingly. + */ + if(_dw_file_active) + { + DW_MUTEX_UNLOCK; + return NULL; + } + + _dw_file_active = 1; + + filew = gtk_file_selection_new(title); + + dwwait = dw_dialog_new((void *)filew); + + gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(filew)->ok_button), "clicked", (GtkSignalFunc) _gtk_file_ok, dwwait); + gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(filew)->cancel_button), "clicked", (GtkSignalFunc) _gtk_file_cancel, dwwait); + + if(defpath) + gtk_file_selection_set_filename(GTK_FILE_SELECTION(filew), defpath); + + gtk_widget_show(filew); + + DW_MUTEX_UNLOCK; + } + return (char *)dw_dialog_wait(dwwait); } @@ -10299,54 +10344,54 @@ */ int dw_exec(char *program, int type, char **params) { - int ret = -1; - - if((ret = fork()) == 0) - { - int i; - - for (i = 3; i < 256; i++) - close(i); - setsid(); - if(type == DW_EXEC_GUI) - { - execvp(program, params); - } - else if(type == DW_EXEC_CON) - { - char **tmpargs; - - if(!params) - { - tmpargs = malloc(sizeof(char *)); - tmpargs[0] = NULL; - } - else - { - int z = 0; - - while(params[z]) - { - z++; - } - tmpargs = malloc(sizeof(char *)*(z+3)); - z=0; - tmpargs[0] = "xterm"; - tmpargs[1] = "-e"; - while(params[z]) - { - tmpargs[z+2] = params[z]; - z++; - } - tmpargs[z+2] = NULL; - } - execvp("xterm", tmpargs); - free(tmpargs); - } - /* If we got here exec failed */ - _exit(-1); - } - return ret; + int ret = -1; + + if((ret = fork()) == 0) + { + int i; + + for (i = 3; i < 256; i++) + close(i); + setsid(); + if(type == DW_EXEC_GUI) + { + execvp(program, params); + } + else if(type == DW_EXEC_CON) + { + char **tmpargs; + + if(!params) + { + tmpargs = malloc(sizeof(char *)); + tmpargs[0] = NULL; + } + else + { + int z = 0; + + while(params[z]) + { + z++; + } + tmpargs = malloc(sizeof(char *)*(z+3)); + z=0; + tmpargs[0] = "xterm"; + tmpargs[1] = "-e"; + while(params[z]) + { + tmpargs[z+2] = params[z]; + z++; + } + tmpargs[z+2] = NULL; + } + execvp("xterm", tmpargs); + free(tmpargs); + } + /* If we got here exec failed */ + _exit(-1); + } + return ret; } /* @@ -10356,16 +10401,16 @@ */ int dw_browse(char *url) { - /* Is there a way to find the webbrowser in Unix? */ - char *execargs[3], *browser = "netscape", *tmp; - - tmp = getenv( "DW_BROWSER" ); - if(tmp) browser = tmp; - execargs[0] = browser; - execargs[1] = url; - execargs[2] = NULL; - - return dw_exec(browser, DW_EXEC_GUI, execargs); + /* Is there a way to find the webbrowser in Unix? */ + char *execargs[3], *browser = "netscape", *tmp; + + tmp = getenv( "DW_BROWSER" ); + if(tmp) browser = tmp; + execargs[0] = browser; + execargs[1] = url; + execargs[2] = NULL; + + return dw_exec(browser, DW_EXEC_GUI, execargs); } /* @@ -10377,31 +10422,31 @@ void dw_html_action(HWND handle, int action) { #ifdef USE_GTKMOZEMBED - int _locked_by_me = FALSE; - - if(!_gtk_moz_embed_new) - return; - - DW_MUTEX_LOCK; - switch(action) - { - case DW_HTML_GOBACK: - _gtk_moz_embed_go_back(GTK_MOZ_EMBED(handle)); - break; - case DW_HTML_GOFORWARD: - _gtk_moz_embed_go_forward(GTK_MOZ_EMBED(handle)); - break; - case DW_HTML_GOHOME: - _gtk_moz_embed_load_url(GTK_MOZ_EMBED(handle), "http://dwindows.netlabs.org"); - break; - case DW_HTML_RELOAD: - _gtk_moz_embed_reload(GTK_MOZ_EMBED(handle), 0); - break; - case DW_HTML_STOP: - _gtk_moz_embed_stop_load(GTK_MOZ_EMBED(handle)); - break; - } - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; + + if(!_gtk_moz_embed_new) + return; + + DW_MUTEX_LOCK; + switch(action) + { + case DW_HTML_GOBACK: + _gtk_moz_embed_go_back(GTK_MOZ_EMBED(handle)); + break; + case DW_HTML_GOFORWARD: + _gtk_moz_embed_go_forward(GTK_MOZ_EMBED(handle)); + break; + case DW_HTML_GOHOME: + _gtk_moz_embed_load_url(GTK_MOZ_EMBED(handle), "http://dwindows.netlabs.org"); + break; + case DW_HTML_RELOAD: + _gtk_moz_embed_reload(GTK_MOZ_EMBED(handle), 0); + break; + case DW_HTML_STOP: + _gtk_moz_embed_stop_load(GTK_MOZ_EMBED(handle)); + break; + } + DW_MUTEX_UNLOCK; #endif } @@ -10417,17 +10462,17 @@ int dw_html_raw(HWND handle, char *string) { #ifdef USE_GTKMOZEMBED - int _locked_by_me = FALSE; - - if(!_gtk_moz_embed_new) - return -1; - - DW_MUTEX_LOCK; - _gtk_moz_embed_render_data(GTK_MOZ_EMBED(handle), string, strlen(string), "", ""); - DW_MUTEX_UNLOCK; - return 0; -#endif - return -1; + int _locked_by_me = FALSE; + + if(!_gtk_moz_embed_new) + return -1; + + DW_MUTEX_LOCK; + _gtk_moz_embed_render_data(GTK_MOZ_EMBED(handle), string, strlen(string), "", ""); + DW_MUTEX_UNLOCK; + return 0; +#endif + return -1; } /* @@ -10442,18 +10487,108 @@ int dw_html_url(HWND handle, char *url) { #ifdef USE_GTKMOZEMBED - int _locked_by_me = FALSE; - - if(!_gtk_moz_embed_new) - return -1; - - DW_MUTEX_LOCK; - _gtk_moz_embed_load_url(GTK_MOZ_EMBED(handle), url); - DW_MUTEX_UNLOCK; - return 0; -#endif - return -1; -} + int _locked_by_me = FALSE; + + if (!_gtk_moz_embed_new) + return -1; + + DW_MUTEX_LOCK; + _gtk_moz_embed_load_url( GTK_MOZ_EMBED(handle), url ); + DW_MUTEX_UNLOCK; + return 0; +#endif + return -1; +} + +#ifdef USE_GTKMOZEMBED +/* + * Callback for a HTML widget when the "Forward" menu item is selected + */ +static int _dw_html_forward_callback(HWND window, void *data) +{ + HWND handle=(HWND)data; + dw_html_action( handle, DW_HTML_GOFORWARD ); + return TRUE; +} + +/* + * Callback for a HTML widget when the "Back" menu item is selected + */ +static int _dw_html_backward_callback(HWND window, void *data) +{ + HWND handle=(HWND)data; + dw_html_action( handle, DW_HTML_GOBACK ); + return TRUE; +} + +/* + * Callback for a HTML widget when the "Reload" menu item is selected + */ +static int _dw_html_reload_callback(HWND window, void *data) +{ + HWND handle=(HWND)data; + dw_html_action( handle, DW_HTML_RELOAD ); + return TRUE; +} + +/* + * Callback for a HTML widget when a page has completed loading + * Once the page has finished loading, show the widget. + */ +void _dw_html_net_stop_cb( GtkMozEmbed *embed, gpointer data ) +{ + gtk_widget_show(GTK_WIDGET(data)); +} + +/* + * Callback for a HTML widget when a mouse button is clicked inside the widget + * If the right mouse button is clicked, popup a context menu + */ +static gint _dw_dom_mouse_click_cb (GtkMozEmbed *dummy, gpointer dom_event, gpointer embed) +{ + gint button,rc; + glong x,y; + int flags; + + button = mozilla_get_mouse_event_button( dom_event ); + if ( button == 2 ) + { + HWND menuitem; + HMENUI popup; + /* + * Right mouse button; display context menu + */ + rc = mozilla_get_mouse_location( dom_event, &x, &y); + popup = dw_menu_new( 0 ); + if ( _gtk_moz_embed_can_go_forward(GTK_MOZ_EMBED(embed) ) ) + flags = DW_MIS_ENABLED; + else + flags = DW_MIS_DISABLED; + menuitem = dw_menu_append_item( popup, "Forward", 1, flags, TRUE, FALSE, 0 ); + dw_signal_connect( menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(_dw_html_forward_callback), embed ); + + if ( _gtk_moz_embed_can_go_back(GTK_MOZ_EMBED(embed) ) ) + flags = DW_MIS_ENABLED; + else + flags = DW_MIS_DISABLED; + menuitem = dw_menu_append_item( popup, "Back", 2, flags, TRUE, FALSE, 0 ); + dw_signal_connect( menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(_dw_html_backward_callback), embed ); + + dw_menu_append_item( popup, DW_MENU_SEPARATOR, 99, 0, TRUE, FALSE, 0 ); + + menuitem = dw_menu_append_item( popup, "Reload", 3, 0, TRUE, FALSE, 0 ); + dw_signal_connect( menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(_dw_html_reload_callback), embed ); + + dw_menu_popup( &popup, embed, x, y ); + rc = TRUE; + } + else + { + rc = FALSE; + } + return rc; +} +#endif /* * Create a new Entryfield window (widget) to be packed. @@ -10463,20 +10598,33 @@ */ HWND dw_html_new(unsigned long id) { + GtkWidget *widget,*stext; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; #ifdef USE_GTKMOZEMBED - GtkWidget *widget; - int _locked_by_me = FALSE; - - if(!_gtk_moz_embed_new) - return NULL; - - DW_MUTEX_LOCK; - widget = _gtk_moz_embed_new(); - DW_MUTEX_UNLOCK; - return widget; + if (!_gtk_moz_embed_new) + { + widget = dw_box_new(DW_HORZ, 0); + stext = dw_text_new( "HTML widget not available; you do not have access to gtkmozembed.", 0); + dw_box_pack_start(widget, stext, 0, 0, TRUE, TRUE, 10); + } + else + { + widget = _gtk_moz_embed_new(); + /* + * Connect some signals + */ + gtk_signal_connect( GTK_OBJECT(widget), "net-stop", GTK_SIGNAL_FUNC(_dw_html_net_stop_cb), widget ); + gtk_signal_connect( GTK_OBJECT(widget), "dom_mouse_click", GTK_SIGNAL_FUNC(_dw_dom_mouse_click_cb), widget ); + } #else - return dw_box_new(DW_HORZ, 0); -#endif + widget = dw_box_new(DW_HORZ, 0); + stext = dw_text_new( "HTML widget not available; you do not have access to gtkmozembed.", 0); + dw_box_pack_start(widget, stext, 0, 0, TRUE, TRUE, 10); +#endif + DW_MUTEX_UNLOCK; + return widget; } /* @@ -10530,18 +10678,18 @@ */ char *dw_user_dir(void) { - static char _user_dir[1024] = ""; - - if(!_user_dir[0]) - { - char *home = getenv("HOME"); - - if(home) - strcpy(_user_dir, home); - else - strcpy(_user_dir, "/"); - } - return _user_dir; + static char _user_dir[1024] = ""; + + if(!_user_dir[0]) + { + char *home = getenv("HOME"); + + if(home) + strcpy(_user_dir, home); + else + strcpy(_user_dir, "/"); + } + return _user_dir; } /* @@ -10553,12 +10701,12 @@ */ void dw_window_function(HWND handle, void *function, void *data) { - void (* windowfunc)(void *); - - windowfunc = function; - - if(windowfunc) - windowfunc(data); + void (* windowfunc)(void *); + + windowfunc = function; + + if(windowfunc) + windowfunc(data); } /* @@ -10570,26 +10718,26 @@ */ void dw_window_set_data(HWND window, char *dataname, void *data) { - int _locked_by_me = FALSE; - - if(!window) - return; - - DW_MUTEX_LOCK; - if(GTK_IS_OBJECT(window)) - { - if(GTK_IS_SCROLLED_WINDOW(window)) - { - HWND thiswindow = (HWND)gtk_object_get_user_data(GTK_OBJECT(window)); - - if(thiswindow && GTK_IS_OBJECT(thiswindow)) - gtk_object_set_data(GTK_OBJECT(thiswindow), dataname, (gpointer)data); - } - if(GTK_IS_COMBO(window)) - gtk_object_set_data(GTK_OBJECT(GTK_COMBO(window)->entry), dataname, (gpointer)data); - gtk_object_set_data(GTK_OBJECT(window), dataname, (gpointer)data); - } - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; + + if(!window) + return; + + DW_MUTEX_LOCK; + if(GTK_IS_OBJECT(window)) + { + if(GTK_IS_SCROLLED_WINDOW(window)) + { + HWND thiswindow = (HWND)gtk_object_get_user_data(GTK_OBJECT(window)); + + if(thiswindow && GTK_IS_OBJECT(thiswindow)) + gtk_object_set_data(GTK_OBJECT(thiswindow), dataname, (gpointer)data); + } + if(GTK_IS_COMBO(window)) + gtk_object_set_data(GTK_OBJECT(GTK_COMBO(window)->entry), dataname, (gpointer)data); + gtk_object_set_data(GTK_OBJECT(window), dataname, (gpointer)data); + } + DW_MUTEX_UNLOCK; } /* @@ -10601,17 +10749,17 @@ */ void *dw_window_get_data(HWND window, char *dataname) { - int _locked_by_me = FALSE; - void *ret = NULL; - - if(!window) - return NULL; - - DW_MUTEX_LOCK; + int _locked_by_me = FALSE; + void *ret = NULL; + + if(!window) + return NULL; + + DW_MUTEX_LOCK; if(GTK_IS_OBJECT(window)) - ret = (void *)gtk_object_get_data(GTK_OBJECT(window), dataname); - DW_MUTEX_UNLOCK; - return ret; + ret = (void *)gtk_object_get_data(GTK_OBJECT(window), dataname); + DW_MUTEX_UNLOCK; + return ret; } /* @@ -10625,12 +10773,12 @@ */ int API dw_timer_connect(int interval, void *sigfunc, void *data) { - int tag, _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - tag = gtk_timeout_add(interval, (GtkFunction)sigfunc, data); - DW_MUTEX_UNLOCK; - return tag; + int tag, _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + tag = gtk_timeout_add(interval, (GtkFunction)sigfunc, data); + DW_MUTEX_UNLOCK; + return tag; } /* @@ -10640,11 +10788,11 @@ */ void API dw_timer_disconnect(int id) { - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - gtk_timeout_remove(id); - DW_MUTEX_UNLOCK; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + gtk_timeout_remove(id); + DW_MUTEX_UNLOCK; } /* Get the actual signal window handle not the user window handle @@ -10652,22 +10800,22 @@ */ static HWND _find_signal_window(HWND window, char *signame) { - HWND thiswindow = window; - - if(GTK_IS_SCROLLED_WINDOW(thiswindow)) - thiswindow = (HWND)gtk_object_get_user_data(GTK_OBJECT(window)); - else if(GTK_IS_COMBO(thiswindow) && signame && strcmp(signame, DW_SIGNAL_LIST_SELECT) == 0) - thiswindow = GTK_COMBO(thiswindow)->list; - else if(GTK_IS_COMBO(thiswindow) && signame && strcmp(signame, DW_SIGNAL_SET_FOCUS) == 0) - thiswindow = GTK_COMBO(thiswindow)->entry; - else if(GTK_IS_VSCALE(thiswindow) || GTK_IS_HSCALE(thiswindow) || - GTK_IS_VSCROLLBAR(thiswindow) || GTK_IS_HSCROLLBAR(thiswindow)) - thiswindow = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(thiswindow), "_dw_adjustment"); -#if GTK_MAJOR_VERSION > 1 - else if(GTK_IS_TREE_VIEW(thiswindow) && strcmp(signame, DW_SIGNAL_ITEM_SELECT) == 0) - thiswindow = (GtkWidget *)gtk_tree_view_get_selection(GTK_TREE_VIEW(thiswindow)); -#endif - return thiswindow; + HWND thiswindow = window; + + if(GTK_IS_SCROLLED_WINDOW(thiswindow)) + thiswindow = (HWND)gtk_object_get_user_data(GTK_OBJECT(window)); + else if(GTK_IS_COMBO(thiswindow) && signame && strcmp(signame, DW_SIGNAL_LIST_SELECT) == 0) + thiswindow = GTK_COMBO(thiswindow)->list; + else if(GTK_IS_COMBO(thiswindow) && signame && strcmp(signame, DW_SIGNAL_SET_FOCUS) == 0) + thiswindow = GTK_COMBO(thiswindow)->entry; + else if(GTK_IS_VSCALE(thiswindow) || GTK_IS_HSCALE(thiswindow) || + GTK_IS_VSCROLLBAR(thiswindow) || GTK_IS_HSCROLLBAR(thiswindow)) + thiswindow = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(thiswindow), "_dw_adjustment"); +#if GTK_MAJOR_VERSION > 1 + else if(GTK_IS_TREE_VIEW(thiswindow) && strcmp(signame, DW_SIGNAL_ITEM_SELECT) == 0) + thiswindow = (GtkWidget *)gtk_tree_view_get_selection(GTK_TREE_VIEW(thiswindow)); +#endif + return thiswindow; } /* @@ -10680,166 +10828,166 @@ */ void dw_signal_connect(HWND window, char *signame, void *sigfunc, void *data) { - void *thisfunc = _findsigfunc(signame); - char *thisname = signame; - HWND thiswindow = window; - int sigid, _locked_by_me = FALSE; - gint cid; - - DW_MUTEX_LOCK; + void *thisfunc = _findsigfunc(signame); + char *thisname = signame; + HWND thiswindow = window; + int sigid, _locked_by_me = FALSE; + gint cid; + + DW_MUTEX_LOCK; /* * If the window we are setting the signal on is a scrolled window we need to get * the "real" widget type. thiswindow is the "real" widget type */ - if(GTK_IS_SCROLLED_WINDOW(thiswindow)) - { - thiswindow = (HWND)gtk_object_get_user_data(GTK_OBJECT(window)); - } - - if(GTK_IS_MENU_ITEM(thiswindow) && strcmp(signame, DW_SIGNAL_CLICKED) == 0) - { - thisname = "activate"; - thisfunc = _findsigfunc(thisname); - } - else if(GTK_IS_CLIST(thiswindow) && strcmp(signame, DW_SIGNAL_ITEM_CONTEXT) == 0) - { - thisname = "button_press_event"; - thisfunc = _findsigfunc(DW_SIGNAL_ITEM_CONTEXT); - } -#if GTK_MAJOR_VERSION > 1 - else if(GTK_IS_TREE_VIEW(thiswindow) && strcmp(signame, DW_SIGNAL_ITEM_CONTEXT) == 0) - { - thisfunc = _findsigfunc("tree-context"); - - sigid = _set_signal_handler(thiswindow, window, sigfunc, data, thisfunc); - cid = gtk_signal_connect(GTK_OBJECT(thiswindow), "button_press_event", GTK_SIGNAL_FUNC(thisfunc), (gpointer)sigid); - _set_signal_handler_id(thiswindow, sigid, cid); + if (GTK_IS_SCROLLED_WINDOW(thiswindow)) + { + thiswindow = (HWND)gtk_object_get_user_data(GTK_OBJECT(window)); + } + + if (GTK_IS_MENU_ITEM(thiswindow) && strcmp(signame, DW_SIGNAL_CLICKED) == 0) + { + thisname = "activate"; + thisfunc = _findsigfunc(thisname); + } + else if (GTK_IS_CLIST(thiswindow) && strcmp(signame, DW_SIGNAL_ITEM_CONTEXT) == 0) + { + thisname = "button_press_event"; + thisfunc = _findsigfunc(DW_SIGNAL_ITEM_CONTEXT); + } +#if GTK_MAJOR_VERSION > 1 + else if (GTK_IS_TREE_VIEW(thiswindow) && strcmp(signame, DW_SIGNAL_ITEM_CONTEXT) == 0) + { + thisfunc = _findsigfunc("tree-context"); + + sigid = _set_signal_handler(thiswindow, window, sigfunc, data, thisfunc); + cid = gtk_signal_connect(GTK_OBJECT(thiswindow), "button_press_event", GTK_SIGNAL_FUNC(thisfunc), (gpointer)sigid); + _set_signal_handler_id(thiswindow, sigid, cid); #if 0 - sigid = _set_signal_handler(window, window, sigfunc, data, thisfunc); - cid = gtk_signal_connect(GTK_OBJECT(window), "button_press_event", GTK_SIGNAL_FUNC(thisfunc), (gpointer)sigid); - _set_signal_handler_id(window, sigid, cid); -#endif - - DW_MUTEX_UNLOCK; - return; - } - else if(GTK_IS_TREE_VIEW(thiswindow) && strcmp(signame, DW_SIGNAL_ITEM_SELECT) == 0) - { - GtkWidget *treeview = thiswindow; - - thiswindow = (GtkWidget *)gtk_tree_view_get_selection(GTK_TREE_VIEW(thiswindow)); - thisname = "changed"; - - sigid = _set_signal_handler(treeview, window, sigfunc, data, thisfunc); - cid = g_signal_connect(G_OBJECT(thiswindow), thisname, (GCallback)thisfunc, (gpointer)sigid); - _set_signal_handler_id(treeview, sigid, cid); - DW_MUTEX_UNLOCK; - return; - } - else if(GTK_IS_TREE_VIEW(thiswindow) && strcmp(signame, DW_SIGNAL_TREE_EXPAND) == 0) - { - thisname = "row-expanded"; - } + sigid = _set_signal_handler(window, window, sigfunc, data, thisfunc); + cid = gtk_signal_connect(GTK_OBJECT(window), "button_press_event", GTK_SIGNAL_FUNC(thisfunc), (gpointer)sigid); + _set_signal_handler_id(window, sigid, cid); +#endif + + DW_MUTEX_UNLOCK; + return; + } + else if (GTK_IS_TREE_VIEW(thiswindow) && strcmp(signame, DW_SIGNAL_ITEM_SELECT) == 0) + { + GtkWidget *treeview = thiswindow; + + thiswindow = (GtkWidget *)gtk_tree_view_get_selection(GTK_TREE_VIEW(thiswindow)); + thisname = "changed"; + + sigid = _set_signal_handler(treeview, window, sigfunc, data, thisfunc); + cid = g_signal_connect(G_OBJECT(thiswindow), thisname, (GCallback)thisfunc, (gpointer)sigid); + _set_signal_handler_id(treeview, sigid, cid); + DW_MUTEX_UNLOCK; + return; + } + else if (GTK_IS_TREE_VIEW(thiswindow) && strcmp(signame, DW_SIGNAL_TREE_EXPAND) == 0) + { + thisname = "row-expanded"; + } #else - else if(GTK_IS_TREE(thiswindow) && strcmp(signame, DW_SIGNAL_ITEM_CONTEXT) == 0) - { - thisfunc = _findsigfunc("tree-context"); - sigid = _set_signal_handler(thiswindow, window, sigfunc, data, thisfunc); - - gtk_object_set_data(GTK_OBJECT(thiswindow), "_dw_container_context_func", (gpointer)thisfunc); - gtk_object_set_data(GTK_OBJECT(thiswindow), "_dw_container_context_data", (gpointer)sigid); - cid = gtk_signal_connect(GTK_OBJECT(thiswindow), "button_press_event", GTK_SIGNAL_FUNC(thisfunc), (gpointer)sigid); - _set_signal_handler_id(thiswindow, sigid, cid); - sigid = _set_signal_handler(window, window, sigfunc, data, thisfunc); - cid = gtk_signal_connect(GTK_OBJECT(window), "button_press_event", GTK_SIGNAL_FUNC(thisfunc), (gpointer)sigid); - _set_signal_handler_id(window, sigid, cid); - DW_MUTEX_UNLOCK; - return; - } - else if(GTK_IS_TREE(thiswindow) && strcmp(signame, DW_SIGNAL_ITEM_SELECT) == 0) - { - if(thisfunc) - { - sigid = _set_signal_handler(thiswindow, window, sigfunc, data, thisfunc); - gtk_object_set_data(GTK_OBJECT(thiswindow), "_dw_select_child_func", (gpointer)thisfunc); - gtk_object_set_data(GTK_OBJECT(thiswindow), "_dw_select_child_data", (gpointer)sigid); - } - thisname = "select-child"; - } - else if(GTK_IS_TREE(thiswindow) && strcmp(signame, DW_SIGNAL_TREE_EXPAND) == 0) - { - if(thisfunc) - { - sigid = _set_signal_handler(thiswindow, window, sigfunc, data, thisfunc); - gtk_object_set_data(GTK_OBJECT(thiswindow), "_dw_tree_item_expand_func", (gpointer)thisfunc); - gtk_object_set_data(GTK_OBJECT(thiswindow), "_dw_tree_item_expand_data", (gpointer)sigid); - } - DW_MUTEX_UNLOCK; - return; - } -#endif - else if(GTK_IS_CLIST(thiswindow) && strcmp(signame, DW_SIGNAL_ITEM_ENTER) == 0) - { - sigid = _set_signal_handler(thiswindow, window, sigfunc, data, _container_enter_event); - cid = gtk_signal_connect(GTK_OBJECT(thiswindow), "key_press_event", GTK_SIGNAL_FUNC(_container_enter_event), (gpointer)sigid); - _set_signal_handler_id(thiswindow, sigid, cid); - - thisname = "button_press_event"; - thisfunc = _findsigfunc(DW_SIGNAL_ITEM_ENTER); - } - else if(GTK_IS_CLIST(thiswindow) && strcmp(signame, DW_SIGNAL_ITEM_SELECT) == 0) - { - thisname = "select_row"; - thisfunc = (void *)_container_select_row; - } - else if(GTK_IS_COMBO(thiswindow) && strcmp(signame, DW_SIGNAL_LIST_SELECT) == 0) - { - thisname = "select_child"; - thiswindow = GTK_COMBO(thiswindow)->list; - } - else if(GTK_IS_LIST(thiswindow) && strcmp(signame, DW_SIGNAL_LIST_SELECT) == 0) - { - thisname = "select_child"; - } - else if(strcmp(signame, DW_SIGNAL_SET_FOCUS) == 0) - { - thisname = "focus-in-event"; - if(GTK_IS_COMBO(thiswindow)) - thiswindow = GTK_COMBO(thiswindow)->entry; - } + else if (GTK_IS_TREE(thiswindow) && strcmp(signame, DW_SIGNAL_ITEM_CONTEXT) == 0) + { + thisfunc = _findsigfunc("tree-context"); + sigid = _set_signal_handler(thiswindow, window, sigfunc, data, thisfunc); + + gtk_object_set_data(GTK_OBJECT(thiswindow), "_dw_container_context_func", (gpointer)thisfunc); + gtk_object_set_data(GTK_OBJECT(thiswindow), "_dw_container_context_data", GINT_TO_POINTER(sigid)); + cid = gtk_signal_connect(GTK_OBJECT(thiswindow), "button_press_event", GTK_SIGNAL_FUNC(thisfunc), (gpointer)sigid); + _set_signal_handler_id(thiswindow, sigid, cid); + sigid = _set_signal_handler(window, window, sigfunc, data, thisfunc); + cid = gtk_signal_connect(GTK_OBJECT(window), "button_press_event", GTK_SIGNAL_FUNC(thisfunc), (gpointer)sigid); + _set_signal_handler_id(window, sigid, cid); + DW_MUTEX_UNLOCK; + return; + } + else if (GTK_IS_TREE(thiswindow) && strcmp(signame, DW_SIGNAL_ITEM_SELECT) == 0) + { + if(thisfunc) + { + sigid = _set_signal_handler(thiswindow, window, sigfunc, data, thisfunc); + gtk_object_set_data(GTK_OBJECT(thiswindow), "_dw_select_child_func", (gpointer)thisfunc); + gtk_object_set_data(GTK_OBJECT(thiswindow), "_dw_select_child_data", GINT_TO_POINTER(sigid)); + } + thisname = "select-child"; + } + else if (GTK_IS_TREE(thiswindow) && strcmp(signame, DW_SIGNAL_TREE_EXPAND) == 0) + { + if(thisfunc) + { + sigid = _set_signal_handler(thiswindow, window, sigfunc, data, thisfunc); + gtk_object_set_data(GTK_OBJECT(thiswindow), "_dw_tree_item_expand_func", (gpointer)thisfunc); + gtk_object_set_data(GTK_OBJECT(thiswindow), "_dw_tree_item_expand_data", GINT_TO_POINTER(sigid)); + } + DW_MUTEX_UNLOCK; + return; + } +#endif + else if (GTK_IS_CLIST(thiswindow) && strcmp(signame, DW_SIGNAL_ITEM_ENTER) == 0) + { + sigid = _set_signal_handler(thiswindow, window, sigfunc, data, _container_enter_event); + cid = gtk_signal_connect(GTK_OBJECT(thiswindow), "key_press_event", GTK_SIGNAL_FUNC(_container_enter_event), (gpointer)sigid); + _set_signal_handler_id(thiswindow, sigid, cid); + + thisname = "button_press_event"; + thisfunc = _findsigfunc(DW_SIGNAL_ITEM_ENTER); + } + else if (GTK_IS_CLIST(thiswindow) && strcmp(signame, DW_SIGNAL_ITEM_SELECT) == 0) + { + thisname = "select_row"; + thisfunc = (void *)_container_select_row; + } + else if (GTK_IS_COMBO(thiswindow) && strcmp(signame, DW_SIGNAL_LIST_SELECT) == 0) + { + thisname = "select_child"; + thiswindow = GTK_COMBO(thiswindow)->list; + } + else if (GTK_IS_LIST(thiswindow) && strcmp(signame, DW_SIGNAL_LIST_SELECT) == 0) + { + thisname = "select_child"; + } + else if (strcmp(signame, DW_SIGNAL_SET_FOCUS) == 0) + { + thisname = "focus-in-event"; + if (GTK_IS_COMBO(thiswindow)) + thiswindow = GTK_COMBO(thiswindow)->entry; + } #if 0 - else if(strcmp(signame, DW_SIGNAL_LOSE_FOCUS) == 0) - { - thisname = "focus-out-event"; - if(GTK_IS_COMBO(thiswindow)) - thiswindow = GTK_COMBO(thiswindow)->entry; - } -#endif - else if(GTK_IS_VSCALE(thiswindow) || GTK_IS_HSCALE(thiswindow) || - GTK_IS_VSCROLLBAR(thiswindow) || GTK_IS_HSCROLLBAR(thiswindow)) - { - thiswindow = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(thiswindow), "_dw_adjustment"); - } - else if(GTK_IS_NOTEBOOK(thiswindow) && strcmp(signame, DW_SIGNAL_SWITCH_PAGE) == 0) - { - thisname = "switch-page"; - } - else if(GTK_IS_CLIST(thiswindow) && strcmp(signame, DW_SIGNAL_COLUMN_CLICK) == 0) - { - thisname = "click-column"; - } - - if(!thisfunc || !thiswindow) - { - DW_MUTEX_UNLOCK; - return; - } - - sigid = _set_signal_handler(thiswindow, window, sigfunc, data, thisfunc); - cid = gtk_signal_connect(GTK_OBJECT(thiswindow), thisname, GTK_SIGNAL_FUNC(thisfunc),(gpointer)sigid); - _set_signal_handler_id(thiswindow, sigid, cid); - DW_MUTEX_UNLOCK; + else if (strcmp(signame, DW_SIGNAL_LOSE_FOCUS) == 0) + { + thisname = "focus-out-event"; + if(GTK_IS_COMBO(thiswindow)) + thiswindow = GTK_COMBO(thiswindow)->entry; + } +#endif + else if (GTK_IS_VSCALE(thiswindow) || GTK_IS_HSCALE(thiswindow) || + GTK_IS_VSCROLLBAR(thiswindow) || GTK_IS_HSCROLLBAR(thiswindow)) + { + thiswindow = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(thiswindow), "_dw_adjustment"); + } + else if (GTK_IS_NOTEBOOK(thiswindow) && strcmp(signame, DW_SIGNAL_SWITCH_PAGE) == 0) + { + thisname = "switch-page"; + } + else if (GTK_IS_CLIST(thiswindow) && strcmp(signame, DW_SIGNAL_COLUMN_CLICK) == 0) + { + thisname = "click-column"; + } + + if (!thisfunc || !thiswindow) + { + DW_MUTEX_UNLOCK; + return; + } + + sigid = _set_signal_handler(thiswindow, window, sigfunc, data, thisfunc); + cid = gtk_signal_connect(GTK_OBJECT(thiswindow), thisname, GTK_SIGNAL_FUNC(thisfunc),(gpointer)sigid); + _set_signal_handler_id(thiswindow, sigid, cid); + DW_MUTEX_UNLOCK; } /* @@ -10849,24 +10997,24 @@ */ void dw_signal_disconnect_by_name(HWND window, char *signame) { - HWND thiswindow; - int z, count; - void *thisfunc; - int _locked_by_me = FALSE; - - DW_MUTEX_LOCK; - thiswindow = _find_signal_window(window, signame); - count = (int)gtk_object_get_data(GTK_OBJECT(thiswindow), "_dw_sigcounter"); - thisfunc = _findsigfunc(signame); - - for(z=0;z