changeset 643:9ab89d89e6b4

Add dw_listview_insert() Default to using webkit for Gtk+ HTML widget Add option to build with libgtkhtml2 - incomplete Initial attempt to use customdraw for Win32 container - not working Added dw_window_get_font() for Gtk+ - not implemented in other ports yet Change package name from dw to dwindows for Linux ports - use dwindows-config now Add debian package build target
author mhessling@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 03 Oct 2010 00:34:36 +0000
parents fda03b13ebda
children 903a8f7bcb7c
files Makefile.in config.h.in configure configure.in debian/changelog debian/compat debian/control debian/copyright debian/rules dw-config.in dw.def dw.h dwindows-config.1 dwindows-config.in dwtest.c dww-mingw.def dww.def gtk/dw.c license.txt makefile.vc os2/dw.c win/dw.c
diffstat 22 files changed, 10559 insertions(+), 10446 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.in	Sun Apr 12 01:41:50 2009 +0000
+++ b/Makefile.in	Sun Oct 03 00:34:36 2010 +0000
@@ -1,12 +1,13 @@
 srcdir=@srcdir@
+mandir=@mandir@
 CC	=	@CC@
 MLFLAGS	=	-L.
-CCFLAGS	=	@CFLAGS@ -g -O2 -fPIC -Wall -D@DW_DEFINE@ -DBUILD_DLL -DDW_RESOURCES
-LFLAGS	=	@LIBS@
+CCFLAGS	=	@CFLAGS@ -g -O2 @ARCH@ -fPIC -Wall -D@DW_DEFINE@ -DBUILD_DLL -DDW_RESOURCES
+LFLAGS	=	@LIBS@ @ARCH@
 INSTALL =	@INSTALL@
 DW_SRC  =	@DW_SRC@
 INCPATH	=	-I.. -I. -I$(srcdir)
-TARGET	=	dw
+TARGET	=	@TARGET@
 SRCS	=	$(srcdir)/$(DW_SRC)/dw.c $(DW_SRC)rel2abs.c
 BROWSER_OBJECT=@BROWSER_OBJECT@
 COMPAT_OBJECT=@COMPAT_OBJECT@
@@ -14,11 +15,12 @@
 OBJECTS	=	dw.o rel2abs.o $(BROWSER_OBJECT)
 SRCS2	=	$(srcdir)compat.c
 OBJECTS2=	$(COMPAT_OBJECT)
-TARGET2 =	dwcompat
+TARGET2=	@TARGET2@
 VER_MAJ	=	@DW_MAJOR_VERSION@
 VER_MIN	=	@DW_MINOR_VERSION@
 SOSUFFIX=	@SOSUFFIX@
-PREFIX	=	$(DESTDIR)@prefix@
+SONAME=	@SONAME@
+prefix	=	$(DESTDIR)@prefix@
 SRCDIR=dwindows-$(VER_MAJ).$(VER_MIN)
 
 #.SUFFIXES:	.c .h
@@ -38,7 +40,7 @@
 SYSCONF_LINK_TARGET_SHARED = @SYSCONF_LINK_TARGET_SHARED@
 SYSCONF_LINK_LIB_SHARED	=  $(SYSCONF_LINK_SHLIB) $(SYSCONF_LFLAGS_SHOBJ) \
 				     -o $(SYSCONF_LINK_TARGET_SHARED) \
-				     $(OBJECTS) $(LFLAGS); \
+				     $(OBJECTS) $(LFLAGS) $(SONAME); \
 				 rm -f lib$(TARGET).$(SOSUFFIX) lib$(TARGET).$(SOSUFFIX).$(VER_MAJ); \
 				 ln -s $(SYSCONF_LINK_TARGET_SHARED) lib$(TARGET).$(SOSUFFIX); \
 				 ln -s $(SYSCONF_LINK_TARGET_SHARED) lib$(TARGET).$(SOSUFFIX).$(VER_MAJ)
@@ -75,32 +77,44 @@
 install: installbase $(INSTALL_COMPAT)
 
 installbase: $(SYSCONF_LINK_TARGET)
-		$(INSTALL) -d $(PREFIX)/include; \
-		$(INSTALL) -d $(PREFIX)/bin; \
-		$(INSTALL) -d $(PREFIX)/lib; \
-		$(INSTALL) $(srcdir)/dw.h $(PREFIX)/include; \
-		$(INSTALL) dw-config $(PREFIX)/bin; \
-		$(INSTALL) dwtest $(PREFIX)/bin; \
-		$(INSTALL) $(SYSCONF_LINK_TARGET)  $(PREFIX)/lib; \
-		cd $(PREFIX)/lib; \
-		rm -f lib$(TARGET).so lib$(TARGET).so.$(VER_MAJ); \
-		ln -sf $(SYSCONF_LINK_TARGET_SHARED) lib$(TARGET).$(SOSUFFIX); \
-		ln -sf $(SYSCONF_LINK_TARGET_SHARED) lib$(TARGET).$(SOSUFFIX).$(VER_MAJ)
+	$(INSTALL) -d $(prefix)/include; \
+	$(INSTALL) -d $(prefix)/lib; \
+	$(INSTALL) -d $(prefix)/bin; \
+	$(INSTALL) -d $(prefix)/share/man/man1; \
+	$(INSTALL) $(srcdir)/dw.h $(prefix)/include; \
+	$(INSTALL) dwindows-config $(prefix)/bin; \
+	$(INSTALL) dwindows-config.1 $(prefix)/share/man/man1; \
+	cd $(prefix)/share/man/man1; gzip -f -9 dwindows-config.1
+	$(INSTALL) $(SYSCONF_LINK_TARGET)  $(prefix)/lib; \
+	cd $(prefix)/lib; \
+	rm -f lib$(TARGET).so lib$(TARGET).so.$(VER_MAJ); \
+	ln -sf $(SYSCONF_LINK_TARGET_SHARED) lib$(TARGET).$(SOSUFFIX); \
+	ln -sf $(SYSCONF_LINK_TARGET_SHARED) lib$(TARGET).$(SOSUFFIX).$(VER_MAJ)
 
 installcompat: $(SYSCONF_LINK_TARGET2)
-		$(INSTALL) -d $(PREFIX)/lib; \
-		$(INSTALL) $(SYSCONF_LINK_TARGET2) $(PREFIX)/lib; \
-		cd $(PREFIX)/lib; \
-		rm -f lib$(TARGET2).$(SOSUFFIX) lib$(TARGET2).$(SOSUFFIX).$(VER_MAJ); \
-		ln -sf $(SYSCONF_LINK_TARGET_SHARED2) lib$(TARGET2).$(SOSUFFIX); \
-		ln -sf $(SYSCONF_LINK_TARGET_SHARED2) lib$(TARGET2).$(SOSUFFIX).$(VER_MAJ)
+	$(INSTALL) -d $(prefix)/lib; \
+	$(INSTALL) $(SYSCONF_LINK_TARGET2) $(prefix)/lib; \
+	cd $(prefix)/lib; \
+	rm -f lib$(TARGET2).$(SOSUFFIX) lib$(TARGET2).$(SOSUFFIX).$(VER_MAJ); \
+	ln -sf $(SYSCONF_LINK_TARGET_SHARED2) lib$(TARGET2).$(SOSUFFIX); \
+	ln -sf $(SYSCONF_LINK_TARGET_SHARED2) lib$(TARGET2).$(SOSUFFIX).$(VER_MAJ)
+
+deb: dist
+	-rm -fr tmp
+	-mkdir tmp
+	(cd tmp;tar zxvf ../../$(srcdir)/$(SRCDIR).tar.gz;cd $(SRCDIR);dpkg-buildpackage -rfakeroot;cd ..;ls -l)
+
+distclean: clean
+	rm -f config.status
 
 clean:
 	rm -f *.$(SOSUFFIX)
+	rm -f *.$(SOSUFFIX).*
 	rm -f *.o
 	rm -f *~
 	rm -f *.a
 	rm -f $(DW_SRC)/*.o
+	rm -f dwtest
 
 $(SYSCONF_LINK_TARGET2): $(OBJECTS2)
 	$(SYSCONF_LINK_LIB2)
@@ -124,24 +138,28 @@
 	$(CC) -c $(INCPATH) $(CCFLAGS) -o $@ $(srcdir)/dwtest.c
 
 dwtest: dwtest.o
-	$(CC) -o dwtest dwtest.o $(MLFLAGS) -ldw $(LFLAGS)
+	$(CC) -o dwtest dwtest.o $(MLFLAGS) -l$(TARGET) $(LFLAGS)
 	-chmod +x $(srcdir)/mac/finishup.sh
 	-$(srcdir)/mac/finishup.sh $(srcdir)
 
 zip:
 	zip dwindows$(VER_MAJ)$(VER_MIN).zip $(srcdir)/license.txt $(srcdir)/makefile.* $(srcdir)/readme $(srcdir)/*.c $(srcdir)/dw.h  $(srcdir)/compat.h \
-		$(srcdir)/*.def $(srcdir)/install.sh $(srcdir)/*.in $(srcdir)/configure \
-		$(srcdir)/ac*.m4 \
-		$(srcdir)/gtk/*.c $(srcdir)/win/*.c $(srcdir)/os2/*.c $(srcdir)/win/*.txt $(srcdir)/os2/*.txt \
-		$(srcdir)/gtk/*.xpm $(srcdir)/win/*.ico $(srcdir)/os2/*.ico \
-		$(srcdir)/mac/Info.plist $(srcdir)/mac/PkgInfo $(srcdir)/mac/*.c $(srcdir)/mac/dwtest.r $(srcdir)/mac/finishup.sh \
-		$(srcdir)/platform/*.h
+	$(srcdir)/*.def $(srcdir)/install.sh $(srcdir)/*.in $(srcdir)/configure \
+	$(srcdir)/ac*.m4 $(srcdir)/dwindows-config.1 \
+	$(srcdir)/gtk/*.c $(srcdir)/gtk/*.cpp $(srcdir)/win/*.c $(srcdir)/os2/*.c $(srcdir)/win/*.txt $(srcdir)/os2/*.txt \
+	$(srcdir)/gtk/*.xpm $(srcdir)/win/*.ico $(srcdir)/os2/*.ico \
+	$(srcdir)/mac/Info.plist $(srcdir)/mac/PkgInfo $(srcdir)/mac/*.c $(srcdir)/mac/dwtest.r $(srcdir)/mac/finishup.sh \
+	$(srcdir)/platform/*.h \
+	$(srcdir)/debian/control $(srcdir)/debian/rules $(srcdir)/debian/copyright $(srcdir)/debian/compat $(srcdir)/debian/changelog
 
 dist:
+	(cd $(srcdir)/..;ln -sf dwindows $(SRCDIR))
 	(cd $(srcdir)/..;tar -cvf - $(SRCDIR)/license.txt $(SRCDIR)/makefile.* $(SRCDIR)/readme $(SRCDIR)/*.c $(SRCDIR)/dw.h $(SRCDIR)/compat.h \
-		$(SRCDIR)/*.def $(SRCDIR)/install.sh $(SRCDIR)/*.in $(SRCDIR)/configure \
-		$(SRCDIR)/ac*.m4 \
-		$(SRCDIR)/gtk/*.c $(SRCDIR)/win/*.c $(SRCDIR)/os2/*.c  $(srcdir)/win/*.txt $(srcdir)/os2/*.txt \
-		$(SRCDIR)/gtk/*.xpm $(SRCDIR)/win/*.ico $(SRCDIR)/os2/*.ico \
-		$(SRCDIR)/mac/Info.plist $(SRCDIR)/mac/PkgInfo $(SRCDIR)/mac/*.c $(SRCDIR)/mac/dwtest.r $(SRCDIR)/mac/finishup.sh \
-		$(SRCDIR)/platform/*.h | gzip > dwindows-$(VER_MAJ).$(VER_MIN).tar.gz )
+	$(SRCDIR)/*.def $(SRCDIR)/install.sh $(SRCDIR)/*.in $(SRCDIR)/configure \
+	$(SRCDIR)/ac*.m4 $(SRCDIR)/dwindows-config.1 \
+	$(SRCDIR)/gtk/*.c $(SRCDIR)/gtk/*.cpp $(SRCDIR)/win/*.c $(SRCDIR)/os2/*.c  $(SRCDIR)/win/*.txt $(SRCDIR)/os2/*.txt \
+	$(SRCDIR)/gtk/*.xpm $(SRCDIR)/win/*.ico $(SRCDIR)/os2/*.ico \
+	$(SRCDIR)/mac/Info.plist $(SRCDIR)/mac/PkgInfo $(SRCDIR)/mac/*.c $(SRCDIR)/mac/dwtest.r $(SRCDIR)/mac/finishup.sh \
+	$(SRCDIR)/debian/control $(SRCDIR)/debian/rules $(SRCDIR)/debian/copyright $(SRCDIR)/debian/compat $(SRCDIR)/debian/changelog \
+	$(SRCDIR)/platform/*.h | gzip > $(SRCDIR).tar.gz )
+	(cd $(srcdir)/..;rm -f $(SRCDIR))
--- a/config.h.in	Sun Apr 12 01:41:50 2009 +0000
+++ b/config.h.in	Sun Oct 03 00:34:36 2010 +0000
@@ -33,6 +33,21 @@
 /* Define if GtkMozEmbed is available */
 #undef USE_GTKMOZEMBED
 
+/* Define if libgtkhtml-2.0 is available */
+#undef USE_LIBGTKHTML2
+
+/* Define if WebKit is available */
+#undef USE_WEBKIT
+
+/* Define if webkit-1.0 is available */
+#undef USE_WEBKIT10
+
+/* Define if webkit-1.1 is available */
+#undef USE_WEBKIT11
+
+/* Define for name of webkit library */
+#undef WEBKIT_LIB
+
 /* Define if IMLIB is available. */
 #undef USE_IMLIB
 
--- a/configure	Sun Apr 12 01:41:50 2009 +0000
+++ b/configure	Sun Oct 03 00:34:36 2010 +0000
@@ -1,60 +1,81 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61.
+# Generated by GNU Autoconf 2.64.
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
+# Foundation, Inc.
+#
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
-## --------------------- ##
-## M4sh Initialization.  ##
-## --------------------- ##
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
 
 # Be more Bourne compatible
 DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+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
+  # Pre-4.2 versions of Zsh do 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 ;;
+  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'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
 
 # The user is always right.
 if test "${PATH_SEPARATOR+set}" != set; 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 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
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
 fi
 
 
@@ -63,20 +84,18 @@
 # 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
+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
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
 IFS=$as_save_IFS
 
      ;;
@@ -87,32 +106,270 @@
   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
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && 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
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test "x$CONFIG_SHELL" = x; then
+  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do 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_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
 do
-  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
-    eval $as_var=C; export $as_var
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  as_found=:
+  case $as_dir in #(
+	 /*)
+	   for as_base in sh bash ksh sh5; do
+	     # Try only shells that exist, to save several forks.
+	     as_shell=$as_dir/$as_base
+	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
+	   done;;
+       esac
+  as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+      if test "x$CONFIG_SHELL" != x; then :
+  # We cannot yet assume a decent shell, so we have to provide a
+	# neutralization value for shells without unset; and this also
+	# works around shells that cannot unset nonexistent variables.
+	BASH_ENV=/dev/null
+	ENV=/dev/null
+	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+	export CONFIG_SHELL
+	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+    if test x$as_have_required = xno; then :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
   else
-    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+    $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
   fi
-done
-
-# Required to use basename.
+  exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_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 ||
+$as_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" || as_fn_error "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+# as_fn_error ERROR [LINENO LOG_FD]
+# ---------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with status $?, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$?; test $as_status -eq 0 && as_status=1
+  if test "$3"; then
+    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
+  fi
+  $as_echo "$as_me: error: $1" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
 if expr a : '\(a\)' >/dev/null 2>&1 &&
    test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
@@ -126,13 +383,17 @@
   as_basename=false
 fi
 
-
-# Name of the executable.
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
 as_me=`$as_basename -- "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
 	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
+$as_echo X/"$0" |
     sed '/^.*\/\([^/][^/]*\)\/*$/{
 	    s//\1/
 	    q
@@ -147,294 +408,19 @@
 	  }
 	  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=.
-  case $as_dir in
-	 /*)
-	   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
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  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 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
-  # scripts with optimization help from Paolo Bonzini.  Blame Lee
-  # E. McMahon (1931-1989) for sed's syntax.  :-)
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
   sed -n '
     p
     /[$]LINENO/=
@@ -451,8 +437,7 @@
       s/-\n.*//
     ' >$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; }; }
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_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
@@ -462,49 +447,40 @@
   exit
 }
 
-
-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
+case `echo -n x` in #(((((
 -n*)
-  case `echo 'x\c'` in
+  case `echo 'xy\c'` in
   *c*) ECHO_T='	';;	# ECHO_T is single tab character.
-  *)   ECHO_C='\c';;
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
   esac;;
 *)
   ECHO_N='-n';;
 esac
 
-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
-  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 ||
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    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'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
     as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s=ln
+  fi
 else
   as_ln_s='cp -p'
 fi
@@ -512,7 +488,7 @@
 rmdir conf$$.dir 2>/dev/null
 
 if mkdir -p . 2>/dev/null; then
-  as_mkdir_p=:
+  as_mkdir_p='mkdir -p "$as_dir"'
 else
   test -d ./-p && rmdir ./-p
   as_mkdir_p=false
@@ -529,12 +505,12 @@
   as_test_x='
     eval sh -c '\''
       if test -d "$1"; then
-        test -d "$1/.";
+	test -d "$1/.";
       else
-	case $1 in
-        -*)set "./$1";;
+	case $1 in #(
+	-*)set "./$1";;
 	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
 	???[sx]*):;;*)false;;esac;fi
     '\'' sh
   '
@@ -548,7 +524,6 @@
 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
-
 exec 7<&0 </dev/null 6>&1
 
 # Name of the host.
@@ -567,7 +542,6 @@
 subdirs=
 MFLAGS=
 MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
 
 # Identity of this package.
 PACKAGE_NAME=
@@ -575,6 +549,7 @@
 PACKAGE_VERSION=
 PACKAGE_STRING=
 PACKAGE_BUGREPORT=
+PACKAGE_URL=
 
 ac_unique_file="winmain.c"
 # Factoring default headers for most tests.
@@ -613,93 +588,113 @@
 # include <unistd.h>
 #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
-TARGET
-TARGET2
-DW_MAJOR_VERSION
-DW_MINOR_VERSION
-DW_SUB_VERSION
-CC
+ac_subst_vars='LTLIBOBJS
+LIBOBJS
+ARCH
+INSTALL_COMPAT
+COMPAT_OBJECT
+BROWSER_OBJECT
+DW_DEFINE
+DW_SRC
+SONAME
+SOSUFFIX
+SHAREDFLAG
+MKDIR
+MV
+CP
+LN
+RM
+INCLUDES
+GDK_IMLIB_LIBS
+GDK_IMLIB_CFLAGS
+IMLIB_CONFIG
+GTK_LIBS
+GTK_CFLAGS
+GTK_CONFIG
+GLIB_LIBS
+GLIB_CFLAGS
+GLIB_CONFIG
+PKG_CFG
+EGREP
+GREP
+CPP
+SYSCONF_LINK_TARGET_SHARED2
+SYSCONF_LINK_TARGET_SHARED
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+MAKE
+ac_ct_CXX
+CXXFLAGS
+CXX
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
 CFLAGS
-LDFLAGS
-CPPFLAGS
-ac_ct_CC
-EXEEXT
-OBJEXT
-CXX
-CXXFLAGS
-ac_ct_CXX
-MAKE
-INSTALL_PROGRAM
-INSTALL_SCRIPT
-INSTALL_DATA
-SYSCONF_LINK_TARGET_SHARED
-SYSCONF_LINK_TARGET_SHARED2
-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
-BROWSER_OBJECT
-COMPAT_OBJECT
-INSTALL_COMPAT
-LIBOBJS
-LTLIBOBJS'
+CC
+DW_SUB_VERSION
+DW_MINOR_VERSION
+DW_MAJOR_VERSION
+TARGET2
+TARGET
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
 ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+with_compat
+with_gtk
+with_gtkhtml
+with_gtkmozembed
+with_arch
+with_glib_prefix
+with_glib_exec_prefix
+enable_glibtest
+with_gtk_prefix
+with_gtk_exec_prefix
+enable_gtktest
+with_imlib_prefix
+with_imlib_exec_prefix
+enable_imlibtest
+'
       ac_precious_vars='build_alias
 host_alias
 target_alias
@@ -717,6 +712,8 @@
 # Initialize some variables set by options.
 ac_init_help=
 ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
 # The variables have the same names as the options, with
 # dashes changed to underlines.
 cache_file=/dev/null
@@ -815,13 +812,20 @@
     datarootdir=$ac_optarg ;;
 
   -disable-* | --disable-*)
-    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    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 ;;
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
 
   -docdir | --docdir | --docdi | --doc | --do)
     ac_prev=docdir ;;
@@ -834,13 +838,20 @@
     dvidir=$ac_optarg ;;
 
   -enable-* | --enable-*)
-    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    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=\$ac_optarg ;;
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$ac_optarg ;;
 
   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -1031,22 +1042,36 @@
     ac_init_version=: ;;
 
   -with-* | --with-*)
-    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    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=\$ac_optarg ;;
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
 
   -without-* | --without-*)
-    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    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 ;;
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=no ;;
 
   --x)
     # Obsolete; use --with-x.
@@ -1066,25 +1091,25 @@
   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
     x_libraries=$ac_optarg ;;
 
-  -*) { echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
-   { (exit 1); exit 1; }; }
+  -*) as_fn_error "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information."
     ;;
 
   *=*)
     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
-   { (exit 1); exit 1; }; }
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error "invalid variable name: \`$ac_envvar'" ;;
+    esac
     eval $ac_envvar=\$ac_optarg
     export $ac_envvar ;;
 
   *)
     # FIXME: should be removed in autoconf 3.0.
-    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
     ;;
 
@@ -1093,23 +1118,36 @@
 
 if test -n "$ac_prev"; then
   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
-  { echo "$as_me: error: missing argument to $ac_option" >&2
-   { (exit 1); exit 1; }; }
-fi
-
-# Be sure to have absolute directory names.
+  as_fn_error "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
 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=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
   case $ac_val in
     [\\/$]* | ?:[\\/]* )  continue;;
     NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
   esac
-  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; }
+  as_fn_error "expected an absolute directory name for --$ac_var: $ac_val"
 done
 
 # There might be people who depend on the old broken behavior: `$host'
@@ -1123,7 +1161,7 @@
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
     If a cross compiler is detected then cross compile mode will be used." >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
@@ -1139,23 +1177,21 @@
 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; }; }
+  as_fn_error "working directory cannot be determined"
 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; }; }
+  as_fn_error "pwd does not report name of working directory"
 
 
 # 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 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 ||
-echo X"$0" |
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_myself" : 'X\(//\)[^/]' \| \
+	 X"$as_myself" : 'X\(//\)$' \| \
+	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
 	    s//\1/
 	    q
@@ -1182,13 +1218,11 @@
 fi
 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; }; }
+  as_fn_error "cannot find sources ($ac_unique_file) in $srcdir"
 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; }; }
+	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg"
 	pwd)`
 # When building in place, set srcdir=.
 if test "$ac_abs_confdir" = "$ac_pwd"; then
@@ -1236,9 +1270,9 @@
 
 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
@@ -1248,25 +1282,25 @@
 For better control, use the options below.
 
 Fine tuning of the installation directories:
-  --bindir=DIR           user executables [EPREFIX/bin]
-  --sbindir=DIR          system admin executables [EPREFIX/sbin]
-  --libexecdir=DIR       program executables [EPREFIX/libexec]
-  --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]
-  --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]
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --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]
+  --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
@@ -1278,6 +1312,7 @@
   cat <<\_ACEOF
 
 Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
   --disable-glibtest      Do not try to compile and run a test GLIB program
@@ -1289,6 +1324,9 @@
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
   --with-compat           specify this to build the optional dwcompat library
   --with-gtk              specify this to build dwindows with GTK+ (only relevant for OSX)
+  --with-gtkhtml          specify this to build dwindows with libgtkhtml-2
+  --with-gtkmozembed      specify this to build dwindows with Mozilla gtkmozembed
+  --with-arch             specify architecture: one of all, 32bit, 64bit, ppc, ppc64, x86_64, i386
   --with-glib-prefix=PFX  Prefix where GLIB is installed (optional)
   --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)
   --with-gtk-prefix=PFX   Prefix where GTK is installed (optional)
@@ -1311,6 +1349,7 @@
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
 
+Report bugs to the package provider.
 _ACEOF
 ac_status=$?
 fi
@@ -1318,15 +1357,17 @@
 if test "$ac_init_help" = "recursive"; then
   # If there are subdirs, report their specific --help.
   for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
-    test -d "$ac_dir" || continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
     ac_builddir=.
 
 case "$ac_dir" in
 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
 *)
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
   # A ".." for each directory in $ac_dir_suffix.
-  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  ac_top_builddir_sub=`$as_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/ ;;
@@ -1362,7 +1403,7 @@
       echo &&
       $SHELL "$ac_srcdir/configure" --help=recursive
     else
-      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
     fi || ac_status=$?
     cd "$ac_pwd" || { ac_status=$?; break; }
   done
@@ -1372,21 +1413,410 @@
 if $ac_init_version; then
   cat <<\_ACEOF
 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.
+generated by GNU Autoconf 2.64
+
+Copyright (C) 2009 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
 fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  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 ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  return $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_cxx_try_compile LINENO
+# ----------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  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 ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  return $ac_retval
+
+} # ac_fn_cxx_try_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  return $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+       $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=$ac_status
+fi
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  return $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  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 ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  return $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_header_compiler=yes
+else
+  ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  ac_header_preproc=yes
+else
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+  yes:no: )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+    ;;
+esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $2 (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* 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
+char $2 ();
+/* 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_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_func
 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.61.  Invocation command line was
+generated by GNU Autoconf 2.64.  Invocation command line was
 
   $ $0 $@
 
@@ -1422,8 +1852,8 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  echo "PATH: $as_dir"
-done
+    $as_echo "PATH: $as_dir"
+  done
 IFS=$as_save_IFS
 
 } >&5
@@ -1457,12 +1887,12 @@
     | -silent | --silent | --silen | --sile | --sil)
       continue ;;
     *\'*)
-      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
     case $ac_pass in
-    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
     2)
-      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      as_fn_append ac_configure_args1 " '$ac_arg'"
       if test $ac_must_keep_next = true; then
 	ac_must_keep_next=false # Got value, back to normal.
       else
@@ -1478,13 +1908,13 @@
 	  -* ) ac_must_keep_next=true ;;
 	esac
       fi
-      ac_configure_args="$ac_configure_args '$ac_arg'"
+      as_fn_append 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; }
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
 
 # When interrupted or exit'd, cleanup temporary files, and complete
 # config.log.  We remove comments because anyway the quotes in there
@@ -1509,12 +1939,13 @@
     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;} ;;
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
       esac
       case $ac_var in #(
       _ | IFS | as_nl) ;; #(
-      *) $as_unset $ac_var ;;
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
       esac ;;
     esac
   done
@@ -1543,9 +1974,9 @@
     do
       eval ac_val=\$$ac_var
       case $ac_val in
-      *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
       esac
-      echo "$ac_var='\''$ac_val'\''"
+      $as_echo "$ac_var='\''$ac_val'\''"
     done | sort
     echo
 
@@ -1560,9 +1991,9 @@
       do
 	eval ac_val=\$$ac_var
 	case $ac_val in
-	*\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
 	esac
-	echo "$ac_var='\''$ac_val'\''"
+	$as_echo "$ac_var='\''$ac_val'\''"
       done | sort
       echo
     fi
@@ -1578,64 +2009,69 @@
       echo
     fi
     test "$ac_signal" != 0 &&
-      echo "$as_me: caught signal $ac_signal"
-    echo "$as_me: exit $exit_status"
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
   } >&5
   rm -f core *.core core.conftest.* &&
     rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
     exit $exit_status
 ' 0
 for ac_signal in 1 2 13 15; do
-  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
 done
 ac_signal=0
 
 # confdefs.h avoids OS command line length limits that DEFS can exceed.
 rm -f -r conftest* confdefs.h
 
+$as_echo "/* confdefs.h */" > confdefs.h
+
 # Predefined preprocessor variables.
 
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_NAME "$PACKAGE_NAME"
 _ACEOF
 
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_TARNAME "$PACKAGE_TARNAME"
 _ACEOF
 
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_VERSION "$PACKAGE_VERSION"
 _ACEOF
 
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_STRING "$PACKAGE_STRING"
 _ACEOF
 
-
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
 _ACEOF
 
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
 
 # Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
 if test -n "$CONFIG_SITE"; then
-  set x "$CONFIG_SITE"
+  ac_site_file1=$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
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
 do
+  test "x$ac_site_file" = xNONE && continue
   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;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
     sed 's/^/| /' "$ac_site_file" >&5
     . "$ac_site_file"
   fi
@@ -1645,16 +2081,16 @@
   # Some versions of bash will fail to source /dev/null (special
   # files actually), so we avoid doing that.
   if test -f "$cache_file"; then
-    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
-echo "$as_me: loading cache $cache_file" >&6;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
     case $cache_file in
       [\\/]* | ?:[\\/]* ) . "$cache_file";;
       *)                      . "./$cache_file";;
     esac
   fi
 else
-  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
-echo "$as_me: creating cache $cache_file" >&6;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
   >$cache_file
 fi
 
@@ -1668,60 +2104,56 @@
   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
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,set)
-      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,);;
     *)
       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: error: \`$ac_var' has changed since the previous run:" >&2;}
-	{ 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:   current value: $ac_new_val" >&2;}
-	ac_cache_corrupted=:
+	# differences in whitespace do not lead to failure.
+	ac_old_val_w=`echo x $ac_old_val`
+	ac_new_val_w=`echo x $ac_new_val`
+	if test "$ac_old_val_w" != "$ac_new_val_w"; then
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	  ac_cache_corrupted=:
+	else
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+	  eval $ac_var=\$ac_old_val
+	fi
+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
       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=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
     *) ac_arg=$ac_var=$ac_new_val ;;
     esac
     case " $ac_configure_args " in
       *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
-      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
     esac
   fi
 done
 if $ac_cache_corrupted; then
-  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
 
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -1737,7 +2169,7 @@
 DW_MINOR_VERSION=1
 DW_SUB_VERSION=0
 
-TARGET="dw"
+TARGET="dwindows"
 TARGET2="dwcompat"
 
 
@@ -1760,10 +2192,10 @@
 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; }
-if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1773,25 +2205,25 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    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_CC="${ac_tool_prefix}gcc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-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; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -1800,10 +2232,10 @@
   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; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
@@ -1813,25 +2245,25 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    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_CC="gcc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-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; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
   if test "x$ac_ct_CC" = x; then
@@ -1839,12 +2271,8 @@
   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;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     CC=$ac_ct_CC
@@ -1857,10 +2285,10 @@
           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; }
-if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1870,25 +2298,25 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    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_CC="${ac_tool_prefix}cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-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; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -1897,10 +2325,10 @@
 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; }
-if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1911,18 +2339,18 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    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
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
      fi
     ac_cv_prog_CC="cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
 if test $ac_prog_rejected = yes; then
@@ -1941,11 +2369,11 @@
 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; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -1956,10 +2384,10 @@
   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_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1969,25 +2397,25 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    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_CC="$ac_tool_prefix$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-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; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -2000,10 +2428,10 @@
 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_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
@@ -2013,25 +2441,25 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    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_CC="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-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; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -2043,12 +2471,8 @@
   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;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     CC=$ac_ct_CC
@@ -2058,98 +2482,82 @@
 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; }; }
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "no acceptable C compiler found in \$PATH
+See \`config.log' for more details." "$LINENO" 5; }
 
 # 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"
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&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
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
   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); }
-
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    rm -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
+#include <stdio.h>
 int
 main ()
 {
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
 
   ;
   return 0;
 }
 _ACEOF
 ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.exe b.out"
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out conftest.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 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[^ ]*//'`
-#
-# 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.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
 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_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
     * ) ac_rmfiles="$ac_rmfiles $ac_file";;
   esac
 done
 rm -f $ac_rmfiles
 
-if { (ac_try="$ac_link_default"
+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_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
   (eval "$ac_link_default") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
   # 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,
@@ -2159,14 +2567,14 @@
 do
   test -f "$ac_file" || continue
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.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;
+	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
 	then :; else
 	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
 	fi
@@ -2185,78 +2593,75 @@
 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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+if test -z "$ac_file"; then :
+  $as_echo "$as_me: failed program was:" >&5
 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
-
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ as_fn_set_status 77
+as_fn_error "C compiler cannot create executables
+See \`config.log' for more details." "$LINENO" 5; }; }
+fi
 ac_exeext=$ac_cv_exeext
 
 # 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; }
-# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
 # If not cross compiling, check that we can run a simple program.
 if test "$cross_compiling" != yes; then
   if { ac_try='./$ac_file'
-  { (case "(($ac_try" in
+  { { 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_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
     cross_compiling=no
   else
     if test "$cross_compiling" = maybe; then
 	cross_compiling=yes
     else
-	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot run C compiled programs.
 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'.
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+See \`config.log' for more details." "$LINENO" 5; }
     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 b.out
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out conftest.out
 ac_clean_files=$ac_clean_files_save
 # 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 { (ac_try="$ac_link"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&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_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
   # If both `conftest.exe' and `conftest' are `present' (well, observable)
 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
 # work properly (i.e., refer to `conftest.exe'), while it won't with
@@ -2264,37 +2669,31 @@
 for ac_file in conftest.exe conftest conftest.*; do
   test -f "$ac_file" || continue
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
 	  break;;
     * ) break;;
   esac
 done
 else
-  { { 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
-
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." "$LINENO" 5; }
+fi
 rm -f conftest$ac_cv_exeext
-{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$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; }
-if test "${ac_cv_objext+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -2306,51 +2705,46 @@
 }
 _ACEOF
 rm -f conftest.o conftest.obj
-if { (ac_try="$ac_compile"
+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_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
   (eval "$ac_compile") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
   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 | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
        break;;
   esac
 done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 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
-
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." "$LINENO" 5; }
+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; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$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; }
-if test "${ac_cv_c_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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -2364,54 +2758,34 @@
   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
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_compiler_gnu=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_compiler_gnu=no
-fi
-
+  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; }
-GCC=`test $ac_compiler_gnu = yes && echo yes`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
 ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
-{ 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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   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
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -2422,34 +2796,11 @@
   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
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_prog_cc_g=yes
 else
-  echo "$as_me: failed program was:" >&5
-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
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -2460,35 +2811,12 @@
   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
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  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
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -2499,42 +2827,18 @@
   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
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_prog_cc_g=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
+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; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$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
@@ -2550,18 +2854,14 @@
     CFLAGS=
   fi
 fi
-{ 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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
 ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
@@ -2618,31 +2918,9 @@
 	-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
+  if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_prog_cc_c89=$ac_arg
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
+fi
 rm -f core conftest.err conftest.$ac_objext
   test "x$ac_cv_prog_cc_c89" != "xno" && break
 done
@@ -2653,17 +2931,19 @@
 # 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; } ;;
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
   xno)
-    { echo "$as_me:$LINENO: result: unsupported" >&5
-echo "${ECHO_T}unsupported" >&6; } ;;
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "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; } ;;
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
 esac
-
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
 
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -2685,10 +2965,10 @@
   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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CXX+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CXX"; then
   ac_cv_prog_CXX="$CXX" # Let the user override the test.
@@ -2698,25 +2978,25 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    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
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-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; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -2729,10 +3009,10 @@
 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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CXX"; then
   ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
@@ -2742,25 +3022,25 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    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
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-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; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
+$as_echo "$ac_ct_CXX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -2772,12 +3052,8 @@
   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;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     CXX=$ac_ct_CXX
@@ -2787,49 +3063,36 @@
   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"
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&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
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
   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
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    rm -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
+$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -2843,54 +3106,34 @@
   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
+if ac_fn_cxx_try_compile "$LINENO"; then :
   ac_compiler_gnu=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_compiler_gnu=no
-fi
-
+  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`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
+$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GXX=yes
+else
+  GXX=
+fi
 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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
+$as_echo_n "checking whether $CXX accepts -g... " >&6; }
+if test "${ac_cv_prog_cxx_g+set}" = set; then :
+  $as_echo_n "(cached) " >&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
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -2901,34 +3144,11 @@
   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
+if ac_fn_cxx_try_compile "$LINENO"; 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
+  CXXFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -2939,35 +3159,12 @@
   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
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+else
+  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
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -2978,42 +3175,18 @@
   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
+if ac_fn_cxx_try_compile "$LINENO"; then :
   ac_cv_prog_cxx_g=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
+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; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
+$as_echo "$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
@@ -3038,10 +3211,10 @@
 
 # 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; }
-if test "${ac_cv_prog_MAKE+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_MAKE+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$MAKE"; then
   ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
@@ -3051,35 +3224,35 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    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_MAKE="gmake"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-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; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
+$as_echo "$MAKE" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
 if test x"$MAKE" = x; then
    # 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; }
-if test "${ac_cv_prog_MAKE+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_MAKE+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$MAKE"; then
   ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
@@ -3089,25 +3262,25 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    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_MAKE="make"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-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; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
+$as_echo "$MAKE" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -3115,24 +3288,16 @@
 
 ac_aux_dir=
 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
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install.sh -c"
-    break
-  elif test -f "$ac_dir/shtool"; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/shtool install -c"
-    break
-  fi
+  for ac_t in install-sh install.sh shtool; do
+    if test -f "$ac_dir/$ac_t"; then
+      ac_aux_dir=$ac_dir
+      ac_install_sh="$ac_aux_dir/$ac_t -c"
+      break 2
+    fi
+  done
 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;}
-   { (exit 1); exit 1; }; }
+  as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
 fi
 
 # These three variables are undocumented and unsupported,
@@ -3157,22 +3322,23 @@
 # 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; }
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
 if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test "${ac_cv_path_install+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in
-  ./ | .// | /cC/* | \
+    # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+  ./ | .// | /[cC]/* | \
   /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
-  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
   /usr/ucb/* ) ;;
   *)
     # OSF1 and SCO ODT 3.0 have their own names for install.
@@ -3190,17 +3356,29 @@
 	    # 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
+	    rm -rf conftest.one conftest.two conftest.dir
+	    echo one > conftest.one
+	    echo two > conftest.two
+	    mkdir conftest.dir
+	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+	      test -s conftest.one && test -s conftest.two &&
+	      test -s conftest.dir/conftest.one &&
+	      test -s conftest.dir/conftest.two
+	    then
+	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	      break 3
+	    fi
 	  fi
 	fi
       done
     done
     ;;
 esac
-done
+
+  done
 IFS=$as_save_IFS
 
+rm -rf conftest.one conftest.two conftest.dir
 
 fi
   if test "${ac_cv_path_install+set}" = set; then
@@ -3213,8 +3391,8 @@
     INSTALL=$ac_install_sh
   fi
 fi
-{ echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
 
 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
 # It thinks the first close brace ends the variable substitution.
@@ -3230,7 +3408,7 @@
 with_compat=no
 
 # Check whether --with-compat was given.
-if test "${with_compat+set}" = set; then
+if test "${with_compat+set}" = set; then :
   withval=$with_compat; with_compat=$withval
 else
   with_compat=no
@@ -3251,7 +3429,7 @@
 
 
 # Check whether --with-gtk was given.
-if test "${with_gtk+set}" = set; then
+if test "${with_gtk+set}" = set; then :
   withval=$with_gtk; with_gtk=$withval
 else
   with_gtk=no
@@ -3259,20 +3437,47 @@
 
 
 
+# Check whether --with-gtkhtml was given.
+if test "${with_gtkhtml+set}" = set; then :
+  withval=$with_gtkhtml; with_gtkhtml=$withval
+else
+  with_gtkhtml=no
+fi
+
+
+
+# Check whether --with-gtkmozembed was given.
+if test "${with_gtkmozembed+set}" = set; then :
+  withval=$with_gtkmozembed; with_gtkmozembed=$withval
+else
+  with_gtkmozembed=no
+fi
+
+
+
+# Check whether --with-arch was given.
+if test "${with_arch+set}" = set; then :
+  withval=$with_arch; with_arch=$withval
+else
+  with_arch=no
+fi
+
+
+
 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
-{ 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; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
-  if test "${ac_cv_prog_CPP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  if test "${ac_cv_prog_CPP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
       # Double quotes because CPP needs to be expanded
     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
@@ -3286,11 +3491,7 @@
   # <limits.h> 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
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef __STDC__
 # include <limits.h>
@@ -3299,76 +3500,34 @@
 #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=$?
-  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
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
   # Broken: fails on valid input.
 continue
 fi
-
 rm -f conftest.err conftest.$ac_ext
 
   # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _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
+if ac_fn_c_try_cpp "$LINENO"; then :
   # Broken: success on invalid input.
 continue
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
   # Passes both tests.
 ac_preproc_ok=:
 break
 fi
-
 rm -f conftest.err conftest.$ac_ext
 
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
 rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
+if $ac_preproc_ok; then :
   break
 fi
 
@@ -3380,8 +3539,8 @@
 else
   ac_cv_prog_CPP=$CPP
 fi
-{ echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
 ac_preproc_ok=false
 for ac_c_preproc_warn_flag in '' yes
 do
@@ -3391,11 +3550,7 @@
   # <limits.h> 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
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #ifdef __STDC__
 # include <limits.h>
@@ -3404,83 +3559,40 @@
 #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=$?
-  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
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
   # Broken: fails on valid input.
 continue
 fi
-
 rm -f conftest.err conftest.$ac_ext
 
   # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _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
+if ac_fn_c_try_cpp "$LINENO"; then :
   # Broken: success on invalid input.
 continue
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
   # Passes both tests.
 ac_preproc_ok=:
 break
 fi
-
 rm -f conftest.err conftest.$ac_ext
 
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
 rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
-  :
-else
-  { { 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; }; }
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." "$LINENO" 5; }
 fi
 
 ac_ext=c
@@ -3490,45 +3602,40 @@
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-{ 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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
   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
+  # 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.
+    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"
+  $as_echo_n 0123456789 >"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"
+    $as_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`
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
     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"
@@ -3540,77 +3647,61 @@
   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
 esac
 
-
-    $ac_path_GREP_found && break 3
+      $ac_path_GREP_found && break 3
+    done
   done
-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
-
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  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; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then :
+  $as_echo_n "(cached) " >&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
+     if test -z "$EGREP"; then
   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
+  # 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.
+    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"
+  $as_echo_n 0123456789 >"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"
+    $as_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`
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
     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"
@@ -3622,46 +3713,31 @@
   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
 esac
 
-
-    $ac_path_EGREP_found && break 3
+      $ac_path_EGREP_found && break 3
+    done
   done
-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
-
+  if test -z "$ac_cv_path_EGREP"; then
+    as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  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; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$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
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdlib.h>
 #include <stdarg.h>
@@ -3676,47 +3752,23 @@
   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
+if ac_fn_c_try_compile "$LINENO"; then :
   ac_cv_header_stdc=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_header_stdc=no
-fi
-
+  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
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <string.h>
 
 _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
 fi
@@ -3726,18 +3778,14 @@
 
 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
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdlib.h>
 
 _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
 fi
@@ -3747,14 +3795,10 @@
 
 if test $ac_cv_header_stdc = yes; then
   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then
+  if test "$cross_compiling" = yes; then :
   :
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ctype.h>
 #include <stdlib.h>
@@ -3781,69 +3825,34 @@
   return 0;
 }
 _ACEOF
-rm -f 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>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (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
-  :
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_header_stdc=no
-fi
-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 ac_fn_c_try_run "$LINENO"; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
 if test $ac_cv_header_stdc = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
-
-fi
-
-
-
-
-
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
 
 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 { 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
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5
+$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -3857,39 +3866,20 @@
   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
+if ac_fn_c_try_compile "$LINENO"; then :
   eval "$as_ac_Header=yes"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_Header=no"
-fi
-
+  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
+eval ac_res=\$$as_ac_Header
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+eval as_val=\$$as_ac_Header
+   if test "x$as_val" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
 _ACEOF
 
 ac_header_dirent=$ac_hdr; break
@@ -3898,17 +3888,13 @@
 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; }
-if test "${ac_cv_search_opendir+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5
+$as_echo_n "checking for library containing opendir... " >&6; }
+if test "${ac_cv_search_opendir+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   ac_func_search_save_LIBS=$LIBS
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -3933,66 +3919,39 @@
     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); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+  if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_search_opendir=$ac_res
-else
-  echo "$as_me: failed program was:" >&5
-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
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if test "${ac_cv_search_opendir+set}" = set; then :
   break
 fi
 done
-if test "${ac_cv_search_opendir+set}" = set; then
-  :
+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; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5
+$as_echo "$ac_cv_search_opendir" >&6; }
 ac_res=$ac_cv_search_opendir
-if test "$ac_res" != no; then
+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
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5
+$as_echo_n "checking for library containing opendir... " >&6; }
+if test "${ac_cv_search_opendir+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   ac_func_search_save_LIBS=$LIBS
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -4017,50 +3976,27 @@
     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); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+  if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_search_opendir=$ac_res
-else
-  echo "$as_me: failed program was:" >&5
-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
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if test "${ac_cv_search_opendir+set}" = set; then :
   break
 fi
 done
-if test "${ac_cv_search_opendir+set}" = set; then
-  :
+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; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5
+$as_echo "$ac_cv_search_opendir" >&6; }
 ac_res=$ac_cv_search_opendir
-if test "$ac_res" != no; then
+if test "$ac_res" != no; then :
   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
 
 fi
@@ -4068,208 +4004,41 @@
 fi
 
 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
-
-
-
-
-
-
-
-
-
 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.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 { 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
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-
-#include <$ac_header>
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+eval as_val=\$$as_ac_Header
+   if test "x$as_val" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _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
-  eval "$as_ac_Header=yes"
-else
-  echo "$as_me: failed program was:" >&5
-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
+
+fi
+
+done
+
+
+for ac_header in unistd.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
+if test "x$ac_cv_header_unistd_h" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define HAVE_UNISTD_H 1
 _ACEOF
 
 fi
 
 done
 
-
-
-for ac_header in unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-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
-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; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_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_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 $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header 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 <$ac_header>
-_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
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $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 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: 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:$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 { 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
-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
+for ac_header in sys/stat.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "sys/stat.h" "ac_cv_header_sys_stat_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_stat_h" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define HAVE_SYS_STAT_H 1
 _ACEOF
 
 fi
@@ -4277,177 +4046,42 @@
 done
 
 
-for ac_header in sys/stat.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-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
-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; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_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_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 $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header 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 <$ac_header>
+for ac_func in pipe
+do :
+  ac_fn_c_check_func "$LINENO" "pipe" "ac_cv_func_pipe"
+if test "x$ac_cv_func_pipe" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_PIPE 1
 _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
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $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 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: 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:$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 { 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
-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
+
+$as_echo "#define HAVE_PIPE 1" >>confdefs.h
+
+fi
+done
+
+
+for ac_func in connect
+do :
+  ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect"
+if test "x$ac_cv_func_connect" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-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 { 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
-/* confdefs.h.  */
+#define HAVE_CONNECT 1
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+
+fi
+done
+
+if test x"$ac_cv_func_connect" = x"no"; then
+   if test -z "$libsocket"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5
+$as_echo_n "checking for socket in -lsocket... " >&6; }
+if test "${ac_cv_lib_socket_socket+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> 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.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#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
@@ -4455,175 +4089,41 @@
 #ifdef __cplusplus
 extern "C"
 #endif
-char $ac_func ();
-/* 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
-
+char socket ();
 int
 main ()
 {
-return $ac_func ();
+return socket ();
   ;
   return 0;
 }
 _ACEOF
-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); } && {
-	 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
-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
-_ACEOF
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_PIPE 1
-_ACEOF
-
-fi
-done
-
-
-
-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 { 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
-/* 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 <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> 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.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#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
-char $ac_func ();
-/* 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 ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
-_ACEOF
-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); } && {
-	 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
-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
-_ACEOF
-
-fi
-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 "${ac_cv_lib_socket_socket+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_socket_socket=yes
+else
+  ac_cv_lib_socket_socket=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5
+$as_echo "$ac_cv_lib_socket_socket" >&6; }
+if test "x$ac_cv_lib_socket_socket" = x""yes; then :
+  LIBS="$LIBS -lsocket"
+fi
+
+   fi
+
+      if test -z "$libinet"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -linet" >&5
+$as_echo_n "checking for socket in -linet... " >&6; }
+if test "${ac_cv_lib_inet_socket+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+LIBS="-linet  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -4641,125 +4141,32 @@
   return 0;
 }
 _ACEOF
-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); } && {
-	 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
-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
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_inet_socket=yes
+else
+  ac_cv_lib_inet_socket=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    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; }
-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; }
-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
-/* 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
-char socket ();
-int
-main ()
-{
-return socket ();
-  ;
-  return 0;
-}
-_ACEOF
-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); } && {
-	 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
-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; }
-if test $ac_cv_lib_inet_socket = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_inet_socket" >&5
+$as_echo "$ac_cv_lib_inet_socket" >&6; }
+if test "x$ac_cv_lib_inet_socket" = x""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; }
-if test "${ac_cv_lib_nsl_gethostname+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostname in -lnsl" >&5
+$as_echo_n "checking for gethostname in -lnsl... " >&6; }
+if test "${ac_cv_lib_nsl_gethostname+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lnsl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -4777,57 +4184,32 @@
   return 0;
 }
 _ACEOF
-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); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_nsl_gethostname=yes
 else
-  echo "$as_me: failed program was:" >&5
-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
+  ac_cv_lib_nsl_gethostname=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    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; }
-if test $ac_cv_lib_nsl_gethostname = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostname" >&5
+$as_echo "$ac_cv_lib_nsl_gethostname" >&6; }
+if test "x$ac_cv_lib_nsl_gethostname" = x""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; }
-if test "${ac_cv_lib_sun_getpwnam+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpwnam in -lsun" >&5
+$as_echo_n "checking for getpwnam in -lsun... " >&6; }
+if test "${ac_cv_lib_sun_getpwnam+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lsun  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -4845,54 +4227,29 @@
   return 0;
 }
 _ACEOF
-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); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_sun_getpwnam=yes
 else
-  echo "$as_me: failed program was:" >&5
-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
+  ac_cv_lib_sun_getpwnam=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    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; }
-if test $ac_cv_lib_sun_getpwnam = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sun_getpwnam" >&5
+$as_echo "$ac_cv_lib_sun_getpwnam" >&6; }
+if test "x$ac_cv_lib_sun_getpwnam" = x""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; }
-if test "${ac_cv_lib_dgc_inet_addr+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_addr in -ldgc" >&5
+$as_echo_n "checking for inet_addr in -ldgc... " >&6; }
+if test "${ac_cv_lib_dgc_inet_addr+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldgc  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -4910,54 +4267,29 @@
   return 0;
 }
 _ACEOF
-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); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_dgc_inet_addr=yes
 else
-  echo "$as_me: failed program was:" >&5
-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
+  ac_cv_lib_dgc_inet_addr=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    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; }
-if test $ac_cv_lib_dgc_inet_addr = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dgc_inet_addr" >&5
+$as_echo "$ac_cv_lib_dgc_inet_addr" >&6; }
+if test "x$ac_cv_lib_dgc_inet_addr" = x""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; }
-if test "${ac_cv_lib_resolv_gethostbyname+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lresolv" >&5
+$as_echo_n "checking for gethostbyname in -lresolv... " >&6; }
+if test "${ac_cv_lib_resolv_gethostbyname+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lresolv  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -4975,61 +4307,58 @@
   return 0;
 }
 _ACEOF
-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); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_resolv_gethostbyname=yes
 else
-  echo "$as_me: failed program was:" >&5
-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
+  ac_cv_lib_resolv_gethostbyname=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    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; }
-if test $ac_cv_lib_resolv_gethostbyname = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_gethostbyname" >&5
+$as_echo "$ac_cv_lib_resolv_gethostbyname" >&6; }
+if test "x$ac_cv_lib_resolv_gethostbyname" = x""yes; then :
   LIBS="$LIBS -lresolv"
 fi
 
 
+SONAME=""
 OPSYSTEM=`uname -s`
-case "OPSYSTEM" in
+case "$OPSYSTEM" in
    MINGW32*)
-      cat >>confdefs.h <<\_ACEOF
-#define DW_USE_GTK 1
-_ACEOF
-
+      $as_echo "#define DW_USE_GTK 1" >>confdefs.h
+
+   ;;
+   *Linux*)
+      SONAME="-Wl,-soname,lib$TARGET.so.$DW_MAJOR_VERSION"
    ;;
 esac
 
 if test $OPSYSTEM = "Darwin"; then
-   ARCH="-arch ppc -arch ppc64 -arch x86_64 -arch i386"
-   SHAREDFLAG="-dynamiclib -flat_namespace -undefined suppress $ARCH"
+   case "$with_arch" in
+      no)
+         ARCH=""
+         ;;
+      all)
+         ARCH="-arch ppc -arch ppc64 -arch x86_64 -arch i386"
+         ;;
+      32bit)
+         ARCH="-arch ppc -arch i386"
+         ;;
+      64bit)
+         ARCH="-arch ppc84 -arch x86_64"
+         ;;
+      *)
+         ARCH="-arch $with_arch"
+         ;;
+   esac
+   SHAREDFLAG="-dynamiclib -flat_namespace -undefined suppress"
    SOSUFFIX=dylib
    if test $with_gtk = yes; then
       DW_SRC=gtk
       LIBS="$LIBS -framework Gtk -framework Glib -framework Cairo"
-      GTK_CFLAGS="-I/Library/Frameworks/Gtk.framework/Headers -I/Library/Frameworks/Glib.framework/Headers -I/Library/Frameworks/Cairo.framework/Headers $ARCH"
+      GTK_CFLAGS="-I/Library/Frameworks/Gtk.framework/Headers -I/Library/Frameworks/Glib.framework/Headers -I/Library/Frameworks/Cairo.framework/Headers"
    else
       DW_SRC=mac
       DW_DEFINE=__MAC__
@@ -5038,10 +4367,10 @@
 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; }
-if test "${ac_cv_prog_PKG_CFG+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_PKG_CFG+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$PKG_CFG"; then
   ac_cv_prog_PKG_CFG="$PKG_CFG" # Let the user override the test.
@@ -5051,37 +4380,68 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    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_PKG_CFG="pkg-config"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-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; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CFG" >&5
+$as_echo "$PKG_CFG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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-`
+      if test $with_gtkmozembed = yes; then
+         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
+      elif test $with_gtkhtml = yes; then
+         MOZEMBED_LIBS=`$PKG_CFG --silence-errors --libs libgtkhtml-2.0`
+         MOZEMBED_CFLAGS=`$PKG_CFG --silence-errors --cflags libgtkhtml-2.0`
+         RPATH=`$PKG_CFG --silence-errors --libs-only-L libgtkhtml-2.0 | cut -b 3-`
+      else
+         WEBKIT_LIB="webkit-1.1"
+         MOZEMBED_CFLAGS=`$PKG_CFG --silence-errors --cflags $WEBKIT_LIB`
+         RPATH=`$PKG_CFG --silence-errors --libs-only-L $WEBKIT_LIB | cut -b 3-`
+         if test x"$MOZEMBED_CFLAGS" = x; then
+            WEBKIT_LIB="webkit-1.0"
+            MOZEMBED_CFLAGS=`$PKG_CFG --silence-errors --cflags $WEBKIT_LIB`
+            RPATH=`$PKG_CFG --silence-errors --libs-only-L $WEBKIT_LIB | cut -b 3-`
+            if test x"$MOZEMBED_CFLAGS" = x; then
+               WEBKIT_LIB="WebKitGtk"
+#               MOZEMBED_LIBS=`$PKG_CFG --silence-errors --libs $WEBKIT_LIB`
+               MOZEMBED_CFLAGS=`$PKG_CFG --silence-errors --cflags $WEBKIT_LIB`
+               RPATH=`$PKG_CFG --silence-errors --libs-only-L $WEBKIT_LIB | cut -b 3-`
+            else
+               $as_echo "#define USE_WEBKIT10 1" >>confdefs.h
+
+            fi
+         else
+            $as_echo "#define USE_WEBKIT11 1" >>confdefs.h
+
+         fi
+         cat >>confdefs.h <<_ACEOF
+#define WEBKIT_LIB "$WEBKIT_LIB"
+_ACEOF
+
       fi
       if test x"$RPATH" != x; then
          RPATH="-Wl,-R$RPATH"
@@ -5091,7 +4451,7 @@
    if test x"$GTK_LIBS" = x; then
 
 # Check whether --with-glib-prefix was given.
-if test "${with_glib_prefix+set}" = set; then
+if test "${with_glib_prefix+set}" = set; then :
   withval=$with_glib_prefix; glib_config_prefix="$withval"
 else
   glib_config_prefix=""
@@ -5099,14 +4459,14 @@
 
 
 # Check whether --with-glib-exec-prefix was given.
-if test "${with_glib_exec_prefix+set}" = set; then
+if test "${with_glib_exec_prefix+set}" = set; then :
   withval=$with_glib_exec_prefix; glib_config_exec_prefix="$withval"
 else
   glib_config_exec_prefix=""
 fi
 
 # Check whether --enable-glibtest was given.
-if test "${enable_glibtest+set}" = set; then
+if test "${enable_glibtest+set}" = set; then :
   enableval=$enable_glibtest;
 else
   enable_glibtest=yes
@@ -5140,10 +4500,10 @@
 
   # 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; }
-if test "${ac_cv_path_GLIB_CONFIG+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_GLIB_CONFIG+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   case $GLIB_CONFIG in
   [\\/]* | ?:[\\/]*)
@@ -5155,14 +4515,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    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_path_GLIB_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
   test -z "$ac_cv_path_GLIB_CONFIG" && ac_cv_path_GLIB_CONFIG="no"
@@ -5171,17 +4531,17 @@
 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; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GLIB_CONFIG" >&5
+$as_echo "$GLIB_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB - version >= $min_glib_version" >&5
+$as_echo_n "checking for GLIB - version >= $min_glib_version... " >&6; }
   no_glib=""
   if test "$GLIB_CONFIG" = "no" ; then
     no_glib=yes
@@ -5200,14 +4560,10 @@
       CFLAGS="$CFLAGS $GLIB_CFLAGS"
       LIBS="$GLIB_LIBS $LIBS"
       rm -f conf.glibtest
-      if test "$cross_compiling" = yes; then
+      if test "$cross_compiling" = yes; then :
   echo $ac_n "cross compiling; assumed OK... $ac_c"
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <glib.h>
@@ -5283,50 +4639,26 @@
 }
 
 _ACEOF
-rm -f 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>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (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
-  :
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-no_glib=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  no_glib=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam 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; }
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
      :
   else
-     { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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"
@@ -5339,11 +4671,7 @@
           echo "*** Could not run GLIB test program, checking why..."
           CFLAGS="$CFLAGS $GLIB_CFLAGS"
           LIBS="$LIBS $GLIB_LIBS"
-          cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <glib.h>
@@ -5357,24 +4685,7 @@
   return 0;
 }
 _ACEOF
-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); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+if ac_fn_c_try_link "$LINENO"; 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"
@@ -5385,30 +4696,20 @@
           echo "*** If you have an old version installed, it is best to remove it, although"
           echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	 echo "*** The test program failed to compile or link. See the file config.log for the"
+   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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
           CFLAGS="$ac_save_CFLAGS"
           LIBS="$ac_save_LIBS"
        fi
      fi
      GLIB_CFLAGS=""
      GLIB_LIBS=""
-     { { echo "$as_me:$LINENO: error: { { echo \"$as_me:$LINENO: error: Cannot find GLIB: Is glib-config in path?\" >&5
-echo \"$as_me: error: Cannot find GLIB: Is glib-config in path?\" >&2;}
-   { (exit 1); exit 1; }; }" >&5
-echo "$as_me: error: { { echo \"$as_me:$LINENO: error: Cannot find GLIB: Is glib-config in path?\" >&5
-echo \"$as_me: error: Cannot find GLIB: Is glib-config in path?\" >&2;}
-   { (exit 1); exit 1; }; }" >&2;}
-   { (exit 1); exit 1; }; }
+     as_fn_error "as_fn_error \"Cannot find GLIB: Is glib-config in path?\" \"$LINENO\" 5" "$LINENO" 5
   fi
 
 
@@ -5416,7 +4717,7 @@
 
 
 # Check whether --with-gtk-prefix was given.
-if test "${with_gtk_prefix+set}" = set; then
+if test "${with_gtk_prefix+set}" = set; then :
   withval=$with_gtk_prefix; gtk_config_prefix="$withval"
 else
   gtk_config_prefix=""
@@ -5424,14 +4725,14 @@
 
 
 # Check whether --with-gtk-exec-prefix was given.
-if test "${with_gtk_exec_prefix+set}" = set; then
+if test "${with_gtk_exec_prefix+set}" = set; then :
   withval=$with_gtk_exec_prefix; gtk_config_exec_prefix="$withval"
 else
   gtk_config_exec_prefix=""
 fi
 
 # Check whether --enable-gtktest was given.
-if test "${enable_gtktest+set}" = set; then
+if test "${enable_gtktest+set}" = set; then :
   enableval=$enable_gtktest;
 else
   enable_gtktest=yes
@@ -5462,10 +4763,10 @@
 
   # 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; }
-if test "${ac_cv_path_GTK_CONFIG+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_GTK_CONFIG+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   case $GTK_CONFIG in
   [\\/]* | ?:[\\/]*)
@@ -5477,14 +4778,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    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_path_GTK_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
   test -z "$ac_cv_path_GTK_CONFIG" && ac_cv_path_GTK_CONFIG="no"
@@ -5493,17 +4794,17 @@
 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; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTK_CONFIG" >&5
+$as_echo "$GTK_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK - version >= $min_gtk_version" >&5
+$as_echo_n "checking for GTK - version >= $min_gtk_version... " >&6; }
   no_gtk=""
   if test "$GTK_CONFIG" = "no" ; then
     no_gtk=yes
@@ -5522,14 +4823,10 @@
       CFLAGS="$CFLAGS $GTK_CFLAGS"
       LIBS="$GTK_LIBS $LIBS"
       rm -f conf.gtktest
-      if test "$cross_compiling" = yes; then
+      if test "$cross_compiling" = yes; then :
   echo $ac_n "cross compiling; assumed OK... $ac_c"
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <gtk/gtk.h>
@@ -5607,50 +4904,26 @@
 }
 
 _ACEOF
-rm -f 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>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (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
-  :
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-no_gtk=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  no_gtk=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam 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; }
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
      :
   else
-     { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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"
@@ -5663,11 +4936,7 @@
           echo "*** Could not run GTK test program, checking why..."
           CFLAGS="$CFLAGS $GTK_CFLAGS"
           LIBS="$LIBS $GTK_LIBS"
-          cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <gtk/gtk.h>
@@ -5681,24 +4950,7 @@
   return 0;
 }
 _ACEOF
-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); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+if ac_fn_c_try_link "$LINENO"; 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"
@@ -5709,30 +4961,20 @@
           echo "*** If you have an old version installed, it is best to remove it, although"
           echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	 echo "*** The test program failed to compile or link. See the file config.log for the"
+   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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
           CFLAGS="$ac_save_CFLAGS"
           LIBS="$ac_save_LIBS"
        fi
      fi
      GTK_CFLAGS=""
      GTK_LIBS=""
-     { { echo "$as_me:$LINENO: error: { { echo \"$as_me:$LINENO: error: Cannot find GTK: Is gtk-config in path?\" >&5
-echo \"$as_me: error: Cannot find GTK: Is gtk-config in path?\" >&2;}
-   { (exit 1); exit 1; }; }" >&5
-echo "$as_me: error: { { echo \"$as_me:$LINENO: error: Cannot find GTK: Is gtk-config in path?\" >&5
-echo \"$as_me: error: Cannot find GTK: Is gtk-config in path?\" >&2;}
-   { (exit 1); exit 1; }; }" >&2;}
-   { (exit 1); exit 1; }; }
+     as_fn_error "as_fn_error \"Cannot find GTK: Is gtk-config in path?\" \"$LINENO\" 5" "$LINENO" 5
   fi
 
 
@@ -5740,7 +4982,7 @@
 
 
 # Check whether --with-imlib-prefix was given.
-if test "${with_imlib_prefix+set}" = set; then
+if test "${with_imlib_prefix+set}" = set; then :
   withval=$with_imlib_prefix; imlib_prefix="$withval"
 else
   imlib_prefix=""
@@ -5748,14 +4990,14 @@
 
 
 # Check whether --with-imlib-exec-prefix was given.
-if test "${with_imlib_exec_prefix+set}" = set; then
+if test "${with_imlib_exec_prefix+set}" = set; then :
   withval=$with_imlib_exec_prefix; imlib_exec_prefix="$withval"
 else
   imlib_exec_prefix=""
 fi
 
 # Check whether --enable-imlibtest was given.
-if test "${enable_imlibtest+set}" = set; then
+if test "${enable_imlibtest+set}" = set; then :
   enableval=$enable_imlibtest;
 else
   enable_imlibtest=yes
@@ -5777,10 +5019,10 @@
 
   # 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; }
-if test "${ac_cv_path_IMLIB_CONFIG+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_IMLIB_CONFIG+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   case $IMLIB_CONFIG in
   [\\/]* | ?:[\\/]*)
@@ -5792,14 +5034,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
+    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_path_IMLIB_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
-done
+  done
 IFS=$as_save_IFS
 
   test -z "$ac_cv_path_IMLIB_CONFIG" && ac_cv_path_IMLIB_CONFIG="no"
@@ -5808,17 +5050,17 @@
 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; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IMLIB_CONFIG" >&5
+$as_echo "$IMLIB_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IMLIB - version >= $min_imlib_version" >&5
+$as_echo_n "checking for IMLIB - version >= $min_imlib_version... " >&6; }
   no_imlib=""
   if test "$IMLIB_CONFIG" = "no" ; then
     no_imlib=yes
@@ -5838,14 +5080,10 @@
       CFLAGS="$CFLAGS $GDK_IMLIB_CFLAGS"
       LIBS="$LIBS $GDK_IMLIB_LIBS"
       rm -f conf.imlibtest
-      if test "$cross_compiling" = yes; then
+      if test "$cross_compiling" = yes; then :
   echo $ac_n "cross compiling; assumed OK... $ac_c"
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <stdio.h>
@@ -5887,53 +5125,27 @@
 
 
 _ACEOF
-rm -f 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>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (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
-  :
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-no_imlib=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  no_imlib=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam 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; }
-     cat >>confdefs.h <<\_ACEOF
-#define USE_IMLIB 1
-_ACEOF
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+     $as_echo "#define USE_IMLIB 1" >>confdefs.h
 
   else
-     { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "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"
@@ -5946,11 +5158,7 @@
           echo "*** Could not run IMLIB test program, checking why..."
           CFLAGS="$CFLAGS $GDK_IMLIB_CFLAGS"
           LIBS="$LIBS $GDK_IMLIB_LIBS"
-          cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <stdio.h>
@@ -5964,24 +5172,7 @@
   return 0;
 }
 _ACEOF
-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); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+if ac_fn_c_try_link "$LINENO"; 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"
@@ -5992,26 +5183,20 @@
           echo "*** If you have an old version installed, it is best to remove it, although"
           echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	 echo "*** The test program failed to compile or link. See the file config.log for the"
+   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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
           CFLAGS="$ac_save_CFLAGS"
           LIBS="$ac_save_LIBS"
        fi
      fi
      GDK_IMLIB_CFLAGS=""
      GDK_IMLIB_LIBS=""
-     { { echo "$as_me:$LINENO: error: IMLIB not found or too old. Dynamic Windows cannot build without it." >&5
-echo "$as_me: error: IMLIB not found or too old. Dynamic Windows cannot build without it." >&2;}
-   { (exit 1); exit 1; }; }
+     as_fn_error "IMLIB not found or too old. Dynamic Windows cannot build without it." "$LINENO" 5
   fi
 
 
@@ -6023,152 +5208,100 @@
    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; }
-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; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking pthread.h usability" >&5
-echo $ECHO_N "checking pthread.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <pthread.h>
-_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_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 <pthread.h>
-_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
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: 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 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: 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:$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; }
-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; }
-
-fi
-if test $ac_cv_header_pthread_h = yes; then
-  :
-else
-  { { echo "$as_me:$LINENO: error: pthread header not found. Dynamic Windows cannot build without it." >&5
-echo "$as_me: error: pthread header not found. Dynamic Windows cannot build without it." >&2;}
-   { (exit 1); exit 1; }; }
-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; }
-if test "${ac_cv_lib_pthread_pthread_attr_init+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
+if test "x$ac_cv_header_pthread_h" = x""yes; then :
+
+else
+  as_fn_error "pthread header not found. Dynamic Windows cannot build without it." "$LINENO" 5
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_attr_init in -lpthread" >&5
+$as_echo_n "checking for pthread_attr_init in -lpthread... " >&6; }
+if test "${ac_cv_lib_pthread_pthread_attr_init+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lpthread  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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
+char pthread_attr_init ();
+int
+main ()
+{
+return pthread_attr_init ();
+  ;
+  return 0;
+}
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_pthread_pthread_attr_init=yes
+else
+  ac_cv_lib_pthread_pthread_attr_init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_attr_init" >&5
+$as_echo "$ac_cv_lib_pthread_pthread_attr_init" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_attr_init" = x""yes; then :
+  PTHREAD_LIBS="-lpthread"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_attr_init in -lpthreads" >&5
+$as_echo_n "checking for pthread_attr_init in -lpthreads... " >&6; }
+if test "${ac_cv_lib_pthreads_pthread_attr_init+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthreads  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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
+char pthread_attr_init ();
+int
+main ()
+{
+return pthread_attr_init ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_pthreads_pthread_attr_init=yes
+else
+  ac_cv_lib_pthreads_pthread_attr_init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthreads_pthread_attr_init" >&5
+$as_echo "$ac_cv_lib_pthreads_pthread_attr_init" >&6; }
+if test "x$ac_cv_lib_pthreads_pthread_attr_init" = x""yes; then :
+  PTHREAD_LIBS="-lpthreads"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_attr_init in -lc_r" >&5
+$as_echo_n "checking for pthread_attr_init in -lc_r... " >&6; }
+if test "${ac_cv_lib_c_r_pthread_attr_init+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc_r  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -6186,174 +5319,22 @@
   return 0;
 }
 _ACEOF
-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); } && {
-	 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
-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
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_c_r_pthread_attr_init=yes
+else
+  ac_cv_lib_c_r_pthread_attr_init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    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; }
-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; }
-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
-/* 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
-char pthread_attr_init ();
-int
-main ()
-{
-return pthread_attr_init ();
-  ;
-  return 0;
-}
-_ACEOF
-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); } && {
-	 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
-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; }
-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; }
-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
-/* 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
-char pthread_attr_init ();
-int
-main ()
-{
-return pthread_attr_init ();
-  ;
-  return 0;
-}
-_ACEOF
-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); } && {
-	 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
-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; }
-if test $ac_cv_lib_c_r_pthread_attr_init = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_attr_init" >&5
+$as_echo "$ac_cv_lib_c_r_pthread_attr_init" >&6; }
+if test "x$ac_cv_lib_c_r_pthread_attr_init" = x""yes; then :
   PTHREAD_LIBS="-lc_r"
 else
-  { { 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; }; }
+  as_fn_error "pthread library not found. dwindows cannot build without it.
+                                                   " "$LINENO" 5
 
 fi
 
@@ -6367,22 +5348,19 @@
 CFLAGS="$CFLAGS $GTK_CFLAGS $GDK_IMLIB_FLAGS $MOZEMBED_CFLAGS"
 
 BROWSER_OBJECT=""
-if test x"$MOZEMBED_LIBS" != x; then
+if test x"$MOZEMBED_CFLAGS" != x; then
    SAVE_LIBS="$LIBS"
    LIBS="$RPATH $LIBS $GTK_LIBS $PTHREAD_LIBS $GDK_IMLIB_LIBS $MOZEMBED_LIBS"
    BROWSER_OBJECT="browser.o"
-   { 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
+   if test $with_gtkmozembed = yes; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gtk_moz_embed_new in -lgtkembedmoz" >&5
+$as_echo_n "checking for gtk_moz_embed_new in -lgtkembedmoz... " >&6; }
+if test "${ac_cv_lib_gtkembedmoz_gtk_moz_embed_new+set}" = set; then :
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgtkembedmoz  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -6400,47 +5378,117 @@
   return 0;
 }
 _ACEOF
-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); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_gtkembedmoz_gtk_moz_embed_new=yes
 else
-  echo "$as_me: failed program was:" >&5
-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
+  ac_cv_lib_gtkembedmoz_gtk_moz_embed_new=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    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; }
-if test $ac_cv_lib_gtkembedmoz_gtk_moz_embed_new = yes; then
-  cat >>confdefs.h <<\_ACEOF
-#define USE_GTKMOZEMBED 1
-_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gtkembedmoz_gtk_moz_embed_new" >&5
+$as_echo "$ac_cv_lib_gtkembedmoz_gtk_moz_embed_new" >&6; }
+if test "x$ac_cv_lib_gtkembedmoz_gtk_moz_embed_new" = x""yes; then :
+  $as_echo "#define USE_GTKMOZEMBED 1" >>confdefs.h
 
 else
   BROWSER_OBJECT=""
 fi
 
+   elif test $with_gtkhtml = yes; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for html_document_new in -lgtkhtml-2" >&5
+$as_echo_n "checking for html_document_new in -lgtkhtml-2... " >&6; }
+if test "${ac_cv_lib_gtkhtml_2_html_document_new+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgtkhtml-2  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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
+char html_document_new ();
+int
+main ()
+{
+return html_document_new ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_gtkhtml_2_html_document_new=yes
+else
+  ac_cv_lib_gtkhtml_2_html_document_new=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gtkhtml_2_html_document_new" >&5
+$as_echo "$ac_cv_lib_gtkhtml_2_html_document_new" >&6; }
+if test "x$ac_cv_lib_gtkhtml_2_html_document_new" = x""yes; then :
+  $as_echo "#define USE_LIBGTKHTML2 1" >>confdefs.h
+
+else
+  BROWSER_OBJECT=""
+fi
+
+   else
+      as_ac_Lib=`$as_echo "ac_cv_lib_$WEBKIT_LIB''_webkit_web_view_new" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for webkit_web_view_new in -l$WEBKIT_LIB" >&5
+$as_echo_n "checking for webkit_web_view_new in -l$WEBKIT_LIB... " >&6; }
+if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-l$WEBKIT_LIB  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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
+char webkit_web_view_new ();
+int
+main ()
+{
+return webkit_web_view_new ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$as_ac_Lib=yes"
+else
+  eval "$as_ac_Lib=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+eval ac_res=\$$as_ac_Lib
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+eval as_val=\$$as_ac_Lib
+   if test "x$as_val" = x""yes; then :
+  $as_echo "#define USE_WEBKIT 1" >>confdefs.h
+
+else
+  BROWSER_OBJECT=""
+fi
+
+      BROWSER_OBJECT=""
+   fi
    LIBS="$SAVE_LIBS"
 fi
 
@@ -6468,7 +5516,10 @@
 
 
 
-ac_config_files="$ac_config_files Makefile dw-config"
+
+
+
+ac_config_files="$ac_config_files Makefile dwindows-config"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -6497,12 +5548,13 @@
     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;} ;;
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
       esac
       case $ac_var in #(
       _ | IFS | as_nl) ;; #(
-      *) $as_unset $ac_var ;;
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
       esac ;;
     esac
   done
@@ -6510,8 +5562,8 @@
   (set) 2>&1 |
     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 \).
+      # `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"
@@ -6534,12 +5586,12 @@
 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;}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
     cat confcache >$cache_file
   else
-    { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
-echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
   fi
 fi
 rm -f confcache
@@ -6555,11 +5607,11 @@
 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"`
+  ac_i=`$as_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'
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
 done
 LIBOBJS=$ac_libobjs
 
@@ -6568,11 +5620,13 @@
 
 
 : ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
 #! $SHELL
 # Generated by $as_me.
 # Run this file to recreate the current configuration.
@@ -6582,59 +5636,79 @@
 debug=false
 ac_cs_recheck=false
 ac_cs_silent=false
+
 SHELL=\${CONFIG_SHELL-$SHELL}
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-## --------------------- ##
-## M4sh Initialization.  ##
-## --------------------- ##
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
 
 # Be more Bourne compatible
 DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+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
+  # Pre-4.2 versions of Zsh do 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 ;;
+  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'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
 
 # The user is always right.
 if test "${PATH_SEPARATOR+set}" != set; 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 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
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
 fi
 
 
@@ -6643,20 +5717,18 @@
 # 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
+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
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
 IFS=$as_save_IFS
 
      ;;
@@ -6667,32 +5739,111 @@
   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
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && 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
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error ERROR [LINENO LOG_FD]
+# ---------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with status $?, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$?; test $as_status -eq 0 && as_status=1
+  if test "$3"; then
+    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
   fi
-done
-
-# Required to use basename.
+  $as_echo "$as_me: error: $1" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
 if expr a : '\(a\)' >/dev/null 2>&1 &&
    test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
@@ -6706,13 +5857,17 @@
   as_basename=false
 fi
 
-
-# Name of the executable.
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
 as_me=`$as_basename -- "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
 	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
+$as_echo X/"$0" |
     sed '/^.*\/\([^/][^/]*\)\/*$/{
 	    s//\1/
 	    q
@@ -6727,104 +5882,103 @@
 	  }
 	  s/.*/./; q'`
 
-# CDPATH.
-$as_unset CDPATH
-
-
-
-  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 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
-  # 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
-      :loop
-      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
-      t loop
-      s/-\n.*//
-    ' >$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 sensitive to this).
-  . "./$as_me.lineno"
-  # Exit status is that of the last command.
-  exit
-}
-
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
-  as_dirname=dirname
-else
-  as_dirname=false
-fi
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
 
 ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
+case `echo -n x` in #(((((
 -n*)
-  case `echo 'x\c'` in
+  case `echo 'xy\c'` in
   *c*) ECHO_T='	';;	# ECHO_T is single tab character.
-  *)   ECHO_C='\c';;
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
   esac;;
 *)
   ECHO_N='-n';;
 esac
 
-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
-  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 ||
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    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'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
     as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s=ln
+  fi
 else
   as_ln_s='cp -p'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
 
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_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 ||
+$as_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" || as_fn_error "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
 if mkdir -p . 2>/dev/null; then
-  as_mkdir_p=:
+  as_mkdir_p='mkdir -p "$as_dir"'
 else
   test -d ./-p && rmdir ./-p
   as_mkdir_p=false
@@ -6841,12 +5995,12 @@
   as_test_x='
     eval sh -c '\''
       if test -d "$1"; then
-        test -d "$1/.";
+	test -d "$1/.";
       else
-	case $1 in
-        -*)set "./$1";;
+	case $1 in #(
+	-*)set "./$1";;
 	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
 	???[sx]*):;;*)false;;esac;fi
     '\'' sh
   '
@@ -6861,13 +6015,19 @@
 
 
 exec 6>&1
-
-# Save the log message, to keep $[0] and so on meaningful, and to
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
 This file was extended by $as_me, which was
-generated by GNU Autoconf 2.61.  Invocation command line was
+generated by GNU Autoconf 2.64.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -6880,29 +6040,40 @@
 
 _ACEOF
 
-cat >>$CONFIG_STATUS <<_ACEOF
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 # Files that config.status was made for.
 config_files="$ac_config_files"
 config_headers="$ac_config_headers"
 
 _ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
-
-Usage: $0 [OPTIONS] [FILE]...
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
 
   -h, --help       print this help, then exit
   -V, --version    print version number and configuration settings, then exit
-  -q, --quiet      do not print progress messages
+  -q, --quiet, --silent
+                   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
-  --header=FILE[:TEMPLATE]
-		   instantiate the configuration header FILE
+      --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
+      --header=FILE[:TEMPLATE]
+                   instantiate the configuration header FILE
 
 Configuration files:
 $config_files
@@ -6910,27 +6081,27 @@
 Configuration headers:
 $config_headers
 
-Report bugs to <bug-autoconf@gnu.org>."
+Report bugs to the package provider."
 
 _ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_version="\\
 config.status
-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.
+configured by $0, generated by GNU Autoconf 2.64,
+  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2009 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
 ac_pwd='$ac_pwd'
 srcdir='$srcdir'
 INSTALL='$INSTALL'
+test -n "\$AWK" || AWK=awk
 _ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If no file are specified by the user, then we need to provide default
-# value.  By we need to know if files were specified by the user.
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
 ac_need_defaults=:
 while test $# != 0
 do
@@ -6952,34 +6123,38 @@
   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
     ac_cs_recheck=: ;;
   --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
-    echo "$ac_cs_version"; exit ;;
+    $as_echo "$ac_cs_version"; exit ;;
   --debug | --debu | --deb | --de | --d | -d )
     debug=: ;;
   --file | --fil | --fi | --f )
     $ac_shift
-    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
     ac_need_defaults=false;;
   --header | --heade | --head | --hea )
     $ac_shift
-    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
     ac_need_defaults=false;;
   --he | --h)
     # Conflict between --help and --header
-    { echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2
-   { (exit 1); exit 1; }; };;
+    as_fn_error "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
   --help | --hel | -h )
-    echo "$ac_cs_usage"; exit ;;
+    $as_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: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2
-   { (exit 1); exit 1; }; } ;;
-
-  *) ac_config_targets="$ac_config_targets $1"
+  -*) as_fn_error "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+  *) as_fn_append ac_config_targets " $1"
      ac_need_defaults=false ;;
 
   esac
@@ -6994,30 +6169,32 @@
 fi
 
 _ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 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
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
   export CONFIG_SHELL
-  exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  exec "\$@"
 fi
 
 _ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 exec 5>>config.log
 {
   echo
   sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
 ## Running $as_me. ##
 _ASBOX
-  echo "$ac_log"
+  $as_echo "$ac_log"
 } >&5
 
 _ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 _ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 
 # Handling of arguments.
 for ac_config_target in $ac_config_targets
@@ -7025,11 +6202,9 @@
   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; }; };;
+    "dwindows-config") CONFIG_FILES="$CONFIG_FILES dwindows-config" ;;
+
+  *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
 done
 
@@ -7055,7 +6230,7 @@
   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
+  trap 'as_fn_exit 1' 1 2 13 15
 }
 # Create a (secure) tmp directory for tmp files.
 
@@ -7066,152 +6241,139 @@
 {
   tmp=./conf$$-$RANDOM
   (umask 077 && mkdir "$tmp")
-} ||
+} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
 {
-   echo "$me: cannot create a temporary directory in ." >&2
-   { (exit 1); exit 1; }
-}
-
-#
-# 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
-
-_ACEOF
-
-
-
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
 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
-TARGET!$TARGET$ac_delim
-TARGET2!$TARGET2$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
-SYSCONF_LINK_TARGET_SHARED!$SYSCONF_LINK_TARGET_SHARED$ac_delim
-SYSCONF_LINK_TARGET_SHARED2!$SYSCONF_LINK_TARGET_SHARED2$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
-BROWSER_OBJECT!$BROWSER_OBJECT$ac_delim
-COMPAT_OBJECT!$COMPAT_OBJECT$ac_delim
-INSTALL_COMPAT!$INSTALL_COMPAT$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` = 86; then
+  . ./conf$$subs.sh ||
+    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; 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; }; }
+    as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5
   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
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
 _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 <conf$$subs.sed
-rm -f conf$$subs.sed
-cat >>$CONFIG_STATUS <<_ACEOF
-:end
-s/|#_!!_#|//g
-CEOF$ac_eof
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\).*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\).*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = ""
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
 _ACEOF
-
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+  || as_fn_error "could not setup config files machinery" "$LINENO" 5
+_ACEOF
 
 # VPATH may cause trouble with some makes, so we remove $(srcdir),
 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
@@ -7228,20 +6390,128 @@
 }'
 fi
 
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 fi # test -n "$CONFIG_FILES"
 
-
-for ac_tag in  :F $CONFIG_FILES  :H $CONFIG_HEADERS
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_t"; then
+    break
+  elif $ac_last_try; then
+    as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # 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.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  as_fn_error "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    "
+shift
+for ac_tag
 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; }; };;
+  :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;;
   :[FH]-) ac_tag=-:-;;
   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
   esac
@@ -7269,26 +6539,34 @@
 	   [\\/$]*) 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; }; };;
+	   as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;;
       esac
-      ac_file_inputs="$ac_file_inputs $ac_f"
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      as_fn_append 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."
+    configure_input='Generated from '`
+	  $as_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;}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
     fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
 
     case $ac_tag in
-    *:-:* | *:-) cat >"$tmp/stdin";;
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || as_fn_error "could not create $ac_file" "$LINENO" 5 ;;
     esac
     ;;
   esac
@@ -7298,7 +6576,7 @@
 	 X"$ac_file" : 'X\(//\)[^/]' \| \
 	 X"$ac_file" : 'X\(//\)$' \| \
 	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$ac_file" |
+$as_echo X"$ac_file" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
 	    s//\1/
 	    q
@@ -7316,55 +6594,15 @@
 	    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; }; }; }
+  as_dir="$ac_dir"; as_fn_mkdir_p
   ac_builddir=.
 
 case "$ac_dir" in
 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
 *)
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
   # A ".." for each directory in $ac_dir_suffix.
-  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  ac_top_builddir_sub=`$as_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/ ;;
@@ -7404,12 +6642,12 @@
   esac
 _ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # 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/ {
+ac_sed_dataroot='
+/datarootdir/ {
   p
   q
 }
@@ -7417,36 +6655,37 @@
 /@docdir@/p
 /@infodir@/p
 /@localedir@/p
-/@mandir@/p
-' $ac_file_inputs` in
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $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;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
 _ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
   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' ;;
+  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
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
 $extrasub
 _ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 :t
 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s&@configure_input@&$configure_input&;t t
+s|@configure_input@|$ac_sed_conf_input|;t t
 s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
 s&@srcdir@&$ac_srcdir&;t t
 s&@abs_srcdir@&$ac_abs_srcdir&;t t
 s&@top_srcdir@&$ac_top_srcdir&;t t
@@ -7456,119 +6695,48 @@
 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
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || as_fn_error "could not create $ac_file" "$LINENO" 5
 
 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'
+  { $as_echo "$as_me:${as_lineno-$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'
+$as_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
-  -) cat "$tmp/out"; rm -f "$tmp/out";;
-  *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
-  esac
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  esac \
+  || as_fn_error "could not create $ac_file" "$LINENO" 5
  ;;
   :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.
-# (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 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"' "$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 conftest.tail
-
-echo "ac_result=$ac_in" >>$CONFIG_STATUS
-cat >>$CONFIG_STATUS <<\_ACEOF
   if test x"$ac_file" != x-; 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;}
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+    } >"$tmp/config.h" \
+      || as_fn_error "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
     else
-      rm -f $ac_file
-      mv "$tmp/config.h" $ac_file
+      rm -f "$ac_file"
+      mv "$tmp/config.h" "$ac_file" \
+	|| as_fn_error "could not create $ac_file" "$LINENO" 5
     fi
   else
-    echo "/* $configure_input  */"
-    cat "$ac_result"
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error "could not create -" "$LINENO" 5
   fi
-  rm -f "$tmp/out12"
  ;;
 
 
@@ -7577,11 +6745,13 @@
 done # for ac_tag
 
 
-{ (exit 0); exit 0; }
+as_fn_exit 0
 _ACEOF
-chmod +x $CONFIG_STATUS
 ac_clean_files=$ac_clean_files_save
 
+test $ac_write_fail = 0 ||
+  as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
 
 # configure is writing to config.log, and then calls config.status.
 # config.status does its own redirection, appending to config.log.
@@ -7601,6 +6771,10 @@
   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.
-  $ac_cs_success || { (exit 1); exit 1; }
-fi
-
+  $ac_cs_success || as_fn_exit $?
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
--- a/configure.in	Sun Apr 12 01:41:50 2009 +0000
+++ b/configure.in	Sun Oct 03 00:34:36 2010 +0000
@@ -5,7 +5,7 @@
 DW_MINOR_VERSION=1
 DW_SUB_VERSION=0
 
-TARGET="dw"
+TARGET="dwindows"
 TARGET2="dwcompat"
 AC_SUBST(TARGET)
 AC_SUBST(TARGET2)
@@ -59,6 +59,27 @@
    [with_gtk=no],
 )
 
+dnl ---------------------- check for '--with-gtkhtml' switch -----------------
+AC_ARG_WITH(gtkhtml,
+   [  --with-gtkhtml          specify this to build dwindows with libgtkhtml-2],
+   [with_gtkhtml=$withval],
+   [with_gtkhtml=no],
+)
+
+dnl ---------------------- check for '--with-gtkmozembed' switch -----------------
+AC_ARG_WITH(gtkmozembed,
+   [  --with-gtkmozembed      specify this to build dwindows with Mozilla gtkmozembed],
+   [with_gtkmozembed=$withval],
+   [with_gtkmozembed=no],
+)
+
+dnl ---------------------- check for '--with-arch' switch -----------------
+AC_ARG_WITH(arch,
+   [  --with-arch             specify architecture: one of all, 32bit, 64bit, ppc, ppc64, x86_64, i386],
+   [with_arch=$withval],
+   [with_arch=no],
+)
+
 AC_HEADER_STDC
 AC_HEADER_DIRENT
 AC_CHECK_HEADERS(unistd.h)
@@ -86,21 +107,41 @@
 AC_CHECK_LIB(dgc, inet_addr, LIBS="$LIBS -ldgc",)
 AC_CHECK_LIB(resolv, gethostbyname, LIBS="$LIBS -lresolv",)
 
+SONAME=""
 OPSYSTEM=`uname -s`
-case "OPSYSTEM" in
+case "$OPSYSTEM" in
    MINGW32*)
       AC_DEFINE(DW_USE_GTK)
    ;;
+   *Linux*)
+      SONAME="-Wl,-soname,lib$TARGET.so.$DW_MAJOR_VERSION"
+   ;;
 esac
 
 if test $OPSYSTEM = "Darwin"; then
-   ARCH="-arch ppc -arch ppc64 -arch x86_64 -arch i386"
-   SHAREDFLAG="-dynamiclib -flat_namespace -undefined suppress $ARCH"
+   case "$with_arch" in
+      no)
+         ARCH=""
+         ;;
+      all)
+         ARCH="-arch ppc -arch ppc64 -arch x86_64 -arch i386"
+         ;;
+      32bit)
+         ARCH="-arch ppc -arch i386"
+         ;;
+      64bit)
+         ARCH="-arch ppc84 -arch x86_64"
+         ;;
+      *)
+         ARCH="-arch $with_arch"
+         ;;
+   esac
+   SHAREDFLAG="-dynamiclib -flat_namespace -undefined suppress"
    SOSUFFIX=dylib
    if test $with_gtk = yes; then
       DW_SRC=gtk
       LIBS="$LIBS -framework Gtk -framework Glib -framework Cairo"
-      GTK_CFLAGS="-I/Library/Frameworks/Gtk.framework/Headers -I/Library/Frameworks/Glib.framework/Headers -I/Library/Frameworks/Cairo.framework/Headers $ARCH"
+      GTK_CFLAGS="-I/Library/Frameworks/Gtk.framework/Headers -I/Library/Frameworks/Glib.framework/Headers -I/Library/Frameworks/Cairo.framework/Headers"
    else
       DW_SRC=mac
       DW_DEFINE=__MAC__
@@ -110,13 +151,39 @@
    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-`
+      if test $with_gtkmozembed = yes; then
+         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
+      elif test $with_gtkhtml = yes; then
+         MOZEMBED_LIBS=`$PKG_CFG --silence-errors --libs libgtkhtml-2.0`
+         MOZEMBED_CFLAGS=`$PKG_CFG --silence-errors --cflags libgtkhtml-2.0`
+         RPATH=`$PKG_CFG --silence-errors --libs-only-L libgtkhtml-2.0 | cut -b 3-`
+      else
+         WEBKIT_LIB="webkit-1.1"
+         MOZEMBED_CFLAGS=`$PKG_CFG --silence-errors --cflags $WEBKIT_LIB`
+         RPATH=`$PKG_CFG --silence-errors --libs-only-L $WEBKIT_LIB | cut -b 3-`
+         if test x"$MOZEMBED_CFLAGS" = x; then
+            WEBKIT_LIB="webkit-1.0"
+            MOZEMBED_CFLAGS=`$PKG_CFG --silence-errors --cflags $WEBKIT_LIB`
+            RPATH=`$PKG_CFG --silence-errors --libs-only-L $WEBKIT_LIB | cut -b 3-`
+            if test x"$MOZEMBED_CFLAGS" = x; then
+               WEBKIT_LIB="WebKitGtk"
+#               MOZEMBED_LIBS=`$PKG_CFG --silence-errors --libs $WEBKIT_LIB`
+               MOZEMBED_CFLAGS=`$PKG_CFG --silence-errors --cflags $WEBKIT_LIB`
+               RPATH=`$PKG_CFG --silence-errors --libs-only-L $WEBKIT_LIB | cut -b 3-`
+            else
+               AC_DEFINE(USE_WEBKIT10)
+            fi
+         else
+            AC_DEFINE(USE_WEBKIT11)
+         fi
+         AC_DEFINE_UNQUOTED(WEBKIT_LIB, "$WEBKIT_LIB")
       fi
       if test x"$RPATH" != x; then
          RPATH="-Wl,-R$RPATH"
@@ -152,11 +219,18 @@
 CFLAGS="$CFLAGS $GTK_CFLAGS $GDK_IMLIB_FLAGS $MOZEMBED_CFLAGS"
 
 BROWSER_OBJECT=""
-if test x"$MOZEMBED_LIBS" != x; then
+if test x"$MOZEMBED_CFLAGS" != x; then
    SAVE_LIBS="$LIBS"
    LIBS="$RPATH $LIBS $GTK_LIBS $PTHREAD_LIBS $GDK_IMLIB_LIBS $MOZEMBED_LIBS"
    BROWSER_OBJECT="browser.o"
-   AC_CHECK_LIB(gtkembedmoz,gtk_moz_embed_new,AC_DEFINE(USE_GTKMOZEMBED),BROWSER_OBJECT="")
+   if test $with_gtkmozembed = yes; then
+      AC_CHECK_LIB(gtkembedmoz,gtk_moz_embed_new,AC_DEFINE(USE_GTKMOZEMBED),BROWSER_OBJECT="")
+   elif test $with_gtkhtml = yes; then
+      AC_CHECK_LIB(gtkhtml-2,html_document_new,AC_DEFINE(USE_LIBGTKHTML2),BROWSER_OBJECT="")
+   else
+      AC_CHECK_LIB($WEBKIT_LIB,webkit_web_view_new,AC_DEFINE(USE_WEBKIT),BROWSER_OBJECT="")
+      BROWSER_OBJECT=""
+   fi
    LIBS="$SAVE_LIBS"
 fi
 
@@ -177,6 +251,7 @@
 AC_SUBST(MKDIR)
 AC_SUBST(SHAREDFLAG)
 AC_SUBST(SOSUFFIX)
+AC_SUBST(SONAME)
 
 AC_SUBST(DW_SRC)
 AC_SUBST(DW_DEFINE)
@@ -184,7 +259,9 @@
 AC_SUBST(COMPAT_OBJECT)
 AC_SUBST(INSTALL_COMPAT)
 
+AC_SUBST(ARCH)
+
 AC_CONFIG_FILES([
 Makefile
-dw-config ])
+dwindows-config ])
 AC_OUTPUT
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/changelog	Sun Oct 03 00:34:36 2010 +0000
@@ -0,0 +1,6 @@
+dwindows (1.1-1) unstable; urgency=low
+
+  * Initial debian release
+
+ -- Mark Hessling <mark@rexx.org>  Sun, 12 Apr 2009 13:18:35 +1000
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/compat	Sun Oct 03 00:34:36 2010 +0000
@@ -0,0 +1,1 @@
+5
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/control	Sun Oct 03 00:34:36 2010 +0000
@@ -0,0 +1,14 @@
+Source: dwindows
+Section: devel
+Priority: optional
+Maintainer: Mark Hessling <mark@rexx.org>
+Build-Depends: debhelper (>= 5), autotools-dev
+Standards-Version: 3.7.2
+
+Package: dwindows
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: Dynamic Windows is a lightweight GUI API for C.
+ dwindows provides a high-level wrapper over GTK+ to provide
+ a simple, lightweight GUI hiding some of the complexity of GTK+.
+ It provides the same API for GTK+, native Windows and OS/2.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/copyright	Sun Oct 03 00:34:36 2010 +0000
@@ -0,0 +1,48 @@
+This package was debianized by Mark Hessling <mark@rexx.org> on
+Sun, 12 Apr 2009 13:18:35 +1000.
+
+Upstream Authors:
+
+    Brian Smith <dbsoft@technologist.com>
+    Mark Hessling <mark@rexx.org>
+    Nickolay V. Shmyrev <shmyrev@yandex.ru>
+    Achim Hasenmueller <achimha@innotek.de>
+    Peter Nielsen <peter@pmview.com>
+    Sergey I. Yevtushenko
+
+Copyright:
+
+    Copyright (c) 2000-2009, Brian Smith
+    Copyright (c) 2003-2010, Mark Hessling
+    Copyright (c) 2002, Nickolay V. Shmyrev
+    Copyright (c) 2000, Achim Hasenmueller
+    Copyright (c) 2000, Peter Nielsen
+    Copyright (c) 1998, Sergey I. Yevtushenko
+    All rights reserved.
+
+License:
+
+    Redistribution and use in source and binary forms, with or without modification,
+    are permitted provided that the following conditions are met:
+
+     * Redistributions of source code must retain the above copyright notice, this
+        list of conditions and the following disclaimer.
+     * Redistributions in binary form must reproduce the above copyright notice,
+        this list of conditions and the following disclaimer in the documentation and/or
+        other materials provided with the distribution.
+     * The names of its contributors may not be used to endorse or promote products
+        derived from this software without specific prior written permission.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+    ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+    OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+    THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+    OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+The Debian packaging is (C) 2009, Mark Hessling <mark@rexx.org> and
+is licensed under the GPL, see `/usr/share/common-licenses/GPL'.
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/rules	Sun Oct 03 00:34:36 2010 +0000
@@ -0,0 +1,99 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+# These are used for cross-compiling and for saving the configure script
+# from having to guess our platform (since we know it already)
+DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+
+
+config.status: configure
+	dh_testdir
+	# Add here commands to configure the package.
+ifneq "$(wildcard /usr/share/misc/config.sub)" ""
+	cp -f /usr/share/misc/config.sub config.sub
+endif
+ifneq "$(wildcard /usr/share/misc/config.guess)" ""
+	cp -f /usr/share/misc/config.guess config.guess
+endif
+	./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs"
+
+
+build: build-stamp
+
+build-stamp:  config.status
+	dh_testdir
+
+	# Add here commands to compile the package.
+	$(MAKE)
+	#docbook-to-man debian/dwindows.sgml > dwindows.1
+
+	touch $@
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp
+
+	# Add here commands to clean up after the build process.
+	-$(MAKE) distclean
+	rm -f config.sub config.guess
+
+	dh_clean
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+
+	# Add here commands to install the package into debian/dwindows.
+	$(MAKE) prefix=$(CURDIR)/debian/dwindows/usr install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs
+	dh_installdocs
+	dh_installexamples
+#	dh_install
+#	dh_installmenu
+#	dh_installdebconf
+#	dh_installlogrotate
+#	dh_installemacsen
+#	dh_installpam
+#	dh_installmime
+#	dh_python
+#	dh_installinit
+#	dh_installcron
+#	dh_installinfo
+	dh_installman
+	dh_link
+	dh_strip
+	dh_compress
+	dh_fixperms
+#	dh_perl
+	dh_makeshlibs
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install
--- a/dw-config.in	Sun Apr 12 01:41:50 2009 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-#!/bin/sh
-
-dw_libs="@LIBS@"
-dw_cflags="@CFLAGS@ -D@DW_DEFINE@"
-
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-exec_prefix_set=no
-
-usage()
-{
-	cat <<EOF
-Usage: dw-config [OPTIONS]
-Options:
-	[--prefix[=DIR]]
-	[--exec-prefix[=DIR]]
-	[--version]
-	[--libs]
-	[--cflags]
-EOF
-	exit $1
-}
-
-if test $# -eq 0; then
-	usage 1 1>&2
-fi
-
-while test $# -gt 0; do
-  case "$1" in
-  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
-  *) optarg= ;;
-  esac
-
-  case $1 in
-    --prefix=*)
-      prefix=$optarg
-      if test $exec_prefix_set = no ; then
-        exec_prefix=$optarg
-      fi
-      ;;
-    --prefix)
-      echo_prefix=yes
-      ;;
-    --exec-prefix=*)
-      exec_prefix=$optarg
-      exec_prefix_set=yes
-      ;;
-    --version)
-      echo @DW_MAJOR_VERSION@.@DW_MINOR_VERSION@.@DW_SUB_VERSION@
-      ;;
-    --cflags)
-      echo_cflags=yes
-      ;;
-    --libs)
-      echo_libs=yes
-      ;;
-    *)
-      usage 1 1>&2
-      ;;
-  esac
-  shift
-done
-
-if test "$echo_prefix" = "yes"; then
-	echo $prefix
-fi
-
-if test "$echo_exec_prefix" = "yes"; then
-	echo $exec_prefix
-fi
-
-if test "$echo_cflags" = "yes"; then
-      echo -I${prefix}/include $dw_cflags
-fi
-
-if test "$echo_libs" = "yes"; then
-      echo -L${prefix}/lib -ldw $dw_libs
-fi
-
--- a/dw.def	Sun Apr 12 01:41:50 2009 +0000
+++ b/dw.def	Sun Oct 03 00:34:36 2010 +0000
@@ -91,6 +91,7 @@
   dw_listbox_selected                    @149
   dw_listbox_selected_multi              @150
   dw_listbox_list_append                 @151
+  dw_listbox_insert                      @152
 
   dw_percent_new                         @160
   dw_percent_set_pos                     @162
--- a/dw.h	Sun Apr 12 01:41:50 2009 +0000
+++ b/dw.h	Sun Oct 03 00:34:36 2010 +0000
@@ -81,9 +81,9 @@
 
 typedef struct _user_data
 {
-	struct _user_data *next;
-	void              *data;
-	char              *varname;
+   struct _user_data *next;
+   void              *data;
+   char              *varname;
 } UserData;
 
 /* OS/2 Specific section */
@@ -217,20 +217,20 @@
 #define VK_RMENU             VK_MENU
 
 typedef struct _window_data {
-	PFNWP oldproc;
-	UserData *root;
-	HWND clickdefault;
-	ULONG flags;
-	void *data;
+   PFNWP oldproc;
+   UserData *root;
+   HWND clickdefault;
+   ULONG flags;
+   void *data;
 } WindowData;
 
 typedef struct _hpixmap {
-	unsigned long width, height;
-	HDC hdc;
-	HPS hps;
-	HBITMAP hbm;
-	HWND handle;
-	unsigned long transcolor;
+   unsigned long width, height;
+   HDC hdc;
+   HPS hps;
+   HBITMAP hbm;
+   HWND handle;
+   unsigned long transcolor;
 } *HPIXMAP;
 
 typedef void *HTREEITEM;
@@ -267,16 +267,16 @@
 typedef MenuRef HMENUI;
 
 typedef struct _window_data {
-	UserData *root;
-	HWND clickdefault;
-	ULONG flags;
-	void *data;
+   UserData *root;
+   HWND clickdefault;
+   ULONG flags;
+   void *data;
 } WindowData;
 
 typedef struct _hpixmap {
-	unsigned long width, height;
-	/* ?? *pixmap; */
-	HWND handle;
+   unsigned long width, height;
+   /* ?? *pixmap; */
+   HWND handle;
 } *HPIXMAP;
 
 #define DW_DT_LEFT               0
@@ -346,7 +346,7 @@
 #define DW_POINTER_ARROW         0
 #define DW_POINTER_CLOCK         watchCursor
 
-#define HWND_DESKTOP		 ((HWND)0)
+#define HWND_DESKTOP     ((HWND)0)
 
 /* flag values for dw_messagebox() */
 #define DW_MB_OK                 (1 << 1)
@@ -496,7 +496,7 @@
 #define DW_FCF_NOMOVEWITHOWNER   0
 #define DW_FCF_SYSMODAL          0
 #define DW_FCF_HIDEBUTTON        WS_MINIMIZEBOX
-#define DW_FCF_HIDEMAX           0
+#define DW_FCF_HIDEMAX           (WS_MINIMIZEBOX|WS_MAXIMIZEBOX)
 #define DW_FCF_AUTOICON          0
 #define DW_FCF_MAXIMIZE          WS_MAXIMIZE
 #define DW_FCF_MINIMIZE          WS_MINIMIZE
@@ -558,24 +558,24 @@
 #define DefaultFont NULL
 
 typedef struct _color {
-	int fore;
-	int back;
-	HWND combo, buddy;
-	int user;
-	int vcenter;
-	HWND clickdefault;
-	HBRUSH hbrush;
-	HFONT hfont;
-	char fontname[128];
-	WNDPROC pOldProc;
-	UserData *root;
+   int fore;
+   int back;
+   HWND combo, buddy;
+   int user;
+   int vcenter;
+   HWND clickdefault;
+   HBRUSH hbrush;
+   HFONT hfont;
+   char fontname[128];
+   WNDPROC pOldProc;
+   UserData *root;
 } ColorInfo;
 
 typedef struct _notebookpage {
-	ColorInfo cinfo;
-	TC_ITEM item;
-	HWND hwnd;
-	int realid;
+   ColorInfo cinfo;
+   TC_ITEM item;
+   HWND hwnd;
+   int realid;
 } NotebookPage;
 
 typedef HANDLE HMTX;
@@ -584,82 +584,82 @@
 typedef HANDLE HSHM;
 
 typedef struct _container {
-	ColorInfo cinfo;
-	ULONG *flags;
-	WNDPROC pOldProc;
-	ULONG columns;
+   ColorInfo cinfo;
+   ULONG *flags;
+   WNDPROC pOldProc;
+   ULONG columns;
 } ContainerInfo;
 
 typedef struct _hpixmap {
-	unsigned long width, height;
-	HBITMAP hbm;
-	HDC hdc;
-	unsigned long transcolor;
-	HWND handle;
-	void *bits;
+   unsigned long width, height;
+   HBITMAP hbm;
+   HDC hdc;
+   unsigned long transcolor;
+   HWND handle;
+   void *bits;
 } *HPIXMAP;
 
 typedef HWND HMENUI;
 #endif
 
 typedef struct _item {
-	/* Item type - Box or Item */
-	int type;
-	/* Handle to Frame or Window */
-	HWND hwnd;
-	/* Width and Height of static size */
-	int width, height, origwidth, origheight;
-	/* Size Type - Static or Expand */
-	int hsize, vsize;
-	/* Padding */
-	int pad;
-	/* Ratio of current item */
-	float xratio, yratio;
+   /* Item type - Box or Item */
+   int type;
+   /* Handle to Frame or Window */
+   HWND hwnd;
+   /* Width and Height of static size */
+   int width, height, origwidth, origheight;
+   /* Size Type - Static or Expand */
+   int hsize, vsize;
+   /* Padding */
+   int pad;
+   /* Ratio of current item */
+   float xratio, yratio;
 } Item;
 
 typedef struct _box {
 #if defined(__WIN32__) || defined(WINNT)
-	ColorInfo cinfo;
+   ColorInfo cinfo;
 #elif defined(__OS2__) || defined(__EMX__)
-	PFNWP oldproc;
-	UserData *root;
-	HWND hwndtitle, hwnd;
-	int titlebar;
+   PFNWP oldproc;
+   UserData *root;
+   HWND hwndtitle, hwnd;
+   int titlebar;
 #endif
-	/* Number of items in the box */
-	int count;
-	/* Box type - horizontal or vertical */
-	int type;
-	/* Padding */
-	int pad, parentpad, grouppadx, grouppady;
-	/* Groupbox */
-	HWND grouphwnd;
-	/* Default item */
-	HWND defaultitem;
-	/* Used as temporary storage in the calculation stage */
-	int upx, upy, minheight, minwidth;
-	/* Ratio in this box */
-	float xratio, yratio, parentxratio, parentyratio;
-	/* Used for calculating individual item ratios */
-	int width, height;
-	/* Any combinations of flags describing the box */
-	unsigned long flags;
-	/* Array of item structures */
-	struct _item *items;
+   /* Number of items in the box */
+   int count;
+   /* Box type - horizontal or vertical */
+   int type;
+   /* Padding */
+   int pad, parentpad, grouppadx, grouppady;
+   /* Groupbox */
+   HWND grouphwnd;
+   /* Default item */
+   HWND defaultitem;
+   /* Used as temporary storage in the calculation stage */
+   int upx, upy, minheight, minwidth;
+   /* Ratio in this box */
+   float xratio, yratio, parentxratio, parentyratio;
+   /* Used for calculating individual item ratios */
+   int width, height;
+   /* Any combinations of flags describing the box */
+   unsigned long flags;
+   /* Array of item structures */
+   struct _item *items;
 } Box;
 
 typedef struct _bubblebutton {
 #if defined(__WIN32__) || defined(WINNT)
-	ColorInfo cinfo;
-	int checkbox;
-	WNDPROC pOldProc;
+   ColorInfo cinfo;
+   int checkbox;
+   WNDPROC pOldProc;
 #endif
 #if defined(__OS2__) || defined(__EMX__)
-	PFNWP pOldProc;
-	UserData *root;
+   PFNWP pOldProc;
+   UserData *root;
 #endif
-	unsigned long id;
-	char bubbletext[BUBBLE_HELP_MAX];
+   unsigned long id;
+   char bubbletext[BUBBLE_HELP_MAX];
 } BubbleButton;
 
 #else
@@ -855,19 +855,19 @@
 typedef int INT;
 typedef pthread_mutex_t *HMTX;
 typedef struct _dw_unix_event {
-	pthread_mutex_t mutex;
-	pthread_cond_t event;
-	pthread_t thread;
-	int alive;
-	int posted;
+   pthread_mutex_t mutex;
+   pthread_cond_t event;
+   pthread_t thread;
+   int alive;
+   int posted;
 } *HEV;
 typedef pthread_t DWTID;
 typedef void * HMOD;
 struct _dw_unix_shm {
-	int fd;
-	char *path;
-	int sid;
-	int size;
+   int fd;
+   char *path;
+   int sid;
+   int size;
 };
 
 typedef struct _hpixmap {
@@ -882,8 +882,8 @@
 typedef void *HSHM;
 
 typedef struct _resource_struct {
-	long resource_max, *resource_id;
-	char **resource_data;
+   long resource_max, *resource_id;
+   char **resource_data;
 } DWResources;
 
 #if !defined(DW_RESOURCES) || defined(BUILD_DLL)
@@ -897,18 +897,18 @@
 #if !defined(__OS2__) && !defined(__EMX__)
 typedef struct _CDATE
 {
-	UCHAR  day;
-	UCHAR  month;
-	USHORT year;
+   UCHAR  day;
+   UCHAR  month;
+   USHORT year;
 } CDATE;
 typedef CDATE *PCDATE;
 
 typedef struct _CTIME
 {
-	UCHAR hours;
-	UCHAR minutes;
-	UCHAR seconds;
-	UCHAR ucReserved;
+   UCHAR hours;
+   UCHAR minutes;
+   UCHAR seconds;
+   UCHAR ucReserved;
 } CTIME;
 typedef CTIME *PCTIME;
 #endif
@@ -918,25 +918,25 @@
 #endif
 
 typedef struct _dwenv {
-	/* Operating System Name and DW Build Date/Time */
-	char osName[30], buildDate[30], buildTime[30];
-	/* Versions and builds */
-	short MajorVersion, MinorVersion, MajorBuild, MinorBuild;
-	/* Dynamic Window version */
-	short DWMajorVersion, DWMinorVersion, DWSubVersion;
+   /* Operating System Name and DW Build Date/Time */
+   char osName[30], buildDate[30], buildTime[30];
+   /* Versions and builds */
+   short MajorVersion, MinorVersion, MajorBuild, MinorBuild;
+   /* Dynamic Window version */
+   short DWMajorVersion, DWMinorVersion, DWSubVersion;
 } DWEnv;
 
 
 typedef struct _dwexpose {
-	int x, y;
-	int width, height;
+   int x, y;
+   int width, height;
 } DWExpose;
 
 typedef struct _dwdialog {
-	HEV eve;
-	int done;
-	int method;
-	void *data, *result;
+   HEV eve;
+   int done;
+   int method;
+   void *data, *result;
 } DWDialog;
 
 #define DW_SIGNAL_FUNC(a) ((void *)a)
@@ -999,12 +999,13 @@
 #define DW_ERROR_INTERRUPT 5
 
 /* Embedded HTML actions */
-#define DW_HTML_GOBACK		0
-#define DW_HTML_GOFORWARD	1
-#define DW_HTML_GOHOME		2
-#define DW_HTML_SEARCH		3
-#define DW_HTML_RELOAD		4
-#define DW_HTML_STOP		5
+#define DW_HTML_GOBACK     0
+#define DW_HTML_GOFORWARD  1
+#define DW_HTML_GOHOME     2
+#define DW_HTML_SEARCH     3
+#define DW_HTML_RELOAD     4
+#define DW_HTML_STOP       5
+#define DW_HTML_PRINT      6
 
 #ifndef API
 #define API
@@ -1076,6 +1077,7 @@
 HWND API dw_checkbox_new(char *text, unsigned long id);
 HWND API dw_listbox_new(unsigned long id, int multi);
 void API dw_listbox_append(HWND handle, char *text);
+void API dw_listbox_insert(HWND handle, char *text, int pos);
 void API dw_listbox_list_append(HWND handle, char **text, int count);
 void API dw_listbox_clear(HWND handle);
 int API dw_listbox_count(HWND handle);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dwindows-config.1	Sun Oct 03 00:34:36 2010 +0000
@@ -0,0 +1,30 @@
+.TH dwindows-config 1 "12 Apr 2009" "dwindows" "GNU/Linux"
+.SH NAME
+dwindows-config \- get information about installed dwindows library
+.SH SYNOPSIS
+.B dwindows-config
+[\fIOPTION\fR] ...
+.SH DESCRIPTION
+Provides information about dwindows library.
+
+Known values for OPTION are:
+.TP
+\fB\-\-prefix\fR
+print dwindows prefix
+.TP
+\fB\-\-libs\fR
+print library linking information
+.TP
+\fB\-\-cflags\fR
+print preprocessor flags, I_opts, and compiler options
+.TP
+\fB\-\-help\fR
+print this help and exit
+.TP
+\fB\-\-version\fR
+print version information
+.SH "AUTHOR"
+This manpage has been written by Mark hessling <mark@rexx.org>
+based on libpng12-config.1.
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dwindows-config.in	Sun Oct 03 00:34:36 2010 +0000
@@ -0,0 +1,79 @@
+#!/bin/sh
+
+dw_libs="@LIBS@"
+dw_cflags="@CFLAGS@ -D@DW_DEFINE@"
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+exec_prefix_set=no
+
+usage()
+{
+	cat <<EOF
+Usage: dwindows-config [OPTIONS]
+Options:
+	[--prefix[=DIR]]
+	[--exec-prefix[=DIR]]
+	[--version]
+	[--libs]
+	[--cflags]
+EOF
+	exit $1
+}
+
+if test $# -eq 0; then
+	usage 1 1>&2
+fi
+
+while test $# -gt 0; do
+  case "$1" in
+  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+  *) optarg= ;;
+  esac
+
+  case $1 in
+    --prefix=*)
+      prefix=$optarg
+      if test $exec_prefix_set = no ; then
+        exec_prefix=$optarg
+      fi
+      ;;
+    --prefix)
+      echo_prefix=yes
+      ;;
+    --exec-prefix=*)
+      exec_prefix=$optarg
+      exec_prefix_set=yes
+      ;;
+    --version)
+      echo @DW_MAJOR_VERSION@.@DW_MINOR_VERSION@.@DW_SUB_VERSION@
+      ;;
+    --cflags)
+      echo_cflags=yes
+      ;;
+    --libs)
+      echo_libs=yes
+      ;;
+    *)
+      usage 1 1>&2
+      ;;
+  esac
+  shift
+done
+
+if test "$echo_prefix" = "yes"; then
+	echo $prefix
+fi
+
+if test "$echo_exec_prefix" = "yes"; then
+	echo $exec_prefix
+fi
+
+if test "$echo_cflags" = "yes"; then
+      echo -I${prefix}/include $dw_cflags
+fi
+
+if test "$echo_libs" = "yes"; then
+      echo -L${prefix}/lib -ldwindows $dw_libs
+fi
+
--- a/dwtest.c	Sun Apr 12 01:41:50 2009 +0000
+++ b/dwtest.c	Sun Oct 03 00:34:36 2010 +0000
@@ -16,48 +16,14 @@
 #define FIXEDFONT "monospace 10"
 #define FOLDER_ICON_NAME "gtk/folder"
 #define FILE_ICON_NAME "gtk/file"
-#define FOLDER_DATA_NAME folder_xpm
-#define FOLDER_DATA_LENGTH sizeof(folder_xpm)
 #else
 #define FIXEDFONT "fixed"
 #define FOLDER_ICON_NAME "gtk/folder"
 #define FILE_ICON_NAME "gtk/file"
-#define FOLDER_DATA_NAME folder_xpm
-#define FOLDER_DATA_LENGTH sizeof(folder_xpm)
 #endif
 
 #define SCROLLBARWIDTH 14
 
-/* XPM */
-static char * folder_xpm[] = {
-"16 16 10 1",
-" 	c None",
-".	c #000000",
-"+	c #AA9200",
-"@	c #FFFFAA",
-"#	c #FFDB55",
-"$	c #000000",
-"%	c #F7F7F7",
-"&	c #000000",
-"*	c #FFDBAA",
-"=	c #D5B655",
-"                ",
-"  &&&&          ",
-" &%%%%&         ",
-"&%@@@@%+++++$   ",
-"&@@@@@@%%%%%$   ",
-"&@*++++++++++++ ",
-"&#+%%%%%%%%%*%+$",
-"&#+@@@@@@@@@#@+$",
-"&#+@@@@@@@@@.@+$",
-"&#+@@**@**@@=@+$",
-"&#+@########=@+$",
-"&#+@########=@+$",
-" ++++++++++++++$",
-"  $$$$$$$$$$$$$ ",
-"                ",
-"                "};
-
 unsigned long flStyle = DW_FCF_SYSMENU | DW_FCF_TITLEBAR |
    DW_FCF_SHELLPOSITION | DW_FCF_TASKLIST | DW_FCF_DLGBORDER;
 
@@ -996,6 +962,9 @@
       free(text[i]);
    }
    free(text);
+   /* now insert a couple of items */
+   dw_listbox_insert( combobox2, "inserted item 2", 2 );
+   dw_listbox_insert( combobox2, "inserted item 5", 5 );
    /* make a spinbutton */
    spinbutton = dw_spinbutton_new( "", 0 ); /* no point in specifying text */
    dw_box_pack_start( combox, spinbutton, 200, 20, TRUE, FALSE, 0);
--- a/dww-mingw.def	Sun Apr 12 01:41:50 2009 +0000
+++ b/dww-mingw.def	Sun Oct 03 00:34:36 2010 +0000
@@ -88,6 +88,7 @@
   dw_listbox_selected                    @149
   dw_listbox_selected_multi              @150
   dw_listbox_list_append                 @151
+  dw_listbox_insert                      @152
 
   dw_percent_new                         @160
   dw_percent_set_pos                     @162
--- a/dww.def	Sun Apr 12 01:41:50 2009 +0000
+++ b/dww.def	Sun Oct 03 00:34:36 2010 +0000
@@ -88,6 +88,7 @@
   dw_listbox_selected                    @149
   dw_listbox_selected_multi              @150
   dw_listbox_list_append                 @151
+  dw_listbox_insert                      @152
 
   dw_percent_new                         @160
   dw_percent_set_pos                     @162
--- a/gtk/dw.c	Sun Apr 12 01:41:50 2009 +0000
+++ b/gtk/dw.c	Sun Oct 03 00:34:36 2010 +0000
@@ -31,11 +31,25 @@
 #ifdef USE_IMLIB
 #include <gdk_imlib.h>
 #endif
+
 #ifdef USE_GTKMOZEMBED
-#include <gtkmozembed.h>
-#undef GTK_TYPE_MOZ_EMBED
-#define GTK_TYPE_MOZ_EMBED             (_dw_moz_embed_get_type())
-#endif
+# include <gtkmozembed.h>
+# undef GTK_TYPE_MOZ_EMBED
+# define GTK_TYPE_MOZ_EMBED             (_dw_moz_embed_get_type())
+#endif
+
+#ifdef USE_LIBGTKHTML2
+# include <libgtkhtml/gtkhtml.h>
+#endif
+
+#ifdef USE_WEBKIT
+# if defined(USE_WEBKIT10) || defined(USE_WEBKIT11)
+#  include <webkit/webkit.h>
+# else
+#  include <webkit.h>
+# endif
+#endif
+
 #if GTK_MAJOR_VERSION > 1
 #include <gdk-pixbuf/gdk-pixbuf.h>
 #endif
@@ -83,14 +97,17 @@
    { 0, 0xffff, 0xffff, 0xffff },   /* 15 bright white */
 };
 
+/*
+ * List those icons that have transparency first
+ */
 #define NUM_EXTS 5
 char *image_exts[NUM_EXTS] =
 {
    ".xpm",
    ".png",
-   ".bmp",
+   ".ico",
    ".jpg",
-   ".ico",
+   ".bmp",
 };
 
 #define DW_THREAD_LIMIT 50
@@ -123,7 +140,7 @@
 /* Use default border size for the default enlightenment theme */
 static int _dw_border_width = 12, _dw_border_height = 28;
 
-#define  DW_MUTEX_LOCK { int index = _find_thread_index(dw_thread_id()); if(pthread_self() != _dw_thread && _dw_mutex_locked[index] == FALSE) { gdk_threads_enter(); _dw_mutex_locked[index] = TRUE; _locked_by_me = TRUE;  } }
+#define  DW_MUTEX_LOCK { int index = _find_thread_index(dw_thread_id()); if(pthread_self() != _dw_thread && _dw_mutex_locked[index] == FALSE) { gdk_threads_enter(); _dw_mutex_locked[index] = TRUE; _locked_by_me = TRUE; } }
 #define  DW_MUTEX_UNLOCK { if(pthread_self() != _dw_thread && _locked_by_me == TRUE) { gdk_threads_leave(); _dw_mutex_locked[_find_thread_index(dw_thread_id())] = FALSE; _locked_by_me = FALSE; } }
 
 #define DEFAULT_SIZE_WIDTH 12
@@ -170,6 +187,38 @@
 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;
+void (*_gtk_moz_embed_set_comp_path)(const char *) = NULL;
+void (*_gtk_moz_embed_set_profile_path)(const char *, const char *) = NULL;
+void (*_gtk_moz_embed_push_startup)(void) = NULL;
+#endif
+
+#ifdef USE_LIBGTKHTML2
+GtkHtmlContext *(*_gtk_html_context_get)(void) = NULL;
+HtmlDocument *(*_html_document_new)(void) = NULL;
+GtkWidget *(*_html_view_new)(void) = NULL;
+#endif
+
+#ifdef USE_WEBKIT
+/*
+ * we need to add these equivalents from webkitwebview.h so we can refer to
+ * our own pointers to functions (we don't link with the webkit libraries
+ */
+# define DW_WEBKIT_TYPE_WEB_VIEW            (_webkit_web_view_get_type())
+# define DW_WEBKIT_WEB_VIEW(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), DW_WEBKIT_TYPE_WEB_VIEW, WebKitWebView))
+WEBKIT_API GType (*_webkit_web_view_get_type)(void) = NULL;
+WEBKIT_API void (*_webkit_web_view_load_html_string)(WebKitWebView *, const gchar *, const gchar *) = NULL;
+WEBKIT_API void (*_webkit_web_view_open)(WebKitWebView *, const gchar *) = NULL;
+WEBKIT_API GtkWidget *(*_webkit_web_view_new)(void) = NULL;
+WEBKIT_API void (*_webkit_web_view_go_back)(WebKitWebView *) = NULL;
+WEBKIT_API void (*_webkit_web_view_go_forward)(WebKitWebView *) = NULL;
+WEBKIT_API void (*_webkit_web_view_reload)(WebKitWebView *) = NULL;
+WEBKIT_API void (*_webkit_web_view_stop_loading)(WebKitWebView *) = NULL;
+# ifdef WEBKIT_CHECK_VERSION
+#  if WEBKIT_CHECK_VERSION(1,1,5)
+WEBKIT_API void (*_webkit_web_frame_print)(WebKitWebFrame *) = NULL;
+WEBKIT_API WebKitWebFrame *(*_webkit_web_view_get_focused_frame)(WebKitWebView *) = NULL;
+#  endif
+# endif
 #endif
 
 typedef struct
@@ -232,6 +281,8 @@
 #define DW_CENTER 0.5f
 #define DW_LEFT 0.0f
 #define DW_RIGHT 1.0f
+#define DW_TOP 0.0f
+#define DW_BOTTOM 1.0f
 
 /* MDI Support Code */
 #if GTK_MAJOR_VERSION > 1
@@ -1979,16 +2030,71 @@
       _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");
+      _gtk_moz_embed_set_comp_path = dlsym(handle, "gtk_moz_embed_set_comp_path");
+      _gtk_moz_embed_set_profile_path = dlsym(handle, "gtk_moz_embed_set_profile_path");
+      _gtk_moz_embed_push_startup = dlsym(handle, "gtk_moz_embed_push_startup");
+      _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");
+      _gtk_moz_embed_set_profile_path(profile, "dwindows");
       g_free(profile);
 
       /* startup done */
-      gtk_moz_embed_push_startup();
+      _gtk_moz_embed_push_startup();
+   }
+}
+#endif
+
+/* Try to load the libgtkhtml2 shared libary */
+#ifdef USE_LIBGTKHTML2
+#include <ctype.h>
+
+void init_libgtkhtml2 (void)
+{
+   void *handle = NULL;
+   handle = dlopen( "libgtkhtml-2.so", RTLD_LAZY );
+
+   /* If we loaded it, grab the symbols we want */
+   if ( handle )
+   {
+      _html_document_new = dlsym(handle, "html_document_new");
+      _html_view_new = dlsym(handle, "html_view_new");
+      //...
+      _gtk_html_context_get = dlsym(handle, "gtk_html_context_get" );
+      g_object_set( G_OBJECT(_gtk_html_context_get()), "debug_painting", FALSE, NULL );
+   }
+}
+#endif
+
+/* Try to load the WebKitGtk shared libary */
+#ifdef USE_WEBKIT
+void init_webkit(void)
+{
+   char libname[100];
+   void *handle = NULL;
+
+   sprintf( libname, "lib%s.so", WEBKIT_LIB);
+   handle = dlopen( libname, RTLD_LAZY );
+
+   /* If we loaded it, grab the symbols we want */
+   if ( handle )
+   {
+      _webkit_web_view_get_type = dlsym( handle, "webkit_web_view_get_type" );
+      _webkit_web_view_load_html_string = dlsym( handle, "webkit_web_view_load_html_string" );
+      _webkit_web_view_open = dlsym( handle, "webkit_web_view_open" );
+      _webkit_web_view_new = dlsym( handle, "webkit_web_view_new" );
+      _webkit_web_view_go_back = dlsym( handle, "webkit_web_view_go_back" );
+      _webkit_web_view_go_forward = dlsym( handle, "webkit_web_view_go_forward" );
+      _webkit_web_view_reload = dlsym( handle, "webkit_web_view_reload" );
+      _webkit_web_view_stop_loading = dlsym( handle, "webkit_web_view_stop_loading" );
+# ifdef WEBKIT_CHECK_VERSION
+#  if WEBKIT_CHECK_VERSION(1,1,5)
+      _webkit_web_frame_print = dlsym( handle, "webkit_web_frame_print" );
+      _webkit_web_view_get_focused_frame = dlsym( handle, "webkit_web_view_get_focused_frame" );
+#  endif
+# endif
    }
 }
 #endif
@@ -2041,6 +2147,14 @@
 #ifdef USE_GTKMOZEMBED
    init_mozembed();
 #endif
+
+#ifdef USE_LIBGTKHTML2
+   init_libgtkhtml2();
+#endif
+
+#ifdef USE_WEBKIT
+   init_webkit();
+#endif
    /*
     * Setup logging/debugging
     */
@@ -2139,14 +2253,16 @@
 {
    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;
+   if ( tmp )
+   {
+      tmp->eve = dw_event_new();
+      dw_event_reset(tmp->eve);
+      tmp->data = data;
+      tmp->done = FALSE;
+      tmp->method = FALSE;
+      tmp->result = NULL;
+   }
+   return tmp;
 }
 
 /*
@@ -2340,6 +2456,7 @@
    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);
+#if 0
    height = height+3;
    if(width < text_width)
       text_height = height*2;
@@ -2352,6 +2469,10 @@
       text_width = (width / 3) + 60;
       text_height = height*4;
    }
+#else
+text_width = min( width, dw_screen_width() - extra_width - 100 );
+text_height = min( height, dw_screen_height() );
+#endif
    dw_box_pack_start(texttargetbox, stext, text_width, text_height, TRUE, TRUE, 2);
 
    /* Buttons */
@@ -2400,7 +2521,7 @@
    }
 
    height = max(50,text_height)+100;
-   x = (dw_screen_width() - (text_width+60+extra_width))/2;
+   x = ( - (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);
@@ -2704,6 +2825,71 @@
    return TRUE;
 }
 
+/*
+ * Gets the font used by a specified window (widget) handle.
+ * Parameters:
+ *          handle: The window (widget) handle.
+ */
+char *dw_window_get_font(HWND handle)
+{
+#if GTK_MAJOR_VERSION > 1
+   PangoFontDescription *pfont;
+   PangoContext *pcontext;
+#else
+   GdkFont *gdkfont;
+#endif
+   GtkWidget *handle2 = handle;
+   char *font;
+   char *retfont=NULL;
+   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;
+   }
+
+#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
+
+#if 0
+   /* 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);
+#endif
+
+#if GTK_MAJOR_VERSION > 1
+   pcontext = gtk_widget_get_pango_context( handle2 );
+   if ( pcontext )
+   {
+      pfont = pango_context_get_font_description( pcontext );
+      if ( pfont )
+      {
+         font = pango_font_description_to_string( pfont );
+         retfont = strdup(font);
+         g_free( font );
+      }
+   }
+#endif
+   DW_MUTEX_UNLOCK;
+   return retfont;
+}
+
 void _free_gdk_colors(HWND handle)
 {
    GdkColor *old = (GdkColor *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_foregdk");
@@ -3283,7 +3469,7 @@
 /*
  * Adds a menuitem or submenu to an existing menu.
  * Parameters:
- *       menu: The handle the the existing menu.
+ *       menu: The handle to the existing menu.
  *       title: The title text on the menu item to be added.
  *       id: An ID to be used for message passing.
  *       flags: Extended attributes to set on the menu.
@@ -4199,7 +4385,7 @@
       /* check if we can read from this file (it exists and read permission) */
       if ( access(file, 04 ) != 0 )
       {
-         /* Try with .xpm extention */
+         /* Try with various extentions */
          for ( i = 0; i < NUM_EXTS; i++ )
          {
             strcpy( file, filename );
@@ -6191,6 +6377,8 @@
 #endif
    char *file = alloca(strlen(filename) + 5);
    unsigned long z, ret = 0;
+   int found_ext = 0;
+   int i;
 
    if (!file)
       return 0;
@@ -6200,10 +6388,21 @@
    /* check if we can read from this file (it exists and read permission) */
    if (access(file, 04) != 0)
    {
-      /* Try with .xpm extention */
-      strcat(file, ".xpm");
-      if(access(file, 04) != 0)
+      /* Try with various extentions */
+      for ( i = 0; i < NUM_EXTS; i++ )
+      {
+         strcpy( file, filename );
+         strcat( file, image_exts[i] );
+         if ( access( file, 04 ) == 0 )
+         {
+            found_ext = 1;
+            break;
+         }
+      }
+      if ( found_ext == 0 )
+      {
          return 0;
+      }
    }
 
    DW_MUTEX_LOCK;
@@ -7537,13 +7736,21 @@
    GdkFont *font;
 #endif
    char *fontname = NULL;
+   int free_fontname = 0;
 
    if(!text)
       return;
 
    DW_MUTEX_LOCK;
    if(handle)
+   {
       fontname = (char *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_fontname");
+      if ( fontname == NULL )
+      {
+         fontname = dw_window_get_font(handle);
+         free_fontname = 1;
+      }
+   }
    else if(pixmap)
       fontname = (char *)gtk_object_get_data(GTK_OBJECT(pixmap->handle), "_dw_fontname");
 
@@ -7590,6 +7797,8 @@
       gdk_font_unref(font);
    }
 #endif
+   if ( free_fontname )
+      free( fontname );
    DW_MUTEX_UNLOCK;
 }
 
@@ -7649,6 +7858,8 @@
    GdkImlibImage *image;
 #endif
    char *file = alloca(strlen(filename) + 5);
+   int found_ext = 0;
+   int i;
 
    if (!file || !(pixmap = calloc(1,sizeof(struct _hpixmap))))
       return NULL;
@@ -7658,9 +7869,18 @@
    /* check if we can read from this file (it exists and read permission) */
    if(access(file, 04) != 0)
    {
-      /* Try with .xpm extention */
-      strcat(file, ".xpm");
-      if(access(file, 04) != 0)
+      /* Try with various extentions */
+      for ( i = 0; i < NUM_EXTS; i++ )
+      {
+         strcpy( file, filename );
+         strcat( file, image_exts[i] );
+         if ( access( file, 04 ) == 0 )
+         {
+            found_ext = 1;
+            break;
+         }
+      }
+      if ( found_ext == 0 )
       {
          free(pixmap);
          return NULL;
@@ -9049,24 +9269,26 @@
       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);
+   if ( GTK_IS_LABEL(handle2) )
+   {
+      gfloat x=DW_LEFT, y=DW_CENTER;
+      /* horizontal... */
+      if ( style & DW_DT_CENTER )
+         x = DW_CENTER;
+      if ( style & DW_DT_RIGHT )
+         x = DW_RIGHT;
+      if ( style & DW_DT_LEFT )
+         x = DW_LEFT;
+      /* vertical... */
+      if ( style & DW_DT_VCENTER )
+         y = DW_CENTER;
+      if ( style & DW_DT_TOP )
+         y = DW_TOP;
+      if ( style & DW_DT_BOTTOM )
+         y = DW_BOTTOM;
+      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;
 }
@@ -9345,9 +9567,69 @@
 
       if(addtext)
       {
+         char *defstr = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(handle2)->entry));
          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_entry_set_text(GTK_ENTRY(GTK_COMBO(handle2)->entry), defstr);
+      }
+   }
+   gtk_object_set_data(GTK_OBJECT(handle), "_dw_appending", NULL);
+   DW_MUTEX_UNLOCK;
+}
+
+/*
+ * Inserts the specified text int the listbox's (or combobox) entry list at the
+ * position indicated.
+ * Parameters:
+ *          handle: Handle to the listbox to be appended to.
+ *          text: Text to insert into listbox.
+ *          pos: 0-based index into listbox. -1 will append
+ */
+void dw_listbox_insert(HWND handle, char *text, int pos)
+{
+   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_insert(NULL, list_item, pos);
+      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_insert(tmp, addtext, pos);
+         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);
@@ -10721,26 +11003,85 @@
    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
-}
-
+      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;
+#elif defined(USE_WEBKIT)
+   int _locked_by_me = FALSE;
+   WebKitWebView *web_view;
+   WebKitWebFrame *frame;
+
+   if (!_webkit_web_view_open)
+      return;
+
+   DW_MUTEX_LOCK;
+   web_view = (WebKitWebView *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_web_view");
+   if ( web_view )
+   {
+      switch( action )
+      {
+         case DW_HTML_GOBACK:
+            _webkit_web_view_go_back( web_view );
+            break;
+         case DW_HTML_GOFORWARD:
+            _webkit_web_view_go_forward( web_view );
+            break;
+         case DW_HTML_GOHOME:
+            _webkit_web_view_open( web_view, "http://dwindows.netlabs.org" );
+            break;
+         case DW_HTML_RELOAD:
+            _webkit_web_view_reload( web_view );
+            break;
+         case DW_HTML_STOP:
+            _webkit_web_view_stop_loading( web_view );
+            break;
+# ifdef WEBKIT_CHECK_VERSION
+#  if WEBKIT_CHECK_VERSION(1,1,5)
+         case DW_HTML_PRINT:
+            frame = _webkit_web_view_get_focused_frame( web_view );
+            _webkit_web_frame_print( frame );
+            break;
+#  endif
+# endif
+      }
+   }
+   DW_MUTEX_UNLOCK;
+#endif
+}
+
+#ifdef USE_LIBGTKHTML2
+void _dw_html_render_data( HWND handle, char *string, int i )
+{
+   HtmlDocument *document;
+
+   html_view_set_document (HTML_VIEW(handle), NULL);
+   document = (HtmlDocument *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_html_document" );
+/*   html_document_clear (document);*/
+   if ( document )
+   {
+      html_view_set_document (HTML_VIEW(handle), document);
+      if ( html_document_open_stream( document, "text/html" ) )
+      {
+         html_document_write_stream( document, string, i );
+      }
+      html_document_close_stream (document);
+   }
+}
+#endif
 /*
  * Render raw HTML code in the embedded HTML widget..
  * Parameters:
@@ -10755,7 +11096,7 @@
 #ifdef USE_GTKMOZEMBED
    int _locked_by_me = FALSE;
 
-   if(!_gtk_moz_embed_new)
+   if (!_gtk_moz_embed_new)
       return -1;
 
    DW_MUTEX_LOCK;
@@ -10763,6 +11104,33 @@
    gtk_widget_show(GTK_WIDGET(handle));
    DW_MUTEX_UNLOCK;
    return 0;
+#elif defined(USE_LIBGTKHTML2)
+   int _locked_by_me = FALSE;
+
+   if ( !_html_document_new )
+      return -1;
+
+   DW_MUTEX_LOCK;
+   _dw_html_render_data( handle, string, strlen(string) );
+   gtk_widget_show( GTK_WIDGET(handle) );
+   DW_MUTEX_UNLOCK;
+   return 0;
+#elif defined(USE_WEBKIT)
+   int _locked_by_me = FALSE;
+   WebKitWebView *web_view;
+
+   if (!_webkit_web_view_open)
+      return -1;
+
+   DW_MUTEX_LOCK;
+   web_view = (WebKitWebView *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_web_view");
+   if ( web_view )
+   {
+      _webkit_web_view_load_html_string( web_view, string, "file:///");
+      gtk_widget_show( GTK_WIDGET(handle) );
+   }
+   DW_MUTEX_UNLOCK;
+   return 0;
 #endif
    return -1;
 }
@@ -10789,6 +11157,22 @@
    gtk_widget_show(GTK_WIDGET(handle));
    DW_MUTEX_UNLOCK;
    return 0;
+#elif defined( USE_WEBKIT )
+   int _locked_by_me = FALSE;
+   WebKitWebView *web_view;
+
+   if (!_webkit_web_view_open)
+      return -1;
+
+   DW_MUTEX_LOCK;
+   web_view = (WebKitWebView *)gtk_object_get_data(GTK_OBJECT(handle), "_dw_web_view");
+   if ( web_view )
+   {
+      _webkit_web_view_open( web_view, url );
+      gtk_widget_show(GTK_WIDGET(handle));
+   }
+   DW_MUTEX_UNLOCK;
+   return 0;
 #endif
    return -1;
 }
@@ -10883,6 +11267,63 @@
 }
 #endif
 
+#ifdef USE_LIBGTKHTML2
+static gboolean dom_mouse_down( HtmlDocument *doc, DomMouseEvent *event, gpointer data )
+{
+fprintf(stderr,"mouse down\n");
+return TRUE;
+}
+static gboolean dom_mouse_up( HtmlDocument *doc, DomMouseEvent *event, gpointer data )
+{
+fprintf(stderr,"mouse up\n");
+return TRUE;
+}
+static gboolean dom_mouse_click( HtmlDocument *doc, DomMouseEvent *event, gpointer data )
+{
+fprintf(stderr,"mouse click\n");
+return TRUE;
+}
+static gboolean url_requested (HtmlDocument *doc, const gchar *url, HtmlStream *stream)
+{
+fprintf(stderr,"URL IS REQUESTED: %s\n",url);
+return TRUE;
+}
+static void link_clicked (HtmlDocument *doc, const gchar *url)
+{
+fprintf(stderr,"link clicked: %s!\n", url);
+}
+#endif
+
+#ifdef USE_WEBKIT
+# ifdef WEBKIT_CHECK_VERSION
+#  if WEBKIT_CHECK_VERSION(1,1,5)
+static void _dw_html_print_cb( GtkWidget *widget, gpointer *data )
+{
+   WebKitWebView *web_view = DW_WEBKIT_WEB_VIEW(data);
+   WebKitWebFrame *frame;
+
+   frame = _webkit_web_view_get_focused_frame( web_view );
+   _webkit_web_frame_print( frame );
+}
+/*
+ * Fired when the user right-clicks to get the popup-menu on the HTML widget
+ * We add a "Print" menu item to enable printing
+ * user_data is not used
+ */
+static void _dw_html_populate_popup_cb( WebKitWebView *web_view, GtkMenu *menu, gpointer user_data )
+{
+   GtkWidget *image = gtk_image_new_from_stock( GTK_STOCK_PRINT, GTK_ICON_SIZE_MENU );
+   GtkWidget *item = gtk_image_menu_item_new_with_label( "Print" );
+
+   gtk_image_menu_item_set_image( GTK_IMAGE_MENU_ITEM(item), image );
+   gtk_menu_append( GTK_MENU(menu), item);
+   g_signal_connect( item, "activate", G_CALLBACK(_dw_html_print_cb), web_view );
+   gtk_widget_show(item);
+}
+#  endif
+# endif
+#endif
+
 /*
  * Create a new Entryfield window (widget) to be packed.
  * Parameters:
@@ -10911,11 +11352,54 @@
       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 );
    }
+#elif defined(USE_LIBGTKHTML2)
+   if ( !_html_document_new )
+   {
+      widget = dw_box_new(DW_HORZ, 0);
+      stext = dw_text_new( "HTML widget not available; you do not have access to libgtkhtml-2.", 0);
+      dw_box_pack_start(widget, stext, 0, 0, TRUE, TRUE, 10);
+   }
+   else
+   {
+      HtmlDocument *document;
+      document = html_document_new ();
+      g_signal_connect (G_OBJECT (document), "dom_mouse_down",  G_CALLBACK (dom_mouse_down), NULL);
+      g_signal_connect (G_OBJECT (document), "dom_mouse_up", G_CALLBACK (dom_mouse_up), NULL);
+      g_signal_connect (G_OBJECT (document), "dom_mouse_click", G_CALLBACK (dom_mouse_click), NULL);
+      g_signal_connect (G_OBJECT (document), "request_url",  G_CALLBACK (url_requested), NULL);
+      g_signal_connect (G_OBJECT (document), "link_clicked", G_CALLBACK (link_clicked), NULL);
+      widget = _html_view_new();
+      gtk_object_set_data(GTK_OBJECT(widget), "_dw_html_document", (gpointer)document);
+   }
+#elif defined(USE_WEBKIT)
+   if (!_webkit_web_view_open)
+   {
+      widget = dw_box_new(DW_HORZ, 0);
+      stext = dw_text_new( "HTML widget not available; you do not have access to webkit.", 0);
+      dw_box_pack_start(widget, stext, 0, 0, TRUE, TRUE, 10);
+   }
+   else
+   {
+      WebKitWebView *web_view;
+      widget = gtk_scrolled_window_new (NULL, NULL);
+      gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW (widget), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
+      web_view = (WebKitWebView *)_webkit_web_view_new();
+/*      web_view = WEBKIT_WEB_VIEW(_webkit_web_view_new() ); */
+      gtk_container_add( GTK_CONTAINER (widget), GTK_WIDGET(web_view) );
+      gtk_widget_show( GTK_WIDGET(web_view) );
+      gtk_object_set_data( GTK_OBJECT(widget), "_dw_web_view", (gpointer)web_view );
+# ifdef WEBKIT_CHECK_VERSION
+#  if WEBKIT_CHECK_VERSION(1,1,5)
+      g_signal_connect( web_view, "populate-popup", G_CALLBACK(_dw_html_populate_popup_cb), NULL );
+#  endif
+# endif
+   }
 #else
    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
+   gtk_widget_show(widget);
    DW_MUTEX_UNLOCK;
    return widget;
 }
--- a/license.txt	Sun Apr 12 01:41:50 2009 +0000
+++ b/license.txt	Sun Oct 03 00:34:36 2010 +0000
@@ -1,21 +1,30 @@
-Copyright Information About Dynamic Windows.
 
-2000-2004 Brian Smith <dbsoft@technologist.com>
-2003-2004 Mark Hessling <m.hessling@qut.edu.au>
-2002 Nickolay V. Shmyrev <shmyrev@yandex.ru>
-2000 Achim Hasenmueller <achimha@innotek.de>
-2000 Peter Nielsen <peter@pmview.com>
-1998 Sergey I. Yevtushenko
+Copyright (c) 2000-2009, Brian Smith <dbsoft@technologist.com>
+Copyright (c) 2003-2010, Mark Hessling <mark@rexx.org>
+Copyright (c) 2002, Nickolay V. Shmyrev <shmyrev@yandex.ru>
+Copyright (c) 2000, Achim Hasenmueller <achimha@innotek.de>
+Copyright (c) 2000, Peter Nielsen <peter@pmview.com>
+Copyright (c) 1998, Sergey I. Yevtushenko
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
 
-This license allows you to use this source code in any way you wish, given the
-following restrictions:
+ * Redistributions of source code must retain the above copyright notice, this
+    list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation and/or
+    other materials provided with the distribution.
+ * The names of its contributors may not be used to endorse or promote products
+    derived from this software without specific prior written permission.
 
-Source code must keep the copyrights.
-Entities using the source code must acknowledge Dynamic Windows contributors.
-(either passively when queried or actively by acknowledgements in the program)
-The following are not allowed to use Dynamic Windows in a commercial product:
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-F/X Communications
-Any entity associated with Bjarne Jensen
-
-
--- a/makefile.vc	Sun Apr 12 01:41:50 2009 +0000
+++ b/makefile.vc	Sun Oct 03 00:34:36 2010 +0000
@@ -14,7 +14,7 @@
 FXDLLDIR=.\dll
 
 !if "$(DEBUG)" == "Y"
-CFLAGS_DEBUG = -Z7 -Od # was -Zi
+CFLAGS_DEBUG = -DDEBUG -Z7 -Od # was -Zi
 LINK_DEBUG = -debug:full
 !else
 CFLAGS_DEBUG = -Ox
--- a/os2/dw.c	Sun Apr 12 01:41:50 2009 +0000
+++ b/os2/dw.c	Sun Oct 03 00:34:36 2010 +0000
@@ -60,22 +60,22 @@
 HMOD wpconfig = 0;
 
 unsigned long _colors[] = {
-	CLR_BLACK,
-	CLR_DARKRED,
-	CLR_DARKGREEN,
-	CLR_BROWN,
-	CLR_DARKBLUE,
-	CLR_DARKPINK,
-	CLR_DARKCYAN,
-	CLR_PALEGRAY,
-	CLR_DARKGRAY,
-	CLR_RED,
-	CLR_GREEN,
-	CLR_YELLOW,
-	CLR_BLUE,
-	CLR_PINK,
-	CLR_CYAN,
-	CLR_WHITE
+   CLR_BLACK,
+   CLR_DARKRED,
+   CLR_DARKGREEN,
+   CLR_BROWN,
+   CLR_DARKBLUE,
+   CLR_DARKPINK,
+   CLR_DARKCYAN,
+   CLR_PALEGRAY,
+   CLR_DARKGRAY,
+   CLR_RED,
+   CLR_GREEN,
+   CLR_YELLOW,
+   CLR_BLUE,
+   CLR_PINK,
+   CLR_CYAN,
+   CLR_WHITE
 };
 
 #define IS_WARP4() (aulBuffer[0] == 20 && aulBuffer[1] >= 40)
@@ -86,12 +86,12 @@
 
 typedef struct _sighandler
 {
-	struct _sighandler	*next;
-	ULONG message;
-	HWND window;
-	int id;
-	void *signalfunction;
-	void *data;
+   struct _sighandler   *next;
+   ULONG message;
+   HWND window;
+   int id;
+   void *signalfunction;
+   void *data;
 
 } SignalHandler;
 
@@ -99,8 +99,8 @@
 
 typedef struct
 {
-	ULONG message;
-	char name[30];
+   ULONG message;
+   char name[30];
 
 } SignalList;
 
@@ -108,131 +108,131 @@
 #define SIGNALMAX 16
 
 SignalList SignalTranslate[SIGNALMAX] = {
-	{ WM_SIZE,         DW_SIGNAL_CONFIGURE },
-	{ WM_CHAR,         DW_SIGNAL_KEY_PRESS },
-	{ WM_BUTTON1DOWN,  DW_SIGNAL_BUTTON_PRESS },
-	{ WM_BUTTON1UP,    DW_SIGNAL_BUTTON_RELEASE },
-	{ WM_MOUSEMOVE,    DW_SIGNAL_MOTION_NOTIFY },
-	{ WM_CLOSE,        DW_SIGNAL_DELETE },
-	{ WM_PAINT,        DW_SIGNAL_EXPOSE },
-	{ WM_COMMAND,      DW_SIGNAL_CLICKED },
-	{ CN_ENTER,        DW_SIGNAL_ITEM_ENTER },
-	{ CN_CONTEXTMENU,  DW_SIGNAL_ITEM_CONTEXT },
-	{ LN_SELECT,       DW_SIGNAL_LIST_SELECT },
-	{ CN_EMPHASIS,     DW_SIGNAL_ITEM_SELECT },
-	{ WM_SETFOCUS,     DW_SIGNAL_SET_FOCUS },
-	{ SLN_SLIDERTRACK, DW_SIGNAL_VALUE_CHANGED },
-	{ BKN_PAGESELECTED,DW_SIGNAL_SWITCH_PAGE },
-	{ CN_EXPANDTREE,   DW_SIGNAL_TREE_EXPAND }
+   { WM_SIZE,         DW_SIGNAL_CONFIGURE },
+   { WM_CHAR,         DW_SIGNAL_KEY_PRESS },
+   { WM_BUTTON1DOWN,  DW_SIGNAL_BUTTON_PRESS },
+   { WM_BUTTON1UP,    DW_SIGNAL_BUTTON_RELEASE },
+   { WM_MOUSEMOVE,    DW_SIGNAL_MOTION_NOTIFY },
+   { WM_CLOSE,        DW_SIGNAL_DELETE },
+   { WM_PAINT,        DW_SIGNAL_EXPOSE },
+   { WM_COMMAND,      DW_SIGNAL_CLICKED },
+   { CN_ENTER,        DW_SIGNAL_ITEM_ENTER },
+   { CN_CONTEXTMENU,  DW_SIGNAL_ITEM_CONTEXT },
+   { LN_SELECT,       DW_SIGNAL_LIST_SELECT },
+   { CN_EMPHASIS,     DW_SIGNAL_ITEM_SELECT },
+   { WM_SETFOCUS,     DW_SIGNAL_SET_FOCUS },
+   { SLN_SLIDERTRACK, DW_SIGNAL_VALUE_CHANGED },
+   { BKN_PAGESELECTED,DW_SIGNAL_SWITCH_PAGE },
+   { CN_EXPANDTREE,   DW_SIGNAL_TREE_EXPAND }
 };
 
 /* This function adds a signal handler callback into the linked list.
  */
 void _new_signal(ULONG message, HWND window, int id, void *signalfunction, void *data)
 {
-	SignalHandler *new = malloc(sizeof(SignalHandler));
-
-	new->message = message;
-	new->window = window;
-	new->id = id;
-	new->signalfunction = signalfunction;
-	new->data = data;
-	new->next = NULL;
-
-	if (!Root)
-		Root = new;
-	else
-	{
-		SignalHandler *prev = NULL, *tmp = Root;
-		while(tmp)
-		{
-			if(tmp->message == message &&
-			   tmp->window == window &&
-			   tmp->id == id &&
-			   tmp->signalfunction == signalfunction)
-			{
-				tmp->data = data;
-				free(new);
-				return;
-			}
-			prev = tmp;
-			tmp = tmp->next;
-		}
-		if(prev)
-			prev->next = new;
-		else
-			Root = new;
-	}
+   SignalHandler *new = malloc(sizeof(SignalHandler));
+
+   new->message = message;
+   new->window = window;
+   new->id = id;
+   new->signalfunction = signalfunction;
+   new->data = data;
+   new->next = NULL;
+
+   if (!Root)
+      Root = new;
+   else
+   {
+      SignalHandler *prev = NULL, *tmp = Root;
+      while(tmp)
+      {
+         if(tmp->message == message &&
+            tmp->window == window &&
+            tmp->id == id &&
+            tmp->signalfunction == signalfunction)
+         {
+            tmp->data = data;
+            free(new);
+            return;
+         }
+         prev = tmp;
+         tmp = tmp->next;
+      }
+      if(prev)
+         prev->next = new;
+      else
+         Root = new;
+   }
 }
 
 /* Finds the message number for a given signal name */
 ULONG _findsigmessage(char *signame)
 {
-	int z;
-
-	for(z=0;z<SIGNALMAX;z++)
-	{
-		if(stricmp(signame, SignalTranslate[z].name) == 0)
-			return SignalTranslate[z].message;
-	}
-	return 0L;
+   int z;
+
+   for(z=0;z<SIGNALMAX;z++)
+   {
+      if(stricmp(signame, SignalTranslate[z].name) == 0)
+         return SignalTranslate[z].message;
+   }
+   return 0L;
 }
 
 typedef struct _CNRITEM
 {
-	MINIRECORDCORE rc;
-	HPOINTER       hptrIcon;
-	PVOID          user;
-	HTREEITEM      parent;
+   MINIRECORDCORE rc;
+   HPOINTER       hptrIcon;
+   PVOID          user;
+   HTREEITEM      parent;
 
 } CNRITEM, *PCNRITEM;
 
 
 int _null_key(HWND window, int key, void *data)
 {
-	window = window; /* keep compiler happy */
-	key = key; /* keep compiler happy */
-	data = data; /* keep compiler happy */
-	return TRUE;
+   window = window; /* keep compiler happy */
+   key = key; /* keep compiler happy */
+   data = data; /* keep compiler happy */
+   return TRUE;
 }
 
 /* Find the desktop window handle */
 HWND _toplevel_window(HWND handle)
 {
-	HWND box, lastbox = WinQueryWindow(handle, QW_PARENT);
-
-	/* Find the toplevel window */
-	while((box = WinQueryWindow(lastbox, QW_PARENT)) != desktop && box > 0)
-	{
-		lastbox = box;
-	}
-	if(box > 0)
-		return lastbox;
-	return handle;
+   HWND box, lastbox = WinQueryWindow(handle, QW_PARENT);
+
+   /* Find the toplevel window */
+   while((box = WinQueryWindow(lastbox, QW_PARENT)) != desktop && box > 0)
+   {
+      lastbox = box;
+   }
+   if(box > 0)
+      return lastbox;
+   return handle;
 }
 
 
 /* Returns height of specified window. */
 int _get_height(HWND handle)
 {
-	unsigned long height;
-	dw_window_get_pos_size(handle, NULL, NULL, NULL, &height);
-	return (int)height;
+   unsigned long height;
+   dw_window_get_pos_size(handle, NULL, NULL, NULL, &height);
+   return (int)height;
 }
 
 /* Find the height of the frame a desktop style window is sitting on */
 int _get_frame_height(HWND handle)
 {
-	while(handle)
-	{
-		HWND client;
-		if((client = WinWindowFromID(handle, FID_CLIENT)) != NULLHANDLE)
-		{
+   while(handle)
+   {
+      HWND client;
+      if((client = WinWindowFromID(handle, FID_CLIENT)) != NULLHANDLE)
+      {
             return _get_height(WinQueryWindow(handle, QW_PARENT));
-		}
+      }
         handle = WinQueryWindow(handle, QW_PARENT);
-	}
-	return dw_screen_height();
+   }
+   return dw_screen_height();
 }
 
 /* A "safe" WinSendMsg() that tries multiple times in case the
@@ -240,46 +240,46 @@
  */
 MRESULT _dw_send_msg(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2, int failure)
 {
-	MRESULT res;
-	int z = 0;
-
-	while((int)(res = WinSendMsg(hwnd, msg, mp1, mp2)) == failure)
-	{
-		z++;
-		if(z > 5000000)
-			return (MRESULT)failure;
-		dw_main_sleep(1);
-	}
-	return res;
+   MRESULT res;
+   int z = 0;
+
+   while((int)(res = WinSendMsg(hwnd, msg, mp1, mp2)) == failure)
+   {
+      z++;
+      if(z > 5000000)
+         return (MRESULT)failure;
+      dw_main_sleep(1);
+   }
+   return res;
 }
 
 /* Used in the slider and percent classes internally */
 unsigned int _dw_percent_get_range(HWND handle)
 {
-	return SHORT2FROMMP(WinSendMsg(handle, SLM_QUERYSLIDERINFO, MPFROM2SHORT(SMA_SLIDERARMPOSITION,SMA_RANGEVALUE), 0));
+   return SHORT2FROMMP(WinSendMsg(handle, SLM_QUERYSLIDERINFO, MPFROM2SHORT(SMA_SLIDERARMPOSITION,SMA_RANGEVALUE), 0));
 }
 
 /* Return the entryfield child of a window */
 HWND _find_entryfield(HWND handle)
 {
-	HENUM henum;
-	HWND child, entry = 0;
-
-	henum = WinBeginEnumWindows(handle);
-	while((child = WinGetNextWindow(henum)) != NULLHANDLE)
-	{
-		char tmpbuf[100];
-
-		WinQueryClassName(child, 99, tmpbuf);
-
-		if(strncmp(tmpbuf, "#6", 3)==0)  /* Entryfield */
-		{
-			entry = child;
-			break;
-		}
-	}
-	WinEndEnumWindows(henum);
-	return entry;
+   HENUM henum;
+   HWND child, entry = 0;
+
+   henum = WinBeginEnumWindows(handle);
+   while((child = WinGetNextWindow(henum)) != NULLHANDLE)
+   {
+      char tmpbuf[100];
+
+      WinQueryClassName(child, 99, tmpbuf);
+
+      if(strncmp(tmpbuf, "#6", 3)==0)  /* Entryfield */
+      {
+         entry = child;
+         break;
+      }
+   }
+   WinEndEnumWindows(henum);
+   return entry;
 }
 
 /* This function changes the owner of buttons in to the
@@ -287,58 +287,58 @@
  */
 void _fix_button_owner(HWND handle, HWND dw)
 {
-	HENUM henum;
-	HWND child;
-
-	henum = WinBeginEnumWindows(handle);
-	while((child = WinGetNextWindow(henum)) != NULLHANDLE)
-	{
-		char tmpbuf[100];
-
-		WinQueryClassName(child, 99, tmpbuf);
-
-		if(strncmp(tmpbuf, "#3", 3)==0 && dw)  /* Button */
-			WinSetOwner(child, dw);
-		else if(strncmp(tmpbuf, "dynamicwindows", 14) == 0)
-			dw = child;
-
-		_fix_button_owner(child, dw);
-	}
-	WinEndEnumWindows(henum);
-	return;
+   HENUM henum;
+   HWND child;
+
+   henum = WinBeginEnumWindows(handle);
+   while((child = WinGetNextWindow(henum)) != NULLHANDLE)
+   {
+      char tmpbuf[100];
+
+      WinQueryClassName(child, 99, tmpbuf);
+
+      if(strncmp(tmpbuf, "#3", 3)==0 && dw)  /* Button */
+         WinSetOwner(child, dw);
+      else if(strncmp(tmpbuf, "dynamicwindows", 14) == 0)
+         dw = child;
+
+      _fix_button_owner(child, dw);
+   }
+   WinEndEnumWindows(henum);
+   return;
 }
 
 /* Free bitmap data associated with a window */
 void _free_bitmap(HWND handle)
 {
-	HBITMAP hbm = (HBITMAP)dw_window_get_data(handle, "_dw_bitmap");
-	HPS hps = (HPS)dw_window_get_data(handle, "_dw_hps");
-	HDC hdc = (HDC)dw_window_get_data(handle, "_dw_hdc");
-	HPIXMAP pixmap = (HPIXMAP)dw_window_get_data(handle, "_dw_hpixmap");
-	HPIXMAP disable = (HPIXMAP)dw_window_get_data(handle, "_dw_hpixmap_disabled");
-	HPOINTER icon = (HPOINTER)dw_window_get_data(handle, "_dw_button_icon");
-
-	if(icon)
-		WinDestroyPointer(icon);
-
-	if(pixmap)
-		dw_pixmap_destroy(pixmap);
-
-	if(disable)
-		dw_pixmap_destroy(disable);
-
-	if(hps)
-	{
-		GpiSetBitmap(hps, NULLHANDLE);
-		GpiAssociate(hps, NULLHANDLE);
-		GpiDestroyPS(hps);
-	}
-
-	if(hdc)
-		DevCloseDC(hdc);
-
-	if(hbm)
-		GpiDeleteBitmap(hbm);
+   HBITMAP hbm = (HBITMAP)dw_window_get_data(handle, "_dw_bitmap");
+   HPS hps = (HPS)dw_window_get_data(handle, "_dw_hps");
+   HDC hdc = (HDC)dw_window_get_data(handle, "_dw_hdc");
+   HPIXMAP pixmap = (HPIXMAP)dw_window_get_data(handle, "_dw_hpixmap");
+   HPIXMAP disable = (HPIXMAP)dw_window_get_data(handle, "_dw_hpixmap_disabled");
+   HPOINTER icon = (HPOINTER)dw_window_get_data(handle, "_dw_button_icon");
+
+   if(icon)
+      WinDestroyPointer(icon);
+
+   if(pixmap)
+      dw_pixmap_destroy(pixmap);
+
+   if(disable)
+      dw_pixmap_destroy(disable);
+
+   if(hps)
+   {
+      GpiSetBitmap(hps, NULLHANDLE);
+      GpiAssociate(hps, NULLHANDLE);
+      GpiDestroyPS(hps);
+   }
+
+   if(hdc)
+      DevCloseDC(hdc);
+
+   if(hbm)
+      GpiDeleteBitmap(hbm);
 }
 
 /* This function removes any handlers on windows and frees
@@ -346,100 +346,100 @@
  */
 void _free_window_memory(HWND handle)
 {
-	HENUM henum;
-	HWND child;
-	void *ptr = (void *)WinQueryWindowPtr(handle, QWP_USER);
-
-	dw_signal_disconnect_by_window(handle);
-
-	if((child = WinWindowFromID(handle, FID_MENU)) != NULLHANDLE)
-		_free_menu_data(child);
-
-	if((child = WinWindowFromID(handle, FID_CLIENT)) != NULLHANDLE)
-	{
-		Box *box = (Box *)WinQueryWindowPtr(child, QWP_USER);
-
-		if(box)
-		{
-			if(box->count && box->items)
-				free(box->items);
-
-			WinSetWindowPtr(child, QWP_USER, 0);
-			free(box);
-		}
-	}
-
-	if(ptr)
-	{
-		WindowData *wd = (WindowData *)ptr;
-		char tmpbuf[100];
-
-		WinQueryClassName(handle, 99, tmpbuf);
-
-		if(strncmp(tmpbuf, "ColorSelectClass", 17)!=0)
-		{
-			/* If this window has an associate bitmap destroy it. */
-			_free_bitmap(handle);
-
-			if(strncmp(tmpbuf, "#1", 3)==0 && !WinWindowFromID(handle, FID_CLIENT))
-			{
-				Box *box = (Box *)ptr;
-
-				if(box->count && box->items)
-					free(box->items);
-			}
-			else if(strncmp(tmpbuf, SplitbarClassName, strlen(SplitbarClassName)+1)==0)
-			{
-				void *data = dw_window_get_data(handle, "_dw_percent");
-
-				if(data)
-					free(data);
-			}
-			else if(strncmp(tmpbuf, "#37", 4)==0)
-			{
-				dw_container_clear(handle, FALSE);
-				if(wd && dw_window_get_data(handle, "_dw_container"))
-				{
-					void *oldflags = wd->data;
-
-					wd->data = NULL;
-					free(oldflags);
-				}
-			}
-
-			if(wd->oldproc)
-				WinSubclassWindow(handle, wd->oldproc);
-
-			dw_window_set_data(handle, NULL, NULL);
-			WinSetWindowPtr(handle, QWP_USER, 0);
-			free(ptr);
-		}
-	}
-
-	henum = WinBeginEnumWindows(handle);
-	while((child = WinGetNextWindow(henum)) != NULLHANDLE)
-		_free_window_memory(child);
-
-	WinEndEnumWindows(henum);
-	return;
+   HENUM henum;
+   HWND child;
+   void *ptr = (void *)WinQueryWindowPtr(handle, QWP_USER);
+
+   dw_signal_disconnect_by_window(handle);
+
+   if((child = WinWindowFromID(handle, FID_MENU)) != NULLHANDLE)
+      _free_menu_data(child);
+
+   if((child = WinWindowFromID(handle, FID_CLIENT)) != NULLHANDLE)
+   {
+      Box *box = (Box *)WinQueryWindowPtr(child, QWP_USER);
+
+      if(box)
+      {
+         if(box->count && box->items)
+            free(box->items);
+
+         WinSetWindowPtr(child, QWP_USER, 0);
+         free(box);
+      }
+   }
+
+   if(ptr)
+   {
+      WindowData *wd = (WindowData *)ptr;
+      char tmpbuf[100];
+
+      WinQueryClassName(handle, 99, tmpbuf);
+
+      if(strncmp(tmpbuf, "ColorSelectClass", 17)!=0)
+      {
+         /* If this window has an associate bitmap destroy it. */
+         _free_bitmap(handle);
+
+         if(strncmp(tmpbuf, "#1", 3)==0 && !WinWindowFromID(handle, FID_CLIENT))
+         {
+            Box *box = (Box *)ptr;
+
+            if(box->count && box->items)
+               free(box->items);
+         }
+         else if(strncmp(tmpbuf, SplitbarClassName, strlen(SplitbarClassName)+1)==0)
+         {
+            void *data = dw_window_get_data(handle, "_dw_percent");
+
+            if(data)
+               free(data);
+         }
+         else if(strncmp(tmpbuf, "#37", 4)==0)
+         {
+            dw_container_clear(handle, FALSE);
+            if(wd && dw_window_get_data(handle, "_dw_container"))
+            {
+               void *oldflags = wd->data;
+
+               wd->data = NULL;
+               free(oldflags);
+            }
+         }
+
+         if(wd->oldproc)
+            WinSubclassWindow(handle, wd->oldproc);
+
+         dw_window_set_data(handle, NULL, NULL);
+         WinSetWindowPtr(handle, QWP_USER, 0);
+         free(ptr);
+      }
+   }
+
+   henum = WinBeginEnumWindows(handle);
+   while((child = WinGetNextWindow(henum)) != NULLHANDLE)
+      _free_window_memory(child);
+
+   WinEndEnumWindows(henum);
+   return;
 }
 
 void _free_menu_data(HWND menu)
 {
-	int i, count = (int)WinSendMsg(menu, MM_QUERYITEMCOUNT, 0, 0);
-
-	dw_signal_disconnect_by_name(menu, DW_SIGNAL_CLICKED);
-	_free_window_memory(menu);
-
-	for(i=0;i<count;i++)
-	{
-		SHORT menuid = (SHORT)WinSendMsg(menu, MM_ITEMIDFROMPOSITION, MPFROMSHORT(i), 0);
-		MENUITEM mi;
-
-		if(WinSendMsg(menu, MM_QUERYITEM, MPFROMSHORT(menuid), MPFROMP(&mi))
-		   && mi.hwndSubMenu)
-			_free_menu_data(mi.hwndSubMenu);
-	}
+   int i, count = (int)WinSendMsg(menu, MM_QUERYITEMCOUNT, 0, 0);
+
+   dw_signal_disconnect_by_name(menu, DW_SIGNAL_CLICKED);
+   _free_window_memory(menu);
+
+   for(i=0;i<count;i++)
+   {
+      SHORT menuid = (SHORT)WinSendMsg(menu, MM_ITEMIDFROMPOSITION, MPFROMSHORT(i), 0);
+      MENUITEM mi;
+
+      if(WinSendMsg(menu, MM_QUERYITEM, MPFROMSHORT(menuid), MPFROMP(&mi))
+         && mi.hwndSubMenu)
+         _free_menu_data(mi.hwndSubMenu);
+   }
 }
 
 /* This function returns 1 if the window (widget) handle
@@ -447,274 +447,274 @@
  */
 int _validate_focus(HWND handle)
 {
-	char tmpbuf[100];
-
-	if(!handle)
-		return 0;
-
-	WinQueryClassName(handle, 99, tmpbuf);
-
-	if(!WinIsWindowEnabled(handle) ||
-	   (strncmp(tmpbuf, "ColorSelectClass", 17) && dw_window_get_data(handle, "_dw_disabled")))
-		return 0;
-
-	/* These are the window classes which can
-	 * obtain input focus.
-	 */
-	if(strncmp(tmpbuf, "#2", 3)==0 ||  /* Combobox */
-	   strncmp(tmpbuf, "#3", 3)==0 ||  /* Button */
-	   strncmp(tmpbuf, "#6", 3)==0 ||  /* Entryfield */
-	   strncmp(tmpbuf, "#7", 3)==0 ||  /* List box */
-	   strncmp(tmpbuf, "#10", 4)==0 || /* MLE */
-	   strncmp(tmpbuf, "#32", 4)==0 || /* Spinbutton */
-	   strncmp(tmpbuf, "#37", 4)==0 || /* Container */
-	   strncmp(tmpbuf, "#38", 4)== 0)  /* Slider */
-		return 1;
-	return 0;
+   char tmpbuf[100];
+
+   if(!handle)
+      return 0;
+
+   WinQueryClassName(handle, 99, tmpbuf);
+
+   if(!WinIsWindowEnabled(handle) ||
+      (strncmp(tmpbuf, "ColorSelectClass", 17) && dw_window_get_data(handle, "_dw_disabled")))
+      return 0;
+
+   /* These are the window classes which can
+    * obtain input focus.
+    */
+   if(strncmp(tmpbuf, "#2", 3)==0 ||  /* Combobox */
+      strncmp(tmpbuf, "#3", 3)==0 ||  /* Button */
+      strncmp(tmpbuf, "#6", 3)==0 ||  /* Entryfield */
+      strncmp(tmpbuf, "#7", 3)==0 ||  /* List box */
+      strncmp(tmpbuf, "#10", 4)==0 || /* MLE */
+      strncmp(tmpbuf, "#32", 4)==0 || /* Spinbutton */
+      strncmp(tmpbuf, "#37", 4)==0 || /* Container */
+      strncmp(tmpbuf, "#38", 4)== 0)  /* Slider */
+      return 1;
+   return 0;
 }
 
 int _focus_check_box(Box *box, HWND handle, int start, HWND defaultitem)
 {
-	int z;
-	static HWND lasthwnd, firsthwnd;
+   int z;
+   static HWND lasthwnd, firsthwnd;
     static int finish_searching;
 
-	/* Start is 2 when we have cycled completely and
-	 * need to set the focus to the last widget we found
-	 * that was valid.
-	 */
-	if(start == 2)
-	{
-		if(lasthwnd)
-			WinSetFocus(HWND_DESKTOP, lasthwnd);
-		return 0;
-	}
-
-	/* Start is 1 when we are entering the function
-	 * for the first time, it is zero when entering
-	 * the function recursively.
-	 */
-	if(start == 1)
-	{
-		lasthwnd = handle;
-		finish_searching = 0;
-		firsthwnd = 0;
-	}
-
-	for(z=box->count-1;z>-1;z--)
-	{
-		if(box->items[z].type == TYPEBOX)
-		{
-			Box *thisbox = WinQueryWindowPtr(box->items[z].hwnd, QWP_USER);
-
-			if(thisbox && _focus_check_box(thisbox, handle, start == 3 ? 3 : 0, defaultitem))
-				return 1;
-		}
-		else
-		{
-			if(box->items[z].hwnd == handle)
-			{
-				if(lasthwnd == handle && firsthwnd)
-					WinSetFocus(HWND_DESKTOP, firsthwnd);
-				else if(lasthwnd == handle && !firsthwnd)
-					finish_searching = 1;
-				else
-					WinSetFocus(HWND_DESKTOP, lasthwnd);
-
-				/* If we aren't looking for the last handle,
-				 * return immediately.
-				 */
-				if(!finish_searching)
-					return 1;
-			}
-			if(_validate_focus(box->items[z].hwnd))
-			{
-				/* Start is 3 when we are looking for the
-				 * first valid item in the layout.
-				 */
-				if(start == 3)
-				{
-					if(!defaultitem || (defaultitem && defaultitem == box->items[z].hwnd))
-					{
-						WinSetFocus(HWND_DESKTOP, box->items[z].hwnd);
-						return 1;
-					}
-				}
-
-				if(!firsthwnd)
-					firsthwnd = box->items[z].hwnd;
-
-				lasthwnd = box->items[z].hwnd;
-			}
-			else
-			{
-				char tmpbuf[100] = "";
-
-				WinQueryClassName(box->items[z].hwnd, 99, tmpbuf);
-				if(strncmp(tmpbuf, SplitbarClassName, strlen(SplitbarClassName)+1)==0)
-				{
-					/* Then try the bottom or right box */
-					HWND mybox = (HWND)dw_window_get_data(box->items[z].hwnd, "_dw_bottomright");
-
-					if(mybox)
-					{
-						Box *splitbox = (Box *)WinQueryWindowPtr(mybox, QWP_USER);
-
-						if(splitbox && _focus_check_box(splitbox, handle, start == 3 ? 3 : 0, defaultitem))
-							return 1;
-					}
-
-					/* Try the top or left box */
-					mybox = (HWND)dw_window_get_data(box->items[z].hwnd, "_dw_topleft");
-
-					if(mybox)
-					{
-						Box *splitbox = (Box *)WinQueryWindowPtr(mybox, QWP_USER);
-
-						if(splitbox && _focus_check_box(splitbox, handle, start == 3 ? 3 : 0, defaultitem))
-							return 1;
-					}
-				}
-				else if(strncmp(tmpbuf, "#40", 4)==0) /* Notebook */
-				{
-					Box *notebox;
-					HWND page = (HWND)WinSendMsg(box->items[z].hwnd, BKM_QUERYPAGEWINDOWHWND,
-												 (MPARAM)dw_notebook_page_get(box->items[z].hwnd), 0);
-
-					if(page)
-					{
-						notebox = (Box *)WinQueryWindowPtr(page, QWP_USER);
-
-						if(notebox && _focus_check_box(notebox, handle, start == 3 ? 3 : 0, defaultitem))
-							return 1;
-					}
-				}
-			}
-		}
-	}
-	return 0;
+   /* Start is 2 when we have cycled completely and
+    * need to set the focus to the last widget we found
+    * that was valid.
+    */
+   if(start == 2)
+   {
+      if(lasthwnd)
+         WinSetFocus(HWND_DESKTOP, lasthwnd);
+      return 0;
+   }
+
+   /* Start is 1 when we are entering the function
+    * for the first time, it is zero when entering
+    * the function recursively.
+    */
+   if(start == 1)
+   {
+      lasthwnd = handle;
+      finish_searching = 0;
+      firsthwnd = 0;
+   }
+
+   for(z=box->count-1;z>-1;z--)
+   {
+      if(box->items[z].type == TYPEBOX)
+      {
+         Box *thisbox = WinQueryWindowPtr(box->items[z].hwnd, QWP_USER);
+
+         if(thisbox && _focus_check_box(thisbox, handle, start == 3 ? 3 : 0, defaultitem))
+            return 1;
+      }
+      else
+      {
+         if(box->items[z].hwnd == handle)
+         {
+            if(lasthwnd == handle && firsthwnd)
+               WinSetFocus(HWND_DESKTOP, firsthwnd);
+            else if(lasthwnd == handle && !firsthwnd)
+               finish_searching = 1;
+            else
+               WinSetFocus(HWND_DESKTOP, lasthwnd);
+
+            /* If we aren't looking for the last handle,
+             * return immediately.
+             */
+            if(!finish_searching)
+               return 1;
+         }
+         if(_validate_focus(box->items[z].hwnd))
+         {
+            /* Start is 3 when we are looking for the
+             * first valid item in the layout.
+             */
+            if(start == 3)
+            {
+               if(!defaultitem || (defaultitem && defaultitem == box->items[z].hwnd))
+               {
+                  WinSetFocus(HWND_DESKTOP, box->items[z].hwnd);
+                  return 1;
+               }
+            }
+
+            if(!firsthwnd)
+               firsthwnd = box->items[z].hwnd;
+
+            lasthwnd = box->items[z].hwnd;
+         }
+         else
+         {
+            char tmpbuf[100] = "";
+
+            WinQueryClassName(box->items[z].hwnd, 99, tmpbuf);
+            if(strncmp(tmpbuf, SplitbarClassName, strlen(SplitbarClassName)+1)==0)
+            {
+               /* Then try the bottom or right box */
+               HWND mybox = (HWND)dw_window_get_data(box->items[z].hwnd, "_dw_bottomright");
+
+               if(mybox)
+               {
+                  Box *splitbox = (Box *)WinQueryWindowPtr(mybox, QWP_USER);
+
+                  if(splitbox && _focus_check_box(splitbox, handle, start == 3 ? 3 : 0, defaultitem))
+                     return 1;
+               }
+
+               /* Try the top or left box */
+               mybox = (HWND)dw_window_get_data(box->items[z].hwnd, "_dw_topleft");
+
+               if(mybox)
+               {
+                  Box *splitbox = (Box *)WinQueryWindowPtr(mybox, QWP_USER);
+
+                  if(splitbox && _focus_check_box(splitbox, handle, start == 3 ? 3 : 0, defaultitem))
+                     return 1;
+               }
+            }
+            else if(strncmp(tmpbuf, "#40", 4)==0) /* Notebook */
+            {
+               Box *notebox;
+               HWND page = (HWND)WinSendMsg(box->items[z].hwnd, BKM_QUERYPAGEWINDOWHWND,
+                                     (MPARAM)dw_notebook_page_get(box->items[z].hwnd), 0);
+
+               if(page)
+               {
+                  notebox = (Box *)WinQueryWindowPtr(page, QWP_USER);
+
+                  if(notebox && _focus_check_box(notebox, handle, start == 3 ? 3 : 0, defaultitem))
+                     return 1;
+               }
+            }
+         }
+      }
+   }
+   return 0;
 }
 
 int _focus_check_box_back(Box *box, HWND handle, int start, HWND defaultitem)
 {
-	int z;
-	static HWND lasthwnd, firsthwnd;
+   int z;
+   static HWND lasthwnd, firsthwnd;
     static int finish_searching;
 
-	/* Start is 2 when we have cycled completely and
-	 * need to set the focus to the last widget we found
-	 * that was valid.
-	 */
-	if(start == 2)
-	{
-		if(lasthwnd)
-			WinSetFocus(HWND_DESKTOP, lasthwnd);
-		return 0;
-	}
-
-	/* Start is 1 when we are entering the function
-	 * for the first time, it is zero when entering
-	 * the function recursively.
-	 */
-	if(start == 1)
-	{
-		lasthwnd = handle;
-		finish_searching = 0;
-		firsthwnd = 0;
-	}
-
-	for(z=0;z<box->count;z++)
-	{
-		if(box->items[z].type == TYPEBOX)
-		{
-			Box *thisbox = WinQueryWindowPtr(box->items[z].hwnd, QWP_USER);
-
-			if(thisbox && _focus_check_box_back(thisbox, handle, start == 3 ? 3 : 0, defaultitem))
-				return 1;
-		}
-		else
-		{
-			if(box->items[z].hwnd == handle)
-			{
-				if(lasthwnd == handle && firsthwnd)
-					WinSetFocus(HWND_DESKTOP, firsthwnd);
-				else if(lasthwnd == handle && !firsthwnd)
-					finish_searching = 1;
-				else
-					WinSetFocus(HWND_DESKTOP, lasthwnd);
-
-				/* If we aren't looking for the last handle,
-				 * return immediately.
-				 */
-				if(!finish_searching)
-					return 1;
-			}
-			if(_validate_focus(box->items[z].hwnd))
-			{
-				/* Start is 3 when we are looking for the
-				 * first valid item in the layout.
-				 */
-				if(start == 3)
-				{
-					if(!defaultitem || (defaultitem && defaultitem == box->items[z].hwnd))
-					{
-						WinSetFocus(HWND_DESKTOP, box->items[z].hwnd);
-						return 1;
-					}
-				}
-
-				if(!firsthwnd)
-					firsthwnd = box->items[z].hwnd;
-
-				lasthwnd = box->items[z].hwnd;
-			}
-			else
-			{
-				char tmpbuf[100] = "";
-
-				WinQueryClassName(box->items[z].hwnd, 99, tmpbuf);
-				if(strncmp(tmpbuf, SplitbarClassName, strlen(SplitbarClassName)+1)==0)
-				{
-					/* Try the top or left box */
-					HWND mybox = (HWND)dw_window_get_data(box->items[z].hwnd, "_dw_topleft");
-
-					if(mybox)
-					{
-						Box *splitbox = (Box *)WinQueryWindowPtr(mybox, QWP_USER);
-
-						if(splitbox && _focus_check_box_back(splitbox, handle, start == 3 ? 3 : 0, defaultitem))
-							return 1;
-					}
-
-					/* Then try the bottom or right box */
-					mybox = (HWND)dw_window_get_data(box->items[z].hwnd, "_dw_bottomright");
-
-					if(mybox)
-					{
-						Box *splitbox = (Box *)WinQueryWindowPtr(mybox, QWP_USER);
-
-						if(splitbox && _focus_check_box_back(splitbox, handle, start == 3 ? 3 : 0, defaultitem))
-							return 1;
-					}
-				}
-				else if(strncmp(tmpbuf, "#40", 4)==0) /* Notebook */
-				{
-					Box *notebox;
-					HWND page = (HWND)WinSendMsg(box->items[z].hwnd, BKM_QUERYPAGEWINDOWHWND,
-												 (MPARAM)dw_notebook_page_get(box->items[z].hwnd), 0);
-
-					if(page)
-					{
-						notebox = (Box *)WinQueryWindowPtr(page, QWP_USER);
-
-						if(notebox && _focus_check_box_back(notebox, handle, start == 3 ? 3 : 0, defaultitem))
-							return 1;
-					}
-				}
-			}
-		}
-	}
-	return 0;
+   /* Start is 2 when we have cycled completely and
+    * need to set the focus to the last widget we found
+    * that was valid.
+    */
+   if(start == 2)
+   {
+      if(lasthwnd)
+         WinSetFocus(HWND_DESKTOP, lasthwnd);
+      return 0;
+   }
+
+   /* Start is 1 when we are entering the function
+    * for the first time, it is zero when entering
+    * the function recursively.
+    */
+   if(start == 1)
+   {
+      lasthwnd = handle;
+      finish_searching = 0;
+      firsthwnd = 0;
+   }
+
+   for(z=0;z<box->count;z++)
+   {
+      if(box->items[z].type == TYPEBOX)
+      {
+         Box *thisbox = WinQueryWindowPtr(box->items[z].hwnd, QWP_USER);
+
+         if(thisbox && _focus_check_box_back(thisbox, handle, start == 3 ? 3 : 0, defaultitem))
+            return 1;
+      }
+      else
+      {
+         if(box->items[z].hwnd == handle)
+         {
+            if(lasthwnd == handle && firsthwnd)
+               WinSetFocus(HWND_DESKTOP, firsthwnd);
+            else if(lasthwnd == handle && !firsthwnd)
+               finish_searching = 1;
+            else
+               WinSetFocus(HWND_DESKTOP, lasthwnd);
+
+            /* If we aren't looking for the last handle,
+             * return immediately.
+             */
+            if(!finish_searching)
+               return 1;
+         }
+         if(_validate_focus(box->items[z].hwnd))
+         {
+            /* Start is 3 when we are looking for the
+             * first valid item in the layout.
+             */
+            if(start == 3)
+            {
+               if(!defaultitem || (defaultitem && defaultitem == box->items[z].hwnd))
+               {
+                  WinSetFocus(HWND_DESKTOP, box->items[z].hwnd);
+                  return 1;
+               }
+            }
+
+            if(!firsthwnd)
+               firsthwnd = box->items[z].hwnd;
+
+            lasthwnd = box->items[z].hwnd;
+         }
+         else
+         {
+            char tmpbuf[100] = "";
+
+            WinQueryClassName(box->items[z].hwnd, 99, tmpbuf);
+            if(strncmp(tmpbuf, SplitbarClassName, strlen(SplitbarClassName)+1)==0)
+            {
+               /* Try the top or left box */
+               HWND mybox = (HWND)dw_window_get_data(box->items[z].hwnd, "_dw_topleft");
+
+               if(mybox)
+               {
+                  Box *splitbox = (Box *)WinQueryWindowPtr(mybox, QWP_USER);
+
+                  if(splitbox && _focus_check_box_back(splitbox, handle, start == 3 ? 3 : 0, defaultitem))
+                     return 1;
+               }
+
+               /* Then try the bottom or right box */
+               mybox = (HWND)dw_window_get_data(box->items[z].hwnd, "_dw_bottomright");
+
+               if(mybox)
+               {
+                  Box *splitbox = (Box *)WinQueryWindowPtr(mybox, QWP_USER);
+
+                  if(splitbox && _focus_check_box_back(splitbox, handle, start == 3 ? 3 : 0, defaultitem))
+                     return 1;
+               }
+            }
+            else if(strncmp(tmpbuf, "#40", 4)==0) /* Notebook */
+            {
+               Box *notebox;
+               HWND page = (HWND)WinSendMsg(box->items[z].hwnd, BKM_QUERYPAGEWINDOWHWND,
+                                     (MPARAM)dw_notebook_page_get(box->items[z].hwnd), 0);
+
+               if(page)
+               {
+                  notebox = (Box *)WinQueryWindowPtr(page, QWP_USER);
+
+                  if(notebox && _focus_check_box_back(notebox, handle, start == 3 ? 3 : 0, defaultitem))
+                     return 1;
+               }
+            }
+         }
+      }
+   }
+   return 0;
 }
 
 /* This function finds the first widget in the
@@ -722,18 +722,18 @@
  */
 int _initial_focus(HWND handle)
 {
-	Box *thisbox = NULL;
-	HWND box;
-
-	box = WinWindowFromID(handle, FID_CLIENT);
-	if(box)
-		thisbox = WinQueryWindowPtr(box, QWP_USER);
-	else
-		return 1;
-
-	if(thisbox)
-		_focus_check_box(thisbox, handle, 3, thisbox->defaultitem);
-	return 0;
+   Box *thisbox = NULL;
+   HWND box;
+
+   box = WinWindowFromID(handle, FID_CLIENT);
+   if(box)
+      thisbox = WinQueryWindowPtr(box, QWP_USER);
+   else
+      return 1;
+
+   if(thisbox)
+      _focus_check_box(thisbox, handle, 3, thisbox->defaultitem);
+   return 0;
 }
 
 /* This function finds the current widget in the
@@ -741,20 +741,20 @@
  */
 void _shift_focus(HWND handle)
 {
-	Box *thisbox;
-	HWND box, lastbox = _toplevel_window(handle);
-
-	box = WinWindowFromID(lastbox, FID_CLIENT);
-	if(box)
-		thisbox = WinQueryWindowPtr(box, QWP_USER);
-	else
-		thisbox = WinQueryWindowPtr(lastbox, QWP_USER);
-
-	if(thisbox)
-	{
-		if(_focus_check_box(thisbox, handle, 1, 0)  == 0)
-			_focus_check_box(thisbox, handle, 2, 0);
-	}
+   Box *thisbox;
+   HWND box, lastbox = _toplevel_window(handle);
+
+   box = WinWindowFromID(lastbox, FID_CLIENT);
+   if(box)
+      thisbox = WinQueryWindowPtr(box, QWP_USER);
+   else
+      thisbox = WinQueryWindowPtr(lastbox, QWP_USER);
+
+   if(thisbox)
+   {
+      if(_focus_check_box(thisbox, handle, 1, 0)  == 0)
+         _focus_check_box(thisbox, handle, 2, 0);
+   }
 }
 
 /* This function finds the current widget in the
@@ -762,80 +762,80 @@
  */
 void _shift_focus_back(HWND handle)
 {
-	Box *thisbox;
-	HWND box, lastbox = _toplevel_window(handle);
-
-	box = WinWindowFromID(lastbox, FID_CLIENT);
-	if(box)
-		thisbox = WinQueryWindowPtr(box, QWP_USER);
-	else
-		thisbox = WinQueryWindowPtr(lastbox, QWP_USER);
-
-	if(thisbox)
-	{
-		if(_focus_check_box_back(thisbox, handle, 1, 0)  == 0)
-			_focus_check_box_back(thisbox, handle, 2, 0);
-	}
+   Box *thisbox;
+   HWND box, lastbox = _toplevel_window(handle);
+
+   box = WinWindowFromID(lastbox, FID_CLIENT);
+   if(box)
+      thisbox = WinQueryWindowPtr(box, QWP_USER);
+   else
+      thisbox = WinQueryWindowPtr(lastbox, QWP_USER);
+
+   if(thisbox)
+   {
+      if(_focus_check_box_back(thisbox, handle, 1, 0)  == 0)
+         _focus_check_box_back(thisbox, handle, 2, 0);
+   }
 }
 
 /* This function will recursively search a box and add up the total height of it */
 void _count_size(HWND box, int type, int *xsize, int *xorigsize)
 {
-	int size = 0, origsize = 0, z;
-	Box *tmp = WinQueryWindowPtr(box, QWP_USER);
-
-	if(!tmp)
-	{
-		*xsize = *xorigsize = 0;
-		return;
-	}
-
-	if(type == tmp->type)
-	{
-		/* If the box is going in the direction we want, then we
-		 * return the entire sum of the items.
-		 */
-		for(z=0;z<tmp->count;z++)
-		{
-			if(tmp->items[z].type == TYPEBOX)
-			{
-				int s, os;
-
-				_count_size(tmp->items[z].hwnd, type, &s, &os);
-				size += s;
-				origsize += os;
-			}
-			else
-			{
-				size += (type == DW_HORZ ? tmp->items[z].width : tmp->items[z].height);
-				origsize += (type == DW_HORZ ? tmp->items[z].origwidth : tmp->items[z].origheight);
-			}
-		}
-	}
-	else
-	{
-		/* If the box is not going in the direction we want, then we only
-		 * want to return the maximum value.
-		 */
-		int tmpsize = 0, tmporigsize = 0;
-
-		for(z=0;z<tmp->count;z++)
-		{
-			if(tmp->items[z].type == TYPEBOX)
-				_count_size(tmp->items[z].hwnd, type, &tmpsize, &tmporigsize);
-			else
-			{
-				tmpsize = (type == DW_HORZ ? tmp->items[z].width : tmp->items[z].height);
-				tmporigsize = (type == DW_HORZ ? tmp->items[z].origwidth : tmp->items[z].origheight);
-			}
-
-			if(tmpsize > size)
-				size = tmpsize;
-		}
-	}
-
-	*xsize = size;
-	*xorigsize = origsize;
+   int size = 0, origsize = 0, z;
+   Box *tmp = WinQueryWindowPtr(box, QWP_USER);
+
+   if(!tmp)
+   {
+      *xsize = *xorigsize = 0;
+      return;
+   }
+
+   if(type == tmp->type)
+   {
+      /* If the box is going in the direction we want, then we
+       * return the entire sum of the items.
+       */
+      for(z=0;z<tmp->count;z++)
+      {
+         if(tmp->items[z].type == TYPEBOX)
+         {
+            int s, os;
+
+            _count_size(tmp->items[z].hwnd, type, &s, &os);
+            size += s;
+            origsize += os;
+         }
+         else
+         {
+            size += (type == DW_HORZ ? tmp->items[z].width : tmp->items[z].height);
+            origsize += (type == DW_HORZ ? tmp->items[z].origwidth : tmp->items[z].origheight);
+         }
+      }
+   }
+   else
+   {
+      /* If the box is not going in the direction we want, then we only
+       * want to return the maximum value.
+       */
+      int tmpsize = 0, tmporigsize = 0;
+
+      for(z=0;z<tmp->count;z++)
+      {
+         if(tmp->items[z].type == TYPEBOX)
+            _count_size(tmp->items[z].hwnd, type, &tmpsize, &tmporigsize);
+         else
+         {
+            tmpsize = (type == DW_HORZ ? tmp->items[z].width : tmp->items[z].height);
+            tmporigsize = (type == DW_HORZ ? tmp->items[z].origwidth : tmp->items[z].origheight);
+         }
+
+         if(tmpsize > size)
+            size = tmpsize;
+      }
+   }
+
+   *xsize = size;
+   *xorigsize = origsize;
 }
 
 
@@ -849,734 +849,734 @@
 
 BOOL _TrackRectangle(HWND hwndBase, RECTL* rclTrack, RECTL* rclBounds)
 {
-	TRACKINFO track;
-	APIRET rc;
-
-	track.cxBorder = 1;
-	track.cyBorder = 1;
-	track.cxGrid   = 1;
-	track.cyGrid   = 1;
-	track.cxKeyboard = 8;
-	track.cyKeyboard = 8;
-
-	if(!rclTrack)
-		return FALSE;
-
-	if(rclBounds)
-	{
-		track.rclBoundary = *rclBounds;
-	}
-	else
-	{
-		track.rclBoundary.yTop    =
-			track.rclBoundary.xRight  = 3000;
-		track.rclBoundary.yBottom =
-			track.rclBoundary.xLeft   = -3000;
-	}
-
-	track.rclTrack = *rclTrack;
-
-	WinMapWindowPoints(hwndBase,
-					   HWND_DESKTOP,
-					   (PPOINTL)&track.rclTrack,
-					   2);
-
-	track.ptlMinTrackSize.x = track.rclTrack.xRight
-		- track.rclTrack.xLeft;
-	track.ptlMinTrackSize.y = track.rclTrack.yTop
-		- track.rclTrack.yBottom;
-	track.ptlMaxTrackSize.x = track.rclTrack.xRight
-		- track.rclTrack.xLeft;
-	track.ptlMaxTrackSize.y = track.rclTrack.yTop
-		- track.rclTrack.yBottom;
-
-	track.fs = TF_MOVE | TF_ALLINBOUNDARY;
-
-	rc = WinTrackRect(HWND_DESKTOP, 0, &track);
-
-	if(rc)
-		*rclTrack = track.rclTrack;
-
-	return rc;
+   TRACKINFO track;
+   APIRET rc;
+
+   track.cxBorder = 1;
+   track.cyBorder = 1;
+   track.cxGrid   = 1;
+   track.cyGrid   = 1;
+   track.cxKeyboard = 8;
+   track.cyKeyboard = 8;
+
+   if(!rclTrack)
+      return FALSE;
+
+   if(rclBounds)
+   {
+      track.rclBoundary = *rclBounds;
+   }
+   else
+   {
+      track.rclBoundary.yTop    =
+         track.rclBoundary.xRight  = 3000;
+      track.rclBoundary.yBottom =
+         track.rclBoundary.xLeft   = -3000;
+   }
+
+   track.rclTrack = *rclTrack;
+
+   WinMapWindowPoints(hwndBase,
+                  HWND_DESKTOP,
+                  (PPOINTL)&track.rclTrack,
+                  2);
+
+   track.ptlMinTrackSize.x = track.rclTrack.xRight
+      - track.rclTrack.xLeft;
+   track.ptlMinTrackSize.y = track.rclTrack.yTop
+      - track.rclTrack.yBottom;
+   track.ptlMaxTrackSize.x = track.rclTrack.xRight
+      - track.rclTrack.xLeft;
+   track.ptlMaxTrackSize.y = track.rclTrack.yTop
+      - track.rclTrack.yBottom;
+
+   track.fs = TF_MOVE | TF_ALLINBOUNDARY;
+
+   rc = WinTrackRect(HWND_DESKTOP, 0, &track);
+
+   if(rc)
+      *rclTrack = track.rclTrack;
+
+   return rc;
 }
 
 void _check_resize_notebook(HWND hwnd)
 {
-	char tmpbuf[100];
-
-	WinQueryClassName(hwnd, 99, tmpbuf);
-
-	/* If we have a notebook we resize the page again. */
-	if(strncmp(tmpbuf, "#40", 4)==0)
-	{
-		unsigned long x, y, width, height;
-		ULONG page = (ULONG)WinSendMsg(hwnd, BKM_QUERYPAGEID, 0, MPFROM2SHORT(BKA_FIRST, BKA_MAJOR));
-
-		while(page)
-		{
-			HWND pagehwnd = (HWND)WinSendMsg(hwnd, BKM_QUERYPAGEWINDOWHWND, MPFROMLONG(page), 0);
-			RECTL rc;
-
-			Box *pagebox = (Box *)WinQueryWindowPtr(pagehwnd, QWP_USER);
-			if(pagebox)
-			{
-				dw_window_get_pos_size(hwnd, &x, &y, &width, &height);
-
-				rc.xLeft = x;
-				rc.yBottom = y;
-				rc.xRight = x + width;
-				rc.yTop = y + height;
-
-				WinSendMsg(hwnd, BKM_CALCPAGERECT, (MPARAM)&rc, (MPARAM)TRUE);
-
-				_do_resize(pagebox, rc.xRight - rc.xLeft, rc.yTop - rc.yBottom);
-			}
-			page = (ULONG)WinSendMsg(hwnd, BKM_QUERYPAGEID, (MPARAM)page, MPFROM2SHORT(BKA_NEXT, BKA_MAJOR));
-		}
-
-	}
+   char tmpbuf[100];
+
+   WinQueryClassName(hwnd, 99, tmpbuf);
+
+   /* If we have a notebook we resize the page again. */
+   if(strncmp(tmpbuf, "#40", 4)==0)
+   {
+      unsigned long x, y, width, height;
+      ULONG page = (ULONG)WinSendMsg(hwnd, BKM_QUERYPAGEID, 0, MPFROM2SHORT(BKA_FIRST, BKA_MAJOR));
+
+      while(page)
+      {
+         HWND pagehwnd = (HWND)WinSendMsg(hwnd, BKM_QUERYPAGEWINDOWHWND, MPFROMLONG(page), 0);
+         RECTL rc;
+
+         Box *pagebox = (Box *)WinQueryWindowPtr(pagehwnd, QWP_USER);
+         if(pagebox)
+         {
+            dw_window_get_pos_size(hwnd, &x, &y, &width, &height);
+
+            rc.xLeft = x;
+            rc.yBottom = y;
+            rc.xRight = x + width;
+            rc.yTop = y + height;
+
+            WinSendMsg(hwnd, BKM_CALCPAGERECT, (MPARAM)&rc, (MPARAM)TRUE);
+
+            _do_resize(pagebox, rc.xRight - rc.xLeft, rc.yTop - rc.yBottom);
+         }
+         page = (ULONG)WinSendMsg(hwnd, BKM_QUERYPAGEID, (MPARAM)page, MPFROM2SHORT(BKA_NEXT, BKA_MAJOR));
+      }
+
+   }
 }
 
 /* Return the OS/2 color from the DW color */
 unsigned long _internal_color(unsigned long color)
 {
-	if(color < 16)
-		return _colors[color];
-	return color;
+   if(color < 16)
+      return _colors[color];
+   return color;
 }
 
 unsigned long _os2_color(unsigned long color)
 {
-	return DW_RED_VALUE(color) << 16 | DW_GREEN_VALUE(color) << 8 | DW_BLUE_VALUE(color);
+   return DW_RED_VALUE(color) << 16 | DW_GREEN_VALUE(color) << 8 | DW_BLUE_VALUE(color);
 }
 
 BOOL _MySetWindowPos(HWND hwnd, HWND parent, HWND behind, LONG x, LONG y, LONG cx, LONG cy, ULONG fl)
 {
-	int height = _get_height(parent);
-
-	return WinSetWindowPos(hwnd, behind, x, height - y - cy, cx, cy, fl);
+   int height = _get_height(parent);
+
+   return WinSetWindowPos(hwnd, behind, x, height - y - cy, cx, cy, fl);
 }
 
 /* This function calculates how much space the widgets and boxes require
  * and does expansion as necessary.
  */
 int _resize_box(Box *thisbox, int *depth, int x, int y, int *usedx, int *usedy,
-				int pass, int *usedpadx, int *usedpady)
-{
-	int z, currentx = 0, currenty = 0;
-	int uymax = 0, uxmax = 0;
-	int upymax = 0, upxmax = 0;
-	/* Used for the SIZEEXPAND */
-	int nux = *usedx, nuy = *usedy;
-	int nupx = *usedpadx, nupy = *usedpady;
-
-	(*usedx) += (thisbox->pad * 2);
-	(*usedy) += (thisbox->pad * 2);
-
-	if(thisbox->grouphwnd)
-	{
-		char *text = dw_window_get_text(thisbox->grouphwnd);
-
-		thisbox->grouppady = 0;
-
-		if(text)
-		{
-			dw_font_text_extents_get(thisbox->grouphwnd, 0, text, NULL, &thisbox->grouppady);
-			dw_free(text);
-		}
-
-		if(thisbox->grouppady)
-			thisbox->grouppady += 3;
-		else
-			thisbox->grouppady = 6;
-
-		thisbox->grouppadx = 6;
-
-		(*usedx) += thisbox->grouppadx;
-		(*usedpadx) += thisbox->grouppadx;
-		(*usedy) += thisbox->grouppady;
-		(*usedpady) += thisbox->grouppady;
-	}
-
-	for(z=0;z<thisbox->count;z++)
-	{
-		if(thisbox->items[z].type == TYPEBOX)
-		{
-			int initialx, initialy;
-			Box *tmp = WinQueryWindowPtr(thisbox->items[z].hwnd, QWP_USER);
-
-			initialx = x - (*usedx);
-			initialy = y - (*usedy);
-
-			if(tmp)
-			{
-				int newx, newy;
-				int nux = *usedx, nuy = *usedy;
-				int upx = *usedpadx + (tmp->pad*2), upy = *usedpady + (tmp->pad*2);
-
-				/* On the second pass we know how big the box needs to be and how
-				 * much space we have, so we can calculate a ratio for the new box.
-				 */
-				if(pass == 2)
-				{
-					int deep = *depth + 1;
-
-					_resize_box(tmp, &deep, x, y, &nux, &nuy, 1, &upx, &upy);
-
-					tmp->upx = upx - *usedpadx;
-					tmp->upy = upy - *usedpady;
-
-					newx = x - nux;
-					newy = y - nuy;
-
-					tmp->width = thisbox->items[z].width = initialx - newx;
-					tmp->height = thisbox->items[z].height = initialy - newy;
-
-					tmp->parentxratio = thisbox->xratio;
-					tmp->parentyratio = thisbox->yratio;
-
-					tmp->parentpad = tmp->pad;
-
-					/* Just in case */
-					tmp->xratio = thisbox->xratio;
-					tmp->yratio = thisbox->yratio;
-
-					if(thisbox->type == DW_VERT)
-					{
-						int tmppad = (thisbox->items[z].pad*2)+(tmp->pad*2)+tmp->grouppady;
-
-						if((thisbox->items[z].width - tmppad)!=0)
-							tmp->xratio = ((float)((thisbox->items[z].width * thisbox->xratio)-tmppad))/((float)(thisbox->items[z].width-tmppad));
-					}
-					else
-					{
-						if((thisbox->items[z].width-tmp->upx)!=0)
-							tmp->xratio = ((float)((thisbox->items[z].width * thisbox->xratio)-tmp->upx))/((float)(thisbox->items[z].width-tmp->upx));
-					}
-					if(thisbox->type == DW_HORZ)
-					{
-						int tmppad = (thisbox->items[z].pad*2)+(tmp->pad*2)+tmp->grouppadx;
-
-						if((thisbox->items[z].height-tmppad)!=0)
-							tmp->yratio = ((float)((thisbox->items[z].height * thisbox->yratio)-tmppad))/((float)(thisbox->items[z].height-tmppad));
-					}
-					else
-					{
-						if((thisbox->items[z].height-tmp->upy)!=0)
-							tmp->yratio = ((float)((thisbox->items[z].height * thisbox->yratio)-tmp->upy))/((float)(thisbox->items[z].height-tmp->upy));
-					}
-
-					nux = *usedx; nuy = *usedy;
-					upx = *usedpadx + (tmp->pad*2); upy = *usedpady + (tmp->pad*2);
-				}
-
-				(*depth)++;
-
-				_resize_box(tmp, depth, x, y, &nux, &nuy, pass, &upx, &upy);
-
-				(*depth)--;
-
-				newx = x - nux;
-				newy = y - nuy;
-
-				tmp->minwidth = thisbox->items[z].width = initialx - newx;
-				tmp->minheight = thisbox->items[z].height = initialy - newy;
-			}
-		}
-
-		if(pass > 1 && *depth > 0)
-		{
-			if(thisbox->type == DW_VERT)
-			{
-				int tmppad = (thisbox->items[z].pad*2)+(thisbox->parentpad*2)+thisbox->grouppadx;
-
-				if((thisbox->minwidth-tmppad) == 0)
-					thisbox->items[z].xratio = 1.0;
-				else
-					thisbox->items[z].xratio = ((float)((thisbox->width * thisbox->parentxratio)-tmppad))/((float)(thisbox->minwidth-tmppad));
-			}
-			else
-			{
-				if(thisbox->minwidth-thisbox->upx == 0)
-					thisbox->items[z].xratio = 1.0;
-				else
-					thisbox->items[z].xratio = ((float)((thisbox->width * thisbox->parentxratio)-thisbox->upx))/((float)(thisbox->minwidth-thisbox->upx));
-			}
-
-			if(thisbox->type == DW_HORZ)
-			{
-				int tmppad = (thisbox->items[z].pad*2)+(thisbox->parentpad*2)+thisbox->grouppady;
-
-				if((thisbox->minheight-tmppad) == 0)
-					thisbox->items[z].yratio = 1.0;
-				else
-					thisbox->items[z].yratio = ((float)((thisbox->height * thisbox->parentyratio)-tmppad))/((float)(thisbox->minheight-tmppad));
-			}
-			else
-			{
-				if(thisbox->minheight-thisbox->upy == 0)
-					thisbox->items[z].yratio = 1.0;
-				else
-					thisbox->items[z].yratio = ((float)((thisbox->height * thisbox->parentyratio)-thisbox->upy))/((float)(thisbox->minheight-thisbox->upy));
-			}
-
-			if(thisbox->items[z].type == TYPEBOX)
-			{
-				Box *tmp = WinQueryWindowPtr(thisbox->items[z].hwnd, QWP_USER);
-
-				if(tmp)
-				{
-					tmp->parentxratio = thisbox->items[z].xratio;
-					tmp->parentyratio = thisbox->items[z].yratio;
-				}
-			}
-		}
-		else
-		{
-			thisbox->items[z].xratio = thisbox->xratio;
-			thisbox->items[z].yratio = thisbox->yratio;
-		}
-
-		if(thisbox->type == DW_VERT)
-		{
-			int itemwidth = thisbox->items[z].width + (thisbox->items[z].pad*2);
-
-			if(itemwidth > uxmax)
-				uxmax = itemwidth;
-			if(thisbox->items[z].hsize != SIZEEXPAND)
-			{
-				if(itemwidth > upxmax)
-					upxmax = itemwidth;
-			}
-			else
-			{
-				if(thisbox->items[z].pad*2 > upxmax)
-					upxmax = thisbox->items[z].pad*2;
-			}
-		}
-		else
-		{
-			if(thisbox->items[z].width == -1)
-			{
-				/* figure out how much space this item requires */
-				/* thisbox->items[z].width = */
-			}
-			else
-			{
-				(*usedx) += thisbox->items[z].width + (thisbox->items[z].pad*2);
-				if(thisbox->items[z].hsize != SIZEEXPAND)
-					(*usedpadx) += (thisbox->items[z].pad*2) + thisbox->items[z].width;
-				else
-					(*usedpadx) += thisbox->items[z].pad*2;
-			}
-		}
-		if(thisbox->type == DW_HORZ)
-		{
-			int itemheight = thisbox->items[z].height + (thisbox->items[z].pad*2);
-
-			if(itemheight > uymax)
-				uymax = itemheight;
-			if(thisbox->items[z].vsize != SIZEEXPAND)
-			{
-				if(itemheight > upymax)
-					upymax = itemheight;
-			}
-			else
-			{
-				if(thisbox->items[z].pad*2 > upymax)
-					upymax = thisbox->items[z].pad*2;
-			}
-		}
-		else
-		{
-			if(thisbox->items[z].height == -1)
-			{
-				/* figure out how much space this item requires */
-				/* thisbox->items[z].height = */
-			}
-			else
-			{
-				(*usedy) += thisbox->items[z].height + (thisbox->items[z].pad*2);
-				if(thisbox->items[z].vsize != SIZEEXPAND)
-					(*usedpady) += (thisbox->items[z].pad*2) + thisbox->items[z].height;
-				else
-					(*usedpady) += thisbox->items[z].pad*2;
-			}
-		}
-	}
-
-	(*usedx) += uxmax;
-	(*usedy) += uymax;
-	(*usedpadx) += upxmax;
-	(*usedpady) += upymax;
-
-	currentx += thisbox->pad;
-	currenty += thisbox->pad;
-
-	if(thisbox->grouphwnd)
-	{
-		currentx += 3;
-		currenty += thisbox->grouppady - 3;
-	}
-
-	/* The second pass is for expansion and actual placement. */
-	if(pass > 1)
-	{
-		/* Any SIZEEXPAND items should be set to uxmax/uymax */
-		for(z=0;z<thisbox->count;z++)
-		{
-			if(thisbox->items[z].hsize == SIZEEXPAND && thisbox->type == DW_VERT)
-				thisbox->items[z].width = uxmax-(thisbox->items[z].pad*2);
-			if(thisbox->items[z].vsize == SIZEEXPAND && thisbox->type == DW_HORZ)
-				thisbox->items[z].height = uymax-(thisbox->items[z].pad*2);
-			/* Run this code segment again to finalize the sized after setting uxmax/uymax values. */
-			if(thisbox->items[z].type == TYPEBOX)
-			{
-				Box *tmp = WinQueryWindowPtr(thisbox->items[z].hwnd, QWP_USER);
-
-				if(tmp)
-				{
-					if(*depth > 0)
-					{
-						float calcval;
-
-						if(thisbox->type == DW_VERT)
-						{
-							calcval = (float)(tmp->minwidth-((thisbox->items[z].pad*2)+(thisbox->pad*2)));
-							if(calcval == 0.0)
-								tmp->xratio = thisbox->xratio;
-							else
-								tmp->xratio = ((float)((thisbox->items[z].width * thisbox->xratio)-((thisbox->items[z].pad*2)+(thisbox->pad*2))))/calcval;
-							tmp->width = thisbox->items[z].width;
-						}
-						if(thisbox->type == DW_HORZ)
-						{
-							calcval = (float)(tmp->minheight-((thisbox->items[z].pad*2)+(thisbox->pad*2)));
-							if(calcval == 0.0)
-								tmp->yratio = thisbox->yratio;
-							else
-								tmp->yratio = ((float)((thisbox->items[z].height * thisbox->yratio)-((thisbox->items[z].pad*2)+(thisbox->pad*2))))/calcval;
-							tmp->height = thisbox->items[z].height;
-						}
-					}
-
-					(*depth)++;
-
-					_resize_box(tmp, depth, x, y, &nux, &nuy, 3, &nupx, &nupy);
-
-					(*depth)--;
-
-				}
-			}
-		}
-
-		for(z=0;z<(thisbox->count);z++)
-		{
-			int height = thisbox->items[z].height;
-			int width = thisbox->items[z].width;
-			int pad = thisbox->items[z].pad;
-			HWND handle = thisbox->items[z].hwnd;
-			int vectorx, vectory;
-
-			/* When upxmax != pad*2 then ratios are incorrect. */
-			vectorx = (int)((width*thisbox->items[z].xratio)-width);
-			vectory = (int)((height*thisbox->items[z].yratio)-height);
-
-			if(width > 0 && height > 0)
-			{
-				char tmpbuf[100];
-				/* This is a hack to fix rounding of the sizing */
-				if(*depth == 0)
-				{
-					vectorx++;
-					vectory++;
-				}
-
-				/* If this item isn't going to expand... reset the vectors to 0 */
-				if(thisbox->items[z].vsize != SIZEEXPAND)
-					vectory = 0;
-				if(thisbox->items[z].hsize != SIZEEXPAND)
-					vectorx = 0;
-
-				WinQueryClassName(handle, 99, tmpbuf);
-
-				if(strncmp(tmpbuf, "#2", 3)==0)
-				{
-					HWND frame = (HWND)dw_window_get_data(handle, "_dw_combo_box");
-					/* Make the combobox big enough to drop down. :) */
-					WinSetWindowPos(handle, HWND_TOP, 0, -100,
-									width + vectorx, (height + vectory) + 100, SWP_MOVE | SWP_SIZE | SWP_ZORDER);
-					_MySetWindowPos(frame, thisbox->hwnd, HWND_TOP, currentx + pad, currenty + pad,
-									width + vectorx, height + vectory, SWP_MOVE | SWP_SIZE | SWP_ZORDER);
-				}
-				else if(strncmp(tmpbuf, "#6", 3)==0)
-				{
-					/* Entryfields on OS/2 have a thick border that isn't on Windows and GTK */
-					_MySetWindowPos(handle, thisbox->hwnd, HWND_TOP, (currentx + pad) + 3, (currenty + pad) + 3,
-									(width + vectorx) - 6, (height + vectory) - 6, SWP_MOVE | SWP_SIZE | SWP_ZORDER);
-				}
-				else if(strncmp(tmpbuf, "#40", 5)==0)
-				{
-					_MySetWindowPos(handle, thisbox->hwnd, HWND_TOP, currentx + pad, currenty + pad,
-									width + vectorx, height + vectory, SWP_MOVE | SWP_SIZE | SWP_ZORDER);
-					_check_resize_notebook(handle);
-				}
-				else if(strncmp(tmpbuf, SplitbarClassName, strlen(SplitbarClassName)+1)==0)
-				{
-					/* Then try the bottom or right box */
-					float *percent = (float *)dw_window_get_data(handle, "_dw_percent");
-					int type = (int)dw_window_get_data(handle, "_dw_type");
-					int cx = width + vectorx;
-					int cy = height + vectory;
-
-					_MySetWindowPos(handle, thisbox->hwnd, HWND_TOP, currentx + pad, currenty + pad,
-									cx, cy, SWP_MOVE | SWP_SIZE | SWP_ZORDER);
-
-					if(cx > 0 && cy > 0 && percent)
-						_handle_splitbar_resize(handle, *percent, type, cx, cy);
-				}
-				else
-				{
-					_MySetWindowPos(handle, thisbox->hwnd, HWND_TOP, currentx + pad, currenty + pad,
-									width + vectorx, height + vectory, SWP_MOVE | SWP_SIZE | SWP_ZORDER);
-					if(thisbox->items[z].type == TYPEBOX)
-					{
-						Box *boxinfo = WinQueryWindowPtr(handle, QWP_USER);
-
-						if(boxinfo && boxinfo->grouphwnd)
-							WinSetWindowPos(boxinfo->grouphwnd, HWND_TOP, 0, 0,
-											width + vectorx, height + vectory, SWP_MOVE | SWP_SIZE);
-
-					}
-
-				}
-
-				if(thisbox->type == DW_HORZ)
-					currentx += width + vectorx + (pad * 2);
-				if(thisbox->type == DW_VERT)
-					currenty += height + vectory + (pad * 2);
-			}
-		}
-	}
-	return 0;
+            int pass, int *usedpadx, int *usedpady)
+{
+   int z, currentx = 0, currenty = 0;
+   int uymax = 0, uxmax = 0;
+   int upymax = 0, upxmax = 0;
+   /* Used for the SIZEEXPAND */
+   int nux = *usedx, nuy = *usedy;
+   int nupx = *usedpadx, nupy = *usedpady;
+
+   (*usedx) += (thisbox->pad * 2);
+   (*usedy) += (thisbox->pad * 2);
+
+   if(thisbox->grouphwnd)
+   {
+      char *text = dw_window_get_text(thisbox->grouphwnd);
+
+      thisbox->grouppady = 0;
+
+      if(text)
+      {
+         dw_font_text_extents_get(thisbox->grouphwnd, 0, text, NULL, &thisbox->grouppady);
+         dw_free(text);
+      }
+
+      if(thisbox->grouppady)
+         thisbox->grouppady += 3;
+      else
+         thisbox->grouppady = 6;
+
+      thisbox->grouppadx = 6;
+
+      (*usedx) += thisbox->grouppadx;
+      (*usedpadx) += thisbox->grouppadx;
+      (*usedy) += thisbox->grouppady;
+      (*usedpady) += thisbox->grouppady;
+   }
+
+   for(z=0;z<thisbox->count;z++)
+   {
+      if(thisbox->items[z].type == TYPEBOX)
+      {
+         int initialx, initialy;
+         Box *tmp = WinQueryWindowPtr(thisbox->items[z].hwnd, QWP_USER);
+
+         initialx = x - (*usedx);
+         initialy = y - (*usedy);
+
+         if(tmp)
+         {
+            int newx, newy;
+            int nux = *usedx, nuy = *usedy;
+            int upx = *usedpadx + (tmp->pad*2), upy = *usedpady + (tmp->pad*2);
+
+            /* On the second pass we know how big the box needs to be and how
+             * much space we have, so we can calculate a ratio for the new box.
+             */
+            if(pass == 2)
+            {
+               int deep = *depth + 1;
+
+               _resize_box(tmp, &deep, x, y, &nux, &nuy, 1, &upx, &upy);
+
+               tmp->upx = upx - *usedpadx;
+               tmp->upy = upy - *usedpady;
+
+               newx = x - nux;
+               newy = y - nuy;
+
+               tmp->width = thisbox->items[z].width = initialx - newx;
+               tmp->height = thisbox->items[z].height = initialy - newy;
+
+               tmp->parentxratio = thisbox->xratio;
+               tmp->parentyratio = thisbox->yratio;
+
+               tmp->parentpad = tmp->pad;
+
+               /* Just in case */
+               tmp->xratio = thisbox->xratio;
+               tmp->yratio = thisbox->yratio;
+
+               if(thisbox->type == DW_VERT)
+               {
+                  int tmppad = (thisbox->items[z].pad*2)+(tmp->pad*2)+tmp->grouppady;
+
+                  if((thisbox->items[z].width - tmppad)!=0)
+                     tmp->xratio = ((float)((thisbox->items[z].width * thisbox->xratio)-tmppad))/((float)(thisbox->items[z].width-tmppad));
+               }
+               else
+               {
+                  if((thisbox->items[z].width-tmp->upx)!=0)
+                     tmp->xratio = ((float)((thisbox->items[z].width * thisbox->xratio)-tmp->upx))/((float)(thisbox->items[z].width-tmp->upx));
+               }
+               if(thisbox->type == DW_HORZ)
+               {
+                  int tmppad = (thisbox->items[z].pad*2)+(tmp->pad*2)+tmp->grouppadx;
+
+                  if((thisbox->items[z].height-tmppad)!=0)
+                     tmp->yratio = ((float)((thisbox->items[z].height * thisbox->yratio)-tmppad))/((float)(thisbox->items[z].height-tmppad));
+               }
+               else
+               {
+                  if((thisbox->items[z].height-tmp->upy)!=0)
+                     tmp->yratio = ((float)((thisbox->items[z].height * thisbox->yratio)-tmp->upy))/((float)(thisbox->items[z].height-tmp->upy));
+               }
+
+               nux = *usedx; nuy = *usedy;
+               upx = *usedpadx + (tmp->pad*2); upy = *usedpady + (tmp->pad*2);
+            }
+
+            (*depth)++;
+
+            _resize_box(tmp, depth, x, y, &nux, &nuy, pass, &upx, &upy);
+
+            (*depth)--;
+
+            newx = x - nux;
+            newy = y - nuy;
+
+            tmp->minwidth = thisbox->items[z].width = initialx - newx;
+            tmp->minheight = thisbox->items[z].height = initialy - newy;
+         }
+      }
+
+      if(pass > 1 && *depth > 0)
+      {
+         if(thisbox->type == DW_VERT)
+         {
+            int tmppad = (thisbox->items[z].pad*2)+(thisbox->parentpad*2)+thisbox->grouppadx;
+
+            if((thisbox->minwidth-tmppad) == 0)
+               thisbox->items[z].xratio = 1.0;
+            else
+               thisbox->items[z].xratio = ((float)((thisbox->width * thisbox->parentxratio)-tmppad))/((float)(thisbox->minwidth-tmppad));
+         }
+         else
+         {
+            if(thisbox->minwidth-thisbox->upx == 0)
+               thisbox->items[z].xratio = 1.0;
+            else
+               thisbox->items[z].xratio = ((float)((thisbox->width * thisbox->parentxratio)-thisbox->upx))/((float)(thisbox->minwidth-thisbox->upx));
+         }
+
+         if(thisbox->type == DW_HORZ)
+         {
+            int tmppad = (thisbox->items[z].pad*2)+(thisbox->parentpad*2)+thisbox->grouppady;
+
+            if((thisbox->minheight-tmppad) == 0)
+               thisbox->items[z].yratio = 1.0;
+            else
+               thisbox->items[z].yratio = ((float)((thisbox->height * thisbox->parentyratio)-tmppad))/((float)(thisbox->minheight-tmppad));
+         }
+         else
+         {
+            if(thisbox->minheight-thisbox->upy == 0)
+               thisbox->items[z].yratio = 1.0;
+            else
+               thisbox->items[z].yratio = ((float)((thisbox->height * thisbox->parentyratio)-thisbox->upy))/((float)(thisbox->minheight-thisbox->upy));
+         }
+
+         if(thisbox->items[z].type == TYPEBOX)
+         {
+            Box *tmp = WinQueryWindowPtr(thisbox->items[z].hwnd, QWP_USER);
+
+            if(tmp)
+            {
+               tmp->parentxratio = thisbox->items[z].xratio;
+               tmp->parentyratio = thisbox->items[z].yratio;
+            }
+         }
+      }
+      else
+      {
+         thisbox->items[z].xratio = thisbox->xratio;
+         thisbox->items[z].yratio = thisbox->yratio;
+      }
+
+      if(thisbox->type == DW_VERT)
+      {
+         int itemwidth = thisbox->items[z].width + (thisbox->items[z].pad*2);
+
+         if(itemwidth > uxmax)
+            uxmax = itemwidth;
+         if(thisbox->items[z].hsize != SIZEEXPAND)
+         {
+            if(itemwidth > upxmax)
+               upxmax = itemwidth;
+         }
+         else
+         {
+            if(thisbox->items[z].pad*2 > upxmax)
+               upxmax = thisbox->items[z].pad*2;
+         }
+      }
+      else
+      {
+         if(thisbox->items[z].width == -1)
+         {
+            /* figure out how much space this item requires */
+            /* thisbox->items[z].width = */
+         }
+         else
+         {
+            (*usedx) += thisbox->items[z].width + (thisbox->items[z].pad*2);
+            if(thisbox->items[z].hsize != SIZEEXPAND)
+               (*usedpadx) += (thisbox->items[z].pad*2) + thisbox->items[z].width;
+            else
+               (*usedpadx) += thisbox->items[z].pad*2;
+         }
+      }
+      if(thisbox->type == DW_HORZ)
+      {
+         int itemheight = thisbox->items[z].height + (thisbox->items[z].pad*2);
+
+         if(itemheight > uymax)
+            uymax = itemheight;
+         if(thisbox->items[z].vsize != SIZEEXPAND)
+         {
+            if(itemheight > upymax)
+               upymax = itemheight;
+         }
+         else
+         {
+            if(thisbox->items[z].pad*2 > upymax)
+               upymax = thisbox->items[z].pad*2;
+         }
+      }
+      else
+      {
+         if(thisbox->items[z].height == -1)
+         {
+            /* figure out how much space this item requires */
+            /* thisbox->items[z].height = */
+         }
+         else
+         {
+            (*usedy) += thisbox->items[z].height + (thisbox->items[z].pad*2);
+            if(thisbox->items[z].vsize != SIZEEXPAND)
+               (*usedpady) += (thisbox->items[z].pad*2) + thisbox->items[z].height;
+            else
+               (*usedpady) += thisbox->items[z].pad*2;
+         }
+      }
+   }
+
+   (*usedx) += uxmax;
+   (*usedy) += uymax;
+   (*usedpadx) += upxmax;
+   (*usedpady) += upymax;
+
+   currentx += thisbox->pad;
+   currenty += thisbox->pad;
+
+   if(thisbox->grouphwnd)
+   {
+      currentx += 3;
+      currenty += thisbox->grouppady - 3;
+   }
+
+   /* The second pass is for expansion and actual placement. */
+   if(pass > 1)
+   {
+      /* Any SIZEEXPAND items should be set to uxmax/uymax */
+      for(z=0;z<thisbox->count;z++)
+      {
+         if(thisbox->items[z].hsize == SIZEEXPAND && thisbox->type == DW_VERT)
+            thisbox->items[z].width = uxmax-(thisbox->items[z].pad*2);
+         if(thisbox->items[z].vsize == SIZEEXPAND && thisbox->type == DW_HORZ)
+            thisbox->items[z].height = uymax-(thisbox->items[z].pad*2);
+         /* Run this code segment again to finalize the sized after setting uxmax/uymax values. */
+         if(thisbox->items[z].type == TYPEBOX)
+         {
+            Box *tmp = WinQueryWindowPtr(thisbox->items[z].hwnd, QWP_USER);
+
+            if(tmp)
+            {
+               if(*depth > 0)
+               {
+                  float calcval;
+
+                  if(thisbox->type == DW_VERT)
+                  {
+                     calcval = (float)(tmp->minwidth-((thisbox->items[z].pad*2)+(thisbox->pad*2)));
+                     if(calcval == 0.0)
+                        tmp->xratio = thisbox->xratio;
+                     else
+                        tmp->xratio = ((float)((thisbox->items[z].width * thisbox->xratio)-((thisbox->items[z].pad*2)+(thisbox->pad*2))))/calcval;
+                     tmp->width = thisbox->items[z].width;
+                  }
+                  if(thisbox->type == DW_HORZ)
+                  {
+                     calcval = (float)(tmp->minheight-((thisbox->items[z].pad*2)+(thisbox->pad*2)));
+                     if(calcval == 0.0)
+                        tmp->yratio = thisbox->yratio;
+                     else
+                        tmp->yratio = ((float)((thisbox->items[z].height * thisbox->yratio)-((thisbox->items[z].pad*2)+(thisbox->pad*2))))/calcval;
+                     tmp->height = thisbox->items[z].height;
+                  }
+               }
+
+               (*depth)++;
+
+               _resize_box(tmp, depth, x, y, &nux, &nuy, 3, &nupx, &nupy);
+
+               (*depth)--;
+
+            }
+         }
+      }
+
+      for(z=0;z<(thisbox->count);z++)
+      {
+         int height = thisbox->items[z].height;
+         int width = thisbox->items[z].width;
+         int pad = thisbox->items[z].pad;
+         HWND handle = thisbox->items[z].hwnd;
+         int vectorx, vectory;
+
+         /* When upxmax != pad*2 then ratios are incorrect. */
+         vectorx = (int)((width*thisbox->items[z].xratio)-width);
+         vectory = (int)((height*thisbox->items[z].yratio)-height);
+
+         if(width > 0 && height > 0)
+         {
+            char tmpbuf[100];
+            /* This is a hack to fix rounding of the sizing */
+            if(*depth == 0)
+            {
+               vectorx++;
+               vectory++;
+            }
+
+            /* If this item isn't going to expand... reset the vectors to 0 */
+            if(thisbox->items[z].vsize != SIZEEXPAND)
+               vectory = 0;
+            if(thisbox->items[z].hsize != SIZEEXPAND)
+               vectorx = 0;
+
+            WinQueryClassName(handle, 99, tmpbuf);
+
+            if(strncmp(tmpbuf, "#2", 3)==0)
+            {
+               HWND frame = (HWND)dw_window_get_data(handle, "_dw_combo_box");
+               /* Make the combobox big enough to drop down. :) */
+               WinSetWindowPos(handle, HWND_TOP, 0, -100,
+                           width + vectorx, (height + vectory) + 100, SWP_MOVE | SWP_SIZE | SWP_ZORDER);
+               _MySetWindowPos(frame, thisbox->hwnd, HWND_TOP, currentx + pad, currenty + pad,
+                           width + vectorx, height + vectory, SWP_MOVE | SWP_SIZE | SWP_ZORDER);
+            }
+            else if(strncmp(tmpbuf, "#6", 3)==0)
+            {
+               /* Entryfields on OS/2 have a thick border that isn't on Windows and GTK */
+               _MySetWindowPos(handle, thisbox->hwnd, HWND_TOP, (currentx + pad) + 3, (currenty + pad) + 3,
+                           (width + vectorx) - 6, (height + vectory) - 6, SWP_MOVE | SWP_SIZE | SWP_ZORDER);
+            }
+            else if(strncmp(tmpbuf, "#40", 5)==0)
+            {
+               _MySetWindowPos(handle, thisbox->hwnd, HWND_TOP, currentx + pad, currenty + pad,
+                           width + vectorx, height + vectory, SWP_MOVE | SWP_SIZE | SWP_ZORDER);
+               _check_resize_notebook(handle);
+            }
+            else if(strncmp(tmpbuf, SplitbarClassName, strlen(SplitbarClassName)+1)==0)
+            {
+               /* Then try the bottom or right box */
+               float *percent = (float *)dw_window_get_data(handle, "_dw_percent");
+               int type = (int)dw_window_get_data(handle, "_dw_type");
+               int cx = width + vectorx;
+               int cy = height + vectory;
+
+               _MySetWindowPos(handle, thisbox->hwnd, HWND_TOP, currentx + pad, currenty + pad,
+                           cx, cy, SWP_MOVE | SWP_SIZE | SWP_ZORDER);
+
+               if(cx > 0 && cy > 0 && percent)
+                  _handle_splitbar_resize(handle, *percent, type, cx, cy);
+            }
+            else
+            {
+               _MySetWindowPos(handle, thisbox->hwnd, HWND_TOP, currentx + pad, currenty + pad,
+                           width + vectorx, height + vectory, SWP_MOVE | SWP_SIZE | SWP_ZORDER);
+               if(thisbox->items[z].type == TYPEBOX)
+               {
+                  Box *boxinfo = WinQueryWindowPtr(handle, QWP_USER);
+
+                  if(boxinfo && boxinfo->grouphwnd)
+                     WinSetWindowPos(boxinfo->grouphwnd, HWND_TOP, 0, 0,
+                                 width + vectorx, height + vectory, SWP_MOVE | SWP_SIZE);
+
+               }
+
+            }
+
+            if(thisbox->type == DW_HORZ)
+               currentx += width + vectorx + (pad * 2);
+            if(thisbox->type == DW_VERT)
+               currenty += height + vectory + (pad * 2);
+         }
+      }
+   }
+   return 0;
 }
 
 void _do_resize(Box *thisbox, int x, int y)
 {
-	if(x != 0 && y != 0)
-	{
-		if(thisbox)
-		{
-			int usedx = 0, usedy = 0, usedpadx = 0, usedpady = 0, depth = 0;
-
-			_resize_box(thisbox, &depth, x, y, &usedx, &usedy, 1, &usedpadx, &usedpady);
-
-			if(usedx-usedpadx == 0 || usedy-usedpady == 0)
-				return;
-
-			thisbox->xratio = ((float)(x-usedpadx))/((float)(usedx-usedpadx));
-			thisbox->yratio = ((float)(y-usedpady))/((float)(usedy-usedpady));
-
-			usedx = usedy = usedpadx = usedpady = depth = 0;
-
-			_resize_box(thisbox, &depth, x, y, &usedx, &usedy, 2, &usedpadx, &usedpady);
-		}
-	}
+   if(x != 0 && y != 0)
+   {
+      if(thisbox)
+      {
+         int usedx = 0, usedy = 0, usedpadx = 0, usedpady = 0, depth = 0;
+
+         _resize_box(thisbox, &depth, x, y, &usedx, &usedy, 1, &usedpadx, &usedpady);
+
+         if(usedx-usedpadx == 0 || usedy-usedpady == 0)
+            return;
+
+         thisbox->xratio = ((float)(x-usedpadx))/((float)(usedx-usedpadx));
+         thisbox->yratio = ((float)(y-usedpady))/((float)(usedy-usedpady));
+
+         usedx = usedy = usedpadx = usedpady = depth = 0;
+
+         _resize_box(thisbox, &depth, x, y, &usedx, &usedy, 2, &usedpadx, &usedpady);
+      }
+   }
 }
 
 /* This procedure handles WM_QUERYTRACKINFO requests from the frame */
 MRESULT EXPENTRY _sizeproc(HWND hWnd, ULONG msg, MPARAM mp1, MPARAM mp2)
 {
-	PFNWP *blah = WinQueryWindowPtr(hWnd, QWP_USER);
-	Box *thisbox = NULL;
-	HWND box;
-
-	box = WinWindowFromID(hWnd, FID_CLIENT);
-	if(box)
-		thisbox = WinQueryWindowPtr(box, QWP_USER);
-
-	if(thisbox && !thisbox->titlebar)
-	{
-		switch(msg)
-		{
-		case WM_QUERYTRACKINFO:
-			{
-				if(blah && *blah)
-				{
-					PTRACKINFO ptInfo;
-					int res;
-					PFNWP myfunc = *blah;
-					res = (int)myfunc(hWnd, msg, mp1, mp2);
-
-					ptInfo = (PTRACKINFO)(mp2);
-
-					ptInfo->ptlMinTrackSize.y = 8;
-					ptInfo->ptlMinTrackSize.x = 8;
-
-					return (MRESULT)res;
-				}
-			}
-		}
-	}
-
-	if(blah && *blah)
-	{
-		PFNWP myfunc = *blah;
-		return myfunc(hWnd, msg, mp1, mp2);
-	}
-
-	return WinDefWindowProc(hWnd, msg, mp1, mp2);
+   PFNWP *blah = WinQueryWindowPtr(hWnd, QWP_USER);
+   Box *thisbox = NULL;
+   HWND box;
+
+   box = WinWindowFromID(hWnd, FID_CLIENT);
+   if(box)
+      thisbox = WinQueryWindowPtr(box, QWP_USER);
+
+   if(thisbox && !thisbox->titlebar)
+   {
+      switch(msg)
+      {
+      case WM_QUERYTRACKINFO:
+         {
+            if(blah && *blah)
+            {
+               PTRACKINFO ptInfo;
+               int res;
+               PFNWP myfunc = *blah;
+               res = (int)myfunc(hWnd, msg, mp1, mp2);
+
+               ptInfo = (PTRACKINFO)(mp2);
+
+               ptInfo->ptlMinTrackSize.y = 8;
+               ptInfo->ptlMinTrackSize.x = 8;
+
+               return (MRESULT)res;
+            }
+         }
+      }
+   }
+
+   if(blah && *blah)
+   {
+      PFNWP myfunc = *blah;
+      return myfunc(hWnd, msg, mp1, mp2);
+   }
+
+   return WinDefWindowProc(hWnd, msg, mp1, mp2);
 }
 
 void _Top(HPS hpsPaint, RECTL rclPaint)
 {
-	POINTL ptl1, ptl2;
-
-	ptl1.x = rclPaint.xLeft;
-	ptl2.y = ptl1.y = rclPaint.yTop - 1;
-	ptl2.x = rclPaint.xRight - 1;
-	GpiMove(hpsPaint, &ptl1);
-	GpiLine(hpsPaint, &ptl2);
+   POINTL ptl1, ptl2;
+
+   ptl1.x = rclPaint.xLeft;
+   ptl2.y = ptl1.y = rclPaint.yTop - 1;
+   ptl2.x = rclPaint.xRight - 1;
+   GpiMove(hpsPaint, &ptl1);
+   GpiLine(hpsPaint, &ptl2);
 }
 
 /* Left hits the bottom */
 void _Left(HPS hpsPaint, RECTL rclPaint)
 {
-	POINTL ptl1, ptl2;
-
-	ptl2.x = ptl1.x = rclPaint.xLeft;
-	ptl1.y = rclPaint.yTop - 1;
-	ptl2.y = rclPaint.yBottom;
-	GpiMove(hpsPaint, &ptl1);
-	GpiLine(hpsPaint, &ptl2);
+   POINTL ptl1, ptl2;
+
+   ptl2.x = ptl1.x = rclPaint.xLeft;
+   ptl1.y = rclPaint.yTop - 1;
+   ptl2.y = rclPaint.yBottom;
+   GpiMove(hpsPaint, &ptl1);
+   GpiLine(hpsPaint, &ptl2);
 }
 
 void _Bottom(HPS hpsPaint, RECTL rclPaint)
 {
-	POINTL ptl1, ptl2;
-
-	ptl1.x = rclPaint.xRight - 1;
-	ptl1.y = ptl2.y = rclPaint.yBottom;
-	ptl2.x = rclPaint.xLeft;
-	GpiMove(hpsPaint, &ptl1);
-	GpiLine(hpsPaint, &ptl2);
+   POINTL ptl1, ptl2;
+
+   ptl1.x = rclPaint.xRight - 1;
+   ptl1.y = ptl2.y = rclPaint.yBottom;
+   ptl2.x = rclPaint.xLeft;
+   GpiMove(hpsPaint, &ptl1);
+   GpiLine(hpsPaint, &ptl2);
 }
 
 /* Right hits the top */
 void _Right(HPS hpsPaint, RECTL rclPaint)
 {
-	POINTL ptl1, ptl2;
-
-	ptl2.x = ptl1.x = rclPaint.xRight - 1;
-	ptl1.y = rclPaint.yBottom + 1;
-	ptl2.y = rclPaint.yTop - 1;
-	GpiMove(hpsPaint, &ptl1);
-	GpiLine(hpsPaint, &ptl2);
+   POINTL ptl1, ptl2;
+
+   ptl2.x = ptl1.x = rclPaint.xRight - 1;
+   ptl1.y = rclPaint.yBottom + 1;
+   ptl2.y = rclPaint.yTop - 1;
+   GpiMove(hpsPaint, &ptl1);
+   GpiLine(hpsPaint, &ptl2);
 }
 
 /* This procedure handles drawing of a status border */
 MRESULT EXPENTRY _statusproc(HWND hWnd, ULONG msg, MPARAM mp1, MPARAM mp2)
 {
-	PFNWP *blah = WinQueryWindowPtr(hWnd, QWP_USER);
-
-	if(msg == WM_MOUSEMOVE && _wndproc(hWnd, msg, mp1, mp2))
-		return MPFROMSHORT(FALSE);
-
-	if(blah && *blah)
-	{
-		PFNWP myfunc = *blah;
-
-		switch(msg)
-		{
-		case WM_PAINT:
-			{
-				HPS hpsPaint;
-				RECTL rclPaint;
-				char buf[1024];
-
-				hpsPaint = WinBeginPaint(hWnd, 0, 0);
-				WinQueryWindowRect(hWnd, &rclPaint);
-				WinFillRect(hpsPaint, &rclPaint, CLR_PALEGRAY);
-
-				GpiSetColor(hpsPaint, CLR_DARKGRAY);
-				_Top(hpsPaint, rclPaint);
-				_Left(hpsPaint, rclPaint);
-
-				GpiSetColor(hpsPaint, CLR_WHITE);
-				_Right(hpsPaint, rclPaint);
-				_Bottom(hpsPaint, rclPaint);
-
-				WinQueryWindowText(hWnd, 1024, buf);
-				rclPaint.xLeft += 3;
-				rclPaint.xRight--;
-				rclPaint.yTop--;
-				rclPaint.yBottom++;
-
-				GpiSetColor(hpsPaint, CLR_BLACK);
-				WinDrawText(hpsPaint, -1, buf, &rclPaint, DT_TEXTATTRS, DT_TEXTATTRS, DT_VCENTER | DT_LEFT | DT_TEXTATTRS);
-				WinEndPaint(hpsPaint);
-
-				return (MRESULT)TRUE;
-			}
-		}
-		return myfunc(hWnd, msg, mp1, mp2);
-	}
-
-	return WinDefWindowProc(hWnd, msg, mp1, mp2);
+   PFNWP *blah = WinQueryWindowPtr(hWnd, QWP_USER);
+
+   if(msg == WM_MOUSEMOVE && _wndproc(hWnd, msg, mp1, mp2))
+      return MPFROMSHORT(FALSE);
+
+   if(blah && *blah)
+   {
+      PFNWP myfunc = *blah;
+
+      switch(msg)
+      {
+      case WM_PAINT:
+         {
+            HPS hpsPaint;
+            RECTL rclPaint;
+            char buf[1024];
+
+            hpsPaint = WinBeginPaint(hWnd, 0, 0);
+            WinQueryWindowRect(hWnd, &rclPaint);
+            WinFillRect(hpsPaint, &rclPaint, CLR_PALEGRAY);
+
+            GpiSetColor(hpsPaint, CLR_DARKGRAY);
+            _Top(hpsPaint, rclPaint);
+            _Left(hpsPaint, rclPaint);
+
+            GpiSetColor(hpsPaint, CLR_WHITE);
+            _Right(hpsPaint, rclPaint);
+            _Bottom(hpsPaint, rclPaint);
+
+            WinQueryWindowText(hWnd, 1024, buf);
+            rclPaint.xLeft += 3;
+            rclPaint.xRight--;
+            rclPaint.yTop--;
+            rclPaint.yBottom++;
+
+            GpiSetColor(hpsPaint, CLR_BLACK);
+            WinDrawText(hpsPaint, -1, buf, &rclPaint, DT_TEXTATTRS, DT_TEXTATTRS, DT_VCENTER | DT_LEFT | DT_TEXTATTRS);
+            WinEndPaint(hpsPaint);
+
+            return (MRESULT)TRUE;
+         }
+      }
+      return myfunc(hWnd, msg, mp1, mp2);
+   }
+
+   return WinDefWindowProc(hWnd, msg, mp1, mp2);
 }
 
 /* This procedure handles pointer changes */
 MRESULT EXPENTRY _textproc(HWND hWnd, ULONG msg, MPARAM mp1, MPARAM mp2)
 {
-	PFNWP *blah = WinQueryWindowPtr(hWnd, QWP_USER);
-
-	if(msg == WM_MOUSEMOVE &&_wndproc(hWnd, msg, mp1, mp2))
-		return MPFROMSHORT(FALSE);
-
-	if(blah && *blah)
-	{
-		PFNWP myfunc = *blah;
-
-		return myfunc(hWnd, msg, mp1, mp2);
-	}
-
-	return WinDefWindowProc(hWnd, msg, mp1, mp2);
+   PFNWP *blah = WinQueryWindowPtr(hWnd, QWP_USER);
+
+   if(msg == WM_MOUSEMOVE &&_wndproc(hWnd, msg, mp1, mp2))
+      return MPFROMSHORT(FALSE);
+
+   if(blah && *blah)
+   {
+      PFNWP myfunc = *blah;
+
+      return myfunc(hWnd, msg, mp1, mp2);
+   }
+
+   return WinDefWindowProc(hWnd, msg, mp1, mp2);
 }
 
 void _click_default(HWND handle)
 {
-	char tmpbuf[100];
-
-	WinQueryClassName(handle, 99, tmpbuf);
-
-	/* These are the window classes which can
-	 * obtain input focus.
-	 */
-	if(strncmp(tmpbuf, "#3", 3)==0)
-	{
-		/* Generate click on default item */
-		SignalHandler *tmp = Root;
-
-		/* Find any callbacks for this function */
-		while(tmp)
-		{
-			if(tmp->message == WM_COMMAND)
-			{
-				int (* API clickfunc)(HWND, void *) = (int (* API)(HWND, void *))tmp->signalfunction;
-
-				/* Make sure it's the right window, and the right ID */
-				if(tmp->window == handle)
-				{
-					clickfunc(tmp->window, tmp->data);
-					tmp = NULL;
-				}
-			}
-			if(tmp)
-				tmp= tmp->next;
-		}
-	}
-	else
-		WinSetFocus(HWND_DESKTOP, handle);
+   char tmpbuf[100];
+
+   WinQueryClassName(handle, 99, tmpbuf);
+
+   /* These are the window classes which can
+    * obtain input focus.
+    */
+   if(strncmp(tmpbuf, "#3", 3)==0)
+   {
+      /* Generate click on default item */
+      SignalHandler *tmp = Root;
+
+      /* Find any callbacks for this function */
+      while(tmp)
+      {
+         if(tmp->message == WM_COMMAND)
+         {
+            int (* API clickfunc)(HWND, void *) = (int (* API)(HWND, void *))tmp->signalfunction;
+
+            /* Make sure it's the right window, and the right ID */
+            if(tmp->window == handle)
+            {
+               clickfunc(tmp->window, tmp->data);
+               tmp = NULL;
+            }
+         }
+         if(tmp)
+            tmp= tmp->next;
+      }
+   }
+   else
+      WinSetFocus(HWND_DESKTOP, handle);
 }
 
 #define ENTRY_CUT   1001
@@ -1590,291 +1590,291 @@
  */
 MRESULT EXPENTRY _entryproc(HWND hWnd, ULONG msg, MPARAM mp1, MPARAM mp2)
 {
-	WindowData *blah = (WindowData *)WinQueryWindowPtr(hWnd, QWP_USER);
-	PFNWP oldproc = 0;
-	char tmpbuf[100];
-
-	if(blah)
-		oldproc = blah->oldproc;
-
-	WinQueryClassName(hWnd, 99, tmpbuf);
-
-	/* These are the window classes which should get a menu */
-	if(strncmp(tmpbuf, "#2", 3)==0 ||  /* Combobox */
-	   strncmp(tmpbuf, "#6", 3)==0 ||  /* Entryfield */
-	   strncmp(tmpbuf, "#10", 4)==0 || /* MLE */
-	   strncmp(tmpbuf, "#32", 4)==0)   /* Spinbutton */
-	{
-		switch(msg)
-		{
-		case WM_CONTEXTMENU:
-			{
-				HMENUI hwndMenu = dw_menu_new(0L);
-				long x, y;
-
-				if(strncmp(tmpbuf, "#10", 4)==0 && !WinSendMsg(hWnd, MLM_QUERYREADONLY, 0, 0))
-				{
-					dw_menu_append_item(hwndMenu, "Undo", ENTRY_UNDO, 0L, TRUE, FALSE, 0L);
-					dw_menu_append_item(hwndMenu, "", 0L, 0L, TRUE, FALSE, 0L);
-				}
-				dw_menu_append_item(hwndMenu, "Copy", ENTRY_COPY, 0L, TRUE, FALSE, 0L);
-				if((strncmp(tmpbuf, "#10", 4)!=0  && !dw_window_get_data(hWnd, "_dw_disabled")) || (strncmp(tmpbuf, "#10", 4)==0 && !WinSendMsg(hWnd, MLM_QUERYREADONLY, 0, 0)))
-				{
-					dw_menu_append_item(hwndMenu, "Cut", ENTRY_CUT, 0L, TRUE, FALSE, 0L);
-					dw_menu_append_item(hwndMenu, "Paste", ENTRY_PASTE, 0L, TRUE, FALSE, 0L);
-				}
-				dw_menu_append_item(hwndMenu, "", 0L, 0L, TRUE, FALSE, 0L);
-				dw_menu_append_item(hwndMenu, "Select All", ENTRY_SALL, 0L, TRUE, FALSE, 0L);
-
-				WinSetFocus(HWND_DESKTOP, hWnd);
-				dw_pointer_query_pos(&x, &y);
-				dw_menu_popup(&hwndMenu, hWnd, x, y);
-			}
-			break;
-		case WM_COMMAND:
-			{
-				ULONG command = COMMANDMSG(&msg)->cmd;
-
-				/* MLE */
-				if(strncmp(tmpbuf, "#10", 4)==0)
-				{
-					switch(command)
-					{
-					case ENTRY_CUT:
-						return WinSendMsg(hWnd, MLM_CUT, 0, 0);
-					case ENTRY_COPY:
-						return WinSendMsg(hWnd, MLM_COPY, 0, 0);
-					case ENTRY_PASTE:
-						return WinSendMsg(hWnd, MLM_PASTE, 0, 0);
-					case ENTRY_UNDO:
-						return WinSendMsg(hWnd, MLM_UNDO, 0, 0);
-					case ENTRY_SALL:
-						{
-							ULONG len = (ULONG)WinSendMsg(hWnd, MLM_QUERYTEXTLENGTH, 0, 0);
-							return WinSendMsg(hWnd, MLM_SETSEL, 0, (MPARAM)len);
-						}
-					}
-				}
-				else /* Other */
-				{
-					HWND handle = hWnd;
-
-					/* Get the entryfield handle from multi window controls */
-					if(strncmp(tmpbuf, "#2", 3)==0)
-						handle = WinWindowFromID(hWnd, 667);
-
-					if(handle)
-					{
-						switch(command)
-						{
-						case ENTRY_CUT:
-							return WinSendMsg(handle, EM_CUT, 0, 0);
-						case ENTRY_COPY:
-							return WinSendMsg(handle, EM_COPY, 0, 0);
-						case ENTRY_PASTE:
-							return WinSendMsg(handle, EM_PASTE, 0, 0);
-						case ENTRY_SALL:
-							{
-								LONG len = WinQueryWindowTextLength(hWnd);
-								return WinSendMsg(hWnd, EM_SETSEL, MPFROM2SHORT(0, (SHORT)len), 0);
-							}
-						}
-					}
-				}
-			}
-			break;
-		}
-	}
-
-	switch(msg)
-	{
-	case WM_BUTTON1DOWN:
-	case WM_BUTTON2DOWN:
-	case WM_BUTTON3DOWN:
-		{
-			if(strncmp(tmpbuf, "#32", 4)==0)
-				_run_event(hWnd, WM_SETFOCUS, (MPARAM)FALSE, (MPARAM)TRUE);
-		}
-		break;
-	case WM_CONTROL:
-		{
-			if(strncmp(tmpbuf, "#38", 4)==0)
-				_run_event(hWnd, msg, mp1, mp2);
-		}
-		break;
-	case WM_SETFOCUS:
-		_run_event(hWnd, msg, mp1, mp2);
-		break;
-	case WM_CHAR:
-		if(_run_event(hWnd, msg, mp1, mp2) == (MRESULT)TRUE)
-			return (MRESULT)TRUE;
-		if(SHORT1FROMMP(mp2) == '\t')
-		{
-			if(CHARMSG(&msg)->fs & KC_SHIFT)
-				_shift_focus_back(hWnd);
-			else
-				_shift_focus(hWnd);
-			return FALSE;
-		}
-		else if(SHORT1FROMMP(mp2) == '\r' && blah && blah->clickdefault)
-			_click_default(blah->clickdefault);
-		/* When you hit escape we get this value and the
-		 * window hangs for reasons unknown. (in an MLE)
-		 */
-		else if(SHORT1FROMMP(mp2) == 283)
-			return (MRESULT)TRUE;
-
-		break;
-	case WM_SIZE:
-		{
-			/* If it's a slider... make sure it shows the correct value */
-			if(strncmp(tmpbuf, "#38", 4)==0)
-				WinPostMsg(hWnd, WM_USER+7, 0, 0);
-		}
-		break;
-	case WM_USER+7:
-		{
-			int pos = (int)dw_window_get_data(hWnd, "_dw_slider_value");
-			WinSendMsg(hWnd, SLM_SETSLIDERINFO, MPFROM2SHORT(SMA_SLIDERARMPOSITION, SMA_INCREMENTVALUE), (MPARAM)pos);
-		}
-		break;
-	case WM_MOUSEMOVE:
-		if(_wndproc(hWnd, msg, mp1, mp2))
-			return MPFROMSHORT(FALSE);
-		break;
-	}
-
-	if(oldproc)
-		return oldproc(hWnd, msg, mp1, mp2);
-
-	return WinDefWindowProc(hWnd, msg, mp1, mp2);
+   WindowData *blah = (WindowData *)WinQueryWindowPtr(hWnd, QWP_USER);
+   PFNWP oldproc = 0;
+   char tmpbuf[100];
+
+   if(blah)
+      oldproc = blah->oldproc;
+
+   WinQueryClassName(hWnd, 99, tmpbuf);
+
+   /* These are the window classes which should get a menu */
+   if(strncmp(tmpbuf, "#2", 3)==0 ||  /* Combobox */
+      strncmp(tmpbuf, "#6", 3)==0 ||  /* Entryfield */
+      strncmp(tmpbuf, "#10", 4)==0 || /* MLE */
+      strncmp(tmpbuf, "#32", 4)==0)   /* Spinbutton */
+   {
+      switch(msg)
+      {
+      case WM_CONTEXTMENU:
+         {
+            HMENUI hwndMenu = dw_menu_new(0L);
+            long x, y;
+
+            if(strncmp(tmpbuf, "#10", 4)==0 && !WinSendMsg(hWnd, MLM_QUERYREADONLY, 0, 0))
+            {
+               dw_menu_append_item(hwndMenu, "Undo", ENTRY_UNDO, 0L, TRUE, FALSE, 0L);
+               dw_menu_append_item(hwndMenu, "", 0L, 0L, TRUE, FALSE, 0L);
+            }
+            dw_menu_append_item(hwndMenu, "Copy", ENTRY_COPY, 0L, TRUE, FALSE, 0L);
+            if((strncmp(tmpbuf, "#10", 4)!=0  && !dw_window_get_data(hWnd, "_dw_disabled")) || (strncmp(tmpbuf, "#10", 4)==0 && !WinSendMsg(hWnd, MLM_QUERYREADONLY, 0, 0)))
+            {
+               dw_menu_append_item(hwndMenu, "Cut", ENTRY_CUT, 0L, TRUE, FALSE, 0L);
+               dw_menu_append_item(hwndMenu, "Paste", ENTRY_PASTE, 0L, TRUE, FALSE, 0L);
+            }
+            dw_menu_append_item(hwndMenu, "", 0L, 0L, TRUE, FALSE, 0L);
+            dw_menu_append_item(hwndMenu, "Select All", ENTRY_SALL, 0L, TRUE, FALSE, 0L);
+
+            WinSetFocus(HWND_DESKTOP, hWnd);
+            dw_pointer_query_pos(&x, &y);
+            dw_menu_popup(&hwndMenu, hWnd, x, y);
+         }
+         break;
+      case WM_COMMAND:
+         {
+            ULONG command = COMMANDMSG(&msg)->cmd;
+
+            /* MLE */
+            if(strncmp(tmpbuf, "#10", 4)==0)
+            {
+               switch(command)
+               {
+               case ENTRY_CUT:
+                  return WinSendMsg(hWnd, MLM_CUT, 0, 0);
+               case ENTRY_COPY:
+                  return WinSendMsg(hWnd, MLM_COPY, 0, 0);
+               case ENTRY_PASTE:
+                  return WinSendMsg(hWnd, MLM_PASTE, 0, 0);
+               case ENTRY_UNDO:
+                  return WinSendMsg(hWnd, MLM_UNDO, 0, 0);
+               case ENTRY_SALL:
+                  {
+                     ULONG len = (ULONG)WinSendMsg(hWnd, MLM_QUERYTEXTLENGTH, 0, 0);
+                     return WinSendMsg(hWnd, MLM_SETSEL, 0, (MPARAM)len);
+                  }
+               }
+            }
+            else /* Other */
+            {
+               HWND handle = hWnd;
+
+               /* Get the entryfield handle from multi window controls */
+               if(strncmp(tmpbuf, "#2", 3)==0)
+                  handle = WinWindowFromID(hWnd, 667);
+
+               if(handle)
+               {
+                  switch(command)
+                  {
+                  case ENTRY_CUT:
+                     return WinSendMsg(handle, EM_CUT, 0, 0);
+                  case ENTRY_COPY:
+                     return WinSendMsg(handle, EM_COPY, 0, 0);
+                  case ENTRY_PASTE:
+                     return WinSendMsg(handle, EM_PASTE, 0, 0);
+                  case ENTRY_SALL:
+                     {
+                        LONG len = WinQueryWindowTextLength(hWnd);
+                        return WinSendMsg(hWnd, EM_SETSEL, MPFROM2SHORT(0, (SHORT)len), 0);
+                     }
+                  }
+               }
+            }
+         }
+         break;
+      }
+   }
+
+   switch(msg)
+   {
+   case WM_BUTTON1DOWN:
+   case WM_BUTTON2DOWN:
+   case WM_BUTTON3DOWN:
+      {
+         if(strncmp(tmpbuf, "#32", 4)==0)
+            _run_event(hWnd, WM_SETFOCUS, (MPARAM)FALSE, (MPARAM)TRUE);
+      }
+      break;
+   case WM_CONTROL:
+      {
+         if(strncmp(tmpbuf, "#38", 4)==0)
+            _run_event(hWnd, msg, mp1, mp2);
+      }
+      break;
+   case WM_SETFOCUS:
+      _run_event(hWnd, msg, mp1, mp2);
+      break;
+   case WM_CHAR:
+      if(_run_event(hWnd, msg, mp1, mp2) == (MRESULT)TRUE)
+         return (MRESULT)TRUE;
+      if(SHORT1FROMMP(mp2) == '\t')
+      {
+         if(CHARMSG(&msg)->fs & KC_SHIFT)
+            _shift_focus_back(hWnd);
+         else
+            _shift_focus(hWnd);
+         return FALSE;
+      }
+      else if(SHORT1FROMMP(mp2) == '\r' && blah && blah->clickdefault)
+         _click_default(blah->clickdefault);
+      /* When you hit escape we get this value and the
+       * window hangs for reasons unknown. (in an MLE)
+       */
+      else if(SHORT1FROMMP(mp2) == 283)
+         return (MRESULT)TRUE;
+
+      break;
+   case WM_SIZE:
+      {
+         /* If it's a slider... make sure it shows the correct value */
+         if(strncmp(tmpbuf, "#38", 4)==0)
+            WinPostMsg(hWnd, WM_USER+7, 0, 0);
+      }
+      break;
+   case WM_USER+7:
+      {
+         int pos = (int)dw_window_get_data(hWnd, "_dw_slider_value");
+         WinSendMsg(hWnd, SLM_SETSLIDERINFO, MPFROM2SHORT(SMA_SLIDERARMPOSITION, SMA_INCREMENTVALUE), (MPARAM)pos);
+      }
+      break;
+   case WM_MOUSEMOVE:
+      if(_wndproc(hWnd, msg, mp1, mp2))
+         return MPFROMSHORT(FALSE);
+      break;
+   }
+
+   if(oldproc)
+      return oldproc(hWnd, msg, mp1, mp2);
+
+   return WinDefWindowProc(hWnd, msg, mp1, mp2);
 }
 
 /*  Deal with combobox specifics and enhancements */
 MRESULT EXPENTRY _comboentryproc(HWND hWnd, ULONG msg, MPARAM mp1, MPARAM mp2)
 {
-	WindowData *blah = (WindowData *)WinQueryWindowPtr(hWnd, QWP_USER);
-
-	switch(msg)
-	{
-	case WM_MOUSEMOVE:
-		if(_wndproc(hWnd, msg, mp1, mp2))
-			return MPFROMSHORT(FALSE);
-		break;
-	case WM_CONTEXTMENU:
-	case WM_COMMAND:
-		return _entryproc(hWnd, msg, mp1, mp2);
-	case WM_SETFOCUS:
-		_run_event(hWnd, msg, mp1, mp2);
-		break;
-	case WM_CHAR:
-		if(_run_event(hWnd, msg, mp1, mp2) == (MRESULT)TRUE)
-			return (MRESULT)TRUE;
-		/* A Similar problem to the MLE, if ESC just return */
-		if(SHORT1FROMMP(mp2) == 283)
-			return (MRESULT)TRUE;
-		break;
-	}
-
-	if(blah && blah->oldproc)
-		return blah->oldproc(hWnd, msg, mp1, mp2);
-
-	return WinDefWindowProc(hWnd, msg, mp1, mp2);
+   WindowData *blah = (WindowData *)WinQueryWindowPtr(hWnd, QWP_USER);
+
+   switch(msg)
+   {
+   case WM_MOUSEMOVE:
+      if(_wndproc(hWnd, msg, mp1, mp2))
+         return MPFROMSHORT(FALSE);
+      break;
+   case WM_CONTEXTMENU:
+   case WM_COMMAND:
+      return _entryproc(hWnd, msg, mp1, mp2);
+   case WM_SETFOCUS:
+      _run_event(hWnd, msg, mp1, mp2);
+      break;
+   case WM_CHAR:
+      if(_run_event(hWnd, msg, mp1, mp2) == (MRESULT)TRUE)
+         return (MRESULT)TRUE;
+      /* A Similar problem to the MLE, if ESC just return */
+      if(SHORT1FROMMP(mp2) == 283)
+         return (MRESULT)TRUE;
+      break;
+   }
+
+   if(blah && blah->oldproc)
+      return blah->oldproc(hWnd, msg, mp1, mp2);
+
+   return WinDefWindowProc(hWnd, msg, mp1, mp2);
 }
 
 /* Enhance the standard OS/2 MLE control */
 MRESULT EXPENTRY _mleproc(HWND hWnd, ULONG msg, MPARAM mp1, MPARAM mp2)
 {
-	switch(msg)
-	{
-	case WM_VSCROLL:
-		if(SHORT2FROMMP(mp2) == SB_SLIDERTRACK)
-		{
-			USHORT pos = SHORT1FROMMP(mp2);
-
-			WinSendMsg(hWnd, msg, mp1, MPFROM2SHORT(pos, SB_SLIDERPOSITION));
-		}
-		break;
-	}
-	return _entryproc(hWnd, msg, mp1, mp2);
+   switch(msg)
+   {
+   case WM_VSCROLL:
+      if(SHORT2FROMMP(mp2) == SB_SLIDERTRACK)
+      {
+         USHORT pos = SHORT1FROMMP(mp2);
+
+         WinSendMsg(hWnd, msg, mp1, MPFROM2SHORT(pos, SB_SLIDERPOSITION));
+      }
+      break;
+   }
+   return _entryproc(hWnd, msg, mp1, mp2);
 }
 
 /* Handle special messages for the spinbutton's entryfield */
 MRESULT EXPENTRY _spinentryproc(HWND hWnd, ULONG msg, MPARAM mp1, MPARAM mp2)
 {
-	WindowData *blah = (WindowData *)WinQueryWindowPtr(hWnd, QWP_USER);
-	PFNWP oldproc = 0;
-
-	if(blah)
-		oldproc = blah->oldproc;
-
-	switch(msg)
-	{
-	case WM_MOUSEMOVE:
-		if(_wndproc(hWnd, msg, mp1, mp2))
-			return MPFROMSHORT(FALSE);
-		break;
-	case WM_CONTEXTMENU:
-	case WM_COMMAND:
-		return _entryproc(hWnd, msg, mp1, mp2);
-	}
-
-	if(oldproc)
-		return oldproc(hWnd, msg, mp1, mp2);
-
-	return WinDefWindowProc(hWnd, msg, mp1, mp2);
+   WindowData *blah = (WindowData *)WinQueryWindowPtr(hWnd, QWP_USER);
+   PFNWP oldproc = 0;
+
+   if(blah)
+      oldproc = blah->oldproc;
+
+   switch(msg)
+   {
+   case WM_MOUSEMOVE:
+      if(_wndproc(hWnd, msg, mp1, mp2))
+         return MPFROMSHORT(FALSE);
+      break;
+   case WM_CONTEXTMENU:
+   case WM_COMMAND:
+      return _entryproc(hWnd, msg, mp1, mp2);
+   }
+
+   if(oldproc)
+      return oldproc(hWnd, msg, mp1, mp2);
+
+   return WinDefWindowProc(hWnd, msg, mp1, mp2);
 }
 
 int _dw_int_pos(HWND hwnd)
 {
-	int pos = (int)dw_window_get_data(hwnd, "_dw_percent_value");
-	int range = _dw_percent_get_range(hwnd);
-	float fpos = (float)pos;
-	float frange = (float)range;
-	float fnew = (fpos/1000.0)*frange;
-	return (int)fnew;
+   int pos = (int)dw_window_get_data(hwnd, "_dw_percent_value");
+   int range = _dw_percent_get_range(hwnd);
+   float fpos = (float)pos;
+   float frange = (float)range;
+   float fnew = (fpos/1000.0)*frange;
+   return (int)fnew;
 }
 
 void _dw_int_set(HWND hwnd, int pos)
 {
-	int inew, range = _dw_percent_get_range(hwnd);
-	if(range)
-	{
-		float fpos = (float)pos;
-		float frange = (float)range;
-		float fnew = (fpos/frange)*1000.0;
-		inew = (int)fnew;
-		dw_window_set_data(hwnd, "_dw_percent_value", (void *)inew);
-	}
+   int inew, range = _dw_percent_get_range(hwnd);
+   if(range)
+   {
+      float fpos = (float)pos;
+      float frange = (float)range;
+      float fnew = (fpos/frange)*1000.0;
+      inew = (int)fnew;
+      dw_window_set_data(hwnd, "_dw_percent_value", (void *)inew);
+   }
 }
 
 /* Handle size changes in the percent class */
 MRESULT EXPENTRY _percentproc(HWND hWnd, ULONG msg, MPARAM mp1, MPARAM mp2)
 {
-	WindowData *blah = (WindowData *)WinQueryWindowPtr(hWnd, QWP_USER);
-	PFNWP oldproc = 0;
-
-	if(blah)
-		oldproc = blah->oldproc;
-
-	switch(msg)
-	{
-	case WM_MOUSEMOVE:
-		if(_wndproc(hWnd, msg, mp1, mp2))
-			return MPFROMSHORT(FALSE);
-		break;
-	case WM_SIZE:
-		WinPostMsg(hWnd, WM_USER+7, 0, 0);
-		break;
-	case WM_USER+7:
-		WinSendMsg(hWnd, SLM_SETSLIDERINFO, MPFROM2SHORT(SMA_SLIDERARMPOSITION,SMA_RANGEVALUE), (MPARAM)_dw_int_pos(hWnd));
-		break;
-	}
-
-	if(oldproc)
-		return oldproc(hWnd, msg, mp1, mp2);
-
-	return WinDefWindowProc(hWnd, msg, mp1, mp2);
+   WindowData *blah = (WindowData *)WinQueryWindowPtr(hWnd, QWP_USER);
+   PFNWP oldproc = 0;
+
+   if(blah)
+      oldproc = blah->oldproc;
+
+   switch(msg)
+   {
+   case WM_MOUSEMOVE:
+      if(_wndproc(hWnd, msg, mp1, mp2))
+         return MPFROMSHORT(FALSE);
+      break;
+   case WM_SIZE:
+      WinPostMsg(hWnd, WM_USER+7, 0, 0);
+      break;
+   case WM_USER+7:
+      WinSendMsg(hWnd, SLM_SETSLIDERINFO, MPFROM2SHORT(SMA_SLIDERARMPOSITION,SMA_RANGEVALUE), (MPARAM)_dw_int_pos(hWnd));
+      break;
+   }
+
+   if(oldproc)
+      return oldproc(hWnd, msg, mp1, mp2);
+
+   return WinDefWindowProc(hWnd, msg, mp1, mp2);
 }
 
 /* Handle correct painting of a combobox with the WS_CLIPCHILDREN
@@ -1882,90 +1882,90 @@
  */
 MRESULT EXPENTRY _comboproc(HWND hWnd, ULONG msg, MPARAM mp1, MPARAM mp2)
 {
-	WindowData *blah = WinQueryWindowPtr(hWnd, QWP_USER);
-	PFNWP oldproc = 0;
-
-	if(blah)
-		oldproc = blah->oldproc;
-
-	switch(msg)
-	{
-	case WM_MOUSEMOVE:
-		if(_wndproc(hWnd, msg, mp1, mp2))
-			return MPFROMSHORT(FALSE);
-		break;
-	case WM_CHAR:
-		if(SHORT1FROMMP(mp2) == '\t')
-		{
-			if(CHARMSG(&msg)->fs & KC_SHIFT)
-				_shift_focus_back(hWnd);
-			else
-				_shift_focus(hWnd);
-			return FALSE;
-		}
-		else if(SHORT1FROMMP(mp2) == '\r' && blah && blah->clickdefault)
-			_click_default(blah->clickdefault);
-		break;
-	case WM_BUTTON1DBLCLK:
-	case WM_BUTTON2DBLCLK:
-	case WM_BUTTON3DBLCLK:
-		if(dw_window_get_data(hWnd, "_dw_disabled"))
-			return (MRESULT)TRUE;
-		break;
-	case WM_BUTTON1DOWN:
-	case WM_BUTTON2DOWN:
-	case WM_BUTTON3DOWN:
-		if(_run_event(hWnd, msg, mp1, mp2) == (MRESULT)TRUE)
-			return (MRESULT)TRUE;
-		_run_event(hWnd, WM_SETFOCUS, (MPARAM)FALSE, (MPARAM)TRUE);
-		break;
-	case WM_SETFOCUS:
-		_run_event(hWnd, msg, mp1, mp2);
-		break;
-	case WM_PAINT:
-		{
-			HWND entry, frame = (HWND)dw_window_get_data(hWnd, "_dw_combo_box"), parent = WinQueryWindow(frame, QW_PARENT);
-			HPS hpsPaint;
-			POINTL ptl;
-			unsigned long width, height, thumbheight = 0;
-			ULONG color;
-
-			if((entry = (HWND)dw_window_get_data(hWnd, "_dw_comboentry")) != NULLHANDLE)
-				dw_window_get_pos_size(entry, 0, 0, 0, &thumbheight);
-
-			if(!thumbheight)
-				thumbheight = WinQuerySysValue(HWND_DESKTOP, SV_CYVSCROLLARROW);
-
-			/* Add 6 because it has a thick border like the entryfield */
-			thumbheight += 6;
-
-			color = (ULONG)dw_window_get_data(parent, "_dw_fore");
-			dw_window_get_pos_size(hWnd, 0, 0, &width, &height);
-
-			if(height > thumbheight)
-			{
-				hpsPaint = WinGetPS(hWnd);
-				if(color)
-					GpiSetColor(hpsPaint, _internal_color(color-1));
-				else
-					GpiSetColor(hpsPaint, CLR_PALEGRAY);
-
-				ptl.x = ptl.y = 0;
-				GpiMove(hpsPaint, &ptl);
-
-				ptl.x = width;
-				ptl.y = height - thumbheight;
-				GpiBox(hpsPaint, DRO_FILL, &ptl, 0, 0);
-
-				WinReleasePS(hpsPaint);
-			}
-		}
-		break;
-	}
-	if(oldproc)
-		return oldproc(hWnd, msg, mp1, mp2);
-
-	return WinDefWindowProc(hWnd, msg, mp1, mp2);
+   WindowData *blah = WinQueryWindowPtr(hWnd, QWP_USER);
+   PFNWP oldproc = 0;
+
+   if(blah)
+      oldproc = blah->oldproc;
+
+   switch(msg)
+   {
+   case WM_MOUSEMOVE:
+      if(_wndproc(hWnd, msg, mp1, mp2))
+         return MPFROMSHORT(FALSE);
+      break;
+   case WM_CHAR:
+      if(SHORT1FROMMP(mp2) == '\t')
+      {
+         if(CHARMSG(&msg)->fs & KC_SHIFT)
+            _shift_focus_back(hWnd);
+         else
+            _shift_focus(hWnd);
+         return FALSE;
+      }
+      else if(SHORT1FROMMP(mp2) == '\r' && blah && blah->clickdefault)
+         _click_default(blah->clickdefault);
+      break;
+   case WM_BUTTON1DBLCLK:
+   case WM_BUTTON2DBLCLK:
+   case WM_BUTTON3DBLCLK:
+      if(dw_window_get_data(hWnd, "_dw_disabled"))
+         return (MRESULT)TRUE;
+      break;
+   case WM_BUTTON1DOWN:
+   case WM_BUTTON2DOWN:
+   case WM_BUTTON3DOWN:
+      if(_run_event(hWnd, msg, mp1, mp2) == (MRESULT)TRUE)
+         return (MRESULT)TRUE;
+      _run_event(hWnd, WM_SETFOCUS, (MPARAM)FALSE, (MPARAM)TRUE);
+      break;
+   case WM_SETFOCUS:
+      _run_event(hWnd, msg, mp1, mp2);
+      break;
+   case WM_PAINT:
+      {
+         HWND entry, frame = (HWND)dw_window_get_data(hWnd, "_dw_combo_box"), parent = WinQueryWindow(frame, QW_PARENT);
+         HPS hpsPaint;
+         POINTL ptl;
+         unsigned long width, height, thumbheight = 0;
+         ULONG color;
+
+         if((entry = (HWND)dw_window_get_data(hWnd, "_dw_comboentry")) != NULLHANDLE)
+            dw_window_get_pos_size(entry, 0, 0, 0, &thumbheight);
+
+         if(!thumbheight)
+            thumbheight = WinQuerySysValue(HWND_DESKTOP, SV_CYVSCROLLARROW);
+
+         /* Add 6 because it has a thick border like the entryfield */
+         thumbheight += 6;
+
+         color = (ULONG)dw_window_get_data(parent, "_dw_fore");
+         dw_window_get_pos_size(hWnd, 0, 0, &width, &height);
+
+         if(height > thumbheight)
+         {
+            hpsPaint = WinGetPS(hWnd);
+            if(color)
+               GpiSetColor(hpsPaint, _internal_color(color-1));
+            else
+               GpiSetColor(hpsPaint, CLR_PALEGRAY);
+
+            ptl.x = ptl.y = 0;
+            GpiMove(hpsPaint, &ptl);
+
+            ptl.x = width;
+            ptl.y = height - thumbheight;
+            GpiBox(hpsPaint, DRO_FILL, &ptl, 0, 0);
+
+            WinReleasePS(hpsPaint);
+         }
+      }
+      break;
+   }
+   if(oldproc)
+      return oldproc(hWnd, msg, mp1, mp2);
+
+   return WinDefWindowProc(hWnd, msg, mp1, mp2);
 }
 
 void _GetPPFont(HWND hwnd, char *buff)
@@ -1990,1044 +1990,1044 @@
 
 int _HandleScroller(HWND handle, int pos, int which)
 {
-	MPARAM res;
-	int min, max, page;
-
-	if(which == SB_SLIDERTRACK)
-		return pos;
-
-	pos = dw_scrollbar_get_pos(handle);
-	res = WinSendMsg(handle, SBM_QUERYRANGE, 0, 0);
-
-	min = SHORT1FROMMP(res);
-	max = SHORT2FROMMP(res);
-	page = (int)dw_window_get_data(handle, "_dw_scrollbar_visible");
-
-	switch(which)
-	{
-	case SB_LINEUP:
-		pos = pos - 1;
-		if(pos < min)
-			pos = min;
-		dw_scrollbar_set_pos(handle, pos);
-		return pos;
-	case SB_LINEDOWN:
-		pos = pos + 1;
-		if(pos > max)
-			pos = max;
-		dw_scrollbar_set_pos(handle, pos);
-		return pos;
-	case SB_PAGEUP:
-		pos = pos - page;
-		if(pos < min)
-			pos = min;
-		dw_scrollbar_set_pos(handle, pos);
-		return pos;
-	case SB_PAGEDOWN:
-		pos = pos + page;
-		if(pos > max)
-			pos = max;
-		dw_scrollbar_set_pos(handle, pos);
-		return pos;
-	}
-	return -1;
+   MPARAM res;
+   int min, max, page;
+
+   if(which == SB_SLIDERTRACK)
+      return pos;
+
+   pos = dw_scrollbar_get_pos(handle);
+   res = WinSendMsg(handle, SBM_QUERYRANGE, 0, 0);
+
+   min = SHORT1FROMMP(res);
+   max = SHORT2FROMMP(res);
+   page = (int)dw_window_get_data(handle, "_dw_scrollbar_visible");
+
+   switch(which)
+   {
+   case SB_LINEUP:
+      pos = pos - 1;
+      if(pos < min)
+         pos = min;
+      dw_scrollbar_set_pos(handle, pos);
+      return pos;
+   case SB_LINEDOWN:
+      pos = pos + 1;
+      if(pos > max)
+         pos = max;
+      dw_scrollbar_set_pos(handle, pos);
+      return pos;
+   case SB_PAGEUP:
+      pos = pos - page;
+      if(pos < min)
+         pos = min;
+      dw_scrollbar_set_pos(handle, pos);
+      return pos;
+   case SB_PAGEDOWN:
+      pos = pos + page;
+      if(pos > max)
+         pos = max;
+      dw_scrollbar_set_pos(handle, pos);
+      return pos;
+   }
+   return -1;
 }
 
 void _clear_emphasis(void)
 {
-	if(hwndEmph && WinIsWindow(dwhab, hwndEmph) && pCoreEmph)
-		WinSendMsg(hwndEmph, CM_SETRECORDEMPHASIS, pCoreEmph, MPFROM2SHORT(FALSE, CRA_SOURCE));
-	hwndEmph = NULLHANDLE;
-	pCoreEmph = NULL;
+   if(hwndEmph && WinIsWindow(dwhab, hwndEmph) && pCoreEmph)
+      WinSendMsg(hwndEmph, CM_SETRECORDEMPHASIS, pCoreEmph, MPFROM2SHORT(FALSE, CRA_SOURCE));
+   hwndEmph = NULLHANDLE;
+   pCoreEmph = NULL;
 }
 
 /* Find the desktop window handle */
 HWND _menu_owner(HWND handle)
 {
-	HWND menuowner = NULLHANDLE, lastowner = (HWND)dw_window_get_data(handle, "_dw_owner");
-	int menubar = (int)dw_window_get_data(handle, "_dw_menubar");
-
-	/* Find the toplevel window */
-	while(!menubar && (menuowner = (HWND)dw_window_get_data(lastowner, "_dw_owner")) != NULLHANDLE)
-	{
-		menubar = (int)dw_window_get_data(lastowner, "_dw_menubar");
-		lastowner = menuowner;
-	}
-	if(menuowner && menubar)
-	{
-		HWND client = WinWindowFromID(menuowner, FID_CLIENT);
-
-		return client ? client : menuowner;
-	}
-	return NULLHANDLE;
+   HWND menuowner = NULLHANDLE, lastowner = (HWND)dw_window_get_data(handle, "_dw_owner");
+   int menubar = (int)dw_window_get_data(handle, "_dw_menubar");
+
+   /* Find the toplevel window */
+   while(!menubar && (menuowner = (HWND)dw_window_get_data(lastowner, "_dw_owner")) != NULLHANDLE)
+   {
+      menubar = (int)dw_window_get_data(lastowner, "_dw_menubar");
+      lastowner = menuowner;
+   }
+   if(menuowner && menubar)
+   {
+      HWND client = WinWindowFromID(menuowner, FID_CLIENT);
+
+      return client ? client : menuowner;
+   }
+   return NULLHANDLE;
 }
 
 MRESULT EXPENTRY _run_event(HWND hWnd, ULONG msg, MPARAM mp1, MPARAM mp2)
 {
-	int result = -1;
-	SignalHandler *tmp = Root;
-	ULONG origmsg = msg;
-
-	if(msg == WM_BUTTON2DOWN || msg == WM_BUTTON3DOWN)
-		msg = WM_BUTTON1DOWN;
-	if(msg == WM_BUTTON2UP || msg == WM_BUTTON3UP)
-		msg = WM_BUTTON1UP;
-	if(msg == WM_VSCROLL || msg == WM_HSCROLL)
-		msg = WM_CONTROL;
-
-	/* Find any callbacks for this function */
-	while(tmp)
-	{
-		if(tmp->message == msg || msg == WM_CONTROL || tmp->message == WM_USER+1)
-		{
-			switch(msg)
-			{
-			case WM_SETFOCUS:
-				{
-					if((mp2 && tmp->message == WM_SETFOCUS) || (!mp2 && tmp->message == WM_USER+1))
-					{
-						int (* API setfocusfunc)(HWND, void *) = (int (* API)(HWND, void *))tmp->signalfunction;
-
-						if(hWnd == tmp->window || WinWindowFromID(tmp->window, FID_CLIENT) == hWnd)
-						{
-							result = setfocusfunc(tmp->window, tmp->data);
-							tmp = NULL;
-						}
-					}
-				}
-				break;
-			case WM_TIMER:
-				{
-					int (* API timerfunc)(void *) = (int (* API)(void *))tmp->signalfunction;
-					if(tmp->id == (int)mp1)
-					{
-						if(!timerfunc(tmp->data))
-							dw_timer_disconnect(tmp->id);
-						tmp = NULL;
-					}
-					result = 0;
-				}
-				break;
-			case WM_SIZE:
-				{
-					int (* API sizefunc)(HWND, int, int, void *) = (int (* API)(HWND, int, int, void *))tmp->signalfunction;
-
-					if((hWnd == tmp->window || WinWindowFromID(tmp->window, FID_CLIENT) == hWnd) && SHORT1FROMMP(mp2) && SHORT2FROMMP(mp2))
-					{
-						result = sizefunc(tmp->window, SHORT1FROMMP(mp2), SHORT2FROMMP(mp2), tmp->data);
-						tmp = NULL;
-					}
-				}
-				break;
-			case WM_BUTTON1DOWN:
-				{
-					POINTS pts = (*((POINTS*)&mp1));
-					int (* API buttonfunc)(HWND, int, int, int, void *) = (int (* API)(HWND, int, int, int, void *))tmp->signalfunction;
-
-					if(hWnd == tmp->window || WinWindowFromID(tmp->window, FID_CLIENT) == hWnd || WinQueryCapture(HWND_DESKTOP) == tmp->window)
-					{
-						int button = 0;
-
-						switch(origmsg)
-						{
-						case WM_BUTTON1DOWN:
-							button = 1;
-							break;
-						case WM_BUTTON2DOWN:
-							button = 2;
-							break;
-						case WM_BUTTON3DOWN:
-							button = 3;
-							break;
-						}
-
-						result = buttonfunc(tmp->window, pts.x, _get_frame_height(tmp->window) - pts.y, button, tmp->data);
-						tmp = NULL;
-					}
-				}
-				break;
-			case WM_BUTTON1UP:
-				{
-					POINTS pts = (*((POINTS*)&mp1));
-					int (* API buttonfunc)(HWND, int, int, int, void *) = (int (* API)(HWND, int, int, int, void *))tmp->signalfunction;
-
-					if(hWnd == tmp->window || WinWindowFromID(tmp->window, FID_CLIENT) == hWnd || WinQueryCapture(HWND_DESKTOP) == tmp->window)
-					{
-						int button = 0;
-
-						switch(origmsg)
-						{
-						case WM_BUTTON1UP:
-							button = 1;
-							break;
-						case WM_BUTTON2UP:
-							button = 2;
-							break;
-						case WM_BUTTON3UP:
-							button = 3;
-							break;
-						}
-
-						result = buttonfunc(tmp->window, pts.x, WinQueryWindow(tmp->window, QW_PARENT) == HWND_DESKTOP ? dw_screen_height() - pts.y : _get_height(tmp->window) - pts.y, button, tmp->data);
-						tmp = NULL;
-					}
-				}
-				break;
-			case WM_MOUSEMOVE:
-				{
-					int (* API motionfunc)(HWND, int, int, int, void *) = (int (* API)(HWND, int, int, int, void *))tmp->signalfunction;
-
-					if(hWnd == tmp->window || WinWindowFromID(tmp->window, FID_CLIENT) == hWnd || WinQueryCapture(HWND_DESKTOP) == tmp->window)
-					{
-						int keys = 0;
-						SHORT x = SHORT1FROMMP(mp1), y = SHORT2FROMMP(mp1);
-
-						if (WinGetKeyState(HWND_DESKTOP, VK_BUTTON1) & 0x8000)
-							keys = DW_BUTTON1_MASK;
-						if (WinGetKeyState(HWND_DESKTOP, VK_BUTTON2) & 0x8000)
-							keys |= DW_BUTTON2_MASK;
-						if (WinGetKeyState(HWND_DESKTOP, VK_BUTTON3) & 0x8000)
-							keys |= DW_BUTTON3_MASK;
-
-						result = motionfunc(tmp->window, x, _get_frame_height(tmp->window) - y, keys, tmp->data);
-						tmp = NULL;
-					}
-				}
-				break;
-			case WM_CHAR:
-				{
-					int (* API keypressfunc)(HWND, char, int, int, void *) = (int (* API)(HWND, char, int, int, void *))tmp->signalfunction;
-
-					if((hWnd == tmp->window || _toplevel_window(hWnd) == tmp->window) && !(SHORT1FROMMP(mp1) & KC_KEYUP))
-					{
-						int vk;
-						char ch = 0;
-
-						if(SHORT1FROMMP(mp1) & KC_CHAR)
-							ch = (char)SHORT1FROMMP(mp2);
-						if(SHORT1FROMMP(mp1) & KC_VIRTUALKEY)
-							vk = SHORT2FROMMP(mp2);
-						else
-							vk = SHORT1FROMMP(mp2) + 128;
-
-						/* This is a hack to fix shift presses showing
-						 * up as tabs!
-						 */
-						if(ch == '\t' && !(SHORT1FROMMP(mp1) & KC_CHAR))
-						{
-							ch = 0;
-							vk = VK_SHIFT;
-						}
-
-						result = keypressfunc(tmp->window, ch, vk,
-											  SHORT1FROMMP(mp1) & (KC_ALT | KC_SHIFT | KC_CTRL), tmp->data);
-						tmp = NULL;
-					}
-				}
-				break;
-			case WM_CLOSE:
-				{
-					int (* API closefunc)(HWND, void *) = (int (* API)(HWND, void *))tmp->signalfunction;
-
-					if(hWnd == tmp->window || hWnd == WinWindowFromID(tmp->window, FID_CLIENT))
-					{
-						result = closefunc(tmp->window, tmp->data);
-						if(result)
-							result = FALSE;
-						tmp = NULL;
-					}
-				}
-				break;
-			case WM_PAINT:
-				{
-					HPS hps;
-					DWExpose exp;
-					int (* API exposefunc)(HWND, DWExpose *, void *) = (int (* API)(HWND, DWExpose *, void *))tmp->signalfunction;
-					RECTL  rc;
-
-					if(hWnd == tmp->window)
-					{
-						int height = _get_height(hWnd);
-
-						hps = WinBeginPaint(hWnd, 0L, &rc);
-						exp.x = rc.xLeft;
-						exp.y = height - rc.yTop - 1;
-						exp.width = rc.xRight - rc. xLeft;
-						exp.height = rc.yTop - rc.yBottom;
-						result = exposefunc(hWnd, &exp, tmp->data);
-						WinEndPaint(hps);
-					}
-				}
-				break;
-			case WM_COMMAND:
-				{
-					int (* API clickfunc)(HWND, void *) = (int (* API)(HWND, void *))tmp->signalfunction;
-					ULONG command = COMMANDMSG(&msg)->cmd;
-
-					if(tmp->id && command == tmp->id)
-					{
-						HWND menuowner = _menu_owner(tmp->window);
-
-						if(menuowner == hWnd || menuowner == NULLHANDLE)
-						{
-							result = clickfunc(tmp->window, tmp->data);
-							tmp = NULL;
-						}
-					}
-					else if(tmp->window < 65536 && command == tmp->window)
-					{
-						result = clickfunc(popup ?  popup : tmp->window, tmp->data);
-						tmp = NULL;
-					}
-				}
-				break;
-			case WM_CONTROL:
-				if(origmsg == WM_VSCROLL || origmsg == WM_HSCROLL || tmp->message == SHORT2FROMMP(mp1) ||
-				   (tmp->message == SLN_SLIDERTRACK && SHORT2FROMMP(mp1) == SLN_CHANGE))
-				{
-					int svar = SLN_SLIDERTRACK;
-					if(origmsg == WM_CONTROL)
-						svar = SHORT2FROMMP(mp1);
-
-					switch(svar)
-					{
-					case CN_ENTER:
-						{
-							int (* API containerselectfunc)(HWND, char *, void *) = (int (* API)(HWND, char *, void *))tmp->signalfunction;
-							int id = SHORT1FROMMP(mp1);
-							HWND conthwnd = dw_window_from_id(hWnd, id);
-							char *text = NULL;
-
-							if(mp2)
-							{
-								PRECORDCORE pre;
-
-								pre = ((PNOTIFYRECORDENTER)mp2)->pRecord;
-								if(pre)
-									text = pre->pszIcon;
-							}
-
-							if(tmp->window == conthwnd)
-							{
-								result = containerselectfunc(tmp->window, text, tmp->data);
-								tmp = NULL;
-							}
-						}
-						break;
-					case CN_EXPANDTREE:
-						{
-							int (* API treeexpandfunc)(HWND, HTREEITEM, void *) = (int (* API)(HWND, HTREEITEM, void *))tmp->signalfunction;
-							int id = SHORT1FROMMP(mp1);
-							HWND conthwnd = dw_window_from_id(hWnd, id);
-
-							if(tmp->window == conthwnd)
-							{
-								result = treeexpandfunc(tmp->window, (HTREEITEM)mp2, tmp->data);
-								tmp = NULL;
-							}
-						}
-						break;
-					case CN_CONTEXTMENU:
-						{
-							int (* API containercontextfunc)(HWND, char *, int, int, void *, void *) = (int (* API)(HWND, char *, int, int, void *, void *))tmp->signalfunction;
-							int id = SHORT1FROMMP(mp1);
-							HWND conthwnd = dw_window_from_id(hWnd, id);
-							char *text = NULL;
-							void *user = NULL;
-							LONG x,y;
-
-							if(mp2)
-							{
-								PCNRITEM pci;
-
-								pci = (PCNRITEM)mp2;
-
-								text = pci->rc.pszIcon;
-								user = pci->user;
-							}
-
-							dw_pointer_query_pos(&x, &y);
-
-							if(tmp->window == conthwnd)
-							{
-								int container = (int)dw_window_get_data(tmp->window, "_dw_container");
-
-								if(mp2)
-								{
-									if(!container)
-									{
-										NOTIFYRECORDEMPHASIS pre;
-
-										dw_tree_item_select(tmp->window, (HTREEITEM)mp2);
-										pre.pRecord = mp2;
-										pre.fEmphasisMask = CRA_CURSORED;
-										pre.hwndCnr = tmp->window;
-										_run_event(hWnd, WM_CONTROL, MPFROM2SHORT(0, CN_EMPHASIS), (MPARAM)&pre);
-										pre.pRecord->flRecordAttr |= CRA_CURSORED;
-									}
-									else
-									{
-										if(pCoreEmph)
-											_clear_emphasis();
-										hwndEmph = tmp->window;
-										pCoreEmph = mp2;
-										WinSendMsg(tmp->window, CM_SETRECORDEMPHASIS, mp2, MPFROM2SHORT(TRUE, CRA_SOURCE));
-									}
-								}
-								result = containercontextfunc(tmp->window, text, x, y, tmp->data, user);
-								tmp = NULL;
-							}
-						}
-						break;
-					case CN_EMPHASIS:
-						{
-							PNOTIFYRECORDEMPHASIS pre = (PNOTIFYRECORDEMPHASIS)mp2;
-							static int emph_recurse = 0;
-
-							if(!emph_recurse)
-							{
-								emph_recurse = 1;
-
-								if(mp2)
-								{
-									if(tmp->window == pre->hwndCnr)
-									{
-										PCNRITEM pci = (PCNRITEM)pre->pRecord;
-
-										if(pci && pre->fEmphasisMask & CRA_CURSORED && (pci->rc.flRecordAttr & CRA_CURSORED))
-										{
-											int (* API treeselectfunc)(HWND, HTREEITEM, char *, void *, void *) = (int (* API)(HWND, HTREEITEM, char *, void *, void *))tmp->signalfunction;
-
-											if(dw_window_get_data(tmp->window, "_dw_container"))
-												result = treeselectfunc(tmp->window, 0, pci->rc.pszIcon, tmp->data, 0);
-											else
-											{
-												if(lasthcnr == tmp->window && lastitem == (HWND)pci)
-												{
-													lasthcnr = 0;
-													lastitem = 0;
-												}
-												else
-												{
-													lasthcnr = tmp->window;
-													lastitem = (HWND)pci;
-													result = treeselectfunc(tmp->window, (HTREEITEM)pci, pci->rc.pszIcon, tmp->data, pci->user);
-												}
-											}
-											tmp = NULL;
-										}
-									}
-								}
-								emph_recurse = 0;
-							}
-						}
-						break;
-					case LN_SELECT:
-						{
-							char classbuf[100];
-
-							WinQueryClassName(tmp->window, 99, classbuf);
-
-							if(strncmp(classbuf, "#38", 4) == 0)
-							{
-								int (* API valuechangedfunc)(HWND, int, void *) = (int (* API)(HWND, int, void *))tmp->signalfunction;
-
-								if(tmp->window == hWnd || WinQueryWindow(tmp->window, QW_PARENT) == hWnd)
-								{
-									static int lastvalue = -1;
-									static HWND lasthwnd = NULLHANDLE;
-									int ulValue = (int)WinSendMsg(tmp->window, SLM_QUERYSLIDERINFO, MPFROM2SHORT(SMA_SLIDERARMPOSITION, SMA_INCREMENTVALUE), 0);
-									if(lastvalue != ulValue || lasthwnd != tmp->window)
-									{
-										result = valuechangedfunc(tmp->window, ulValue, tmp->data);
-										lastvalue = ulValue;
-										lasthwnd = tmp->window;
-									}
-									tmp = NULL;
-								}
-							}
-							else
-							{
-								int (* API listboxselectfunc)(HWND, int, void *) = (int (* API )(HWND, int, void *))tmp->signalfunction;
-								int id = SHORT1FROMMP(mp1);
-								HWND conthwnd = dw_window_from_id(hWnd, id);
-								static int _recursing = 0;
-
-								if(_recursing == 0 && (tmp->window == conthwnd || (!id && tmp->window == (HWND)mp2)))
-								{
-									char buf1[500];
-									unsigned int index = dw_listbox_selected(tmp->window);
-
-									dw_listbox_get_text(tmp->window, index, buf1, 500);
-
-									_recursing = 1;
-
-									if(id && strncmp(classbuf, "#2", 3)==0)
-									{
-										char *buf2;
-
-										buf2 = dw_window_get_text(tmp->window);
-
-										/* This is to make sure the listboxselect function doesn't
-										 * get called if the user is modifying the entry text.
-										 */
-										if(buf2 && *buf2 && *buf1 && strncmp(buf1, buf2, 500) == 0)
-											result = listboxselectfunc(tmp->window, index, tmp->data);
-
-										if(buf2)
-											free(buf2);
-									}
-									else
-										result = listboxselectfunc(tmp->window, index, tmp->data);
-
-									_recursing = 0;
-									tmp = NULL;
-								}
-							}
-						}
-						break;
-					case SLN_SLIDERTRACK:
-						{
-							int (* API valuechangedfunc)(HWND, int, void *) = (int (* API)(HWND, int, void *))tmp->signalfunction;
-
-							if(origmsg == WM_CONTROL)
-							{
-								/* Handle Slider control */
-								if(tmp->window == hWnd || WinQueryWindow(tmp->window, QW_PARENT) == hWnd)
-								{
-									static int lastvalue = -1;
-									static HWND lasthwnd = NULLHANDLE;
-									int ulValue = (int)WinSendMsg(tmp->window, SLM_QUERYSLIDERINFO, MPFROM2SHORT(SMA_SLIDERARMPOSITION, SMA_INCREMENTVALUE), 0);
-									if(lastvalue != ulValue || lasthwnd != tmp->window)
-									{
-										dw_window_set_data(tmp->window, "_dw_slider_value", (void *)ulValue);
-										result = valuechangedfunc(tmp->window, ulValue, tmp->data);
-										lastvalue = ulValue;
-										lasthwnd = tmp->window;
-									}
-									tmp = NULL;
-								}
-							}
-							else
-							{
-								/* Handle scrollbar control */
-								if(tmp->window > 65535 && tmp->window == WinWindowFromID(hWnd, (ULONG)mp1))
-								{
-									int pos = _HandleScroller(tmp->window, (int)SHORT1FROMMP(mp2), (int)SHORT2FROMMP(mp2));;
-
-									if(pos > -1)
-									{
-										dw_window_set_data(tmp->window, "_dw_scrollbar_value", (void *)pos);
-										result = valuechangedfunc(tmp->window, pos, tmp->data);
-									}
-									result = 0;
-									tmp = NULL;
-								}
-							}
-						}
-						break;
-					case BKN_PAGESELECTED:
-						{
-							PAGESELECTNOTIFY *psn = (PAGESELECTNOTIFY *)mp2;
-
-							if(psn && tmp->window == psn->hwndBook)
-							{
-								int (* API switchpagefunc)(HWND, unsigned long, void *) = (int (* API)(HWND, unsigned long, void *))tmp->signalfunction;
-
-								result = switchpagefunc(tmp->window, psn->ulPageIdNew, tmp->data);
-								tmp = NULL;
-							}
-						}
-						break;
-					}
-				}
-				break;
-			}
-		}
-
-		if(tmp)
-			tmp = tmp->next;
-
-	}
-	return (MRESULT)result;
+   int result = -1;
+   SignalHandler *tmp = Root;
+   ULONG origmsg = msg;
+
+   if(msg == WM_BUTTON2DOWN || msg == WM_BUTTON3DOWN)
+      msg = WM_BUTTON1DOWN;
+   if(msg == WM_BUTTON2UP || msg == WM_BUTTON3UP)
+      msg = WM_BUTTON1UP;
+   if(msg == WM_VSCROLL || msg == WM_HSCROLL)
+      msg = WM_CONTROL;
+
+   /* Find any callbacks for this function */
+   while(tmp)
+   {
+      if(tmp->message == msg || msg == WM_CONTROL || tmp->message == WM_USER+1)
+      {
+         switch(msg)
+         {
+         case WM_SETFOCUS:
+            {
+               if((mp2 && tmp->message == WM_SETFOCUS) || (!mp2 && tmp->message == WM_USER+1))
+               {
+                  int (* API setfocusfunc)(HWND, void *) = (int (* API)(HWND, void *))tmp->signalfunction;
+
+                  if(hWnd == tmp->window || WinWindowFromID(tmp->window, FID_CLIENT) == hWnd)
+                  {
+                     result = setfocusfunc(tmp->window, tmp->data);
+                     tmp = NULL;
+                  }
+               }
+            }
+            break;
+         case WM_TIMER:
+            {
+               int (* API timerfunc)(void *) = (int (* API)(void *))tmp->signalfunction;
+               if(tmp->id == (int)mp1)
+               {
+                  if(!timerfunc(tmp->data))
+                     dw_timer_disconnect(tmp->id);
+                  tmp = NULL;
+               }
+               result = 0;
+            }
+            break;
+         case WM_SIZE:
+            {
+               int (* API sizefunc)(HWND, int, int, void *) = (int (* API)(HWND, int, int, void *))tmp->signalfunction;
+
+               if((hWnd == tmp->window || WinWindowFromID(tmp->window, FID_CLIENT) == hWnd) && SHORT1FROMMP(mp2) && SHORT2FROMMP(mp2))
+               {
+                  result = sizefunc(tmp->window, SHORT1FROMMP(mp2), SHORT2FROMMP(mp2), tmp->data);
+                  tmp = NULL;
+               }
+            }
+            break;
+         case WM_BUTTON1DOWN:
+            {
+               POINTS pts = (*((POINTS*)&mp1));
+               int (* API buttonfunc)(HWND, int, int, int, void *) = (int (* API)(HWND, int, int, int, void *))tmp->signalfunction;
+
+               if(hWnd == tmp->window || WinWindowFromID(tmp->window, FID_CLIENT) == hWnd || WinQueryCapture(HWND_DESKTOP) == tmp->window)
+               {
+                  int button = 0;
+
+                  switch(origmsg)
+                  {
+                  case WM_BUTTON1DOWN:
+                     button = 1;
+                     break;
+                  case WM_BUTTON2DOWN:
+                     button = 2;
+                     break;
+                  case WM_BUTTON3DOWN:
+                     button = 3;
+                     break;
+                  }
+
+                  result = buttonfunc(tmp->window, pts.x, _get_frame_height(tmp->window) - pts.y, button, tmp->data);
+                  tmp = NULL;
+               }
+            }
+            break;
+         case WM_BUTTON1UP:
+            {
+               POINTS pts = (*((POINTS*)&mp1));
+               int (* API buttonfunc)(HWND, int, int, int, void *) = (int (* API)(HWND, int, int, int, void *))tmp->signalfunction;
+
+               if(hWnd == tmp->window || WinWindowFromID(tmp->window, FID_CLIENT) == hWnd || WinQueryCapture(HWND_DESKTOP) == tmp->window)
+               {
+                  int button = 0;
+
+                  switch(origmsg)
+                  {
+                  case WM_BUTTON1UP:
+                     button = 1;
+                     break;
+                  case WM_BUTTON2UP:
+                     button = 2;
+                     break;
+                  case WM_BUTTON3UP:
+                     button = 3;
+                     break;
+                  }
+
+                  result = buttonfunc(tmp->window, pts.x, WinQueryWindow(tmp->window, QW_PARENT) == HWND_DESKTOP ? dw_screen_height() - pts.y : _get_height(tmp->window) - pts.y, button, tmp->data);
+                  tmp = NULL;
+               }
+            }
+            break;
+         case WM_MOUSEMOVE:
+            {
+               int (* API motionfunc)(HWND, int, int, int, void *) = (int (* API)(HWND, int, int, int, void *))tmp->signalfunction;
+
+               if(hWnd == tmp->window || WinWindowFromID(tmp->window, FID_CLIENT) == hWnd || WinQueryCapture(HWND_DESKTOP) == tmp->window)
+               {
+                  int keys = 0;
+                  SHORT x = SHORT1FROMMP(mp1), y = SHORT2FROMMP(mp1);
+
+                  if (WinGetKeyState(HWND_DESKTOP, VK_BUTTON1) & 0x8000)
+                     keys = DW_BUTTON1_MASK;
+                  if (WinGetKeyState(HWND_DESKTOP, VK_BUTTON2) & 0x8000)
+                     keys |= DW_BUTTON2_MASK;
+                  if (WinGetKeyState(HWND_DESKTOP, VK_BUTTON3) & 0x8000)
+                     keys |= DW_BUTTON3_MASK;
+
+                  result = motionfunc(tmp->window, x, _get_frame_height(tmp->window) - y, keys, tmp->data);
+                  tmp = NULL;
+               }
+            }
+            break;
+         case WM_CHAR:
+            {
+               int (* API keypressfunc)(HWND, char, int, int, void *) = (int (* API)(HWND, char, int, int, void *))tmp->signalfunction;
+
+               if((hWnd == tmp->window || _toplevel_window(hWnd) == tmp->window) && !(SHORT1FROMMP(mp1) & KC_KEYUP))
+               {
+                  int vk;
+                  char ch = 0;
+
+                  if(SHORT1FROMMP(mp1) & KC_CHAR)
+                     ch = (char)SHORT1FROMMP(mp2);
+                  if(SHORT1FROMMP(mp1) & KC_VIRTUALKEY)
+                     vk = SHORT2FROMMP(mp2);
+                  else
+                     vk = SHORT1FROMMP(mp2) + 128;
+
+                  /* This is a hack to fix shift presses showing
+                   * up as tabs!
+                   */
+                  if(ch == '\t' && !(SHORT1FROMMP(mp1) & KC_CHAR))
+                  {
+                     ch = 0;
+                     vk = VK_SHIFT;
+                  }
+
+                  result = keypressfunc(tmp->window, ch, vk,
+                                   SHORT1FROMMP(mp1) & (KC_ALT | KC_SHIFT | KC_CTRL), tmp->data);
+                  tmp = NULL;
+               }
+            }
+            break;
+         case WM_CLOSE:
+            {
+               int (* API closefunc)(HWND, void *) = (int (* API)(HWND, void *))tmp->signalfunction;
+
+               if(hWnd == tmp->window || hWnd == WinWindowFromID(tmp->window, FID_CLIENT))
+               {
+                  result = closefunc(tmp->window, tmp->data);
+                  if(result)
+                     result = FALSE;
+                  tmp = NULL;
+               }
+            }
+            break;
+         case WM_PAINT:
+            {
+               HPS hps;
+               DWExpose exp;
+               int (* API exposefunc)(HWND, DWExpose *, void *) = (int (* API)(HWND, DWExpose *, void *))tmp->signalfunction;
+               RECTL  rc;
+
+               if(hWnd == tmp->window)
+               {
+                  int height = _get_height(hWnd);
+
+                  hps = WinBeginPaint(hWnd, 0L, &rc);
+                  exp.x = rc.xLeft;
+                  exp.y = height - rc.yTop - 1;
+                  exp.width = rc.xRight - rc. xLeft;
+                  exp.height = rc.yTop - rc.yBottom;
+                  result = exposefunc(hWnd, &exp, tmp->data);
+                  WinEndPaint(hps);
+               }
+            }
+            break;
+         case WM_COMMAND:
+            {
+               int (* API clickfunc)(HWND, void *) = (int (* API)(HWND, void *))tmp->signalfunction;
+               ULONG command = COMMANDMSG(&msg)->cmd;
+
+               if(tmp->id && command == tmp->id)
+               {
+                  HWND menuowner = _menu_owner(tmp->window);
+
+                  if(menuowner == hWnd || menuowner == NULLHANDLE)
+                  {
+                     result = clickfunc(tmp->window, tmp->data);
+                     tmp = NULL;
+                  }
+               }
+               else if(tmp->window < 65536 && command == tmp->window)
+               {
+                  result = clickfunc(popup ?  popup : tmp->window, tmp->data);
+                  tmp = NULL;
+               }
+            }
+            break;
+         case WM_CONTROL:
+            if(origmsg == WM_VSCROLL || origmsg == WM_HSCROLL || tmp->message == SHORT2FROMMP(mp1) ||
+               (tmp->message == SLN_SLIDERTRACK && SHORT2FROMMP(mp1) == SLN_CHANGE))
+            {
+               int svar = SLN_SLIDERTRACK;
+               if(origmsg == WM_CONTROL)
+                  svar = SHORT2FROMMP(mp1);
+
+               switch(svar)
+               {
+               case CN_ENTER:
+                  {
+                     int (* API containerselectfunc)(HWND, char *, void *) = (int (* API)(HWND, char *, void *))tmp->signalfunction;
+                     int id = SHORT1FROMMP(mp1);
+                     HWND conthwnd = dw_window_from_id(hWnd, id);
+                     char *text = NULL;
+
+                     if(mp2)
+                     {
+                        PRECORDCORE pre;
+
+                        pre = ((PNOTIFYRECORDENTER)mp2)->pRecord;
+                        if(pre)
+                           text = pre->pszIcon;
+                     }
+
+                     if(tmp->window == conthwnd)
+                     {
+                        result = containerselectfunc(tmp->window, text, tmp->data);
+                        tmp = NULL;
+                     }
+                  }
+                  break;
+               case CN_EXPANDTREE:
+                  {
+                     int (* API treeexpandfunc)(HWND, HTREEITEM, void *) = (int (* API)(HWND, HTREEITEM, void *))tmp->signalfunction;
+                     int id = SHORT1FROMMP(mp1);
+                     HWND conthwnd = dw_window_from_id(hWnd, id);
+
+                     if(tmp->window == conthwnd)
+                     {
+                        result = treeexpandfunc(tmp->window, (HTREEITEM)mp2, tmp->data);
+                        tmp = NULL;
+                     }
+                  }
+                  break;
+               case CN_CONTEXTMENU:
+                  {
+                     int (* API containercontextfunc)(HWND, char *, int, int, void *, void *) = (int (* API)(HWND, char *, int, int, void *, void *))tmp->signalfunction;
+                     int id = SHORT1FROMMP(mp1);
+                     HWND conthwnd = dw_window_from_id(hWnd, id);
+                     char *text = NULL;
+                     void *user = NULL;
+                     LONG x,y;
+
+                     if(mp2)
+                     {
+                        PCNRITEM pci;
+
+                        pci = (PCNRITEM)mp2;
+
+                        text = pci->rc.pszIcon;
+                        user = pci->user;
+                     }
+
+                     dw_pointer_query_pos(&x, &y);
+
+                     if(tmp->window == conthwnd)
+                     {
+                        int container = (int)dw_window_get_data(tmp->window, "_dw_container");
+
+                        if(mp2)
+                        {
+                           if(!container)
+                           {
+                              NOTIFYRECORDEMPHASIS pre;
+
+                              dw_tree_item_select(tmp->window, (HTREEITEM)mp2);
+                              pre.pRecord = mp2;
+                              pre.fEmphasisMask = CRA_CURSORED;
+                              pre.hwndCnr = tmp->window;
+                              _run_event(hWnd, WM_CONTROL, MPFROM2SHORT(0, CN_EMPHASIS), (MPARAM)&pre);
+                              pre.pRecord->flRecordAttr |= CRA_CURSORED;
+                           }
+                           else
+                           {
+                              if(pCoreEmph)
+                                 _clear_emphasis();
+                              hwndEmph = tmp->window;
+                              pCoreEmph = mp2;
+                              WinSendMsg(tmp->window, CM_SETRECORDEMPHASIS, mp2, MPFROM2SHORT(TRUE, CRA_SOURCE));
+                           }
+                        }
+                        result = containercontextfunc(tmp->window, text, x, y, tmp->data, user);
+                        tmp = NULL;
+                     }
+                  }
+                  break;
+               case CN_EMPHASIS:
+                  {
+                     PNOTIFYRECORDEMPHASIS pre = (PNOTIFYRECORDEMPHASIS)mp2;
+                     static int emph_recurse = 0;
+
+                     if(!emph_recurse)
+                     {
+                        emph_recurse = 1;
+
+                        if(mp2)
+                        {
+                           if(tmp->window == pre->hwndCnr)
+                           {
+                              PCNRITEM pci = (PCNRITEM)pre->pRecord;
+
+                              if(pci && pre->fEmphasisMask & CRA_CURSORED && (pci->rc.flRecordAttr & CRA_CURSORED))
+                              {
+                                 int (* API treeselectfunc)(HWND, HTREEITEM, char *, void *, void *) = (int (* API)(HWND, HTREEITEM, char *, void *, void *))tmp->signalfunction;
+
+                                 if(dw_window_get_data(tmp->window, "_dw_container"))
+                                    result = treeselectfunc(tmp->window, 0, pci->rc.pszIcon, tmp->data, 0);
+                                 else
+                                 {
+                                    if(lasthcnr == tmp->window && lastitem == (HWND)pci)
+                                    {
+                                       lasthcnr = 0;
+                                       lastitem = 0;
+                                    }
+                                    else
+                                    {
+                                       lasthcnr = tmp->window;
+                                       lastitem = (HWND)pci;
+                                       result = treeselectfunc(tmp->window, (HTREEITEM)pci, pci->rc.pszIcon, tmp->data, pci->user);
+                                    }
+                                 }
+                                 tmp = NULL;
+                              }
+                           }
+                        }
+                        emph_recurse = 0;
+                     }
+                  }
+                  break;
+               case LN_SELECT:
+                  {
+                     char classbuf[100];
+
+                     WinQueryClassName(tmp->window, 99, classbuf);
+
+                     if(strncmp(classbuf, "#38", 4) == 0)
+                     {
+                        int (* API valuechangedfunc)(HWND, int, void *) = (int (* API)(HWND, int, void *))tmp->signalfunction;
+
+                        if(tmp->window == hWnd || WinQueryWindow(tmp->window, QW_PARENT) == hWnd)
+                        {
+                           static int lastvalue = -1;
+                           static HWND lasthwnd = NULLHANDLE;
+                           int ulValue = (int)WinSendMsg(tmp->window, SLM_QUERYSLIDERINFO, MPFROM2SHORT(SMA_SLIDERARMPOSITION, SMA_INCREMENTVALUE), 0);
+                           if(lastvalue != ulValue || lasthwnd != tmp->window)
+                           {
+                              result = valuechangedfunc(tmp->window, ulValue, tmp->data);
+                              lastvalue = ulValue;
+                              lasthwnd = tmp->window;
+                           }
+                           tmp = NULL;
+                        }
+                     }
+                     else
+                     {
+                        int (* API listboxselectfunc)(HWND, int, void *) = (int (* API )(HWND, int, void *))tmp->signalfunction;
+                        int id = SHORT1FROMMP(mp1);
+                        HWND conthwnd = dw_window_from_id(hWnd, id);
+                        static int _recursing = 0;
+
+                        if(_recursing == 0 && (tmp->window == conthwnd || (!id && tmp->window == (HWND)mp2)))
+                        {
+                           char buf1[500];
+                           unsigned int index = dw_listbox_selected(tmp->window);
+
+                           dw_listbox_get_text(tmp->window, index, buf1, 500);
+
+                           _recursing = 1;
+
+                           if(id && strncmp(classbuf, "#2", 3)==0)
+                           {
+                              char *buf2;
+
+                              buf2 = dw_window_get_text(tmp->window);
+
+                              /* This is to make sure the listboxselect function doesn't
+                               * get called if the user is modifying the entry text.
+                               */
+                              if(buf2 && *buf2 && *buf1 && strncmp(buf1, buf2, 500) == 0)
+                                 result = listboxselectfunc(tmp->window, index, tmp->data);
+
+                              if(buf2)
+                                 free(buf2);
+                           }
+                           else
+                              result = listboxselectfunc(tmp->window, index, tmp->data);
+
+                           _recursing = 0;
+                           tmp = NULL;
+                        }
+                     }
+                  }
+                  break;
+               case SLN_SLIDERTRACK:
+                  {
+                     int (* API valuechangedfunc)(HWND, int, void *) = (int (* API)(HWND, int, void *))tmp->signalfunction;
+
+                     if(origmsg == WM_CONTROL)
+                     {
+                        /* Handle Slider control */
+                        if(tmp->window == hWnd || WinQueryWindow(tmp->window, QW_PARENT) == hWnd)
+                        {
+                           static int lastvalue = -1;
+                           static HWND lasthwnd = NULLHANDLE;
+                           int ulValue = (int)WinSendMsg(tmp->window, SLM_QUERYSLIDERINFO, MPFROM2SHORT(SMA_SLIDERARMPOSITION, SMA_INCREMENTVALUE), 0);
+                           if(lastvalue != ulValue || lasthwnd != tmp->window)
+                           {
+                              dw_window_set_data(tmp->window, "_dw_slider_value", (void *)ulValue);
+                              result = valuechangedfunc(tmp->window, ulValue, tmp->data);
+                              lastvalue = ulValue;
+                              lasthwnd = tmp->window;
+                           }
+                           tmp = NULL;
+                        }
+                     }
+                     else
+                     {
+                        /* Handle scrollbar control */
+                        if(tmp->window > 65535 && tmp->window == WinWindowFromID(hWnd, (ULONG)mp1))
+                        {
+                           int pos = _HandleScroller(tmp->window, (int)SHORT1FROMMP(mp2), (int)SHORT2FROMMP(mp2));;
+
+                           if(pos > -1)
+                           {
+                              dw_window_set_data(tmp->window, "_dw_scrollbar_value", (void *)pos);
+                              result = valuechangedfunc(tmp->window, pos, tmp->data);
+                           }
+                           result = 0;
+                           tmp = NULL;
+                        }
+                     }
+                  }
+                  break;
+               case BKN_PAGESELECTED:
+                  {
+                     PAGESELECTNOTIFY *psn = (PAGESELECTNOTIFY *)mp2;
+
+                     if(psn && tmp->window == psn->hwndBook)
+                     {
+                        int (* API switchpagefunc)(HWND, unsigned long, void *) = (int (* API)(HWND, unsigned long, void *))tmp->signalfunction;
+
+                        result = switchpagefunc(tmp->window, psn->ulPageIdNew, tmp->data);
+                        tmp = NULL;
+                     }
+                  }
+                  break;
+               }
+            }
+            break;
+         }
+      }
+
+      if(tmp)
+         tmp = tmp->next;
+
+   }
+   return (MRESULT)result;
 }
 
 /* Gets a DW_RGB value from the three spinbuttons */
 unsigned long _dw_color_spin_get(HWND window)
 {
-	HWND button = (HWND)dw_window_get_data(window, "_dw_red_spin");
-	long red, green, blue;
-
-	red = dw_spinbutton_get_pos(button);
-	button = (HWND)dw_window_get_data(window, "_dw_green_spin");
-	green = dw_spinbutton_get_pos(button);
-	button = (HWND)dw_window_get_data(window, "_dw_blue_spin");
-	blue = dw_spinbutton_get_pos(button);
-
-	return DW_RGB(red, green, blue);
+   HWND button = (HWND)dw_window_get_data(window, "_dw_red_spin");
+   long red, green, blue;
+
+   red = dw_spinbutton_get_pos(button);
+   button = (HWND)dw_window_get_data(window, "_dw_green_spin");
+   green = dw_spinbutton_get_pos(button);
+   button = (HWND)dw_window_get_data(window, "_dw_blue_spin");
+   blue = dw_spinbutton_get_pos(button);
+
+   return DW_RGB(red, green, blue);
 }
 
 /* Set the three spinbuttons from a DW_RGB value */
 void _dw_color_spin_set(HWND window, unsigned long value)
 {
-	HWND button = (HWND)dw_window_get_data(window, "_dw_red_spin");
-	dw_window_set_data(window, "_dw_updating", (void *)1);
-	dw_spinbutton_set_pos(button, DW_RED_VALUE(value));
-	button = (HWND)dw_window_get_data(window, "_dw_green_spin");
-	dw_spinbutton_set_pos(button, DW_GREEN_VALUE(value));
-	button = (HWND)dw_window_get_data(window, "_dw_blue_spin");
-	dw_spinbutton_set_pos(button, DW_BLUE_VALUE(value));
-	dw_window_set_data(window, "_dw_updating", NULL);
+   HWND button = (HWND)dw_window_get_data(window, "_dw_red_spin");
+   dw_window_set_data(window, "_dw_updating", (void *)1);
+   dw_spinbutton_set_pos(button, DW_RED_VALUE(value));
+   button = (HWND)dw_window_get_data(window, "_dw_green_spin");
+   dw_spinbutton_set_pos(button, DW_GREEN_VALUE(value));
+   button = (HWND)dw_window_get_data(window, "_dw_blue_spin");
+   dw_spinbutton_set_pos(button, DW_BLUE_VALUE(value));
+   dw_window_set_data(window, "_dw_updating", NULL);
 }
 
 /* Sets the color selection control to be a DW_RGB value */
 void _dw_col_set(HWND col, unsigned long value)
 {
-	WinSendMsg(col, 0x0602, MPFROMLONG(_os2_color(value)), 0);
-	if(!IS_WARP4())
-		WinSendMsg(col, 0x1384, MPFROMLONG(_os2_color(value)), 0);
+   WinSendMsg(col, 0x0602, MPFROMLONG(_os2_color(value)), 0);
+   if(!IS_WARP4())
+      WinSendMsg(col, 0x1384, MPFROMLONG(_os2_color(value)), 0);
 }
 
 /* Handles control messages sent to the box (owner). */
 MRESULT EXPENTRY _controlproc(HWND hWnd, ULONG msg, MPARAM mp1, MPARAM mp2)
 {
-	Box *blah = WinQueryWindowPtr(hWnd, QWP_USER);
-
-	switch(msg)
-	{
-	case WM_MOUSEMOVE:
-		if(_wndproc(hWnd, msg, mp1, mp2))
-			return MPFROMSHORT(FALSE);
-		break;
-	case WM_VSCROLL:
-	case WM_HSCROLL:
-		if(_run_event(hWnd, msg, mp1, mp2))
-		{
-			HWND window = WinWindowFromID(hWnd, (ULONG)mp1);
-			_HandleScroller(window, (int)SHORT1FROMMP(mp2), (int)SHORT2FROMMP(mp2));
-		}
-		break;
-		/* Handles Color Selection control messages */
-	case 0x0601:
-	case 0x130C:
-		{
-			HWND window = (HWND)dw_window_get_data(hWnd, "_dw_window");
-			unsigned long val = (unsigned long)mp1;
-
-			if(window)
-				_dw_color_spin_set(window, DW_RGB((val & 0xFF0000) >> 16, (val & 0xFF00) >> 8, val & 0xFF));
-		}
-		break;
-	case WM_CONTROL:
-		if((SHORT2FROMMP(mp1) == SPBN_CHANGE || SHORT2FROMMP(mp1) == SPBN_ENDSPIN))
-		{
-			HWND window = (HWND)dw_window_get_data(hWnd, "_dw_window");
-
-			if(window && !dw_window_get_data(window, "_dw_updating"))
-			{
-				unsigned long val = _dw_color_spin_get(window);
-				HWND col = (HWND)dw_window_get_data(window, "_dw_col");
-
-				_dw_col_set(col, val);
-			}
-		}
-		_run_event(hWnd, msg, mp1, mp2);
-		break;
-	}
-
-	if(blah && blah->oldproc)
-		return blah->oldproc(hWnd, msg, mp1, mp2);
-
-	return WinDefWindowProc(hWnd, msg, mp1, mp2);
+   Box *blah = WinQueryWindowPtr(hWnd, QWP_USER);
+
+   switch(msg)
+   {
+   case WM_MOUSEMOVE:
+      if(_wndproc(hWnd, msg, mp1, mp2))
+         return MPFROMSHORT(FALSE);
+      break;
+   case WM_VSCROLL:
+   case WM_HSCROLL:
+      if(_run_event(hWnd, msg, mp1, mp2))
+      {
+         HWND window = WinWindowFromID(hWnd, (ULONG)mp1);
+         _HandleScroller(window, (int)SHORT1FROMMP(mp2), (int)SHORT2FROMMP(mp2));
+      }
+      break;
+      /* Handles Color Selection control messages */
+   case 0x0601:
+   case 0x130C:
+      {
+         HWND window = (HWND)dw_window_get_data(hWnd, "_dw_window");
+         unsigned long val = (unsigned long)mp1;
+
+         if(window)
+            _dw_color_spin_set(window, DW_RGB((val & 0xFF0000) >> 16, (val & 0xFF00) >> 8, val & 0xFF));
+      }
+      break;
+   case WM_CONTROL:
+      if((SHORT2FROMMP(mp1) == SPBN_CHANGE || SHORT2FROMMP(mp1) == SPBN_ENDSPIN))
+      {
+         HWND window = (HWND)dw_window_get_data(hWnd, "_dw_window");
+
+         if(window && !dw_window_get_data(window, "_dw_updating"))
+         {
+            unsigned long val = _dw_color_spin_get(window);
+            HWND col = (HWND)dw_window_get_data(window, "_dw_col");
+
+            _dw_col_set(col, val);
+         }
+      }
+      _run_event(hWnd, msg, mp1, mp2);
+      break;
+   }
+
+   if(blah && blah->oldproc)
+      return blah->oldproc(hWnd, msg, mp1, mp2);
+
+   return WinDefWindowProc(hWnd, msg, mp1, mp2);
 }
 
 /* The main window procedure for Dynamic Windows, all the resizing code is done here. */
 MRESULT EXPENTRY _wndproc(HWND hWnd, ULONG msg, MPARAM mp1, MPARAM mp2)
 {
-	int result = -1;
-	static int command_active = 0;
-	void (* API windowfunc)(PVOID) = 0L;
-
-	if(!command_active)
-	{
+   int result = -1;
+   static int command_active = 0;
+   void (* API windowfunc)(PVOID) = 0L;
+
+   if(!command_active)
+   {
         /* Make sure we don't end up in infinite recursion */
-		command_active = 1;
-
-		result = (int)_run_event(hWnd, msg, mp1, mp2);
-
-		command_active = 0;
-	}
-
-	/* Now that any handlers are done... do normal processing */
-	switch( msg )
-	{
+      command_active = 1;
+
+      result = (int)_run_event(hWnd, msg, mp1, mp2);
+
+      command_active = 0;
+   }
+
+   /* Now that any handlers are done... do normal processing */
+   switch( msg )
+   {
    case WM_ERASEBACKGROUND:
       return 0;
 
-	case WM_PAINT:
-		{
-		HPS    hps;
-		RECTL  rc;
-
-		hps = WinBeginPaint( hWnd, 0L, &rc );
-		WinEndPaint( hps );
-		break;
-		}
-
-	case WM_SIZE:
-		{
-			Box *mybox = (Box *)WinQueryWindowPtr(hWnd, QWP_USER);
-
-			if(!SHORT1FROMMP(mp2) && !SHORT2FROMMP(mp2))
-				return (MPARAM)TRUE;
-
-			if(mybox && mybox->flags != DW_MINIMIZED)
-			{
-				/* Hide the window when recalculating to reduce
-				 * CPU load.
-				 */
-				WinShowWindow(hWnd, FALSE);
+   case WM_PAINT:
+      {
+      HPS    hps;
+      RECTL  rc;
+
+      hps = WinBeginPaint( hWnd, 0L, &rc );
+      WinEndPaint( hps );
+      break;
+      }
+
+   case WM_SIZE:
+      {
+         Box *mybox = (Box *)WinQueryWindowPtr(hWnd, QWP_USER);
+
+         if(!SHORT1FROMMP(mp2) && !SHORT2FROMMP(mp2))
+            return (MPARAM)TRUE;
+
+         if(mybox && mybox->flags != DW_MINIMIZED)
+         {
+            /* Hide the window when recalculating to reduce
+             * CPU load.
+             */
+            WinShowWindow(hWnd, FALSE);
 
                 if(mybox->items)
-					WinSetWindowPos(mybox->items[0].hwnd, HWND_TOP, 0, 0, SHORT1FROMMP(mp2), SHORT2FROMMP(mp2), SWP_MOVE | SWP_SIZE);
-
-				_do_resize(mybox, SHORT1FROMMP(mp2), SHORT2FROMMP(mp2));
-
-				WinShowWindow(hWnd, TRUE);
-			}
-		}
-		break;
-	case WM_MINMAXFRAME:
-		{
-			Box *mybox = (Box *)WinQueryWindowPtr(hWnd, QWP_USER);
-			SWP *swp = (SWP *)mp1;
-
-			if(mybox && (swp->fl & SWP_MINIMIZE))
-				mybox->flags = DW_MINIMIZED;
-
-			if(mybox && (swp->fl & SWP_RESTORE))
-			{
-				if(!mybox->titlebar && mybox->hwndtitle)
-					WinSetParent(mybox->hwndtitle, HWND_OBJECT, FALSE);
-				mybox->flags = 0;
-			}
-
-			if(mybox && (swp->fl & (SWP_MAXIMIZE | SWP_RESTORE)))
-			{
-				int z;
-				SWP swp2;
-
-				WinQueryWindowPos(swp->hwnd, &swp2);
-
-				if(swp2.cx == swp->cx && swp2.cy == swp->cy)
-					return FALSE;
-
-				mybox->flags = 0;
-
-				/* Hide the window when recalculating to reduce
-				 * CPU load.
-				 */
-				WinShowWindow(hWnd, FALSE);
-
-				_do_resize(mybox, swp->cx, swp->cy);
-
-				if(mybox->count == 1 && mybox->items[0].type == TYPEBOX)
-				{
-					mybox = (Box *)WinQueryWindowPtr(mybox->items[0].hwnd, QWP_USER);
-
-					for(z=0;z<mybox->count;z++)
-						_check_resize_notebook(mybox->items[z].hwnd);
-
-				}
-
-				WinShowWindow(hWnd, TRUE);
-			}
-		}
-		break;
-	case WM_CONTROL:
-		switch(SHORT2FROMMP(mp1))
-		{
-		case BKN_PAGESELECTEDPENDING:
-			{
-				PAGESELECTNOTIFY *psn = (PAGESELECTNOTIFY *)mp2;
-				HWND pagehwnd = (HWND)WinSendMsg(psn->hwndBook, BKM_QUERYPAGEWINDOWHWND, MPFROMLONG(psn->ulPageIdNew), 0);
-				Box *pagebox = (Box *)WinQueryWindowPtr(pagehwnd, QWP_USER);
-				unsigned long x, y, width, height;
-				RECTL rc;
-
-				if(pagebox && psn->ulPageIdNew != psn->ulPageIdCur)
-				{
-					dw_window_get_pos_size(psn->hwndBook, &x, &y, &width, &height);
-
-					rc.xLeft = x;
-					rc.yBottom = y;
-					rc.xRight = x + width;
-					rc.yTop = y + height;
-
-					WinSendMsg(psn->hwndBook, BKM_CALCPAGERECT, (MPARAM)&rc, (MPARAM)TRUE);
-
-					_do_resize(pagebox, rc.xRight - rc.xLeft, rc.yTop - rc.yBottom);
-				}
-			}
-			break;
-		}
-		break;
-	case WM_CLOSE:
-		if(result == -1)
-		{
-			dw_window_destroy(WinQueryWindow(hWnd, QW_PARENT));
-			return (MRESULT)TRUE;
-		}
-		break;
-	case WM_MOUSEMOVE:
-		{
-			HPOINTER pointer;
-
-			if((pointer = (HPOINTER)dw_window_get_data(hWnd, "_dw_pointer")) ||
-			   (pointer = (HPOINTER)dw_window_get_data(_toplevel_window(hWnd), "_dw_pointer")))
-			{
-				WinSetPointer(HWND_DESKTOP, pointer);
-				return MRFROMSHORT(TRUE);
-			}
-		}
-		return MRFROMSHORT(FALSE);
-	case WM_USER:
-		windowfunc = (void (* API)(void *))mp1;
-
-		if(windowfunc)
-			windowfunc((void *)mp2);
-		break;
-	case WM_CHAR:
-		if(SHORT1FROMMP(mp2) == '\t')
-		{
-			if(CHARMSG(&msg)->fs & KC_SHIFT)
-				_shift_focus_back(hWnd);
-			else
-				_shift_focus(hWnd);
-			return FALSE;
-		}
-		break;
-	case WM_DESTROY:
-		{
-			HWND parent = WinQueryWindow(hWnd, QW_PARENT);
-
-			/* Free memory before destroying */
-			if(parent && WinWindowFromID(parent, FID_CLIENT) == hWnd)
-				_free_window_memory(parent);
-			else
-				_free_window_memory(hWnd);
-		}
-		break;
-	case WM_MENUEND:
-		/* Delay removing the signal until we've executed
-		 * the signal handler.
-		 */
-		WinPostMsg(hWnd, WM_USER+2, mp1, mp2);
-		break;
-	case WM_USER+2:
-		_clear_emphasis();
-		if(dw_window_get_data((HWND)mp2, "_dw_popup"))
-			_free_menu_data((HWND)mp2);
-		break;
-	}
-
-	if(result != -1)
-		return (MRESULT)result;
-	else
-		return WinDefWindowProc(hWnd, msg, mp1, mp2);
+               WinSetWindowPos(mybox->items[0].hwnd, HWND_TOP, 0, 0, SHORT1FROMMP(mp2), SHORT2FROMMP(mp2), SWP_MOVE | SWP_SIZE);
+
+            _do_resize(mybox, SHORT1FROMMP(mp2), SHORT2FROMMP(mp2));
+
+            WinShowWindow(hWnd, TRUE);
+         }
+      }
+      break;
+   case WM_MINMAXFRAME:
+      {
+         Box *mybox = (Box *)WinQueryWindowPtr(hWnd, QWP_USER);
+         SWP *swp = (SWP *)mp1;
+
+         if(mybox && (swp->fl & SWP_MINIMIZE))
+            mybox->flags = DW_MINIMIZED;
+
+         if(mybox && (swp->fl & SWP_RESTORE))
+         {
+            if(!mybox->titlebar && mybox->hwndtitle)
+               WinSetParent(mybox->hwndtitle, HWND_OBJECT, FALSE);
+            mybox->flags = 0;
+         }
+
+         if(mybox && (swp->fl & (SWP_MAXIMIZE | SWP_RESTORE)))
+         {
+            int z;
+            SWP swp2;
+
+            WinQueryWindowPos(swp->hwnd, &swp2);
+
+            if(swp2.cx == swp->cx && swp2.cy == swp->cy)
+               return FALSE;
+
+            mybox->flags = 0;
+
+            /* Hide the window when recalculating to reduce
+             * CPU load.
+             */
+            WinShowWindow(hWnd, FALSE);
+
+            _do_resize(mybox, swp->cx, swp->cy);
+
+            if(mybox->count == 1 && mybox->items[0].type == TYPEBOX)
+            {
+               mybox = (Box *)WinQueryWindowPtr(mybox->items[0].hwnd, QWP_USER);
+
+               for(z=0;z<mybox->count;z++)
+                  _check_resize_notebook(mybox->items[z].hwnd);
+
+            }
+
+            WinShowWindow(hWnd, TRUE);
+         }
+      }
+      break;
+   case WM_CONTROL:
+      switch(SHORT2FROMMP(mp1))
+      {
+      case BKN_PAGESELECTEDPENDING:
+         {
+            PAGESELECTNOTIFY *psn = (PAGESELECTNOTIFY *)mp2;
+            HWND pagehwnd = (HWND)WinSendMsg(psn->hwndBook, BKM_QUERYPAGEWINDOWHWND, MPFROMLONG(psn->ulPageIdNew), 0);
+            Box *pagebox = (Box *)WinQueryWindowPtr(pagehwnd, QWP_USER);
+            unsigned long x, y, width, height;
+            RECTL rc;
+
+            if(pagebox && psn->ulPageIdNew != psn->ulPageIdCur)
+            {
+               dw_window_get_pos_size(psn->hwndBook, &x, &y, &width, &height);
+
+               rc.xLeft = x;
+               rc.yBottom = y;
+               rc.xRight = x + width;
+               rc.yTop = y + height;
+
+               WinSendMsg(psn->hwndBook, BKM_CALCPAGERECT, (MPARAM)&rc, (MPARAM)TRUE);
+
+               _do_resize(pagebox, rc.xRight - rc.xLeft, rc.yTop - rc.yBottom);
+            }
+         }
+         break;
+      }
+      break;
+   case WM_CLOSE:
+      if(result == -1)
+      {
+         dw_window_destroy(WinQueryWindow(hWnd, QW_PARENT));
+         return (MRESULT)TRUE;
+      }
+      break;
+   case WM_MOUSEMOVE:
+      {
+         HPOINTER pointer;
+
+         if((pointer = (HPOINTER)dw_window_get_data(hWnd, "_dw_pointer")) ||
+            (pointer = (HPOINTER)dw_window_get_data(_toplevel_window(hWnd), "_dw_pointer")))
+         {
+            WinSetPointer(HWND_DESKTOP, pointer);
+            return MRFROMSHORT(TRUE);
+         }
+      }
+      return MRFROMSHORT(FALSE);
+   case WM_USER:
+      windowfunc = (void (* API)(void *))mp1;
+
+      if(windowfunc)
+         windowfunc((void *)mp2);
+      break;
+   case WM_CHAR:
+      if(SHORT1FROMMP(mp2) == '\t')
+      {
+         if(CHARMSG(&msg)->fs & KC_SHIFT)
+            _shift_focus_back(hWnd);
+         else
+            _shift_focus(hWnd);
+         return FALSE;
+      }
+      break;
+   case WM_DESTROY:
+      {
+         HWND parent = WinQueryWindow(hWnd, QW_PARENT);
+
+         /* Free memory before destroying */
+         if(parent && WinWindowFromID(parent, FID_CLIENT) == hWnd)
+            _free_window_memory(parent);
+         else
+            _free_window_memory(hWnd);
+      }
+      break;
+   case WM_MENUEND:
+      /* Delay removing the signal until we've executed
+       * the signal handler.
+       */
+      WinPostMsg(hWnd, WM_USER+2, mp1, mp2);
+      break;
+   case WM_USER+2:
+      _clear_emphasis();
+      if(dw_window_get_data((HWND)mp2, "_dw_popup"))
+         _free_menu_data((HWND)mp2);
+      break;
+   }
+
+   if(result != -1)
+      return (MRESULT)result;
+   else
+      return WinDefWindowProc(hWnd, msg, mp1, mp2);
 }
 
 void _changebox(Box *thisbox, int percent, int type)
 {
-	int z;
-
-	for(z=0;z<thisbox->count;z++)
-	{
-		if(thisbox->items[z].type == TYPEBOX)
-		{
-			Box *tmp = WinQueryWindowPtr(thisbox->items[z].hwnd, QWP_USER);
-			_changebox(tmp, percent, type);
-		}
-		else
-		{
-			if(type == DW_HORZ)
-			{
-				if(thisbox->items[z].hsize == SIZEEXPAND)
-					thisbox->items[z].width = (int)(((float)thisbox->items[z].origwidth) * (((float)percent)/((float)100.0)));
-			}
-			else
-			{
-				if(thisbox->items[z].vsize == SIZEEXPAND)
-					thisbox->items[z].height = (int)(((float)thisbox->items[z].origheight) * (((float)percent)/((float)100.0)));
-			}
-		}
-	}
+   int z;
+
+   for(z=0;z<thisbox->count;z++)
+   {
+      if(thisbox->items[z].type == TYPEBOX)
+      {
+         Box *tmp = WinQueryWindowPtr(thisbox->items[z].hwnd, QWP_USER);
+         _changebox(tmp, percent, type);
+      }
+      else
+      {
+         if(type == DW_HORZ)
+         {
+            if(thisbox->items[z].hsize == SIZEEXPAND)
+               thisbox->items[z].width = (int)(((float)thisbox->items[z].origwidth) * (((float)percent)/((float)100.0)));
+         }
+         else
+         {
+            if(thisbox->items[z].vsize == SIZEEXPAND)
+               thisbox->items[z].height = (int)(((float)thisbox->items[z].origheight) * (((float)percent)/((float)100.0)));
+         }
+      }
+   }
 }
 
 void _handle_splitbar_resize(HWND hwnd, float percent, int type, int x, int y)
 {
-	float ratio = (float)percent/(float)100.0;
-	HWND handle1 = (HWND)dw_window_get_data(hwnd, "_dw_topleft");
-	HWND handle2 = (HWND)dw_window_get_data(hwnd, "_dw_bottomright");
-	Box *tmp = WinQueryWindowPtr(handle1, QWP_USER);
-
-	WinShowWindow(handle1, FALSE);
-	WinShowWindow(handle2, FALSE);
-
-	if(type == DW_HORZ)
-	{
-		int newx = (int)((float)x * ratio) - (SPLITBAR_WIDTH/2);
-
-		WinSetWindowPos(handle1, NULLHANDLE, 0, 0, newx, y, SWP_MOVE | SWP_SIZE);
-		_do_resize(tmp, newx - 1, y - 1);
-
-		dw_window_set_data(hwnd, "_dw_start", (void *)newx);
-
-		tmp = WinQueryWindowPtr(handle2, QWP_USER);
-
-		newx = x - newx - SPLITBAR_WIDTH;
-
-		WinSetWindowPos(handle2, NULLHANDLE, x - newx, 0, newx, y, SWP_MOVE | SWP_SIZE);
-		_do_resize(tmp, newx - 1, y - 1);
-	}
-	else
-	{
-		int newy = (int)((float)y * ratio) - (SPLITBAR_WIDTH/2);
-
-		WinSetWindowPos(handle1, NULLHANDLE, 0, y - newy, x, newy, SWP_MOVE | SWP_SIZE);
-		_do_resize(tmp, x - 1, newy - 1);
-
-		tmp = WinQueryWindowPtr(handle2, QWP_USER);
-
-		newy = y - newy - SPLITBAR_WIDTH;
-
-		WinSetWindowPos(handle2, NULLHANDLE, 0, 0, x, newy, SWP_MOVE | SWP_SIZE);
-		_do_resize(tmp, x - 1, newy - 1);
-
-		dw_window_set_data(hwnd, "_dw_start", (void *)newy);
-	}
-
-	WinShowWindow(handle1, TRUE);
-	WinShowWindow(handle2, TRUE);
+   float ratio = (float)percent/(float)100.0;
+   HWND handle1 = (HWND)dw_window_get_data(hwnd, "_dw_topleft");
+   HWND handle2 = (HWND)dw_window_get_data(hwnd, "_dw_bottomright");
+   Box *tmp = WinQueryWindowPtr(handle1, QWP_USER);
+
+   WinShowWindow(handle1, FALSE);
+   WinShowWindow(handle2, FALSE);
+
+   if(type == DW_HORZ)
+   {
+      int newx = (int)((float)x * ratio) - (SPLITBAR_WIDTH/2);
+
+      WinSetWindowPos(handle1, NULLHANDLE, 0, 0, newx, y, SWP_MOVE | SWP_SIZE);
+      _do_resize(tmp, newx - 1, y - 1);
+
+      dw_window_set_data(hwnd, "_dw_start", (void *)newx);
+
+      tmp = WinQueryWindowPtr(handle2, QWP_USER);
+
+      newx = x - newx - SPLITBAR_WIDTH;
+
+      WinSetWindowPos(handle2, NULLHANDLE, x - newx, 0, newx, y, SWP_MOVE | SWP_SIZE);
+      _do_resize(tmp, newx - 1, y - 1);
+   }
+   else
+   {
+      int newy = (int)((float)y * ratio) - (SPLITBAR_WIDTH/2);
+
+      WinSetWindowPos(handle1, NULLHANDLE, 0, y - newy, x, newy, SWP_MOVE | SWP_SIZE);
+      _do_resize(tmp, x - 1, newy - 1);
+
+      tmp = WinQueryWindowPtr(handle2, QWP_USER);
+
+      newy = y - newy - SPLITBAR_WIDTH;
+
+      WinSetWindowPos(handle2, NULLHANDLE, 0, 0, x, newy, SWP_MOVE | SWP_SIZE);
+      _do_resize(tmp, x - 1, newy - 1);
+
+      dw_window_set_data(hwnd, "_dw_start", (void *)newy);
+   }
+
+   WinShowWindow(handle1, TRUE);
+   WinShowWindow(handle2, TRUE);
 }
 
 
 /* This handles any activity on the splitbars (sizers) */
 MRESULT EXPENTRY _splitwndproc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
 {
-	switch (msg)
-	{
-	case WM_ACTIVATE:
-	case WM_SETFOCUS:
-		return (MRESULT)(FALSE);
-
-	case WM_PAINT:
-		{
-			HPS hps;
-			POINTL ptl[2];
-			RECTL rcl;
-			int type = (int)dw_window_get_data(hwnd, "_dw_type");
-			int start = (int)dw_window_get_data(hwnd, "_dw_start");
-
-			hps = WinBeginPaint(hwnd, 0, 0);
-
-			WinQueryWindowRect(hwnd, &rcl);
-
-			if(type == DW_HORZ)
-			{
-				ptl[0].x = rcl.xLeft + start;
-				ptl[0].y = rcl.yBottom;
-				ptl[1].x = rcl.xRight + start + 3;
-				ptl[1].y = rcl.yTop;
-			}
-			else
-			{
-				ptl[0].x = rcl.xLeft;
-				ptl[0].y = rcl.yBottom + start;
-				ptl[1].x = rcl.xRight;
-				ptl[1].y = rcl.yTop + start + 3;
-			}
-
-
-			GpiSetColor(hps, CLR_PALEGRAY);
-			GpiMove(hps, &ptl[0]);
-			GpiBox(hps, DRO_OUTLINEFILL, &ptl[1], 0, 0);
-			WinEndPaint(hps);
-		}
-		return MRFROMSHORT(FALSE);
-
-	case WM_MOUSEMOVE:
-		{
-			int type = (int)dw_window_get_data(hwnd, "_dw_type");
-
-			if(type == DW_HORZ)
-				WinSetPointer(HWND_DESKTOP,
-							  WinQuerySysPointer(HWND_DESKTOP,
-												 SPTR_SIZEWE,
-												 FALSE));
-			else
-				WinSetPointer(HWND_DESKTOP,
-							  WinQuerySysPointer(HWND_DESKTOP,
-												 SPTR_SIZENS,
-												 FALSE));
-		}
-		return MRFROMSHORT(FALSE);
-	case WM_BUTTON1DOWN:
-		{
-			APIRET rc;
-			RECTL  rclFrame;
-			RECTL  rclBounds;
-			float *percent = (float *)dw_window_get_data(hwnd, "_dw_percent");
-			int type = (int)dw_window_get_data(hwnd, "_dw_type");
-			int start = (int)dw_window_get_data(hwnd, "_dw_start");
-
-			WinQueryWindowRect(hwnd, &rclFrame);
-			WinQueryWindowRect(hwnd, &rclBounds);
-
-			WinMapWindowPoints(hwnd, HWND_DESKTOP,
-							   (PPOINTL)&rclBounds, 2);
-
-
-			if(type == DW_HORZ)
-			{
-				rclFrame.xLeft = start;
-				rclFrame.xRight = start + SPLITBAR_WIDTH;
-			}
-			else
-			{
-				rclFrame.yBottom = start;
-				rclFrame.yTop = start + SPLITBAR_WIDTH;
-			}
-
-			if(percent)
-			{
-				rc = _TrackRectangle(hwnd, &rclFrame, &rclBounds);
-
-				if(rc == TRUE)
-				{
-					int width = (rclBounds.xRight - rclBounds.xLeft);
-					int height = (rclBounds.yTop - rclBounds.yBottom);
-
-					if(type == DW_HORZ)
-					{
-						start = rclFrame.xLeft - rclBounds.xLeft;
-						if(width - SPLITBAR_WIDTH > 1 && start < width - SPLITBAR_WIDTH)
-							*percent = ((float)start / (float)(width - SPLITBAR_WIDTH)) * 100.0;
-					}
-					else
-					{
-						start = rclFrame.yBottom - rclBounds.yBottom;
-						if(height - SPLITBAR_WIDTH > 1 && start < height - SPLITBAR_WIDTH)
-							*percent = 100.0 - (((float)start / (float)(height - SPLITBAR_WIDTH)) * 100.0);
-					}
-					_handle_splitbar_resize(hwnd, *percent, type, width, height);
-					_handle_splitbar_resize(hwnd, *percent, type, width, height);
-				}
-			}
-		}
-		return MRFROMSHORT(FALSE);
-	}
-	return WinDefWindowProc(hwnd, msg, mp1, mp2);
+   switch (msg)
+   {
+   case WM_ACTIVATE:
+   case WM_SETFOCUS:
+      return (MRESULT)(FALSE);
+
+   case WM_PAINT:
+      {
+         HPS hps;
+         POINTL ptl[2];
+         RECTL rcl;
+         int type = (int)dw_window_get_data(hwnd, "_dw_type");
+         int start = (int)dw_window_get_data(hwnd, "_dw_start");
+
+         hps = WinBeginPaint(hwnd, 0, 0);
+
+         WinQueryWindowRect(hwnd, &rcl);
+
+         if(type == DW_HORZ)
+         {
+            ptl[0].x = rcl.xLeft + start;
+            ptl[0].y = rcl.yBottom;
+            ptl[1].x = rcl.xRight + start + 3;
+            ptl[1].y = rcl.yTop;
+         }
+         else
+         {
+            ptl[0].x = rcl.xLeft;
+            ptl[0].y = rcl.yBottom + start;
+            ptl[1].x = rcl.xRight;
+            ptl[1].y = rcl.yTop + start + 3;
+         }
+
+
+         GpiSetColor(hps, CLR_PALEGRAY);
+         GpiMove(hps, &ptl[0]);
+         GpiBox(hps, DRO_OUTLINEFILL, &ptl[1], 0, 0);
+         WinEndPaint(hps);
+      }
+      return MRFROMSHORT(FALSE);
+
+   case WM_MOUSEMOVE:
+      {
+         int type = (int)dw_window_get_data(hwnd, "_dw_type");
+
+         if(type == DW_HORZ)
+            WinSetPointer(HWND_DESKTOP,
+                       WinQuerySysPointer(HWND_DESKTOP,
+                                     SPTR_SIZEWE,
+                                     FALSE));
+         else
+            WinSetPointer(HWND_DESKTOP,
+                       WinQuerySysPointer(HWND_DESKTOP,
+                                     SPTR_SIZENS,
+                                     FALSE));
+      }
+      return MRFROMSHORT(FALSE);
+   case WM_BUTTON1DOWN:
+      {
+         APIRET rc;
+         RECTL  rclFrame;
+         RECTL  rclBounds;
+         float *percent = (float *)dw_window_get_data(hwnd, "_dw_percent");
+         int type = (int)dw_window_get_data(hwnd, "_dw_type");
+         int start = (int)dw_window_get_data(hwnd, "_dw_start");
+
+         WinQueryWindowRect(hwnd, &rclFrame);
+         WinQueryWindowRect(hwnd, &rclBounds);
+
+         WinMapWindowPoints(hwnd, HWND_DESKTOP,
+                        (PPOINTL)&rclBounds, 2);
+
+
+         if(type == DW_HORZ)
+         {
+            rclFrame.xLeft = start;
+            rclFrame.xRight = start + SPLITBAR_WIDTH;
+         }
+         else
+         {
+            rclFrame.yBottom = start;
+            rclFrame.yTop = start + SPLITBAR_WIDTH;
+         }
+
+         if(percent)
+         {
+            rc = _TrackRectangle(hwnd, &rclFrame, &rclBounds);
+
+            if(rc == TRUE)
+            {
+               int width = (rclBounds.xRight - rclBounds.xLeft);
+               int height = (rclBounds.yTop - rclBounds.yBottom);
+
+               if(type == DW_HORZ)
+               {
+                  start = rclFrame.xLeft - rclBounds.xLeft;
+                  if(width - SPLITBAR_WIDTH > 1 && start < width - SPLITBAR_WIDTH)
+                     *percent = ((float)start / (float)(width - SPLITBAR_WIDTH)) * 100.0;
+               }
+               else
+               {
+                  start = rclFrame.yBottom - rclBounds.yBottom;
+                  if(height - SPLITBAR_WIDTH > 1 && start < height - SPLITBAR_WIDTH)
+                     *percent = 100.0 - (((float)start / (float)(height - SPLITBAR_WIDTH)) * 100.0);
+               }
+               _handle_splitbar_resize(hwnd, *percent, type, width, height);
+               _handle_splitbar_resize(hwnd, *percent, type, width, height);
+            }
+         }
+      }
+      return MRFROMSHORT(FALSE);
+   }
+   return WinDefWindowProc(hwnd, msg, mp1, mp2);
 }
 
 /* Function: BubbleProc
@@ -3035,124 +3035,124 @@
  */
 MRESULT EXPENTRY _BubbleProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
 {
-	MRESULT res;
-	PFNWP proc = (PFNWP)WinQueryWindowPtr(hwnd, QWL_USER);
-
-	if(proc)
-		res = proc(hwnd, msg, mp1, mp2);
-	else
-		res = WinDefWindowProc(hwnd, msg, mp1, mp2);
-
-	if(msg == WM_PAINT)
-	{
-		POINTL ptl;
-		HPS hpsTemp;
-		RECTL rcl;
-		int height, width;
-
-		WinQueryWindowRect(hwnd, &rcl);
-		height = rcl.yTop - rcl.yBottom - 1;
-		width = rcl.xRight - rcl.xLeft - 1;
-
-		/* Draw a border around the bubble help */
-		hpsTemp = WinGetPS(hwnd);
-		GpiSetColor(hpsTemp, CLR_BLACK);
-		ptl.x = ptl.y = 0;
-		GpiMove(hpsTemp, &ptl);
-		ptl.x = 0;
-		ptl.y = height;
-		GpiLine(hpsTemp, &ptl);
-		ptl.x = ptl.y = 0;
-		GpiMove(hpsTemp, &ptl);
-		ptl.y = 0;
-		ptl.x = width;
-		GpiLine(hpsTemp, &ptl);
-		ptl.x = width;
-		ptl.y = height;
-		GpiMove(hpsTemp, &ptl);
-		ptl.x = 0;
-		ptl.y = height;
-		GpiLine(hpsTemp, &ptl);
-		ptl.x = width;
-		ptl.y = height;
-		GpiMove(hpsTemp, &ptl);
-		ptl.y = 0;
-		ptl.x = width;
-		GpiLine(hpsTemp, &ptl);
-		WinReleasePS(hpsTemp);
-	}
-	return res;
+   MRESULT res;
+   PFNWP proc = (PFNWP)WinQueryWindowPtr(hwnd, QWL_USER);
+
+   if(proc)
+      res = proc(hwnd, msg, mp1, mp2);
+   else
+      res = WinDefWindowProc(hwnd, msg, mp1, mp2);
+
+   if(msg == WM_PAINT)
+   {
+      POINTL ptl;
+      HPS hpsTemp;
+      RECTL rcl;
+      int height, width;
+
+      WinQueryWindowRect(hwnd, &rcl);
+      height = rcl.yTop - rcl.yBottom - 1;
+      width = rcl.xRight - rcl.xLeft - 1;
+
+      /* Draw a border around the bubble help */
+      hpsTemp = WinGetPS(hwnd);
+      GpiSetColor(hpsTemp, CLR_BLACK);
+      ptl.x = ptl.y = 0;
+      GpiMove(hpsTemp, &ptl);
+      ptl.x = 0;
+      ptl.y = height;
+      GpiLine(hpsTemp, &ptl);
+      ptl.x = ptl.y = 0;
+      GpiMove(hpsTemp, &ptl);
+      ptl.y = 0;
+      ptl.x = width;
+      GpiLine(hpsTemp, &ptl);
+      ptl.x = width;
+      ptl.y = height;
+      GpiMove(hpsTemp, &ptl);
+      ptl.x = 0;
+      ptl.y = height;
+      GpiLine(hpsTemp, &ptl);
+      ptl.x = width;
+      ptl.y = height;
+      GpiMove(hpsTemp, &ptl);
+      ptl.y = 0;
+      ptl.x = width;
+      GpiLine(hpsTemp, &ptl);
+      WinReleasePS(hpsTemp);
+   }
+   return res;
 }
 
 MRESULT EXPENTRY _button_draw(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2, PFNWP oldproc, int indent)
 {
-	HPIXMAP pixmap = (HPIXMAP)dw_window_get_data(hwnd, "_dw_hpixmap");
-	HPIXMAP disable = (HPIXMAP)dw_window_get_data(hwnd, "_dw_hpixmap_disabled");
-	HPOINTER icon = (HPOINTER)dw_window_get_data(hwnd, "_dw_button_icon");
-	MRESULT res;
-	unsigned long width, height;
-	int x = 5, y = 5;
-
-	dw_window_get_pos_size(hwnd, NULL, NULL, &width, &height);
-
-	if(!oldproc)
-		res = WinDefWindowProc(hwnd, msg, mp1, mp2);
-	res = oldproc(hwnd, msg, mp1, mp2);
-
-	if(icon)
-	{
-		ULONG halftone = DP_NORMAL;
-		HPS hps = WinGetPS(hwnd);
-		POINTERINFO pi;
-		int cx, cy;
-
-		if(dw_window_get_data(hwnd, "_dw_disabled"))
-			halftone = DP_HALFTONED;
-
-		cx = width - 10;
-		cy = height - 10;
-
-		if(WinQueryPointerInfo(icon, &pi))
-		{
-			BITMAPINFOHEADER sl;
-			int newcx = cx, newcy = cy;
-
-			/* Check the mini icon first */
-			if(GpiQueryBitmapParameters(pi.hbmMiniColor, &sl))
-			{
-				if(sl.cx && sl.cy && cx > sl.cx && cy > sl.cy)
-				{
-					newcx = sl.cx;
-					newcy = sl.cy;
-				}
-			}
-			/* Check the normal icon second */
-			if(GpiQueryBitmapParameters(pi.hbmColor, &sl))
-			{
-				if(sl.cx && sl.cy && cx > sl.cx && cy > sl.cy)
-				{
-					newcx = sl.cx;
-					newcy = sl.cy;
-				}
-			}
-			cx = newcx; cy = newcy;
-			x = (width - cx)/2;
-			y = (height - cy)/2;
-		}
-		WinStretchPointer(hps, x + indent, y - indent, cx, cy, icon, halftone);
-		WinReleasePS(hps);
-	}
-	else if(pixmap)
-	{
-		x = (width - pixmap->width)/2;
-		y = (height - pixmap->height)/2;
-
-		if(disable && dw_window_get_data(hwnd, "_dw_disabled"))
-			dw_pixmap_bitblt(hwnd, 0, x + indent, y + indent, pixmap->width, pixmap->height, 0, disable, 0, 0);
-		else
-			dw_pixmap_bitblt(hwnd, 0, x + indent, y + indent, pixmap->width, pixmap->height, 0, pixmap, 0, 0);
-	}
-	return res;
+   HPIXMAP pixmap = (HPIXMAP)dw_window_get_data(hwnd, "_dw_hpixmap");
+   HPIXMAP disable = (HPIXMAP)dw_window_get_data(hwnd, "_dw_hpixmap_disabled");
+   HPOINTER icon = (HPOINTER)dw_window_get_data(hwnd, "_dw_button_icon");
+   MRESULT res;
+   unsigned long width, height;
+   int x = 5, y = 5;
+
+   dw_window_get_pos_size(hwnd, NULL, NULL, &width, &height);
+
+   if(!oldproc)
+      res = WinDefWindowProc(hwnd, msg, mp1, mp2);
+   res = oldproc(hwnd, msg, mp1, mp2);
+
+   if(icon)
+   {
+      ULONG halftone = DP_NORMAL;
+      HPS hps = WinGetPS(hwnd);
+      POINTERINFO pi;
+      int cx, cy;
+
+      if(dw_window_get_data(hwnd, "_dw_disabled"))
+         halftone = DP_HALFTONED;
+
+      cx = width - 10;
+      cy = height - 10;
+
+      if(WinQueryPointerInfo(icon, &pi))
+      {
+         BITMAPINFOHEADER sl;
+         int newcx = cx, newcy = cy;
+
+         /* Check the mini icon first */
+         if(GpiQueryBitmapParameters(pi.hbmMiniColor, &sl))
+         {
+            if(sl.cx && sl.cy && cx > sl.cx && cy > sl.cy)
+            {
+               newcx = sl.cx;
+               newcy = sl.cy;
+            }
+         }
+         /* Check the normal icon second */
+         if(GpiQueryBitmapParameters(pi.hbmColor, &sl))
+         {
+            if(sl.cx && sl.cy && cx > sl.cx && cy > sl.cy)
+            {
+               newcx = sl.cx;
+               newcy = sl.cy;
+            }
+         }
+         cx = newcx; cy = newcy;
+         x = (width - cx)/2;
+         y = (height - cy)/2;
+      }
+      WinStretchPointer(hps, x + indent, y - indent, cx, cy, icon, halftone);
+      WinReleasePS(hps);
+   }
+   else if(pixmap)
+   {
+      x = (width - pixmap->width)/2;
+      y = (height - pixmap->height)/2;
+
+      if(disable && dw_window_get_data(hwnd, "_dw_disabled"))
+         dw_pixmap_bitblt(hwnd, 0, x + indent, y + indent, pixmap->width, pixmap->height, 0, disable, 0, 0);
+      else
+         dw_pixmap_bitblt(hwnd, 0, x + indent, y + indent, pixmap->width, pixmap->height, 0, pixmap, 0, 0);
+   }
+   return res;
 }
 
 /* Function: BtProc
@@ -3161,304 +3161,304 @@
 
 MRESULT EXPENTRY _BtProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
 {
-	BubbleButton *bubble;
-	PFNWP oldproc;
-
-	bubble = (BubbleButton *)WinQueryWindowPtr(hwnd, QWL_USER);
-
-	if(!bubble)
-		return WinDefWindowProc(hwnd, msg, mp1, mp2);
-
-	oldproc = bubble->pOldProc;
-
-	switch(msg)
-	{
-	case WM_MOUSEMOVE:
-		if(_wndproc(hwnd, msg, mp1, mp2))
-			return MPFROMSHORT(FALSE);
-		break;
-	case WM_PAINT:
-		return _button_draw(hwnd, msg, mp1, mp2, oldproc, 0);
-	case BM_SETHILITE:
-		return _button_draw(hwnd, msg, mp1, mp2, oldproc, (int)mp1);
-	case WM_SETFOCUS:
-		if(mp2)
-			_run_event(hwnd, msg, mp1, mp2);
-		else
-			WinSendMsg(hwnd, BM_SETDEFAULT, 0, 0);
-		break;
-	case WM_BUTTON1DOWN:
-	case WM_BUTTON2DOWN:
-	case WM_BUTTON3DOWN:
-	case WM_BUTTON1DBLCLK:
-	case WM_BUTTON2DBLCLK:
-	case WM_BUTTON3DBLCLK:
-		if(dw_window_get_data(hwnd, "_dw_disabled"))
-			return (MRESULT)FALSE;
-		break;
-	case WM_BUTTON1UP:
-		{
-			SignalHandler *tmp = Root;
-
-			if(WinIsWindowEnabled(hwnd) && !dw_window_get_data(hwnd, "_dw_disabled"))
-			{
-				/* Find any callbacks for this function */
-				while(tmp)
-				{
-					if(tmp->message == WM_COMMAND)
-					{
-						/* Make sure it's the right window, and the right ID */
-						if(tmp->window == hwnd)
-						{
-							/* Due to the fact that if we run the function
-							 * here, finishing actions on the button will occur
-							 * after we run the signal handler.  So we post the
-							 * message so the button can finish what it needs to
-							 * do before we run our handler.
-							 */
-							WinPostMsg(hwnd, WM_USER, (MPARAM)tmp, 0);
-							tmp = NULL;
-						}
-					}
-					if(tmp)
-						tmp= tmp->next;
-				}
-			}
-		}
-		break;
-	case WM_USER:
-		{
+   BubbleButton *bubble;
+   PFNWP oldproc;
+
+   bubble = (BubbleButton *)WinQueryWindowPtr(hwnd, QWL_USER);
+
+   if(!bubble)
+      return WinDefWindowProc(hwnd, msg, mp1, mp2);
+
+   oldproc = bubble->pOldProc;
+
+   switch(msg)
+   {
+   case WM_MOUSEMOVE:
+      if(_wndproc(hwnd, msg, mp1, mp2))
+         return MPFROMSHORT(FALSE);
+      break;
+   case WM_PAINT:
+      return _button_draw(hwnd, msg, mp1, mp2, oldproc, 0);
+   case BM_SETHILITE:
+      return _button_draw(hwnd, msg, mp1, mp2, oldproc, (int)mp1);
+   case WM_SETFOCUS:
+      if(mp2)
+         _run_event(hwnd, msg, mp1, mp2);
+      else
+         WinSendMsg(hwnd, BM_SETDEFAULT, 0, 0);
+      break;
+   case WM_BUTTON1DOWN:
+   case WM_BUTTON2DOWN:
+   case WM_BUTTON3DOWN:
+   case WM_BUTTON1DBLCLK:
+   case WM_BUTTON2DBLCLK:
+   case WM_BUTTON3DBLCLK:
+      if(dw_window_get_data(hwnd, "_dw_disabled"))
+         return (MRESULT)FALSE;
+      break;
+   case WM_BUTTON1UP:
+      {
+         SignalHandler *tmp = Root;
+
+         if(WinIsWindowEnabled(hwnd) && !dw_window_get_data(hwnd, "_dw_disabled"))
+         {
+            /* Find any callbacks for this function */
+            while(tmp)
+            {
+               if(tmp->message == WM_COMMAND)
+               {
+                  /* Make sure it's the right window, and the right ID */
+                  if(tmp->window == hwnd)
+                  {
+                     /* Due to the fact that if we run the function
+                      * here, finishing actions on the button will occur
+                      * after we run the signal handler.  So we post the
+                      * message so the button can finish what it needs to
+                      * do before we run our handler.
+                      */
+                     WinPostMsg(hwnd, WM_USER, (MPARAM)tmp, 0);
+                     tmp = NULL;
+                  }
+               }
+               if(tmp)
+                  tmp= tmp->next;
+            }
+         }
+      }
+      break;
+   case WM_USER:
+      {
             SignalHandler *tmp = (SignalHandler *)mp1;
-			int (* API clickfunc)(HWND, void *) = NULL;
-
-			if(tmp)
-			{
-				clickfunc = (int (* API)(HWND, void *))tmp->signalfunction;
-
-				clickfunc(tmp->window, tmp->data);
-			}
-		}
+         int (* API clickfunc)(HWND, void *) = NULL;
+
+         if(tmp)
+         {
+            clickfunc = (int (* API)(HWND, void *))tmp->signalfunction;
+
+            clickfunc(tmp->window, tmp->data);
+         }
+      }
         break;
-	case WM_CHAR:
-		{
-			/* A button press should also occur for an ENTER or SPACE press
-			 * while the button has the active input focus.
-			 */
-			if(SHORT1FROMMP(mp2) == '\r' || SHORT1FROMMP(mp2) == ' ')
-			{
-				SignalHandler *tmp = Root;
-
-				/* Find any callbacks for this function */
-				while(tmp)
-				{
-					if(tmp->message == WM_COMMAND)
-					{
-						/* Make sure it's the right window, and the right ID */
-						if(tmp->window == hwnd)
-						{
-							WinPostMsg(hwnd, WM_USER, (MPARAM)tmp, 0);
-							tmp = NULL;
-						}
-					}
-					if(tmp)
-						tmp= tmp->next;
-				}
-			}
-			if(SHORT1FROMMP(mp2) == '\t')
-			{
-				if(CHARMSG(&msg)->fs & KC_SHIFT)
-					_shift_focus_back(hwnd);
-				else
-					_shift_focus(hwnd);
-				WinSendMsg(hwnd, BM_SETDEFAULT, 0, 0);
-				return FALSE;
-			}
-			else if(!(CHARMSG(&msg)->fs & KC_KEYUP) && (CHARMSG(&msg)->vkey == VK_LEFT || CHARMSG(&msg)->vkey == VK_UP))
-			{
-				_shift_focus_back(hwnd);
-				return FALSE;
-			}
-			else if(!(CHARMSG(&msg)->fs & KC_KEYUP) && (CHARMSG(&msg)->vkey == VK_RIGHT || CHARMSG(&msg)->vkey == VK_DOWN))
-			{
-				_shift_focus(hwnd);
-				return FALSE;
-			}
-		}
-		break;
-	case 0x041f:
-		if (hwndBubble)
-		{
-			WinDestroyWindow(hwndBubble);
-			hwndBubble = 0;
-		}
-		break;
-
-	case 0x041e:
-
-		if(!*bubble->bubbletext)
-			break;
-
-		if(hwndBubble)
-		{
-			WinDestroyWindow(hwndBubble);
-			hwndBubble = 0;
-		}
-
-		if(!hwndBubble)
-		{
-			HPS   hpsTemp = 0;
-			LONG  lHight;
-			LONG  lWidth;
-			POINTL txtPointl[TXTBOX_COUNT];
-			POINTL ptlWork = {0,0};
-			ULONG ulColor = CLR_YELLOW;
-			void *blah;
-
-			hwndBubbleLast   = hwnd;
-			hwndBubble = WinCreateWindow(HWND_DESKTOP,
-										 WC_STATIC,
-										 "",
-										 SS_TEXT |
-										 DT_CENTER |
-										 DT_VCENTER,
+   case WM_CHAR:
+      {
+         /* A button press should also occur for an ENTER or SPACE press
+          * while the button has the active input focus.
+          */
+         if(SHORT1FROMMP(mp2) == '\r' || SHORT1FROMMP(mp2) == ' ')
+         {
+            SignalHandler *tmp = Root;
+
+            /* Find any callbacks for this function */
+            while(tmp)
+            {
+               if(tmp->message == WM_COMMAND)
+               {
+                  /* Make sure it's the right window, and the right ID */
+                  if(tmp->window == hwnd)
+                  {
+                     WinPostMsg(hwnd, WM_USER, (MPARAM)tmp, 0);
+                     tmp = NULL;
+                  }
+               }
+               if(tmp)
+                  tmp= tmp->next;
+            }
+         }
+         if(SHORT1FROMMP(mp2) == '\t')
+         {
+            if(CHARMSG(&msg)->fs & KC_SHIFT)
+               _shift_focus_back(hwnd);
+            else
+               _shift_focus(hwnd);
+            WinSendMsg(hwnd, BM_SETDEFAULT, 0, 0);
+            return FALSE;
+         }
+         else if(!(CHARMSG(&msg)->fs & KC_KEYUP) && (CHARMSG(&msg)->vkey == VK_LEFT || CHARMSG(&msg)->vkey == VK_UP))
+         {
+            _shift_focus_back(hwnd);
+            return FALSE;
+         }
+         else if(!(CHARMSG(&msg)->fs & KC_KEYUP) && (CHARMSG(&msg)->vkey == VK_RIGHT || CHARMSG(&msg)->vkey == VK_DOWN))
+         {
+            _shift_focus(hwnd);
+            return FALSE;
+         }
+      }
+      break;
+   case 0x041f:
+      if (hwndBubble)
+      {
+         WinDestroyWindow(hwndBubble);
+         hwndBubble = 0;
+      }
+      break;
+
+   case 0x041e:
+
+      if(!*bubble->bubbletext)
+         break;
+
+      if(hwndBubble)
+      {
+         WinDestroyWindow(hwndBubble);
+         hwndBubble = 0;
+      }
+
+      if(!hwndBubble)
+      {
+         HPS   hpsTemp = 0;
+         LONG  lHight;
+         LONG  lWidth;
+         POINTL txtPointl[TXTBOX_COUNT];
+         POINTL ptlWork = {0,0};
+         ULONG ulColor = CLR_YELLOW;
+         void *blah;
+
+         hwndBubbleLast   = hwnd;
+         hwndBubble = WinCreateWindow(HWND_DESKTOP,
+                               WC_STATIC,
+                               "",
+                               SS_TEXT |
+                               DT_CENTER |
+                               DT_VCENTER,
                                          0,0,0,0,
-										 HWND_DESKTOP,
-										 HWND_TOP,
-										 0,
-										 NULL,
-										 NULL);
-
-			WinSetPresParam(hwndBubble,
-							PP_FONTNAMESIZE,
-							strlen(DefaultFont)+1,
-							DefaultFont);
-
-
-			WinSetPresParam(hwndBubble,
-							PP_BACKGROUNDCOLORINDEX,
-							sizeof(ulColor),
-							&ulColor);
-
-			WinSetWindowText(hwndBubble,
-							 bubble->bubbletext);
-
-			WinMapWindowPoints(hwnd, HWND_DESKTOP, &ptlWork, 1);
-
-			hpsTemp = WinGetPS(hwndBubble);
-			GpiQueryTextBox(hpsTemp,
-							strlen(bubble->bubbletext),
-							bubble->bubbletext,
-							TXTBOX_COUNT,
-							txtPointl);
-			WinReleasePS(hpsTemp);
-
-			lWidth = txtPointl[TXTBOX_TOPRIGHT].x -
-				txtPointl[TXTBOX_TOPLEFT ].x + 8;
-
-			lHight = txtPointl[TXTBOX_TOPLEFT].y -
-				txtPointl[TXTBOX_BOTTOMLEFT].y + 8;
-
-			ptlWork.y -= lHight;
-
-			blah = (void *)WinSubclassWindow(hwndBubble, _BubbleProc);
-
-			if(blah)
-				WinSetWindowPtr(hwndBubble, QWP_USER, blah);
-
-			WinSetWindowPos(hwndBubble,
-							HWND_TOP,
-							ptlWork.x,
-							ptlWork.y,
-							lWidth,
-							lHight,
-							SWP_SIZE | SWP_MOVE | SWP_SHOW);
-		}
-		break;
-	}
-
-	if(!oldproc)
-		return WinDefWindowProc(hwnd, msg, mp1, mp2);
-	return oldproc(hwnd, msg, mp1, mp2);
+                               HWND_DESKTOP,
+                               HWND_TOP,
+                               0,
+                               NULL,
+                               NULL);
+
+         WinSetPresParam(hwndBubble,
+                     PP_FONTNAMESIZE,
+                     strlen(DefaultFont)+1,
+                     DefaultFont);
+
+
+         WinSetPresParam(hwndBubble,
+                     PP_BACKGROUNDCOLORINDEX,
+                     sizeof(ulColor),
+                     &ulColor);
+
+         WinSetWindowText(hwndBubble,
+                      bubble->bubbletext);
+
+         WinMapWindowPoints(hwnd, HWND_DESKTOP, &ptlWork, 1);
+
+         hpsTemp = WinGetPS(hwndBubble);
+         GpiQueryTextBox(hpsTemp,
+                     strlen(bubble->bubbletext),
+                     bubble->bubbletext,
+                     TXTBOX_COUNT,
+                     txtPointl);
+         WinReleasePS(hpsTemp);
+
+         lWidth = txtPointl[TXTBOX_TOPRIGHT].x -
+            txtPointl[TXTBOX_TOPLEFT ].x + 8;
+
+         lHight = txtPointl[TXTBOX_TOPLEFT].y -
+            txtPointl[TXTBOX_BOTTOMLEFT].y + 8;
+
+         ptlWork.y -= lHight;
+
+         blah = (void *)WinSubclassWindow(hwndBubble, _BubbleProc);
+
+         if(blah)
+            WinSetWindowPtr(hwndBubble, QWP_USER, blah);
+
+         WinSetWindowPos(hwndBubble,
+                     HWND_TOP,
+                     ptlWork.x,
+                     ptlWork.y,
+                     lWidth,
+                     lHight,
+                     SWP_SIZE | SWP_MOVE | SWP_SHOW);
+      }
+      break;
+   }
+
+   if(!oldproc)
+      return WinDefWindowProc(hwnd, msg, mp1, mp2);
+   return oldproc(hwnd, msg, mp1, mp2);
 }
 
 MRESULT EXPENTRY _RendProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
 {
-	int res = 0;
-	res = (int)_run_event(hwnd, msg, mp1, mp2);
-	switch(msg)
-	{
-	case WM_MOUSEMOVE:
-		if(_wndproc(hwnd, msg, mp1, mp2))
-			return MPFROMSHORT(FALSE);
-		break;
-	case WM_BUTTON1DOWN:
-	case WM_BUTTON2DOWN:
-	case WM_BUTTON3DOWN:
-		if(res == -1)
-			WinSetFocus(HWND_DESKTOP, hwnd);
-		else if(res)
-			return (MPARAM)TRUE;
-	}
-	return WinDefWindowProc(hwnd, msg, mp1, mp2);
+   int res = 0;
+   res = (int)_run_event(hwnd, msg, mp1, mp2);
+   switch(msg)
+   {
+   case WM_MOUSEMOVE:
+      if(_wndproc(hwnd, msg, mp1, mp2))
+         return MPFROMSHORT(FALSE);
+      break;
+   case WM_BUTTON1DOWN:
+   case WM_BUTTON2DOWN:
+   case WM_BUTTON3DOWN:
+      if(res == -1)
+         WinSetFocus(HWND_DESKTOP, hwnd);
+      else if(res)
+         return (MPARAM)TRUE;
+   }
+   return WinDefWindowProc(hwnd, msg, mp1, mp2);
 }
 
 MRESULT EXPENTRY _TreeProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
 {
-	WindowData *blah = (WindowData *)WinQueryWindowPtr(hwnd, QWP_USER);
-	PFNWP oldproc = 0;
-
-	if(blah)
-		oldproc = blah->oldproc;
-
-	switch(msg)
-	{
-	case WM_MOUSEMOVE:
-		if(_wndproc(hwnd, msg, mp1, mp2))
-			return MPFROMSHORT(FALSE);
-		break;
-	case WM_PAINT:
-		{
-			HPS hps;
-			RECTL rcl;
-			POINTL ptl[2];
-
-			if(oldproc)
-				oldproc(hwnd, msg, mp1, mp2);
-
-			hps = WinBeginPaint(hwnd, 0, 0);
-			WinQueryWindowRect(hwnd, &rcl);
-			ptl[0].x = rcl.xLeft + 1;
-			ptl[0].y = rcl.yBottom + 1;
-			ptl[1].x = rcl.xRight - 1;
-			ptl[1].y = rcl.yTop - 1;
-
-			GpiSetColor(hps, CLR_BLACK);
-			GpiMove(hps, &ptl[0]);
-			GpiBox(hps, DRO_OUTLINE, &ptl[1], 0, 0);
-			WinEndPaint(hps);
-		}
-		return MRFROMSHORT(FALSE);
-	case WM_SETFOCUS:
-		_run_event(hwnd, msg, mp1, mp2);
-		break;
-	case WM_CHAR:
-		if(SHORT1FROMMP(mp2) == '\t')
-		{
-			if(CHARMSG(&msg)->fs & KC_SHIFT)
-				_shift_focus_back(hwnd);
-			else
-				_shift_focus(hwnd);
-			return FALSE;
-		}
-		break;
-	}
-
-	_run_event(hwnd, msg, mp1, mp2);
-
-	if(oldproc)
-		return oldproc(hwnd, msg, mp1, mp2);
-
-	return WinDefWindowProc(hwnd, msg, mp1, mp2);
+   WindowData *blah = (WindowData *)WinQueryWindowPtr(hwnd, QWP_USER);
+   PFNWP oldproc = 0;
+
+   if(blah)
+      oldproc = blah->oldproc;
+
+   switch(msg)
+   {
+   case WM_MOUSEMOVE:
+      if(_wndproc(hwnd, msg, mp1, mp2))
+         return MPFROMSHORT(FALSE);
+      break;
+   case WM_PAINT:
+      {
+         HPS hps;
+         RECTL rcl;
+         POINTL ptl[2];
+
+         if(oldproc)
+            oldproc(hwnd, msg, mp1, mp2);
+
+         hps = WinBeginPaint(hwnd, 0, 0);
+         WinQueryWindowRect(hwnd, &rcl);
+         ptl[0].x = rcl.xLeft + 1;
+         ptl[0].y = rcl.yBottom + 1;
+         ptl[1].x = rcl.xRight - 1;
+         ptl[1].y = rcl.yTop - 1;
+
+         GpiSetColor(hps, CLR_BLACK);
+         GpiMove(hps, &ptl[0]);
+         GpiBox(hps, DRO_OUTLINE, &ptl[1], 0, 0);
+         WinEndPaint(hps);
+      }
+      return MRFROMSHORT(FALSE);
+   case WM_SETFOCUS:
+      _run_event(hwnd, msg, mp1, mp2);
+      break;
+   case WM_CHAR:
+      if(SHORT1FROMMP(mp2) == '\t')
+      {
+         if(CHARMSG(&msg)->fs & KC_SHIFT)
+            _shift_focus_back(hwnd);
+         else
+            _shift_focus(hwnd);
+         return FALSE;
+      }
+      break;
+   }
+
+   _run_event(hwnd, msg, mp1, mp2);
+
+   if(oldproc)
+      return oldproc(hwnd, msg, mp1, mp2);
+
+   return WinDefWindowProc(hwnd, msg, mp1, mp2);
 }
 
 /*
@@ -3469,35 +3469,35 @@
  */
 int API dw_init(int newthread, int argc, char *argv[])
 {
-	APIRET rc;
-	char objnamebuf[300] = "";
-
-	argc = argc; /* keep compiler happy */
-	argv = argv; /* keep compiler happy */
-	if(newthread)
-	{
-		dwhab = WinInitialize(0);
-		dwhmq = WinCreateMsgQueue(dwhab, 0);
-	}
-
-	rc = WinRegisterClass(dwhab, ClassName, _wndproc, CS_SIZEREDRAW | CS_CLIPCHILDREN, 32);
-	rc = WinRegisterClass(dwhab, SplitbarClassName, _splitwndproc, 0L, 32);
-
-	/* Get the OS/2 version. */
-	DosQuerySysInfo(QSV_VERSION_MAJOR, QSV_MS_COUNT,(void *)aulBuffer, 4*sizeof(ULONG));
-
-	desktop = WinQueryDesktopWindow(dwhab, NULLHANDLE);
-
-	if(!IS_WARP4())
-		DefaultFont = "8.Helv";
-
-	/* This is a window that hangs around as long as the
-	 * application does and handles menu messages.
-	 */
-	hwndApp = dw_window_new(HWND_OBJECT, "", 0);
-	DosLoadModule(objnamebuf, sizeof(objnamebuf), "WPCONFIG", &wpconfig);
-
-	return rc;
+   APIRET rc;
+   char objnamebuf[300] = "";
+
+   argc = argc; /* keep compiler happy */
+   argv = argv; /* keep compiler happy */
+   if(newthread)
+   {
+      dwhab = WinInitialize(0);
+      dwhmq = WinCreateMsgQueue(dwhab, 0);
+   }
+
+   rc = WinRegisterClass(dwhab, ClassName, _wndproc, CS_SIZEREDRAW | CS_CLIPCHILDREN, 32);
+   rc = WinRegisterClass(dwhab, SplitbarClassName, _splitwndproc, 0L, 32);
+
+   /* Get the OS/2 version. */
+   DosQuerySysInfo(QSV_VERSION_MAJOR, QSV_MS_COUNT,(void *)aulBuffer, 4*sizeof(ULONG));
+
+   desktop = WinQueryDesktopWindow(dwhab, NULLHANDLE);
+
+   if(!IS_WARP4())
+      DefaultFont = "8.Helv";
+
+   /* This is a window that hangs around as long as the
+    * application does and handles menu messages.
+    */
+   hwndApp = dw_window_new(HWND_OBJECT, "", 0);
+   DosLoadModule(objnamebuf, sizeof(objnamebuf), "WPCONFIG", &wpconfig);
+
+   return rc;
 }
 
 /*
@@ -3505,19 +3505,19 @@
  */
 void API dw_main(void)
 {
-	QMSG qmsg;
-
-	_dwtid = dw_thread_id();
-
-	while(WinGetMsg(dwhab, &qmsg, 0, 0, 0))
-	{
-		if(qmsg.msg == WM_TIMER && qmsg.hwnd == NULLHANDLE)
-			_run_event(qmsg.hwnd, qmsg.msg, qmsg.mp1, qmsg.mp2);
-		WinDispatchMsg(dwhab, &qmsg);
-	}
-
-	WinDestroyMsgQueue(dwhmq);
-	WinTerminate(dwhab);
+   QMSG qmsg;
+
+   _dwtid = dw_thread_id();
+
+   while(WinGetMsg(dwhab, &qmsg, 0, 0, 0))
+   {
+      if(qmsg.msg == WM_TIMER && qmsg.hwnd == NULLHANDLE)
+         _run_event(qmsg.hwnd, qmsg.msg, qmsg.mp1, qmsg.mp2);
+      WinDispatchMsg(dwhab, &qmsg);
+   }
+
+   WinDestroyMsgQueue(dwhmq);
+   WinTerminate(dwhab);
 }
 
 /*
@@ -3527,41 +3527,41 @@
  */
 void API dw_main_sleep(int milliseconds)
 {
-	QMSG qmsg;
+   QMSG qmsg;
 #ifdef __EMX__
-	struct timeval tv, start;
-
-	gettimeofday(&start, NULL);
-	gettimeofday(&tv, NULL);
-
-	while(((tv.tv_sec - start.tv_sec)*1000) + ((tv.tv_usec - start.tv_usec)/1000) <= milliseconds)
-	{
-		if(WinPeekMsg(dwhab, &qmsg, 0, 0, 0, PM_NOREMOVE))
-		{
-			WinGetMsg(dwhab, &qmsg, 0, 0, 0);
-			if(qmsg.msg == WM_TIMER && qmsg.hwnd == NULLHANDLE)
-				_run_event(qmsg.hwnd, qmsg.msg, qmsg.mp1, qmsg.mp2);
-			WinDispatchMsg(dwhab, &qmsg);
-		}
-		else
-			DosSleep(1);
-		gettimeofday(&tv, NULL);
-	}
+   struct timeval tv, start;
+
+   gettimeofday(&start, NULL);
+   gettimeofday(&tv, NULL);
+
+   while(((tv.tv_sec - start.tv_sec)*1000) + ((tv.tv_usec - start.tv_usec)/1000) <= milliseconds)
+   {
+      if(WinPeekMsg(dwhab, &qmsg, 0, 0, 0, PM_NOREMOVE))
+      {
+         WinGetMsg(dwhab, &qmsg, 0, 0, 0);
+         if(qmsg.msg == WM_TIMER && qmsg.hwnd == NULLHANDLE)
+            _run_event(qmsg.hwnd, qmsg.msg, qmsg.mp1, qmsg.mp2);
+         WinDispatchMsg(dwhab, &qmsg);
+      }
+      else
+         DosSleep(1);
+      gettimeofday(&tv, NULL);
+   }
 #else
-	double start = (double)clock();
-
-	while(((clock() - start) / (CLOCKS_PER_SEC/1000)) <= milliseconds)
-	{
-		if(WinPeekMsg(dwhab, &qmsg, 0, 0, 0, PM_NOREMOVE))
-		{
-			WinGetMsg(dwhab, &qmsg, 0, 0, 0);
-			if(qmsg.msg == WM_TIMER && qmsg.hwnd == NULLHANDLE)
-				_run_event(qmsg.hwnd, qmsg.msg, qmsg.mp1, qmsg.mp2);
-			WinDispatchMsg(dwhab, &qmsg);
-		}
-		else
-			DosSleep(1);
-	}
+   double start = (double)clock();
+
+   while(((clock() - start) / (CLOCKS_PER_SEC/1000)) <= milliseconds)
+   {
+      if(WinPeekMsg(dwhab, &qmsg, 0, 0, 0, PM_NOREMOVE))
+      {
+         WinGetMsg(dwhab, &qmsg, 0, 0, 0);
+         if(qmsg.msg == WM_TIMER && qmsg.hwnd == NULLHANDLE)
+            _run_event(qmsg.hwnd, qmsg.msg, qmsg.mp1, qmsg.mp2);
+         WinDispatchMsg(dwhab, &qmsg);
+      }
+      else
+         DosSleep(1);
+   }
 #endif
 }
 
@@ -3570,16 +3570,16 @@
  */
 void API dw_main_iteration(void)
 {
-	QMSG qmsg;
-
-	_dwtid = dw_thread_id();
-
-	if(WinGetMsg(dwhab, &qmsg, 0, 0, 0))
-	{
-		if(qmsg.msg == WM_TIMER && qmsg.hwnd == NULLHANDLE)
-			_run_event(qmsg.hwnd, qmsg.msg, qmsg.mp1, qmsg.mp2);
-		WinDispatchMsg(dwhab, &qmsg);
-	}
+   QMSG qmsg;
+
+   _dwtid = dw_thread_id();
+
+   if(WinGetMsg(dwhab, &qmsg, 0, 0, 0))
+   {
+      if(qmsg.msg == WM_TIMER && qmsg.hwnd == NULLHANDLE)
+         _run_event(qmsg.hwnd, qmsg.msg, qmsg.mp1, qmsg.mp2);
+      WinDispatchMsg(dwhab, &qmsg);
+   }
 }
 
 /*
@@ -3590,7 +3590,7 @@
  */
 void API dw_free(void *ptr)
 {
-	free(ptr);
+   free(ptr);
 }
 
 /*
@@ -3600,13 +3600,13 @@
  */
 DWDialog * API dw_dialog_new(void *data)
 {
-	DWDialog *tmp = malloc(sizeof(DWDialog));
-
-	tmp->eve = dw_event_new();
-	dw_event_reset(tmp->eve);
-	tmp->data = data;
-	tmp->done = 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->result = NULL;
 
     return tmp;
 }
@@ -3620,10 +3620,10 @@
  */
 int API dw_dialog_dismiss(DWDialog *dialog, void *result)
 {
-	dialog->result = result;
-	dw_event_post(dialog->eve);
-	dialog->done = TRUE;
-	return 0;
+   dialog->result = result;
+   dw_event_post(dialog->eve);
+   dialog->done = TRUE;
+   return 0;
 }
 
 /*
@@ -3634,21 +3634,21 @@
  */
 void * API dw_dialog_wait(DWDialog *dialog)
 {
-	QMSG qmsg;
-	void *tmp;
-
-	while (WinGetMsg(dwhab, &qmsg, 0, 0, 0))
-	{
-		if(qmsg.msg == WM_TIMER && qmsg.hwnd == NULLHANDLE)
-			_run_event(qmsg.hwnd, qmsg.msg, qmsg.mp1, qmsg.mp2);
-		WinDispatchMsg(dwhab, &qmsg);
-		if(dialog->done)
-			break;
-	}
-	dw_event_close(&dialog->eve);
-	tmp = dialog->result;
-	free(dialog);
-	return tmp;
+   QMSG qmsg;
+   void *tmp;
+
+   while (WinGetMsg(dwhab, &qmsg, 0, 0, 0))
+   {
+      if(qmsg.msg == WM_TIMER && qmsg.hwnd == NULLHANDLE)
+         _run_event(qmsg.hwnd, qmsg.msg, qmsg.mp1, qmsg.mp2);
+      WinDispatchMsg(dwhab, &qmsg);
+      if(dialog->done)
+         break;
+   }
+   dw_event_close(&dialog->eve);
+   tmp = dialog->result;
+   free(dialog);
+   return tmp;
 }
 
 
@@ -3662,24 +3662,24 @@
  */
 int API dw_messagebox(char *title, int flags, char *format, ...)
 {
-	va_list args;
-	char outbuf[1024];
-	int rc;
-
-	va_start(args, format);
-	vsprintf(outbuf, format, args);
-	va_end(args);
-
-	rc = WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, outbuf, title, 0, flags | MB_MOVEABLE);
-	if(rc == MBID_OK)
-		return DW_MB_RETURN_OK;
-	else if(rc == MBID_YES)
-		return DW_MB_RETURN_YES;
-	else if(rc == MBID_NO)
-		return DW_MB_RETURN_NO;
-	else if(rc == MBID_CANCEL)
-		return DW_MB_RETURN_CANCEL;
-	else return 0;
+   va_list args;
+   char outbuf[1024];
+   int rc;
+
+   va_start(args, format);
+   vsprintf(outbuf, format, args);
+   va_end(args);
+
+   rc = WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, outbuf, title, 0, flags | MB_MOVEABLE);
+   if(rc == MBID_OK)
+      return DW_MB_RETURN_OK;
+   else if(rc == MBID_YES)
+      return DW_MB_RETURN_YES;
+   else if(rc == MBID_NO)
+      return DW_MB_RETURN_NO;
+   else if(rc == MBID_CANCEL)
+      return DW_MB_RETURN_CANCEL;
+   else return 0;
 }
 
 /*
@@ -3689,7 +3689,7 @@
  */
 int API dw_window_raise(HWND handle)
 {
-	return WinSetWindowPos(handle, HWND_TOP, 0, 0, 0, 0, SWP_ZORDER);
+   return WinSetWindowPos(handle, HWND_TOP, 0, 0, 0, 0, SWP_ZORDER);
 }
 
 /*
@@ -3699,7 +3699,7 @@
  */
 int API dw_window_lower(HWND handle)
 {
-	return WinSetWindowPos(handle, HWND_BOTTOM, 0, 0, 0, 0, SWP_ZORDER);
+   return WinSetWindowPos(handle, HWND_BOTTOM, 0, 0, 0, 0, SWP_ZORDER);
 }
 
 /*
@@ -3709,54 +3709,54 @@
  */
 int API dw_window_show(HWND handle)
 {
-	int rc = WinSetWindowPos(handle, NULLHANDLE, 0, 0, 0, 0, SWP_SHOW);
-	HSWITCH hswitch;
-	SWCNTRL swcntrl;
-
-	_fix_button_owner(_toplevel_window(handle), 0);
-	WinSetFocus(HWND_DESKTOP, handle);
-	_initial_focus(handle);
-
-	/* If this window has a  switch list entry make sure it is visible */
-	hswitch = WinQuerySwitchHandle(handle, 0);
-	if(hswitch)
-	{
-		WinQuerySwitchEntry(hswitch, &swcntrl);
-		swcntrl.uchVisibility = SWL_VISIBLE;
-		WinChangeSwitchEntry(hswitch, &swcntrl);
-	}
-	if(WinWindowFromID(handle, FID_CLIENT))
-	{
-		WindowData *blah = WinQueryWindowPtr(handle, QWP_USER);
-
-		if(blah && !(blah->flags & DW_OS2_NEW_WINDOW))
-		{
-			ULONG cx = dw_screen_width(), cy = dw_screen_height();
-			int newx, newy, changed = 0;
-			SWP swp;
-
-			blah->flags |= DW_OS2_NEW_WINDOW;
-
-			WinQueryWindowPos(handle, &swp);
-
-			newx = swp.x;
-			newy = swp.y;
-
-			if((swp.x+swp.cx) > cx)
-			{
-				newx = (cx - swp.cx)/2;
-				changed = 1;
-			}
-			if((swp.y+swp.cy) > cy)
-			{
-				newy = (cy - swp.cy)/2;
-				changed = 1;
-			}
-			if(changed)
-				WinSetWindowPos(handle, NULLHANDLE, newx, newy, 0, 0, SWP_MOVE);
-		}
-	}
-	return rc;
+   int rc = WinSetWindowPos(handle, NULLHANDLE, 0, 0, 0, 0, SWP_SHOW);
+   HSWITCH hswitch;
+   SWCNTRL swcntrl;
+
+   _fix_button_owner(_toplevel_window(handle), 0);
+   WinSetFocus(HWND_DESKTOP, handle);
+   _initial_focus(handle);
+
+   /* If this window has a  switch list entry make sure it is visible */
+   hswitch = WinQuerySwitchHandle(handle, 0);
+   if(hswitch)
+   {
+      WinQuerySwitchEntry(hswitch, &swcntrl);
+      swcntrl.uchVisibility = SWL_VISIBLE;
+      WinChangeSwitchEntry(hswitch, &swcntrl);
+   }
+   if(WinWindowFromID(handle, FID_CLIENT))
+   {
+      WindowData *blah = WinQueryWindowPtr(handle, QWP_USER);
+
+      if(blah && !(blah->flags & DW_OS2_NEW_WINDOW))
+      {
+         ULONG cx = dw_screen_width(), cy = dw_screen_height();
+         int newx, newy, changed = 0;
+         SWP swp;
+
+         blah->flags |= DW_OS2_NEW_WINDOW;
+
+         WinQueryWindowPos(handle, &swp);
+
+         newx = swp.x;
+         newy = swp.y;
+
+         if((swp.x+swp.cx) > cx)
+         {
+            newx = (cx - swp.cx)/2;
+            changed = 1;
+         }
+         if((swp.y+swp.cy) > cy)
+         {
+            newy = (cy - swp.cy)/2;
+            changed = 1;
+         }
+         if(changed)
+            WinSetWindowPos(handle, NULLHANDLE, newx, newy, 0, 0, SWP_MOVE);
+      }
+   }
+   return rc;
 }
 
 /*
@@ -3766,20 +3766,20 @@
  */
 int API dw_window_minimize(HWND handle)
 {
-	HWND hwndclient = WinWindowFromID(handle, FID_CLIENT);
-
-	if(hwndclient)
-	{
-		Box *box = (Box *)WinQueryWindowPtr(hwndclient, QWP_USER);
-
-		if(box)
-		{
-			if(!box->titlebar && box->hwndtitle)
-				WinSetParent(box->hwndtitle, handle, FALSE);
-		}
-	}
-
-	return WinSetWindowPos(handle, NULLHANDLE, 0, 0, 0, 0, SWP_MINIMIZE);
+   HWND hwndclient = WinWindowFromID(handle, FID_CLIENT);
+
+   if(hwndclient)
+   {
+      Box *box = (Box *)WinQueryWindowPtr(hwndclient, QWP_USER);
+
+      if(box)
+      {
+         if(!box->titlebar && box->hwndtitle)
+            WinSetParent(box->hwndtitle, handle, FALSE);
+      }
+   }
+
+   return WinSetWindowPos(handle, NULLHANDLE, 0, 0, 0, 0, SWP_MINIMIZE);
 }
 
 /*
@@ -3789,18 +3789,18 @@
  */
 int API dw_window_hide(HWND handle)
 {
-	HSWITCH hswitch;
-	SWCNTRL swcntrl;
-
-	/* If this window has a  switch list entry make sure it is invisible */
-	hswitch = WinQuerySwitchHandle(handle, 0);
-	if(hswitch)
-	{
-		WinQuerySwitchEntry(hswitch, &swcntrl);
-		swcntrl.uchVisibility = SWL_INVISIBLE;
-		WinChangeSwitchEntry(hswitch, &swcntrl);
-	}
-	return WinShowWindow(handle, FALSE);
+   HSWITCH hswitch;
+   SWCNTRL swcntrl;
+
+   /* If this window has a  switch list entry make sure it is invisible */
+   hswitch = WinQuerySwitchHandle(handle, 0);
+   if(hswitch)
+   {
+      WinQuerySwitchEntry(hswitch, &swcntrl);
+      swcntrl.uchVisibility = SWL_INVISIBLE;
+      WinChangeSwitchEntry(hswitch, &swcntrl);
+   }
+   return WinShowWindow(handle, FALSE);
 }
 
 /*
@@ -3810,49 +3810,49 @@
  */
 int API dw_window_destroy(HWND handle)
 {
-	HWND frame, menu, parent = WinQueryWindow(handle, QW_PARENT);
-	Box *thisbox = WinQueryWindowPtr(parent, QWP_USER);
-
-	if(!handle)
-		return -1;
-
-	frame = (HWND)dw_window_get_data(handle, "_dw_combo_box");
-
-	if((menu = WinWindowFromID(handle, FID_MENU)) != NULLHANDLE)
-		_free_menu_data(menu);
-
-	if(parent != desktop && thisbox && thisbox->count)
-	{
-		int z, index = -1;
-		Item *tmpitem, *thisitem = thisbox->items;
-
-		for(z=0;z<thisbox->count;z++)
-		{
-			if(thisitem[z].hwnd == handle)
-				index = z;
-		}
-
-		if(index == -1)
-			return 0;
-
-		tmpitem = malloc(sizeof(Item)*(thisbox->count-1));
-
-		/* Copy all but the current entry to the new list */
-		for(z=0;z<index;z++)
-		{
-			tmpitem[z] = thisitem[z];
-		}
-		for(z=index+1;z<thisbox->count;z++)
-		{
-			tmpitem[z-1] = thisitem[z];
-		}
-
-		thisbox->items = tmpitem;
-		free(thisitem);
-		thisbox->count--;
-		_free_window_memory(frame ? frame : handle);
-	}
-	return WinDestroyWindow(frame ? frame : handle);
+   HWND frame, menu, parent = WinQueryWindow(handle, QW_PARENT);
+   Box *thisbox = WinQueryWindowPtr(parent, QWP_USER);
+
+   if(!handle)
+      return -1;
+
+   frame = (HWND)dw_window_get_data(handle, "_dw_combo_box");
+
+   if((menu = WinWindowFromID(handle, FID_MENU)) != NULLHANDLE)
+      _free_menu_data(menu);
+
+   if(parent != desktop && thisbox && thisbox->count)
+   {
+      int z, index = -1;
+      Item *tmpitem, *thisitem = thisbox->items;
+
+      for(z=0;z<thisbox->count;z++)
+      {
+         if(thisitem[z].hwnd == handle)
+            index = z;
+      }
+
+      if(index == -1)
+         return 0;
+
+      tmpitem = malloc(sizeof(Item)*(thisbox->count-1));
+
+      /* Copy all but the current entry to the new list */
+      for(z=0;z<index;z++)
+      {
+         tmpitem[z] = thisitem[z];
+      }
+      for(z=index+1;z<thisbox->count;z++)
+      {
+         tmpitem[z-1] = thisitem[z];
+      }
+
+      thisbox->items = tmpitem;
+      free(thisitem);
+      thisbox->count--;
+      _free_window_memory(frame ? frame : handle);
+   }
+   return WinDestroyWindow(frame ? frame : handle);
 }
 
 /* Causes entire window to be invalidated and redrawn.
@@ -3861,21 +3861,21 @@
  */
 void API dw_window_redraw(HWND handle)
 {
-	HWND client = WinWindowFromID(handle, FID_CLIENT);
-	HWND window = client ? client : handle;
-	Box *mybox = (Box *)WinQueryWindowPtr(window, QWP_USER);
-
-	_fix_button_owner(_toplevel_window(handle), 0);
-	if(window && mybox)
-	{
-		unsigned long width, height;
-
-		dw_window_get_pos_size(window, NULL, NULL, &width, &height);
-
-		WinShowWindow(client ? mybox->items[0].hwnd : handle, FALSE);
-		_do_resize(mybox, width, height);
-		WinShowWindow(client ? mybox->items[0].hwnd : handle, TRUE);
-	}
+   HWND client = WinWindowFromID(handle, FID_CLIENT);
+   HWND window = client ? client : handle;
+   Box *mybox = (Box *)WinQueryWindowPtr(window, QWP_USER);
+
+   _fix_button_owner(_toplevel_window(handle), 0);
+   if(window && mybox)
+   {
+      unsigned long width, height;
+
+      dw_window_get_pos_size(window, NULL, NULL, &width, &height);
+
+      WinShowWindow(client ? mybox->items[0].hwnd : handle, FALSE);
+      _do_resize(mybox, width, height);
+      WinShowWindow(client ? mybox->items[0].hwnd : handle, TRUE);
+   }
 }
 
 /*
@@ -3886,8 +3886,8 @@
  */
 void API dw_window_reparent(HWND handle, HWND newparent)
 {
-	HWND blah = WinWindowFromID(newparent, FID_CLIENT);
-	WinSetParent(handle, blah ? blah : newparent, TRUE);
+   HWND blah = WinWindowFromID(newparent, FID_CLIENT);
+   WinSetParent(handle, blah ? blah : newparent, TRUE);
 }
 
 /*
@@ -3898,49 +3898,49 @@
  */
 int API dw_window_set_font(HWND handle, char *fontname)
 {
-	return WinSetPresParam(handle, PP_FONTNAMESIZE, strlen(fontname)+1, fontname);
+   return WinSetPresParam(handle, PP_FONTNAMESIZE, strlen(fontname)+1, fontname);
 }
 
 /* Internal version */
 int _dw_window_set_color(HWND handle, ULONG fore, ULONG back)
 {
-	if((fore & DW_RGB_COLOR) == DW_RGB_COLOR)
-	{
-		RGB2 rgb2;
-
-		rgb2.bBlue = DW_BLUE_VALUE(fore);
-		rgb2.bGreen = DW_GREEN_VALUE(fore);
-		rgb2.bRed = DW_RED_VALUE(fore);
-		rgb2.fcOptions = 0;
-
-		WinSetPresParam(handle, PP_FOREGROUNDCOLOR, sizeof(RGB2), &rgb2);
-
-	}
-	else if(fore != DW_CLR_DEFAULT)
-	{
-		fore = _internal_color(fore);
-
-		WinSetPresParam(handle, PP_FOREGROUNDCOLORINDEX, sizeof(ULONG), &fore);
-	}
-	if((back & DW_RGB_COLOR) == DW_RGB_COLOR)
-	{
-		RGB2 rgb2;
-
-		rgb2.bBlue = DW_BLUE_VALUE(back);
-		rgb2.bGreen = DW_GREEN_VALUE(back);
-		rgb2.bRed = DW_RED_VALUE(back);
-		rgb2.fcOptions = 0;
-
-		WinSetPresParam(handle, PP_BACKGROUNDCOLOR, sizeof(RGB2), &rgb2);
-		return 0;
-	}
-	else if(back != DW_CLR_DEFAULT)
-	{
-		back = _internal_color(back);
-
-		WinSetPresParam(handle, PP_BACKGROUNDCOLORINDEX, sizeof(ULONG), &back);
-	}
-	return 0;
+   if((fore & DW_RGB_COLOR) == DW_RGB_COLOR)
+   {
+      RGB2 rgb2;
+
+      rgb2.bBlue = DW_BLUE_VALUE(fore);
+      rgb2.bGreen = DW_GREEN_VALUE(fore);
+      rgb2.bRed = DW_RED_VALUE(fore);
+      rgb2.fcOptions = 0;
+
+      WinSetPresParam(handle, PP_FOREGROUNDCOLOR, sizeof(RGB2), &rgb2);
+
+   }
+   else if(fore != DW_CLR_DEFAULT)
+   {
+      fore = _internal_color(fore);
+
+      WinSetPresParam(handle, PP_FOREGROUNDCOLORINDEX, sizeof(ULONG), &fore);
+   }
+   if((back & DW_RGB_COLOR) == DW_RGB_COLOR)
+   {
+      RGB2 rgb2;
+
+      rgb2.bBlue = DW_BLUE_VALUE(back);
+      rgb2.bGreen = DW_GREEN_VALUE(back);
+      rgb2.bRed = DW_RED_VALUE(back);
+      rgb2.fcOptions = 0;
+
+      WinSetPresParam(handle, PP_BACKGROUNDCOLOR, sizeof(RGB2), &rgb2);
+      return 0;
+   }
+   else if(back != DW_CLR_DEFAULT)
+   {
+      back = _internal_color(back);
+
+      WinSetPresParam(handle, PP_BACKGROUNDCOLORINDEX, sizeof(ULONG), &back);
+   }
+   return 0;
 }
 /*
  * Sets the colors used by a specified window (widget) handle.
@@ -3951,10 +3951,10 @@
  */
 int API dw_window_set_color(HWND handle, ULONG fore, ULONG back)
 {
-	dw_window_set_data(handle, "_dw_fore", (void *)(fore+1));
-	dw_window_set_data(handle, "_dw_back", (void *)(back+1));
-
-	return _dw_window_set_color(handle, fore, back);
+   dw_window_set_data(handle, "_dw_fore", (void *)(fore+1));
+   dw_window_set_data(handle, "_dw_back", (void *)(back+1));
+
+   return _dw_window_set_color(handle, fore, back);
 }
 
 /*
@@ -3965,8 +3965,8 @@
  */
 int API dw_window_set_border(HWND handle, int border)
 {
-	WinSendMsg(handle, WM_SETBORDERSIZE, MPFROMSHORT(border), MPFROMSHORT(border));
-	return 0;
+   WinSendMsg(handle, WM_SETBORDERSIZE, MPFROMSHORT(border), MPFROMSHORT(border));
+   return 0;
 }
 
 /*
@@ -3976,7 +3976,7 @@
  */
 void API dw_window_capture(HWND handle)
 {
-	WinSetCapture(HWND_DESKTOP, handle);
+   WinSetCapture(HWND_DESKTOP, handle);
 }
 
 /*
@@ -3984,7 +3984,7 @@
  */
 void API dw_window_release(void)
 {
-	WinSetCapture(HWND_DESKTOP, NULLHANDLE);
+   WinSetCapture(HWND_DESKTOP, NULLHANDLE);
 }
 
 /*
@@ -3994,7 +3994,7 @@
  */
 void API dw_window_track(HWND handle)
 {
-	WinSendMsg(handle, WM_TRACKFRAME, MPFROMSHORT(TF_MOVE), 0);
+   WinSendMsg(handle, WM_TRACKFRAME, MPFROMSHORT(TF_MOVE), 0);
 }
 
 /*
@@ -4005,19 +4005,19 @@
  */
 void API dw_window_set_pointer(HWND handle, int pointertype)
 {
-	HPOINTER pointer = pointertype < 65535 ?
-		WinQuerySysPointer(HWND_DESKTOP, pointertype, FALSE)
-		: (HPOINTER)pointertype;
-
-	if(!pointertype)
-		dw_window_set_data(handle, "_dw_pointer", 0);
-	else
-	{
-		WinSetPointer(HWND_DESKTOP, pointer);
-
-		if(handle != HWND_DESKTOP)
-			dw_window_set_data(handle, "_dw_pointer", (void *)pointer);
-	}
+   HPOINTER pointer = pointertype < 65535 ?
+      WinQuerySysPointer(HWND_DESKTOP, pointertype, FALSE)
+      : (HPOINTER)pointertype;
+
+   if(!pointertype)
+      dw_window_set_data(handle, "_dw_pointer", 0);
+   else
+   {
+      WinSetPointer(HWND_DESKTOP, pointer);
+
+      if(handle != HWND_DESKTOP)
+         dw_window_set_data(handle, "_dw_pointer", (void *)pointer);
+   }
 }
 
 /*
@@ -4029,45 +4029,45 @@
  */
 HWND API dw_window_new(HWND hwndOwner, char *title, ULONG flStyle)
 {
-	HWND hwndframe;
-	Box *newbox = calloc(1, sizeof(Box));
-	WindowData *blah = calloc(1, sizeof(WindowData));
-	ULONG winStyle = 0L;
-
-	newbox->pad = 0;
-	newbox->type = DW_VERT;
-	newbox->count = 0;
-
-	flStyle |= FCF_NOBYTEALIGN;
-
-	if(flStyle & DW_FCF_TITLEBAR)
-		newbox->titlebar = 1;
-	else
-		flStyle |= FCF_TITLEBAR;
-
-	if(!(flStyle & FCF_SHELLPOSITION))
-		blah->flags |= DW_OS2_NEW_WINDOW;
-
-	if(flStyle & WS_MAXIMIZED)
-	{
-		winStyle |= WS_MAXIMIZED;
-		flStyle &= ~WS_MAXIMIZED;
-	}
-	if(flStyle & WS_MINIMIZED)
-	{
-		winStyle |= WS_MINIMIZED;
-		flStyle &= ~WS_MINIMIZED;
-	}
-
-	hwndframe = WinCreateStdWindow(hwndOwner, winStyle, &flStyle, ClassName, title, 0L, NULLHANDLE, 0L, &newbox->hwnd);
-	newbox->hwndtitle = WinWindowFromID(hwndframe, FID_TITLEBAR);
-	if(!newbox->titlebar && newbox->hwndtitle)
-		WinSetParent(newbox->hwndtitle, HWND_OBJECT, FALSE);
-	blah->oldproc = WinSubclassWindow(hwndframe, _sizeproc);
-	WinSetWindowPtr(hwndframe, QWP_USER, blah);
-	WinSetWindowPtr(newbox->hwnd, QWP_USER, newbox);
-
-	return hwndframe;
+   HWND hwndframe;
+   Box *newbox = calloc(1, sizeof(Box));
+   WindowData *blah = calloc(1, sizeof(WindowData));
+   ULONG winStyle = 0L;
+
+   newbox->pad = 0;
+   newbox->type = DW_VERT;
+   newbox->count = 0;
+
+   flStyle |= FCF_NOBYTEALIGN;
+
+   if(flStyle & DW_FCF_TITLEBAR)
+      newbox->titlebar = 1;
+   else
+      flStyle |= FCF_TITLEBAR;
+
+   if(!(flStyle & FCF_SHELLPOSITION))
+      blah->flags |= DW_OS2_NEW_WINDOW;
+
+   if(flStyle & WS_MAXIMIZED)
+   {
+      winStyle |= WS_MAXIMIZED;
+      flStyle &= ~WS_MAXIMIZED;
+   }
+   if(flStyle & WS_MINIMIZED)
+   {
+      winStyle |= WS_MINIMIZED;
+      flStyle &= ~WS_MINIMIZED;
+   }
+
+   hwndframe = WinCreateStdWindow(hwndOwner, winStyle, &flStyle, ClassName, title, 0L, NULLHANDLE, 0L, &newbox->hwnd);
+   newbox->hwndtitle = WinWindowFromID(hwndframe, FID_TITLEBAR);
+   if(!newbox->titlebar && newbox->hwndtitle)
+      WinSetParent(newbox->hwndtitle, HWND_OBJECT, FALSE);
+   blah->oldproc = WinSubclassWindow(hwndframe, _sizeproc);
+   WinSetWindowPtr(hwndframe, QWP_USER, blah);
+   WinSetWindowPtr(newbox->hwnd, QWP_USER, newbox);
+
+   return hwndframe;
 }
 
 /*
@@ -4078,29 +4078,29 @@
  */
 HWND API dw_box_new(int type, int pad)
 {
-	Box *newbox = calloc(1, sizeof(Box));
-
-	newbox->pad = pad;
-	newbox->type = type;
-	newbox->count = 0;
+   Box *newbox = calloc(1, sizeof(Box));
+
+   newbox->pad = pad;
+   newbox->type = type;
+   newbox->count = 0;
     newbox->grouphwnd = NULLHANDLE;
 
-	newbox->hwnd = WinCreateWindow(HWND_OBJECT,
-								   WC_FRAME,
-								   NULL,
-								   WS_VISIBLE | WS_CLIPCHILDREN |
-								   FS_NOBYTEALIGN,
-								   0,0,2000,1000,
-								   NULLHANDLE,
-								   HWND_TOP,
-								   0L,
-								   NULL,
-								   NULL);
-
-	newbox->oldproc = WinSubclassWindow(newbox->hwnd, _controlproc);
-	WinSetWindowPtr(newbox->hwnd, QWP_USER, newbox);
-	dw_window_set_color(newbox->hwnd, DW_CLR_PALEGRAY, DW_CLR_PALEGRAY);
-	return newbox->hwnd;
+   newbox->hwnd = WinCreateWindow(HWND_OBJECT,
+                           WC_FRAME,
+                           NULL,
+                           WS_VISIBLE | WS_CLIPCHILDREN |
+                           FS_NOBYTEALIGN,
+                           0,0,2000,1000,
+                           NULLHANDLE,
+                           HWND_TOP,
+                           0L,
+                           NULL,
+                           NULL);
+
+   newbox->oldproc = WinSubclassWindow(newbox->hwnd, _controlproc);
+   WinSetWindowPtr(newbox->hwnd, QWP_USER, newbox);
+   dw_window_set_color(newbox->hwnd, DW_CLR_PALEGRAY, DW_CLR_PALEGRAY);
+   return newbox->hwnd;
 }
 
 /*
@@ -4112,40 +4112,40 @@
  */
 HWND API dw_groupbox_new(int type, int pad, char *title)
 {
-	Box *newbox = calloc(1, sizeof(Box));
-	newbox->pad = pad;
-	newbox->type = type;
-	newbox->count = 0;
-
-	newbox->hwnd = WinCreateWindow(HWND_OBJECT,
-								   WC_FRAME,
-								   NULL,
-								   WS_VISIBLE |
-								   FS_NOBYTEALIGN,
-								   0,0,2000,1000,
-								   NULLHANDLE,
-								   HWND_TOP,
-								   0L,
-								   NULL,
-								   NULL);
-
-	newbox->grouphwnd = WinCreateWindow(newbox->hwnd,
-										WC_STATIC,
-										title,
-										WS_VISIBLE | SS_GROUPBOX |
-										WS_GROUP,
-										0,0,2000,1000,
-										NULLHANDLE,
-										HWND_TOP,
-										0L,
-										NULL,
-										NULL);
-
-	WinSetWindowPtr(newbox->hwnd, QWP_USER, newbox);
-	dw_window_set_color(newbox->hwnd, DW_CLR_PALEGRAY, DW_CLR_PALEGRAY);
-	dw_window_set_color(newbox->grouphwnd, DW_CLR_BLACK, DW_CLR_PALEGRAY);
-	dw_window_set_font(newbox->grouphwnd, DefaultFont);
-	return newbox->hwnd;
+   Box *newbox = calloc(1, sizeof(Box));
+   newbox->pad = pad;
+   newbox->type = type;
+   newbox->count = 0;
+
+   newbox->hwnd = WinCreateWindow(HWND_OBJECT,
+                           WC_FRAME,
+                           NULL,
+                           WS_VISIBLE |
+                           FS_NOBYTEALIGN,
+                           0,0,2000,1000,
+                           NULLHANDLE,
+                           HWND_TOP,
+                           0L,
+                           NULL,
+                           NULL);
+
+   newbox->grouphwnd = WinCreateWindow(newbox->hwnd,
+                              WC_STATIC,
+                              title,
+                              WS_VISIBLE | SS_GROUPBOX |
+                              WS_GROUP,
+                              0,0,2000,1000,
+                              NULLHANDLE,
+                              HWND_TOP,
+                              0L,
+                              NULL,
+                              NULL);
+
+   WinSetWindowPtr(newbox->hwnd, QWP_USER, newbox);
+   dw_window_set_color(newbox->hwnd, DW_CLR_PALEGRAY, DW_CLR_PALEGRAY);
+   dw_window_set_color(newbox->grouphwnd, DW_CLR_BLACK, DW_CLR_PALEGRAY);
+   dw_window_set_font(newbox->grouphwnd, DefaultFont);
+   return newbox->hwnd;
 }
 
 /*
@@ -4155,23 +4155,23 @@
  */
 HWND API dw_mdi_new(unsigned long id)
 {
-	HWND hwndframe;
-	ULONG back = CLR_DARKGRAY;
-
-	hwndframe = WinCreateWindow(HWND_OBJECT,
-								WC_FRAME,
-								NULL,
-								WS_VISIBLE | WS_CLIPCHILDREN |
-								FS_NOBYTEALIGN,
-								0,0,2000,1000,
-								NULLHANDLE,
-								HWND_TOP,
-								id,
-								NULL,
-								NULL);
-	/* Make the MDI Client area the same color as Windows and Unix */
-	WinSetPresParam(hwndframe, PP_BACKGROUNDCOLORINDEX, sizeof(ULONG), &back);
-	return hwndframe;
+   HWND hwndframe;
+   ULONG back = CLR_DARKGRAY;
+
+   hwndframe = WinCreateWindow(HWND_OBJECT,
+                        WC_FRAME,
+                        NULL,
+                        WS_VISIBLE | WS_CLIPCHILDREN |
+                        FS_NOBYTEALIGN,
+                        0,0,2000,1000,
+                        NULLHANDLE,
+                        HWND_TOP,
+                        id,
+                        NULL,
+                        NULL);
+   /* Make the MDI Client area the same color as Windows and Unix */
+   WinSetPresParam(hwndframe, PP_BACKGROUNDCOLORINDEX, sizeof(ULONG), &back);
+   return hwndframe;
 }
 
 /*
@@ -4181,16 +4181,16 @@
  */
 HWND API dw_bitmap_new(ULONG id)
 {
-	return WinCreateWindow(HWND_OBJECT,
-						   WC_STATIC,
-						   NULL,
-						   WS_VISIBLE | SS_TEXT,
-						   0,0,2000,1000,
-						   NULLHANDLE,
-						   HWND_TOP,
-						   id,
-						   NULL,
-						   NULL);
+   return WinCreateWindow(HWND_OBJECT,
+                     WC_STATIC,
+                     NULL,
+                     WS_VISIBLE | SS_TEXT,
+                     0,0,2000,1000,
+                     NULLHANDLE,
+                     HWND_TOP,
+                     id,
+                     NULL,
+                     NULL);
 }
 
 /*
@@ -4201,38 +4201,38 @@
  */
 HWND API dw_notebook_new(ULONG id, int top)
 {
-	ULONG flags;
-	HWND tmp;
-
-	if(top)
-		flags = BKS_MAJORTABTOP;
-	else
-		flags = BKS_MAJORTABBOTTOM;
-
-	tmp = WinCreateWindow(HWND_OBJECT,
-						  WC_NOTEBOOK,
-						  NULL,
-						  WS_VISIBLE |
+   ULONG flags;
+   HWND tmp;
+
+   if(top)
+      flags = BKS_MAJORTABTOP;
+   else
+      flags = BKS_MAJORTABBOTTOM;
+
+   tmp = WinCreateWindow(HWND_OBJECT,
+                    WC_NOTEBOOK,
+                    NULL,
+                    WS_VISIBLE |
 #ifdef BKS_TABBEDDIALOG
-						  BKS_TABBEDDIALOG |
+                    BKS_TABBEDDIALOG |
 #endif
-						  flags,
-						  0,0,2000,1000,
-						  NULLHANDLE,
-						  HWND_TOP,
-						  id,
-						  NULL,
-						  NULL);
-
-	/* Fix tab sizes on Warp 3 */
-	if(!IS_WARP4())
-	{
-		/* best sizes to be determined by trial and error */
-		WinSendMsg(tmp, BKM_SETDIMENSIONS,MPFROM2SHORT(102, 28), MPFROMSHORT( BKA_MAJORTAB));
-	}
-
-	dw_window_set_font(tmp, DefaultFont);
-	return tmp;
+                    flags,
+                    0,0,2000,1000,
+                    NULLHANDLE,
+                    HWND_TOP,
+                    id,
+                    NULL,
+                    NULL);
+
+   /* Fix tab sizes on Warp 3 */
+   if(!IS_WARP4())
+   {
+      /* best sizes to be determined by trial and error */
+      WinSendMsg(tmp, BKM_SETDIMENSIONS,MPFROM2SHORT(102, 28), MPFROMSHORT( BKA_MAJORTAB));
+   }
+
+   dw_window_set_font(tmp, DefaultFont);
+   return tmp;
 }
 
 /*
@@ -4243,17 +4243,17 @@
  */
 HMENUI API dw_menu_new(ULONG id)
 {
-	HMENUI tmp = WinCreateWindow(HWND_OBJECT,
-								 WC_MENU,
-								 NULL,
-								 WS_VISIBLE,
-								 0,0,2000,1000,
-								 NULLHANDLE,
-								 HWND_TOP,
-								 id,
-								 NULL,
-								 NULL);
-	return tmp;
+   HMENUI tmp = WinCreateWindow(HWND_OBJECT,
+                         WC_MENU,
+                         NULL,
+                         WS_VISIBLE,
+                         0,0,2000,1000,
+                         NULLHANDLE,
+                         HWND_TOP,
+                         id,
+                         NULL,
+                         NULL);
+   return tmp;
 }
 
 /*
@@ -4263,19 +4263,19 @@
  */
 HMENUI API dw_menubar_new(HWND location)
 {
-	HMENUI tmp = WinCreateWindow(location,
-								 WC_MENU,
-								 NULL,
-								 WS_VISIBLE | MS_ACTIONBAR,
-								 0,0,2000,1000,
-								 location,
-								 HWND_TOP,
-								 FID_MENU,
-								 NULL,
-								 NULL);
-	dw_window_set_data(tmp, "_dw_owner", (void *)location);
-	dw_window_set_data(tmp, "_dw_menubar", (void *)location);
-	return tmp;
+   HMENUI tmp = WinCreateWindow(location,
+                         WC_MENU,
+                         NULL,
+                         WS_VISIBLE | MS_ACTIONBAR,
+                         0,0,2000,1000,
+                         location,
+                         HWND_TOP,
+                         FID_MENU,
+                         NULL,
+                         NULL);
+   dw_window_set_data(tmp, "_dw_owner", (void *)location);
+   dw_window_set_data(tmp, "_dw_menubar", (void *)location);
+   return tmp;
 }
 
 /*
@@ -4285,8 +4285,8 @@
  */
 void API dw_menu_destroy(HMENUI *menu)
 {
-	if(menu)
-		WinDestroyWindow(*menu);
+   if(menu)
+      WinDestroyWindow(*menu);
 }
 
 /*
@@ -4450,12 +4450,12 @@
  */
 void API dw_menu_popup(HMENUI *menu, HWND parent, int x, int y)
 {
-	if(menu)
-	{
-		popup = parent;
-		dw_window_set_data(*menu, "_dw_popup", (void *)1);
-		WinPopupMenu(HWND_DESKTOP, parent, *menu, x, dw_screen_height() - y, 0, PU_KEYBOARD | PU_MOUSEBUTTON1 | PU_VCONSTRAIN | PU_HCONSTRAIN);
-	}
+   if(menu)
+   {
+      popup = parent;
+      dw_window_set_data(*menu, "_dw_popup", (void *)1);
+      WinPopupMenu(HWND_DESKTOP, parent, *menu, x, dw_screen_height() - y, 0, PU_KEYBOARD | PU_MOUSEBUTTON1 | PU_VCONSTRAIN | PU_HCONSTRAIN);
+   }
 }
 
 /*
@@ -4466,14 +4466,14 @@
  */
 void API dw_pointer_query_pos(long *x, long *y)
 {
-	POINTL ptl;
-
-	WinQueryPointerPos(HWND_DESKTOP, &ptl);
-	if(x && y)
-	{
-		*x = ptl.x;
-		*y = dw_screen_height() - ptl.y;
-	}
+   POINTL ptl;
+
+   WinQueryPointerPos(HWND_DESKTOP, &ptl);
+   if(x && y)
+   {
+      *x = ptl.x;
+      *y = dw_screen_height() - ptl.y;
+   }
 }
 
 /*
@@ -4484,7 +4484,7 @@
  */
 void API dw_pointer_set_pos(long x, long y)
 {
-	WinSetPointerPos(HWND_DESKTOP, x, dw_screen_height() - y);
+   WinSetPointerPos(HWND_DESKTOP, x, dw_screen_height() - y);
 }
 
 
@@ -4496,24 +4496,24 @@
  */
 HWND API dw_container_new(ULONG id, int multi)
 {
-	WindowData *blah = calloc(1, sizeof(WindowData));
-	HWND tmp = WinCreateWindow(HWND_OBJECT,
-							   WC_CONTAINER,
-							   NULL,
-							   WS_VISIBLE | CCS_READONLY |
-							   (multi ? CCS_EXTENDSEL : CCS_SINGLESEL) |
-							   CCS_AUTOPOSITION,
-							   0,0,2000,1000,
-							   NULLHANDLE,
-							   HWND_TOP,
-							   id ? id : (GlobalID++),
-							   NULL,
-							   NULL);
-	blah->oldproc = WinSubclassWindow(tmp, _TreeProc);
-	WinSetWindowPtr(tmp, QWP_USER, blah);
-	dw_window_set_font(tmp, DefaultFont);
-	dw_window_set_data(tmp, "_dw_container", (void *)1);
-	return tmp;
+   WindowData *blah = calloc(1, sizeof(WindowData));
+   HWND tmp = WinCreateWindow(HWND_OBJECT,
+                        WC_CONTAINER,
+                        NULL,
+                        WS_VISIBLE | CCS_READONLY |
+                        (multi ? CCS_EXTENDSEL : CCS_SINGLESEL) |
+                        CCS_AUTOPOSITION,
+                        0,0,2000,1000,
+                        NULLHANDLE,
+                        HWND_TOP,
+                        id ? id : (GlobalID++),
+                        NULL,
+                        NULL);
+   blah->oldproc = WinSubclassWindow(tmp, _TreeProc);
+   WinSetWindowPtr(tmp, QWP_USER, blah);
+   dw_window_set_font(tmp, DefaultFont);
+   dw_window_set_data(tmp, "_dw_container", (void *)1);
+   return tmp;
 }
 
 /*
@@ -4524,33 +4524,33 @@
  */
 HWND API dw_tree_new(ULONG id)
 {
-	CNRINFO cnrinfo;
-	WindowData *blah = calloc(1, sizeof(WindowData));
-	HWND tmp = WinCreateWindow(HWND_OBJECT,
-							   WC_CONTAINER,
-							   NULL,
-							   WS_VISIBLE | CCS_READONLY |
-							   CCS_SINGLESEL | CCS_AUTOPOSITION,
-							   0,0,2000,1000,
-							   NULLHANDLE,
-							   HWND_TOP,
-							   id ? id : (GlobalID++),
-							   NULL,
-							   NULL);
-
-	cnrinfo.flWindowAttr = CV_TREE | CA_TREELINE;
-	cnrinfo.slBitmapOrIcon.cx = 16;
-	cnrinfo.slBitmapOrIcon.cy = 16;
-	cnrinfo.cyLineSpacing = 0;
-	cnrinfo.cxTreeIndent = 16;
-	cnrinfo.cxTreeLine = 1;
-
-	WinSendMsg(tmp, CM_SETCNRINFO, &cnrinfo, MPFROMLONG(CMA_FLWINDOWATTR | CMA_SLBITMAPORICON |
-														CMA_LINESPACING | CMA_CXTREEINDENT | CMA_CXTREELINE));
-	blah->oldproc = WinSubclassWindow(tmp, _TreeProc);
-	WinSetWindowPtr(tmp, QWP_USER, blah);
-	dw_window_set_font(tmp, DefaultFont);
-	return tmp;
+   CNRINFO cnrinfo;
+   WindowData *blah = calloc(1, sizeof(WindowData));
+   HWND tmp = WinCreateWindow(HWND_OBJECT,
+                        WC_CONTAINER,
+                        NULL,
+                        WS_VISIBLE | CCS_READONLY |
+                        CCS_SINGLESEL | CCS_AUTOPOSITION,
+                        0,0,2000,1000,
+                        NULLHANDLE,
+                        HWND_TOP,
+                        id ? id : (GlobalID++),
+                        NULL,
+                        NULL);
+
+   cnrinfo.flWindowAttr = CV_TREE | CA_TREELINE;
+   cnrinfo.slBitmapOrIcon.cx = 16;
+   cnrinfo.slBitmapOrIcon.cy = 16;
+   cnrinfo.cyLineSpacing = 0;
+   cnrinfo.cxTreeIndent = 16;
+   cnrinfo.cxTreeLine = 1;
+
+   WinSendMsg(tmp, CM_SETCNRINFO, &cnrinfo, MPFROMLONG(CMA_FLWINDOWATTR | CMA_SLBITMAPORICON |
+                                          CMA_LINESPACING | CMA_CXTREEINDENT | CMA_CXTREELINE));
+   blah->oldproc = WinSubclassWindow(tmp, _TreeProc);
+   WinSetWindowPtr(tmp, QWP_USER, blah);
+   dw_window_set_font(tmp, DefaultFont);
+   return tmp;
 }
 
 /*
@@ -4561,22 +4561,22 @@
  */
 HWND API dw_text_new(char *text, ULONG id)
 {
-	WindowData *blah = calloc(sizeof(WindowData), 1);
-	HWND tmp = WinCreateWindow(HWND_OBJECT,
-							   WC_STATIC,
-							   text,
-							   WS_VISIBLE | SS_TEXT,
-							   0,0,2000,1000,
-							   NULLHANDLE,
-							   HWND_TOP,
-							   id,
-							   NULL,
-							   NULL);
-	blah->oldproc = WinSubclassWindow(tmp, _textproc);
-	WinSetWindowPtr(tmp, QWP_USER, blah);
-	dw_window_set_font(tmp, DefaultFont);
-	dw_window_set_color(tmp, DW_CLR_BLACK, DW_CLR_PALEGRAY);
-	return tmp;
+   WindowData *blah = calloc(sizeof(WindowData), 1);
+   HWND tmp = WinCreateWindow(HWND_OBJECT,
+                        WC_STATIC,
+                        text,
+                        WS_VISIBLE | SS_TEXT,
+                        0,0,2000,1000,
+                        NULLHANDLE,
+                        HWND_TOP,
+                        id,
+                        NULL,
+                        NULL);
+   blah->oldproc = WinSubclassWindow(tmp, _textproc);
+   WinSetWindowPtr(tmp, QWP_USER, blah);
+   dw_window_set_font(tmp, DefaultFont);
+   dw_window_set_color(tmp, DW_CLR_BLACK, DW_CLR_PALEGRAY);
+   return tmp;
 }
 
 /*
@@ -4587,22 +4587,22 @@
  */
 HWND API dw_status_text_new(char *text, ULONG id)
 {
-	WindowData *blah = calloc(sizeof(WindowData), 1);
-	HWND tmp = WinCreateWindow(HWND_OBJECT,
-							   WC_STATIC,
-							   text,
-							   WS_VISIBLE | SS_TEXT,
-							   0,0,2000,1000,
-							   NULLHANDLE,
-							   HWND_TOP,
-							   id,
-							   NULL,
-							   NULL);
-	blah->oldproc = WinSubclassWindow(tmp, _statusproc);
-	WinSetWindowPtr(tmp, QWP_USER, blah);
-	dw_window_set_font(tmp, DefaultFont);
-	dw_window_set_color(tmp, DW_CLR_BLACK, DW_CLR_PALEGRAY);
-	return tmp;
+   WindowData *blah = calloc(sizeof(WindowData), 1);
+   HWND tmp = WinCreateWindow(HWND_OBJECT,
+                        WC_STATIC,
+                        text,
+                        WS_VISIBLE | SS_TEXT,
+                        0,0,2000,1000,
+                        NULLHANDLE,
+                        HWND_TOP,
+                        id,
+                        NULL,
+                        NULL);
+   blah->oldproc = WinSubclassWindow(tmp, _statusproc);
+   WinSetWindowPtr(tmp, QWP_USER, blah);
+   dw_window_set_font(tmp, DefaultFont);
+   dw_window_set_color(tmp, DW_CLR_BLACK, DW_CLR_PALEGRAY);
+   return tmp;
 }
 
 #ifndef MLS_LIMITVSCROLL
@@ -4616,24 +4616,24 @@
  */
 HWND API dw_mle_new(ULONG id)
 {
-	WindowData *blah = calloc(1, sizeof(WindowData));
-	HWND tmp = WinCreateWindow(HWND_OBJECT,
-							   WC_MLE,
-							   "",
-							   WS_VISIBLE |
-							   MLS_BORDER | MLS_IGNORETAB |
-							   MLS_READONLY | MLS_VSCROLL |
-							   MLS_LIMITVSCROLL,
-							   0,0,2000,1000,
-							   NULLHANDLE,
-							   HWND_TOP,
-							   id,
-							   NULL,
-							   NULL);
-	blah->oldproc = WinSubclassWindow(tmp, _mleproc);
-	WinSetWindowPtr(tmp, QWP_USER, blah);
-	dw_window_set_font(tmp, DefaultFont);
-	return tmp;
+   WindowData *blah = calloc(1, sizeof(WindowData));
+   HWND tmp = WinCreateWindow(HWND_OBJECT,
+                        WC_MLE,
+                        "",
+                        WS_VISIBLE |
+                        MLS_BORDER | MLS_IGNORETAB |
+                        MLS_READONLY | MLS_VSCROLL |
+                        MLS_LIMITVSCROLL,
+                        0,0,2000,1000,
+                        NULLHANDLE,
+                        HWND_TOP,
+                        id,
+                        NULL,
+                        NULL);
+   blah->oldproc = WinSubclassWindow(tmp, _mleproc);
+   WinSetWindowPtr(tmp, QWP_USER, blah);
+   dw_window_set_font(tmp, DefaultFont);
+   return tmp;
 }
 
 /*
@@ -4645,23 +4645,23 @@
 HWND API dw_entryfield_new(char *text, ULONG id)
 {
 
-	WindowData *blah = calloc(1, sizeof(WindowData));
-	HWND tmp = WinCreateWindow(HWND_OBJECT,
-							   WC_ENTRYFIELD,
-							   text,
-							   WS_VISIBLE | ES_MARGIN |
-							   ES_AUTOSCROLL | WS_TABSTOP,
-							   0,0,2000,1000,
-							   NULLHANDLE,
-							   HWND_TOP,
-							   id,
-							   NULL,
-							   NULL);
-	blah->oldproc = WinSubclassWindow(tmp, _entryproc);
-	WinSetWindowPtr(tmp, QWP_USER, blah);
-	dw_window_set_font(tmp, DefaultFont);
-	dw_window_set_color(tmp, DW_CLR_BLACK, DW_CLR_WHITE);
-	return tmp;
+   WindowData *blah = calloc(1, sizeof(WindowData));
+   HWND tmp = WinCreateWindow(HWND_OBJECT,
+                        WC_ENTRYFIELD,
+                        text,
+                        WS_VISIBLE | ES_MARGIN |
+                        ES_AUTOSCROLL | WS_TABSTOP,
+                        0,0,2000,1000,
+                        NULLHANDLE,
+                        HWND_TOP,
+                        id,
+                        NULL,
+                        NULL);
+   blah->oldproc = WinSubclassWindow(tmp, _entryproc);
+   WinSetWindowPtr(tmp, QWP_USER, blah);
+   dw_window_set_font(tmp, DefaultFont);
+   dw_window_set_color(tmp, DW_CLR_BLACK, DW_CLR_WHITE);
+   return tmp;
 }
 
 /*
@@ -4672,23 +4672,23 @@
  */
 HWND API dw_entryfield_password_new(char *text, ULONG id)
 {
-	WindowData *blah = calloc(1, sizeof(WindowData));
-	HWND tmp = WinCreateWindow(HWND_OBJECT,
-							   WC_ENTRYFIELD,
-							   text,
-							   WS_VISIBLE | ES_MARGIN | ES_UNREADABLE |
-							   ES_AUTOSCROLL | WS_TABSTOP,
-							   0,0,2000,1000,
-							   NULLHANDLE,
-							   HWND_TOP,
-							   id,
-							   NULL,
-							   NULL);
-	blah->oldproc = WinSubclassWindow(tmp, _entryproc);
-	WinSetWindowPtr(tmp, QWP_USER, blah);
-	dw_window_set_font(tmp, DefaultFont);
-	dw_window_set_color(tmp, DW_CLR_BLACK, DW_CLR_WHITE);
-	return tmp;
+   WindowData *blah = calloc(1, sizeof(WindowData));
+   HWND tmp = WinCreateWindow(HWND_OBJECT,
+                        WC_ENTRYFIELD,
+                        text,
+                        WS_VISIBLE | ES_MARGIN | ES_UNREADABLE |
+                        ES_AUTOSCROLL | WS_TABSTOP,
+                        0,0,2000,1000,
+                        NULLHANDLE,
+                        HWND_TOP,
+                        id,
+                        NULL,
+                        NULL);
+   blah->oldproc = WinSubclassWindow(tmp, _entryproc);
+   WinSetWindowPtr(tmp, QWP_USER, blah);
+   dw_window_set_font(tmp, DefaultFont);
+   dw_window_set_color(tmp, DW_CLR_BLACK, DW_CLR_WHITE);
+   return tmp;
 }
 
 /*
@@ -4699,38 +4699,38 @@
  */
 HWND API dw_combobox_new(char *text, ULONG id)
 {
-	WindowData *blah = calloc(1, sizeof(WindowData));
-	HWND frame = dw_box_new(DW_HORZ, 0);
-	HWND tmp = WinCreateWindow(frame,
-							   WC_COMBOBOX,
-							   text,
-							   WS_VISIBLE | CBS_DROPDOWN | WS_GROUP,
-							   0,0,2000,1000,
-							   NULLHANDLE,
-							   HWND_TOP,
-							   id,
-							   NULL,
-							   NULL);
-	HENUM henum = WinBeginEnumWindows(tmp);
-	HWND child, last = NULLHANDLE;
-	
-	while((child = WinGetNextWindow(henum)) != NULLHANDLE)
-	{
-		WindowData *moreblah = calloc(1, sizeof(WindowData));
-		moreblah->oldproc = WinSubclassWindow(child, _comboentryproc);
-		WinSetWindowPtr(child, QWP_USER, moreblah);
-		dw_window_set_color(child, DW_CLR_BLACK, DW_CLR_WHITE);
-		last = child;
-	}
-	WinEndEnumWindows(henum);
-	blah->oldproc = WinSubclassWindow(tmp, _comboproc);
-	WinSetWindowPtr(tmp, QWP_USER, blah);
-	dw_window_set_font(tmp, DefaultFont);
-	dw_window_set_color(tmp, DW_CLR_BLACK, DW_CLR_WHITE);
-	dw_window_set_data(tmp, "_dw_comboentry", (void *)last);
-	dw_window_set_data(tmp, "_dw_combo_box", (void *)frame);
-	WinSetOwner(tmp, frame);
-	return tmp;
+   WindowData *blah = calloc(1, sizeof(WindowData));
+   HWND frame = dw_box_new(DW_HORZ, 0);
+   HWND tmp = WinCreateWindow(frame,
+                        WC_COMBOBOX,
+                        text,
+                        WS_VISIBLE | CBS_DROPDOWN | WS_GROUP,
+                        0,0,2000,1000,
+                        NULLHANDLE,
+                        HWND_TOP,
+                        id,
+                        NULL,
+                        NULL);
+   HENUM henum = WinBeginEnumWindows(tmp);
+   HWND child, last = NULLHANDLE;
+
+   while((child = WinGetNextWindow(henum)) != NULLHANDLE)
+   {
+      WindowData *moreblah = calloc(1, sizeof(WindowData));
+      moreblah->oldproc = WinSubclassWindow(child, _comboentryproc);
+      WinSetWindowPtr(child, QWP_USER, moreblah);
+      dw_window_set_color(child, DW_CLR_BLACK, DW_CLR_WHITE);
+      last = child;
+   }
+   WinEndEnumWindows(henum);
+   blah->oldproc = WinSubclassWindow(tmp, _comboproc);
+   WinSetWindowPtr(tmp, QWP_USER, blah);
+   dw_window_set_font(tmp, DefaultFont);
+   dw_window_set_color(tmp, DW_CLR_BLACK, DW_CLR_WHITE);
+   dw_window_set_data(tmp, "_dw_comboentry", (void *)last);
+   dw_window_set_data(tmp, "_dw_combo_box", (void *)frame);
+   WinSetOwner(tmp, frame);
+   return tmp;
 }
 
 /*
@@ -4741,27 +4741,27 @@
  */
 HWND API dw_button_new(char *text, ULONG id)
 {
-	BubbleButton *bubble = calloc(sizeof(BubbleButton), 1);
-
-	HWND tmp = WinCreateWindow(HWND_OBJECT,
-							   WC_BUTTON,
-							   text,
-							   WS_VISIBLE,
-							   0,0,2000,1000,
-							   NULLHANDLE,
-							   HWND_TOP,
-							   id,
-							   NULL,
-							   NULL);
-
-	bubble->id = id;
-	bubble->bubbletext[0] = '\0';
-	bubble->pOldProc = WinSubclassWindow(tmp, _BtProc);
-
-	WinSetWindowPtr(tmp, QWP_USER, bubble);
-	dw_window_set_font(tmp, DefaultFont);
-	dw_window_set_color(tmp, DW_CLR_BLACK, DW_CLR_PALEGRAY);
-	return tmp;
+   BubbleButton *bubble = calloc(sizeof(BubbleButton), 1);
+
+   HWND tmp = WinCreateWindow(HWND_OBJECT,
+                        WC_BUTTON,
+                        text,
+                        WS_VISIBLE,
+                        0,0,2000,1000,
+                        NULLHANDLE,
+                        HWND_TOP,
+                        id,
+                        NULL,
+                        NULL);
+
+   bubble->id = id;
+   bubble->bubbletext[0] = '\0';
+   bubble->pOldProc = WinSubclassWindow(tmp, _BtProc);
+
+   WinSetWindowPtr(tmp, QWP_USER, bubble);
+   dw_window_set_font(tmp, DefaultFont);
+   dw_window_set_color(tmp, DW_CLR_BLACK, DW_CLR_PALEGRAY);
+   return tmp;
 }
 
 /* Function: GenResIDStr
@@ -4771,29 +4771,29 @@
 
 void _GenResIDStr(CHAR *buff, ULONG ulID)
 {
-	char *str;
-	int  slen = 0;
-
-	*buff++ = '#';
-
-	str = buff;
-
-	do
-	{
-		*str++ = (ulID % 10) + '0';
-		ulID /= 10;
-		slen++;
-	}
-	while(ulID);
-
-	*str-- = 0;
-
-	for(; str > buff; str--, buff++)
-	{
-		*buff ^= *str;
-		*str  ^= *buff;
-		*buff ^= *str;
-	}
+   char *str;
+   int  slen = 0;
+
+   *buff++ = '#';
+
+   str = buff;
+
+   do
+   {
+      *str++ = (ulID % 10) + '0';
+      ulID /= 10;
+      slen++;
+   }
+   while(ulID);
+
+   *str-- = 0;
+
+   for(; str > buff; str--, buff++)
+   {
+      *buff ^= *str;
+      *str  ^= *buff;
+      *buff ^= *str;
+   }
 }
 
 
@@ -4805,41 +4805,41 @@
  */
 HWND API dw_bitmapbutton_new(char *text, ULONG id)
 {
-	char idbuf[256], *name = NULL;
-	HWND tmp;
-	BubbleButton *bubble = calloc(sizeof(BubbleButton), 1);
-	HPOINTER icon = WinLoadPointer(HWND_DESKTOP, 0L, id);
-
-	if(!icon)
-	{
-		name = idbuf;
-		_GenResIDStr(idbuf, id);
-	}
-
-	tmp = WinCreateWindow(HWND_OBJECT,
-						  WC_BUTTON,
-						  name,
-						  WS_VISIBLE | BS_PUSHBUTTON |
-						  BS_NOPOINTERFOCUS | BS_AUTOSIZE |
-						  (icon ? 0 : BS_BITMAP),
-						  0,0,2000,1000,
-						  NULLHANDLE,
-						  HWND_TOP,
-						  id,
-						  NULL,
-						  NULL);
-
-	bubble->id = id;
-	strncpy(bubble->bubbletext, text, BUBBLE_HELP_MAX - 1);
-	bubble->bubbletext[BUBBLE_HELP_MAX - 1] = '\0';
-	bubble->pOldProc = WinSubclassWindow(tmp, _BtProc);
-
-	WinSetWindowPtr(tmp, QWP_USER, bubble);
-
-	if(icon)
-		dw_window_set_data(tmp, "_dw_button_icon", (void *)icon);
-	dw_window_set_data(tmp, "_dw_bitmapbutton", (void *)1);
-	return tmp;
+   char idbuf[256], *name = NULL;
+   HWND tmp;
+   BubbleButton *bubble = calloc(sizeof(BubbleButton), 1);
+   HPOINTER icon = WinLoadPointer(HWND_DESKTOP, 0L, id);
+
+   if(!icon)
+   {
+      name = idbuf;
+      _GenResIDStr(idbuf, id);
+   }
+
+   tmp = WinCreateWindow(HWND_OBJECT,
+                    WC_BUTTON,
+                    name,
+                    WS_VISIBLE | BS_PUSHBUTTON |
+                    BS_NOPOINTERFOCUS | BS_AUTOSIZE |
+                    (icon ? 0 : BS_BITMAP),
+                    0,0,2000,1000,
+                    NULLHANDLE,
+                    HWND_TOP,
+                    id,
+                    NULL,
+                    NULL);
+
+   bubble->id = id;
+   strncpy(bubble->bubbletext, text, BUBBLE_HELP_MAX - 1);
+   bubble->bubbletext[BUBBLE_HELP_MAX - 1] = '\0';
+   bubble->pOldProc = WinSubclassWindow(tmp, _BtProc);
+
+   WinSetWindowPtr(tmp, QWP_USER, bubble);
+
+   if(icon)
+      dw_window_set_data(tmp, "_dw_button_icon", (void *)icon);
+   dw_window_set_data(tmp, "_dw_bitmapbutton", (void *)1);
+   return tmp;
 }
 
 /*
@@ -5054,26 +5054,26 @@
  */
 HWND API dw_spinbutton_new(char *text, ULONG id)
 {
-	WindowData *blah = calloc(sizeof(WindowData), 1);
-	HWND tmp = WinCreateWindow(HWND_OBJECT,
-							   WC_SPINBUTTON,
-							   text,
-							   WS_VISIBLE | SPBS_MASTER,
-							   0,0,2000,1000,
-							   NULLHANDLE,
-							   HWND_TOP,
-							   id,
-							   NULL,
-							   NULL);
-	HWND entry = _find_entryfield(tmp);
-	blah->oldproc = WinSubclassWindow(tmp, _entryproc);
-	WinSetWindowPtr(tmp, QWP_USER, blah);
-	blah = calloc(sizeof(WindowData), 1);
-	blah->oldproc = WinSubclassWindow(entry, _spinentryproc);
-	WinSetWindowPtr(entry, QWP_USER, blah);
-	dw_window_set_font(tmp, DefaultFont);
-	dw_window_set_color(entry, DW_CLR_BLACK, DW_CLR_WHITE);
-	return tmp;
+   WindowData *blah = calloc(sizeof(WindowData), 1);
+   HWND tmp = WinCreateWindow(HWND_OBJECT,
+                        WC_SPINBUTTON,
+                        text,
+                        WS_VISIBLE | SPBS_MASTER,
+                        0,0,2000,1000,
+                        NULLHANDLE,
+                        HWND_TOP,
+                        id,
+                        NULL,
+                        NULL);
+   HWND entry = _find_entryfield(tmp);
+   blah->oldproc = WinSubclassWindow(tmp, _entryproc);
+   WinSetWindowPtr(tmp, QWP_USER, blah);
+   blah = calloc(sizeof(WindowData), 1);
+   blah->oldproc = WinSubclassWindow(entry, _spinentryproc);
+   WinSetWindowPtr(entry, QWP_USER, blah);
+   dw_window_set_font(tmp, DefaultFont);
+   dw_window_set_color(entry, DW_CLR_BLACK, DW_CLR_WHITE);
+   return tmp;
 }
 
 /*
@@ -5084,23 +5084,23 @@
  */
 HWND API dw_radiobutton_new(char *text, ULONG id)
 {
-	WindowData *blah = calloc(sizeof(WindowData), 1);
-	HWND tmp = WinCreateWindow(HWND_OBJECT,
-							   WC_BUTTON,
-							   text,
-							   WS_VISIBLE |
-							   BS_AUTORADIOBUTTON,
-							   0,0,2000,1000,
-							   NULLHANDLE,
-							   HWND_TOP,
-							   id,
-							   NULL,
-							   NULL);
-	blah->oldproc = WinSubclassWindow(tmp, _entryproc);
-	WinSetWindowPtr(tmp, QWP_USER, blah);
-	dw_window_set_font(tmp, DefaultFont);
-	dw_window_set_color(tmp, DW_CLR_BLACK, DW_CLR_PALEGRAY);
-	return tmp;
+   WindowData *blah = calloc(sizeof(WindowData), 1);
+   HWND tmp = WinCreateWindow(HWND_OBJECT,
+                        WC_BUTTON,
+                        text,
+                        WS_VISIBLE |
+                        BS_AUTORADIOBUTTON,
+                        0,0,2000,1000,
+                        NULLHANDLE,
+                        HWND_TOP,
+                        id,
+                        NULL,
+                        NULL);
+   blah->oldproc = WinSubclassWindow(tmp, _entryproc);
+   WinSetWindowPtr(tmp, QWP_USER, blah);
+   dw_window_set_font(tmp, DefaultFont);
+   dw_window_set_color(tmp, DW_CLR_BLACK, DW_CLR_PALEGRAY);
+   return tmp;
 }
 
 
@@ -5113,28 +5113,28 @@
  */
 HWND API dw_slider_new(int vertical, int increments, ULONG id)
 {
-	WindowData *blah = calloc(1, sizeof(WindowData));
-	SLDCDATA sldcData = { 0, 0, 0, 0, 0 };
-	HWND tmp;
-
-	sldcData.cbSize = sizeof(SLDCDATA);
+   WindowData *blah = calloc(1, sizeof(WindowData));
+   SLDCDATA sldcData = { 0, 0, 0, 0, 0 };
+   HWND tmp;
+
+   sldcData.cbSize = sizeof(SLDCDATA);
     sldcData.usScale1Increments = increments;
 
-	tmp = WinCreateWindow(HWND_OBJECT,
-						  WC_SLIDER,
-						  "",
-						  WS_VISIBLE | SLS_SNAPTOINCREMENT |
-						  (vertical ? SLS_VERTICAL : SLS_HORIZONTAL),
-						  0,0,2000,1000,
-						  NULLHANDLE,
-						  HWND_TOP,
-						  id,
-						  &sldcData,
-						  NULL);
-
-	blah->oldproc = WinSubclassWindow(tmp, _entryproc);
-	WinSetWindowPtr(tmp, QWP_USER, blah);
-	return tmp;
+   tmp = WinCreateWindow(HWND_OBJECT,
+                    WC_SLIDER,
+                    "",
+                    WS_VISIBLE | SLS_SNAPTOINCREMENT |
+                    (vertical ? SLS_VERTICAL : SLS_HORIZONTAL),
+                    0,0,2000,1000,
+                    NULLHANDLE,
+                    HWND_TOP,
+                    id,
+                    &sldcData,
+                    NULL);
+
+   blah->oldproc = WinSubclassWindow(tmp, _entryproc);
+   WinSetWindowPtr(tmp, QWP_USER, blah);
+   return tmp;
 }
 
 /*
@@ -5146,17 +5146,17 @@
  */
 HWND API dw_scrollbar_new(int vertical, ULONG id)
 {
-	return WinCreateWindow(HWND_OBJECT,
-						   WC_SCROLLBAR,
-						   "",
-						   WS_VISIBLE | SBS_AUTOTRACK |
-						   (vertical ? SBS_VERT : SBS_HORZ),
-						   0,0,2000,1000,
-						   NULLHANDLE,
-						   HWND_TOP,
-						   id ? id : (GlobalID++),
-						   NULL,
-						   NULL);
+   return WinCreateWindow(HWND_OBJECT,
+                     WC_SCROLLBAR,
+                     "",
+                     WS_VISIBLE | SBS_AUTOTRACK |
+                     (vertical ? SBS_VERT : SBS_HORZ),
+                     0,0,2000,1000,
+                     NULLHANDLE,
+                     HWND_TOP,
+                     id ? id : (GlobalID++),
+                     NULL,
+                     NULL);
 }
 
 /*
@@ -5166,22 +5166,22 @@
  */
 HWND API dw_percent_new(ULONG id)
 {
-	WindowData *blah = calloc(1, sizeof(WindowData));
-	HWND tmp = WinCreateWindow(HWND_OBJECT,
-							   WC_SLIDER,
-							   "",
-							   WS_VISIBLE | SLS_READONLY
-							   | SLS_RIBBONSTRIP,
-							   0,0,2000,1000,
-							   NULLHANDLE,
-							   HWND_TOP,
-							   id,
-							   NULL,
-							   NULL);
-	blah->oldproc = WinSubclassWindow(tmp, _percentproc);
-	WinSetWindowPtr(tmp, QWP_USER, blah);
-	dw_window_disable(tmp);
-	return tmp;
+   WindowData *blah = calloc(1, sizeof(WindowData));
+   HWND tmp = WinCreateWindow(HWND_OBJECT,
+                        WC_SLIDER,
+                        "",
+                        WS_VISIBLE | SLS_READONLY
+                        | SLS_RIBBONSTRIP,
+                        0,0,2000,1000,
+                        NULLHANDLE,
+                        HWND_TOP,
+                        id,
+                        NULL,
+                        NULL);
+   blah->oldproc = WinSubclassWindow(tmp, _percentproc);
+   WinSetWindowPtr(tmp, QWP_USER, blah);
+   dw_window_disable(tmp);
+   return tmp;
 }
 
 /*
@@ -5192,24 +5192,24 @@
  */
 HWND API dw_checkbox_new(char *text, ULONG id)
 {
-	BubbleButton *bubble = calloc(sizeof(BubbleButton), 1);
-	HWND tmp = WinCreateWindow(HWND_OBJECT,
-							   WC_BUTTON,
-							   text,
-							   WS_VISIBLE | BS_AUTOCHECKBOX,
-							   0,0,2000,1000,
-							   NULLHANDLE,
-							   HWND_TOP,
-							   id,
-							   NULL,
-							   NULL);
-	bubble->id = id;
-	bubble->bubbletext[0] = '\0';
-	bubble->pOldProc = WinSubclassWindow(tmp, _BtProc);
-	WinSetWindowPtr(tmp, QWP_USER, bubble);
-	dw_window_set_font(tmp, DefaultFont);
-	dw_window_set_color(tmp, DW_CLR_BLACK, DW_CLR_PALEGRAY);
-	return tmp;
+   BubbleButton *bubble = calloc(sizeof(BubbleButton), 1);
+   HWND tmp = WinCreateWindow(HWND_OBJECT,
+                        WC_BUTTON,
+                        text,
+                        WS_VISIBLE | BS_AUTOCHECKBOX,
+                        0,0,2000,1000,
+                        NULLHANDLE,
+                        HWND_TOP,
+                        id,
+                        NULL,
+                        NULL);
+   bubble->id = id;
+   bubble->bubbletext[0] = '\0';
+   bubble->pOldProc = WinSubclassWindow(tmp, _BtProc);
+   WinSetWindowPtr(tmp, QWP_USER, bubble);
+   dw_window_set_font(tmp, DefaultFont);
+   dw_window_set_color(tmp, DW_CLR_BLACK, DW_CLR_PALEGRAY);
+   return tmp;
 }
 
 /*
@@ -5220,23 +5220,23 @@
  */
 HWND API dw_listbox_new(ULONG id, int multi)
 {
-	WindowData *blah = calloc(sizeof(WindowData), 1);
-	HWND tmp = WinCreateWindow(HWND_OBJECT,
-							   WC_LISTBOX,
-							   NULL,
-							   WS_VISIBLE | LS_NOADJUSTPOS |
-							   (multi ? LS_MULTIPLESEL : 0),
-							   0,0,2000,1000,
-							   NULLHANDLE,
-							   HWND_TOP,
-							   id ? id : (GlobalID++),
-							   NULL,
-							   NULL);
-	blah->oldproc = WinSubclassWindow(tmp, _entryproc);
-	WinSetWindowPtr(tmp, QWP_USER, blah);
-	dw_window_set_font(tmp, DefaultFont);
-	dw_window_set_color(tmp, DW_CLR_BLACK, DW_CLR_WHITE);
-	return tmp;
+   WindowData *blah = calloc(sizeof(WindowData), 1);
+   HWND tmp = WinCreateWindow(HWND_OBJECT,
+                        WC_LISTBOX,
+                        NULL,
+                        WS_VISIBLE | LS_NOADJUSTPOS |
+                        (multi ? LS_MULTIPLESEL : 0),
+                        0,0,2000,1000,
+                        NULLHANDLE,
+                        HWND_TOP,
+                        id ? id : (GlobalID++),
+                        NULL,
+                        NULL);
+   blah->oldproc = WinSubclassWindow(tmp, _entryproc);
+   WinSetWindowPtr(tmp, QWP_USER, blah);
+   dw_window_set_font(tmp, DefaultFont);
+   dw_window_set_color(tmp, DW_CLR_BLACK, DW_CLR_WHITE);
+   return tmp;
 }
 
 /*
@@ -5247,8 +5247,8 @@
  */
 void API dw_window_set_icon(HWND handle, ULONG id)
 {
-	HPOINTER icon = id < 65536 ? WinLoadPointer(HWND_DESKTOP,NULLHANDLE,id) : (HPOINTER)id;
-	WinSendMsg(handle, WM_SETICON, (MPARAM)icon, 0);
+   HPOINTER icon = id < 65536 ? WinLoadPointer(HWND_DESKTOP,NULLHANDLE,id) : (HPOINTER)id;
+   WinSendMsg(handle, WM_SETICON, (MPARAM)icon, 0);
 }
 
 /* Internal function to load a bitmap from a file and return handles
@@ -5256,104 +5256,104 @@
  */
 int _load_bitmap_file(char *file, HWND handle, HBITMAP *hbm, HDC *hdc, HPS *hps, unsigned long *width, unsigned long *height)
 {
-	HFILE BitmapFileHandle = NULLHANDLE; /* handle for the file */
-	ULONG OpenAction = 0;
-	PBYTE BitmapFileBegin; /* pointer to the first byte of bitmap data  */
-	FILESTATUS BitmapStatus;
-	ULONG cbRead;
-	PBITMAPFILEHEADER2 pBitmapFileHeader;
-	PBITMAPINFOHEADER2 pBitmapInfoHeader;
-	ULONG ScanLines, ulFlags;
-	HPS hps1;
-	HDC hdc1;
-	SIZEL sizl = { 0, 0 };
-
-	/* open bitmap file */
-	DosOpen(file, &BitmapFileHandle, &OpenAction, 0L,
-			FILE_ARCHIVED | FILE_NORMAL | FILE_READONLY,
-			OPEN_ACTION_FAIL_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS,
-			OPEN_SHARE_DENYNONE | OPEN_ACCESS_READONLY |
-			OPEN_FLAGS_NOINHERIT, 0L);
-
-	if(!BitmapFileHandle)
-		return 0;
-
-	/* find out how big the file is  */
-	DosQueryFileInfo(BitmapFileHandle, 1, &BitmapStatus,
-					 sizeof(BitmapStatus));
-
-	/* allocate memory to load the bitmap */
-	DosAllocMem((PPVOID)&BitmapFileBegin, (ULONG)BitmapStatus.cbFile,
-				PAG_READ | PAG_WRITE | PAG_COMMIT);
-
-	/* read bitmap file into memory buffer */
-	DosRead(BitmapFileHandle, (PVOID)BitmapFileBegin,
-			BitmapStatus.cbFile, &cbRead);
-
-	/* access first bytes as bitmap header */
-	pBitmapFileHeader = (PBITMAPFILEHEADER2)BitmapFileBegin;
-
-	/* check if it's a valid bitmap data file */
-	if((pBitmapFileHeader->usType != BFT_BITMAPARRAY) &&
-	   (pBitmapFileHeader->usType != BFT_BMAP))
-	{
-		/* free memory of bitmap file buffer */
-		DosFreeMem(BitmapFileBegin);
-		/* close the bitmap file */
-		DosClose(BitmapFileHandle);
-		return 0;
-	}
-
-	/* check if it's a file with multiple bitmaps */
-	if(pBitmapFileHeader->usType == BFT_BITMAPARRAY)
-	{
-		/* we'll just use the first bitmap and ignore the others */
-		pBitmapFileHeader = &(((PBITMAPARRAYFILEHEADER2)BitmapFileBegin)->bfh2);
-	}
-
-	/* set pointer to bitmap information block */
-	pBitmapInfoHeader = &pBitmapFileHeader->bmp2;
-
-	/* find out if it's the new 2.0 format or the old format */
-	/* and query number of lines */
-	if(pBitmapInfoHeader->cbFix == sizeof(BITMAPINFOHEADER))
-	{
-		*height = ScanLines = (ULONG)((PBITMAPINFOHEADER)pBitmapInfoHeader)->cy;
-		*width = (ULONG)((PBITMAPINFOHEADER)pBitmapInfoHeader)->cx;
-	}
-	else
-	{
-		*height = ScanLines = pBitmapInfoHeader->cy;
-		*width = pBitmapInfoHeader->cx;
-	}
-
-	/* now we need a presentation space, get it from static control */
-	hps1 = WinGetPS(handle);
-
-	hdc1    = GpiQueryDevice(hps1);
-	ulFlags = GpiQueryPS(hps1, &sizl);
-
-	*hdc = DevOpenDC(dwhab, OD_MEMORY, "*", 0L, NULL, hdc1);
-	*hps = GpiCreatePS (dwhab, *hdc, &sizl, ulFlags | GPIA_ASSOC);
-
-	/* create bitmap now using the parameters from the info block */
-	*hbm = GpiCreateBitmap(*hps, pBitmapInfoHeader, 0L, NULL, NULL);
-
-	/* select the new bitmap into presentation space */
-	GpiSetBitmap(*hps, *hbm);
-
-	/* now copy the bitmap data into the bitmap */
-	GpiSetBitmapBits(*hps, 0L, ScanLines,
-					 BitmapFileBegin + pBitmapFileHeader->offBits,
-					 (PBITMAPINFO2)pBitmapInfoHeader);
-
-	WinReleasePS(hps1);
-
-	/* free memory of bitmap file buffer */
-	DosFreeMem(BitmapFileBegin);
-	/* close the bitmap file */
-	DosClose(BitmapFileHandle);
-	return 1;
+   HFILE BitmapFileHandle = NULLHANDLE; /* handle for the file */
+   ULONG OpenAction = 0;
+   PBYTE BitmapFileBegin; /* pointer to the first byte of bitmap data  */
+   FILESTATUS BitmapStatus;
+   ULONG cbRead;
+   PBITMAPFILEHEADER2 pBitmapFileHeader;
+   PBITMAPINFOHEADER2 pBitmapInfoHeader;
+   ULONG ScanLines, ulFlags;
+   HPS hps1;
+   HDC hdc1;
+   SIZEL sizl = { 0, 0 };
+
+   /* open bitmap file */
+   DosOpen(file, &BitmapFileHandle, &OpenAction, 0L,
+         FILE_ARCHIVED | FILE_NORMAL | FILE_READONLY,
+         OPEN_ACTION_FAIL_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS,
+         OPEN_SHARE_DENYNONE | OPEN_ACCESS_READONLY |
+         OPEN_FLAGS_NOINHERIT, 0L);
+
+   if(!BitmapFileHandle)
+      return 0;
+
+   /* find out how big the file is  */
+   DosQueryFileInfo(BitmapFileHandle, 1, &BitmapStatus,
+                sizeof(BitmapStatus));
+
+   /* allocate memory to load the bitmap */
+   DosAllocMem((PPVOID)&BitmapFileBegin, (ULONG)BitmapStatus.cbFile,
+            PAG_READ | PAG_WRITE | PAG_COMMIT);
+
+   /* read bitmap file into memory buffer */
+   DosRead(BitmapFileHandle, (PVOID)BitmapFileBegin,
+         BitmapStatus.cbFile, &cbRead);
+
+   /* access first bytes as bitmap header */
+   pBitmapFileHeader = (PBITMAPFILEHEADER2)BitmapFileBegin;
+
+   /* check if it's a valid bitmap data file */
+   if((pBitmapFileHeader->usType != BFT_BITMAPARRAY) &&
+      (pBitmapFileHeader->usType != BFT_BMAP))
+   {
+      /* free memory of bitmap file buffer */
+      DosFreeMem(BitmapFileBegin);
+      /* close the bitmap file */
+      DosClose(BitmapFileHandle);
+      return 0;
+   }
+
+   /* check if it's a file with multiple bitmaps */
+   if(pBitmapFileHeader->usType == BFT_BITMAPARRAY)
+   {
+      /* we'll just use the first bitmap and ignore the others */
+      pBitmapFileHeader = &(((PBITMAPARRAYFILEHEADER2)BitmapFileBegin)->bfh2);
+   }
+
+   /* set pointer to bitmap information block */
+   pBitmapInfoHeader = &pBitmapFileHeader->bmp2;
+
+   /* find out if it's the new 2.0 format or the old format */
+   /* and query number of lines */
+   if(pBitmapInfoHeader->cbFix == sizeof(BITMAPINFOHEADER))
+   {
+      *height = ScanLines = (ULONG)((PBITMAPINFOHEADER)pBitmapInfoHeader)->cy;
+      *width = (ULONG)((PBITMAPINFOHEADER)pBitmapInfoHeader)->cx;
+   }
+   else
+   {
+      *height = ScanLines = pBitmapInfoHeader->cy;
+      *width = pBitmapInfoHeader->cx;
+   }
+
+   /* now we need a presentation space, get it from static control */
+   hps1 = WinGetPS(handle);
+
+   hdc1    = GpiQueryDevice(hps1);
+   ulFlags = GpiQueryPS(hps1, &sizl);
+
+   *hdc = DevOpenDC(dwhab, OD_MEMORY, "*", 0L, NULL, hdc1);
+   *hps = GpiCreatePS (dwhab, *hdc, &sizl, ulFlags | GPIA_ASSOC);
+
+   /* create bitmap now using the parameters from the info block */
+   *hbm = GpiCreateBitmap(*hps, pBitmapInfoHeader, 0L, NULL, NULL);
+
+   /* select the new bitmap into presentation space */
+   GpiSetBitmap(*hps, *hbm);
+
+   /* now copy the bitmap data into the bitmap */
+   GpiSetBitmapBits(*hps, 0L, ScanLines,
+                BitmapFileBegin + pBitmapFileHeader->offBits,
+                (PBITMAPINFO2)pBitmapInfoHeader);
+
+   WinReleasePS(hps1);
+
+   /* free memory of bitmap file buffer */
+   DosFreeMem(BitmapFileBegin);
+   /* close the bitmap file */
+   DosClose(BitmapFileHandle);
+   return 1;
 }
 
 /*
@@ -5496,7 +5496,7 @@
  */
 void API dw_window_set_text(HWND handle, char *text)
 {
-	WinSetWindowText(handle, text);
+   WinSetWindowText(handle, text);
 }
 
 /*
@@ -5508,12 +5508,12 @@
  */
 char * API dw_window_get_text(HWND handle)
 {
-	int len = WinQueryWindowTextLength(handle);
-	char *tempbuf = calloc(1, len + 2);
-
-	WinQueryWindowText(handle, len + 1, tempbuf);
-
-	return tempbuf;
+   int len = WinQueryWindowTextLength(handle);
+   char *tempbuf = calloc(1, len + 2);
+
+   WinQueryWindowText(handle, len + 1, tempbuf);
+
+   return tempbuf;
 }
 
 /*
@@ -5523,47 +5523,47 @@
  */
 void API dw_window_disable(HWND handle)
 {
-	char tmpbuf[100];
-
-	if(dw_window_get_data(handle, "_dw_disabled"))
-		return;
-
-	WinQueryClassName(handle, 99, tmpbuf);
-	dw_window_set_data(handle, "_dw_disabled", (void *)1);
-
-	if(tmpbuf[0] == '#')
-	{
-		int val = atoi(&tmpbuf[1]);
-		HWND hwnd;
-
-		switch(val)
-		{
-		case 2:
-		case 6:
-		case 10:
-		case 32:
-		case 7:
-			hwnd = _find_entryfield(handle);
-			_dw_window_set_color(hwnd ? hwnd : handle, DW_CLR_BLACK, DW_CLR_PALEGRAY);
-			dw_signal_connect(hwnd ? hwnd : handle, DW_SIGNAL_KEY_PRESS, DW_SIGNAL_FUNC(_null_key), (void *)100);
+   char tmpbuf[100];
+
+   if(dw_window_get_data(handle, "_dw_disabled"))
+      return;
+
+   WinQueryClassName(handle, 99, tmpbuf);
+   dw_window_set_data(handle, "_dw_disabled", (void *)1);
+
+   if(tmpbuf[0] == '#')
+   {
+      int val = atoi(&tmpbuf[1]);
+      HWND hwnd;
+
+      switch(val)
+      {
+      case 2:
+      case 6:
+      case 10:
+      case 32:
+      case 7:
+         hwnd = _find_entryfield(handle);
+         _dw_window_set_color(hwnd ? hwnd : handle, DW_CLR_BLACK, DW_CLR_PALEGRAY);
+         dw_signal_connect(hwnd ? hwnd : handle, DW_SIGNAL_KEY_PRESS, DW_SIGNAL_FUNC(_null_key), (void *)100);
             if(val == 2)
-				dw_signal_connect(handle, DW_SIGNAL_BUTTON_PRESS, DW_SIGNAL_FUNC(_null_key), (void *)100);
-			if(hwnd)
-				dw_window_set_data(hwnd, "_dw_disabled", (void *)1);
-			return;
-		case 3:
-			if(dw_window_get_data(handle, "_dw_bitmapbutton") && !dw_window_get_data(handle, "_dw_hpixmap"))
-				WinEnableWindow(handle, FALSE);
-			else if(dw_window_get_data(handle, "_dw_bitmapbutton") && dw_window_get_data(handle, "_dw_hpixmap_disabled"))
-				WinInvalidateRect(handle, NULL, FALSE);
-			else
-				_dw_window_set_color(handle, DW_CLR_DARKGRAY, DW_CLR_PALEGRAY);
-			dw_signal_connect(handle, DW_SIGNAL_KEY_PRESS, DW_SIGNAL_FUNC(_null_key), (void *)100);
-			dw_signal_connect(handle, DW_SIGNAL_BUTTON_PRESS, DW_SIGNAL_FUNC(_null_key), (void *)100);
-			return;
-		}
-	}
-	WinEnableWindow(handle, FALSE);
+            dw_signal_connect(handle, DW_SIGNAL_BUTTON_PRESS, DW_SIGNAL_FUNC(_null_key), (void *)100);
+         if(hwnd)
+            dw_window_set_data(hwnd, "_dw_disabled", (void *)1);
+         return;
+      case 3:
+         if(dw_window_get_data(handle, "_dw_bitmapbutton") && !dw_window_get_data(handle, "_dw_hpixmap"))
+            WinEnableWindow(handle, FALSE);
+         else if(dw_window_get_data(handle, "_dw_bitmapbutton") && dw_window_get_data(handle, "_dw_hpixmap_disabled"))
+            WinInvalidateRect(handle, NULL, FALSE);
+         else
+            _dw_window_set_color(handle, DW_CLR_DARKGRAY, DW_CLR_PALEGRAY);
+         dw_signal_connect(handle, DW_SIGNAL_KEY_PRESS, DW_SIGNAL_FUNC(_null_key), (void *)100);
+         dw_signal_connect(handle, DW_SIGNAL_BUTTON_PRESS, DW_SIGNAL_FUNC(_null_key), (void *)100);
+         return;
+      }
+   }
+   WinEnableWindow(handle, FALSE);
 }
 
 /*
@@ -5573,19 +5573,19 @@
  */
 void API dw_window_enable(HWND handle)
 {
-	ULONG fore = (ULONG)dw_window_get_data(handle, "_dw_fore");
-	ULONG back = (ULONG)dw_window_get_data(handle, "_dw_back");
-	HWND hwnd = _find_entryfield(handle);
-
-	dw_window_set_data(handle, "_dw_disabled", 0);
-	if(hwnd)
-		dw_window_set_data(hwnd, "_dw_disabled", 0);
-	if(fore && back)
-		_dw_window_set_color(hwnd ? hwnd : handle, fore-1, back-1);
-	dw_signal_disconnect_by_data(handle, (void *)100);
-	WinEnableWindow(handle, TRUE);
-	if(dw_window_get_data(handle, "_dw_bitmapbutton") && dw_window_get_data(handle, "_dw_hpixmap_disabled"))
-		WinInvalidateRect(handle, NULL, FALSE);
+   ULONG fore = (ULONG)dw_window_get_data(handle, "_dw_fore");
+   ULONG back = (ULONG)dw_window_get_data(handle, "_dw_back");
+   HWND hwnd = _find_entryfield(handle);
+
+   dw_window_set_data(handle, "_dw_disabled", 0);
+   if(hwnd)
+      dw_window_set_data(hwnd, "_dw_disabled", 0);
+   if(fore && back)
+      _dw_window_set_color(hwnd ? hwnd : handle, fore-1, back-1);
+   dw_signal_disconnect_by_data(handle, (void *)100);
+   WinEnableWindow(handle, TRUE);
+   if(dw_window_get_data(handle, "_dw_bitmapbutton") && dw_window_get_data(handle, "_dw_hpixmap_disabled"))
+      WinInvalidateRect(handle, NULL, FALSE);
 }
 
 /*
@@ -5596,31 +5596,31 @@
  */
 HWND API dw_window_from_id(HWND handle, int id)
 {
-	HENUM henum;
-	HWND child;
-	char tmpbuf[100];
-
-	henum = WinBeginEnumWindows(handle);
-	while((child = WinGetNextWindow(henum)) != NULLHANDLE)
-	{
-		int windowid = WinQueryWindowUShort(child, QWS_ID);
-		HWND found;
-
-		WinQueryClassName(child, 99, tmpbuf);
-
-		/* If the child is a box (frame) then recurse into it */
-		if(strncmp(tmpbuf, "#1", 3)==0)
-			if((found = dw_window_from_id(child, id)) != NULLHANDLE)
-				return found;
-
-		if(windowid && windowid == id)
-		{
-			WinEndEnumWindows(henum);
-			return child;
-		}
-	}
-	WinEndEnumWindows(henum);
-	return NULLHANDLE;
+   HENUM henum;
+   HWND child;
+   char tmpbuf[100];
+
+   henum = WinBeginEnumWindows(handle);
+   while((child = WinGetNextWindow(henum)) != NULLHANDLE)
+   {
+      int windowid = WinQueryWindowUShort(child, QWS_ID);
+      HWND found;
+
+      WinQueryClassName(child, 99, tmpbuf);
+
+      /* If the child is a box (frame) then recurse into it */
+      if(strncmp(tmpbuf, "#1", 3)==0)
+         if((found = dw_window_from_id(child, id)) != NULLHANDLE)
+            return found;
+
+      if(windowid && windowid == id)
+      {
+         WinEndEnumWindows(henum);
+         return child;
+      }
+   }
+   WinEndEnumWindows(henum);
+   return NULLHANDLE;
 }
 
 /*
@@ -5636,91 +5636,91 @@
  */
 void API dw_box_pack_end(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad)
 {
-	char *funcname = "dw_box_pack_end()";
-
-		/*
-		 * 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(funcname, DW_MB_OK|DW_MB_ERROR, "Danger! Danger! Will Robinson; box and item are the same!");
-		return;
-	}
-
-	if(WinWindowFromID(box, FID_CLIENT))
-	{
-		box = WinWindowFromID(box, FID_CLIENT);
-		hsize = TRUE;
-		vsize = TRUE;
-	}
-	_dw_box_pack_end(box, item, width, height, hsize, vsize, pad, funcname);
+   char *funcname = "dw_box_pack_end()";
+
+      /*
+       * 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(funcname, DW_MB_OK|DW_MB_ERROR, "Danger! Danger! Will Robinson; box and item are the same!");
+      return;
+   }
+
+   if(WinWindowFromID(box, FID_CLIENT))
+   {
+      box = WinWindowFromID(box, FID_CLIENT);
+      hsize = TRUE;
+      vsize = TRUE;
+   }
+   _dw_box_pack_end(box, item, width, height, hsize, vsize, pad, funcname);
 }
 
 void _dw_box_pack_end(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad, char *functionname)
 {
-	Box *thisbox = WinQueryWindowPtr(box, QWP_USER);
-
-	if(thisbox)
-	{
-		int z;
-		Item *tmpitem, *thisitem = thisbox->items;
-		char tmpbuf[100];
-		HWND frame = (HWND)dw_window_get_data(item, "_dw_combo_box");
-
-		tmpitem = malloc(sizeof(Item)*(thisbox->count+1));
-
-		for(z=0;z<thisbox->count;z++)
-		{
-			tmpitem[z+1] = thisitem[z];
-		}
-
-		WinQueryClassName(item, 99, tmpbuf);
-
-		if(vsize && !height)
-			height = 1;
-		if(hsize && !width)
-			width = 1;
-
-		if(strncmp(tmpbuf, "#1", 3)==0)
-			tmpitem[0].type = TYPEBOX;
-		else
-		{
-			if ( width == 0 && hsize == FALSE )
-				dw_messagebox(functionname, 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(functionname, DW_MB_OK|DW_MB_ERROR, "Height and expand Vertical both unset for box: %x item: %x",box,item);
-
-			tmpitem[0].type = TYPEITEM;
-		}
-
-		tmpitem[0].hwnd = item;
-		tmpitem[0].origwidth = tmpitem[0].width = width;
-		tmpitem[0].origheight = tmpitem[0].height = height;
-		tmpitem[0].pad = pad;
-		if(hsize)
-			tmpitem[0].hsize = SIZEEXPAND;
-		else
-			tmpitem[0].hsize = SIZESTATIC;
-
-		if(vsize)
-			tmpitem[0].vsize = SIZEEXPAND;
-		else
-			tmpitem[0].vsize = SIZESTATIC;
-
-		thisbox->items = tmpitem;
-
-		if(thisbox->count)
-			free(thisitem);
-
-		thisbox->count++;
-
-		WinQueryClassName(item, 99, tmpbuf);
-		/* Don't set the ownership if it's an entryfield or spinbutton */
-		if(strncmp(tmpbuf, "#6", 3)!=0 && strncmp(tmpbuf, "#32", 4)!=0 && strncmp(tmpbuf, "#2", 3)!=0)
-			WinSetOwner(item, box);
-		WinSetParent(frame ? frame : item, box, FALSE);
-	}
+   Box *thisbox = WinQueryWindowPtr(box, QWP_USER);
+
+   if(thisbox)
+   {
+      int z;
+      Item *tmpitem, *thisitem = thisbox->items;
+      char tmpbuf[100];
+      HWND frame = (HWND)dw_window_get_data(item, "_dw_combo_box");
+
+      tmpitem = malloc(sizeof(Item)*(thisbox->count+1));
+
+      for(z=0;z<thisbox->count;z++)
+      {
+         tmpitem[z+1] = thisitem[z];
+      }
+
+      WinQueryClassName(item, 99, tmpbuf);
+
+      if(vsize && !height)
+         height = 1;
+      if(hsize && !width)
+         width = 1;
+
+      if(strncmp(tmpbuf, "#1", 3)==0)
+         tmpitem[0].type = TYPEBOX;
+      else
+      {
+         if ( width == 0 && hsize == FALSE )
+            dw_messagebox(functionname, 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(functionname, DW_MB_OK|DW_MB_ERROR, "Height and expand Vertical both unset for box: %x item: %x",box,item);
+
+         tmpitem[0].type = TYPEITEM;
+      }
+
+      tmpitem[0].hwnd = item;
+      tmpitem[0].origwidth = tmpitem[0].width = width;
+      tmpitem[0].origheight = tmpitem[0].height = height;
+      tmpitem[0].pad = pad;
+      if(hsize)
+         tmpitem[0].hsize = SIZEEXPAND;
+      else
+         tmpitem[0].hsize = SIZESTATIC;
+
+      if(vsize)
+         tmpitem[0].vsize = SIZEEXPAND;
+      else
+         tmpitem[0].vsize = SIZESTATIC;
+
+      thisbox->items = tmpitem;
+
+      if(thisbox->count)
+         free(thisitem);
+
+      thisbox->count++;
+
+      WinQueryClassName(item, 99, tmpbuf);
+      /* Don't set the ownership if it's an entryfield or spinbutton */
+      if(strncmp(tmpbuf, "#6", 3)!=0 && strncmp(tmpbuf, "#32", 4)!=0 && strncmp(tmpbuf, "#2", 3)!=0)
+         WinSetOwner(item, box);
+      WinSetParent(frame ? frame : item, box, FALSE);
+   }
 }
 
 /*
@@ -5732,7 +5732,7 @@
  */
 void API dw_window_set_size(HWND handle, ULONG width, ULONG height)
 {
-	WinSetWindowPos(handle, NULLHANDLE, 0, 0, width, height, SWP_SHOW | SWP_SIZE);
+   WinSetWindowPos(handle, NULLHANDLE, 0, 0, width, height, SWP_SHOW | SWP_SIZE);
 }
 
 /*
@@ -5740,7 +5740,7 @@
  */
 int API dw_screen_width(void)
 {
-	return WinQuerySysValue(HWND_DESKTOP,SV_CXSCREEN);
+   return WinQuerySysValue(HWND_DESKTOP,SV_CXSCREEN);
 }
 
 /*
@@ -5748,18 +5748,18 @@
  */
 int API dw_screen_height(void)
 {
-	return WinQuerySysValue(HWND_DESKTOP,SV_CYSCREEN);
+   return WinQuerySysValue(HWND_DESKTOP,SV_CYSCREEN);
 }
 
 /* This should return the current color depth */
 unsigned long API dw_color_depth_get(void)
 {
-	HDC hdc = WinOpenWindowDC(HWND_DESKTOP);
-	long colors;
-
-	DevQueryCaps(hdc, CAPS_COLOR_BITCOUNT, 1, &colors);
-	DevCloseDC(hdc);
-	return colors;
+   HDC hdc = WinOpenWindowDC(HWND_DESKTOP);
+   long colors;
+
+   DevQueryCaps(hdc, CAPS_COLOR_BITCOUNT, 1, &colors);
+   DevCloseDC(hdc);
+   return colors;
 }
 
 
@@ -5772,9 +5772,9 @@
  */
 void API dw_window_set_pos(HWND handle, LONG x, LONG y)
 {
-	int myy = _get_frame_height(handle) - (y + _get_height(handle));
-
-	WinSetWindowPos(handle, NULLHANDLE, x, myy, 0, 0, SWP_MOVE);
+   int myy = _get_frame_height(handle) - (y + _get_height(handle));
+
+   WinSetWindowPos(handle, NULLHANDLE, x, myy, 0, 0, SWP_MOVE);
 }
 
 /*
@@ -5788,9 +5788,9 @@
  */
 void API dw_window_set_pos_size(HWND handle, LONG x, LONG y, ULONG width, ULONG height)
 {
-	int myy = _get_frame_height(handle) - (y + height);
-
-	WinSetWindowPos(handle, NULLHANDLE, x, myy, width, height, SWP_MOVE | SWP_SIZE | SWP_SHOW);
+   int myy = _get_frame_height(handle) - (y + height);
+
+   WinSetWindowPos(handle, NULLHANDLE, x, myy, width, height, SWP_MOVE | SWP_SIZE | SWP_SHOW);
 }
 
 /*
@@ -5804,16 +5804,16 @@
  */
 void API dw_window_get_pos_size(HWND handle, LONG *x, LONG *y, ULONG *width, ULONG *height)
 {
-	SWP swp;
-	WinQueryWindowPos(handle, &swp);
-	if(x)
-		*x = swp.x;
-	if(y)
-		*y = _get_frame_height(handle) - (swp.y + swp.cy);
-	if(width)
-		*width = swp.cx;
-	if(height)
-		*height = swp.cy;
+   SWP swp;
+   WinQueryWindowPos(handle, &swp);
+   if(x)
+      *x = swp.x;
+   if(y)
+      *y = _get_frame_height(handle) - (swp.y + swp.cy);
+   if(width)
+      *width = swp.cx;
+   if(height)
+      *height = swp.cy;
 }
 
 /*
@@ -5825,7 +5825,7 @@
  */
 void API dw_window_set_style(HWND handle, ULONG style, ULONG mask)
 {
-	WinSetWindowBits(handle, QWL_STYLE, style, mask);
+   WinSetWindowBits(handle, QWL_STYLE, style, mask);
 }
 
 /*
@@ -5837,8 +5837,8 @@
  */
 unsigned long API dw_notebook_page_new(HWND handle, ULONG flags, int front)
 {
-	return (ULONG)WinSendMsg(handle, BKM_INSERTPAGE, 0L,
-							 MPFROM2SHORT((BKA_STATUSTEXTON | BKA_AUTOPAGESIZE | BKA_MAJOR | flags), front ? BKA_FIRST : BKA_LAST));
+   return (ULONG)WinSendMsg(handle, BKM_INSERTPAGE, 0L,
+                      MPFROM2SHORT((BKA_STATUSTEXTON | BKA_AUTOPAGESIZE | BKA_MAJOR | flags), front ? BKA_FIRST : BKA_LAST));
 }
 
 /*
@@ -5849,8 +5849,8 @@
  */
 void API dw_notebook_page_destroy(HWND handle, unsigned int pageid)
 {
-	WinSendMsg(handle, BKM_DELETEPAGE,
-			   MPFROMLONG(pageid),	(MPARAM)BKA_SINGLE);
+   WinSendMsg(handle, BKM_DELETEPAGE,
+            MPFROMLONG(pageid),  (MPARAM)BKA_SINGLE);
 }
 
 /*
@@ -5860,7 +5860,7 @@
  */
 unsigned long API dw_notebook_page_get(HWND handle)
 {
-	return (unsigned long)WinSendMsg(handle, BKM_QUERYPAGEID,0L, MPFROM2SHORT(BKA_TOP, BKA_MAJOR));
+   return (unsigned long)WinSendMsg(handle, BKM_QUERYPAGEID,0L, MPFROM2SHORT(BKA_TOP, BKA_MAJOR));
 }
 
 /*
@@ -5871,7 +5871,7 @@
  */
 void API dw_notebook_page_set(HWND handle, unsigned int pageid)
 {
-	WinSendMsg(handle, BKM_TURNTOPAGE, MPFROMLONG(pageid), 0L);
+   WinSendMsg(handle, BKM_TURNTOPAGE, MPFROMLONG(pageid), 0L);
 }
 
 /*
@@ -5883,8 +5883,8 @@
  */
 void API dw_notebook_page_set_text(HWND handle, ULONG pageid, char *text)
 {
-	WinSendMsg(handle, BKM_SETTABTEXT,
-			   MPFROMLONG(pageid),	MPFROMP(text));
+   WinSendMsg(handle, BKM_SETTABTEXT,
+            MPFROMLONG(pageid),  MPFROMP(text));
 }
 
 /*
@@ -5896,8 +5896,8 @@
  */
 void API dw_notebook_page_set_status_text(HWND handle, ULONG pageid, char *text)
 {
-	WinSendMsg(handle, BKM_SETSTATUSLINETEXT,
-			   MPFROMLONG(pageid),	MPFROMP(text));
+   WinSendMsg(handle, BKM_SETSTATUSLINETEXT,
+            MPFROMLONG(pageid),  MPFROMP(text));
 }
 
 /*
@@ -5909,12 +5909,12 @@
  */
 void API dw_notebook_pack(HWND handle, ULONG pageid, HWND page)
 {
-	HWND tmpbox = dw_box_new(DW_VERT, 0);
-
-	dw_box_pack_start(tmpbox, page, 0, 0, TRUE, TRUE, 0);
-	WinSubclassWindow(tmpbox, _wndproc);
-	WinSendMsg(handle, BKM_SETPAGEWINDOWHWND,
-			   MPFROMLONG(pageid),	MPFROMHWND(tmpbox));
+   HWND tmpbox = dw_box_new(DW_VERT, 0);
+
+   dw_box_pack_start(tmpbox, page, 0, 0, TRUE, TRUE, 0);
+   WinSubclassWindow(tmpbox, _wndproc);
+   WinSendMsg(handle, BKM_SETPAGEWINDOWHWND,
+            MPFROMLONG(pageid),  MPFROMHWND(tmpbox));
 }
 
 /*
@@ -5925,10 +5925,25 @@
  */
 void API dw_listbox_append(HWND handle, char *text)
 {
-	WinSendMsg(handle,
-			   LM_INSERTITEM,
-			   MPFROMSHORT(LIT_END),
-			   MPFROMP(text));
+   WinSendMsg(handle,
+            LM_INSERTITEM,
+            MPFROMSHORT(LIT_END),
+            MPFROMP(text));
+}
+
+/*
+ * Inserts the specified text into the listbox's (or combobox) entry list.
+ * Parameters:
+ *          handle: Handle to the listbox to be inserted into.
+ *          text: Text to insert into listbox.
+ *          pos: 0-based position to insert text
+ */
+void API dw_listbox_insert(HWND handle, char *text, int pos)
+{
+   WinSendMsg(handle,
+            LM_INSERTITEM,
+            MPFROMSHORT(pos),
+            MPFROMP(text));
 }
 
 /*
@@ -5940,12 +5955,12 @@
  */
 void API dw_listbox_list_append(HWND handle, char **text, int count)
 {
-	int i;
-	for(i=0;i<count;i++)
-		WinSendMsg(handle,
-				   LM_INSERTITEM,
-				   MPFROMSHORT(LIT_END),
-				   MPFROMP(text[i]));
+   int i;
+   for(i=0;i<count;i++)
+      WinSendMsg(handle,
+               LM_INSERTITEM,
+               MPFROMSHORT(LIT_END),
+               MPFROMP(text[i]));
 }
 
 /*
@@ -5955,8 +5970,8 @@
  */
 void API dw_listbox_clear(HWND handle)
 {
-	WinSendMsg(handle,
-			   LM_DELETEALL, 0L, 0L);
+   WinSendMsg(handle,
+            LM_DELETEALL, 0L, 0L);
 }
 
 /*
@@ -5966,8 +5981,8 @@
  */
 int API dw_listbox_count(HWND handle)
 {
-	return (int)WinSendMsg(handle,
-						   LM_QUERYITEMCOUNT,0L, 0L);
+   return (int)WinSendMsg(handle,
+                     LM_QUERYITEMCOUNT,0L, 0L);
 }
 
 /*
@@ -5978,10 +5993,10 @@
  */
 void API dw_listbox_set_top(HWND handle, int top)
 {
-	WinSendMsg(handle,
-			   LM_SETTOPINDEX,
-			   MPFROMSHORT(top),
-			   0L);
+   WinSendMsg(handle,
+            LM_SETTOPINDEX,
+            MPFROMSHORT(top),
+            0L);
 }
 
 /*
@@ -5994,7 +6009,7 @@
  */
 void API dw_listbox_get_text(HWND handle, unsigned int index, char *buffer, unsigned int length)
 {
-	WinSendMsg(handle, LM_QUERYITEMTEXT, MPFROM2SHORT(index, length), (MPARAM)buffer);
+   WinSendMsg(handle, LM_QUERYITEMTEXT, MPFROM2SHORT(index, length), (MPARAM)buffer);
 }
 
 /*
@@ -6006,7 +6021,7 @@
  */
 void API dw_listbox_set_text(HWND handle, unsigned int index, char *buffer)
 {
-	WinSendMsg(handle, LM_SETITEMTEXT, MPFROMSHORT(index), (MPARAM)buffer);
+   WinSendMsg(handle, LM_SETITEMTEXT, MPFROMSHORT(index), (MPARAM)buffer);
 }
 
 /*
@@ -6016,10 +6031,10 @@
  */
 unsigned int API dw_listbox_selected(HWND handle)
 {
-		return (unsigned int)WinSendMsg(handle,
-										LM_QUERYSELECTION,
-										MPFROMSHORT(LIT_CURSOR),
-										0);
+      return (unsigned int)WinSendMsg(handle,
+                              LM_QUERYSELECTION,
+                              MPFROMSHORT(LIT_CURSOR),
+                              0);
 }
 
 /*
@@ -6030,17 +6045,17 @@
  */
 int API dw_listbox_selected_multi(HWND handle, int where)
 {
-	int place = where;
-
-	if(where == -1)
-		place = LIT_FIRST;
-
-	place = (int)WinSendMsg(handle,
-							LM_QUERYSELECTION,
-							MPFROMSHORT(place),0L);
-	if(place == LIT_NONE)
-		return -1;
-	return place;
+   int place = where;
+
+   if(where == -1)
+      place = LIT_FIRST;
+
+   place = (int)WinSendMsg(handle,
+                     LM_QUERYSELECTION,
+                     MPFROMSHORT(place),0L);
+   if(place == LIT_NONE)
+      return -1;
+   return place;
 }
 
 /*
@@ -6052,15 +6067,15 @@
  */
 void API dw_listbox_select(HWND handle, int index, int state)
 {
-	char tmpbuf[100];
-
-	WinSendMsg(handle, LM_SELECTITEM, MPFROMSHORT(index), (MPARAM)state);
-
-	WinQueryClassName(handle, 99, tmpbuf);
-
-	/* If we are setting a combobox call the event handler manually */
-	if(strncmp(tmpbuf, "#6", 3)==0)
-		_run_event(handle, WM_CONTROL, MPFROM2SHORT(0, LN_SELECT), (MPARAM)handle);
+   char tmpbuf[100];
+
+   WinSendMsg(handle, LM_SELECTITEM, MPFROMSHORT(index), (MPARAM)state);
+
+   WinQueryClassName(handle, 99, tmpbuf);
+
+   /* If we are setting a combobox call the event handler manually */
+   if(strncmp(tmpbuf, "#6", 3)==0)
+      _run_event(handle, WM_CONTROL, MPFROM2SHORT(0, LN_SELECT), (MPARAM)handle);
 }
 
 /*
@@ -6071,7 +6086,7 @@
  */
 void API dw_listbox_delete(HWND handle, int index)
 {
-	WinSendMsg(handle, LM_DELETEITEM, MPFROMSHORT(index), 0);
+   WinSendMsg(handle, LM_DELETEITEM, MPFROMSHORT(index), 0);
 }
 
 /*
@@ -6083,33 +6098,33 @@
  */
 unsigned int API dw_mle_import(HWND handle, char *buffer, int startpoint)
 {
-	unsigned long point = startpoint;
-	PBYTE mlebuf;
-
-	/* Work around 64K limit */
-	if(!DosAllocMem((PPVOID) &mlebuf, 65536, PAG_COMMIT | PAG_READ | PAG_WRITE | OBJ_TILE))
-	{
-		int amount, len = strlen(buffer), written = 0;
-
-		while(written < len)
-		{
-			if((len - written) > 65535)
-				amount = 65535;
-			else
-				amount = len - written;
-
-			memcpy(mlebuf, &buffer[written], amount);
-			mlebuf[amount] = '\0';
-
-			WinSendMsg(handle, MLM_SETIMPORTEXPORT, MPFROMP(mlebuf), MPFROMLONG(amount+1));
-			WinSendMsg(handle, MLM_IMPORT, MPFROMP(&point), MPFROMLONG(amount + 1));
-			dw_mle_delete(handle, point, 1);
-
-			written += amount;
-		}
-		DosFreeMem(mlebuf);
-	}
-	return point - 1;
+   unsigned long point = startpoint;
+   PBYTE mlebuf;
+
+   /* Work around 64K limit */
+   if(!DosAllocMem((PPVOID) &mlebuf, 65536, PAG_COMMIT | PAG_READ | PAG_WRITE | OBJ_TILE))
+   {
+      int amount, len = strlen(buffer), written = 0;
+
+      while(written < len)
+      {
+         if((len - written) > 65535)
+            amount = 65535;
+         else
+            amount = len - written;
+
+         memcpy(mlebuf, &buffer[written], amount);
+         mlebuf[amount] = '\0';
+
+         WinSendMsg(handle, MLM_SETIMPORTEXPORT, MPFROMP(mlebuf), MPFROMLONG(amount+1));
+         WinSendMsg(handle, MLM_IMPORT, MPFROMP(&point), MPFROMLONG(amount + 1));
+         dw_mle_delete(handle, point, 1);
+
+         written += amount;
+      }
+      DosFreeMem(mlebuf);
+   }
+   return point - 1;
 }
 
 /*
@@ -6122,34 +6137,34 @@
  */
 void API dw_mle_export(HWND handle, char *buffer, int startpoint, int length)
 {
-	PBYTE mlebuf;
-
-	/* Work around 64K limit */
-	if(!DosAllocMem((PPVOID) &mlebuf, 65535, PAG_COMMIT | PAG_READ | PAG_WRITE | OBJ_TILE))
-	{
-		int amount, copied, written = 0;
-
-		while(written < length)
-		{
-			if((length - written) > 65535)
-				amount = 65535;
-			else
-				amount = length - written;
-
-			WinSendMsg(handle, MLM_SETIMPORTEXPORT, MPFROMP(mlebuf), MPFROMLONG(amount));
-			copied = (int)WinSendMsg(handle, MLM_EXPORT, MPFROMP(&startpoint), MPFROMLONG(&amount));
-
-			if(copied)
-			{
-				memcpy(&buffer[written], mlebuf, copied);
-
-				written += copied;
-			}
-			else
-				break;
-		}
-		DosFreeMem(mlebuf);
-	}
+   PBYTE mlebuf;
+
+   /* Work around 64K limit */
+   if(!DosAllocMem((PPVOID) &mlebuf, 65535, PAG_COMMIT | PAG_READ | PAG_WRITE | OBJ_TILE))
+   {
+      int amount, copied, written = 0;
+
+      while(written < length)
+      {
+         if((length - written) > 65535)
+            amount = 65535;
+         else
+            amount = length - written;
+
+         WinSendMsg(handle, MLM_SETIMPORTEXPORT, MPFROMP(mlebuf), MPFROMLONG(amount));
+         copied = (int)WinSendMsg(handle, MLM_EXPORT, MPFROMP(&startpoint), MPFROMLONG(&amount));
+
+         if(copied)
+         {
+            memcpy(&buffer[written], mlebuf, copied);
+
+            written += copied;
+         }
+         else
+            break;
+      }
+      DosFreeMem(mlebuf);
+   }
 }
 
 /*
@@ -6161,10 +6176,10 @@
  */
 void API dw_mle_get_size(HWND handle, unsigned long *bytes, unsigned long *lines)
 {
-	if(bytes)
-		*bytes = (unsigned long)WinSendMsg(handle, MLM_QUERYTEXTLENGTH, 0, 0);
-	if(lines)
-		*lines = (unsigned long)WinSendMsg(handle, MLM_QUERYLINECOUNT, 0, 0);
+   if(bytes)
+      *bytes = (unsigned long)WinSendMsg(handle, MLM_QUERYTEXTLENGTH, 0, 0);
+   if(lines)
+      *lines = (unsigned long)WinSendMsg(handle, MLM_QUERYLINECOUNT, 0, 0);
 }
 
 /*
@@ -6176,18 +6191,18 @@
  */
 void API dw_mle_delete(HWND handle, int startpoint, int length)
 {
-	char *buf = malloc(length+1);
-	int z, dellen = length;
-
-	dw_mle_export(handle, buf, startpoint, length);
-
-	for(z=0;z<length-1;z++)
-	{
-		if(strncmp(&buf[z], "\r\n", 2) == 0)
-			dellen--;
-	}
-	WinSendMsg(handle, MLM_DELETE, MPFROMLONG(startpoint), MPFROMLONG(dellen));
-	free(buf);
+   char *buf = malloc(length+1);
+   int z, dellen = length;
+
+   dw_mle_export(handle, buf, startpoint, length);
+
+   for(z=0;z<length-1;z++)
+   {
+      if(strncmp(&buf[z], "\r\n", 2) == 0)
+         dellen--;
+   }
+   WinSendMsg(handle, MLM_DELETE, MPFROMLONG(startpoint), MPFROMLONG(dellen));
+   free(buf);
 }
 
 /*
@@ -6197,11 +6212,11 @@
  */
 void API dw_mle_clear(HWND handle)
 {
-	unsigned long bytes;
-
-	dw_mle_get_size(handle, &bytes, NULL);
-
-	WinSendMsg(handle, MLM_DELETE, MPFROMLONG(0), MPFROMLONG(bytes));
+   unsigned long bytes;
+
+   dw_mle_get_size(handle, &bytes, NULL);
+
+   WinSendMsg(handle, MLM_DELETE, MPFROMLONG(0), MPFROMLONG(bytes));
 }
 
 /*
@@ -6212,8 +6227,8 @@
  */
 void API dw_mle_set_visible(HWND handle, int line)
 {
-	int tmppnt = (int)WinSendMsg(handle, MLM_CHARFROMLINE, MPFROMLONG(line), 0);
-	WinSendMsg(handle, MLM_SETSEL, MPFROMLONG(tmppnt), MPFROMLONG(tmppnt));
+   int tmppnt = (int)WinSendMsg(handle, MLM_CHARFROMLINE, MPFROMLONG(line), 0);
+   WinSendMsg(handle, MLM_SETSEL, MPFROMLONG(tmppnt), MPFROMLONG(tmppnt));
 }
 
 /*
@@ -6224,7 +6239,7 @@
  */
 void API dw_mle_set_editable(HWND handle, int state)
 {
-	WinSendMsg(handle, MLM_SETREADONLY, MPFROMLONG(state ? FALSE : TRUE), 0);
+   WinSendMsg(handle, MLM_SETREADONLY, MPFROMLONG(state ? FALSE : TRUE), 0);
 }
 
 /*
@@ -6235,7 +6250,7 @@
  */
 void API dw_mle_set_word_wrap(HWND handle, int state)
 {
-	WinSendMsg(handle, MLM_SETWRAP, MPFROMLONG(state), 0);
+   WinSendMsg(handle, MLM_SETWRAP, MPFROMLONG(state), 0);
 }
 
 /*
@@ -6246,7 +6261,7 @@
  */
 void API dw_mle_set_cursor(HWND handle, int point)
 {
-	WinSendMsg(handle, MLM_SETSEL, MPFROMLONG(point), MPFROMLONG(point));
+   WinSendMsg(handle, MLM_SETSEL, MPFROMLONG(point), MPFROMLONG(point));
 }
 
 /*
@@ -6259,22 +6274,22 @@
  */
 int API dw_mle_search(HWND handle, char *text, int point, unsigned long flags)
 {
-	MLE_SEARCHDATA msd;
-
-	/* This code breaks with structure packing set to 1 (/Sp1 in VAC)
-	 * if this is needed we need to add a pragma here.
-	 */
-	msd.cb = sizeof(msd);
-	msd.pchFind = text;
-	msd.pchReplace = NULL;
-	msd.cchFind = strlen(text);
-	msd.cchReplace = 0;
-	msd.iptStart = point;
-	msd.iptStop = -1;
-
-	if(WinSendMsg(handle, MLM_SEARCH, MPFROMLONG(MLFSEARCH_SELECTMATCH | flags), (MPARAM)&msd))
-		return (int)WinSendMsg(handle, MLM_QUERYSEL,(MPARAM)MLFQS_MAXSEL, 0);
-	return 0;
+   MLE_SEARCHDATA msd;
+
+   /* This code breaks with structure packing set to 1 (/Sp1 in VAC)
+    * if this is needed we need to add a pragma here.
+    */
+   msd.cb = sizeof(msd);
+   msd.pchFind = text;
+   msd.pchReplace = NULL;
+   msd.cchFind = strlen(text);
+   msd.cchReplace = 0;
+   msd.iptStart = point;
+   msd.iptStop = -1;
+
+   if(WinSendMsg(handle, MLM_SEARCH, MPFROMLONG(MLFSEARCH_SELECTMATCH | flags), (MPARAM)&msd))
+      return (int)WinSendMsg(handle, MLM_QUERYSEL,(MPARAM)MLFQS_MAXSEL, 0);
+   return 0;
 }
 
 /*
@@ -6284,7 +6299,7 @@
  */
 void API dw_mle_freeze(HWND handle)
 {
-	WinSendMsg(handle, MLM_DISABLEREFRESH, 0, 0);
+   WinSendMsg(handle, MLM_DISABLEREFRESH, 0, 0);
 }
 
 /*
@@ -6294,7 +6309,7 @@
  */
 void API dw_mle_thaw(HWND handle)
 {
-	WinSendMsg(handle, MLM_ENABLEREFRESH, 0, 0);
+   WinSendMsg(handle, MLM_ENABLEREFRESH, 0, 0);
 }
 
 /*
@@ -6305,14 +6320,14 @@
  */
 void API dw_percent_set_pos(HWND handle, unsigned int position)
 {
-	int range = _dw_percent_get_range(handle);
-	int mypos = ((float)position/100)*range;
-
-	if(range)
-	{
-		_dw_int_set(handle, mypos);
-		WinSendMsg(handle, SLM_SETSLIDERINFO, MPFROM2SHORT(SMA_SLIDERARMPOSITION,SMA_RANGEVALUE), (MPARAM)mypos);
-	}
+   int range = _dw_percent_get_range(handle);
+   int mypos = ((float)position/100)*range;
+
+   if(range)
+   {
+      _dw_int_set(handle, mypos);
+      WinSendMsg(handle, SLM_SETSLIDERINFO, MPFROM2SHORT(SMA_SLIDERARMPOSITION,SMA_RANGEVALUE), (MPARAM)mypos);
+   }
 }
 
 /*
@@ -6322,7 +6337,7 @@
  */
 unsigned int API dw_slider_get_pos(HWND handle)
 {
-	return (unsigned int)WinSendMsg(handle, SLM_QUERYSLIDERINFO, MPFROM2SHORT(SMA_SLIDERARMPOSITION, SMA_INCREMENTVALUE), 0);
+   return (unsigned int)WinSendMsg(handle, SLM_QUERYSLIDERINFO, MPFROM2SHORT(SMA_SLIDERARMPOSITION, SMA_INCREMENTVALUE), 0);
 }
 
 /*
@@ -6333,8 +6348,8 @@
  */
 void API dw_slider_set_pos(HWND handle, unsigned int position)
 {
-	dw_window_set_data(handle, "_dw_slider_value", (void *)position);
-	WinSendMsg(handle, SLM_SETSLIDERINFO, MPFROM2SHORT(SMA_SLIDERARMPOSITION, SMA_INCREMENTVALUE), (MPARAM)position);
+   dw_window_set_data(handle, "_dw_slider_value", (void *)position);
+   WinSendMsg(handle, SLM_SETSLIDERINFO, MPFROM2SHORT(SMA_SLIDERARMPOSITION, SMA_INCREMENTVALUE), (MPARAM)position);
 }
 
 /*
@@ -6344,7 +6359,7 @@
  */
 unsigned int API dw_scrollbar_get_pos(HWND handle)
 {
-	return (unsigned int)WinSendMsg(handle, SBM_QUERYPOS, 0, 0);
+   return (unsigned int)WinSendMsg(handle, SBM_QUERYPOS, 0, 0);
 }
 
 /*
@@ -6355,8 +6370,8 @@
  */
 void API dw_scrollbar_set_pos(HWND handle, unsigned int position)
 {
-	dw_window_set_data(handle, "_dw_scrollbar_value", (void *)position);
-	WinSendMsg(handle, SBM_SETPOS, (MPARAM)position, 0);
+   dw_window_set_data(handle, "_dw_scrollbar_value", (void *)position);
+   WinSendMsg(handle, SBM_SETPOS, (MPARAM)position, 0);
 }
 
 /*
@@ -6368,10 +6383,10 @@
  */
 void API dw_scrollbar_set_range(HWND handle, unsigned int range, unsigned int visible)
 {
-	unsigned int pos = (unsigned int)dw_window_get_data(handle, "_dw_scrollbar_value");
-	WinSendMsg(handle, SBM_SETSCROLLBAR, (MPARAM)pos, MPFROM2SHORT(0, (unsigned short)range - visible));
-	WinSendMsg(handle, SBM_SETTHUMBSIZE, MPFROM2SHORT((unsigned short)visible, range), 0);
-	dw_window_set_data(handle, "_dw_scrollbar_visible", (void *)visible);
+   unsigned int pos = (unsigned int)dw_window_get_data(handle, "_dw_scrollbar_value");
+   WinSendMsg(handle, SBM_SETSCROLLBAR, (MPARAM)pos, MPFROM2SHORT(0, (unsigned short)range - visible));
+   WinSendMsg(handle, SBM_SETTHUMBSIZE, MPFROM2SHORT((unsigned short)visible, range), 0);
+   dw_window_set_data(handle, "_dw_scrollbar_visible", (void *)visible);
 }
 
 /*
@@ -6382,7 +6397,7 @@
  */
 void API dw_spinbutton_set_pos(HWND handle, long position)
 {
-	WinSendMsg(handle, SPBM_SETCURRENTVALUE, MPFROMLONG((long)position), 0L);
+   WinSendMsg(handle, SPBM_SETCURRENTVALUE, MPFROMLONG((long)position), 0L);
 }
 
 /*
@@ -6394,7 +6409,7 @@
  */
 void API dw_spinbutton_set_limits(HWND handle, long upper, long lower)
 {
-	WinSendMsg(handle, SPBM_SETLIMITS, MPFROMLONG(upper), MPFROMLONG(lower));
+   WinSendMsg(handle, SPBM_SETLIMITS, MPFROMLONG(upper), MPFROMLONG(lower));
 }
 
 /*
@@ -6405,7 +6420,7 @@
  */
 void API dw_entryfield_set_limit(HWND handle, ULONG limit)
 {
-	WinSendMsg(handle, EM_SETTEXTLIMIT, (MPARAM)limit, (MPARAM)0);
+   WinSendMsg(handle, EM_SETTEXTLIMIT, (MPARAM)limit, (MPARAM)0);
 }
 
 
@@ -6416,9 +6431,9 @@
  */
 long API dw_spinbutton_get_pos(HWND handle)
 {
-	long tmpval = 0L;
-
-	WinSendMsg(handle, SPBM_QUERYVALUE, (MPARAM)&tmpval,0L);
+   long tmpval = 0L;
+
+   WinSendMsg(handle, SPBM_QUERYVALUE, (MPARAM)&tmpval,0L);
     return tmpval;
 }
 
@@ -6429,7 +6444,7 @@
  */
 int API dw_checkbox_get(HWND handle)
 {
-	return (int)WinSendMsg(handle,BM_QUERYCHECK,0,0);
+   return (int)WinSendMsg(handle,BM_QUERYCHECK,0,0);
 }
 
 /*
@@ -6440,7 +6455,7 @@
  */
 void API dw_checkbox_set(HWND handle, int value)
 {
-	WinSendMsg(handle,BM_SETCHECK,MPFROMSHORT(value),0);
+   WinSendMsg(handle,BM_SETCHECK,MPFROMSHORT(value),0);
 }
 
 /*
@@ -6455,51 +6470,51 @@
  */
 HTREEITEM API dw_tree_insert_after(HWND handle, HTREEITEM item, char *title, unsigned long icon, HTREEITEM parent, void *itemdata)
 {
-	ULONG        cbExtra;
-	PCNRITEM     pci;
-	RECORDINSERT ri;
-
-	if(!item)
-		item = (HTREEITEM)CMA_FIRST;
-
-	/* Calculate extra bytes needed for each record besides that needed for the
-	 * MINIRECORDCORE structure
-	 */
-
-	cbExtra = sizeof(CNRITEM) - sizeof(MINIRECORDCORE);
-
-	/* Allocate memory for the parent record */
-
-	if((pci = (PCNRITEM)_dw_send_msg(handle, CM_ALLOCRECORD, MPFROMLONG(cbExtra), MPFROMSHORT(1), 0)) == 0)
-		return 0;
-
-	/* Fill in the parent record data */
-
-	pci->rc.cb          = sizeof(MINIRECORDCORE);
-	pci->rc.pszIcon     = strdup(title);
-	pci->rc.hptrIcon    = icon;
-
-	pci->hptrIcon       = icon;
-	pci->user           = itemdata;
-	pci->parent         = parent;
-
-	memset(&ri, 0, sizeof(RECORDINSERT));
-
-	ri.cb                 = sizeof(RECORDINSERT);
-	ri.pRecordOrder       = (PRECORDCORE)item;
-	ri.zOrder             = (USHORT)CMA_TOP;
-	ri.cRecordsInsert     = 1;
-	ri.fInvalidateRecord  = TRUE;
-
-	/* We are about to insert the child records. Set the parent record to be
-	 * the one we just inserted.
-	 */
-	ri.pRecordParent = (PRECORDCORE)parent;
-
-	/* Insert the record */
-	WinSendMsg(handle, CM_INSERTRECORD, MPFROMP(pci), MPFROMP(&ri));
-
-	return (HTREEITEM)pci;
+   ULONG        cbExtra;
+   PCNRITEM     pci;
+   RECORDINSERT ri;
+
+   if(!item)
+      item = (HTREEITEM)CMA_FIRST;
+
+   /* Calculate extra bytes needed for each record besides that needed for the
+    * MINIRECORDCORE structure
+    */
+
+   cbExtra = sizeof(CNRITEM) - sizeof(MINIRECORDCORE);
+
+   /* Allocate memory for the parent record */
+
+   if((pci = (PCNRITEM)_dw_send_msg(handle, CM_ALLOCRECORD, MPFROMLONG(cbExtra), MPFROMSHORT(1), 0)) == 0)
+      return 0;
+
+   /* Fill in the parent record data */
+
+   pci->rc.cb          = sizeof(MINIRECORDCORE);
+   pci->rc.pszIcon     = strdup(title);
+   pci->rc.hptrIcon    = icon;
+
+   pci->hptrIcon       = icon;
+   pci->user           = itemdata;
+   pci->parent         = parent;
+
+   memset(&ri, 0, sizeof(RECORDINSERT));
+
+   ri.cb                 = sizeof(RECORDINSERT);
+   ri.pRecordOrder       = (PRECORDCORE)item;
+   ri.zOrder             = (USHORT)CMA_TOP;
+   ri.cRecordsInsert     = 1;
+   ri.fInvalidateRecord  = TRUE;
+
+   /* We are about to insert the child records. Set the parent record to be
+    * the one we just inserted.
+    */
+   ri.pRecordParent = (PRECORDCORE)parent;
+
+   /* Insert the record */
+   WinSendMsg(handle, CM_INSERTRECORD, MPFROMP(pci), MPFROMP(&ri));
+
+   return (HTREEITEM)pci;
 }
 
 /*
@@ -6513,7 +6528,7 @@
  */
 HTREEITEM API dw_tree_insert(HWND handle, char *title, unsigned long icon, HTREEITEM parent, void *itemdata)
 {
-	return dw_tree_insert_after(handle, (HTREEITEM)CMA_END, title, icon, parent, itemdata);
+   return dw_tree_insert_after(handle, (HTREEITEM)CMA_END, title, icon, parent, itemdata);
 }
 
 /*
@@ -6526,20 +6541,20 @@
  */
 void API dw_tree_item_change(HWND handle, HTREEITEM item, char *title, unsigned long icon)
 {
-	PCNRITEM pci = (PCNRITEM)item;
-
-	if(!pci)
-		return;
-
-	if(pci->rc.pszIcon)
-		free(pci->rc.pszIcon);
-
-	pci->rc.pszIcon     = strdup(title);
-	pci->rc.hptrIcon    = icon;
-
-	pci->hptrIcon       = icon;
-
-	WinSendMsg(handle, CM_INVALIDATERECORD, (MPARAM)&pci, MPFROM2SHORT(1, CMA_TEXTCHANGED));
+   PCNRITEM pci = (PCNRITEM)item;
+
+   if(!pci)
+      return;
+
+   if(pci->rc.pszIcon)
+      free(pci->rc.pszIcon);
+
+   pci->rc.pszIcon     = strdup(title);
+   pci->rc.hptrIcon    = icon;
+
+   pci->hptrIcon       = icon;
+
+   WinSendMsg(handle, CM_INVALIDATERECORD, (MPARAM)&pci, MPFROM2SHORT(1, CMA_TEXTCHANGED));
 }
 
 /*
@@ -6550,12 +6565,12 @@
  */
 char * API dw_tree_get_title(HWND handle, HTREEITEM item)
 {
-	PCNRITEM pci = (PCNRITEM)item;
-
-	handle = handle; /* keep compiler happy */
-	if(pci)
-		return pci->rc.pszIcon;
-	return NULL;
+   PCNRITEM pci = (PCNRITEM)item;
+
+   handle = handle; /* keep compiler happy */
+   if(pci)
+      return pci->rc.pszIcon;
+   return NULL;
 }
 
 /*
@@ -6566,12 +6581,12 @@
  */
 HTREEITEM API dw_tree_get_parent(HWND handle, HTREEITEM item)
 {
-	PCNRITEM pci = (PCNRITEM)item;
-
-	handle = handle; /* keep compiler happy */
-	if(pci)
-		return pci->parent;
-	return (HTREEITEM)0;
+   PCNRITEM pci = (PCNRITEM)item;
+
+   handle = handle; /* keep compiler happy */
+   if(pci)
+      return pci->parent;
+   return (HTREEITEM)0;
 }
 
 /*
@@ -6583,13 +6598,13 @@
  */
 void API dw_tree_item_set_data(HWND handle, HTREEITEM item, void *itemdata)
 {
-	PCNRITEM pci = (PCNRITEM)item;
-
-	handle = handle; /* keep compiler happy */
-	if(!pci)
-		return;
-
-	pci->user = itemdata;
+   PCNRITEM pci = (PCNRITEM)item;
+
+   handle = handle; /* keep compiler happy */
+   if(!pci)
+      return;
+
+   pci->user = itemdata;
 }
 
 /*
@@ -6600,12 +6615,12 @@
  */
 void * API dw_tree_item_get_data(HWND handle, HTREEITEM item)
 {
-	PCNRITEM pci = (PCNRITEM)item;
-
-	handle = handle; /* keep compiler happy */
-	if(!pci)
-		return NULL;
-	return pci->user;
+   PCNRITEM pci = (PCNRITEM)item;
+
+   handle = handle; /* keep compiler happy */
+   if(!pci)
+      return NULL;
+   return pci->user;
 }
 
 /*
@@ -6616,17 +6631,17 @@
  */
 void API dw_tree_item_select(HWND handle, HTREEITEM item)
 {
-	PRECORDCORE pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
-
-	while(pCore)
-	{
-		if(pCore->flRecordAttr & CRA_SELECTED)
-			WinSendMsg(handle, CM_SETRECORDEMPHASIS, (MPARAM)pCore, MPFROM2SHORT(FALSE, CRA_SELECTED | CRA_CURSORED));
-		pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
-	}
-	WinSendMsg(handle, CM_SETRECORDEMPHASIS, (MPARAM)item, MPFROM2SHORT(TRUE, CRA_SELECTED | CRA_CURSORED));
-	lastitem = 0;
-	lasthcnr = 0;
+   PRECORDCORE pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
+
+   while(pCore)
+   {
+      if(pCore->flRecordAttr & CRA_SELECTED)
+         WinSendMsg(handle, CM_SETRECORDEMPHASIS, (MPARAM)pCore, MPFROM2SHORT(FALSE, CRA_SELECTED | CRA_CURSORED));
+      pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
+   }
+   WinSendMsg(handle, CM_SETRECORDEMPHASIS, (MPARAM)item, MPFROM2SHORT(TRUE, CRA_SELECTED | CRA_CURSORED));
+   lastitem = 0;
+   lasthcnr = 0;
 }
 
 /*
@@ -6636,7 +6651,7 @@
  */
 void API dw_tree_clear(HWND handle)
 {
-	dw_container_clear(handle, TRUE);
+   dw_container_clear(handle, TRUE);
 }
 
 /*
@@ -6647,7 +6662,7 @@
  */
 void API dw_tree_item_expand(HWND handle, HTREEITEM item)
 {
-	WinSendMsg(handle, CM_EXPANDTREE, MPFROMP(item), 0);
+   WinSendMsg(handle, CM_EXPANDTREE, MPFROMP(item), 0);
 }
 
 /*
@@ -6658,7 +6673,7 @@
  */
 void API dw_tree_item_collapse(HWND handle, HTREEITEM item)
 {
-	WinSendMsg(handle, CM_COLLAPSETREE, MPFROMP(item), 0);
+   WinSendMsg(handle, CM_COLLAPSETREE, MPFROMP(item), 0);
 }
 
 /*
@@ -6669,25 +6684,25 @@
  */
 void API dw_tree_item_delete(HWND handle, HTREEITEM item)
 {
-	PCNRITEM     pci = (PCNRITEM)item;
-
-	if(!item)
-		return;
-
-	if(pci->rc.pszIcon)
-	{
-		free(pci->rc.pszIcon);
-		pci->rc.pszIcon = 0;
-	}
-
-	WinSendMsg(handle, CM_REMOVERECORD, (MPARAM)&pci, MPFROM2SHORT(1, CMA_INVALIDATE | CMA_FREE));
+   PCNRITEM     pci = (PCNRITEM)item;
+
+   if(!item)
+      return;
+
+   if(pci->rc.pszIcon)
+   {
+      free(pci->rc.pszIcon);
+      pci->rc.pszIcon = 0;
+   }
+
+   WinSendMsg(handle, CM_REMOVERECORD, (MPARAM)&pci, MPFROM2SHORT(1, CMA_INVALIDATE | CMA_FREE));
 }
 
 /* Some OS/2 specific container structs */
 typedef struct _containerinfo {
-	int count;
-	void *data;
-	HWND handle;
+   int count;
+   void *data;
+   HWND handle;
 } ContainerInfo;
 
 /*
@@ -6702,93 +6717,93 @@
  */
 int API dw_container_setup(HWND handle, unsigned long *flags, char **titles, int count, int separator)
 {
-	PFIELDINFO details, first, left = NULL;
-	FIELDINFOINSERT detin;
-	CNRINFO cnri;
-	int z;
-	ULONG size = sizeof(RECORDCORE);
-	ULONG *offStruct = malloc(count * sizeof(ULONG));
-	ULONG *tempflags = malloc((count+1) * sizeof(ULONG));
-	WindowData *blah = (WindowData *)WinQueryWindowPtr(handle, QWP_USER);
-	ULONG *oldflags = blah ? blah->data : 0;
-
-	if(!offStruct || !tempflags)
-		return FALSE;
-
-	memcpy(tempflags, flags, count * sizeof(ULONG));
-	tempflags[count] = 0;
-
-	blah->data = tempflags;
-	blah->flags = separator;
-
-	if(oldflags)
-		free(oldflags);
-
-	while((first = (PFIELDINFO)WinSendMsg(handle, CM_QUERYDETAILFIELDINFO,  0, MPFROMSHORT(CMA_FIRST))) != NULL)
-	{
-		WinSendMsg(handle, CM_REMOVEDETAILFIELDINFO, (MPARAM)&first, MPFROM2SHORT(1, CMA_FREE));
-	}
-
-	/* Figure out the offsets to the items in the struct */
-	for(z=0;z<count;z++)
-	{
-		offStruct[z] = size;
-		if(flags[z] & DW_CFA_BITMAPORICON)
-			size += sizeof(HPOINTER);
-		else if(flags[z] & DW_CFA_STRING)
-			size += sizeof(char *);
-		else if(flags[z] & DW_CFA_ULONG)
-			size += sizeof(ULONG);
-		else if(flags[z] & DW_CFA_DATE)
-			size += sizeof(CDATE);
-		else if(flags[z] & DW_CFA_TIME)
-			size += sizeof(CTIME);
-	}
-
-	first = details = (PFIELDINFO)WinSendMsg(handle, CM_ALLOCDETAILFIELDINFO, MPFROMLONG(count), 0L);
-
-	if(!first)
-	{
-		free(offStruct);
-		return FALSE;
-	}
-
-	for(z=0;z<count;z++)
-	{
-		if(z==separator-1)
-			left=details;
-		details->cb = sizeof(FIELDINFO);
-		details->flData = flags[z];
-		details->flTitle = CFA_FITITLEREADONLY;
-		details->pTitleData = titles[z];
-		details->offStruct = offStruct[z];
-		details = details->pNextFieldInfo;
-	}
-
-	detin.cb = sizeof(FIELDINFOINSERT);
-	detin.fInvalidateFieldInfo = FALSE;
-	detin.pFieldInfoOrder = (PFIELDINFO) CMA_FIRST;
-	detin.cFieldInfoInsert = (ULONG)count;
-
-	WinSendMsg(handle, CM_INSERTDETAILFIELDINFO, MPFROMP(first), MPFROMP(&detin));
-
-	if(count > separator && separator > 0)
-	{
-		cnri.cb = sizeof(CNRINFO);
-		cnri.pFieldInfoLast = left;
-		cnri.xVertSplitbar  = 150;
-
-		WinSendMsg(handle, CM_SETCNRINFO, MPFROMP(&cnri),  MPFROMLONG(CMA_PFIELDINFOLAST | CMA_XVERTSPLITBAR));
-	}
-
-	cnri.flWindowAttr = CV_DETAIL | CV_MINI | CA_DETAILSVIEWTITLES;
-	cnri.slBitmapOrIcon.cx = 16;
-	cnri.slBitmapOrIcon.cy = 16;
-
-	WinSendMsg(handle, CM_SETCNRINFO, &cnri, MPFROMLONG(CMA_FLWINDOWATTR | CMA_SLBITMAPORICON));
-
-	free(offStruct);
-	return TRUE;
+   PFIELDINFO details, first, left = NULL;
+   FIELDINFOINSERT detin;
+   CNRINFO cnri;
+   int z;
+   ULONG size = sizeof(RECORDCORE);
+   ULONG *offStruct = malloc(count * sizeof(ULONG));
+   ULONG *tempflags = malloc((count+1) * sizeof(ULONG));
+   WindowData *blah = (WindowData *)WinQueryWindowPtr(handle, QWP_USER);
+   ULONG *oldflags = blah ? blah->data : 0;
+
+   if(!offStruct || !tempflags)
+      return FALSE;
+
+   memcpy(tempflags, flags, count * sizeof(ULONG));
+   tempflags[count] = 0;
+
+   blah->data = tempflags;
+   blah->flags = separator;
+
+   if(oldflags)
+      free(oldflags);
+
+   while((first = (PFIELDINFO)WinSendMsg(handle, CM_QUERYDETAILFIELDINFO,  0, MPFROMSHORT(CMA_FIRST))) != NULL)
+   {
+      WinSendMsg(handle, CM_REMOVEDETAILFIELDINFO, (MPARAM)&first, MPFROM2SHORT(1, CMA_FREE));
+   }
+
+   /* Figure out the offsets to the items in the struct */
+   for(z=0;z<count;z++)
+   {
+      offStruct[z] = size;
+      if(flags[z] & DW_CFA_BITMAPORICON)
+         size += sizeof(HPOINTER);
+      else if(flags[z] & DW_CFA_STRING)
+         size += sizeof(char *);
+      else if(flags[z] & DW_CFA_ULONG)
+         size += sizeof(ULONG);
+      else if(flags[z] & DW_CFA_DATE)
+         size += sizeof(CDATE);
+      else if(flags[z] & DW_CFA_TIME)
+         size += sizeof(CTIME);
+   }
+
+   first = details = (PFIELDINFO)WinSendMsg(handle, CM_ALLOCDETAILFIELDINFO, MPFROMLONG(count), 0L);
+
+   if(!first)
+   {
+      free(offStruct);
+      return FALSE;
+   }
+
+   for(z=0;z<count;z++)
+   {
+      if(z==separator-1)
+         left=details;
+      details->cb = sizeof(FIELDINFO);
+      details->flData = flags[z];
+      details->flTitle = CFA_FITITLEREADONLY;
+      details->pTitleData = titles[z];
+      details->offStruct = offStruct[z];
+      details = details->pNextFieldInfo;
+   }
+
+   detin.cb = sizeof(FIELDINFOINSERT);
+   detin.fInvalidateFieldInfo = FALSE;
+   detin.pFieldInfoOrder = (PFIELDINFO) CMA_FIRST;
+   detin.cFieldInfoInsert = (ULONG)count;
+
+   WinSendMsg(handle, CM_INSERTDETAILFIELDINFO, MPFROMP(first), MPFROMP(&detin));
+
+   if(count > separator && separator > 0)
+   {
+      cnri.cb = sizeof(CNRINFO);
+      cnri.pFieldInfoLast = left;
+      cnri.xVertSplitbar  = 150;
+
+      WinSendMsg(handle, CM_SETCNRINFO, MPFROMP(&cnri),  MPFROMLONG(CMA_PFIELDINFOLAST | CMA_XVERTSPLITBAR));
+   }
+
+   cnri.flWindowAttr = CV_DETAIL | CV_MINI | CA_DETAILSVIEWTITLES;
+   cnri.slBitmapOrIcon.cx = 16;
+   cnri.slBitmapOrIcon.cy = 16;
+
+   WinSendMsg(handle, CM_SETCNRINFO, &cnri, MPFROMLONG(CMA_FLWINDOWATTR | CMA_SLBITMAPORICON));
+
+   free(offStruct);
+   return TRUE;
 }
 
 /*
@@ -6801,23 +6816,23 @@
  */
 int API dw_filesystem_setup(HWND handle, unsigned long *flags, char **titles, int count)
 {
-	char **newtitles = malloc(sizeof(char *) * (count + 2));
-	unsigned long *newflags = malloc(sizeof(unsigned long) * (count + 2));
-
-	newtitles[0] = "Icon";
-	newtitles[1] = "Filename";
-
-	newflags[0] = DW_CFA_BITMAPORICON | DW_CFA_CENTER | DW_CFA_HORZSEPARATOR | DW_CFA_SEPARATOR;
-	newflags[1] = DW_CFA_STRING | DW_CFA_LEFT | DW_CFA_HORZSEPARATOR;
-
-	memcpy(&newtitles[2], titles, sizeof(char *) * count);
-	memcpy(&newflags[2], flags, sizeof(unsigned long) * count);
-
-	dw_container_setup(handle, newflags, newtitles, count + 2, count ? 2 : 0);
-
-	free(newtitles);
-	free(newflags);
-	return TRUE;
+   char **newtitles = malloc(sizeof(char *) * (count + 2));
+   unsigned long *newflags = malloc(sizeof(unsigned long) * (count + 2));
+
+   newtitles[0] = "Icon";
+   newtitles[1] = "Filename";
+
+   newflags[0] = DW_CFA_BITMAPORICON | DW_CFA_CENTER | DW_CFA_HORZSEPARATOR | DW_CFA_SEPARATOR;
+   newflags[1] = DW_CFA_STRING | DW_CFA_LEFT | DW_CFA_HORZSEPARATOR;
+
+   memcpy(&newtitles[2], titles, sizeof(char *) * count);
+   memcpy(&newflags[2], flags, sizeof(unsigned long) * count);
+
+   dw_container_setup(handle, newflags, newtitles, count + 2, count ? 2 : 0);
+
+   free(newtitles);
+   free(newflags);
+   return TRUE;
 }
 
 /*
@@ -6830,7 +6845,7 @@
  */
 unsigned long API dw_icon_load(unsigned long module, unsigned long id)
 {
-	return WinLoadPointer(HWND_DESKTOP,module,id);
+   return WinLoadPointer(HWND_DESKTOP,module,id);
 }
 
 /*
@@ -6913,159 +6928,159 @@
  */
 void * API dw_container_alloc(HWND handle, int rowcount)
 {
-	WindowData *wd = (WindowData *)WinQueryWindowPtr(handle, QWP_USER);
-	ULONG *flags = wd ? wd->data : 0;
-	int z, size = 0, totalsize, count = 0;
-	PRECORDCORE temp;
-	ContainerInfo *ci;
-	void *blah = NULL;
-
-	if(!flags || rowcount < 1)
-		return NULL;
-
-	while(flags[count])
-		count++;
-
-	/* Figure out the offsets to the items in the struct */
-	for(z=0;z<count;z++)
-	{
-		if(flags[z] & DW_CFA_BITMAPORICON)
-			size += sizeof(HPOINTER);
-		else if(flags[z] & DW_CFA_STRING)
-			size += sizeof(char *);
-		else if(flags[z] & DW_CFA_ULONG)
-			size += sizeof(ULONG);
-		else if(flags[z] & DW_CFA_DATE)
-			size += sizeof(CDATE);
-		else if(flags[z] & DW_CFA_TIME)
-			size += sizeof(CTIME);
-	}
-
-	totalsize = size + sizeof(RECORDCORE);
-
-	z = 0;
-
-	if(!(blah = (void *)_dw_send_msg(handle, CM_ALLOCRECORD, MPFROMLONG(size), MPFROMLONG(rowcount), 0)))
-		return NULL;
-
-	temp = (PRECORDCORE)blah;
-
-	for(z=0;z<rowcount;z++)
-	{
-		temp->cb = totalsize;
-		temp = temp->preccNextRecord;
-	}
-
-	ci = malloc(sizeof(struct _containerinfo));
-
-	ci->count = rowcount;
-	ci->data = blah;
-	ci->handle = handle;
-
-	return (void *)ci;
+   WindowData *wd = (WindowData *)WinQueryWindowPtr(handle, QWP_USER);
+   ULONG *flags = wd ? wd->data : 0;
+   int z, size = 0, totalsize, count = 0;
+   PRECORDCORE temp;
+   ContainerInfo *ci;
+   void *blah = NULL;
+
+   if(!flags || rowcount < 1)
+      return NULL;
+
+   while(flags[count])
+      count++;
+
+   /* Figure out the offsets to the items in the struct */
+   for(z=0;z<count;z++)
+   {
+      if(flags[z] & DW_CFA_BITMAPORICON)
+         size += sizeof(HPOINTER);
+      else if(flags[z] & DW_CFA_STRING)
+         size += sizeof(char *);
+      else if(flags[z] & DW_CFA_ULONG)
+         size += sizeof(ULONG);
+      else if(flags[z] & DW_CFA_DATE)
+         size += sizeof(CDATE);
+      else if(flags[z] & DW_CFA_TIME)
+         size += sizeof(CTIME);
+   }
+
+   totalsize = size + sizeof(RECORDCORE);
+
+   z = 0;
+
+   if(!(blah = (void *)_dw_send_msg(handle, CM_ALLOCRECORD, MPFROMLONG(size), MPFROMLONG(rowcount), 0)))
+      return NULL;
+
+   temp = (PRECORDCORE)blah;
+
+   for(z=0;z<rowcount;z++)
+   {
+      temp->cb = totalsize;
+      temp = temp->preccNextRecord;
+   }
+
+   ci = malloc(sizeof(struct _containerinfo));
+
+   ci->count = rowcount;
+   ci->data = blah;
+   ci->handle = handle;
+
+   return (void *)ci;
 }
 
 /* Internal function that does the work for set_item and change_item */
 void _dw_container_set_item(HWND handle, PRECORDCORE temp, int column, int row, void *data)
 {
-	WindowData *blah = (WindowData *)WinQueryWindowPtr(handle, QWP_USER);
-	ULONG totalsize, size = 0, *flags = blah ? blah->data : 0;
-	int z, currentcount;
-	CNRINFO cnr;
+   WindowData *blah = (WindowData *)WinQueryWindowPtr(handle, QWP_USER);
+   ULONG totalsize, size = 0, *flags = blah ? blah->data : 0;
+   int z, currentcount;
+   CNRINFO cnr;
     void *dest;
 
-	if(!flags)
-		return;
-
-	if(!_dw_send_msg(handle, CM_QUERYCNRINFO, (MPARAM)&cnr, MPFROMSHORT(sizeof(CNRINFO)), 0))
-		return;
-
-	currentcount = cnr.cRecords;
-
-	/* Figure out the offsets to the items in the struct */
-	for(z=0;z<column;z++)
-	{
-		if(flags[z] & DW_CFA_BITMAPORICON)
-			size += sizeof(HPOINTER);
-		else if(flags[z] & DW_CFA_STRING)
-			size += sizeof(char *);
-		else if(flags[z] & DW_CFA_ULONG)
-			size += sizeof(ULONG);
-		else if(flags[z] & DW_CFA_DATE)
-			size += sizeof(CDATE);
-		else if(flags[z] & DW_CFA_TIME)
-			size += sizeof(CTIME);
-	}
-
-	totalsize = size + sizeof(RECORDCORE);
-
-	for(z=0;z<(row-currentcount);z++)
-		temp = temp->preccNextRecord;
-
-	dest = (void *)(((ULONG)temp)+((ULONG)totalsize));
-
-	if(flags[column] & DW_CFA_BITMAPORICON)
-		memcpy(dest, data, sizeof(HPOINTER));
-	else if(flags[column] & DW_CFA_STRING)
-	{
-		char **newstr = (char **)data, **str = dest;
-
-		if(*str)
-			free(*str);
-
-		if(newstr && *newstr)
-			*str = strdup(*newstr);
-		else
-			*str = NULL;
-	}
-	else if(flags[column] & DW_CFA_ULONG)
-		memcpy(dest, data, sizeof(ULONG));
-	else if(flags[column] & DW_CFA_DATE)
-		memcpy(dest, data, sizeof(CDATE));
-	else if(flags[column] & DW_CFA_TIME)
-		memcpy(dest, data, sizeof(CTIME));
+   if(!flags)
+      return;
+
+   if(!_dw_send_msg(handle, CM_QUERYCNRINFO, (MPARAM)&cnr, MPFROMSHORT(sizeof(CNRINFO)), 0))
+      return;
+
+   currentcount = cnr.cRecords;
+
+   /* Figure out the offsets to the items in the struct */
+   for(z=0;z<column;z++)
+   {
+      if(flags[z] & DW_CFA_BITMAPORICON)
+         size += sizeof(HPOINTER);
+      else if(flags[z] & DW_CFA_STRING)
+         size += sizeof(char *);
+      else if(flags[z] & DW_CFA_ULONG)
+         size += sizeof(ULONG);
+      else if(flags[z] & DW_CFA_DATE)
+         size += sizeof(CDATE);
+      else if(flags[z] & DW_CFA_TIME)
+         size += sizeof(CTIME);
+   }
+
+   totalsize = size + sizeof(RECORDCORE);
+
+   for(z=0;z<(row-currentcount);z++)
+      temp = temp->preccNextRecord;
+
+   dest = (void *)(((ULONG)temp)+((ULONG)totalsize));
+
+   if(flags[column] & DW_CFA_BITMAPORICON)
+      memcpy(dest, data, sizeof(HPOINTER));
+   else if(flags[column] & DW_CFA_STRING)
+   {
+      char **newstr = (char **)data, **str = dest;
+
+      if(*str)
+         free(*str);
+
+      if(newstr && *newstr)
+         *str = strdup(*newstr);
+      else
+         *str = NULL;
+   }
+   else if(flags[column] & DW_CFA_ULONG)
+      memcpy(dest, data, sizeof(ULONG));
+   else if(flags[column] & DW_CFA_DATE)
+      memcpy(dest, data, sizeof(CDATE));
+   else if(flags[column] & DW_CFA_TIME)
+      memcpy(dest, data, sizeof(CTIME));
 }
 
 /* Internal function that free()s any strings allocated for a container item */
 void _dw_container_free_strings(HWND handle, PRECORDCORE temp)
 {
-	WindowData *blah = (WindowData *)WinQueryWindowPtr(handle, QWP_USER);
-	ULONG totalsize, size = 0, *flags = blah ? blah->data : 0;
-	int z, count = 0;
-
-	if(!flags)
-		return;
-
-	while(flags[count])
-		count++;
-
-	/* Figure out the offsets to the items in the struct */
-	for(z=0;z<count;z++)
-	{
-		if(flags[z] & DW_CFA_BITMAPORICON)
-			size += sizeof(HPOINTER);
-		else if(flags[z] & DW_CFA_STRING)
-		{
-			char **str;
-
-			totalsize = size + sizeof(RECORDCORE);
-
-			str = (char **)(((ULONG)temp)+((ULONG)totalsize));
-
-			if(*str)
-			{
-				free(*str);
-				*str = NULL;
-			}
-			size += sizeof(char *);
-		}
-		else if(flags[z] & DW_CFA_ULONG)
-			size += sizeof(ULONG);
-		else if(flags[z] & DW_CFA_DATE)
-			size += sizeof(CDATE);
-		else if(flags[z] & DW_CFA_TIME)
-			size += sizeof(CTIME);
-	}
+   WindowData *blah = (WindowData *)WinQueryWindowPtr(handle, QWP_USER);
+   ULONG totalsize, size = 0, *flags = blah ? blah->data : 0;
+   int z, count = 0;
+
+   if(!flags)
+      return;
+
+   while(flags[count])
+      count++;
+
+   /* Figure out the offsets to the items in the struct */
+   for(z=0;z<count;z++)
+   {
+      if(flags[z] & DW_CFA_BITMAPORICON)
+         size += sizeof(HPOINTER);
+      else if(flags[z] & DW_CFA_STRING)
+      {
+         char **str;
+
+         totalsize = size + sizeof(RECORDCORE);
+
+         str = (char **)(((ULONG)temp)+((ULONG)totalsize));
+
+         if(*str)
+         {
+            free(*str);
+            *str = NULL;
+         }
+         size += sizeof(char *);
+      }
+      else if(flags[z] & DW_CFA_ULONG)
+         size += sizeof(ULONG);
+      else if(flags[z] & DW_CFA_DATE)
+         size += sizeof(CDATE);
+      else if(flags[z] & DW_CFA_TIME)
+         size += sizeof(CTIME);
+   }
 }
 
 /*
@@ -7079,12 +7094,12 @@
  */
 void API dw_container_set_item(HWND handle, void *pointer, int column, int row, void *data)
 {
-	ContainerInfo *ci = (ContainerInfo *)pointer;
-
-	if(!ci)
-		return;
-
-	_dw_container_set_item(handle, (PRECORDCORE)ci->data, column, row, data);
+   ContainerInfo *ci = (ContainerInfo *)pointer;
+
+   if(!ci)
+      return;
+
+   _dw_container_set_item(handle, (PRECORDCORE)ci->data, column, row, data);
 }
 
 /*
@@ -7097,20 +7112,20 @@
  */
 void API dw_container_change_item(HWND handle, int column, int row, void *data)
 {
-	PRECORDCORE pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
-	int count = 0;
-
-	while(pCore)
-	{
-		if(count == row)
-		{
-			_dw_container_set_item(handle, pCore, column, 0, data);
-			WinSendMsg(handle, CM_INVALIDATERECORD, (MPARAM)&pCore, MPFROM2SHORT(1, CMA_NOREPOSITION | CMA_TEXTCHANGED));
-			return;
-		}
-		pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
-		count++;
-	}
+   PRECORDCORE pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
+   int count = 0;
+
+   while(pCore)
+   {
+      if(count == row)
+      {
+         _dw_container_set_item(handle, pCore, column, 0, data);
+         WinSendMsg(handle, CM_INVALIDATERECORD, (MPARAM)&pCore, MPFROM2SHORT(1, CMA_NOREPOSITION | CMA_TEXTCHANGED));
+         return;
+      }
+      pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
+      count++;
+   }
 }
 
 /*
@@ -7123,7 +7138,7 @@
  */
 void API dw_filesystem_change_item(HWND handle, int column, int row, void *data)
 {
-	dw_container_change_item(handle, column + 2, row, data);
+   dw_container_change_item(handle, column + 2, row, data);
 }
 
 /*
@@ -7137,8 +7152,8 @@
  */
 void API dw_filesystem_change_file(HWND handle, int row, char *filename, unsigned long icon)
 {
-	dw_container_change_item(handle, 0, row, (void *)&icon);
-	dw_container_change_item(handle, 1, row, (void *)&filename);
+   dw_container_change_item(handle, 0, row, (void *)&icon);
+   dw_container_change_item(handle, 1, row, (void *)&filename);
 }
 
 /*
@@ -7152,8 +7167,8 @@
  */
 void API dw_filesystem_set_file(HWND handle, void *pointer, int row, char *filename, unsigned long icon)
 {
-	dw_container_set_item(handle, pointer, 0, row, (void *)&icon);
-	dw_container_set_item(handle, pointer, 1, row, (void *)&filename);
+   dw_container_set_item(handle, pointer, 0, row, (void *)&icon);
+   dw_container_set_item(handle, pointer, 1, row, (void *)&filename);
 }
 
 /*
@@ -7167,7 +7182,7 @@
  */
 void API dw_filesystem_set_item(HWND handle, void *pointer, int column, int row, void *data)
 {
-	dw_container_set_item(handle, pointer, column + 2, row, data);
+   dw_container_set_item(handle, pointer, column + 2, row, data);
 }
 
 /*
@@ -7178,26 +7193,26 @@
  */
 int API dw_container_get_column_type(HWND handle, int column)
 {
-	WindowData *blah = (WindowData *)WinQueryWindowPtr(handle, QWP_USER);
-	ULONG *flags = blah ? blah->data : 0;
-	int rc;
-
-	if(!flags)
-		return 0;
-
-	if(flags[column] & DW_CFA_BITMAPORICON)
-		rc = DW_CFA_BITMAPORICON;
-	else if(flags[column] & DW_CFA_STRING)
-		rc = DW_CFA_STRING;
-	else if(flags[column] & DW_CFA_ULONG)
-		rc = DW_CFA_ULONG;
-	else if(flags[column] & DW_CFA_DATE)
-		rc = DW_CFA_DATE;
-	else if(flags[column] & DW_CFA_TIME)
-		rc = DW_CFA_TIME;
-	else
-		rc = 0;
-	return rc;
+   WindowData *blah = (WindowData *)WinQueryWindowPtr(handle, QWP_USER);
+   ULONG *flags = blah ? blah->data : 0;
+   int rc;
+
+   if(!flags)
+      return 0;
+
+   if(flags[column] & DW_CFA_BITMAPORICON)
+      rc = DW_CFA_BITMAPORICON;
+   else if(flags[column] & DW_CFA_STRING)
+      rc = DW_CFA_STRING;
+   else if(flags[column] & DW_CFA_ULONG)
+      rc = DW_CFA_ULONG;
+   else if(flags[column] & DW_CFA_DATE)
+      rc = DW_CFA_DATE;
+   else if(flags[column] & DW_CFA_TIME)
+      rc = DW_CFA_TIME;
+   else
+      rc = 0;
+   return rc;
 }
 
 /*
@@ -7208,7 +7223,7 @@
  */
 int API dw_filesystem_get_column_type(HWND handle, int column)
 {
-	return dw_container_get_column_type( handle, column + 2 );
+   return dw_container_get_column_type( handle, column + 2 );
 }
 
 /*
@@ -7220,9 +7235,9 @@
  */
 void API dw_container_set_column_width(HWND handle, int column, int width)
 {
-	handle = handle; /* keep compiler happy */
-	column = column; /* keep compiler happy */
-	width = width; /* keep compiler happy */
+   handle = handle; /* keep compiler happy */
+   column = column; /* keep compiler happy */
+   width = width; /* keep compiler happy */
 }
 
 /*
@@ -7234,29 +7249,29 @@
  */
 void API dw_container_set_row_title(void *pointer, int row, char *title)
 {
-	ContainerInfo *ci = (ContainerInfo *)pointer;
-	PRECORDCORE temp;
-	int z, currentcount;
-	CNRINFO cnr;
-
-	if(!ci)
-		return;
-
-	temp = (PRECORDCORE)ci->data;
-
-	z = 0;
-
-	if(!_dw_send_msg(ci->handle, CM_QUERYCNRINFO, (MPARAM)&cnr, MPFROMSHORT(sizeof(CNRINFO)), 0))
-		return;
-
-	currentcount = cnr.cRecords;
-
-	for(z=0;z<(row-currentcount);z++)
-		temp = temp->preccNextRecord;
-
-	temp->pszIcon = title;
-	temp->pszName = title;
-	temp->pszText = title;
+   ContainerInfo *ci = (ContainerInfo *)pointer;
+   PRECORDCORE temp;
+   int z, currentcount;
+   CNRINFO cnr;
+
+   if(!ci)
+      return;
+
+   temp = (PRECORDCORE)ci->data;
+
+   z = 0;
+
+   if(!_dw_send_msg(ci->handle, CM_QUERYCNRINFO, (MPARAM)&cnr, MPFROMSHORT(sizeof(CNRINFO)), 0))
+      return;
+
+   currentcount = cnr.cRecords;
+
+   for(z=0;z<(row-currentcount);z++)
+      temp = temp->preccNextRecord;
+
+   temp->pszIcon = title;
+   temp->pszName = title;
+   temp->pszText = title;
 }
 
 /*
@@ -7268,22 +7283,22 @@
  */
 void API dw_container_insert(HWND handle, void *pointer, int rowcount)
 {
-	RECORDINSERT recin;
-	ContainerInfo *ci = (ContainerInfo *)pointer;
-
-	if(!ci)
-		return;
-
-	recin.cb = sizeof(RECORDINSERT);
-	recin.pRecordOrder = (PRECORDCORE)CMA_END;
-	recin.pRecordParent = NULL;
-	recin.zOrder = CMA_TOP;
-	recin.fInvalidateRecord = TRUE;
-	recin.cRecordsInsert = rowcount;
-
-	_dw_send_msg(handle, CM_INSERTRECORD, MPFROMP(ci->data), MPFROMP(&recin), 0);
-
-	free(ci);
+   RECORDINSERT recin;
+   ContainerInfo *ci = (ContainerInfo *)pointer;
+
+   if(!ci)
+      return;
+
+   recin.cb = sizeof(RECORDINSERT);
+   recin.pRecordOrder = (PRECORDCORE)CMA_END;
+   recin.pRecordParent = NULL;
+   recin.zOrder = CMA_TOP;
+   recin.fInvalidateRecord = TRUE;
+   recin.cRecordsInsert = rowcount;
+
+   _dw_send_msg(handle, CM_INSERTRECORD, MPFROMP(ci->data), MPFROMP(&recin), 0);
+
+   free(ci);
 }
 
 /*
@@ -7294,30 +7309,30 @@
  */
 void API dw_container_clear(HWND handle, int redraw)
 {
-	PCNRITEM pCore;
-	int container = (int)dw_window_get_data(handle, "_dw_container");
-
-	if(hwndEmph == handle)
-		_clear_emphasis();
-
-	pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
-
-	while(pCore)
-	{
-		if(container)
-			_dw_container_free_strings(handle, (PRECORDCORE)pCore);
-		else
-		{
-			/* Free icon text */
-			if(pCore->rc.pszIcon)
-			{
-				free(pCore->rc.pszIcon);
-				pCore->rc.pszIcon = 0;
-			}
-		}
-		pCore = (PCNRITEM)pCore->rc.preccNextRecord;/*WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));*/
-	}
-	_dw_send_msg(handle, CM_REMOVERECORD, (MPARAM)0L, MPFROM2SHORT(0, (redraw ? CMA_INVALIDATE : 0) | CMA_FREE), -1);
+   PCNRITEM pCore;
+   int container = (int)dw_window_get_data(handle, "_dw_container");
+
+   if(hwndEmph == handle)
+      _clear_emphasis();
+
+   pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
+
+   while(pCore)
+   {
+      if(container)
+         _dw_container_free_strings(handle, (PRECORDCORE)pCore);
+      else
+      {
+         /* Free icon text */
+         if(pCore->rc.pszIcon)
+         {
+            free(pCore->rc.pszIcon);
+            pCore->rc.pszIcon = 0;
+         }
+      }
+      pCore = (PCNRITEM)pCore->rc.preccNextRecord;/*WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));*/
+   }
+   _dw_send_msg(handle, CM_REMOVERECORD, (MPARAM)0L, MPFROM2SHORT(0, (redraw ? CMA_INVALIDATE : 0) | CMA_FREE), -1);
 }
 
 /*
@@ -7328,21 +7343,21 @@
  */
 void API dw_container_delete(HWND handle, int rowcount)
 {
-	RECORDCORE *last, **prc = malloc(sizeof(RECORDCORE *) * rowcount);
-	int current = 1;
-
-	prc[0] = last = (RECORDCORE *)WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
-
-	while(last && current < rowcount)
-	{
-		_dw_container_free_strings(handle, last);
-		prc[current] = last = (RECORDCORE *)WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)last, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
-		current++;
-	}
-
-	_dw_send_msg(handle, CM_REMOVERECORD, (MPARAM)prc, MPFROM2SHORT(current, CMA_INVALIDATE | CMA_FREE), -1);
-	
-	free(prc);
+   RECORDCORE *last, **prc = malloc(sizeof(RECORDCORE *) * rowcount);
+   int current = 1;
+
+   prc[0] = last = (RECORDCORE *)WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
+
+   while(last && current < rowcount)
+   {
+      _dw_container_free_strings(handle, last);
+      prc[current] = last = (RECORDCORE *)WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)last, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
+      current++;
+   }
+
+   _dw_send_msg(handle, CM_REMOVERECORD, (MPARAM)prc, MPFROM2SHORT(current, CMA_INVALIDATE | CMA_FREE), -1);
+
+   free(prc);
 }
 
 /*
@@ -7355,16 +7370,16 @@
  */
 void API dw_container_scroll(HWND handle, int direction, long rows)
 {
-	rows = rows; /* keep compiler happy */
-	switch(direction)
-	{
-	case DW_SCROLL_TOP:
-		WinSendMsg(handle, CM_SCROLLWINDOW, MPFROMSHORT(CMA_VERTICAL), MPFROMLONG(-10000000));
+   rows = rows; /* keep compiler happy */
+   switch(direction)
+   {
+   case DW_SCROLL_TOP:
+      WinSendMsg(handle, CM_SCROLLWINDOW, MPFROMSHORT(CMA_VERTICAL), MPFROMLONG(-10000000));
         break;
-	case DW_SCROLL_BOTTOM:
-		WinSendMsg(handle, CM_SCROLLWINDOW, MPFROMSHORT(CMA_VERTICAL), MPFROMLONG(10000000));
-		break;
-	}
+   case DW_SCROLL_BOTTOM:
+      WinSendMsg(handle, CM_SCROLLWINDOW, MPFROMSHORT(CMA_VERTICAL), MPFROMLONG(10000000));
+      break;
+   }
 }
 
 /*
@@ -7377,28 +7392,28 @@
  */
 char * API dw_container_query_start(HWND handle, unsigned long flags)
 {
-	PRECORDCORE pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
-
-	if(pCore)
-	{
-		if(flags)
-		{
-			while(pCore)
-			{
-				if(pCore->flRecordAttr & flags)
-				{
-					dw_window_set_data(handle, "_dw_pcore", (void *)pCore);
-					return pCore->pszIcon;
-				}
-				pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
-			}
-		}
-		else
-		{
-			dw_window_set_data(handle, "_dw_pcore", (void *)pCore);
-			return pCore->pszIcon;
-		}
-	}
+   PRECORDCORE pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
+
+   if(pCore)
+   {
+      if(flags)
+      {
+         while(pCore)
+         {
+            if(pCore->flRecordAttr & flags)
+            {
+               dw_window_set_data(handle, "_dw_pcore", (void *)pCore);
+               return pCore->pszIcon;
+            }
+            pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
+         }
+      }
+      else
+      {
+         dw_window_set_data(handle, "_dw_pcore", (void *)pCore);
+         return pCore->pszIcon;
+      }
+   }
     return NULL;
 }
 
@@ -7412,31 +7427,31 @@
  */
 char * API dw_container_query_next(HWND handle, unsigned long flags)
 {
-	PRECORDCORE pCore = (PRECORDCORE)dw_window_get_data(handle, "_dw_pcore");
-
-	pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
-
-	if(pCore)
-	{
-		if(flags)
-		{
-			while(pCore)
-			{
-				if(pCore->flRecordAttr & flags)
-				{
-					dw_window_set_data(handle, "_dw_pcore", (void *)pCore);
-					return pCore->pszIcon;
-				}
-
-				pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
-			}
-		}
-		else
-		{
-			dw_window_set_data(handle, "_dw_pcore", (void *)pCore);
-			return pCore->pszIcon;
-		}
-	}
+   PRECORDCORE pCore = (PRECORDCORE)dw_window_get_data(handle, "_dw_pcore");
+
+   pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
+
+   if(pCore)
+   {
+      if(flags)
+      {
+         while(pCore)
+         {
+            if(pCore->flRecordAttr & flags)
+            {
+               dw_window_set_data(handle, "_dw_pcore", (void *)pCore);
+               return pCore->pszIcon;
+            }
+
+            pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
+         }
+      }
+      else
+      {
+         dw_window_set_data(handle, "_dw_pcore", (void *)pCore);
+         return pCore->pszIcon;
+      }
+   }
     return NULL;
 }
 
@@ -7448,34 +7463,34 @@
  */
 void API dw_container_cursor(HWND handle, char *text)
 {
-	RECTL viewport, item;
-	PRECORDCORE pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
-
-	while(pCore)
-	{
-		if((char *)pCore->pszIcon == text)
-		{
-			QUERYRECORDRECT qrr;
-			int scrollpixels = 0, midway;
-
-			qrr.cb = sizeof(QUERYRECORDRECT);
-			qrr.pRecord = pCore;
-			qrr.fRightSplitWindow = 0;
-			qrr.fsExtent = CMA_TEXT;
-
-			WinSendMsg(handle, CM_SETRECORDEMPHASIS, (MPARAM)pCore, MPFROM2SHORT(TRUE, CRA_CURSORED));
-			WinSendMsg(handle, CM_QUERYVIEWPORTRECT, (MPARAM)&viewport, MPFROM2SHORT(CMA_WORKSPACE, FALSE));
-			WinSendMsg(handle, CM_QUERYRECORDRECT, (MPARAM)&item, (MPARAM)&qrr);
-
-			midway = (viewport.yTop - viewport.yBottom)/2;
-			scrollpixels = viewport.yTop - (item.yTop + midway);
-
-			WinSendMsg(handle, CM_SCROLLWINDOW, MPFROMSHORT(CMA_VERTICAL),  MPFROMLONG(scrollpixels));
-			return;
-		}
-
-		pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
-	}
+   RECTL viewport, item;
+   PRECORDCORE pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
+
+   while(pCore)
+   {
+      if((char *)pCore->pszIcon == text)
+      {
+         QUERYRECORDRECT qrr;
+         int scrollpixels = 0, midway;
+
+         qrr.cb = sizeof(QUERYRECORDRECT);
+         qrr.pRecord = pCore;
+         qrr.fRightSplitWindow = 0;
+         qrr.fsExtent = CMA_TEXT;
+
+         WinSendMsg(handle, CM_SETRECORDEMPHASIS, (MPARAM)pCore, MPFROM2SHORT(TRUE, CRA_CURSORED));
+         WinSendMsg(handle, CM_QUERYVIEWPORTRECT, (MPARAM)&viewport, MPFROM2SHORT(CMA_WORKSPACE, FALSE));
+         WinSendMsg(handle, CM_QUERYRECORDRECT, (MPARAM)&item, (MPARAM)&qrr);
+
+         midway = (viewport.yTop - viewport.yBottom)/2;
+         scrollpixels = viewport.yTop - (item.yTop + midway);
+
+         WinSendMsg(handle, CM_SCROLLWINDOW, MPFROMSHORT(CMA_VERTICAL),  MPFROMLONG(scrollpixels));
+         return;
+      }
+
+      pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
+   }
 }
 
 /*
@@ -7486,17 +7501,17 @@
  */
 void API dw_container_delete_row(HWND handle, char *text)
 {
-	PRECORDCORE pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
-
-	while(pCore)
-	{
-		if((char *)pCore->pszIcon == text)
-		{
-			WinSendMsg(handle, CM_REMOVERECORD, (MPARAM)&pCore, MPFROM2SHORT(1, CMA_FREE | CMA_INVALIDATE));
-			return;
-		}
-		pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
-	}
+   PRECORDCORE pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
+
+   while(pCore)
+   {
+      if((char *)pCore->pszIcon == text)
+      {
+         WinSendMsg(handle, CM_REMOVERECORD, (MPARAM)&pCore, MPFROM2SHORT(1, CMA_FREE | CMA_INVALIDATE));
+         return;
+      }
+      pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
+   }
 }
 
 /*
@@ -7506,44 +7521,44 @@
  */
 void API dw_container_optimize(HWND handle)
 {
-	WindowData *blah = (WindowData *)WinQueryWindowPtr(handle, QWP_USER);
-	RECTL item;
-	PRECORDCORE pCore = NULL;
-	int max = 0;
-
-	if(blah && !blah->flags)
-		return;
-
-	pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
-	while(pCore)
-	{
-		QUERYRECORDRECT qrr;
-		int vector;
-
-		qrr.cb = sizeof(QUERYRECORDRECT);
-		qrr.pRecord = pCore;
-		qrr.fRightSplitWindow = 0;
-		qrr.fsExtent = CMA_TEXT;
-
-		WinSendMsg(handle, CM_QUERYRECORDRECT, (MPARAM)&item, (MPARAM)&qrr);
-
-		vector = item.xRight - item.xLeft;
-
-		if(vector > max)
-			max = vector;
-
-		pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
-	}
-
-	if(max)
-	{
-		CNRINFO cnri;
-
-		cnri.cb = sizeof(CNRINFO);
-		cnri.xVertSplitbar  = max;
-
-		WinSendMsg(handle, CM_SETCNRINFO, MPFROMP(&cnri),  MPFROMLONG(CMA_XVERTSPLITBAR));
-	}
+   WindowData *blah = (WindowData *)WinQueryWindowPtr(handle, QWP_USER);
+   RECTL item;
+   PRECORDCORE pCore = NULL;
+   int max = 0;
+
+   if(blah && !blah->flags)
+      return;
+
+   pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)0L, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));
+   while(pCore)
+   {
+      QUERYRECORDRECT qrr;
+      int vector;
+
+      qrr.cb = sizeof(QUERYRECORDRECT);
+      qrr.pRecord = pCore;
+      qrr.fRightSplitWindow = 0;
+      qrr.fsExtent = CMA_TEXT;
+
+      WinSendMsg(handle, CM_QUERYRECORDRECT, (MPARAM)&item, (MPARAM)&qrr);
+
+      vector = item.xRight - item.xLeft;
+
+      if(vector > max)
+         max = vector;
+
+      pCore = WinSendMsg(handle, CM_QUERYRECORD, (MPARAM)pCore, MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
+   }
+
+   if(max)
+   {
+      CNRINFO cnri;
+
+      cnri.cb = sizeof(CNRINFO);
+      cnri.xVertSplitbar  = max;
+
+      WinSendMsg(handle, CM_SETCNRINFO, MPFROMP(&cnri),  MPFROMLONG(CMA_XVERTSPLITBAR));
+   }
 }
 
 /*
@@ -7555,10 +7570,10 @@
  */
 void API dw_taskbar_insert(HWND handle, unsigned long icon, char *bubbletext)
 {
-	handle = handle;
-	icon = icon;
-	bubbletext = bubbletext;
-	/* TODO */
+   handle = handle;
+   icon = icon;
+   bubbletext = bubbletext;
+   /* TODO */
 }
 
 /*
@@ -7569,9 +7584,9 @@
  */
 void API dw_taskbar_delete(HWND handle, unsigned long icon)
 {
-	handle = handle;
-	icon = icon;
-	/* TODO */
+   handle = handle;
+   icon = icon;
+   /* TODO */
 }
 
 /*
@@ -7583,19 +7598,19 @@
  */
 HWND API dw_render_new(unsigned long id)
 {
-	HWND hwndframe = WinCreateWindow(HWND_OBJECT,
-									 WC_FRAME,
-									 NULL,
-									 WS_VISIBLE |
-									 FS_NOBYTEALIGN,
-									 0,0,2000,1000,
-									 NULLHANDLE,
-									 HWND_TOP,
-									 id,
-									 NULL,
-									 NULL);
-	WinSubclassWindow(hwndframe, _RendProc);
-	return hwndframe;
+   HWND hwndframe = WinCreateWindow(HWND_OBJECT,
+                            WC_FRAME,
+                            NULL,
+                            WS_VISIBLE |
+                            FS_NOBYTEALIGN,
+                            0,0,2000,1000,
+                            NULLHANDLE,
+                            HWND_TOP,
+                            id,
+                            NULL,
+                            NULL);
+   WinSubclassWindow(hwndframe, _RendProc);
+   return hwndframe;
 }
 
 /* Sets the current foreground drawing color.
@@ -7606,7 +7621,7 @@
  */
 void API dw_color_foreground_set(unsigned long value)
 {
-	_foreground = value;
+   _foreground = value;
 }
 
 /* Sets the current background drawing color.
@@ -7617,39 +7632,39 @@
  */
 void API dw_color_background_set(unsigned long value)
 {
-	_background = value;
+   _background = value;
 }
 
 int DWSIGNAL _dw_color_cancel_func(HWND window, void *data)
 {
-	DWDialog *dwwait = (DWDialog *)data;
-	HMTX mtx = (HMTX)dw_window_get_data((HWND)dwwait->data, "_dw_mutex");
-	void *val;
-
-	window = (HWND)dwwait->data;
-	val = dw_window_get_data(window, "_dw_val");
-
-	dw_mutex_lock(mtx);
-	dw_mutex_close(mtx);
-	dw_window_destroy(window);
-	dw_dialog_dismiss((DWDialog *)data, val);
-	return FALSE;
+   DWDialog *dwwait = (DWDialog *)data;
+   HMTX mtx = (HMTX)dw_window_get_data((HWND)dwwait->data, "_dw_mutex");
+   void *val;
+
+   window = (HWND)dwwait->data;
+   val = dw_window_get_data(window, "_dw_val");
+
+   dw_mutex_lock(mtx);
+   dw_mutex_close(mtx);
+   dw_window_destroy(window);
+   dw_dialog_dismiss((DWDialog *)data, val);
+   return FALSE;
 }
 
 int DWSIGNAL _dw_color_ok_func(HWND window, void *data)
 {
-	DWDialog *dwwait = (DWDialog *)data;
-	HMTX mtx = (HMTX)dw_window_get_data((HWND)dwwait->data, "_dw_mutex");
-	unsigned long val;
-
-	window = (HWND)dwwait->data;
-	val = _dw_color_spin_get(window);
-
-	dw_mutex_lock(mtx);
-	dw_mutex_close(mtx);
-	dw_window_destroy(window);
-	dw_dialog_dismiss((DWDialog *)data, (void *)val);
-	return FALSE;
+   DWDialog *dwwait = (DWDialog *)data;
+   HMTX mtx = (HMTX)dw_window_get_data((HWND)dwwait->data, "_dw_mutex");
+   unsigned long val;
+
+   window = (HWND)dwwait->data;
+   val = _dw_color_spin_get(window);
+
+   dw_mutex_lock(mtx);
+   dw_mutex_close(mtx);
+   dw_window_destroy(window);
+   dw_dialog_dismiss((DWDialog *)data, (void *)val);
+   return FALSE;
 }
 
 /* Allows the user to choose a color using the system's color chooser dialog.
@@ -7660,122 +7675,122 @@
  */
 unsigned long API dw_color_choose(unsigned long value)
 {
-	HWND window, hbox, vbox, col, button, text;
-	DWDialog *dwwait;
-	HMTX mtx = dw_mutex_new();
-
-	window = dw_window_new( HWND_DESKTOP, "Choose Color", FCF_SHELLPOSITION | FCF_TITLEBAR | FCF_DLGBORDER | FCF_CLOSEBUTTON | FCF_SYSMENU);
-
-	vbox = dw_box_new(DW_VERT, 5);
-
-	dw_box_pack_start(window, vbox, 0, 0, TRUE, TRUE, 0);
-
-	hbox = dw_box_new(DW_HORZ, 0);
-
-	dw_box_pack_start(vbox, hbox, 0, 0, FALSE, FALSE, 0);
-	dw_window_set_style(hbox, 0, WS_CLIPCHILDREN);
-
-	col = WinCreateWindow(vbox, "ColorSelectClass", "", WS_VISIBLE | WS_GROUP, 0, 0, 390, 300, vbox, HWND_TOP, 266, NULL,NULL);
-	dw_box_pack_start(hbox, col, 390, 300, FALSE, FALSE, 0);
-
-	dw_window_set_data(hbox, "_dw_window", (void *)window);
-	dw_window_set_data(window, "_dw_mutex", (void *)mtx);
-	dw_window_set_data(window, "_dw_col", (void *)col);
-	dw_window_set_data(window, "_dw_val", (void *)value);
-
-	hbox = dw_box_new(DW_HORZ, 0);
-	dw_window_set_data(hbox, "_dw_window", (void *)window);
-
-	dw_box_pack_start(vbox, hbox, 0, 0, TRUE, FALSE, 0);
-
-	text = dw_text_new("Red:", 0);
-	dw_window_set_style(text, DW_DT_VCENTER, DW_DT_VCENTER);
-	dw_box_pack_start(hbox, text, 30, 20, FALSE, FALSE, 3);
-
-	button = dw_spinbutton_new("", 1001L);
-	dw_spinbutton_set_limits(button, 255, 0);
-	dw_box_pack_start(hbox, button, 20, 20, TRUE, FALSE, 3);
-	WinSetOwner(button, hbox);
-	dw_window_set_data(window, "_dw_red_spin", (void *)button);
-
-	text = dw_text_new("Green:", 0);
-	dw_window_set_style(text, DW_DT_VCENTER, DW_DT_VCENTER);
-	dw_box_pack_start(hbox, text, 30, 20, FALSE, FALSE, 3);
-
-	button = dw_spinbutton_new("", 1002L);
-	dw_spinbutton_set_limits(button, 255, 0);
-	dw_box_pack_start(hbox, button, 20, 20, TRUE, FALSE, 3);
-	WinSetOwner(button, hbox);
-	dw_window_set_data(window, "_dw_green_spin", (void *)button);
-
-	text = dw_text_new("Blue:", 0);
-	dw_window_set_style(text, DW_DT_VCENTER, DW_DT_VCENTER);
-	dw_box_pack_start(hbox, text, 30, 20, FALSE, FALSE, 3);
-
-	button = dw_spinbutton_new("", 1003L);
-	dw_spinbutton_set_limits(button, 255, 0);
-	dw_box_pack_start(hbox, button, 20, 20, TRUE, FALSE, 3);
-	WinSetOwner(button, hbox);
-	dw_window_set_data(window, "_dw_blue_spin", (void *)button);
-
-	hbox = dw_box_new(DW_HORZ, 0);
-
-	dw_box_pack_start(vbox, hbox, 0, 0, TRUE, FALSE, 0);
-	dw_box_pack_start(hbox, 0, 100, 1, TRUE, FALSE, 0);
-
-	button = dw_button_new("Ok", 1001L);
-	dw_box_pack_start(hbox, button, 50, 30, TRUE, FALSE, 3);
-
-	dwwait = dw_dialog_new((void *)window);
-
-	dw_signal_connect(button, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(_dw_color_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_color_cancel_func), (void *)dwwait);
-	dw_signal_connect(window, DW_SIGNAL_DELETE, DW_SIGNAL_FUNC(_dw_color_cancel_func), (void *)dwwait);
-
-	dw_window_set_size(window, 400, 400);
-
-	_dw_col_set(col, value);
-	_dw_color_spin_set(window, value);
-
-	dw_window_show(window);
-
-	return (unsigned long)dw_dialog_wait(dwwait);
+   HWND window, hbox, vbox, col, button, text;
+   DWDialog *dwwait;
+   HMTX mtx = dw_mutex_new();
+
+   window = dw_window_new( HWND_DESKTOP, "Choose Color", FCF_SHELLPOSITION | FCF_TITLEBAR | FCF_DLGBORDER | FCF_CLOSEBUTTON | FCF_SYSMENU);
+
+   vbox = dw_box_new(DW_VERT, 5);
+
+   dw_box_pack_start(window, vbox, 0, 0, TRUE, TRUE, 0);
+
+   hbox = dw_box_new(DW_HORZ, 0);
+
+   dw_box_pack_start(vbox, hbox, 0, 0, FALSE, FALSE, 0);
+   dw_window_set_style(hbox, 0, WS_CLIPCHILDREN);
+
+   col = WinCreateWindow(vbox, "ColorSelectClass", "", WS_VISIBLE | WS_GROUP, 0, 0, 390, 300, vbox, HWND_TOP, 266, NULL,NULL);
+   dw_box_pack_start(hbox, col, 390, 300, FALSE, FALSE, 0);
+
+   dw_window_set_data(hbox, "_dw_window", (void *)window);
+   dw_window_set_data(window, "_dw_mutex", (void *)mtx);
+   dw_window_set_data(window, "_dw_col", (void *)col);
+   dw_window_set_data(window, "_dw_val", (void *)value);
+
+   hbox = dw_box_new(DW_HORZ, 0);
+   dw_window_set_data(hbox, "_dw_window", (void *)window);
+
+   dw_box_pack_start(vbox, hbox, 0, 0, TRUE, FALSE, 0);
+
+   text = dw_text_new("Red:", 0);
+   dw_window_set_style(text, DW_DT_VCENTER, DW_DT_VCENTER);
+   dw_box_pack_start(hbox, text, 30, 20, FALSE, FALSE, 3);
+
+   button = dw_spinbutton_new("", 1001L);
+   dw_spinbutton_set_limits(button, 255, 0);
+   dw_box_pack_start(hbox, button, 20, 20, TRUE, FALSE, 3);
+   WinSetOwner(button, hbox);
+   dw_window_set_data(window, "_dw_red_spin", (void *)button);
+
+   text = dw_text_new("Green:", 0);
+   dw_window_set_style(text, DW_DT_VCENTER, DW_DT_VCENTER);
+   dw_box_pack_start(hbox, text, 30, 20, FALSE, FALSE, 3);
+
+   button = dw_spinbutton_new("", 1002L);
+   dw_spinbutton_set_limits(button, 255, 0);
+   dw_box_pack_start(hbox, button, 20, 20, TRUE, FALSE, 3);
+   WinSetOwner(button, hbox);
+   dw_window_set_data(window, "_dw_green_spin", (void *)button);
+
+   text = dw_text_new("Blue:", 0);
+   dw_window_set_style(text, DW_DT_VCENTER, DW_DT_VCENTER);
+   dw_box_pack_start(hbox, text, 30, 20, FALSE, FALSE, 3);
+
+   button = dw_spinbutton_new("", 1003L);
+   dw_spinbutton_set_limits(button, 255, 0);
+   dw_box_pack_start(hbox, button, 20, 20, TRUE, FALSE, 3);
+   WinSetOwner(button, hbox);
+   dw_window_set_data(window, "_dw_blue_spin", (void *)button);
+
+   hbox = dw_box_new(DW_HORZ, 0);
+
+   dw_box_pack_start(vbox, hbox, 0, 0, TRUE, FALSE, 0);
+   dw_box_pack_start(hbox, 0, 100, 1, TRUE, FALSE, 0);
+
+   button = dw_button_new("Ok", 1001L);
+   dw_box_pack_start(hbox, button, 50, 30, TRUE, FALSE, 3);
+
+   dwwait = dw_dialog_new((void *)window);
+
+   dw_signal_connect(button, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(_dw_color_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_color_cancel_func), (void *)dwwait);
+   dw_signal_connect(window, DW_SIGNAL_DELETE, DW_SIGNAL_FUNC(_dw_color_cancel_func), (void *)dwwait);
+
+   dw_window_set_size(window, 400, 400);
+
+   _dw_col_set(col, value);
+   _dw_color_spin_set(window, value);
+
+   dw_window_show(window);
+
+   return (unsigned long)dw_dialog_wait(dwwait);
 }
 
 HPS _set_hps(HPS hps)
 {
-	LONG alTable[2];
-
-	alTable[0] = DW_RED_VALUE(_foreground) << 16 | DW_GREEN_VALUE(_foreground) << 8 | DW_BLUE_VALUE(_foreground);
-	alTable[1] = DW_RED_VALUE(_background) << 16 | DW_GREEN_VALUE(_background) << 8 | DW_BLUE_VALUE(_background);
-
-	GpiCreateLogColorTable(hps,
-						   LCOL_RESET,
-						   LCOLF_CONSECRGB,
-						   16,
-						   2,
-						   alTable);
-	if(_foreground & DW_RGB_COLOR)
-		GpiSetColor(hps, 16);
-	else
-		GpiSetColor(hps, _internal_color(_foreground));
-	if(_background & DW_RGB_COLOR)
-		GpiSetBackColor(hps, 17);
-	else
-		GpiSetBackColor(hps, _internal_color(_background));
-	return hps;
+   LONG alTable[2];
+
+   alTable[0] = DW_RED_VALUE(_foreground) << 16 | DW_GREEN_VALUE(_foreground) << 8 | DW_BLUE_VALUE(_foreground);
+   alTable[1] = DW_RED_VALUE(_background) << 16 | DW_GREEN_VALUE(_background) << 8 | DW_BLUE_VALUE(_background);
+
+   GpiCreateLogColorTable(hps,
+                     LCOL_RESET,
+                     LCOLF_CONSECRGB,
+                     16,
+                     2,
+                     alTable);
+   if(_foreground & DW_RGB_COLOR)
+      GpiSetColor(hps, 16);
+   else
+      GpiSetColor(hps, _internal_color(_foreground));
+   if(_background & DW_RGB_COLOR)
+      GpiSetBackColor(hps, 17);
+   else
+      GpiSetBackColor(hps, _internal_color(_background));
+   return hps;
 }
 
 HPS _set_colors(HWND handle)
 {
-	HPS hps = WinGetPS(handle);
-
-	_set_hps(hps);
-	return hps;
+   HPS hps = WinGetPS(handle);
+
+   _set_hps(hps);
+   return hps;
 }
 
 /* Draw a point on a window (preferably a render window).
@@ -7787,29 +7802,29 @@
  */
 void API dw_draw_point(HWND handle, HPIXMAP pixmap, int x, int y)
 {
-	HPS hps;
-	int height;
-	POINTL ptl;
-
-	if(handle)
-	{
-		hps = _set_colors(handle);
+   HPS hps;
+   int height;
+   POINTL ptl;
+
+   if(handle)
+   {
+      hps = _set_colors(handle);
         height = _get_height(handle);
-	}
-	else if(pixmap)
-	{
-		hps = _set_hps(pixmap->hps);
-		height = pixmap->height;
-	}
-	else
-		return;
-
-	ptl.x = x;
-	ptl.y = height - y - 1;
-
-	GpiSetPel(hps, &ptl);
-	if(!pixmap)
-		WinReleasePS(hps);
+   }
+   else if(pixmap)
+   {
+      hps = _set_hps(pixmap->hps);
+      height = pixmap->height;
+   }
+   else
+      return;
+
+   ptl.x = x;
+   ptl.y = height - y - 1;
+
+   GpiSetPel(hps, &ptl);
+   if(!pixmap)
+      WinReleasePS(hps);
 }
 
 /* Draw a line on a window (preferably a render window).
@@ -7823,56 +7838,56 @@
  */
 void API dw_draw_line(HWND handle, HPIXMAP pixmap, int x1, int y1, int x2, int y2)
 {
-	HPS hps;
-	int height;
-	POINTL ptl[2];
-
-	if(handle)
-	{
-		hps = _set_colors(handle);
+   HPS hps;
+   int height;
+   POINTL ptl[2];
+
+   if(handle)
+   {
+      hps = _set_colors(handle);
         height = _get_height(handle);
-	}
-	else if(pixmap)
-	{
-		hps = _set_hps(pixmap->hps);
-		height = pixmap->height;
-	}
-	else
-		return;
-
-	ptl[0].x = x1;
-	ptl[0].y = height - y1 - 1;
-	ptl[1].x = x2;
-	ptl[1].y = height - y2 - 1;
-
-	GpiMove(hps, &ptl[0]);
-	GpiLine(hps, &ptl[1]);
-	
-	if(!pixmap)
-		WinReleasePS(hps);
+   }
+   else if(pixmap)
+   {
+      hps = _set_hps(pixmap->hps);
+      height = pixmap->height;
+   }
+   else
+      return;
+
+   ptl[0].x = x1;
+   ptl[0].y = height - y1 - 1;
+   ptl[1].x = x2;
+   ptl[1].y = height - y2 - 1;
+
+   GpiMove(hps, &ptl[0]);
+   GpiLine(hps, &ptl[1]);
+
+   if(!pixmap)
+      WinReleasePS(hps);
 }
 
 
 void _CopyFontSettings(HPS hpsSrc, HPS hpsDst)
 {
-	FONTMETRICS fm;
-	FATTRS fat;
-	SIZEF sizf;
-
-	GpiQueryFontMetrics(hpsSrc, sizeof(FONTMETRICS), &fm);
+   FONTMETRICS fm;
+   FATTRS fat;
+   SIZEF sizf;
+
+   GpiQueryFontMetrics(hpsSrc, sizeof(FONTMETRICS), &fm);
 
     memset(&fat, 0, sizeof(fat));
 
-	fat.usRecordLength  = sizeof(FATTRS);
-	fat.lMatch          = fm.lMatch;
-	strcpy(fat.szFacename, fm.szFacename);
-
-	GpiCreateLogFont(hpsDst, 0, 1L, &fat);
-	GpiSetCharSet(hpsDst, 1L);
-
-	sizf.cx = MAKEFIXED(fm.lEmInc,0);
-	sizf.cy = MAKEFIXED(fm.lMaxBaselineExt,0);
-	GpiSetCharBox(hpsDst, &sizf );
+   fat.usRecordLength  = sizeof(FATTRS);
+   fat.lMatch          = fm.lMatch;
+   strcpy(fat.szFacename, fm.szFacename);
+
+   GpiCreateLogFont(hpsDst, 0, 1L, &fat);
+   GpiSetCharSet(hpsDst, 1L);
+
+   sizf.cx = MAKEFIXED(fm.lEmInc,0);
+   sizf.cy = MAKEFIXED(fm.lMaxBaselineExt,0);
+   GpiSetCharBox(hpsDst, &sizf );
 }
 
 /* Draw text on a window (preferably a render window).
@@ -7885,51 +7900,51 @@
  */
 void API dw_draw_text(HWND handle, HPIXMAP pixmap, int x, int y, char *text)
 {
-	HPS hps;
-	int z, height;
-	RECTL rcl;
-	char fontname[128];
-	POINTL aptl[TXTBOX_COUNT];
-
-	if(handle)
-	{
-		hps = _set_colors(handle);
-		height = _get_height(handle);
-		_GetPPFont(handle, fontname);
-	}
-	else if(pixmap)
-	{
-		HPS pixmaphps = WinGetPS(pixmap->handle);
-
-		hps = _set_hps(pixmap->hps);
-		height = pixmap->height;
-		_GetPPFont(pixmap->handle, fontname);
-		_CopyFontSettings(pixmaphps, hps);
-		WinReleasePS(pixmaphps);
-	}
-	else
-		return;
-
-	for(z=0;z<strlen(fontname);z++)
-	{
-		if(fontname[z]=='.')
-			break;
-	}
-
-	GpiQueryTextBox(hps, strlen(text), text, TXTBOX_COUNT, aptl);
-
-	rcl.xLeft = x;
-	rcl.yTop = height - y;
-	rcl.yBottom = rcl.yTop - (aptl[TXTBOX_TOPLEFT].y - aptl[TXTBOX_BOTTOMLEFT].y);
-	rcl.xRight = rcl.xLeft + (aptl[TXTBOX_TOPRIGHT].x - aptl[TXTBOX_TOPLEFT].x);
-
-	if(_background == DW_CLR_DEFAULT)
-		WinDrawText(hps, -1, text, &rcl, DT_TEXTATTRS, DT_TEXTATTRS, DT_VCENTER | DT_LEFT | DT_TEXTATTRS);
-	else
-		WinDrawText(hps, -1, text, &rcl, _internal_color(_foreground), _internal_color(_background), DT_VCENTER | DT_LEFT | DT_ERASERECT);
-
-	if(!pixmap)
-		WinReleasePS(hps);
+   HPS hps;
+   int z, height;
+   RECTL rcl;
+   char fontname[128];
+   POINTL aptl[TXTBOX_COUNT];
+
+   if(handle)
+   {
+      hps = _set_colors(handle);
+      height = _get_height(handle);
+      _GetPPFont(handle, fontname);
+   }
+   else if(pixmap)
+   {
+      HPS pixmaphps = WinGetPS(pixmap->handle);
+
+      hps = _set_hps(pixmap->hps);
+      height = pixmap->height;
+      _GetPPFont(pixmap->handle, fontname);
+      _CopyFontSettings(pixmaphps, hps);
+      WinReleasePS(pixmaphps);
+   }
+   else
+      return;
+
+   for(z=0;z<strlen(fontname);z++)
+   {
+      if(fontname[z]=='.')
+         break;
+   }
+
+   GpiQueryTextBox(hps, strlen(text), text, TXTBOX_COUNT, aptl);
+
+   rcl.xLeft = x;
+   rcl.yTop = height - y;
+   rcl.yBottom = rcl.yTop - (aptl[TXTBOX_TOPLEFT].y - aptl[TXTBOX_BOTTOMLEFT].y);
+   rcl.xRight = rcl.xLeft + (aptl[TXTBOX_TOPRIGHT].x - aptl[TXTBOX_TOPLEFT].x);
+
+   if(_background == DW_CLR_DEFAULT)
+      WinDrawText(hps, -1, text, &rcl, DT_TEXTATTRS, DT_TEXTATTRS, DT_VCENTER | DT_LEFT | DT_TEXTATTRS);
+   else
+      WinDrawText(hps, -1, text, &rcl, _internal_color(_foreground), _internal_color(_background), DT_VCENTER | DT_LEFT | DT_ERASERECT);
+
+   if(!pixmap)
+      WinReleasePS(hps);
 }
 
 /* Query the width and height of a text string.
@@ -7942,34 +7957,34 @@
  */
 void API dw_font_text_extents_get(HWND handle, HPIXMAP pixmap, char *text, int *width, int *height)
 {
-	HPS hps;
-	POINTL aptl[TXTBOX_COUNT];
-
-	if(handle)
-	{
-		hps = _set_colors(handle);
-	}
-	else if(pixmap)
-	{
-		HPS pixmaphps = WinGetPS(pixmap->handle);
-
-		hps = _set_hps(pixmap->hps);
-		_CopyFontSettings(pixmaphps, hps);
-		WinReleasePS(pixmaphps);
-	}
-	else
-		return;
-
-	GpiQueryTextBox(hps, strlen(text), text, TXTBOX_COUNT, aptl);
-
-	if(width)
-		*width = aptl[TXTBOX_TOPRIGHT].x - aptl[TXTBOX_TOPLEFT].x;
-
-	if(height)
-		*height = aptl[TXTBOX_TOPLEFT].y - aptl[TXTBOX_BOTTOMLEFT].y;
-
-	if(!pixmap)
-		WinReleasePS(hps);
+   HPS hps;
+   POINTL aptl[TXTBOX_COUNT];
+
+   if(handle)
+   {
+      hps = _set_colors(handle);
+   }
+   else if(pixmap)
+   {
+      HPS pixmaphps = WinGetPS(pixmap->handle);
+
+      hps = _set_hps(pixmap->hps);
+      _CopyFontSettings(pixmaphps, hps);
+      WinReleasePS(pixmaphps);
+   }
+   else
+      return;
+
+   GpiQueryTextBox(hps, strlen(text), text, TXTBOX_COUNT, aptl);
+
+   if(width)
+      *width = aptl[TXTBOX_TOPRIGHT].x - aptl[TXTBOX_TOPLEFT].x;
+
+   if(height)
+      *height = aptl[TXTBOX_TOPLEFT].y - aptl[TXTBOX_BOTTOMLEFT].y;
+
+   if(!pixmap)
+      WinReleasePS(hps);
 }
 
 /* Draw a polygon on a window (preferably a render window).
@@ -8050,33 +8065,33 @@
  */
 void API dw_draw_rect(HWND handle, HPIXMAP pixmap, int fill, int x, int y, int width, int height)
 {
-	HPS hps;
-	int thisheight;
-	POINTL ptl[2];
-
-	if(handle)
-	{
-		hps = _set_colors(handle);
+   HPS hps;
+   int thisheight;
+   POINTL ptl[2];
+
+   if(handle)
+   {
+      hps = _set_colors(handle);
         thisheight = _get_height(handle);
-	}
-	else if(pixmap)
-	{
-		hps = _set_hps(pixmap->hps);
-		thisheight = pixmap->height;
-	}
-	else
-		return;
-
-	ptl[0].x = x;
-	ptl[0].y = thisheight - y - 1;
-	ptl[1].x = x + width - 1;
-	ptl[1].y = thisheight - y - height;
-
-	GpiMove(hps, &ptl[0]);
-	GpiBox(hps, fill ? DRO_OUTLINEFILL : DRO_OUTLINE, &ptl[1], 0, 0);
-	
-	if(!pixmap)
-		WinReleasePS(hps);
+   }
+   else if(pixmap)
+   {
+      hps = _set_hps(pixmap->hps);
+      thisheight = pixmap->height;
+   }
+   else
+      return;
+
+   ptl[0].x = x;
+   ptl[0].y = thisheight - y - 1;
+   ptl[1].x = x + width - 1;
+   ptl[1].y = thisheight - y - height;
+
+   GpiMove(hps, &ptl[0]);
+   GpiBox(hps, fill ? DRO_OUTLINEFILL : DRO_OUTLINE, &ptl[1], 0, 0);
+
+   if(!pixmap)
+      WinReleasePS(hps);
 }
 
 /* Call this after drawing to the screen to make sure
@@ -8098,52 +8113,52 @@
  */
 HPIXMAP API dw_pixmap_new(HWND handle, unsigned long width, unsigned long height, int depth)
 {
-	BITMAPINFOHEADER bmih;
-	SIZEL sizl = { 0, 0 };
-	HPIXMAP pixmap;
-	HDC hdc;
-	HPS hps;
-	ULONG ulFlags;
+   BITMAPINFOHEADER bmih;
+   SIZEL sizl = { 0, 0 };
+   HPIXMAP pixmap;
+   HDC hdc;
+   HPS hps;
+   ULONG ulFlags;
     LONG cPlanes, cBitCount;
 
-	if (!(pixmap = calloc(1,sizeof(struct _hpixmap))))
-		return NULL;
-
-	hps = WinGetPS(handle);
-
-	hdc     = GpiQueryDevice(hps);
-	ulFlags = GpiQueryPS(hps, &sizl);
-
-	pixmap->handle = handle;
-	pixmap->hdc = DevOpenDC(dwhab, OD_MEMORY, "*", 0L, NULL, hdc);
-	pixmap->hps = GpiCreatePS (dwhab, pixmap->hdc, &sizl, ulFlags | GPIA_ASSOC);
-
-	DevQueryCaps(hdc, CAPS_COLOR_PLANES  , 1L, &cPlanes);
-	if (!depth)
-	{
-		DevQueryCaps(hdc, CAPS_COLOR_BITCOUNT, 1L, &cBitCount);
-		depth = cBitCount;
-	}
-
-	memset(&bmih, 0, sizeof(BITMAPINFOHEADER));
-	bmih.cbFix     = sizeof(BITMAPINFOHEADER);
-	bmih.cx        = (SHORT)width;
-	bmih.cy        = (SHORT)height;
-	bmih.cPlanes   = (SHORT)cPlanes;
-	bmih.cBitCount = (SHORT)depth;
-
-	pixmap->width = width; pixmap->height = height;
-
-	pixmap->hbm = GpiCreateBitmap(pixmap->hps, (PBITMAPINFOHEADER2)&bmih, 0L, NULL, NULL);
-
-	GpiSetBitmap(pixmap->hps, pixmap->hbm);
-
-	if (depth>8)
-		GpiCreateLogColorTable(pixmap->hps, LCOL_PURECOLOR, LCOLF_RGB, 0, 0, NULL );
-
-	WinReleasePS(hps);
-
-	return pixmap;
+   if (!(pixmap = calloc(1,sizeof(struct _hpixmap))))
+      return NULL;
+
+   hps = WinGetPS(handle);
+
+   hdc     = GpiQueryDevice(hps);
+   ulFlags = GpiQueryPS(hps, &sizl);
+
+   pixmap->handle = handle;
+   pixmap->hdc = DevOpenDC(dwhab, OD_MEMORY, "*", 0L, NULL, hdc);
+   pixmap->hps = GpiCreatePS (dwhab, pixmap->hdc, &sizl, ulFlags | GPIA_ASSOC);
+
+   DevQueryCaps(hdc, CAPS_COLOR_PLANES  , 1L, &cPlanes);
+   if (!depth)
+   {
+      DevQueryCaps(hdc, CAPS_COLOR_BITCOUNT, 1L, &cBitCount);
+      depth = cBitCount;
+   }
+
+   memset(&bmih, 0, sizeof(BITMAPINFOHEADER));
+   bmih.cbFix     = sizeof(BITMAPINFOHEADER);
+   bmih.cx        = (SHORT)width;
+   bmih.cy        = (SHORT)height;
+   bmih.cPlanes   = (SHORT)cPlanes;
+   bmih.cBitCount = (SHORT)depth;
+
+   pixmap->width = width; pixmap->height = height;
+
+   pixmap->hbm = GpiCreateBitmap(pixmap->hps, (PBITMAPINFOHEADER2)&bmih, 0L, NULL, NULL);
+
+   GpiSetBitmap(pixmap->hps, pixmap->hbm);
+
+   if (depth>8)
+      GpiCreateLogColorTable(pixmap->hps, LCOL_PURECOLOR, LCOLF_RGB, 0, 0, NULL );
+
+   WinReleasePS(hps);
+
+   return pixmap;
 }
 
 /*
@@ -8269,35 +8284,35 @@
  */
 HPIXMAP API dw_pixmap_grab(HWND handle, ULONG id)
 {
-	BITMAPINFOHEADER bmih;
-	SIZEL sizl = { 0, 0 };
-	HPIXMAP pixmap;
-	HDC hdc;
-	HPS hps;
-	ULONG ulFlags;
-
-	if (!(pixmap = calloc(1,sizeof(struct _hpixmap))))
-		return NULL;
-
-	hps = WinGetPS(handle);
-
-	hdc     = GpiQueryDevice(hps);
-	ulFlags = GpiQueryPS(hps, &sizl);
-
-	pixmap->hdc = DevOpenDC(dwhab, OD_MEMORY, "*", 0L, NULL, hdc);
-	pixmap->hps = GpiCreatePS (dwhab, pixmap->hdc, &sizl, ulFlags | GPIA_ASSOC);
-
-	pixmap->hbm = GpiLoadBitmap(pixmap->hps, NULLHANDLE, id, 0, 0);
-
-	GpiQueryBitmapParameters(pixmap->hbm, &bmih);
-
-	GpiSetBitmap(pixmap->hps, pixmap->hbm);
-
-	pixmap->width = bmih.cx; pixmap->height = bmih.cy;
-
-	WinReleasePS(hps);
-
-	return pixmap;
+   BITMAPINFOHEADER bmih;
+   SIZEL sizl = { 0, 0 };
+   HPIXMAP pixmap;
+   HDC hdc;
+   HPS hps;
+   ULONG ulFlags;
+
+   if (!(pixmap = calloc(1,sizeof(struct _hpixmap))))
+      return NULL;
+
+   hps = WinGetPS(handle);
+
+   hdc     = GpiQueryDevice(hps);
+   ulFlags = GpiQueryPS(hps, &sizl);
+
+   pixmap->hdc = DevOpenDC(dwhab, OD_MEMORY, "*", 0L, NULL, hdc);
+   pixmap->hps = GpiCreatePS (dwhab, pixmap->hdc, &sizl, ulFlags | GPIA_ASSOC);
+
+   pixmap->hbm = GpiLoadBitmap(pixmap->hps, NULLHANDLE, id, 0, 0);
+
+   GpiQueryBitmapParameters(pixmap->hbm, &bmih);
+
+   GpiSetBitmap(pixmap->hps, pixmap->hbm);
+
+   pixmap->width = bmih.cx; pixmap->height = bmih.cy;
+
+   WinReleasePS(hps);
+
+   return pixmap;
 }
 
 /*
@@ -8308,12 +8323,12 @@
  */
 void API dw_pixmap_destroy(HPIXMAP pixmap)
 {
-	GpiSetBitmap(pixmap->hps, NULLHANDLE);
-	GpiDeleteBitmap(pixmap->hbm);
-	GpiAssociate(pixmap->hps, NULLHANDLE);
-	GpiDestroyPS(pixmap->hps);
-	DevCloseDC(pixmap->hdc);
-	free(pixmap);
+   GpiSetBitmap(pixmap->hps, NULLHANDLE);
+   GpiDeleteBitmap(pixmap->hbm);
+   GpiAssociate(pixmap->hps, NULLHANDLE);
+   GpiDestroyPS(pixmap->hps);
+   DevCloseDC(pixmap->hdc);
+   free(pixmap);
 }
 
 /*
@@ -8332,68 +8347,68 @@
  */
 void API dw_pixmap_bitblt(HWND dest, HPIXMAP destp, int xdest, int ydest, int width, int height, HWND src, HPIXMAP srcp, int xsrc, int ysrc)
 {
-	HPS hpsdest;
-	HPS hpssrc;
-	POINTL ptl[4];
+   HPS hpsdest;
+   HPS hpssrc;
+   POINTL ptl[4];
     int destheight, srcheight;
 
-	if(dest)
-	{
-		hpsdest = WinGetPS(dest);
-		destheight = _get_height(dest);
-	}
-	else if(destp)
-	{
-		hpsdest = destp->hps;
-		destheight = destp->height;
-	}
-	else
-		return;
-
-	if(src)
-	{
-		hpssrc = WinGetPS(src);
-		srcheight = _get_height(src);
-	}
-	else if(srcp)
-	{
-		hpssrc = srcp->hps;
-		srcheight = srcp->height;
-	}
-	else
-	{
-		if(!destp)
-			WinReleasePS(hpsdest);
-		return;
-	}
-
-	ptl[0].x = xdest;
-	ptl[0].y = (destheight - ydest) - height;
-	ptl[1].x = ptl[0].x + width;
-	ptl[1].y = destheight - ydest;
-	ptl[2].x = xsrc;
-	ptl[2].y = srcheight - (ysrc + height);
-	ptl[3].x = ptl[2].x + width;
-	ptl[3].y = ptl[2].y + height;
-
-	GpiBitBlt(hpsdest, hpssrc, 4, ptl, ROP_SRCCOPY, BBO_IGNORE);
-
-	if(!destp)
-		WinReleasePS(hpsdest);
-	if(!srcp)
-		WinReleasePS(hpssrc);
+   if(dest)
+   {
+      hpsdest = WinGetPS(dest);
+      destheight = _get_height(dest);
+   }
+   else if(destp)
+   {
+      hpsdest = destp->hps;
+      destheight = destp->height;
+   }
+   else
+      return;
+
+   if(src)
+   {
+      hpssrc = WinGetPS(src);
+      srcheight = _get_height(src);
+   }
+   else if(srcp)
+   {
+      hpssrc = srcp->hps;
+      srcheight = srcp->height;
+   }
+   else
+   {
+      if(!destp)
+         WinReleasePS(hpsdest);
+      return;
+   }
+
+   ptl[0].x = xdest;
+   ptl[0].y = (destheight - ydest) - height;
+   ptl[1].x = ptl[0].x + width;
+   ptl[1].y = destheight - ydest;
+   ptl[2].x = xsrc;
+   ptl[2].y = srcheight - (ysrc + height);
+   ptl[3].x = ptl[2].x + width;
+   ptl[3].y = ptl[2].y + height;
+
+   GpiBitBlt(hpsdest, hpssrc, 4, ptl, ROP_SRCCOPY, BBO_IGNORE);
+
+   if(!destp)
+      WinReleasePS(hpsdest);
+   if(!srcp)
+      WinReleasePS(hpssrc);
 }
 
 /* Run DosBeep() in a separate thread so it doesn't block */
 void _beepthread(void *data)
 {
-	int *info = (int *)data;
-
-	if(data)
-	{
-		DosBeep(info[0], info[1]);
-		free(data);
-	}
+   int *info = (int *)data;
+
+   if(data)
+   {
+      DosBeep(info[0], info[1]);
+      free(data);
+   }
 }
 
 /*
@@ -8404,15 +8419,15 @@
  */
 void API dw_beep(int freq, int dur)
 {
-	int *info = malloc(sizeof(int) * 2);
-
-	if(info)
-	{
-		info[0] = freq;
-		info[1] = dur;
-
-		_beginthread(_beepthread, NULL, 100, (void *)info);
-	}
+   int *info = malloc(sizeof(int) * 2);
+
+   if(info)
+   {
+      info[0] = freq;
+      info[1] = dur;
+
+      _beginthread(_beepthread, NULL, 100, (void *)info);
+   }
 }
 
 /* Open a shared library and return a handle.
@@ -8423,9 +8438,9 @@
  */
 int API dw_module_load(char *name, HMOD *handle)
 {
-	char objnamebuf[300] = "";
-
-	return DosLoadModule(objnamebuf, sizeof(objnamebuf), name, handle);
+   char objnamebuf[300] = "";
+
+   return DosLoadModule(objnamebuf, sizeof(objnamebuf), name, handle);
 }
 
 /* Queries the address of a symbol within open handle.
@@ -8437,7 +8452,7 @@
  */
 int API dw_module_symbol(HMOD handle, char *name, void**func)
 {
-	return DosQueryProcAddr(handle, 0, name, (PFN*)func);
+   return DosQueryProcAddr(handle, 0, name, (PFN*)func);
 }
 
 /* Frees the shared library previously opened.
@@ -8446,8 +8461,8 @@
  */
 int API dw_module_close(HMOD handle)
 {
-	DosFreeModule(handle);
-	return 0;
+   DosFreeModule(handle);
+   return 0;
 }
 
 /*
@@ -8455,10 +8470,10 @@
  */
 HMTX API dw_mutex_new(void)
 {
-	HMTX mutex;
-
-	DosCreateMutexSem(NULL, &mutex, 0, FALSE);
-	return mutex;
+   HMTX mutex;
+
+   DosCreateMutexSem(NULL, &mutex, 0, FALSE);
+   return mutex;
 }
 
 /*
@@ -8468,7 +8483,7 @@
  */
 void API dw_mutex_close(HMTX mutex)
 {
-	DosCloseMutexSem(mutex);
+   DosCloseMutexSem(mutex);
 }
 
 /*
@@ -8480,18 +8495,18 @@
  */
 void API dw_mutex_lock(HMTX mutex)
 {
-	if(_dwtid == dw_thread_id())
-	{
-		int rc = DosRequestMutexSem(mutex, SEM_IMMEDIATE_RETURN);
-
-		while(rc == ERROR_TIMEOUT)
-		{
-			dw_main_sleep(10);
-			rc = DosRequestMutexSem(mutex, SEM_IMMEDIATE_RETURN);
-		}
-	}
+   if(_dwtid == dw_thread_id())
+   {
+      int rc = DosRequestMutexSem(mutex, SEM_IMMEDIATE_RETURN);
+
+      while(rc == ERROR_TIMEOUT)
+      {
+         dw_main_sleep(10);
+         rc = DosRequestMutexSem(mutex, SEM_IMMEDIATE_RETURN);
+      }
+   }
     else
-		DosRequestMutexSem(mutex, SEM_INDEFINITE_WAIT);
+      DosRequestMutexSem(mutex, SEM_INDEFINITE_WAIT);
 }
 
 /*
@@ -8501,7 +8516,7 @@
  */
 void API dw_mutex_unlock(HMTX mutex)
 {
-	DosReleaseMutexSem(mutex);
+   DosReleaseMutexSem(mutex);
 }
 
 /*
@@ -8509,12 +8524,12 @@
  */
 HEV API dw_event_new(void)
 {
-	HEV blah;
-
-	if(DosCreateEventSem (NULL, &blah, 0L, FALSE))
-		return 0;
-
-	return blah;
+   HEV blah;
+
+   if(DosCreateEventSem (NULL, &blah, 0L, FALSE))
+      return 0;
+
+   return blah;
 }
 
 /*
@@ -8524,11 +8539,11 @@
  */
 int API dw_event_reset(HEV eve)
 {
-	ULONG count;
-
-	if(DosResetEventSem(eve, &count))
-		return FALSE;
-	return TRUE;
+   ULONG count;
+
+   if(DosResetEventSem(eve, &count))
+      return FALSE;
+   return TRUE;
 }
 
 /*
@@ -8539,9 +8554,9 @@
  */
 int API dw_event_post(HEV eve)
 {
-	if(DosPostEventSem(eve))
-		return FALSE;
-	return TRUE;
+   if(DosPostEventSem(eve))
+      return FALSE;
+   return TRUE;
 }
 
 
@@ -8553,12 +8568,12 @@
  */
 int API dw_event_wait(HEV eve, unsigned long timeout)
 {
-	int rc = DosWaitEventSem(eve, timeout);
-	if(!rc)
-		return 1;
-	if(rc == ERROR_TIMEOUT)
-		return -1;
-	return 0;
+   int rc = DosWaitEventSem(eve, timeout);
+   if(!rc)
+      return 1;
+   if(rc == ERROR_TIMEOUT)
+      return -1;
+   return 0;
 }
 
 /*
@@ -8568,9 +8583,9 @@
  */
 int API dw_event_close(HEV *eve)
 {
-	if(!eve || ~DosCloseEventSem(*eve))
-		return FALSE;
-	return TRUE;
+   if(!eve || ~DosCloseEventSem(*eve))
+      return FALSE;
+   return TRUE;
 }
 
 /* Create a named event semaphore which can be
@@ -8582,19 +8597,19 @@
  */
 HEV API dw_named_event_new(char *name)
 {
-	char *semname = malloc(strlen(name)+8);
-	HEV ev = 0;
-
-	if(!semname)
-		return 0;
-
-	strcpy(semname, "\\sem32\\");
-	strcat(semname, name);
-
-	DosCreateEventSem(semname, &ev, 0L, FALSE);
-
-	free(semname);
-	return ev;
+   char *semname = malloc(strlen(name)+8);
+   HEV ev = 0;
+
+   if(!semname)
+      return 0;
+
+   strcpy(semname, "\\sem32\\");
+   strcat(semname, name);
+
+   DosCreateEventSem(semname, &ev, 0L, FALSE);
+
+   free(semname);
+   return ev;
 }
 
 /* Open an already existing named event semaphore.
@@ -8605,19 +8620,19 @@
  */
 HEV API dw_named_event_get(char *name)
 {
-	char *semname = malloc(strlen(name)+8);
-	HEV ev;
-
-	if(!semname)
-		return 0;
-
-	strcpy(semname, "\\sem32\\");
-	strcat(semname, name);
-
-	DosOpenEventSem(semname, &ev);
-
-	free(semname);
-	return ev;
+   char *semname = malloc(strlen(name)+8);
+   HEV ev;
+
+   if(!semname)
+      return 0;
+
+   strcpy(semname, "\\sem32\\");
+   strcat(semname, name);
+
+   DosOpenEventSem(semname, &ev);
+
+   free(semname);
+   return ev;
 }
 
 /* Resets the event semaphore so threads who call wait
@@ -8628,9 +8643,9 @@
  */
 int API dw_named_event_reset(HEV eve)
 {
-	ULONG count;
-
-	return DosResetEventSem(eve, &count);
+   ULONG count;
+
+   return DosResetEventSem(eve, &count);
 }
 
 /* Sets the posted state of an event semaphore, any threads
@@ -8641,7 +8656,7 @@
  */
 int API dw_named_event_post(HEV eve)
 {
-	return DosPostEventSem(eve);
+   return DosPostEventSem(eve);
 }
 
 
@@ -8655,26 +8670,26 @@
  */
 int API dw_named_event_wait(HEV eve, unsigned long timeout)
 {
-	int rc;
-
-	rc = DosWaitEventSem(eve, timeout);
-	switch (rc)
-	{
-	case ERROR_INVALID_HANDLE:
-		rc = DW_ERROR_NON_INIT;
-		break;
-	case ERROR_NOT_ENOUGH_MEMORY:
-		rc = DW_ERROR_NO_MEM;
-		break;
-	case ERROR_INTERRUPT:
-		rc = DW_ERROR_INTERRUPT;
-		break;
-	case ERROR_TIMEOUT:
-		rc = DW_ERROR_TIMEOUT;
-		break;
-	}
-
-	return rc;
+   int rc;
+
+   rc = DosWaitEventSem(eve, timeout);
+   switch (rc)
+   {
+   case ERROR_INVALID_HANDLE:
+      rc = DW_ERROR_NON_INIT;
+      break;
+   case ERROR_NOT_ENOUGH_MEMORY:
+      rc = DW_ERROR_NO_MEM;
+      break;
+   case ERROR_INTERRUPT:
+      rc = DW_ERROR_INTERRUPT;
+      break;
+   case ERROR_TIMEOUT:
+      rc = DW_ERROR_TIMEOUT;
+      break;
+   }
+
+   return rc;
 }
 
 /* Release this semaphore, if there are no more open
@@ -8685,21 +8700,21 @@
  */
 int API dw_named_event_close(HEV eve)
 {
-	int rc;
-
-	rc = DosCloseEventSem(eve);
-	switch (rc)
-	{
-	case ERROR_INVALID_HANDLE:
-		rc = DW_ERROR_NON_INIT;
-		break;
-
-	case ERROR_SEM_BUSY:
-		rc = DW_ERROR_INTERRUPT;
-		break;
-	}
-
-	return rc;
+   int rc;
+
+   rc = DosCloseEventSem(eve);
+   switch (rc)
+   {
+   case ERROR_INVALID_HANDLE:
+      rc = DW_ERROR_NON_INIT;
+      break;
+
+   case ERROR_SEM_BUSY:
+      rc = DW_ERROR_INTERRUPT;
+      break;
+   }
+
+   return rc;
 }
 
 /*
@@ -8712,14 +8727,14 @@
  */
 HSHM API dw_named_memory_new(void **dest, int size, char *name)
 {
-	char namebuf[1024];
-
-	sprintf(namebuf, "\\sharemem\\%s", name);
-
-	if(DosAllocSharedMem((void *)dest, namebuf, size, PAG_COMMIT | PAG_WRITE | PAG_READ) != NO_ERROR)
-		return 0;
-
-	return 1;
+   char namebuf[1024];
+
+   sprintf(namebuf, "\\sharemem\\%s", name);
+
+   if(DosAllocSharedMem((void *)dest, namebuf, size, PAG_COMMIT | PAG_WRITE | PAG_READ) != NO_ERROR)
+      return 0;
+
+   return 1;
 }
 
 /*
@@ -8731,15 +8746,15 @@
  */
 HSHM API dw_named_memory_get(void **dest, int size, char *name)
 {
-	char namebuf[1024];
-
-	size = size;
-	sprintf(namebuf, "\\sharemem\\%s", name);
-
-	if(DosGetNamedSharedMem((void *)dest, namebuf, PAG_READ | PAG_WRITE) != NO_ERROR)
-		return 0;
-
-	return 1;
+   char namebuf[1024];
+
+   size = size;
+   sprintf(namebuf, "\\sharemem\\%s", name);
+
+   if(DosGetNamedSharedMem((void *)dest, namebuf, PAG_READ | PAG_WRITE) != NO_ERROR)
+      return 0;
+
+   return 1;
 }
 
 /*
@@ -8750,11 +8765,11 @@
  */
 int API dw_named_memory_free(HSHM handle, void *ptr)
 {
-	handle = handle;
-
-	if(DosFreeMem(ptr) != NO_ERROR)
-		return -1;
-	return 0;
+   handle = handle;
+
+   if(DosFreeMem(ptr) != NO_ERROR)
+      return -1;
+   return 0;
 }
 
 /*
@@ -8762,18 +8777,18 @@
  */
 void _dwthreadstart(void *data)
 {
-	HAB thishab = WinInitialize(0);
-	HMQ thishmq = WinCreateMsgQueue(dwhab, 0);
-	void (* API threadfunc)(void *) = NULL;
-	void **tmp = (void **)data;
-
-	threadfunc = (void (* API)(void *))tmp[0];
-	threadfunc(tmp[1]);
-
-	free(tmp);
-
-	WinDestroyMsgQueue(thishmq);
-	WinTerminate(thishab);
+   HAB thishab = WinInitialize(0);
+   HMQ thishmq = WinCreateMsgQueue(dwhab, 0);
+   void (* API threadfunc)(void *) = NULL;
+   void **tmp = (void **)data;
+
+   threadfunc = (void (* API)(void *))tmp[0];
+   threadfunc(tmp[1]);
+
+   free(tmp);
+
+   WinDestroyMsgQueue(thishmq);
+   WinTerminate(thishab);
 }
 
 /*
@@ -8785,12 +8800,12 @@
  */
 DWTID API dw_thread_new(void *func, void *data, int stack)
 {
-	void **tmp = malloc(sizeof(void *) * 2);
-
-	tmp[0] = func;
-	tmp[1] = data;
-
-	return (DWTID)_beginthread((void (*)(void *))_dwthreadstart, NULL, stack, (void *)tmp);
+   void **tmp = malloc(sizeof(void *) * 2);
+
+   tmp[0] = func;
+   tmp[1] = data;
+
+   return (DWTID)_beginthread((void (*)(void *))_dwthreadstart, NULL, stack, (void *)tmp);
 }
 
 /*
@@ -8798,7 +8813,7 @@
  */
 void API dw_thread_end(void)
 {
-	_endthread();
+   _endthread();
 }
 
 /*
@@ -8806,7 +8821,7 @@
  */
 DWTID API dw_thread_id(void)
 {
-	return (DWTID)_threadid;
+   return (DWTID)_threadid;
 }
 
 /*
@@ -8816,17 +8831,17 @@
  */
 void API dw_exit(int exitcode)
 {
-	/* Destroy the menu message window */
-	dw_window_destroy(hwndApp);
-
-	/* In case we are in a signal handler, don't
-	 * try to free memory that could possibly be
-	 * free()'d by the runtime already.
-	 */
-	Root = NULL;
-
-	DosFreeModule(wpconfig);
-	exit(exitcode);
+   /* Destroy the menu message window */
+   dw_window_destroy(hwndApp);
+
+   /* In case we are in a signal handler, don't
+    * try to free memory that could possibly be
+    * free()'d by the runtime already.
+    */
+   Root = NULL;
+
+   DosFreeModule(wpconfig);
+   exit(exitcode);
 }
 
 /*
@@ -8840,34 +8855,34 @@
  */
 HWND API dw_splitbar_new(int type, HWND topleft, HWND bottomright, unsigned long id)
 {
-	HWND tmp = WinCreateWindow(HWND_OBJECT,
-							   SplitbarClassName,
-							   NULL,
-							   WS_VISIBLE | WS_CLIPCHILDREN,
-							   0,0,2000,1000,
-							   NULLHANDLE,
-							   HWND_TOP,
-							   id,
-							   NULL,
-							   NULL);
-	if(tmp)
-	{
-		HWND tmpbox = dw_box_new(DW_VERT, 0);
+   HWND tmp = WinCreateWindow(HWND_OBJECT,
+                        SplitbarClassName,
+                        NULL,
+                        WS_VISIBLE | WS_CLIPCHILDREN,
+                        0,0,2000,1000,
+                        NULLHANDLE,
+                        HWND_TOP,
+                        id,
+                        NULL,
+                        NULL);
+   if(tmp)
+   {
+      HWND tmpbox = dw_box_new(DW_VERT, 0);
         float *percent = malloc(sizeof(float));
 
-		dw_box_pack_start(tmpbox, topleft, 1, 1, TRUE, TRUE, 0);
-		WinSetParent(tmpbox, tmp, FALSE);
-		dw_window_set_data(tmp, "_dw_topleft", (void *)tmpbox);
-
-		tmpbox = dw_box_new(DW_VERT, 0);
-		dw_box_pack_start(tmpbox, bottomright, 1, 1, TRUE, TRUE, 0);
-		WinSetParent(tmpbox, tmp, FALSE);
-		*percent = 50.0;
-		dw_window_set_data(tmp, "_dw_bottomright", (void *)tmpbox);
-		dw_window_set_data(tmp, "_dw_percent", (void *)percent);
-		dw_window_set_data(tmp, "_dw_type", (void *)type);
-	}
-	return tmp;
+      dw_box_pack_start(tmpbox, topleft, 1, 1, TRUE, TRUE, 0);
+      WinSetParent(tmpbox, tmp, FALSE);
+      dw_window_set_data(tmp, "_dw_topleft", (void *)tmpbox);
+
+      tmpbox = dw_box_new(DW_VERT, 0);
+      dw_box_pack_start(tmpbox, bottomright, 1, 1, TRUE, TRUE, 0);
+      WinSetParent(tmpbox, tmp, FALSE);
+      *percent = 50.0;
+      dw_window_set_data(tmp, "_dw_bottomright", (void *)tmpbox);
+      dw_window_set_data(tmp, "_dw_percent", (void *)percent);
+      dw_window_set_data(tmp, "_dw_type", (void *)type);
+   }
+   return tmp;
 }
 
 /*
@@ -8877,16 +8892,16 @@
  */
 void API dw_splitbar_set(HWND handle, float percent)
 {
-	float *mypercent = (float *)dw_window_get_data(handle, "_dw_percent");
-	int type = (int)dw_window_get_data(handle, "_dw_type");
+   float *mypercent = (float *)dw_window_get_data(handle, "_dw_percent");
+   int type = (int)dw_window_get_data(handle, "_dw_type");
     unsigned long width, height;
 
-	if(mypercent)
-		*mypercent = percent;
-
-	dw_window_get_pos_size(handle, NULL, NULL, &width, &height);
-
-	_handle_splitbar_resize(handle, percent, type, width, height);
+   if(mypercent)
+      *mypercent = percent;
+
+   dw_window_get_pos_size(handle, NULL, NULL, &width, &height);
+
+   _handle_splitbar_resize(handle, percent, type, width, height);
 }
 
 /*
@@ -8896,11 +8911,11 @@
  */
 float API 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;
 }
 
 /*
@@ -8916,177 +8931,177 @@
  */
 void API dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad)
 {
-	char *funcname = "dw_box_pack_start()";
-
-	/*
-	 * 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(funcname, DW_MB_OK|DW_MB_ERROR, "Danger! Danger! Will Robinson; box and item are the same!");
-		return;
-	}
-
-	if(WinWindowFromID(box, FID_CLIENT))
-	{
-		box = WinWindowFromID(box, FID_CLIENT);
-		hsize = TRUE;
-		vsize = TRUE;
-	}
-	_dw_box_pack_start(box, item, width, height, hsize, vsize, pad, funcname);
+   char *funcname = "dw_box_pack_start()";
+
+   /*
+    * 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(funcname, DW_MB_OK|DW_MB_ERROR, "Danger! Danger! Will Robinson; box and item are the same!");
+      return;
+   }
+
+   if(WinWindowFromID(box, FID_CLIENT))
+   {
+      box = WinWindowFromID(box, FID_CLIENT);
+      hsize = TRUE;
+      vsize = TRUE;
+   }
+   _dw_box_pack_start(box, item, width, height, hsize, vsize, pad, funcname);
 }
 
 void _dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad, char *functionname)
 {
-	Box *thisbox = WinQueryWindowPtr(box, QWP_USER);
-
-	if(thisbox)
-	{
-		int z;
-		Item *tmpitem, *thisitem = thisbox->items;
-		char tmpbuf[100];
-		HWND frame = (HWND)dw_window_get_data(item, "_dw_combo_box");
-
-		tmpitem = malloc(sizeof(Item)*(thisbox->count+1));
-
-		for(z=0;z<thisbox->count;z++)
-		{
-			tmpitem[z] = thisitem[z];
-		}
-
-		WinQueryClassName(item, 99, tmpbuf);
-
-		if(vsize && !height)
-			height = 1;
-		if(hsize && !width)
-			width = 1;
-
-		if(strncmp(tmpbuf, "#1", 3)==0)
-			tmpitem[thisbox->count].type = TYPEBOX;
-		else
-		{
-			if ( width == 0 && hsize == FALSE )
-				dw_messagebox(functionname, 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(functionname, DW_MB_OK|DW_MB_ERROR, "Height and expand Vertical both unset for box: %x item: %x",box,item);
-
-			tmpitem[thisbox->count].type = TYPEITEM;
-		}
-
-		tmpitem[thisbox->count].hwnd = item;
-		tmpitem[thisbox->count].origwidth = tmpitem[thisbox->count].width = width;
-		tmpitem[thisbox->count].origheight = tmpitem[thisbox->count].height = height;
-		tmpitem[thisbox->count].pad = pad;
-		if(hsize)
-			tmpitem[thisbox->count].hsize = SIZEEXPAND;
-		else
-			tmpitem[thisbox->count].hsize = SIZESTATIC;
-
-		if(vsize)
-			tmpitem[thisbox->count].vsize = SIZEEXPAND;
-		else
-			tmpitem[thisbox->count].vsize = SIZESTATIC;
-
-		thisbox->items = tmpitem;
-
-		if(thisbox->count)
-			free(thisitem);
-
-		thisbox->count++;
+   Box *thisbox = WinQueryWindowPtr(box, QWP_USER);
+
+   if(thisbox)
+   {
+      int z;
+      Item *tmpitem, *thisitem = thisbox->items;
+      char tmpbuf[100];
+      HWND frame = (HWND)dw_window_get_data(item, "_dw_combo_box");
+
+      tmpitem = malloc(sizeof(Item)*(thisbox->count+1));
+
+      for(z=0;z<thisbox->count;z++)
+      {
+         tmpitem[z] = thisitem[z];
+      }
+
+      WinQueryClassName(item, 99, tmpbuf);
+
+      if(vsize && !height)
+         height = 1;
+      if(hsize && !width)
+         width = 1;
+
+      if(strncmp(tmpbuf, "#1", 3)==0)
+         tmpitem[thisbox->count].type = TYPEBOX;
+      else
+      {
+         if ( width == 0 && hsize == FALSE )
+            dw_messagebox(functionname, 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(functionname, DW_MB_OK|DW_MB_ERROR, "Height and expand Vertical both unset for box: %x item: %x",box,item);
+
+         tmpitem[thisbox->count].type = TYPEITEM;
+      }
+
+      tmpitem[thisbox->count].hwnd = item;
+      tmpitem[thisbox->count].origwidth = tmpitem[thisbox->count].width = width;
+      tmpitem[thisbox->count].origheight = tmpitem[thisbox->count].height = height;
+      tmpitem[thisbox->count].pad = pad;
+      if(hsize)
+         tmpitem[thisbox->count].hsize = SIZEEXPAND;
+      else
+         tmpitem[thisbox->count].hsize = SIZESTATIC;
+
+      if(vsize)
+         tmpitem[thisbox->count].vsize = SIZEEXPAND;
+      else
+         tmpitem[thisbox->count].vsize = SIZESTATIC;
+
+      thisbox->items = tmpitem;
+
+      if(thisbox->count)
+         free(thisitem);
+
+      thisbox->count++;
 
         /* Don't set the ownership if it's an entryfield  or spinbutton */
-		WinQueryClassName(item, 99, tmpbuf);
-		if(strncmp(tmpbuf, "#6", 3)!=0 && strncmp(tmpbuf, "#32", 4)!=0 && strncmp(tmpbuf, "#2", 3)!=0)
-			WinSetOwner(item, box);
-		WinSetParent(frame ? frame : item, box, FALSE);
-	}
+      WinQueryClassName(item, 99, tmpbuf);
+      if(strncmp(tmpbuf, "#6", 3)!=0 && strncmp(tmpbuf, "#32", 4)!=0 && strncmp(tmpbuf, "#2", 3)!=0)
+         WinSetOwner(item, box);
+      WinSetParent(frame ? frame : item, box, FALSE);
+   }
 }
 
 /* The following two functions graciously contributed by Peter Nielsen. */
 static ULONG _ParseBuildLevel (char* pchBuffer, ULONG ulSize) {
-	char* pchStart = pchBuffer;
-	char* pchEnd = pchStart + ulSize - 2;
-
-	while (pchEnd >= pchStart)
-	{
-		if ((pchEnd[0] == '#') && (pchEnd[1] == '@'))
-		{
-			*pchEnd-- = '\0';
-			while (pchEnd >= pchStart)
-			{
-				if ((pchEnd[0] == '@') && (pchEnd[1] == '#'))
-				{
-					ULONG ulMajor = 0;
-					ULONG ulMinor = 0;
-
-					char* pch = pchEnd + 2;
-					while (!isdigit ((int)*pch) && *pch)
-						pch++;
-
-					while (isdigit ((int)*pch))
-						ulMajor = ulMajor * 10 + *pch++ - '0';
-
-					if (*pch == '.')
-					{
-						while (isdigit ((int)*++pch))
-							ulMinor = ulMinor * 10 + *pch - '0';
-					}
-					return ((ulMajor << 16) | ulMinor);
-				}
-				pchEnd--;
-			}
-		}
-		pchEnd--;
-	}
-	return (0);
+   char* pchStart = pchBuffer;
+   char* pchEnd = pchStart + ulSize - 2;
+
+   while (pchEnd >= pchStart)
+   {
+      if ((pchEnd[0] == '#') && (pchEnd[1] == '@'))
+      {
+         *pchEnd-- = '\0';
+         while (pchEnd >= pchStart)
+         {
+            if ((pchEnd[0] == '@') && (pchEnd[1] == '#'))
+            {
+               ULONG ulMajor = 0;
+               ULONG ulMinor = 0;
+
+               char* pch = pchEnd + 2;
+               while (!isdigit ((int)*pch) && *pch)
+                  pch++;
+
+               while (isdigit ((int)*pch))
+                  ulMajor = ulMajor * 10 + *pch++ - '0';
+
+               if (*pch == '.')
+               {
+                  while (isdigit ((int)*++pch))
+                     ulMinor = ulMinor * 10 + *pch - '0';
+               }
+               return ((ulMajor << 16) | ulMinor);
+            }
+            pchEnd--;
+         }
+      }
+      pchEnd--;
+   }
+   return (0);
 }
 
 ULONG _GetSystemBuildLevel(void) {
-	/* The build level info is normally available in the end of the OS2KRNL file. However, this is not the case in some beta versions of OS/2.
-	 * We first try to find the info in the 256 last bytes of the file. If that fails, we load the entire file and search it completely.
-	 */
-	ULONG ulBootDrive = 0;
-	ULONG ulBuild = 0;
-	if (DosQuerySysInfo (QSV_BOOT_DRIVE, QSV_BOOT_DRIVE, &ulBootDrive, sizeof (ulBootDrive)) == NO_ERROR)
-	{
-		char achFileName[11] = "C:\\OS2KRNL";
-		HFILE hfile;
-		ULONG ulResult;
+   /* The build level info is normally available in the end of the OS2KRNL file. However, this is not the case in some beta versions of OS/2.
+    * We first try to find the info in the 256 last bytes of the file. If that fails, we load the entire file and search it completely.
+    */
+   ULONG ulBootDrive = 0;
+   ULONG ulBuild = 0;
+   if (DosQuerySysInfo (QSV_BOOT_DRIVE, QSV_BOOT_DRIVE, &ulBootDrive, sizeof (ulBootDrive)) == NO_ERROR)
+   {
+      char achFileName[11] = "C:\\OS2KRNL";
+      HFILE hfile;
+      ULONG ulResult;
 
         achFileName[0] = (char)('A'+ulBootDrive-1);
 
-		if (DosOpen (achFileName, &hfile, &ulResult, 0, 0, OPEN_ACTION_FAIL_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS, OPEN_FLAGS_FAIL_ON_ERROR | OPEN_FLAGS_NO_CACHE | OPEN_FLAGS_SEQUENTIAL | OPEN_SHARE_DENYNONE | OPEN_ACCESS_READONLY, NULL) == NO_ERROR)
-		{
-			ULONG ulFileSize = 0;
-			if (DosSetFilePtr (hfile, 0, FILE_END, &ulFileSize) == NO_ERROR)
-			{
-				const ULONG ulFirstTry = min (256, ulFileSize);
-				if (DosSetFilePtr (hfile, -(LONG)ulFirstTry, FILE_END, &ulResult) == NO_ERROR)
-				{
-					char *pchBuffer = malloc(ulFirstTry);
-					if (DosRead (hfile, pchBuffer, ulFirstTry, &ulResult) == NO_ERROR)
-					{
-						ulBuild = _ParseBuildLevel (pchBuffer, ulFirstTry);
-						if (ulBuild == 0)
-						{
-							if (DosSetFilePtr (hfile, 0, FILE_BEGIN, &ulResult) == NO_ERROR)
-							{
-								free(pchBuffer);
-								pchBuffer = malloc(ulFileSize);
-
-								if (DosRead (hfile, pchBuffer, ulFileSize, &ulResult) == NO_ERROR)
-									ulBuild = _ParseBuildLevel (pchBuffer, ulFileSize);
-							}
-						}
-					}
-					free(pchBuffer);
-				}
-			}
-			DosClose (hfile);
-		}
-	}
-	return (ulBuild);
+      if (DosOpen (achFileName, &hfile, &ulResult, 0, 0, OPEN_ACTION_FAIL_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS, OPEN_FLAGS_FAIL_ON_ERROR | OPEN_FLAGS_NO_CACHE | OPEN_FLAGS_SEQUENTIAL | OPEN_SHARE_DENYNONE | OPEN_ACCESS_READONLY, NULL) == NO_ERROR)
+      {
+         ULONG ulFileSize = 0;
+         if (DosSetFilePtr (hfile, 0, FILE_END, &ulFileSize) == NO_ERROR)
+         {
+            const ULONG ulFirstTry = min (256, ulFileSize);
+            if (DosSetFilePtr (hfile, -(LONG)ulFirstTry, FILE_END, &ulResult) == NO_ERROR)
+            {
+               char *pchBuffer = malloc(ulFirstTry);
+               if (DosRead (hfile, pchBuffer, ulFirstTry, &ulResult) == NO_ERROR)
+               {
+                  ulBuild = _ParseBuildLevel (pchBuffer, ulFirstTry);
+                  if (ulBuild == 0)
+                  {
+                     if (DosSetFilePtr (hfile, 0, FILE_BEGIN, &ulResult) == NO_ERROR)
+                     {
+                        free(pchBuffer);
+                        pchBuffer = malloc(ulFileSize);
+
+                        if (DosRead (hfile, pchBuffer, ulFileSize, &ulResult) == NO_ERROR)
+                           ulBuild = _ParseBuildLevel (pchBuffer, ulFileSize);
+                     }
+                  }
+               }
+               free(pchBuffer);
+            }
+         }
+         DosClose (hfile);
+      }
+   }
+   return (ulBuild);
 }
 
 /*
@@ -9097,15 +9112,15 @@
  */
 void API dw_window_default(HWND window, HWND defaultitem)
 {
-	Box *thisbox = NULL;
-	HWND box;
-
-	box = WinWindowFromID(window, FID_CLIENT);
-	if(box)
-		thisbox = WinQueryWindowPtr(box, QWP_USER);
-
-	if(thisbox)
-		thisbox->defaultitem = defaultitem;
+   Box *thisbox = NULL;
+   HWND box;
+
+   box = WinWindowFromID(window, FID_CLIENT);
+   if(box)
+      thisbox = WinQueryWindowPtr(box, QWP_USER);
+
+   if(thisbox)
+      thisbox->defaultitem = defaultitem;
 }
 
 /*
@@ -9116,10 +9131,10 @@
  */
 void API dw_window_click_default(HWND window, HWND next)
 {
-	WindowData *blah = (WindowData *)WinQueryWindowPtr(window, QWP_USER);
-
-	if(blah)
-		blah->clickdefault = next;
+   WindowData *blah = (WindowData *)WinQueryWindowPtr(window, QWP_USER);
+
+   if(blah)
+      blah->clickdefault = next;
 }
 
 /*
@@ -9154,198 +9169,198 @@
  */
 void API dw_environment_query(DWEnv *env)
 {
-	ULONG Build;
-
-	if(!env)
-		return;
-
-	/* The default is OS/2 2.0 */
-	strcpy(env->osName,"OS/2");
-	env->MajorVersion = 2;
-	env->MinorVersion = 0;
-
-	Build = _GetSystemBuildLevel();
-	env->MinorBuild =  Build & 0xFFFF;
-	env->MajorBuild =  Build >> 16;
-
-	if (aulBuffer[0] == 20)
-	{
-		int i = (unsigned int)aulBuffer[1];
-		if (i > 20)
-		{
-			strcpy(env->osName,"Warp");
-			env->MajorVersion = (int)i/10;
-			env->MinorVersion = i-(((int)i/10)*10);
-		}
-		else if (i == 10)
-			env->MinorVersion = 1;
-	}
-	strcpy(env->buildDate, __DATE__);
-	strcpy(env->buildTime, __TIME__);
-	env->DWMajorVersion = DW_MAJOR_VERSION;
-	env->DWMinorVersion = DW_MINOR_VERSION;
-	env->DWSubVersion = DW_SUB_VERSION;
+   ULONG Build;
+
+   if(!env)
+      return;
+
+   /* The default is OS/2 2.0 */
+   strcpy(env->osName,"OS/2");
+   env->MajorVersion = 2;
+   env->MinorVersion = 0;
+
+   Build = _GetSystemBuildLevel();
+   env->MinorBuild =  Build & 0xFFFF;
+   env->MajorBuild =  Build >> 16;
+
+   if (aulBuffer[0] == 20)
+   {
+      int i = (unsigned int)aulBuffer[1];
+      if (i > 20)
+      {
+         strcpy(env->osName,"Warp");
+         env->MajorVersion = (int)i/10;
+         env->MinorVersion = i-(((int)i/10)*10);
+      }
+      else if (i == 10)
+         env->MinorVersion = 1;
+   }
+   strcpy(env->buildDate, __DATE__);
+   strcpy(env->buildTime, __TIME__);
+   env->DWMajorVersion = DW_MAJOR_VERSION;
+   env->DWMinorVersion = DW_MINOR_VERSION;
+   env->DWSubVersion = DW_SUB_VERSION;
 }
 
 /* The next few functions are support functions for the OS/2 folder browser */
 void _populate_directory(HWND tree, HTREEITEM parent, char *path)
 {
-	FILEFINDBUF3 ffbuf;
-	HTREEITEM item;
-	ULONG count = 1;
-	HDIR hdir = HDIR_CREATE;
-
-	if(DosFindFirst(path, &hdir, FILE_READONLY | FILE_HIDDEN | FILE_SYSTEM | FILE_ARCHIVED | MUST_HAVE_DIRECTORY,
-					&ffbuf, sizeof(FILEFINDBUF3), &count, FIL_STANDARD) == NO_ERROR)
-	{
-		while(DosFindNext(hdir, &ffbuf, sizeof(FILEFINDBUF3), &count) == NO_ERROR)
-		{
-			if(strcmp(ffbuf.achName, ".") && strcmp(ffbuf.achName, ".."))
-			{
-				int len = strlen(path);
-				char *folder = malloc(len + ffbuf.cchName + 2);
-				HTREEITEM tempitem;
-
-				strcpy(folder, path);
-				strcpy(&folder[len-1], ffbuf.achName);
-
-				item = dw_tree_insert(tree, ffbuf.achName, WinLoadFileIcon(folder, TRUE), parent, (void *)parent);
-				tempitem = dw_tree_insert(tree, "", 0, item, 0);
-				dw_tree_item_set_data(tree, item, (void *)tempitem);
-			}
-		}
-		DosFindClose(hdir);
-	}
+   FILEFINDBUF3 ffbuf;
+   HTREEITEM item;
+   ULONG count = 1;
+   HDIR hdir = HDIR_CREATE;
+
+   if(DosFindFirst(path, &hdir, FILE_READONLY | FILE_HIDDEN | FILE_SYSTEM | FILE_ARCHIVED | MUST_HAVE_DIRECTORY,
+               &ffbuf, sizeof(FILEFINDBUF3), &count, FIL_STANDARD) == NO_ERROR)
+   {
+      while(DosFindNext(hdir, &ffbuf, sizeof(FILEFINDBUF3), &count) == NO_ERROR)
+      {
+         if(strcmp(ffbuf.achName, ".") && strcmp(ffbuf.achName, ".."))
+         {
+            int len = strlen(path);
+            char *folder = malloc(len + ffbuf.cchName + 2);
+            HTREEITEM tempitem;
+
+            strcpy(folder, path);
+            strcpy(&folder[len-1], ffbuf.achName);
+
+            item = dw_tree_insert(tree, ffbuf.achName, WinLoadFileIcon(folder, TRUE), parent, (void *)parent);
+            tempitem = dw_tree_insert(tree, "", 0, item, 0);
+            dw_tree_item_set_data(tree, item, (void *)tempitem);
+         }
+      }
+      DosFindClose(hdir);
+   }
 }
 
 void _populate_tree_thread(void *data)
 {
-	HWND window = (HWND)data, tree = (HWND)dw_window_get_data(window, "_dw_tree");
-	HMTX mtx = (HMTX)dw_window_get_data(window, "_dw_mutex");
-	int drive;
-	HTREEITEM items[26];
-	FSINFO  volinfo;
-
-	DosError(FERR_DISABLEHARDERR);
-
-	dw_mutex_lock(mtx);
-	for(drive=0;drive<26;drive++)
-	{
-		if(DosQueryFSInfo(drive+1, FSIL_VOLSER,(PVOID)&volinfo, sizeof(FSINFO)) == NO_ERROR)
-		{
-			char folder[5] = "C:\\", name[9] = "Drive C:";
-			HTREEITEM tempitem;
-
-			folder[0] = name[6] = 'A' + drive;
-
-			items[drive] = dw_tree_insert(tree, name, WinLoadFileIcon(folder, TRUE), NULL, 0);
-			tempitem = dw_tree_insert(tree, "", 0, items[drive], 0);
-			dw_tree_item_set_data(tree, items[drive], (void *)tempitem);
-		}
-		else
-			items[drive] = 0;
-	}
-	dw_mutex_unlock(mtx);
-
-	DosError(FERR_ENABLEHARDERR);
+   HWND window = (HWND)data, tree = (HWND)dw_window_get_data(window, "_dw_tree");
+   HMTX mtx = (HMTX)dw_window_get_data(window, "_dw_mutex");
+   int drive;
+   HTREEITEM items[26];
+   FSINFO  volinfo;
+
+   DosError(FERR_DISABLEHARDERR);
+
+   dw_mutex_lock(mtx);
+   for(drive=0;drive<26;drive++)
+   {
+      if(DosQueryFSInfo(drive+1, FSIL_VOLSER,(PVOID)&volinfo, sizeof(FSINFO)) == NO_ERROR)
+      {
+         char folder[5] = "C:\\", name[9] = "Drive C:";
+         HTREEITEM tempitem;
+
+         folder[0] = name[6] = 'A' + drive;
+
+         items[drive] = dw_tree_insert(tree, name, WinLoadFileIcon(folder, TRUE), NULL, 0);
+         tempitem = dw_tree_insert(tree, "", 0, items[drive], 0);
+         dw_tree_item_set_data(tree, items[drive], (void *)tempitem);
+      }
+      else
+         items[drive] = 0;
+   }
+   dw_mutex_unlock(mtx);
+
+   DosError(FERR_ENABLEHARDERR);
 }
 
 int DWSIGNAL _dw_ok_func(HWND window, void *data)
 {
-	DWDialog *dwwait = (DWDialog *)data;
-	HMTX mtx = (HMTX)dw_window_get_data((HWND)dwwait->data, "_dw_mutex");
-	void *treedata;
-
-	window = window;
-	if(!dwwait)
-		return FALSE;
-
-	dw_mutex_lock(mtx);
-	treedata = dw_window_get_data((HWND)dwwait->data, "_dw_tree_selected");
-	dw_mutex_close(mtx);
-	dw_window_destroy((HWND)dwwait->data);
-	dw_dialog_dismiss((DWDialog *)data, treedata);
-	return FALSE;
+   DWDialog *dwwait = (DWDialog *)data;
+   HMTX mtx = (HMTX)dw_window_get_data((HWND)dwwait->data, "_dw_mutex");
+   void *treedata;
+
+   window = window;
+   if(!dwwait)
+      return FALSE;
+
+   dw_mutex_lock(mtx);
+   treedata = dw_window_get_data((HWND)dwwait->data, "_dw_tree_selected");
+   dw_mutex_close(mtx);
+   dw_window_destroy((HWND)dwwait->data);
+   dw_dialog_dismiss((DWDialog *)data, treedata);
+   return FALSE;
 }
 
 int DWSIGNAL _dw_cancel_func(HWND window, void *data)
 {
-	DWDialog *dwwait = (DWDialog *)data;
-	HMTX mtx = (HMTX)dw_window_get_data((HWND)dwwait->data, "_dw_mutex");
-
-	window = window;
-	if(!dwwait)
-		return FALSE;
-
-	dw_mutex_lock(mtx);
-	dw_mutex_close(mtx);
-	dw_window_destroy((HWND)dwwait->data);
-	dw_dialog_dismiss((DWDialog *)data, NULL);
-	return FALSE;
+   DWDialog *dwwait = (DWDialog *)data;
+   HMTX mtx = (HMTX)dw_window_get_data((HWND)dwwait->data, "_dw_mutex");
+
+   window = window;
+   if(!dwwait)
+      return FALSE;
+
+   dw_mutex_lock(mtx);
+   dw_mutex_close(mtx);
+   dw_window_destroy((HWND)dwwait->data);
+   dw_dialog_dismiss((DWDialog *)data, NULL);
+   return FALSE;
 }
 
 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)
-		{
-			if(strncmp(text, "Drive ", 6) == 0)
-				text = &text[6];
-
-			temp = malloc(strlen(text) + strlen(folder) + 3);
-			strcpy(temp, 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)
+      {
+         if(strncmp(text, "Drive ", 6) == 0)
+            text = &text[6];
+
+         temp = malloc(strlen(text) + strlen(folder) + 3);
+         strcpy(temp, text);
+         strcat(temp, "\\");
+         strcat(temp, folder);
+         free(folder);
+         folder = temp;
+      }
+      parent = dw_tree_get_parent(tree, parent);
+   }
+   return folder;
 }
 
 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;
 }
 
 int DWSIGNAL _tree_expand(HWND window, HTREEITEM item, void *data)
 {
-	HTREEITEM tempitem = (HTREEITEM)dw_tree_item_get_data(window, item);
-
-	data = data;
-	if(tempitem)
-	{
-		char *folder = _tree_folder(window, item);
-
-		dw_tree_item_set_data(window, item, 0);
-		dw_tree_item_delete(window, tempitem);
-
-		if(*folder)
-		{
-			strcat(folder, "*");
-			_populate_directory(window, item, folder);
-		}
-		free(folder);
-	}
-
-	return FALSE;
+   HTREEITEM tempitem = (HTREEITEM)dw_tree_item_get_data(window, item);
+
+   data = data;
+   if(tempitem)
+   {
+      char *folder = _tree_folder(window, item);
+
+      dw_tree_item_set_data(window, item, 0);
+      dw_tree_item_delete(window, tempitem);
+
+      if(*folder)
+      {
+         strcat(folder, "*");
+         _populate_directory(window, item, folder);
+      }
+      free(folder);
+   }
+
+   return FALSE;
 }
 
 /*
@@ -9362,110 +9377,110 @@
  */
 char * API dw_file_browse(char *title, char *defpath, char *ext, int flags)
 {
-	if(flags == DW_DIRECTORY_OPEN)
-	{
-		HWND window, hbox, vbox, tree, button;
-		DWDialog *dwwait;
-		HMTX mtx = dw_mutex_new();
-
-		window = dw_window_new( HWND_DESKTOP, title, FCF_SHELLPOSITION | FCF_TITLEBAR | FCF_SIZEBORDER | 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_mutex", (void *)mtx);
-		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_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_cancel_func), (void *)dwwait);
-		dw_signal_connect(window, DW_SIGNAL_DELETE, DW_SIGNAL_FUNC(_dw_cancel_func), (void *)dwwait);
-
-		dw_window_set_size(window, 225, 300);
-		dw_window_show(window);
-
-		dw_thread_new((void *)_populate_tree_thread, (void *)window, 0xff);
-		return (char *)dw_dialog_wait(dwwait);
-	}
-	else
-	{
-		FILEDLG fild;
-		HWND hwndFile;
-		int len;
-
-		if(defpath)
-			strcpy(fild.szFullFile, defpath);
-		else
-			strcpy(fild.szFullFile, "");
-
-		len = strlen(fild.szFullFile);
-
-		if(len)
-		{
-			if(fild.szFullFile[len-1] != '\\')
-				strcat(fild.szFullFile, "\\");
-		}
-		strcat(fild.szFullFile, "*");
-
-		if(ext)
-		{
-			strcat(fild.szFullFile, ".");
-			strcat(fild.szFullFile, ext);
-		}
-
-		memset(&fild, 0, sizeof(FILEDLG));
-		fild.cbSize = sizeof(FILEDLG);
-		fild.fl = FDS_CENTER | FDS_OPEN_DIALOG;
-		fild.pszTitle = title;
-		fild.pszOKButton = ((flags & DW_FILE_SAVE) ? "Save" : "Open");
-		fild.pfnDlgProc = (PFNWP)WinDefFileDlgProc;
-
-		hwndFile = WinFileDlg(HWND_DESKTOP, HWND_DESKTOP, &fild);
-		if(hwndFile)
-		{
-			switch(fild.lReturn)
-			{
-			case DID_OK:
-				return strdup(fild.szFullFile);
-			case DID_CANCEL:
-				return NULL;
-			}
-		}
-	}
-	return NULL;
+   if(flags == DW_DIRECTORY_OPEN)
+   {
+      HWND window, hbox, vbox, tree, button;
+      DWDialog *dwwait;
+      HMTX mtx = dw_mutex_new();
+
+      window = dw_window_new( HWND_DESKTOP, title, FCF_SHELLPOSITION | FCF_TITLEBAR | FCF_SIZEBORDER | 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_mutex", (void *)mtx);
+      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_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_cancel_func), (void *)dwwait);
+      dw_signal_connect(window, DW_SIGNAL_DELETE, DW_SIGNAL_FUNC(_dw_cancel_func), (void *)dwwait);
+
+      dw_window_set_size(window, 225, 300);
+      dw_window_show(window);
+
+      dw_thread_new((void *)_populate_tree_thread, (void *)window, 0xff);
+      return (char *)dw_dialog_wait(dwwait);
+   }
+   else
+   {
+      FILEDLG fild;
+      HWND hwndFile;
+      int len;
+
+      if(defpath)
+         strcpy(fild.szFullFile, defpath);
+      else
+         strcpy(fild.szFullFile, "");
+
+      len = strlen(fild.szFullFile);
+
+      if(len)
+      {
+         if(fild.szFullFile[len-1] != '\\')
+            strcat(fild.szFullFile, "\\");
+      }
+      strcat(fild.szFullFile, "*");
+
+      if(ext)
+      {
+         strcat(fild.szFullFile, ".");
+         strcat(fild.szFullFile, ext);
+      }
+
+      memset(&fild, 0, sizeof(FILEDLG));
+      fild.cbSize = sizeof(FILEDLG);
+      fild.fl = FDS_CENTER | FDS_OPEN_DIALOG;
+      fild.pszTitle = title;
+      fild.pszOKButton = ((flags & DW_FILE_SAVE) ? "Save" : "Open");
+      fild.pfnDlgProc = (PFNWP)WinDefFileDlgProc;
+
+      hwndFile = WinFileDlg(HWND_DESKTOP, HWND_DESKTOP, &fild);
+      if(hwndFile)
+      {
+         switch(fild.lReturn)
+         {
+         case DID_OK:
+            return strdup(fild.szFullFile);
+         case DID_CANCEL:
+            return NULL;
+         }
+      }
+   }
+   return NULL;
 }
 
 /* Internal function to set drive and directory */
 int _SetPath(char *path)
 {
 #ifndef __WATCOMC__
-	if(strlen(path)	> 2)
-	{
-		if(path[1] == ':')
-		{
-			char drive = toupper(path[0]);
-			_chdrive((drive - 'A')+1);
-		}
-	}
+   if(strlen(path)   > 2)
+   {
+      if(path[1] == ':')
+      {
+         char drive = toupper(path[0]);
+         _chdrive((drive - 'A')+1);
+      }
+   }
 #endif
-	return chdir(path);
+   return chdir(path);
 }
 
 /*
@@ -9479,8 +9494,8 @@
  */
 int API dw_exec(char *program, int type, char **params)
 {
-	type = type; /* keep compiler happy */
-	return spawnvp(P_NOWAIT, program, (const char **)params);
+   type = type; /* keep compiler happy */
+   return spawnvp(P_NOWAIT, program, (const char **)params);
 }
 
 /*
@@ -9490,58 +9505,58 @@
  */
 int API dw_browse(char *url)
 {
-	char *execargs[3], browser[1024], *olddir, *newurl = NULL;
-	int len, ret;
-
-	olddir = _getcwd(NULL, 1024);
-
-	PrfQueryProfileString(HINI_USERPROFILE, "WPURLDEFAULTSETTINGS",
-						  "DefaultWorkingDir", NULL, browser, 1024);
-
-	if(browser[0])
-		_SetPath(browser);
-
-	PrfQueryProfileString(HINI_USERPROFILE, "WPURLDEFAULTSETTINGS",
-						  "DefaultBrowserExe", NULL, browser, 1024);
-
-	len = strlen(browser) - strlen("explore.exe");
-
-	execargs[0] = browser;
-	execargs[1] = url;
-	execargs[2] = NULL;
-
-	/* Special case for Web Explorer, it requires file:/// instead
-	 * of file:// so I am handling it here.
-	 */
-	if(len > 0)
-	{
-		if(stricmp(&browser[len], "explore.exe") == 0 && stricmp(url, "file://") == 0)
-		{
-			int newlen, z;
-			newurl = malloc(strlen(url) + 2);
-			sprintf(newurl, "file:///%s", &url[7]);
-			newlen = strlen(newurl);
-			for(z=8;z<(newlen-8);z++)
-			{
-				if(newurl[z] == '|')
-					newurl[z] = ':';
-				if(newurl[z] == '/')
-					newurl[z] = '\\';
-			}
-			execargs[1] = newurl;
-		}
-	}
-
-	ret = dw_exec(browser, DW_EXEC_GUI, execargs);
-
-	if(olddir)
-	{
-		_SetPath(olddir);
-		free(olddir);
-	}
-	if(newurl)
-		free(newurl);
-	return ret;
+   char *execargs[3], browser[1024], *olddir, *newurl = NULL;
+   int len, ret;
+
+   olddir = _getcwd(NULL, 1024);
+
+   PrfQueryProfileString(HINI_USERPROFILE, "WPURLDEFAULTSETTINGS",
+                    "DefaultWorkingDir", NULL, browser, 1024);
+
+   if(browser[0])
+      _SetPath(browser);
+
+   PrfQueryProfileString(HINI_USERPROFILE, "WPURLDEFAULTSETTINGS",
+                    "DefaultBrowserExe", NULL, browser, 1024);
+
+   len = strlen(browser) - strlen("explore.exe");
+
+   execargs[0] = browser;
+   execargs[1] = url;
+   execargs[2] = NULL;
+
+   /* Special case for Web Explorer, it requires file:/// instead
+    * of file:// so I am handling it here.
+    */
+   if(len > 0)
+   {
+      if(stricmp(&browser[len], "explore.exe") == 0 && stricmp(url, "file://") == 0)
+      {
+         int newlen, z;
+         newurl = malloc(strlen(url) + 2);
+         sprintf(newurl, "file:///%s", &url[7]);
+         newlen = strlen(newurl);
+         for(z=8;z<(newlen-8);z++)
+         {
+            if(newurl[z] == '|')
+               newurl[z] = ':';
+            if(newurl[z] == '/')
+               newurl[z] = '\\';
+         }
+         execargs[1] = newurl;
+      }
+   }
+
+   ret = dw_exec(browser, DW_EXEC_GUI, execargs);
+
+   if(olddir)
+   {
+      _SetPath(olddir);
+      free(olddir);
+   }
+   if(newurl)
+      free(newurl);
+   return ret;
 }
 
 /*
@@ -9552,8 +9567,8 @@
  */
 void API dw_html_action(HWND handle, int action)
 {
-	handle = handle;
-	action = action;
+   handle = handle;
+   action = action;
 }
 
 /*
@@ -9567,9 +9582,9 @@
  */
 int API dw_html_raw(HWND handle, char *string)
 {
-	handle = handle;
-	string = string;
-	return -1;
+   handle = handle;
+   string = string;
+   return -1;
 }
 
 /*
@@ -9583,21 +9598,22 @@
  */
 int API dw_html_url(HWND handle, char *url)
 {
-	handle = handle;
-	url = url;
-	return -1;
-}
-
-/*
- * Create a new Entryfield window (widget) to be packed.
+   handle = handle;
+   url = url;
+   return -1;
+}
+
+/*
+ * Create a new HTML window (widget) to be packed.
+ * Not available under OS/2, eCS
  * Parameters:
  *       text: The default text to be in the entryfield widget.
  *       id: An ID to be used with dw_window_from_id() or 0L.
  */
 HWND API dw_html_new(unsigned long id)
 {
-	id = id;
-    return dw_box_new(DW_HORZ, 0);
+   id = id;
+   return dw_box_new(DW_HORZ, 0);
 }
 
 /*
@@ -9607,18 +9623,18 @@
  */
 char * API 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, "C:\\");
-	}
-	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, "C:\\");
+   }
+   return _user_dir;
 }
 
 /*
@@ -9630,7 +9646,7 @@
  */
 void API dw_window_function(HWND handle, void *function, void *data)
 {
-	WinSendMsg(handle, WM_USER, (MPARAM)function, (MPARAM)data);
+   WinSendMsg(handle, WM_USER, (MPARAM)function, (MPARAM)data);
 }
 
 /* Functions for managing the user data lists that are associated with
@@ -9639,92 +9655,92 @@
  */
 UserData *_find_userdata(UserData **root, char *varname)
 {
-	UserData *tmp = *root;
-
-	while(tmp)
-	{
-		if(stricmp(tmp->varname, varname) == 0)
-			return tmp;
-		tmp = tmp->next;
-	}
-	return NULL;
+   UserData *tmp = *root;
+
+   while(tmp)
+   {
+      if(stricmp(tmp->varname, varname) == 0)
+         return tmp;
+      tmp = tmp->next;
+   }
+   return NULL;
 }
 
 int _new_userdata(UserData **root, char *varname, void *data)
 {
-	UserData *new = _find_userdata(root, varname);
-
-	if(new)
-	{
-		new->data = data;
-		return TRUE;
-	}
-	else
-	{
-		new = malloc(sizeof(UserData));
-		if(new)
-		{
-			new->varname = strdup(varname);
-			new->data = data;
-
-			new->next = NULL;
-
-			if (!*root)
-				*root = new;
-			else
-			{
-				UserData *prev = NULL, *tmp = *root;
-				while(tmp)
-				{
-					prev = tmp;
-					tmp = tmp->next;
-				}
-				if(prev)
-					prev->next = new;
-				else
-					*root = new;
-			}
-			return TRUE;
-		}
-	}
-	return FALSE;
+   UserData *new = _find_userdata(root, varname);
+
+   if(new)
+   {
+      new->data = data;
+      return TRUE;
+   }
+   else
+   {
+      new = malloc(sizeof(UserData));
+      if(new)
+      {
+         new->varname = strdup(varname);
+         new->data = data;
+
+         new->next = NULL;
+
+         if (!*root)
+            *root = new;
+         else
+         {
+            UserData *prev = NULL, *tmp = *root;
+            while(tmp)
+            {
+               prev = tmp;
+               tmp = tmp->next;
+            }
+            if(prev)
+               prev->next = new;
+            else
+               *root = new;
+         }
+         return TRUE;
+      }
+   }
+   return FALSE;
 }
 
 int _remove_userdata(UserData **root, char *varname, int all)
 {
-	UserData *prev = NULL, *tmp = *root;
-
-	while(tmp)
-	{
-		if(all || stricmp(tmp->varname, varname) == 0)
-		{
-			if(!prev)
-			{
-				*root = tmp->next;
-				free(tmp->varname);
-				free(tmp);
-				if(!all)
-					return 0;
-				tmp = *root;
-			}
-			else
-			{
-				/* If all is true we should
-				 * never get here.
-				 */
-				prev->next = tmp->next;
-				free(tmp->varname);
-				free(tmp);
-				return 0;
-			}
-		}
-		else
-		{
-			prev = tmp;
-			tmp = tmp->next;
-		}
-	}
-	return 0;
+   UserData *prev = NULL, *tmp = *root;
+
+   while(tmp)
+   {
+      if(all || stricmp(tmp->varname, varname) == 0)
+      {
+         if(!prev)
+         {
+            *root = tmp->next;
+            free(tmp->varname);
+            free(tmp);
+            if(!all)
+               return 0;
+            tmp = *root;
+         }
+         else
+         {
+            /* If all is true we should
+             * never get here.
+             */
+            prev->next = tmp->next;
+            free(tmp->varname);
+            free(tmp);
+            return 0;
+         }
+      }
+      else
+      {
+         prev = tmp;
+         tmp = tmp->next;
+      }
+   }
+   return 0;
 }
 
 /*
@@ -9736,26 +9752,26 @@
  */
 void API dw_window_set_data(HWND window, char *dataname, void *data)
 {
-	WindowData *blah = (WindowData *)WinQueryWindowPtr(window, QWP_USER);
-
-	if(!blah)
-	{
-		if(!dataname)
-			return;
-
-		blah = calloc(1, sizeof(WindowData));
-		WinSetWindowPtr(window, QWP_USER, blah);
-	}
-
-	if(data)
-		_new_userdata(&(blah->root), dataname, data);
-	else
-	{
-		if(dataname)
-			_remove_userdata(&(blah->root), dataname, FALSE);
-		else
-			_remove_userdata(&(blah->root), NULL, TRUE);
-	}
+   WindowData *blah = (WindowData *)WinQueryWindowPtr(window, QWP_USER);
+
+   if(!blah)
+   {
+      if(!dataname)
+         return;
+
+      blah = calloc(1, sizeof(WindowData));
+      WinSetWindowPtr(window, QWP_USER, blah);
+   }
+
+   if(data)
+      _new_userdata(&(blah->root), dataname, data);
+   else
+   {
+      if(dataname)
+         _remove_userdata(&(blah->root), dataname, FALSE);
+      else
+         _remove_userdata(&(blah->root), NULL, TRUE);
+   }
 }
 
 /*
@@ -9767,15 +9783,15 @@
  */
 void * API dw_window_get_data(HWND window, char *dataname)
 {
-	WindowData *blah = (WindowData *)WinQueryWindowPtr(window, QWP_USER);
-
-	if(blah && blah->root && dataname)
-	{
-		UserData *ud = _find_userdata(&(blah->root), dataname);
-		if(ud)
-			return ud->data;
-	}
-	return NULL;
+   WindowData *blah = (WindowData *)WinQueryWindowPtr(window, QWP_USER);
+
+   if(blah && blah->root && dataname)
+   {
+      UserData *ud = _find_userdata(&(blah->root), dataname);
+      if(ud)
+         return ud->data;
+   }
+   return NULL;
 }
 
 /*
@@ -9789,17 +9805,17 @@
  */
 int API dw_timer_connect(int interval, void *sigfunc, void *data)
 {
-	if(sigfunc)
-	{
-		int timerid = WinStartTimer(dwhab, NULLHANDLE, 0, interval);
-
-		if(timerid)
-		{
-			_new_signal(WM_TIMER, NULLHANDLE, timerid, sigfunc, data);
-			return timerid;
-		}
-	}
-	return 0;
+   if(sigfunc)
+   {
+      int timerid = WinStartTimer(dwhab, NULLHANDLE, 0, interval);
+
+      if(timerid)
+      {
+         _new_signal(WM_TIMER, NULLHANDLE, timerid, sigfunc, data);
+         return timerid;
+      }
+   }
+   return 0;
 }
 
 /*
@@ -9809,37 +9825,37 @@
  */
 void API dw_timer_disconnect(int id)
 {
-	SignalHandler *prev = NULL, *tmp = Root;
-
-	/* 0 is an invalid timer ID */
-	if(!id)
-		return;
-
-	WinStopTimer(dwhab, NULLHANDLE, id);
-
-	while(tmp)
-	{
-		if(tmp->id == id)
-		{
-			if(prev)
-			{
-				prev->next = tmp->next;
-				free(tmp);
-				tmp = prev->next;
-			}
-			else
-			{
-				Root = tmp->next;
-				free(tmp);
-				tmp = Root;
-			}
-		}
-		else
-		{
-			prev = tmp;
-			tmp = tmp->next;
-		}
-	}
+   SignalHandler *prev = NULL, *tmp = Root;
+
+   /* 0 is an invalid timer ID */
+   if(!id)
+      return;
+
+   WinStopTimer(dwhab, NULLHANDLE, id);
+
+   while(tmp)
+   {
+      if(tmp->id == id)
+      {
+         if(prev)
+         {
+            prev->next = tmp->next;
+            free(tmp);
+            tmp = prev->next;
+         }
+         else
+         {
+            Root = tmp->next;
+            free(tmp);
+            tmp = Root;
+         }
+      }
+      else
+      {
+         prev = tmp;
+         tmp = tmp->next;
+      }
+   }
 }
 
 /*
@@ -9852,36 +9868,36 @@
  */
 void API dw_signal_connect(HWND window, char *signame, void *sigfunc, void *data)
 {
-	ULONG message = 0, id = 0;
-
-	if(window && signame && sigfunc)
-	{
-		if((message = _findsigmessage(signame)) != 0)
-		{
-			/* Handle special case of the menu item */
-			if(message == WM_COMMAND && window < 65536)
-			{
-				char buffer[15];
-				HWND owner;
-
-				sprintf(buffer, "_dw_id%d", (int)window);
-				owner = (HWND)dw_window_get_data(hwndApp, buffer);
-
-				if(owner)
-				{
-					id = window;
-					window = owner;
-					dw_window_set_data(hwndApp, buffer, 0);
-				}
-				else
-				{
-					/* If it is a popup menu clear all entries */
-					dw_signal_disconnect_by_window(window);
-				}
-			}
-			_new_signal(message, window, id, sigfunc, data);
-		}
-	}
+   ULONG message = 0, id = 0;
+
+   if(window && signame && sigfunc)
+   {
+      if((message = _findsigmessage(signame)) != 0)
+      {
+         /* Handle special case of the menu item */
+         if(message == WM_COMMAND && window < 65536)
+         {
+            char buffer[15];
+            HWND owner;
+
+            sprintf(buffer, "_dw_id%d", (int)window);
+            owner = (HWND)dw_window_get_data(hwndApp, buffer);
+
+            if(owner)
+            {
+               id = window;
+               window = owner;
+               dw_window_set_data(hwndApp, buffer, 0);
+            }
+            else
+            {
+               /* If it is a popup menu clear all entries */
+               dw_signal_disconnect_by_window(window);
+            }
+         }
+         _new_signal(message, window, id, sigfunc, data);
+      }
+   }
 }
 
 /*
@@ -9891,35 +9907,35 @@
  */
 void API dw_signal_disconnect_by_name(HWND window, char *signame)
 {
-	SignalHandler *prev = NULL, *tmp = Root;
-	ULONG message;
-
-	if(!window || !signame || (message = _findsigmessage(signame)) == 0)
-		return;
-
-	while(tmp)
-	{
-		if(tmp->window == window && tmp->message == message)
-		{
-			if(prev)
-			{
-				prev->next = tmp->next;
-				free(tmp);
-				tmp = prev->next;
-			}
-			else
-			{
-				Root = tmp->next;
-				free(tmp);
-				tmp = Root;
-			}
-		}
-		else
-		{
-			prev = tmp;
-			tmp = tmp->next;
-		}
-	}
+   SignalHandler *prev = NULL, *tmp = Root;
+   ULONG message;
+
+   if(!window || !signame || (message = _findsigmessage(signame)) == 0)
+      return;
+
+   while(tmp)
+   {
+      if(tmp->window == window && tmp->message == message)
+      {
+         if(prev)
+         {
+            prev->next = tmp->next;
+            free(tmp);
+            tmp = prev->next;
+         }
+         else
+         {
+            Root = tmp->next;
+            free(tmp);
+            tmp = Root;
+         }
+      }
+      else
+      {
+         prev = tmp;
+         tmp = tmp->next;
+      }
+   }
 }
 
 /*
@@ -9929,31 +9945,31 @@
  */
 void API dw_signal_disconnect_by_window(HWND window)
 {
-	SignalHandler *prev = NULL, *tmp = Root;
-
-	while(tmp)
-	{
-		if(tmp->window == window)
-		{
-			if(prev)
-			{
-				prev->next = tmp->next;
-				free(tmp);
-				tmp = prev->next;
-			}
-			else
-			{
-				Root = tmp->next;
-				free(tmp);
-				tmp = Root;
-			}
-		}
-		else
-		{
-			prev = tmp;
-			tmp = tmp->next;
-		}
-	}
+   SignalHandler *prev = NULL, *tmp = Root;
+
+   while(tmp)
+   {
+      if(tmp->window == window)
+      {
+         if(prev)
+         {
+            prev->next = tmp->next;
+            free(tmp);
+            tmp = prev->next;
+         }
+         else
+         {
+            Root = tmp->next;
+            free(tmp);
+            tmp = Root;
+         }
+      }
+      else
+      {
+         prev = tmp;
+         tmp = tmp->next;
+      }
+   }
 }
 
 /*
@@ -9964,38 +9980,38 @@
  */
 void API dw_signal_disconnect_by_data(HWND window, void *data)
 {
-	SignalHandler *prev = NULL, *tmp = Root;
-
-	while(tmp)
-	{
-		if(tmp->window == window && tmp->data == data)
-		{
-			if(prev)
-			{
-				prev->next = tmp->next;
-				free(tmp);
-				tmp = prev->next;
-			}
-			else
-			{
-				Root = tmp->next;
-				free(tmp);
-				tmp = Root;
-			}
-		}
-		else
-		{
-			prev = tmp;
-			tmp = tmp->next;
-		}
-	}
+   SignalHandler *prev = NULL, *tmp = Root;
+
+   while(tmp)
+   {
+      if(tmp->window == window && tmp->data == data)
+      {
+         if(prev)
+         {
+            prev->next = tmp->next;
+            free(tmp);
+            tmp = prev->next;
+         }
+         else
+         {
+            Root = tmp->next;
+            free(tmp);
+            tmp = Root;
+         }
+      }
+      else
+      {
+         prev = tmp;
+         tmp = tmp->next;
+      }
+   }
 }
 
 
 
 /*
  * Create a new static text window (widget) to be packed.
- * **** temporary calendar *****
+ * Not available under OS/2, eCS
  * Parameters:
  *       text: The text to be display by the static text widget.
  *       id: An ID to be used with dw_window_from_id() or 0L.
@@ -10003,23 +10019,23 @@
 HWND API dw_calendar_new(ULONG id)
 {
 char *text = "dummy calendar";
-	WindowData *blah = calloc(sizeof(WindowData), 1);
-	HWND tmp = WinCreateWindow(HWND_OBJECT,
-							   WC_STATIC,
-							   text,
-							   WS_VISIBLE | SS_TEXT,
-							   0,0,2000,1000,
-							   NULLHANDLE,
-							   HWND_TOP,
-							   id,
-							   NULL,
-							   NULL);
-	blah->oldproc = WinSubclassWindow(tmp, _textproc);
-	WinSetWindowPtr(tmp, QWP_USER, blah);
-	dw_window_set_font(tmp, DefaultFont);
-	dw_window_set_color(tmp, DW_CLR_BLACK, DW_CLR_PALEGRAY);
-	WinSetWindowText(tmp, text);
-	return tmp;
+   WindowData *blah = calloc(sizeof(WindowData), 1);
+   HWND tmp = WinCreateWindow(HWND_OBJECT,
+                        WC_STATIC,
+                        text,
+                        WS_VISIBLE | SS_TEXT,
+                        0,0,2000,1000,
+                        NULLHANDLE,
+                        HWND_TOP,
+                        id,
+                        NULL,
+                        NULL);
+   blah->oldproc = WinSubclassWindow(tmp, _textproc);
+   WinSetWindowPtr(tmp, QWP_USER, blah);
+   dw_window_set_font(tmp, DefaultFont);
+   dw_window_set_color(tmp, DW_CLR_BLACK, DW_CLR_PALEGRAY);
+   WinSetWindowText(tmp, text);
+   return tmp;
 }
 
 /*
@@ -10027,9 +10043,9 @@
  */
 void API dw_calendar_set_date( HWND window, unsigned int year, unsigned int month, unsigned int day )
 {
-	char tmp[30];
-	sprintf( tmp, "%4.4d-%2.2d-%2.2d", year, month, day);
-	WinSetWindowText(window, tmp);
+   char tmp[30];
+   sprintf( tmp, "%4.4d-%2.2d-%2.2d", year, month, day);
+   WinSetWindowText(window, tmp);
 }
 
 void API dw_calendar_get_date( HWND window, unsigned int *year, unsigned int *month, unsigned int *day )
--- a/win/dw.c	Sun Apr 12 01:41:50 2009 +0000
+++ b/win/dw.c	Sun Oct 03 00:34:36 2010 +0000
@@ -1551,6 +1551,87 @@
    }
 }
 
+#ifdef DEBUG
+long ProcessCustomDraw (LPARAM lParam)
+{
+    LPNMLVCUSTOMDRAW lplvcd = (LPNMLVCUSTOMDRAW)lParam;
+
+    switch(lplvcd->nmcd.dwDrawStage)
+    {
+        case CDDS_PREPAINT : //Before the paint cycle begins
+            //request notifications for individual listview items
+dw_messagebox("LISTVIEW", DW_MB_OK|DW_MB_ERROR, "PREPAINT");
+//            return CDRF_NOTIFYITEMDRAW;
+            return (CDRF_NOTIFYPOSTPAINT | CDRF_NOTIFYITEMDRAW);
+
+        case CDDS_ITEMPREPAINT: //Before an item is drawn
+            {
+dw_messagebox("LISTVIEW", DW_MB_OK|DW_MB_ERROR, "ITEMPREPAINT");
+                return CDRF_NOTIFYSUBITEMDRAW;
+            }
+            break;
+
+        case CDDS_SUBITEM | CDDS_ITEMPREPAINT: //Before a subitem is drawn
+            {
+dw_messagebox("LISTVIEW", DW_MB_OK|DW_MB_ERROR, "SUBITEM ITEMPREPAINT %d",lplvcd->iSubItem);
+                switch(lplvcd->iSubItem)
+                {
+                    case 0:
+                    {
+                      lplvcd->clrText   = RGB(255,255,255);
+                      lplvcd->clrTextBk = RGB(240,55,23);
+                      return CDRF_NEWFONT;
+                    }
+                    break;
+
+                    case 1:
+                    {
+                      lplvcd->clrText   = RGB(255,255,0);
+                      lplvcd->clrTextBk = RGB(0,0,0);
+                      return CDRF_NEWFONT;
+                    }
+                    break;
+
+                    case 2:
+                    {
+                      lplvcd->clrText   = RGB(20,26,158);
+                      lplvcd->clrTextBk = RGB(200,200,10);
+                      return CDRF_NEWFONT;
+                    }
+                    break;
+
+                    case 3:
+                    {
+                      lplvcd->clrText   = RGB(12,15,46);
+                      lplvcd->clrTextBk = RGB(200,200,200);
+                      return CDRF_NEWFONT;
+                    }
+                    break;
+
+                    case 4:
+                    {
+                      lplvcd->clrText   = RGB(120,0,128);
+                      lplvcd->clrTextBk = RGB(20,200,200);
+                      return CDRF_NEWFONT;
+                    }
+                    break;
+
+                    case 5:
+                    {
+                      lplvcd->clrText   = RGB(255,255,255);
+                      lplvcd->clrTextBk = RGB(0,0,150);
+                      return CDRF_NEWFONT;
+                    }
+                    break;
+
+                }
+
+            }
+    }
+    return CDRF_DODEFAULT;
+}
+#endif
+
 /* The main window procedure for Dynamic Windows, all the resizing code is done here. */
 BOOL CALLBACK _wndproc(HWND hWnd, UINT msg, WPARAM mp1, LPARAM mp2)
 {
@@ -1780,6 +1861,10 @@
                         char tmpbuf[100];
 
                         GetClassName(tem->hdr.hwndFrom, tmpbuf, 99);
+#ifdef DEBUG_NOTUSED
+if ( lem->hdr.code == NM_CUSTOMDRAW )
+dw_messagebox("NM_CUSTOMDRAW for (WM_NOTIFY)", DW_MB_OK|DW_MB_ERROR, "%s %d: Classname:%s",__FILE__,__LINE__,tmpbuf);
+#endif
 
                         if(strnicmp(tmpbuf, WC_TREEVIEW, strlen(WC_TREEVIEW))==0)
                         {
@@ -1880,6 +1965,14 @@
                                  }
                               }
                            }
+#ifdef DEBUG
+                           else if ( lem->hdr.code == NM_CUSTOMDRAW )
+                           {
+dw_messagebox("NM_CUSTOMDRAW for WC_LISTVIEW from _wndproc (WM_NOTIFY)", DW_MB_OK|DW_MB_ERROR, "Hello");
+                              SetWindowLong( hWnd, DWL_MSGRESULT, (LONG)ProcessCustomDraw(mp2) );
+                              return TRUE;
+                           }
+#endif
                         }
                      }
                      else if(tmp->message == TCN_SELCHANGE)
@@ -1903,6 +1996,20 @@
                            tmp = NULL;
                         }
                      }
+#ifdef DEBUG_NOTUSED
+                     else
+                     {
+                        NMLISTVIEW FAR *lem=(NMLISTVIEW FAR *)mp2;
+                        char tmpbuf[100];
+                        GetClassName(lem->hdr.hwndFrom, tmpbuf, 99);
+                        if ( strnicmp( tmpbuf, WC_LISTVIEW, strlen(WC_LISTVIEW)+1 ) == 0 && lem->hdr.code == NM_CUSTOMDRAW )
+                        {
+dw_messagebox("NM_CUSTOMDRAW for WC_LISTVIEW(mp2) from _wndproc (WM_NOTIFY)", DW_MB_OK|DW_MB_ERROR, "Hello");
+                           SetWindowLong( hWnd, DWL_MSGRESULT, (LONG)ProcessCustomDraw(mp2) );
+                           tmp = NULL; //return TRUE;
+                        }
+                     }
+#endif
                   }
                   break;
                case WM_COMMAND:
@@ -2081,6 +2188,25 @@
 
             _resize_notebook_page(tem->hwndFrom, num);
          }
+#ifdef DEBUG
+         else
+         {
+            /*
+             * Check if we have a click_default for this window
+             */
+            NMLISTVIEW FAR *lem=(NMLISTVIEW FAR *)mp2;
+            char tmpbuf[100];
+            GetClassName(lem->hdr.hwndFrom, tmpbuf, 99);
+if ( lem->hdr.code == NM_CUSTOMDRAW )
+dw_messagebox("NM_CUSTOMDRAW for (WM_NOTIFY)", DW_MB_OK|DW_MB_ERROR, "%s %d: Classname:%s is it %s",__FILE__,__LINE__,tmpbuf,WC_LISTVIEW);
+            if ( strnicmp( tmpbuf, WC_LISTVIEW, strlen(WC_LISTVIEW)+1 ) == 0 && lem->hdr.code == NM_CUSTOMDRAW )
+            {
+dw_messagebox("NM_CUSTOMDRAW for WC_LISTVIEW(mp2) from _wndproc (WM_NOTIFY) - normal processing", DW_MB_OK|DW_MB_ERROR, "Hello");
+               SetWindowLong( hWnd, DWL_MSGRESULT, (long)ProcessCustomDraw(mp2) );
+               return TRUE;
+            }
+         }
+#endif
       }
       break;
    case WM_HSCROLL:
@@ -2501,11 +2627,10 @@
       {
          if (tmp->message == WM_COMMAND)
          {
-            int (*clickfunc)(HWND, void *) = tmp->signalfunction;
-
             /* Make sure it's the right window, and the right ID */
             if (tmp->window == handle)
             {
+               int (*clickfunc)(HWND, void *) = tmp->signalfunction;
                clickfunc(tmp->window, tmp->data);
                tmp = NULL;
             }
@@ -2634,7 +2759,7 @@
                 */
                HWND tl = _toplevel_window( hWnd );
                ColorInfo *mycinfo = (ColorInfo *)GetWindowLongPtr( tl, GWLP_USERDATA );
-               if ( mycinfo && cinfo->clickdefault )
+               if ( mycinfo && mycinfo->clickdefault )
                {
                   _click_default( mycinfo->clickdefault );
                }
@@ -6229,6 +6354,29 @@
 }
 
 /*
+ * Inserts the specified text to the listbox's (or combobox) entry list.
+ * Parameters:
+ *          handle: Handle to the listbox to be appended to.
+ *          text: Text to append into listbox.
+ *          pos: 0 based position to insert text
+ */
+void API dw_listbox_insert(HWND handle, char *text, int pos)
+{
+   char tmpbuf[100];
+
+   GetClassName(handle, tmpbuf, 99);
+
+   if(strnicmp(tmpbuf, COMBOBOXCLASSNAME, strlen(COMBOBOXCLASSNAME)+1)==0)
+      SendMessage(handle,
+               CB_INSERTSTRING,
+               pos, (LPARAM)text);
+   else
+      SendMessage(handle,
+               LB_INSERTSTRING,
+               pos, (LPARAM)text);
+}
+
+/*
  * Clears the listbox's (or combobox) list of all entries.
  * Parameters:
  *          handle: Handle to the listbox to be cleared.