[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

kocienda kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 05:47:27 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit feb96db284fc1895f967cd4091560fa49c5f5587
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Sep 27 17:35:25 2001 +0000

    This is the big mondo check-in that moves us away from the global
    "KWQ complete" methodology of incorporating our own KWQ-implementations
    of Qt/KDE classes, and moves us to a granular "using-borrowed" method.
    This will give us much more control over switching to new KWQ classes
    as they become available to replace those already provided by Qt/KDE.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@209 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/borrowed-classes.txt b/WebCore/borrowed-classes.txt
new file mode 100644
index 0000000..64dddca
--- /dev/null
+++ b/WebCore/borrowed-classes.txt
@@ -0,0 +1,21 @@
+QArray
+QCollection
+QColor
+QDateTime
+QDict
+QFile
+QList
+QMap
+QPoint
+QPtrDict
+QRect
+QRegExp
+QRegion
+QSize
+QSortedList
+QStack
+QString
+QStringList
+QTextStream
+QValueList
+QVector
diff --git a/WebCore/config.h.in b/WebCore/config.h.in
index b169b88..151e2f7 100644
--- a/WebCore/config.h.in
+++ b/WebCore/config.h.in
@@ -33,6 +33,69 @@
 /* Our platform requires this to handle certain Qt memory mgmt. conventions */
 #define Q_DELETING_VOID_UNDEFINED 1
 
+/* Define if using "borrowed" QArray */
+#undef USING_BORROWED_QARRAY
+
+/* Define if using "borrowed" QCollection */
+#undef USING_BORROWED_QCOLLECTION
+
+/* Define if using "borrowed" QColor */
+#undef USING_BORROWED_QCOLOR
+
+/* Define if using "borrowed" QDateTime */
+#undef USING_BORROWED_QDATETIME
+
+/* Define if using "borrowed" QDict */
+#undef USING_BORROWED_QDICT
+
+/* Define if using "borrowed" QFile */
+#undef USING_BORROWED_QFILE
+
+/* Define if using "borrowed" QList */
+#undef USING_BORROWED_QLIST
+
+/* Define if using "borrowed" QMap */
+#undef USING_BORROWED_QMAP
+
+/* Define if using "borrowed" QPoint */
+#undef USING_BORROWED_QPOINT
+
+/* Define if using "borrowed" QPtrDict */
+#undef USING_BORROWED_QPTRDICT
+
+/* Define if using "borrowed" QRect */
+#undef USING_BORROWED_QRECT
+
+/* Define if using "borrowed" QRegExp */
+#undef USING_BORROWED_QREGEXP
+
+/* Define if using "borrowed" QRegion */
+#undef USING_BORROWED_QREGION
+
+/* Define if using "borrowed" QSize */
+#undef USING_BORROWED_QSIZE
+
+/* Define if using "borrowed" QSortedList */
+#undef USING_BORROWED_QSORTEDLIST
+
+/* Define if using "borrowed" QStack */
+#undef USING_BORROWED_QSTACK
+
+/* Define if using "borrowed" QString */
+#undef USING_BORROWED_QSTRING
+
+/* Define if using "borrowed" QStringList */
+#undef USING_BORROWED_QSTRINGLIST
+
+/* Define if using "borrowed" QTextStream */
+#undef USING_BORROWED_QTEXTSTREAM
+
+/* Define if using "borrowed" QValueList */
+#undef USING_BORROWED_QVALUELIST
+
+/* Define if using "borrowed" QVector */
+#undef USING_BORROWED_QVECTOR
+
 /* Define if using alloca.c.  */
 #undef C_ALLOCA
 
diff --git a/WebCore/configure b/WebCore/configure
index 5528423..d9c800c 100644
--- a/WebCore/configure
+++ b/WebCore/configure
@@ -23,6 +23,48 @@ ac_help="$ac_help
   --enable-qt-datastream  enables Qt datastreams (default off)"
 ac_help="$ac_help
   --enable-qt-textcodec   enables Qt textcodecs (default off)"
+ac_help="$ac_help
+  --enable-borrowed-qarray   enabled use of borrowed QArray (default on)"
+ac_help="$ac_help
+  --enable-borrowed-qcollection   enabled use of borrowed QCollection (default on)"
+ac_help="$ac_help
+  --enable-borrowed-qcolor   enabled use of borrowed QColor (default on)"
+ac_help="$ac_help
+  --enable-borrowed-qdatetime   enabled use of borrowed QDateTime (default on)"
+ac_help="$ac_help
+  --enable-borrowed-qdict   enabled use of borrowed QDict (default on)"
+ac_help="$ac_help
+  --enable-borrowed-qfile   enabled use of borrowed QFile (default on)"
+ac_help="$ac_help
+  --enable-borrowed-qlist   enabled use of borrowed QList (default on)"
+ac_help="$ac_help
+  --enable-borrowed-qmap   enabled use of borrowed QMap (default on)"
+ac_help="$ac_help
+  --enable-borrowed-qpoint   enabled use of borrowed QPoint (default on)"
+ac_help="$ac_help
+  --enable-borrowed-qptrdict   enabled use of borrowed QPtrDict (default on)"
+ac_help="$ac_help
+  --enable-borrowed-qrect   enabled use of borrowed QRect (default on)"
+ac_help="$ac_help
+  --enable-borrowed-qregexp   enabled use of borrowed QRegExp (default on)"
+ac_help="$ac_help
+  --enable-borrowed-qregion   enabled use of borrowed QRegion (default on)"
+ac_help="$ac_help
+  --enable-borrowed-qsize   enabled use of borrowed QSize (default on)"
+ac_help="$ac_help
+  --enable-borrowed-qsortedlist   enabled use of borrowed QSortedList (default on)"
+ac_help="$ac_help
+  --enable-borrowed-qstack   enabled use of borrowed QStack (default on)"
+ac_help="$ac_help
+  --enable-borrowed-qstring   enabled use of borrowed QString (default on)"
+ac_help="$ac_help
+  --enable-borrowed-qstringlist   enabled use of borrowed QStringList (default on)"
+ac_help="$ac_help
+  --enable-borrowed-qtextstream   enabled use of borrowed QTextStream (default on)"
+ac_help="$ac_help
+  --enable-borrowed-qvaluelist   enabled use of borrowed QValueList (default on)"
+ac_help="$ac_help
+  --enable-borrowed-qvector   enabled use of borrowed QVector (default on)"
 
 # Initialize some variables set by options.
 # The variables have the same names as the options, with
@@ -592,7 +634,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:596: checking host system type" >&5
+echo "configure:638: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -623,7 +665,7 @@ esac
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:627: checking for $ac_word" >&5
+echo "configure:669: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -653,7 +695,7 @@ 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:657: checking for $ac_word" >&5
+echo "configure:699: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -704,7 +746,7 @@ fi
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:708: checking for $ac_word" >&5
+echo "configure:750: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -736,7 +778,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:740: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:782: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -747,12 +789,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 751 "configure"
+#line 793 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -778,12 +820,12 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:782: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:824: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:787: checking whether we are using GNU C" >&5
+echo "configure:829: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -792,7 +834,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:796: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:838: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -811,7 +853,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:815: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:857: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -851,7 +893,7 @@ 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:855: checking for $ac_word" >&5
+echo "configure:897: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -883,7 +925,7 @@ test -n "$CXX" || CXX="gcc"
 
 
 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:887: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
+echo "configure:929: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
 
 ac_ext=C
 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -894,12 +936,12 @@ cross_compiling=$ac_cv_prog_cxx_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 898 "configure"
+#line 940 "configure"
 #include "confdefs.h"
 
 int main(){return(0);}
 EOF
-if { (eval echo configure:903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cxx_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -925,12 +967,12 @@ if test $ac_cv_prog_cxx_works = no; then
   { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:929: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:971: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
 cross_compiling=$ac_cv_prog_cxx_cross
 
 echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
-echo "configure:934: checking whether we are using GNU C++" >&5
+echo "configure:976: checking whether we are using GNU C++" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -939,7 +981,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:943: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:985: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gxx=yes
 else
   ac_cv_prog_gxx=no
@@ -958,7 +1000,7 @@ ac_test_CXXFLAGS="${CXXFLAGS+set}"
 ac_save_CXXFLAGS="$CXXFLAGS"
 CXXFLAGS=
 echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
-echo "configure:962: checking whether ${CXX-g++} accepts -g" >&5
+echo "configure:1004: checking whether ${CXX-g++} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -999,7 +1041,7 @@ CXXFLAGS=$CFLAGS
  
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1003: checking how to run the C preprocessor" >&5
+echo "configure:1045: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1014,13 +1056,13 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1018 "configure"
+#line 1060 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1024: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1066: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1031,13 +1073,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1035 "configure"
+#line 1077 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1041: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1083: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1048,13 +1090,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 1052 "configure"
+#line 1094 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1058: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1100: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1081,7 +1123,7 @@ echo "$ac_t""$CPP" 1>&6
 # Extract the first word of "flex", so it can be a program name with args.
 set dummy flex; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1085: checking for $ac_word" >&5
+echo "configure:1127: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1115,7 +1157,7 @@ then
   *) ac_lib=l ;;
   esac
   echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
-echo "configure:1119: checking for yywrap in -l$ac_lib" >&5
+echo "configure:1161: checking for yywrap in -l$ac_lib" >&5
 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1123,7 +1165,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-l$ac_lib  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1127 "configure"
+#line 1169 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1134,7 +1176,7 @@ int main() {
 yywrap()
 ; return 0; }
 EOF
-if { (eval echo configure:1138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1180: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1157,7 +1199,7 @@ fi
 fi
 
 echo $ac_n "checking lex output file root""... $ac_c" 1>&6
-echo "configure:1161: checking lex output file root" >&5
+echo "configure:1203: checking lex output file root" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1178,7 +1220,7 @@ echo "$ac_t""$ac_cv_prog_lex_root" 1>&6
 LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
 
 echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6
-echo "configure:1182: checking whether yytext is a pointer" >&5
+echo "configure:1224: checking whether yytext is a pointer" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1190,14 +1232,14 @@ echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c
 ac_save_LIBS="$LIBS"
 LIBS="$LIBS $LEXLIB"
 cat > conftest.$ac_ext <<EOF
-#line 1194 "configure"
+#line 1236 "configure"
 #include "confdefs.h"
 `cat $LEX_OUTPUT_ROOT.c`
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:1201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_prog_lex_yytext_pointer=yes
 else
@@ -1223,7 +1265,7 @@ 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1227: checking for $ac_word" >&5
+echo "configure:1269: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1264,7 +1306,7 @@ 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1268: checking for $ac_word" >&5
+echo "configure:1310: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1303,7 +1345,7 @@ YACCFLAGS="-d"
 # Extract the first word of "ar", so it can be a program name with args.
 set dummy ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1307: checking for $ac_word" >&5
+echo "configure:1349: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1339,7 +1381,7 @@ ARFLAGS="cr"
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1343: checking for $ac_word" >&5
+echo "configure:1385: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1376,7 +1418,7 @@ 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1380: checking for $ac_word" >&5
+echo "configure:1422: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_SED'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1413,7 +1455,7 @@ fi
 # Extract the first word of "gperf", so it can be a program name with args.
 set dummy gperf; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1417: checking for $ac_word" >&5
+echo "configure:1459: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_GPERF'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1445,7 +1487,7 @@ if test -z "$ac_cv_prog_GPERF"; then
 fi
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1449: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1491: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1483,7 +1525,7 @@ fi
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1487: checking for a BSD compatible install" >&5
+echo "configure:1529: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1558,12 +1600,12 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
 
 echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
-echo "configure:1562: checking whether stat file-mode macros are broken" >&5
+echo "configure:1604: checking whether stat file-mode macros are broken" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1567 "configure"
+#line 1609 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -1618,12 +1660,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:1622: checking for $ac_hdr that defines DIR" >&5
+echo "configure:1664: checking for $ac_hdr that defines DIR" >&5
 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1627 "configure"
+#line 1669 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -1631,7 +1673,7 @@ int main() {
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:1635: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1677: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -1656,7 +1698,7 @@ done
 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
 if test $ac_header_dirent = dirent.h; then
 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:1660: checking for opendir in -ldir" >&5
+echo "configure:1702: checking for opendir in -ldir" >&5
 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1664,7 +1706,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1668 "configure"
+#line 1710 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1675,7 +1717,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:1679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1697,7 +1739,7 @@ fi
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:1701: checking for opendir in -lx" >&5
+echo "configure:1743: checking for opendir in -lx" >&5
 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1705,7 +1747,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1709 "configure"
+#line 1751 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1716,7 +1758,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:1720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1739,12 +1781,12 @@ fi
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1743: checking for ANSI C header files" >&5
+echo "configure:1785: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1748 "configure"
+#line 1790 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -1752,7 +1794,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1756: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1798: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1769,7 +1811,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1773 "configure"
+#line 1815 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -1787,7 +1829,7 @@ fi
 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 <<EOF
-#line 1791 "configure"
+#line 1833 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -1808,7 +1850,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 1812 "configure"
+#line 1854 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1819,7 +1861,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:1823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -1846,17 +1888,17 @@ for ac_hdr in sys/param.h sys/mman.h sys/time.h sys/cdefs.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1850: checking for $ac_hdr" >&5
+echo "configure:1892: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1855 "configure"
+#line 1897 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1860: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1902: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1886,17 +1928,17 @@ for ac_hdr in fnmatch.h sysent.h strings.h sys/stat.h sys/select.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1890: checking for $ac_hdr" >&5
+echo "configure:1932: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1895 "configure"
+#line 1937 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1900: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1942: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1926,17 +1968,17 @@ for ac_hdr in sys/socket.h socketbits.h sigaction.h paths.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1930: checking for $ac_hdr" >&5
+echo "configure:1972: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1935 "configure"
+#line 1977 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1940: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1982: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1966,17 +2008,17 @@ for ac_hdr in malloc.h limits.h dlfcn.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1970: checking for $ac_hdr" >&5
+echo "configure:2012: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1975 "configure"
+#line 2017 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1980: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2022: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2005,7 +2047,7 @@ done
 
 
 echo $ac_n "checking for jpeg_mem_init in -ljpeg""... $ac_c" 1>&6
-echo "configure:2009: checking for jpeg_mem_init in -ljpeg" >&5
+echo "configure:2051: checking for jpeg_mem_init in -ljpeg" >&5
 ac_lib_var=`echo jpeg'_'jpeg_mem_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2013,7 +2055,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ljpeg  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2017 "configure"
+#line 2059 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2024,7 +2066,7 @@ int main() {
 jpeg_mem_init()
 ; return 0; }
 EOF
-if { (eval echo configure:2028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2054,12 +2096,12 @@ fi
 
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2058: checking for working const" >&5
+echo "configure:2100: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2063 "configure"
+#line 2105 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -2108,7 +2150,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:2112: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2154: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -2129,21 +2171,21 @@ EOF
 fi
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:2133: checking for inline" >&5
+echo "configure:2175: checking for inline" >&5
 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat > conftest.$ac_ext <<EOF
-#line 2140 "configure"
+#line 2182 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:2147: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2189: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -2169,12 +2211,12 @@ EOF
 esac
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:2173: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:2215: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2178 "configure"
+#line 2220 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -2183,7 +2225,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:2187: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2229: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -2205,9 +2247,9 @@ fi
 
 
 echo $ac_n "checking whether sys/stat.h declares S_ISSOCK""... $ac_c" 1>&6
-echo "configure:2209: checking whether sys/stat.h declares S_ISSOCK" >&5
+echo "configure:2251: checking whether sys/stat.h declares S_ISSOCK" >&5
 cat > conftest.$ac_ext <<EOF
-#line 2211 "configure"
+#line 2253 "configure"
 #include "confdefs.h"
 #include <sys/stat.h> 
 int main() {
@@ -2221,7 +2263,7 @@ void foo() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2225: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2267: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
     cat >> confdefs.h <<EOF
@@ -2245,12 +2287,12 @@ rm -f conftest*
 for ac_func in socket vsnprintf seteuid setegid random strfmon stpcpy mkstemp gettimeofday setenv unsetenv mkstemps
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2249: checking for $ac_func" >&5
+echo "configure:2291: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2254 "configure"
+#line 2296 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2273,7 +2315,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2306,12 +2348,12 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:2310: checking for pid_t" >&5
+echo "configure:2352: checking for pid_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2315 "configure"
+#line 2357 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2340,17 +2382,17 @@ fi
 
 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:2344: checking for vfork.h" >&5
+echo "configure:2386: checking for vfork.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2349 "configure"
+#line 2391 "configure"
 #include "confdefs.h"
 #include <vfork.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2354: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2396: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2375,18 +2417,18 @@ else
 fi
 
 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:2379: checking for working vfork" >&5
+echo "configure:2421: checking for working vfork" >&5
 if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test "$cross_compiling" = yes; then
   echo $ac_n "checking for vfork""... $ac_c" 1>&6
-echo "configure:2385: checking for vfork" >&5
+echo "configure:2427: checking for vfork" >&5
 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2390 "configure"
+#line 2432 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char vfork(); below.  */
@@ -2409,7 +2451,7 @@ vfork();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_vfork=yes"
 else
@@ -2431,7 +2473,7 @@ fi
 ac_cv_func_vfork_works=$ac_cv_func_vfork
 else
   cat > conftest.$ac_ext <<EOF
-#line 2435 "configure"
+#line 2477 "configure"
 #include "confdefs.h"
 /* Thanks to Paul Eggert for this test.  */
 #include <stdio.h>
@@ -2526,7 +2568,7 @@ main() {
   }
 }
 EOF
-if { (eval echo configure:2530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_vfork_works=yes
 else
@@ -2553,17 +2595,17 @@ for ac_hdr in ieeefp.h float.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2557: checking for $ac_hdr" >&5
+echo "configure:2599: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2562 "configure"
+#line 2604 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2567: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2609: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2590,7 +2632,7 @@ fi
 done
 
 echo $ac_n "checking for isinf in -lm""... $ac_c" 1>&6
-echo "configure:2594: checking for isinf in -lm" >&5
+echo "configure:2636: checking for isinf in -lm" >&5
 ac_lib_var=`echo m'_'isinf | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2598,7 +2640,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2602 "configure"
+#line 2644 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2609,7 +2651,7 @@ int main() {
 isinf()
 ; return 0; }
 EOF
-if { (eval echo configure:2613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2635,7 +2677,7 @@ else
 fi
 
 echo $ac_n "checking for finite in -lm""... $ac_c" 1>&6
-echo "configure:2639: checking for finite in -lm" >&5
+echo "configure:2681: checking for finite in -lm" >&5
 ac_lib_var=`echo m'_'finite | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2643,7 +2685,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2647 "configure"
+#line 2689 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2654,7 +2696,7 @@ int main() {
 finite()
 ; return 0; }
 EOF
-if { (eval echo configure:2658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2680,7 +2722,7 @@ else
 fi
 
 echo $ac_n "checking for _finite in -lm""... $ac_c" 1>&6
-echo "configure:2684: checking for _finite in -lm" >&5
+echo "configure:2726: checking for _finite in -lm" >&5
 ac_lib_var=`echo m'_'_finite | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2688,7 +2730,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2692 "configure"
+#line 2734 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2699,7 +2741,7 @@ int main() {
 _finite()
 ; return 0; }
 EOF
-if { (eval echo configure:2703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2725,7 +2767,7 @@ else
 fi
 
 echo $ac_n "checking for isnan in -lm""... $ac_c" 1>&6
-echo "configure:2729: checking for isnan in -lm" >&5
+echo "configure:2771: checking for isnan in -lm" >&5
 ac_lib_var=`echo m'_'isnan | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2733,7 +2775,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2737 "configure"
+#line 2779 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2744,7 +2786,7 @@ int main() {
 isnan()
 ; return 0; }
 EOF
-if { (eval echo configure:2748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2892,6 +2934,553 @@ fi
 
 
 
+# Check whether --enable-borrowed-qarray or --disable-borrowed-qarray was given.
+if test "${enable_borrowed_qarray+set}" = set; then
+  enableval="$enable_borrowed_qarray"
+  if ( test "$enableval" = "yes" ); then
+    cat >> confdefs.h <<EOF
+#define USING_BORROWED_QARRAY 1
+EOF
+
+fi
+
+else
+  if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QArray$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+cat >> confdefs.h <<EOF
+#define USING_BORROWED_QARRAY 1
+EOF
+
+fi
+fi
+
+fi
+
+
+# Check whether --enable-borrowed-qcollection or --disable-borrowed-qcollection was given.
+if test "${enable_borrowed_qcollection+set}" = set; then
+  enableval="$enable_borrowed_qcollection"
+  if ( test "$enableval" = "yes" ); then
+    cat >> confdefs.h <<EOF
+#define USING_BORROWED_QCOLLECTION 1
+EOF
+
+fi
+
+else
+  if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QCollection$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+cat >> confdefs.h <<EOF
+#define USING_BORROWED_QCOLLECTION 1
+EOF
+
+fi
+fi
+
+fi
+
+
+# Check whether --enable-borrowed-qcolor or --disable-borrowed-qcolor was given.
+if test "${enable_borrowed_qcolor+set}" = set; then
+  enableval="$enable_borrowed_qcolor"
+  if ( test "$enableval" = "yes" ); then
+    cat >> confdefs.h <<EOF
+#define USING_BORROWED_QCOLOR 1
+EOF
+
+fi
+
+else
+  if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QColor$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+cat >> confdefs.h <<EOF
+#define USING_BORROWED_QCOLOR 1
+EOF
+
+fi
+fi
+
+fi
+
+
+# Check whether --enable-borrowed-qdatetime or --disable-borrowed-qdatetime was given.
+if test "${enable_borrowed_qdatetime+set}" = set; then
+  enableval="$enable_borrowed_qdatetime"
+  if ( test "$enableval" = "yes" ); then
+    cat >> confdefs.h <<EOF
+#define USING_BORROWED_QDATETIME 1
+EOF
+
+fi
+
+else
+  if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QDateTime$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+cat >> confdefs.h <<EOF
+#define USING_BORROWED_QDATETIME 1
+EOF
+
+fi
+fi
+
+fi
+
+
+# Check whether --enable-borrowed-qdict or --disable-borrowed-qdict was given.
+if test "${enable_borrowed_qdict+set}" = set; then
+  enableval="$enable_borrowed_qdict"
+  if ( test "$enableval" = "yes" ); then
+    cat >> confdefs.h <<EOF
+#define USING_BORROWED_QDICT 1
+EOF
+
+fi
+
+else
+  if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QDict$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+cat >> confdefs.h <<EOF
+#define USING_BORROWED_QDICT 1
+EOF
+
+fi
+fi
+
+fi
+
+
+# Check whether --enable-borrowed-qfile or --disable-borrowed-qfile was given.
+if test "${enable_borrowed_qfile+set}" = set; then
+  enableval="$enable_borrowed_qfile"
+  if ( test "$enableval" = "yes" ); then
+    cat >> confdefs.h <<EOF
+#define USING_BORROWED_QFILE 1
+EOF
+
+fi
+
+else
+  if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QFile$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+cat >> confdefs.h <<EOF
+#define USING_BORROWED_QFILE 1
+EOF
+
+fi
+fi
+
+fi
+
+
+# Check whether --enable-borrowed-qlist or --disable-borrowed-qlist was given.
+if test "${enable_borrowed_qlist+set}" = set; then
+  enableval="$enable_borrowed_qlist"
+  if ( test "$enableval" = "yes" ); then
+    cat >> confdefs.h <<EOF
+#define USING_BORROWED_QLIST 1
+EOF
+
+fi
+
+else
+  if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QList$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+cat >> confdefs.h <<EOF
+#define USING_BORROWED_QLIST 1
+EOF
+
+fi
+fi
+
+fi
+
+
+# Check whether --enable-borrowed-qmap or --disable-borrowed-qmap was given.
+if test "${enable_borrowed_qmap+set}" = set; then
+  enableval="$enable_borrowed_qmap"
+  if ( test "$enableval" = "yes" ); then
+    cat >> confdefs.h <<EOF
+#define USING_BORROWED_QMAP 1
+EOF
+
+fi
+
+else
+  if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QMap$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+cat >> confdefs.h <<EOF
+#define USING_BORROWED_QMAP 1
+EOF
+
+fi
+fi
+
+fi
+
+
+# Check whether --enable-borrowed-qpoint or --disable-borrowed-qpoint was given.
+if test "${enable_borrowed_qpoint+set}" = set; then
+  enableval="$enable_borrowed_qpoint"
+  if ( test "$enableval" = "yes" ); then
+    cat >> confdefs.h <<EOF
+#define USING_BORROWED_QPOINT 1
+EOF
+
+fi
+
+else
+  if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QPoint$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+cat >> confdefs.h <<EOF
+#define USING_BORROWED_QPOINT 1
+EOF
+
+fi
+fi
+
+fi
+
+
+# Check whether --enable-borrowed-qptrdict or --disable-borrowed-qptrdict was given.
+if test "${enable_borrowed_qptrdict+set}" = set; then
+  enableval="$enable_borrowed_qptrdict"
+  if ( test "$enableval" = "yes" ); then
+    cat >> confdefs.h <<EOF
+#define USING_BORROWED_QPTRDICT 1
+EOF
+
+fi
+
+else
+  if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QPtrDict$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+cat >> confdefs.h <<EOF
+#define USING_BORROWED_QPTRDICT 1
+EOF
+
+fi
+fi
+
+fi
+
+
+# Check whether --enable-borrowed-qrect or --disable-borrowed-qrect was given.
+if test "${enable_borrowed_qrect+set}" = set; then
+  enableval="$enable_borrowed_qrect"
+  if ( test "$enableval" = "yes" ); then
+    cat >> confdefs.h <<EOF
+#define USING_BORROWED_QRECT 1
+EOF
+
+fi
+
+else
+  if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QRect$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+cat >> confdefs.h <<EOF
+#define USING_BORROWED_QRECT 1
+EOF
+
+fi
+fi
+
+fi
+
+
+# Check whether --enable-borrowed-qregexp or --disable-borrowed-qregexp was given.
+if test "${enable_borrowed_qregexp+set}" = set; then
+  enableval="$enable_borrowed_qregexp"
+  if ( test "$enableval" = "yes" ); then
+    cat >> confdefs.h <<EOF
+#define USING_BORROWED_QREGEXP 1
+EOF
+
+fi
+
+else
+  if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QRegExp$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+cat >> confdefs.h <<EOF
+#define USING_BORROWED_QREGEXP 1
+EOF
+
+fi
+fi
+
+fi
+
+
+# Check whether --enable-borrowed-qregion or --disable-borrowed-qregion was given.
+if test "${enable_borrowed_qregion+set}" = set; then
+  enableval="$enable_borrowed_qregion"
+  if ( test "$enableval" = "yes" ); then
+    cat >> confdefs.h <<EOF
+#define USING_BORROWED_QREGION 1
+EOF
+
+fi
+
+else
+  if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QRegion$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+cat >> confdefs.h <<EOF
+#define USING_BORROWED_QREGION 1
+EOF
+
+fi
+fi
+
+fi
+
+
+# Check whether --enable-borrowed-qsize or --disable-borrowed-qsize was given.
+if test "${enable_borrowed_qsize+set}" = set; then
+  enableval="$enable_borrowed_qsize"
+  if ( test "$enableval" = "yes" ); then
+    cat >> confdefs.h <<EOF
+#define USING_BORROWED_QSIZE 1
+EOF
+
+fi
+
+else
+  if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QSize$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+cat >> confdefs.h <<EOF
+#define USING_BORROWED_QSIZE 1
+EOF
+
+fi
+fi
+
+fi
+
+
+# Check whether --enable-borrowed-qsortedlist or --disable-borrowed-qsortedlist was given.
+if test "${enable_borrowed_qsortedlist+set}" = set; then
+  enableval="$enable_borrowed_qsortedlist"
+  if ( test "$enableval" = "yes" ); then
+    cat >> confdefs.h <<EOF
+#define USING_BORROWED_QSORTEDLIST 1
+EOF
+
+fi
+
+else
+  if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QSortedList$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+cat >> confdefs.h <<EOF
+#define USING_BORROWED_QSORTEDLIST 1
+EOF
+
+fi
+fi
+
+fi
+
+
+# Check whether --enable-borrowed-qstack or --disable-borrowed-qstack was given.
+if test "${enable_borrowed_qstack+set}" = set; then
+  enableval="$enable_borrowed_qstack"
+  if ( test "$enableval" = "yes" ); then
+    cat >> confdefs.h <<EOF
+#define USING_BORROWED_QSTACK 1
+EOF
+
+fi
+
+else
+  if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QStack$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+cat >> confdefs.h <<EOF
+#define USING_BORROWED_QSTACK 1
+EOF
+
+fi
+fi
+
+fi
+
+
+# Check whether --enable-borrowed-qstring or --disable-borrowed-qstring was given.
+if test "${enable_borrowed_qstring+set}" = set; then
+  enableval="$enable_borrowed_qstring"
+  if ( test "$enableval" = "yes" ); then
+    cat >> confdefs.h <<EOF
+#define USING_BORROWED_QSTRING 1
+EOF
+
+fi
+
+else
+  if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QString$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+cat >> confdefs.h <<EOF
+#define USING_BORROWED_QSTRING 1
+EOF
+
+fi
+fi
+
+fi
+
+
+# Check whether --enable-borrowed-qstringlist or --disable-borrowed-qstringlist was given.
+if test "${enable_borrowed_qstringlist+set}" = set; then
+  enableval="$enable_borrowed_qstringlist"
+  if ( test "$enableval" = "yes" ); then
+    cat >> confdefs.h <<EOF
+#define USING_BORROWED_QSTRINGLIST 1
+EOF
+
+fi
+
+else
+  if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QStringList$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+cat >> confdefs.h <<EOF
+#define USING_BORROWED_QSTRINGLIST 1
+EOF
+
+fi
+fi
+
+fi
+
+
+# Check whether --enable-borrowed-qtextstream or --disable-borrowed-qtextstream was given.
+if test "${enable_borrowed_qtextstream+set}" = set; then
+  enableval="$enable_borrowed_qtextstream"
+  if ( test "$enableval" = "yes" ); then
+    cat >> confdefs.h <<EOF
+#define USING_BORROWED_QTEXTSTREAM 1
+EOF
+
+fi
+
+else
+  if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QTextStream$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+cat >> confdefs.h <<EOF
+#define USING_BORROWED_QTEXTSTREAM 1
+EOF
+
+fi
+fi
+
+fi
+
+
+# Check whether --enable-borrowed-qvaluelist or --disable-borrowed-qvaluelist was given.
+if test "${enable_borrowed_qvaluelist+set}" = set; then
+  enableval="$enable_borrowed_qvaluelist"
+  if ( test "$enableval" = "yes" ); then
+    cat >> confdefs.h <<EOF
+#define USING_BORROWED_QVALUELIST 1
+EOF
+
+fi
+
+else
+  if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QValueList$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+cat >> confdefs.h <<EOF
+#define USING_BORROWED_QVALUELIST 1
+EOF
+
+fi
+fi
+
+fi
+
+
+# Check whether --enable-borrowed-qvector or --disable-borrowed-qvector was given.
+if test "${enable_borrowed_qvector+set}" = set; then
+  enableval="$enable_borrowed_qvector"
+  if ( test "$enableval" = "yes" ); then
+    cat >> confdefs.h <<EOF
+#define USING_BORROWED_QVECTOR 1
+EOF
+
+fi
+
+else
+  if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QVector$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+cat >> confdefs.h <<EOF
+#define USING_BORROWED_QVECTOR 1
+EOF
+
+fi
+fi
+
+fi
+
+
+
 trap '' 1 2 15
 cat > confcache <<\EOF
 # This file is a shell script that caches the results of configure
diff --git a/WebCore/configure.in b/WebCore/configure.in
index 439e235..17f68c9 100644
--- a/WebCore/configure.in
+++ b/WebCore/configure.in
@@ -239,6 +239,411 @@ AC_DEFINE_UNQUOTED(QT_NO_TEXTCODEC, 1)
 
 dnl
 dnl -------------------------------------------------------------------
+dnl Set what we're borrowing and what we've implemented
+dnl -------------------------------------------------------------------
+dnl
+
+dnl
+dnl QArray borrowing 
+dnl
+AC_ARG_ENABLE(borrowed-qarray,
+[  --enable-borrowed-qarray   enabled use of borrowed QArray (default on)],
+if ( test "$enableval" = "yes" ); then
+    AC_DEFINE_UNQUOTED(USING_BORROWED_QARRAY, 1)
+fi
+,
+if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QArray$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+AC_DEFINE_UNQUOTED(USING_BORROWED_QARRAY, 1)
+fi
+fi
+)
+
+dnl
+dnl QCollection borrowing 
+dnl
+AC_ARG_ENABLE(borrowed-qcollection,
+[  --enable-borrowed-qcollection   enabled use of borrowed QCollection (default on)],
+if ( test "$enableval" = "yes" ); then
+    AC_DEFINE_UNQUOTED(USING_BORROWED_QCOLLECTION, 1)
+fi
+,
+if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QCollection$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+AC_DEFINE_UNQUOTED(USING_BORROWED_QCOLLECTION, 1)
+fi
+fi
+)
+
+dnl
+dnl QColor borrowing 
+dnl
+AC_ARG_ENABLE(borrowed-qcolor,
+[  --enable-borrowed-qcolor   enabled use of borrowed QColor (default on)],
+if ( test "$enableval" = "yes" ); then
+    AC_DEFINE_UNQUOTED(USING_BORROWED_QCOLOR, 1)
+fi
+,
+if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QColor$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+AC_DEFINE_UNQUOTED(USING_BORROWED_QCOLOR, 1)
+fi
+fi
+)
+
+dnl
+dnl QDateTime borrowing 
+dnl
+AC_ARG_ENABLE(borrowed-qdatetime,
+[  --enable-borrowed-qdatetime   enabled use of borrowed QDateTime (default on)],
+if ( test "$enableval" = "yes" ); then
+    AC_DEFINE_UNQUOTED(USING_BORROWED_QDATETIME, 1)
+fi
+,
+if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QDateTime$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+AC_DEFINE_UNQUOTED(USING_BORROWED_QDATETIME, 1)
+fi
+fi
+)
+
+dnl
+dnl QDict borrowing 
+dnl
+AC_ARG_ENABLE(borrowed-qdict,
+[  --enable-borrowed-qdict   enabled use of borrowed QDict (default on)],
+if ( test "$enableval" = "yes" ); then
+    AC_DEFINE_UNQUOTED(USING_BORROWED_QDICT, 1)
+fi
+,
+if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QDict$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+AC_DEFINE_UNQUOTED(USING_BORROWED_QDICT, 1)
+fi
+fi
+)
+
+dnl
+dnl QFile borrowing 
+dnl
+AC_ARG_ENABLE(borrowed-qfile,
+[  --enable-borrowed-qfile   enabled use of borrowed QFile (default on)],
+if ( test "$enableval" = "yes" ); then
+    AC_DEFINE_UNQUOTED(USING_BORROWED_QFILE, 1)
+fi
+,
+if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QFile$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+AC_DEFINE_UNQUOTED(USING_BORROWED_QFILE, 1)
+fi
+fi
+)
+
+dnl
+dnl QList borrowing 
+dnl
+AC_ARG_ENABLE(borrowed-qlist,
+[  --enable-borrowed-qlist   enabled use of borrowed QList (default on)],
+if ( test "$enableval" = "yes" ); then
+    AC_DEFINE_UNQUOTED(USING_BORROWED_QLIST, 1)
+fi
+,
+if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QList$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+AC_DEFINE_UNQUOTED(USING_BORROWED_QLIST, 1)
+fi
+fi
+)
+
+dnl
+dnl QMap borrowing 
+dnl
+AC_ARG_ENABLE(borrowed-qmap,
+[  --enable-borrowed-qmap   enabled use of borrowed QMap (default on)],
+if ( test "$enableval" = "yes" ); then
+    AC_DEFINE_UNQUOTED(USING_BORROWED_QMAP, 1)
+fi
+,
+if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QMap$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+AC_DEFINE_UNQUOTED(USING_BORROWED_QMAP, 1)
+fi
+fi
+)
+
+dnl
+dnl QPoint borrowing 
+dnl
+AC_ARG_ENABLE(borrowed-qpoint,
+[  --enable-borrowed-qpoint   enabled use of borrowed QPoint (default on)],
+if ( test "$enableval" = "yes" ); then
+    AC_DEFINE_UNQUOTED(USING_BORROWED_QPOINT, 1)
+fi
+,
+if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QPoint$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+AC_DEFINE_UNQUOTED(USING_BORROWED_QPOINT, 1)
+fi
+fi
+)
+
+dnl
+dnl QPtrDict borrowing 
+dnl
+AC_ARG_ENABLE(borrowed-qptrdict,
+[  --enable-borrowed-qptrdict   enabled use of borrowed QPtrDict (default on)],
+if ( test "$enableval" = "yes" ); then
+    AC_DEFINE_UNQUOTED(USING_BORROWED_QPTRDICT, 1)
+fi
+,
+if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QPtrDict$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+AC_DEFINE_UNQUOTED(USING_BORROWED_QPTRDICT, 1)
+fi
+fi
+)
+
+dnl
+dnl QRect borrowing 
+dnl
+AC_ARG_ENABLE(borrowed-qrect,
+[  --enable-borrowed-qrect   enabled use of borrowed QRect (default on)],
+if ( test "$enableval" = "yes" ); then
+    AC_DEFINE_UNQUOTED(USING_BORROWED_QRECT, 1)
+fi
+,
+if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QRect$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+AC_DEFINE_UNQUOTED(USING_BORROWED_QRECT, 1)
+fi
+fi
+)
+
+dnl
+dnl QRegExp borrowing 
+dnl
+AC_ARG_ENABLE(borrowed-qregexp,
+[  --enable-borrowed-qregexp   enabled use of borrowed QRegExp (default on)],
+if ( test "$enableval" = "yes" ); then
+    AC_DEFINE_UNQUOTED(USING_BORROWED_QREGEXP, 1)
+fi
+,
+if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QRegExp$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+AC_DEFINE_UNQUOTED(USING_BORROWED_QREGEXP, 1)
+fi
+fi
+)
+
+dnl
+dnl QRegion borrowing 
+dnl
+AC_ARG_ENABLE(borrowed-qregion,
+[  --enable-borrowed-qregion   enabled use of borrowed QRegion (default on)],
+if ( test "$enableval" = "yes" ); then
+    AC_DEFINE_UNQUOTED(USING_BORROWED_QREGION, 1)
+fi
+,
+if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QRegion$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+AC_DEFINE_UNQUOTED(USING_BORROWED_QREGION, 1)
+fi
+fi
+)
+
+dnl
+dnl QSize borrowing 
+dnl
+AC_ARG_ENABLE(borrowed-qsize,
+[  --enable-borrowed-qsize   enabled use of borrowed QSize (default on)],
+if ( test "$enableval" = "yes" ); then
+    AC_DEFINE_UNQUOTED(USING_BORROWED_QSIZE, 1)
+fi
+,
+if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QSize$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+AC_DEFINE_UNQUOTED(USING_BORROWED_QSIZE, 1)
+fi
+fi
+)
+
+dnl
+dnl QSortedList borrowing 
+dnl
+AC_ARG_ENABLE(borrowed-qsortedlist,
+[  --enable-borrowed-qsortedlist   enabled use of borrowed QSortedList (default on)],
+if ( test "$enableval" = "yes" ); then
+    AC_DEFINE_UNQUOTED(USING_BORROWED_QSORTEDLIST, 1)
+fi
+,
+if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QSortedList$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+AC_DEFINE_UNQUOTED(USING_BORROWED_QSORTEDLIST, 1)
+fi
+fi
+)
+
+dnl
+dnl QStack borrowing 
+dnl
+AC_ARG_ENABLE(borrowed-qstack,
+[  --enable-borrowed-qstack   enabled use of borrowed QStack (default on)],
+if ( test "$enableval" = "yes" ); then
+    AC_DEFINE_UNQUOTED(USING_BORROWED_QSTACK, 1)
+fi
+,
+if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QStack$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+AC_DEFINE_UNQUOTED(USING_BORROWED_QSTACK, 1)
+fi
+fi
+)
+
+dnl
+dnl QString borrowing 
+dnl
+AC_ARG_ENABLE(borrowed-qstring,
+[  --enable-borrowed-qstring   enabled use of borrowed QString (default on)],
+if ( test "$enableval" = "yes" ); then
+    AC_DEFINE_UNQUOTED(USING_BORROWED_QSTRING, 1)
+fi
+,
+if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QString$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+AC_DEFINE_UNQUOTED(USING_BORROWED_QSTRING, 1)
+fi
+fi
+)
+
+dnl
+dnl QStringList borrowing 
+dnl
+AC_ARG_ENABLE(borrowed-qstringlist,
+[  --enable-borrowed-qstringlist   enabled use of borrowed QStringList (default on)],
+if ( test "$enableval" = "yes" ); then
+    AC_DEFINE_UNQUOTED(USING_BORROWED_QSTRINGLIST, 1)
+fi
+,
+if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QStringList$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+AC_DEFINE_UNQUOTED(USING_BORROWED_QSTRINGLIST, 1)
+fi
+fi
+)
+
+dnl
+dnl QTextStream borrowing 
+dnl
+AC_ARG_ENABLE(borrowed-qtextstream,
+[  --enable-borrowed-qtextstream   enabled use of borrowed QTextStream (default on)],
+if ( test "$enableval" = "yes" ); then
+    AC_DEFINE_UNQUOTED(USING_BORROWED_QTEXTSTREAM, 1)
+fi
+,
+if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QTextStream$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+AC_DEFINE_UNQUOTED(USING_BORROWED_QTEXTSTREAM, 1)
+fi
+fi
+)
+
+dnl
+dnl QValueList borrowing 
+dnl
+AC_ARG_ENABLE(borrowed-qvaluelist,
+[  --enable-borrowed-qvaluelist   enabled use of borrowed QValueList (default on)],
+if ( test "$enableval" = "yes" ); then
+    AC_DEFINE_UNQUOTED(USING_BORROWED_QVALUELIST, 1)
+fi
+,
+if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QValueList$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+AC_DEFINE_UNQUOTED(USING_BORROWED_QVALUELIST, 1)
+fi
+fi
+)
+
+dnl
+dnl QVector borrowing 
+dnl
+AC_ARG_ENABLE(borrowed-qvector,
+[  --enable-borrowed-qvector   enabled use of borrowed QVector (default on)],
+if ( test "$enableval" = "yes" ); then
+    AC_DEFINE_UNQUOTED(USING_BORROWED_QVECTOR, 1)
+fi
+,
+if ( test -f borrowed-classes.txt )
+then
+BORROWED=`sed -e 's/^QVector$/yes/' borrowed-classes.txt | grep yes`
+if ( test "$BORROWED" = "yes" )
+then 
+AC_DEFINE_UNQUOTED(USING_BORROWED_QVECTOR, 1)
+fi
+fi
+)
+
+dnl
+dnl -------------------------------------------------------------------
 dnl Output files
 dnl -------------------------------------------------------------------
 dnl
diff --git a/WebCore/kwq/KWQCString.h b/WebCore/kwq/KWQCString.h
index a42f93b..8e68252 100644
--- a/WebCore/kwq/KWQCString.h
+++ b/WebCore/kwq/KWQCString.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QSTRING ======================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QSTRING
 #include <_qcstring.h>
 #else
 
@@ -83,7 +83,7 @@ public:
     QCString &operator=(const QCString &);
     QCString &operator=(const char *);
     QCString &operator+=(const char *);
-    QCString &operator+=(const QCString &);
+    QCString &operator+=(char);
 
 #ifdef _KWQ_IOSTREAM_
     friend ostream &operator<<(ostream &, const QCString &);
@@ -92,6 +92,9 @@ public:
 // protected -------------------------------------------------------------------
 // private ---------------------------------------------------------------------
 
+private:
+    bool resize(uint);
+
 }; // class QCString ===========================================================
 
 
@@ -102,6 +105,6 @@ bool operator==(const QCString &s1, const char *s2);
 bool operator!=(const char *s1, const QCString &s2);
 bool operator!=(const QCString &s1, const char *s2);
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QSTRING
 
 #endif
diff --git a/WebCore/kwq/KWQChar.mm b/WebCore/kwq/KWQChar.mm
index ee53cca..a9b0c7a 100644
--- a/WebCore/kwq/KWQChar.mm
+++ b/WebCore/kwq/KWQChar.mm
@@ -27,6 +27,8 @@
 
 #include <qstring.h>
 
+#ifndef USING_BORROWED_QSTRING
+
 static UniChar scratchUniChar;
 
 static CFMutableStringRef GetScratchUniCharString()
@@ -224,3 +226,8 @@ int operator!=(char ch, QChar qc)
 {
     return ch != qc.c;
 }
+
+#else // USING_BORROWED_QSTRING
+// This will help to keep the linker from complaining about empty archives
+void KWQChar_Dummy() {}
+#endif // USING_BORROWED_QSTRING
diff --git a/WebCore/kwq/KWQColor.h b/WebCore/kwq/KWQColor.h
index 022f8c5..5603b82 100644
--- a/WebCore/kwq/KWQColor.h
+++ b/WebCore/kwq/KWQColor.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QCOLOR =======================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QCOLOR
 #include <_qcolor.h>
 #else
 
@@ -94,6 +94,6 @@ public:
 
 }; // class QColor =============================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QCOLOR
 
 #endif
diff --git a/WebCore/kwq/KWQDateTime.h b/WebCore/kwq/KWQDateTime.h
index f185d3f..3570888 100644
--- a/WebCore/kwq/KWQDateTime.h
+++ b/WebCore/kwq/KWQDateTime.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QDATETIME ====================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QDATETIME
 #include <_qdatetime.h>
 #else
 
@@ -159,6 +159,6 @@ public:
 
 }; // class QDateTime ==========================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QDATETIME
 
 #endif
diff --git a/WebCore/kwq/KWQDict.h b/WebCore/kwq/KWQDict.h
index fd7d0d6..4234247 100644
--- a/WebCore/kwq/KWQDict.h
+++ b/WebCore/kwq/KWQDict.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QDICT ========================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QDICT
 #include <_qdict.h>
 #else
 
@@ -124,6 +124,6 @@ private:
 
 }; // class QDictIterator ======================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QDICT
 
 #endif
diff --git a/WebCore/kwq/KWQFile.h b/WebCore/kwq/KWQFile.h
index f67b7df..7034859 100644
--- a/WebCore/kwq/KWQFile.h
+++ b/WebCore/kwq/KWQFile.h
@@ -32,7 +32,9 @@
 
 #include <KWQDef.h>
 
-#ifdef _KWQ_COMPLETE_
+// USING_BORROWED_QFILE =======================================================
+
+#ifdef USING_BORROWED_QFILE
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -116,7 +118,7 @@ struct QFileInfoCache
 };
 
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QFILE
 
 
 #include "_qiodevice.h"
@@ -131,7 +133,7 @@ public:
 
     // typedefs ----------------------------------------------------------------
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QFILE
     typedef QCString(*EncoderFn)(const QString &);
     typedef QString(*DecoderFn)(const QCString &);
 #endif
@@ -140,7 +142,7 @@ public:
     // constants ---------------------------------------------------------------
     // static member functions -------------------------------------------------
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QFILE
     static QCString encodeName(const QString &);
     static QString decodeName(const QCString &);
     static void setEncodingFunction(EncoderFn);
@@ -164,7 +166,7 @@ public:
     uint size() const;
 
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QFILE
     bool remove();
 
     QString	name() const;
@@ -194,7 +196,7 @@ public:
 
 // protected -------------------------------------------------------------------
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QFILE
 protected:
     QString fn;
     FILE *fh;
@@ -213,14 +215,14 @@ private:
     QFile(const QFile &);
     QFile &operator=(const QFile &);
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QFILE
     void init();
     QCString ungetchBuffer;
 #endif
 
 }; // class QFile ==============================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QFILE
 
 inline int QFile::at() const
 {
@@ -230,6 +232,7 @@ inline int QFile::at() const
 inline QString QFile::name() const
 { return fn; }
 
-#endif
+
+#endif // USING_BORROWED_QFILE
 
 #endif
diff --git a/WebCore/kwq/KWQMap.h b/WebCore/kwq/KWQMap.h
index 1c30401..b21233b 100644
--- a/WebCore/kwq/KWQMap.h
+++ b/WebCore/kwq/KWQMap.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QMAP =========================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QMAP
 #include <_qmap.h>
 #else
 
@@ -173,6 +173,6 @@ public:
 
 }; // class QMap ===============================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QMAP
 
 #endif
diff --git a/WebCore/kwq/KWQMemArray.h b/WebCore/kwq/KWQMemArray.h
index f0bf2db..37ab082 100644
--- a/WebCore/kwq/KWQMemArray.h
+++ b/WebCore/kwq/KWQMemArray.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QARRAY =======================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QARRAY
 #include <_qarray.h>
 #else
 
@@ -77,6 +77,6 @@ public:
 
 }; // class QArray =============================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QARRAY
 
 #endif
diff --git a/WebCore/kwq/KWQPointArray.h b/WebCore/kwq/KWQPointArray.h
index 7607f39..4408964 100644
--- a/WebCore/kwq/KWQPointArray.h
+++ b/WebCore/kwq/KWQPointArray.h
@@ -64,7 +64,7 @@ public:
 
     int manhattanLength() const;
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QPOINT
     bool isNull() const;
     void setX(int);
     void setY(int);
@@ -79,7 +79,7 @@ public:
     friend QPoint operator+(const QPoint &, const QPoint &);
     friend QPoint operator-(const QPoint &, const QPoint &);
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QPOINT
     QPoint &operator+=(const QPoint &);
     QPoint &operator-=(const QPoint &);
     QPoint &operator*=(int);
diff --git a/WebCore/kwq/KWQPtrDict.h b/WebCore/kwq/KWQPtrDict.h
index cf80222..3f0c240 100644
--- a/WebCore/kwq/KWQPtrDict.h
+++ b/WebCore/kwq/KWQPtrDict.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QPTRDICT =====================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QPTRDICT
 #include <_qptrdict.h>
 #else
 
@@ -123,6 +123,6 @@ private:
 
 }; // class QPtrDictIterator ===================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QPTRDICT
 
 #endif
diff --git a/WebCore/kwq/KWQPtrList.h b/WebCore/kwq/KWQPtrList.h
index 7d6bdf5..f0cdb1b 100644
--- a/WebCore/kwq/KWQPtrList.h
+++ b/WebCore/kwq/KWQPtrList.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QLIST ========================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QLIST
 #include <_qlist.h>
 #else
 
@@ -142,6 +142,6 @@ private:
 
 }; // class QListIterator ======================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QLIST
 
 #endif
diff --git a/WebCore/kwq/KWQPtrStack.h b/WebCore/kwq/KWQPtrStack.h
index 49e342d..247832b 100644
--- a/WebCore/kwq/KWQPtrStack.h
+++ b/WebCore/kwq/KWQPtrStack.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QSTACK =======================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QSTACK
 #include <_qstack.h>
 #else
 
@@ -66,6 +66,6 @@ public:
 
 }; // class QStack =============================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QSTACK
 
 #endif
diff --git a/WebCore/kwq/KWQPtrVector.h b/WebCore/kwq/KWQPtrVector.h
index bf212cd..6a5cc73 100644
--- a/WebCore/kwq/KWQPtrVector.h
+++ b/WebCore/kwq/KWQPtrVector.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QVECTOR ======================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QVECTOR
 #include <_qvector.h>
 #else
 
@@ -110,6 +110,6 @@ public:
 
 }; // class QVector ============================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QVECTOR
 
 #endif
diff --git a/WebCore/kwq/KWQRect.h b/WebCore/kwq/KWQRect.h
index 5aa018e..3ae421d 100644
--- a/WebCore/kwq/KWQRect.h
+++ b/WebCore/kwq/KWQRect.h
@@ -53,7 +53,7 @@ public:
     QRect(int, int, int, int);
     QRect(const QRect &);
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QRECT
     QRect(const QPoint &, const QPoint &);
     QRect(const QPoint &, const QSize &);
 #endif
@@ -83,7 +83,7 @@ public:
     QRect intersect(const QRect &) const;
     bool intersects(const QRect &) const;
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QRECT
     bool isEmpty() const;
     QRect normalize() const;
 
@@ -118,7 +118,7 @@ public:
     bool contains(int, int, bool proper=FALSE) const;
     bool contains(const QRect &, bool proper=FALSE) const;
     QRect unite(const QRect &) const;
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QRECT
 
     // operators ---------------------------------------------------------------
 
@@ -126,12 +126,13 @@ public:
      * QRect &operator=(const QRect &);
      */
 
-#ifdef _KWQ_COMPLETE_
+    QRect operator&(const QRect &) const;
+
+#ifdef USING_BORROWED_QRECT
     friend bool operator==(const QRect &, const QRect &);
     friend bool operator!=(const QRect &, const QRect &);
 
     QRect operator|(const QRect &) const;
-    QRect operator&(const QRect &) const;
     QRect& operator|=(const QRect &);
     QRect& operator&=(const QRect &);
 #endif
diff --git a/WebCore/kwq/KWQRegExp.h b/WebCore/kwq/KWQRegExp.h
index 64a1e5b..89633aa 100644
--- a/WebCore/kwq/KWQRegExp.h
+++ b/WebCore/kwq/KWQRegExp.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QREGEXP ======================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QREGEXP
 #include <_qregexp.h>
 #else
 
@@ -66,6 +66,6 @@ public:
 
 }; // class QRegExp ============================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QREGEXP
 
 #endif
diff --git a/WebCore/kwq/KWQRegion.h b/WebCore/kwq/KWQRegion.h
index b1d6a17..142f2d8 100644
--- a/WebCore/kwq/KWQRegion.h
+++ b/WebCore/kwq/KWQRegion.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QREGION ======================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QREGION
 #include <_qregion.h>
 #include "qpoint.h"
 #include "qimage.h"
@@ -81,6 +81,6 @@ public:
 
 }; // class QRegion ============================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QREGION
 
 #endif
diff --git a/WebCore/kwq/KWQSize.h b/WebCore/kwq/KWQSize.h
index db80871..8e6014d 100644
--- a/WebCore/kwq/KWQSize.h
+++ b/WebCore/kwq/KWQSize.h
@@ -64,7 +64,7 @@ public:
     void setHeight(int);
     QSize expandedTo(const QSize &) const;
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QSIZE
     bool isNull() const;
     bool isEmpty() const;
     void transpose();
@@ -81,7 +81,7 @@ public:
     friend bool operator==(const QSize &, const QSize &);
     friend bool operator!=(const QSize &, const QSize &);
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QSIZE
     QSize &operator+=(const QSize &);
     QSize &operator-=(const QSize &);
     QSize &operator*=(int);
diff --git a/WebCore/kwq/KWQSortedList.h b/WebCore/kwq/KWQSortedList.h
index eee362a..bda8bb3 100644
--- a/WebCore/kwq/KWQSortedList.h
+++ b/WebCore/kwq/KWQSortedList.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QSORTEDLIST ==================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QSORTEDLIST
 #include <_qsortedlist.h>
 #else
 
@@ -65,6 +65,6 @@ public:
 
 }; // class QSortedList ========================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QSORTEDLIST
 
 #endif
diff --git a/WebCore/kwq/KWQString.h b/WebCore/kwq/KWQString.h
index ed94e9e..6373a5e 100644
--- a/WebCore/kwq/KWQString.h
+++ b/WebCore/kwq/KWQString.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QSTRING ======================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QSTRING
 #include <_qstring.h>
 #else
 
@@ -128,7 +128,7 @@ public:
 
 class QString {
 public:
-    static QString fromLatin1(const char*, int len=-1);
+    static QString fromLatin1(const char *, int len=-1);
 
     // typedefs ----------------------------------------------------------------
     // enums -------------------------------------------------------------------
@@ -177,8 +177,7 @@ public:
     QString &append(const char *);
     QString &append(const QString &);
 
-    int contains(const char *, bool) const;
-    int contains(const char *) const;
+    int contains(const char *, bool cs=TRUE) const;
     int contains(char) const;
 
     int find(char, int index=0) const;
@@ -299,6 +298,6 @@ private:
 
 }; // class QConstString =======================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QSTRING
 
 #endif
diff --git a/WebCore/kwq/KWQString.mm b/WebCore/kwq/KWQString.mm
index 8df0c9c..ac4c091 100644
--- a/WebCore/kwq/KWQString.mm
+++ b/WebCore/kwq/KWQString.mm
@@ -27,6 +27,10 @@
 
 #include <qstring.h>
 
+#ifndef USING_BORROWED_QSTRING
+
+const QString QString::null;
+
 QString::QString()
 {
     s = NULL;
@@ -82,11 +86,111 @@ QString::QString(const char *chs)
     }
 }
 
+QString::QString(const QString &other)
+{
+    s = other.s;
+}
+
 QString::~QString()
 {
     CFRelease(s);
 }
 
+QString QString::lower() const
+{
+    QString result(*this);
+
+    CFStringLowercase(result.s, NULL);
+
+    return result;
+}
+
+bool QString::isNull() const
+{
+    return (s == NULL);
+}
+
+bool QString::isEmpty() const
+{
+    return (s == NULL || CFStringGetLength(s) == 0);
+}
+
+uint QString::length() const
+{
+    return CFStringGetLength(s);
+}
+
+int QString::find(char, int index=0) const
+{
+    // FIXME: awaiting real implementation
+    return 0;
+}
+
+int QString::find(const char *, int index=0, bool b=0) const
+{
+    // FIXME: awaiting real implementation
+    return 0;
+}
+
+int QString::find(const QString &, int index=0, bool b=0) const
+{
+    // FIXME: awaiting real implementation
+    return 0;
+}
+
+int QString::find(const QRegExp &, int index=0, bool b=0) const
+{
+    // FIXME: awaiting real implementation
+    return 0;
+}
+
+int QString::findRev(char, int index=0) const
+{
+    // FIXME: awaiting real implementation
+    return 0;
+}
+
+int QString::findRev(const char *, int index=0) const
+{
+    // FIXME: awaiting real implementation
+    return 0;
+}
+
+QString QString::fromLatin1(const char *s, int len=-1)
+{
+    // FIXME: awaiting real implementation
+    return NULL;
+}
+
+const char *QString::latin1() const
+{
+    // FIXME: awaiting real implementation
+    return (const char *)CFStringGetCStringPtr(s, kCFStringEncodingISOLatin1); 
+}
+
+const QChar *QString::unicode() const
+{
+    // FIXME: awaiting real implementation
+    return (QChar *)CFStringGetCharactersPtr(s); 
+}
+
+int QString::contains(const char *s, bool cs=TRUE) const
+{
+    // FIXME: awaiting real implementation
+    return 0;
+}
+
+QString QString::mid(int, int len=0xffffffff) const
+{
+    // FIXME: awaiting real implementation
+    return NULL;
+}
+
+QString::operator const char *() const
+{
+    return latin1();
+}
+
 QString &QString::operator=(const QString &qs)
 {
     // shared copy
@@ -116,6 +220,59 @@ QString &QString::operator=(char ch)
     return *this = QString(QChar(ch));
 }
 
+bool QString::operator!() const
+{ 
+    return isNull(); 
+}
+
+QChar QString::operator[](int i) const
+{
+    // FIXME: awaiting real implementation
+    return 0;
+}
+
+QString &QString::operator+=(char c)
+{
+    // FIXME: awaiting real implementation
+    return *this;
+}
+
+QString &QString::operator+=(QChar c)
+{
+    // FIXME: awaiting real implementation
+    return *this;
+}
+
+QString &QString::operator+=(const QString &s)
+{
+    // FIXME: awaiting real implementation
+    return *this;
+}
+
+bool operator==(const QString &s1, const QString &s2)
+{
+    CFComparisonResult cmp;
+    int flags;
+
+    flags = 0;
+
+    cmp = CFStringCompare(s1.s, s2.s, flags);
+    
+    return (cmp == kCFCompareEqualTo);
+}
+
+bool operator!=(const QString &s1, const QString &s2)
+{
+    CFComparisonResult cmp;
+    int flags;
+
+    flags = 0;
+
+    cmp = CFStringCompare(s1.s, s2.s, flags);
+    
+    return (cmp != kCFCompareEqualTo);
+}
+
 QConstString::QConstString(QChar *qcs, uint len)
 {
     if (qcs || len) {
@@ -132,3 +289,8 @@ const QString &QConstString::string() const
 {
     return *this;
 }
+
+#else // USING_BORROWED_QSTRING
+// This will help to keep the linker from complaining about empty archives
+void KWQString_Dummy() {}
+#endif // USING_BORROWED_QSTRING
diff --git a/WebCore/kwq/KWQStringList.h b/WebCore/kwq/KWQStringList.h
index 5f339a6..f6f0c6c 100644
--- a/WebCore/kwq/KWQStringList.h
+++ b/WebCore/kwq/KWQStringList.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QSTRINGLIST ==================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QSTRINGLIST
 #include <_qstringlist.h>
 #else
 
@@ -75,6 +75,6 @@ public:
 
 }; // class QStringList ========================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QSTRINGLIST
 
 #endif
diff --git a/WebCore/kwq/KWQTextStream.h b/WebCore/kwq/KWQTextStream.h
index c001c38..816e03f 100644
--- a/WebCore/kwq/KWQTextStream.h
+++ b/WebCore/kwq/KWQTextStream.h
@@ -30,12 +30,13 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QTEXTSTREAM ==================================================
 
 // FIXME: Need a hack here to give the xml tokenizer text stream
 // defines from Qt. The NEED_BOGUS_TEXTSTREAMS symbol
 // can be removed when we have Qt text streams implemented
-#if defined _KWQ_COMPLETE_ && ! defined NEED_BOGUS_TEXTSTREAMS
+
+#if defined USING_BORROWED_QTEXTSTREAM && ! defined NEED_BOGUS_TEXTSTREAMS
 #include <_qtextstream.h>
 #else
 
@@ -168,6 +169,6 @@ private:
 
 }; // class QTextOStream =======================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QTEXTSTREAM
 
 #endif
diff --git a/WebCore/kwq/KWQValueList.h b/WebCore/kwq/KWQValueList.h
index ed60c14..098c10d 100644
--- a/WebCore/kwq/KWQValueList.h
+++ b/WebCore/kwq/KWQValueList.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QVALUELIST ===================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QVALUELIST
 #include <_qvaluelist.h>
 #else
 
@@ -164,6 +164,6 @@ public:
 
 }; // class QValueList =========================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QVALUELIST
 
 #endif
diff --git a/WebCore/kwq/Makefile.in b/WebCore/kwq/Makefile.in
index c22651d..6000e8a 100644
--- a/WebCore/kwq/Makefile.in
+++ b/WebCore/kwq/Makefile.in
@@ -31,7 +31,9 @@ MMOBJECTS = \
 	KWQPixmap.o \
 	KWQWMatrix.o \
 	KWQWidget.o \
-# FIXME: add back in when this file builds ->  KWQString.o \
+	KWQChar.o \
+	KWQString.o \
+	KWQCString.o \
 	$(NULL)
 
 OBJECTS = $(MMOBJECTS) 
diff --git a/WebCore/kwq/qt/_qarray.h b/WebCore/kwq/qt/_qarray.h
index 439ded7..ff3bf06 100644
--- a/WebCore/kwq/qt/_qarray.h
+++ b/WebCore/kwq/qt/_qarray.h
@@ -40,8 +40,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QARRAY
+#define USING_BORROWED_QARRAY
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/kwq/qt/_qcollection.cpp b/WebCore/kwq/qt/_qcollection.cpp
index 73d0710..8e17f6f 100644
--- a/WebCore/kwq/qt/_qcollection.cpp
+++ b/WebCore/kwq/qt/_qcollection.cpp
@@ -37,10 +37,12 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifdef HAVE_CONFIG_H
+#include <config.h>
 #endif
 
+#ifdef USING_BORROWED_QCOLLECTION
+
 // -------------------------------------------------------------------------
 
 #include "_qcollection.h"
@@ -188,3 +190,9 @@ void QCollection::deleteItem( Item d )
 	delete d;				// default operation
 #endif
 }
+
+// KWQ hacks ---------------------------------------------------------------
+
+#endif USING_BORROWED_QCOLLECTION
+
+// -------------------------------------------------------------------------
diff --git a/WebCore/kwq/qt/_qcollection.h b/WebCore/kwq/qt/_qcollection.h
index 0754224..63d676e 100644
--- a/WebCore/kwq/qt/_qcollection.h
+++ b/WebCore/kwq/qt/_qcollection.h
@@ -40,10 +40,6 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
-#endif
-
 #include <KWQDef.h>
 
 // -------------------------------------------------------------------------
diff --git a/WebCore/kwq/qt/_qcolor.cpp b/WebCore/kwq/qt/_qcolor.cpp
index be6c8f0..ef0b03c 100644
--- a/WebCore/kwq/qt/_qcolor.cpp
+++ b/WebCore/kwq/qt/_qcolor.cpp
@@ -37,10 +37,12 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifdef HAVE_CONFIG_H
+#include <config.h>
 #endif
 
+#ifdef USING_BORROWED_QCOLOR
+
 // -------------------------------------------------------------------------
 
 #include "qcolor.h"
@@ -365,6 +367,7 @@ QString QColor::name() const
 
 static int hex2int( QChar hexchar )
 {
+#if USING_BORROWED_QSTRING
     int v;
     if ( hexchar.isDigit() )
 	v = hexchar.digitValue();
@@ -375,6 +378,10 @@ static int hex2int( QChar hexchar )
     else
 	v = 0;
     return v;
+#else
+#warning this function not implemented
+    return 0;
+#endif
 }
 
 
@@ -848,3 +855,9 @@ QDataStream &operator>>( QDataStream &s, QColor &c )
   \overload int qGray( qRgb rgb )
   \relates QColor
 */
+
+// KWQ hacks ---------------------------------------------------------------
+
+#endif // USING_BORROWED_QCOLOR
+
+// -------------------------------------------------------------------------
diff --git a/WebCore/kwq/qt/_qcolor.h b/WebCore/kwq/qt/_qcolor.h
index d6350d8..0771fea 100644
--- a/WebCore/kwq/qt/_qcolor.h
+++ b/WebCore/kwq/qt/_qcolor.h
@@ -40,8 +40,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QCOLOR
+#define USING_BORROWED_QCOLOR
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/kwq/qt/_qcstring.cpp b/WebCore/kwq/qt/_qcstring.cpp
index 140e893..8bfb3cf 100644
--- a/WebCore/kwq/qt/_qcstring.cpp
+++ b/WebCore/kwq/qt/_qcstring.cpp
@@ -38,10 +38,12 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifdef HAVE_CONFIG_H
+#include <config.h>
 #endif
 
+#ifdef USING_BORROWED_QSTRING
+
 // -------------------------------------------------------------------------
 
 #include "qstring.h"
@@ -1942,3 +1944,8 @@ ostream &operator<<(ostream &o, const QCString &s)
 }
 #endif
 
+// KWQ hacks ---------------------------------------------------------------
+
+#endif // USING_BORROWED_QSTRING
+
+// -------------------------------------------------------------------------
diff --git a/WebCore/kwq/qt/_qcstring.h b/WebCore/kwq/qt/_qcstring.h
index efc5fed..b77db31 100644
--- a/WebCore/kwq/qt/_qcstring.h
+++ b/WebCore/kwq/qt/_qcstring.h
@@ -41,8 +41,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QSTRING
+#define USING_BORROWED_QSTRING
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/kwq/qt/_qdatetime.cpp b/WebCore/kwq/qt/_qdatetime.cpp
index 1d31ddb..a6ab2a2 100644
--- a/WebCore/kwq/qt/_qdatetime.cpp
+++ b/WebCore/kwq/qt/_qdatetime.cpp
@@ -37,10 +37,12 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifdef HAVE_CONFIG_H
+#include <config.h>
 #endif
 
+#ifdef USING_BORROWED_QDATETIME
+
 // -------------------------------------------------------------------------
 
 #define gettimeofday	__hide_gettimeofday
@@ -1499,3 +1501,9 @@ QDataStream &operator>>( QDataStream &s, QDateTime &dt )
     return s;
 }
 #endif //QT_NO_DATASTREAM
+
+// KWQ hacks ---------------------------------------------------------------
+
+#endif // USING_BORROWED_QDATETIME
+
+// -------------------------------------------------------------------------
diff --git a/WebCore/kwq/qt/_qdatetime.h b/WebCore/kwq/qt/_qdatetime.h
index d5a530a..2fad329 100644
--- a/WebCore/kwq/qt/_qdatetime.h
+++ b/WebCore/kwq/qt/_qdatetime.h
@@ -40,8 +40,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QDATETIME
+#define USING_BORROWED_QDATETIME
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/kwq/qt/_qdict.h b/WebCore/kwq/qt/_qdict.h
index 39fc24f..912aca3 100644
--- a/WebCore/kwq/qt/_qdict.h
+++ b/WebCore/kwq/qt/_qdict.h
@@ -40,8 +40,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QDICT
+#define USING_BORROWED_QDICT
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/kwq/qt/_qfile.cpp b/WebCore/kwq/qt/_qfile.cpp
index 3516a09..7d78a25 100644
--- a/WebCore/kwq/qt/_qfile.cpp
+++ b/WebCore/kwq/qt/_qfile.cpp
@@ -37,7 +37,13 @@
 
 #include "qfile.h"
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QFILE
+
+#ifndef USING_BORROWED_QSTRING
+#include <string.h>
+#define qstrlen(s) strlen((s))
+#define qstrcpy(dest,src) strcpy((dest),(src))
+#endif
 
 extern bool qt_file_access( const QString& fn, int t );
 
@@ -292,7 +298,11 @@ void QFile::setEncodingFunction( EncoderFn f )
 static
 QString locale_decoder( const QCString &localFileName )
 {
+#ifdef USING_BORROWED_QSTRING
     return QString::fromLocal8Bit(localFileName);
+#else
+    return QString(localFileName);
+#endif
 }
 
 static QFile::DecoderFn decoder = locale_decoder;
@@ -698,4 +708,4 @@ void QFile::close()
     return;
 }
 
-#endif
+#endif // USING_BORROWED_QFILE
diff --git a/WebCore/kwq/qt/_qgarray.cpp b/WebCore/kwq/qt/_qgarray.cpp
index 1daa7f2..60671b5 100644
--- a/WebCore/kwq/qt/_qgarray.cpp
+++ b/WebCore/kwq/qt/_qgarray.cpp
@@ -12,10 +12,12 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifdef HAVE_CONFIG_H
+#include <config.h>
 #endif
 
+#ifdef USING_BORROWED_QARRAY
+
 // -------------------------------------------------------------------------
 
 #include <_qgarray.h>
@@ -430,3 +432,9 @@ void QGArray::deleteData( array_data *p )
     delete p;
     p = 0;
 }
+
+// KWQ hacks ---------------------------------------------------------------
+
+#endif // USING_BORROWED_QARRAY
+
+// -------------------------------------------------------------------------
diff --git a/WebCore/kwq/qt/_qgarray.h b/WebCore/kwq/qt/_qgarray.h
index a18c5c4..89b77d7 100644
--- a/WebCore/kwq/qt/_qgarray.h
+++ b/WebCore/kwq/qt/_qgarray.h
@@ -15,8 +15,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QARRAY
+#define USING_BORROWED_QARRAY
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/kwq/qt/_qgdict.cpp b/WebCore/kwq/qt/_qgdict.cpp
index 4f869c7..d3cb6c3 100644
--- a/WebCore/kwq/qt/_qgdict.cpp
+++ b/WebCore/kwq/qt/_qgdict.cpp
@@ -37,10 +37,12 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifdef HAVE_CONFIG_H
+#include <config.h>
 #endif
 
+#ifdef USING_BORROWED_QDICT
+
 // -------------------------------------------------------------------------
 
 #include "_qgdict.h"
@@ -102,6 +104,7 @@ int QGDict::hashKeyString( const QString &key )
     if ( key.isNull() )
 	qWarning( "QGDict::hashStringKey: Invalid null key" );
 #endif
+#ifdef USING_BORROWED_QSTRING
     int i;
     register uint h=0;
     uint g;
@@ -125,6 +128,9 @@ int QGDict::hashKeyString( const QString &key )
     if ( index < 0 )				// adjust index to table size
 	index = -index;
     return index;
+#else
+    return CFHash(key.s);
+#endif
 }
 
 /*!
@@ -1225,3 +1231,9 @@ QCollection::Item QGDictIterator::operator+=( uint jumps )
 	operator++();
     return curNode ? curNode->getData() : 0;
 }
+
+// KWQ hacks ---------------------------------------------------------------
+
+#endif // USING_BORROWED_QDICT
+
+// -------------------------------------------------------------------------
diff --git a/WebCore/kwq/qt/_qgdict.h b/WebCore/kwq/qt/_qgdict.h
index eb0ba21..25e2e17 100644
--- a/WebCore/kwq/qt/_qgdict.h
+++ b/WebCore/kwq/qt/_qgdict.h
@@ -40,12 +40,19 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QDICT
+#define USING_BORROWED_QDICT
 #endif
 
 #include <KWQDef.h>
 
+#ifndef USING_BORROWED_QSTRING
+#include <string.h>
+#define qstrcmp(s1,s2) strcmp((s1),(s2))
+#define qstricmp(s1,s2) strcasecmp((s1),(s2))
+#define qstrdup(s) strdup((s))
+#endif
+
 // -------------------------------------------------------------------------
 
 #ifndef QT_H
diff --git a/WebCore/kwq/qt/_qglist.cpp b/WebCore/kwq/qt/_qglist.cpp
index f3adc8f..4e6bf7c 100644
--- a/WebCore/kwq/qt/_qglist.cpp
+++ b/WebCore/kwq/qt/_qglist.cpp
@@ -37,10 +37,12 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifdef HAVE_CONFIG_H
+#include <config.h>
 #endif
 
+#ifdef USING_BORROWED_QLIST
+
 // -------------------------------------------------------------------------
 
 #include "_qglist.h"
@@ -1231,3 +1233,9 @@ QCollection::Item QGListIterator::operator-=( uint jumps )
 	curNode = curNode->prev;
     return curNode ? curNode->getData() : 0;
 }
+
+// KWQ hacks ---------------------------------------------------------------
+
+#endif // USING_BORROWED_QVECTOR
+
+// -------------------------------------------------------------------------
diff --git a/WebCore/kwq/qt/_qglist.h b/WebCore/kwq/qt/_qglist.h
index ce21e30..4103b11 100644
--- a/WebCore/kwq/qt/_qglist.h
+++ b/WebCore/kwq/qt/_qglist.h
@@ -40,8 +40,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QLIST
+#define USING_BORROWED_QLIST
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/kwq/qt/_qglobal.cpp b/WebCore/kwq/qt/_qglobal.cpp
index 705e12f..013222c 100644
--- a/WebCore/kwq/qt/_qglobal.cpp
+++ b/WebCore/kwq/qt/_qglobal.cpp
@@ -23,14 +23,6 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-// KWQ hacks ---------------------------------------------------------------
-
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
-#endif
-
-// -------------------------------------------------------------------------
-
 void qDebug(const char *msg, ...)
 {
 }
diff --git a/WebCore/kwq/qt/_qgvector.cpp b/WebCore/kwq/qt/_qgvector.cpp
index 8b6b64f..e8ea0ae 100644
--- a/WebCore/kwq/qt/_qgvector.cpp
+++ b/WebCore/kwq/qt/_qgvector.cpp
@@ -37,10 +37,12 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifdef HAVE_CONFIG_H
+#include <config.h>
 #endif
 
+#ifdef USING_BORROWED_QVECTOR
+
 // -------------------------------------------------------------------------
 
 #define	 QGVECTOR_CPP
@@ -661,3 +663,9 @@ QDataStream &QGVector::write( QDataStream &s ) const
     return s;
 }
 #endif // QT_NO_DATASTREAM
+
+// KWQ hacks ---------------------------------------------------------------
+
+#endif USING_BORROWED_QVECTOR
+
+// -------------------------------------------------------------------------
diff --git a/WebCore/kwq/qt/_qgvector.h b/WebCore/kwq/qt/_qgvector.h
index b679e77..f0ab5c6 100644
--- a/WebCore/kwq/qt/_qgvector.h
+++ b/WebCore/kwq/qt/_qgvector.h
@@ -40,8 +40,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QVECTOR
+#define USING_BORROWED_QVECTOR
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/kwq/qt/_qiodevice.cpp b/WebCore/kwq/qt/_qiodevice.cpp
index 81f91a5..8b83650 100644
--- a/WebCore/kwq/qt/_qiodevice.cpp
+++ b/WebCore/kwq/qt/_qiodevice.cpp
@@ -35,6 +35,16 @@
 **
 **********************************************************************/
 
+// KWQ hacks ---------------------------------------------------------------
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef USING_BORROWED_QFILE
+
+// -------------------------------------------------------------------------
+
 #include "_qiodevice.h"
 
 // NOT REVISED
@@ -636,3 +646,9 @@ int QIODevice::readLine( char *data, uint maxlen )
 
   \sa getch(), putch()
 */
+
+// KWQ hacks ---------------------------------------------------------------
+
+#endif USING_BORROWED_QFILE
+
+// -------------------------------------------------------------------------
diff --git a/WebCore/kwq/qt/_qlist.h b/WebCore/kwq/qt/_qlist.h
index c607b43..62824f1 100644
--- a/WebCore/kwq/qt/_qlist.h
+++ b/WebCore/kwq/qt/_qlist.h
@@ -40,8 +40,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QLIST
+#define USING_BORROWED_QLIST
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/kwq/qt/_qmap.cpp b/WebCore/kwq/qt/_qmap.cpp
index 643fbe5..8d61dcd 100644
--- a/WebCore/kwq/qt/_qmap.cpp
+++ b/WebCore/kwq/qt/_qmap.cpp
@@ -35,16 +35,14 @@
 **
 **********************************************************************/
 
+#include <qmap.h>
+
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
-#endif
+#ifdef USING_BORROWED_QMAP
 
 // -------------------------------------------------------------------------
 
-#include "qmap.h"
-
 typedef QMapNodeBase* NodePtr;
 typedef QMapNodeBase Node;
 
@@ -261,3 +259,4 @@ NodePtr QMapPrivateBase::removeAndRebalance( NodePtr z, NodePtr& root,
     return y;
 }
 
+#endif // USING_BORROWED_QMAP
diff --git a/WebCore/kwq/qt/_qpoint.cpp b/WebCore/kwq/qt/_qpoint.cpp
index da705f8..338ef59 100644
--- a/WebCore/kwq/qt/_qpoint.cpp
+++ b/WebCore/kwq/qt/_qpoint.cpp
@@ -10,12 +10,6 @@
  *
  ***********************************************************************/
 
-// KWQ hacks ---------------------------------------------------------------
-
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
-#endif
-
 // -------------------------------------------------------------------------
 
 #include "qpoint.h"
@@ -78,9 +72,11 @@ ostream &operator<<(ostream &o, const QPoint &p)
 }
 #endif
 
-// KWQ_COMPLETE implementations ------------------------------------------
+// KWQ hacks ---------------------------------------------------------------
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QPOINT
+
+// -------------------------------------------------------------------------
 
 bool QPoint::isNull() const
 { 
@@ -190,4 +186,8 @@ QPoint operator/(const QPoint &p, double d)
     return QPoint((QCOORD)(p.xx / d), (QCOORD)(p.yy / d)); 
 }
 
-#endif // _KWQ_COMPLETE_
+// KWQ hacks ---------------------------------------------------------------
+
+#endif USING_BORROWED_QPOINT
+
+// -------------------------------------------------------------------------
diff --git a/WebCore/kwq/qt/_qptrdict.h b/WebCore/kwq/qt/_qptrdict.h
index 6ac8cc5..87df229 100644
--- a/WebCore/kwq/qt/_qptrdict.h
+++ b/WebCore/kwq/qt/_qptrdict.h
@@ -40,8 +40,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QPTRDICT
+#define USING_BORROWED_QPTRDICT
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/kwq/qt/_qrect.cpp b/WebCore/kwq/qt/_qrect.cpp
index 84e08ba..cd7c3a8 100644
--- a/WebCore/kwq/qt/_qrect.cpp
+++ b/WebCore/kwq/qt/_qrect.cpp
@@ -12,8 +12,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifdef HAVE_CONFIG_H
+#include <config.h>
 #endif
 
 // -------------------------------------------------------------------------
@@ -117,6 +117,16 @@ bool QRect::intersects(const QRect &r) const
             QMAX(y1, r.y1) <= QMIN(y2, r.y2));
 }
 
+QRect QRect::operator&(const QRect &r) const
+{
+    QRect tmp;
+    tmp.x1 = QMAX(x1, r.x1);
+    tmp.x2 = QMIN(x2, r.x2);
+    tmp.y1 = QMAX(y1, r.y1);
+    tmp.y2 = QMIN(y2, r.y2);
+    return tmp;
+}
+
 #ifdef _KWQ_IOSTREAM_
 ostream &operator<<(ostream &o, const QRect &r)
 {
@@ -133,10 +143,11 @@ ostream &operator<<(ostream &o, const QRect &r)
 }
 #endif
 
+// KWQ hacks ---------------------------------------------------------------
 
-// KWQ_COMPLETE implementations ------------------------------------------
+#ifdef USING_BORROWED_QRECT
 
-#ifdef _KWQ_COMPLETE_
+// -------------------------------------------------------------------------
 
 QRect::QRect( const QPoint &topLeft, const QPoint &bottomRight )
 {
@@ -393,16 +404,6 @@ QRect QRect::operator|(const QRect &r) const
     }
 }
 
-QRect QRect::operator&(const QRect &r) const
-{
-    QRect tmp;
-    tmp.x1 = QMAX(x1, r.x1);
-    tmp.x2 = QMIN(x2, r.x2);
-    tmp.y1 = QMAX(y1, r.y1);
-    tmp.y2 = QMIN(y2, r.y2);
-    return tmp;
-}
-
 bool operator==(const QRect &r1, const QRect &r2)
 {
     return r1.x1==r2.x1 && r1.x2==r2.x2 && r1.y1==r2.y1 && r1.y2==r2.y2;
@@ -413,4 +414,8 @@ bool operator!=(const QRect &r1, const QRect &r2)
     return r1.x1!=r2.x1 || r1.x2!=r2.x2 || r1.y1!=r2.y1 || r1.y2!=r2.y2;
 }
 
-#endif // _KWQ_COMPLETE_
+// KWQ hacks ---------------------------------------------------------------
+
+#endif // USING_BORROWED_QRECT
+
+// -------------------------------------------------------------------------
diff --git a/WebCore/kwq/qt/_qregexp.cpp b/WebCore/kwq/qt/_qregexp.cpp
index 5127c56..361322d 100644
--- a/WebCore/kwq/qt/_qregexp.cpp
+++ b/WebCore/kwq/qt/_qregexp.cpp
@@ -37,10 +37,12 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifdef HAVE_CONFIG_H
+#include <config.h>
 #endif
 
+#ifdef USING_BORROWED_QREGEXP
+
 // -------------------------------------------------------------------------
 
 #include "qregexp.h"
@@ -1098,4 +1100,9 @@ void QRegExp::compile()
 #endif
 }
 
+// KWQ hacks ---------------------------------------------------------------
+
+#endif // USING_BORROWED_QREGION
+
+// -------------------------------------------------------------------------
 
diff --git a/WebCore/kwq/qt/_qregexp.h b/WebCore/kwq/qt/_qregexp.h
index 4b3db10..87c7221 100644
--- a/WebCore/kwq/qt/_qregexp.h
+++ b/WebCore/kwq/qt/_qregexp.h
@@ -40,8 +40,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QREGEXP
+#define USING_BORROWED_QREGEXP
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/kwq/qt/_qregion.cpp b/WebCore/kwq/qt/_qregion.cpp
index 2f3f154..f0f752b 100644
--- a/WebCore/kwq/qt/_qregion.cpp
+++ b/WebCore/kwq/qt/_qregion.cpp
@@ -37,10 +37,12 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifdef HAVE_CONFIG_H
+#include <config.h>
 #endif
 
+#ifdef USING_BORROWED_QREGION
+
 // -------------------------------------------------------------------------
 
 #include "qregion.h"
@@ -345,3 +347,8 @@ QRegion& QRegion::operator-=( const QRegion &r )
 QRegion& QRegion::operator^=( const QRegion &r )
     { return *this = *this ^ r; }
 
+// KWQ hacks ---------------------------------------------------------------
+
+#endif // USING_BORROWED_QREGION
+
+// -------------------------------------------------------------------------
diff --git a/WebCore/kwq/qt/_qregion.h b/WebCore/kwq/qt/_qregion.h
index 71db1b7..f0a4a8e 100644
--- a/WebCore/kwq/qt/_qregion.h
+++ b/WebCore/kwq/qt/_qregion.h
@@ -40,8 +40,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QREGION
+#define USING_BORROWED_QREGION
 #endif
 
 #include <KWQDef.h>
@@ -66,7 +66,7 @@ public:
     QRegion( const QPointArray &, bool winding=FALSE );
     QRegion( const QRegion & );
 // FIXME: Take this out until such time as bitmaps are implemented
-#ifndef _KWQ_COMPLETE_    
+#ifndef USING_BORROWED_QREGION
     QRegion( const QBitmap & );
 #endif
    ~QRegion();
diff --git a/WebCore/kwq/qt/_qshared.h b/WebCore/kwq/qt/_qshared.h
index e24bcdb..f2bf40a 100644
--- a/WebCore/kwq/qt/_qshared.h
+++ b/WebCore/kwq/qt/_qshared.h
@@ -19,10 +19,6 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
-#endif
-
 #include <KWQDef.h>
 
 // -------------------------------------------------------------------------
diff --git a/WebCore/kwq/qt/_qsize.cpp b/WebCore/kwq/qt/_qsize.cpp
index e7cee09..f77e221 100644
--- a/WebCore/kwq/qt/_qsize.cpp
+++ b/WebCore/kwq/qt/_qsize.cpp
@@ -12,8 +12,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifdef HAVE_CONFIG_H
+#include <config.h>
 #endif
 
 // -------------------------------------------------------------------------
@@ -100,9 +100,11 @@ ostream &operator<<(ostream &o, const QSize &s)
 }
 #endif
 
-// KWQ_COMPLETE implementations ------------------------------------------
+// KWQ hacks ---------------------------------------------------------------
+
+#ifdef USING_BORROWED_QSIZE
 
-#ifdef _KWQ_COMPLETE_
+// -------------------------------------------------------------------------
 
 bool QSize::isNull() const
 {
@@ -211,4 +213,8 @@ QSize operator/(const QSize &s, double d)
     return QSize((QCOORD)(s.w / d), (QCOORD)(s.h / d));
 }
 
-#endif // _KWQ_COMPLETE_
+// KWQ hacks ---------------------------------------------------------------
+
+#endif // USING_BORROWED_QSIZE
+
+// -------------------------------------------------------------------------
diff --git a/WebCore/kwq/qt/_qsortedlist.h b/WebCore/kwq/qt/_qsortedlist.h
index cb78bee..21f47b5 100644
--- a/WebCore/kwq/qt/_qsortedlist.h
+++ b/WebCore/kwq/qt/_qsortedlist.h
@@ -40,8 +40,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QSORTEDLIST
+#define USING_BORROWED_QSORTEDLIST
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/kwq/qt/_qstack.h b/WebCore/kwq/qt/_qstack.h
index 55f3446..db29522 100644
--- a/WebCore/kwq/qt/_qstack.h
+++ b/WebCore/kwq/qt/_qstack.h
@@ -40,8 +40,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QSTACK
+#define USING_BORROWED_QSTACK
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/kwq/qt/_qstring.cpp b/WebCore/kwq/qt/_qstring.cpp
index 07a845a..58921a6 100644
--- a/WebCore/kwq/qt/_qstring.cpp
+++ b/WebCore/kwq/qt/_qstring.cpp
@@ -37,10 +37,12 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifdef HAVE_CONFIG_H
+#include <config.h>
 #endif
 
+#ifdef USING_BORROWED_QSTRING
+
 // -------------------------------------------------------------------------
 
 // Don't define it while compiling this module, or USERS of Qt will
@@ -49,7 +51,7 @@
 #undef QT_NO_CAST_ASCII
 #endif
 
-#include "qstring.h"
+#include <qstring.h>
 #include "qregexp.h"
 
 #ifndef QT_NO_DATASTREAM
@@ -15273,3 +15275,9 @@ QString qt_winMB2QString( const char* mb, int mblen )
 
 
 #endif // _OS_WIN32_
+
+// KWQ hacks ---------------------------------------------------------------
+
+#endif // USING_BORROWED_QSTRING
+
+// -------------------------------------------------------------------------
diff --git a/WebCore/kwq/qt/_qstring.h b/WebCore/kwq/qt/_qstring.h
index cae347f..f60f94b 100644
--- a/WebCore/kwq/qt/_qstring.h
+++ b/WebCore/kwq/qt/_qstring.h
@@ -45,8 +45,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QSTRING
+#define USING_BORROWED_QSTRING
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/kwq/qt/_qstringlist.cpp b/WebCore/kwq/qt/_qstringlist.cpp
index 6688bb1..6b87311 100644
--- a/WebCore/kwq/qt/_qstringlist.cpp
+++ b/WebCore/kwq/qt/_qstringlist.cpp
@@ -37,10 +37,12 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifdef HAVE_CONFIG_H
+#include <config.h>
 #endif
 
+#ifdef USING_BORROWED_QSTRINGLIST
+
 // -------------------------------------------------------------------------
 
 #include "qstringlist.h"
@@ -260,10 +262,13 @@ QStringList QStringList::grep( const QString &str, bool cs ) const
 QStringList QStringList::grep( const QRegExp &expr ) const
 {
     QStringList res;
+#ifdef USING_BORROWED_QSTRING
     for ( QStringList::ConstIterator it = begin(); it != end(); ++it )
 	if ( (*it).contains( expr ) )
 	    res << *it;
-
+#else
+#warning function is not implemented
+#endif
     return res;
 }
 
@@ -312,3 +317,9 @@ QStringList QStringList::fromStrList(const QStrList& ascii)
 }
 
 #endif //QT_NO_STRINGLIST
+
+// KWQ hacks ---------------------------------------------------------------
+
+#endif USING_BORROWED_QSTRINGLIST
+
+// -------------------------------------------------------------------------
diff --git a/WebCore/kwq/qt/_qstringlist.h b/WebCore/kwq/qt/_qstringlist.h
index 7018c09..0b54fac 100644
--- a/WebCore/kwq/qt/_qstringlist.h
+++ b/WebCore/kwq/qt/_qstringlist.h
@@ -40,8 +40,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QSTRINGLIST
+#define USING_BORROWED_QSTRINGLIST
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/kwq/qt/_qstrlist.h b/WebCore/kwq/qt/_qstrlist.h
index f7700f2..ffcd178 100644
--- a/WebCore/kwq/qt/_qstrlist.h
+++ b/WebCore/kwq/qt/_qstrlist.h
@@ -40,12 +40,19 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QSTRINGLIST
+#define USING_BORROWED_QSTRINGLIST
 #endif
 
 #include <KWQDef.h>
 
+#ifndef USING_BORROWED_QSTRING
+#include <string.h>
+#define qstrcmp(s1,s2) strcmp((s1),(s2))
+#define qstricmp(s1,s2) strcasecmp((s1),(s2))
+#define qstrdup(s) strdup((s))
+#endif
+
 // -------------------------------------------------------------------------
 
 #ifndef QT_H
diff --git a/WebCore/kwq/qt/_qtextcodec.h b/WebCore/kwq/qt/_qtextcodec.h
index 4e6ac8b..f2ba71e 100644
--- a/WebCore/kwq/qt/_qtextcodec.h
+++ b/WebCore/kwq/qt/_qtextcodec.h
@@ -40,10 +40,6 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
-#endif
-
 #include <KWQDef.h>
 
 // -------------------------------------------------------------------------
diff --git a/WebCore/kwq/qt/_qtl.h b/WebCore/kwq/qt/_qtl.h
index e1e2d1e..4b9c462 100644
--- a/WebCore/kwq/qt/_qtl.h
+++ b/WebCore/kwq/qt/_qtl.h
@@ -39,8 +39,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QSTRINGLIST
+#define USING_BORROWED_QSTRINGLIST
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/kwq/qt/_qvaluelist.h b/WebCore/kwq/qt/_qvaluelist.h
index 1132929..ed1b8ce 100644
--- a/WebCore/kwq/qt/_qvaluelist.h
+++ b/WebCore/kwq/qt/_qvaluelist.h
@@ -40,8 +40,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QVALUELIST
+#define USING_BORROWED_QVALUELIST
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/kwq/qt/_qvector.h b/WebCore/kwq/qt/_qvector.h
index 6b55f28..b9c37a7 100644
--- a/WebCore/kwq/qt/_qvector.h
+++ b/WebCore/kwq/qt/_qvector.h
@@ -40,8 +40,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QVECTOR
+#define USING_BORROWED_QVECTOR
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/kwq/qt/qarray.h b/WebCore/kwq/qt/qarray.h
index f0bf2db..37ab082 100644
--- a/WebCore/kwq/qt/qarray.h
+++ b/WebCore/kwq/qt/qarray.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QARRAY =======================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QARRAY
 #include <_qarray.h>
 #else
 
@@ -77,6 +77,6 @@ public:
 
 }; // class QArray =============================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QARRAY
 
 #endif
diff --git a/WebCore/kwq/qt/qcolor.h b/WebCore/kwq/qt/qcolor.h
index 022f8c5..5603b82 100644
--- a/WebCore/kwq/qt/qcolor.h
+++ b/WebCore/kwq/qt/qcolor.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QCOLOR =======================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QCOLOR
 #include <_qcolor.h>
 #else
 
@@ -94,6 +94,6 @@ public:
 
 }; // class QColor =============================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QCOLOR
 
 #endif
diff --git a/WebCore/kwq/qt/qcstring.h b/WebCore/kwq/qt/qcstring.h
index a42f93b..8e68252 100644
--- a/WebCore/kwq/qt/qcstring.h
+++ b/WebCore/kwq/qt/qcstring.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QSTRING ======================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QSTRING
 #include <_qcstring.h>
 #else
 
@@ -83,7 +83,7 @@ public:
     QCString &operator=(const QCString &);
     QCString &operator=(const char *);
     QCString &operator+=(const char *);
-    QCString &operator+=(const QCString &);
+    QCString &operator+=(char);
 
 #ifdef _KWQ_IOSTREAM_
     friend ostream &operator<<(ostream &, const QCString &);
@@ -92,6 +92,9 @@ public:
 // protected -------------------------------------------------------------------
 // private ---------------------------------------------------------------------
 
+private:
+    bool resize(uint);
+
 }; // class QCString ===========================================================
 
 
@@ -102,6 +105,6 @@ bool operator==(const QCString &s1, const char *s2);
 bool operator!=(const char *s1, const QCString &s2);
 bool operator!=(const QCString &s1, const char *s2);
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QSTRING
 
 #endif
diff --git a/WebCore/kwq/qt/qdatetime.h b/WebCore/kwq/qt/qdatetime.h
index f185d3f..3570888 100644
--- a/WebCore/kwq/qt/qdatetime.h
+++ b/WebCore/kwq/qt/qdatetime.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QDATETIME ====================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QDATETIME
 #include <_qdatetime.h>
 #else
 
@@ -159,6 +159,6 @@ public:
 
 }; // class QDateTime ==========================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QDATETIME
 
 #endif
diff --git a/WebCore/kwq/qt/qdict.h b/WebCore/kwq/qt/qdict.h
index fd7d0d6..4234247 100644
--- a/WebCore/kwq/qt/qdict.h
+++ b/WebCore/kwq/qt/qdict.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QDICT ========================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QDICT
 #include <_qdict.h>
 #else
 
@@ -124,6 +124,6 @@ private:
 
 }; // class QDictIterator ======================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QDICT
 
 #endif
diff --git a/WebCore/kwq/qt/qfile.h b/WebCore/kwq/qt/qfile.h
index f67b7df..7034859 100644
--- a/WebCore/kwq/qt/qfile.h
+++ b/WebCore/kwq/qt/qfile.h
@@ -32,7 +32,9 @@
 
 #include <KWQDef.h>
 
-#ifdef _KWQ_COMPLETE_
+// USING_BORROWED_QFILE =======================================================
+
+#ifdef USING_BORROWED_QFILE
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -116,7 +118,7 @@ struct QFileInfoCache
 };
 
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QFILE
 
 
 #include "_qiodevice.h"
@@ -131,7 +133,7 @@ public:
 
     // typedefs ----------------------------------------------------------------
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QFILE
     typedef QCString(*EncoderFn)(const QString &);
     typedef QString(*DecoderFn)(const QCString &);
 #endif
@@ -140,7 +142,7 @@ public:
     // constants ---------------------------------------------------------------
     // static member functions -------------------------------------------------
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QFILE
     static QCString encodeName(const QString &);
     static QString decodeName(const QCString &);
     static void setEncodingFunction(EncoderFn);
@@ -164,7 +166,7 @@ public:
     uint size() const;
 
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QFILE
     bool remove();
 
     QString	name() const;
@@ -194,7 +196,7 @@ public:
 
 // protected -------------------------------------------------------------------
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QFILE
 protected:
     QString fn;
     FILE *fh;
@@ -213,14 +215,14 @@ private:
     QFile(const QFile &);
     QFile &operator=(const QFile &);
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QFILE
     void init();
     QCString ungetchBuffer;
 #endif
 
 }; // class QFile ==============================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QFILE
 
 inline int QFile::at() const
 {
@@ -230,6 +232,7 @@ inline int QFile::at() const
 inline QString QFile::name() const
 { return fn; }
 
-#endif
+
+#endif // USING_BORROWED_QFILE
 
 #endif
diff --git a/WebCore/kwq/qt/qlist.h b/WebCore/kwq/qt/qlist.h
index 7d6bdf5..f0cdb1b 100644
--- a/WebCore/kwq/qt/qlist.h
+++ b/WebCore/kwq/qt/qlist.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QLIST ========================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QLIST
 #include <_qlist.h>
 #else
 
@@ -142,6 +142,6 @@ private:
 
 }; // class QListIterator ======================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QLIST
 
 #endif
diff --git a/WebCore/kwq/qt/qmap.h b/WebCore/kwq/qt/qmap.h
index 1c30401..b21233b 100644
--- a/WebCore/kwq/qt/qmap.h
+++ b/WebCore/kwq/qt/qmap.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QMAP =========================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QMAP
 #include <_qmap.h>
 #else
 
@@ -173,6 +173,6 @@ public:
 
 }; // class QMap ===============================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QMAP
 
 #endif
diff --git a/WebCore/kwq/qt/qpoint.h b/WebCore/kwq/qt/qpoint.h
index 7607f39..4408964 100644
--- a/WebCore/kwq/qt/qpoint.h
+++ b/WebCore/kwq/qt/qpoint.h
@@ -64,7 +64,7 @@ public:
 
     int manhattanLength() const;
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QPOINT
     bool isNull() const;
     void setX(int);
     void setY(int);
@@ -79,7 +79,7 @@ public:
     friend QPoint operator+(const QPoint &, const QPoint &);
     friend QPoint operator-(const QPoint &, const QPoint &);
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QPOINT
     QPoint &operator+=(const QPoint &);
     QPoint &operator-=(const QPoint &);
     QPoint &operator*=(int);
diff --git a/WebCore/kwq/qt/qptrdict.h b/WebCore/kwq/qt/qptrdict.h
index cf80222..3f0c240 100644
--- a/WebCore/kwq/qt/qptrdict.h
+++ b/WebCore/kwq/qt/qptrdict.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QPTRDICT =====================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QPTRDICT
 #include <_qptrdict.h>
 #else
 
@@ -123,6 +123,6 @@ private:
 
 }; // class QPtrDictIterator ===================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QPTRDICT
 
 #endif
diff --git a/WebCore/kwq/qt/qrect.h b/WebCore/kwq/qt/qrect.h
index 5aa018e..3ae421d 100644
--- a/WebCore/kwq/qt/qrect.h
+++ b/WebCore/kwq/qt/qrect.h
@@ -53,7 +53,7 @@ public:
     QRect(int, int, int, int);
     QRect(const QRect &);
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QRECT
     QRect(const QPoint &, const QPoint &);
     QRect(const QPoint &, const QSize &);
 #endif
@@ -83,7 +83,7 @@ public:
     QRect intersect(const QRect &) const;
     bool intersects(const QRect &) const;
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QRECT
     bool isEmpty() const;
     QRect normalize() const;
 
@@ -118,7 +118,7 @@ public:
     bool contains(int, int, bool proper=FALSE) const;
     bool contains(const QRect &, bool proper=FALSE) const;
     QRect unite(const QRect &) const;
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QRECT
 
     // operators ---------------------------------------------------------------
 
@@ -126,12 +126,13 @@ public:
      * QRect &operator=(const QRect &);
      */
 
-#ifdef _KWQ_COMPLETE_
+    QRect operator&(const QRect &) const;
+
+#ifdef USING_BORROWED_QRECT
     friend bool operator==(const QRect &, const QRect &);
     friend bool operator!=(const QRect &, const QRect &);
 
     QRect operator|(const QRect &) const;
-    QRect operator&(const QRect &) const;
     QRect& operator|=(const QRect &);
     QRect& operator&=(const QRect &);
 #endif
diff --git a/WebCore/kwq/qt/qregexp.h b/WebCore/kwq/qt/qregexp.h
index 64a1e5b..89633aa 100644
--- a/WebCore/kwq/qt/qregexp.h
+++ b/WebCore/kwq/qt/qregexp.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QREGEXP ======================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QREGEXP
 #include <_qregexp.h>
 #else
 
@@ -66,6 +66,6 @@ public:
 
 }; // class QRegExp ============================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QREGEXP
 
 #endif
diff --git a/WebCore/kwq/qt/qregion.h b/WebCore/kwq/qt/qregion.h
index b1d6a17..142f2d8 100644
--- a/WebCore/kwq/qt/qregion.h
+++ b/WebCore/kwq/qt/qregion.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QREGION ======================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QREGION
 #include <_qregion.h>
 #include "qpoint.h"
 #include "qimage.h"
@@ -81,6 +81,6 @@ public:
 
 }; // class QRegion ============================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QREGION
 
 #endif
diff --git a/WebCore/kwq/qt/qsize.h b/WebCore/kwq/qt/qsize.h
index db80871..8e6014d 100644
--- a/WebCore/kwq/qt/qsize.h
+++ b/WebCore/kwq/qt/qsize.h
@@ -64,7 +64,7 @@ public:
     void setHeight(int);
     QSize expandedTo(const QSize &) const;
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QSIZE
     bool isNull() const;
     bool isEmpty() const;
     void transpose();
@@ -81,7 +81,7 @@ public:
     friend bool operator==(const QSize &, const QSize &);
     friend bool operator!=(const QSize &, const QSize &);
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QSIZE
     QSize &operator+=(const QSize &);
     QSize &operator-=(const QSize &);
     QSize &operator*=(int);
diff --git a/WebCore/kwq/qt/qsortedlist.h b/WebCore/kwq/qt/qsortedlist.h
index eee362a..bda8bb3 100644
--- a/WebCore/kwq/qt/qsortedlist.h
+++ b/WebCore/kwq/qt/qsortedlist.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QSORTEDLIST ==================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QSORTEDLIST
 #include <_qsortedlist.h>
 #else
 
@@ -65,6 +65,6 @@ public:
 
 }; // class QSortedList ========================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QSORTEDLIST
 
 #endif
diff --git a/WebCore/kwq/qt/qstack.h b/WebCore/kwq/qt/qstack.h
index 49e342d..247832b 100644
--- a/WebCore/kwq/qt/qstack.h
+++ b/WebCore/kwq/qt/qstack.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QSTACK =======================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QSTACK
 #include <_qstack.h>
 #else
 
@@ -66,6 +66,6 @@ public:
 
 }; // class QStack =============================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QSTACK
 
 #endif
diff --git a/WebCore/kwq/qt/qstring.h b/WebCore/kwq/qt/qstring.h
index ed94e9e..6373a5e 100644
--- a/WebCore/kwq/qt/qstring.h
+++ b/WebCore/kwq/qt/qstring.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QSTRING ======================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QSTRING
 #include <_qstring.h>
 #else
 
@@ -128,7 +128,7 @@ public:
 
 class QString {
 public:
-    static QString fromLatin1(const char*, int len=-1);
+    static QString fromLatin1(const char *, int len=-1);
 
     // typedefs ----------------------------------------------------------------
     // enums -------------------------------------------------------------------
@@ -177,8 +177,7 @@ public:
     QString &append(const char *);
     QString &append(const QString &);
 
-    int contains(const char *, bool) const;
-    int contains(const char *) const;
+    int contains(const char *, bool cs=TRUE) const;
     int contains(char) const;
 
     int find(char, int index=0) const;
@@ -299,6 +298,6 @@ private:
 
 }; // class QConstString =======================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QSTRING
 
 #endif
diff --git a/WebCore/kwq/qt/qstringlist.h b/WebCore/kwq/qt/qstringlist.h
index 5f339a6..f6f0c6c 100644
--- a/WebCore/kwq/qt/qstringlist.h
+++ b/WebCore/kwq/qt/qstringlist.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QSTRINGLIST ==================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QSTRINGLIST
 #include <_qstringlist.h>
 #else
 
@@ -75,6 +75,6 @@ public:
 
 }; // class QStringList ========================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QSTRINGLIST
 
 #endif
diff --git a/WebCore/kwq/qt/qtextstream.h b/WebCore/kwq/qt/qtextstream.h
index c001c38..816e03f 100644
--- a/WebCore/kwq/qt/qtextstream.h
+++ b/WebCore/kwq/qt/qtextstream.h
@@ -30,12 +30,13 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QTEXTSTREAM ==================================================
 
 // FIXME: Need a hack here to give the xml tokenizer text stream
 // defines from Qt. The NEED_BOGUS_TEXTSTREAMS symbol
 // can be removed when we have Qt text streams implemented
-#if defined _KWQ_COMPLETE_ && ! defined NEED_BOGUS_TEXTSTREAMS
+
+#if defined USING_BORROWED_QTEXTSTREAM && ! defined NEED_BOGUS_TEXTSTREAMS
 #include <_qtextstream.h>
 #else
 
@@ -168,6 +169,6 @@ private:
 
 }; // class QTextOStream =======================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QTEXTSTREAM
 
 #endif
diff --git a/WebCore/kwq/qt/qvaluelist.h b/WebCore/kwq/qt/qvaluelist.h
index ed60c14..098c10d 100644
--- a/WebCore/kwq/qt/qvaluelist.h
+++ b/WebCore/kwq/qt/qvaluelist.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QVALUELIST ===================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QVALUELIST
 #include <_qvaluelist.h>
 #else
 
@@ -164,6 +164,6 @@ public:
 
 }; // class QValueList =========================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QVALUELIST
 
 #endif
diff --git a/WebCore/kwq/qt/qvector.h b/WebCore/kwq/qt/qvector.h
index bf212cd..6a5cc73 100644
--- a/WebCore/kwq/qt/qvector.h
+++ b/WebCore/kwq/qt/qvector.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QVECTOR ======================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QVECTOR
 #include <_qvector.h>
 #else
 
@@ -110,6 +110,6 @@ public:
 
 }; // class QVector ============================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QVECTOR
 
 #endif
diff --git a/WebCore/kwq/tests/qt/Makefile.in b/WebCore/kwq/tests/qt/Makefile.in
index d0836c9..a872762 100644
--- a/WebCore/kwq/tests/qt/Makefile.in
+++ b/WebCore/kwq/tests/qt/Makefile.in
@@ -16,8 +16,9 @@ include $(TOPSRCDIR)/Makefile.vars
 # Set variables for this directory
 
 CXXOBJECTS = $(patsubst %.cpp,%.o,$(wildcard *.cpp))
+CMMOBJECTS = objc-dummy.o
 
-OBJECTS = $(CXXOBJECTS)
+OBJECTS = $(CMMOBJECTS) $(CXXOBJECTS)
 
 PROGRAMS = \
     qpoint-test \
@@ -50,19 +51,25 @@ CLEAN_FILES = *.o \
 
 CXXFLAGS = $(BASECXXFLAGS) \
     -Wall \
-    -DQ_DELETING_VOID_UNDEFINED \
-    -DQT_NO_TEXTCODEC \
-    -DQT_NO_DATASTREAM \
-    -D_KWQ_COMPLETE_ \
-    -D_KWQ_IOSTREAM_ \
+    -I$(TOPSRCDIR) \
     -I../../qt \
     -I../.. \
     -I. \
     $(NULL)
 
+CMMFLAGS = $(BASECMMFLAGS)
+
+LIBS = objc-dummy.o \
+    -framework Cocoa \
+    -lkwq \
+    -l_qt \
+    -lkwq \
+    -l_qt \
+    $(NULL)
+
 LDFLAGS = $(BASELDFLAGS) \
+    -L../.. \
     -L../../qt \
-    -l_qt \
     $(NULL)
 
 DEPFLAGS = $(CXXFLAGS)
@@ -73,61 +80,61 @@ DEPFLAGS = $(CXXFLAGS)
 all: $(OBJECTS) $(PROGRAMS)
 
 qpoint-test: qpoint-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qsize-test: qsize-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qrect-test: qrect-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qcstring-test: qcstring-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qarray-test: qarray-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qmap-test: qmap-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qvaluelist-test: qvaluelist-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qstringlist-test: qstringlist-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qlist-test: qlist-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qvector-test: qvector-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qdict-test: qdict-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qptrdict-test: qptrdict-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qstack-test: qstack-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qregexp-test: qregexp-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qchar-test: qchar-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qstring-test: qstring-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qdate-test: qdate-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qtime-test: qtime-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qdatetime-test: qdatetime-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 depend: 
 
diff --git a/WebCore/kwq/tests/qt/objc-dummy.mm b/WebCore/kwq/tests/qt/objc-dummy.mm
new file mode 100644
index 0000000..531a44a
--- /dev/null
+++ b/WebCore/kwq/tests/qt/objc-dummy.mm
@@ -0,0 +1,6 @@
+#import <Cocoa/Cocoa.h>
+
+void objective_c_hack()
+{
+    NSObject *o = [NSObject alloc];
+}
diff --git a/WebCore/kwq/tests/qt/qchar-test.cpp b/WebCore/kwq/tests/qt/qchar-test.cpp
index 6e3d8a3..f672093 100644
--- a/WebCore/kwq/tests/qt/qchar-test.cpp
+++ b/WebCore/kwq/tests/qt/qchar-test.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 
 #include <qstring.h>
diff --git a/WebCore/kwq/tests/qt/qdate-test.cpp b/WebCore/kwq/tests/qt/qdate-test.cpp
index f8f40c5..e460937 100644
--- a/WebCore/kwq/tests/qt/qdate-test.cpp
+++ b/WebCore/kwq/tests/qt/qdate-test.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 
 #include <qdatetime.h>
diff --git a/WebCore/kwq/tests/qt/qdatetime-test.cpp b/WebCore/kwq/tests/qt/qdatetime-test.cpp
index 8279cd7..426bd92 100644
--- a/WebCore/kwq/tests/qt/qdatetime-test.cpp
+++ b/WebCore/kwq/tests/qt/qdatetime-test.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 
 #include <qdatetime.h>
diff --git a/WebCore/kwq/tests/qt/qdict-test.cpp b/WebCore/kwq/tests/qt/qdict-test.cpp
index 325e375..5358d0e 100644
--- a/WebCore/kwq/tests/qt/qdict-test.cpp
+++ b/WebCore/kwq/tests/qt/qdict-test.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 
 #include <qstring.h>
diff --git a/WebCore/kwq/tests/qt/qmap-test.cpp b/WebCore/kwq/tests/qt/qmap-test.cpp
index fc6a1e3..24cd8f1 100644
--- a/WebCore/kwq/tests/qt/qmap-test.cpp
+++ b/WebCore/kwq/tests/qt/qmap-test.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 
 #include <qmap.h>
diff --git a/WebCore/kwq/tests/qt/qpoint-test.cpp b/WebCore/kwq/tests/qt/qpoint-test.cpp
index 98283c5..d2cd76b 100644
--- a/WebCore/kwq/tests/qt/qpoint-test.cpp
+++ b/WebCore/kwq/tests/qt/qpoint-test.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 
 #include <qpoint.h>
diff --git a/WebCore/kwq/tests/qt/qrect-test.cpp b/WebCore/kwq/tests/qt/qrect-test.cpp
index 85c6314..7a6106a 100644
--- a/WebCore/kwq/tests/qt/qrect-test.cpp
+++ b/WebCore/kwq/tests/qt/qrect-test.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 
 #include <qrect.h>
diff --git a/WebCore/kwq/tests/qt/qregexp-test.cpp b/WebCore/kwq/tests/qt/qregexp-test.cpp
index 34f10cc..b03c492 100644
--- a/WebCore/kwq/tests/qt/qregexp-test.cpp
+++ b/WebCore/kwq/tests/qt/qregexp-test.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 
 #include <qstring.h>
diff --git a/WebCore/kwq/tests/qt/qsize-test.cpp b/WebCore/kwq/tests/qt/qsize-test.cpp
index a81ce9d..ec2d814 100644
--- a/WebCore/kwq/tests/qt/qsize-test.cpp
+++ b/WebCore/kwq/tests/qt/qsize-test.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 
 #include <qsize.h>
diff --git a/WebCore/kwq/tests/qt/qstack-test.cpp b/WebCore/kwq/tests/qt/qstack-test.cpp
index 2a95c3a..c200770 100644
--- a/WebCore/kwq/tests/qt/qstack-test.cpp
+++ b/WebCore/kwq/tests/qt/qstack-test.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 
 #include <qstack.h>
diff --git a/WebCore/kwq/tests/qt/qstring-test.cpp b/WebCore/kwq/tests/qt/qstring-test.cpp
index 4ceff11..71fc3eb 100644
--- a/WebCore/kwq/tests/qt/qstring-test.cpp
+++ b/WebCore/kwq/tests/qt/qstring-test.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 #include <qstring.h>
 #include <qregexp.h>
@@ -64,23 +68,23 @@ int main() {
     cout << s7.find(s12, 0, TRUE) << endl;
     cout << s7.find("string", 0) << endl;
     cout << s7.find("string", 0, TRUE) << endl;
-    cout << s7.findRev(c[0], 10, TRUE) << endl;
-    cout << s7.findRev(qre, 10) << endl;
-    cout << s7.findRev(s12, -1, TRUE) << endl;
-    cout << s7.findRev('t', 10) << endl;
-    cout << s7.findRev('t', 10, TRUE) << endl;
-    
-    cout << s7.contains(c[0], TRUE) << endl;
-    cout << s7.contains(qre) << endl;
+    //cout << s7.findRev(c[0], 10, TRUE) << endl;
+    //cout << s7.findRev(qre, 10) << endl;
+    //cout << s7.findRev(s12, -1, TRUE) << endl;
+    //cout << s7.findRev('t', 10) << endl;
+    //cout << s7.findRev('t', 10, TRUE) << endl;
+    
+    //cout << s7.contains(c[0], TRUE) << endl;
+    //cout << s7.contains(qre) << endl;
     cout << s13.contains(s14, TRUE) << endl;
-    cout << s13.contains('b', TRUE) << endl;
+    //cout << s13.contains('b', TRUE) << endl;
     cout << s13.contains(blah, TRUE) << endl;
     
     cout << s13.left(4) << endl;
     cout << s13.right(4) << endl;
     cout << s13.mid(5,4) << endl;
-    cout << s14.leftJustify(8,'.') << endl;
-    cout << s14.rightJustify(8,'.') << endl;
+    //cout << s14.leftJustify(8,'.') << endl;
+    //cout << s14.rightJustify(8,'.') << endl;
     
     QString s15 = "Hello %1. How has your %2 been?";
     double my_double =22.45;
@@ -94,7 +98,7 @@ int main() {
     
     cout << s15.arg(s14).arg(s14) << endl;
     cout << s15.arg(s14, 5).arg(s14, 5) << endl; // fieldwidth only add one extra space. hmmmm.
-    cout << s15.arg(c[2]).arg(c[2]) << endl;
+    //cout << s15.arg(c[2]).arg(c[2]) << endl;
     cout << s15.arg("Gramps").arg("morning") << endl;
     cout << s15.arg(my_double).arg(my_double) << endl;
     cout << s15.arg(my_int).arg(my_long) << endl;
@@ -104,21 +108,21 @@ int main() {
     QString s16 = "THIS WAS A STRING IN UPPERCASE";
     QString s17 = "this was a string in lowercase";
     cout << s16.lower() << endl;
-    cout << s17.upper() << endl;
+    //cout << s17.upper() << endl;
     
     QString s18 =" This    was a  string   with a lot of       spaces ";
     cout << s18.stripWhiteSpace() << endl; //why is white space still there?
     cout << s18.simplifyWhiteSpace() << endl; //this works
     
     QString s19 = "221545";
-    cout << s19.toDouble() << endl;   //Am I properly testing this?
+    //cout << s19.toDouble() << endl;   //Am I properly testing this?
     cout << s19.toFloat() << endl;
     cout << s19.toInt() << endl;
     cout << s19.toLong() << endl;
-    cout << s19.toShort() << endl;
+    //cout << s19.toShort() << endl;
     cout << s19.toUInt() << endl;
-    cout << s19.toULong() << endl;
-    cout << s19.toUShort() << endl;
+    //cout << s19.toULong() << endl;
+    //cout << s19.toUShort() << endl;
     
     QString s20;
     cout << s20.sprintf("This is a %s. %d, %f", "test", 44, 56.78) << endl;
@@ -132,22 +136,22 @@ int main() {
     QString s24 = "The answer is: ";
     QChar c2 = '2';
     cout << s24.insert(15, c2) << endl;
-    cout << s24.insert(15, c, 4) << endl;
-    cout << s24.insert(15, s22) << endl;
-    cout << s24.insert(15, 'c') << endl;
+    //cout << s24.insert(15, c, 4) << endl;
+    //cout << s24.insert(15, s22) << endl;
+    //cout << s24.insert(15, 'c') << endl;
     cout << s24.append(c2) << endl;
-    cout << s24.append('c') << endl;
+    //cout << s24.append('c') << endl;
     cout << s24.append(s22) << endl;    
     cout << s24.prepend(c2) << endl;
-    cout << s24.prepend('c') << endl;
+    //cout << s24.prepend('c') << endl;
     cout << s24.prepend(s22) << endl;
     cout << s24.remove(0, 7) << endl;
     
     QString s25 = "There are a lot of a's in a sentence such as this one";
     QString s26 = "bell";
     cout << s25.replace( QRegExp("a"), "e" ) << endl; 
-    cout << s25.replace(1, 4, c, 4) << endl;
-    cout << s25.replace(12, 4, s26) << endl;
+    //cout << s25.replace(1, 4, c, 4) << endl;
+    //cout << s25.replace(12, 4, s26) << endl;
     
     QString s27;
     cout << s27.setNum(my_double) << endl;
diff --git a/WebCore/kwq/tests/qt/qstringlist-test.cpp b/WebCore/kwq/tests/qt/qstringlist-test.cpp
index 132a169..c234072 100644
--- a/WebCore/kwq/tests/qt/qstringlist-test.cpp
+++ b/WebCore/kwq/tests/qt/qstringlist-test.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 
 #include <qstring.h>
diff --git a/WebCore/kwq/tests/qt/qtime-test.cpp b/WebCore/kwq/tests/qt/qtime-test.cpp
index 67acba9..2ce19a8 100644
--- a/WebCore/kwq/tests/qt/qtime-test.cpp
+++ b/WebCore/kwq/tests/qt/qtime-test.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 
 #include <qdatetime.h>
diff --git a/WebCore/kwq/tests/qt/qvaluelist-test.cpp b/WebCore/kwq/tests/qt/qvaluelist-test.cpp
index e2e8161..5e13474 100644
--- a/WebCore/kwq/tests/qt/qvaluelist-test.cpp
+++ b/WebCore/kwq/tests/qt/qvaluelist-test.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 
 #include <qvaluelist.h>
diff --git a/WebCore/kwq/tests/qt/qvector-test.cpp b/WebCore/kwq/tests/qt/qvector-test.cpp
index 7fceda2..56e8387 100644
--- a/WebCore/kwq/tests/qt/qvector-test.cpp
+++ b/WebCore/kwq/tests/qt/qvector-test.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 
 #include <qvector.h>
diff --git a/WebCore/src/kwq/KWQChar.mm b/WebCore/src/kwq/KWQChar.mm
index ee53cca..a9b0c7a 100644
--- a/WebCore/src/kwq/KWQChar.mm
+++ b/WebCore/src/kwq/KWQChar.mm
@@ -27,6 +27,8 @@
 
 #include <qstring.h>
 
+#ifndef USING_BORROWED_QSTRING
+
 static UniChar scratchUniChar;
 
 static CFMutableStringRef GetScratchUniCharString()
@@ -224,3 +226,8 @@ int operator!=(char ch, QChar qc)
 {
     return ch != qc.c;
 }
+
+#else // USING_BORROWED_QSTRING
+// This will help to keep the linker from complaining about empty archives
+void KWQChar_Dummy() {}
+#endif // USING_BORROWED_QSTRING
diff --git a/WebCore/src/kwq/KWQString.mm b/WebCore/src/kwq/KWQString.mm
index 8df0c9c..ac4c091 100644
--- a/WebCore/src/kwq/KWQString.mm
+++ b/WebCore/src/kwq/KWQString.mm
@@ -27,6 +27,10 @@
 
 #include <qstring.h>
 
+#ifndef USING_BORROWED_QSTRING
+
+const QString QString::null;
+
 QString::QString()
 {
     s = NULL;
@@ -82,11 +86,111 @@ QString::QString(const char *chs)
     }
 }
 
+QString::QString(const QString &other)
+{
+    s = other.s;
+}
+
 QString::~QString()
 {
     CFRelease(s);
 }
 
+QString QString::lower() const
+{
+    QString result(*this);
+
+    CFStringLowercase(result.s, NULL);
+
+    return result;
+}
+
+bool QString::isNull() const
+{
+    return (s == NULL);
+}
+
+bool QString::isEmpty() const
+{
+    return (s == NULL || CFStringGetLength(s) == 0);
+}
+
+uint QString::length() const
+{
+    return CFStringGetLength(s);
+}
+
+int QString::find(char, int index=0) const
+{
+    // FIXME: awaiting real implementation
+    return 0;
+}
+
+int QString::find(const char *, int index=0, bool b=0) const
+{
+    // FIXME: awaiting real implementation
+    return 0;
+}
+
+int QString::find(const QString &, int index=0, bool b=0) const
+{
+    // FIXME: awaiting real implementation
+    return 0;
+}
+
+int QString::find(const QRegExp &, int index=0, bool b=0) const
+{
+    // FIXME: awaiting real implementation
+    return 0;
+}
+
+int QString::findRev(char, int index=0) const
+{
+    // FIXME: awaiting real implementation
+    return 0;
+}
+
+int QString::findRev(const char *, int index=0) const
+{
+    // FIXME: awaiting real implementation
+    return 0;
+}
+
+QString QString::fromLatin1(const char *s, int len=-1)
+{
+    // FIXME: awaiting real implementation
+    return NULL;
+}
+
+const char *QString::latin1() const
+{
+    // FIXME: awaiting real implementation
+    return (const char *)CFStringGetCStringPtr(s, kCFStringEncodingISOLatin1); 
+}
+
+const QChar *QString::unicode() const
+{
+    // FIXME: awaiting real implementation
+    return (QChar *)CFStringGetCharactersPtr(s); 
+}
+
+int QString::contains(const char *s, bool cs=TRUE) const
+{
+    // FIXME: awaiting real implementation
+    return 0;
+}
+
+QString QString::mid(int, int len=0xffffffff) const
+{
+    // FIXME: awaiting real implementation
+    return NULL;
+}
+
+QString::operator const char *() const
+{
+    return latin1();
+}
+
 QString &QString::operator=(const QString &qs)
 {
     // shared copy
@@ -116,6 +220,59 @@ QString &QString::operator=(char ch)
     return *this = QString(QChar(ch));
 }
 
+bool QString::operator!() const
+{ 
+    return isNull(); 
+}
+
+QChar QString::operator[](int i) const
+{
+    // FIXME: awaiting real implementation
+    return 0;
+}
+
+QString &QString::operator+=(char c)
+{
+    // FIXME: awaiting real implementation
+    return *this;
+}
+
+QString &QString::operator+=(QChar c)
+{
+    // FIXME: awaiting real implementation
+    return *this;
+}
+
+QString &QString::operator+=(const QString &s)
+{
+    // FIXME: awaiting real implementation
+    return *this;
+}
+
+bool operator==(const QString &s1, const QString &s2)
+{
+    CFComparisonResult cmp;
+    int flags;
+
+    flags = 0;
+
+    cmp = CFStringCompare(s1.s, s2.s, flags);
+    
+    return (cmp == kCFCompareEqualTo);
+}
+
+bool operator!=(const QString &s1, const QString &s2)
+{
+    CFComparisonResult cmp;
+    int flags;
+
+    flags = 0;
+
+    cmp = CFStringCompare(s1.s, s2.s, flags);
+    
+    return (cmp != kCFCompareEqualTo);
+}
+
 QConstString::QConstString(QChar *qcs, uint len)
 {
     if (qcs || len) {
@@ -132,3 +289,8 @@ const QString &QConstString::string() const
 {
     return *this;
 }
+
+#else // USING_BORROWED_QSTRING
+// This will help to keep the linker from complaining about empty archives
+void KWQString_Dummy() {}
+#endif // USING_BORROWED_QSTRING
diff --git a/WebCore/src/kwq/Makefile.in b/WebCore/src/kwq/Makefile.in
index c22651d..6000e8a 100644
--- a/WebCore/src/kwq/Makefile.in
+++ b/WebCore/src/kwq/Makefile.in
@@ -31,7 +31,9 @@ MMOBJECTS = \
 	KWQPixmap.o \
 	KWQWMatrix.o \
 	KWQWidget.o \
-# FIXME: add back in when this file builds ->  KWQString.o \
+	KWQChar.o \
+	KWQString.o \
+	KWQCString.o \
 	$(NULL)
 
 OBJECTS = $(MMOBJECTS) 
diff --git a/WebCore/src/kwq/qt/_qarray.h b/WebCore/src/kwq/qt/_qarray.h
index 439ded7..ff3bf06 100644
--- a/WebCore/src/kwq/qt/_qarray.h
+++ b/WebCore/src/kwq/qt/_qarray.h
@@ -40,8 +40,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QARRAY
+#define USING_BORROWED_QARRAY
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/src/kwq/qt/_qcollection.cpp b/WebCore/src/kwq/qt/_qcollection.cpp
index 73d0710..8e17f6f 100644
--- a/WebCore/src/kwq/qt/_qcollection.cpp
+++ b/WebCore/src/kwq/qt/_qcollection.cpp
@@ -37,10 +37,12 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifdef HAVE_CONFIG_H
+#include <config.h>
 #endif
 
+#ifdef USING_BORROWED_QCOLLECTION
+
 // -------------------------------------------------------------------------
 
 #include "_qcollection.h"
@@ -188,3 +190,9 @@ void QCollection::deleteItem( Item d )
 	delete d;				// default operation
 #endif
 }
+
+// KWQ hacks ---------------------------------------------------------------
+
+#endif USING_BORROWED_QCOLLECTION
+
+// -------------------------------------------------------------------------
diff --git a/WebCore/src/kwq/qt/_qcollection.h b/WebCore/src/kwq/qt/_qcollection.h
index 0754224..63d676e 100644
--- a/WebCore/src/kwq/qt/_qcollection.h
+++ b/WebCore/src/kwq/qt/_qcollection.h
@@ -40,10 +40,6 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
-#endif
-
 #include <KWQDef.h>
 
 // -------------------------------------------------------------------------
diff --git a/WebCore/src/kwq/qt/_qcolor.cpp b/WebCore/src/kwq/qt/_qcolor.cpp
index be6c8f0..ef0b03c 100644
--- a/WebCore/src/kwq/qt/_qcolor.cpp
+++ b/WebCore/src/kwq/qt/_qcolor.cpp
@@ -37,10 +37,12 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifdef HAVE_CONFIG_H
+#include <config.h>
 #endif
 
+#ifdef USING_BORROWED_QCOLOR
+
 // -------------------------------------------------------------------------
 
 #include "qcolor.h"
@@ -365,6 +367,7 @@ QString QColor::name() const
 
 static int hex2int( QChar hexchar )
 {
+#if USING_BORROWED_QSTRING
     int v;
     if ( hexchar.isDigit() )
 	v = hexchar.digitValue();
@@ -375,6 +378,10 @@ static int hex2int( QChar hexchar )
     else
 	v = 0;
     return v;
+#else
+#warning this function not implemented
+    return 0;
+#endif
 }
 
 
@@ -848,3 +855,9 @@ QDataStream &operator>>( QDataStream &s, QColor &c )
   \overload int qGray( qRgb rgb )
   \relates QColor
 */
+
+// KWQ hacks ---------------------------------------------------------------
+
+#endif // USING_BORROWED_QCOLOR
+
+// -------------------------------------------------------------------------
diff --git a/WebCore/src/kwq/qt/_qcolor.h b/WebCore/src/kwq/qt/_qcolor.h
index d6350d8..0771fea 100644
--- a/WebCore/src/kwq/qt/_qcolor.h
+++ b/WebCore/src/kwq/qt/_qcolor.h
@@ -40,8 +40,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QCOLOR
+#define USING_BORROWED_QCOLOR
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/src/kwq/qt/_qcstring.cpp b/WebCore/src/kwq/qt/_qcstring.cpp
index 140e893..8bfb3cf 100644
--- a/WebCore/src/kwq/qt/_qcstring.cpp
+++ b/WebCore/src/kwq/qt/_qcstring.cpp
@@ -38,10 +38,12 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifdef HAVE_CONFIG_H
+#include <config.h>
 #endif
 
+#ifdef USING_BORROWED_QSTRING
+
 // -------------------------------------------------------------------------
 
 #include "qstring.h"
@@ -1942,3 +1944,8 @@ ostream &operator<<(ostream &o, const QCString &s)
 }
 #endif
 
+// KWQ hacks ---------------------------------------------------------------
+
+#endif // USING_BORROWED_QSTRING
+
+// -------------------------------------------------------------------------
diff --git a/WebCore/src/kwq/qt/_qcstring.h b/WebCore/src/kwq/qt/_qcstring.h
index efc5fed..b77db31 100644
--- a/WebCore/src/kwq/qt/_qcstring.h
+++ b/WebCore/src/kwq/qt/_qcstring.h
@@ -41,8 +41,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QSTRING
+#define USING_BORROWED_QSTRING
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/src/kwq/qt/_qdatetime.cpp b/WebCore/src/kwq/qt/_qdatetime.cpp
index 1d31ddb..a6ab2a2 100644
--- a/WebCore/src/kwq/qt/_qdatetime.cpp
+++ b/WebCore/src/kwq/qt/_qdatetime.cpp
@@ -37,10 +37,12 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifdef HAVE_CONFIG_H
+#include <config.h>
 #endif
 
+#ifdef USING_BORROWED_QDATETIME
+
 // -------------------------------------------------------------------------
 
 #define gettimeofday	__hide_gettimeofday
@@ -1499,3 +1501,9 @@ QDataStream &operator>>( QDataStream &s, QDateTime &dt )
     return s;
 }
 #endif //QT_NO_DATASTREAM
+
+// KWQ hacks ---------------------------------------------------------------
+
+#endif // USING_BORROWED_QDATETIME
+
+// -------------------------------------------------------------------------
diff --git a/WebCore/src/kwq/qt/_qdatetime.h b/WebCore/src/kwq/qt/_qdatetime.h
index d5a530a..2fad329 100644
--- a/WebCore/src/kwq/qt/_qdatetime.h
+++ b/WebCore/src/kwq/qt/_qdatetime.h
@@ -40,8 +40,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QDATETIME
+#define USING_BORROWED_QDATETIME
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/src/kwq/qt/_qdict.h b/WebCore/src/kwq/qt/_qdict.h
index 39fc24f..912aca3 100644
--- a/WebCore/src/kwq/qt/_qdict.h
+++ b/WebCore/src/kwq/qt/_qdict.h
@@ -40,8 +40,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QDICT
+#define USING_BORROWED_QDICT
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/src/kwq/qt/_qfile.cpp b/WebCore/src/kwq/qt/_qfile.cpp
index 3516a09..7d78a25 100644
--- a/WebCore/src/kwq/qt/_qfile.cpp
+++ b/WebCore/src/kwq/qt/_qfile.cpp
@@ -37,7 +37,13 @@
 
 #include "qfile.h"
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QFILE
+
+#ifndef USING_BORROWED_QSTRING
+#include <string.h>
+#define qstrlen(s) strlen((s))
+#define qstrcpy(dest,src) strcpy((dest),(src))
+#endif
 
 extern bool qt_file_access( const QString& fn, int t );
 
@@ -292,7 +298,11 @@ void QFile::setEncodingFunction( EncoderFn f )
 static
 QString locale_decoder( const QCString &localFileName )
 {
+#ifdef USING_BORROWED_QSTRING
     return QString::fromLocal8Bit(localFileName);
+#else
+    return QString(localFileName);
+#endif
 }
 
 static QFile::DecoderFn decoder = locale_decoder;
@@ -698,4 +708,4 @@ void QFile::close()
     return;
 }
 
-#endif
+#endif // USING_BORROWED_QFILE
diff --git a/WebCore/src/kwq/qt/_qgarray.cpp b/WebCore/src/kwq/qt/_qgarray.cpp
index 1daa7f2..60671b5 100644
--- a/WebCore/src/kwq/qt/_qgarray.cpp
+++ b/WebCore/src/kwq/qt/_qgarray.cpp
@@ -12,10 +12,12 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifdef HAVE_CONFIG_H
+#include <config.h>
 #endif
 
+#ifdef USING_BORROWED_QARRAY
+
 // -------------------------------------------------------------------------
 
 #include <_qgarray.h>
@@ -430,3 +432,9 @@ void QGArray::deleteData( array_data *p )
     delete p;
     p = 0;
 }
+
+// KWQ hacks ---------------------------------------------------------------
+
+#endif // USING_BORROWED_QARRAY
+
+// -------------------------------------------------------------------------
diff --git a/WebCore/src/kwq/qt/_qgarray.h b/WebCore/src/kwq/qt/_qgarray.h
index a18c5c4..89b77d7 100644
--- a/WebCore/src/kwq/qt/_qgarray.h
+++ b/WebCore/src/kwq/qt/_qgarray.h
@@ -15,8 +15,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QARRAY
+#define USING_BORROWED_QARRAY
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/src/kwq/qt/_qgdict.cpp b/WebCore/src/kwq/qt/_qgdict.cpp
index 4f869c7..d3cb6c3 100644
--- a/WebCore/src/kwq/qt/_qgdict.cpp
+++ b/WebCore/src/kwq/qt/_qgdict.cpp
@@ -37,10 +37,12 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifdef HAVE_CONFIG_H
+#include <config.h>
 #endif
 
+#ifdef USING_BORROWED_QDICT
+
 // -------------------------------------------------------------------------
 
 #include "_qgdict.h"
@@ -102,6 +104,7 @@ int QGDict::hashKeyString( const QString &key )
     if ( key.isNull() )
 	qWarning( "QGDict::hashStringKey: Invalid null key" );
 #endif
+#ifdef USING_BORROWED_QSTRING
     int i;
     register uint h=0;
     uint g;
@@ -125,6 +128,9 @@ int QGDict::hashKeyString( const QString &key )
     if ( index < 0 )				// adjust index to table size
 	index = -index;
     return index;
+#else
+    return CFHash(key.s);
+#endif
 }
 
 /*!
@@ -1225,3 +1231,9 @@ QCollection::Item QGDictIterator::operator+=( uint jumps )
 	operator++();
     return curNode ? curNode->getData() : 0;
 }
+
+// KWQ hacks ---------------------------------------------------------------
+
+#endif // USING_BORROWED_QDICT
+
+// -------------------------------------------------------------------------
diff --git a/WebCore/src/kwq/qt/_qgdict.h b/WebCore/src/kwq/qt/_qgdict.h
index eb0ba21..25e2e17 100644
--- a/WebCore/src/kwq/qt/_qgdict.h
+++ b/WebCore/src/kwq/qt/_qgdict.h
@@ -40,12 +40,19 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QDICT
+#define USING_BORROWED_QDICT
 #endif
 
 #include <KWQDef.h>
 
+#ifndef USING_BORROWED_QSTRING
+#include <string.h>
+#define qstrcmp(s1,s2) strcmp((s1),(s2))
+#define qstricmp(s1,s2) strcasecmp((s1),(s2))
+#define qstrdup(s) strdup((s))
+#endif
+
 // -------------------------------------------------------------------------
 
 #ifndef QT_H
diff --git a/WebCore/src/kwq/qt/_qglist.cpp b/WebCore/src/kwq/qt/_qglist.cpp
index f3adc8f..4e6bf7c 100644
--- a/WebCore/src/kwq/qt/_qglist.cpp
+++ b/WebCore/src/kwq/qt/_qglist.cpp
@@ -37,10 +37,12 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifdef HAVE_CONFIG_H
+#include <config.h>
 #endif
 
+#ifdef USING_BORROWED_QLIST
+
 // -------------------------------------------------------------------------
 
 #include "_qglist.h"
@@ -1231,3 +1233,9 @@ QCollection::Item QGListIterator::operator-=( uint jumps )
 	curNode = curNode->prev;
     return curNode ? curNode->getData() : 0;
 }
+
+// KWQ hacks ---------------------------------------------------------------
+
+#endif // USING_BORROWED_QVECTOR
+
+// -------------------------------------------------------------------------
diff --git a/WebCore/src/kwq/qt/_qglist.h b/WebCore/src/kwq/qt/_qglist.h
index ce21e30..4103b11 100644
--- a/WebCore/src/kwq/qt/_qglist.h
+++ b/WebCore/src/kwq/qt/_qglist.h
@@ -40,8 +40,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QLIST
+#define USING_BORROWED_QLIST
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/src/kwq/qt/_qglobal.cpp b/WebCore/src/kwq/qt/_qglobal.cpp
index 705e12f..013222c 100644
--- a/WebCore/src/kwq/qt/_qglobal.cpp
+++ b/WebCore/src/kwq/qt/_qglobal.cpp
@@ -23,14 +23,6 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-// KWQ hacks ---------------------------------------------------------------
-
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
-#endif
-
-// -------------------------------------------------------------------------
-
 void qDebug(const char *msg, ...)
 {
 }
diff --git a/WebCore/src/kwq/qt/_qgvector.cpp b/WebCore/src/kwq/qt/_qgvector.cpp
index 8b6b64f..e8ea0ae 100644
--- a/WebCore/src/kwq/qt/_qgvector.cpp
+++ b/WebCore/src/kwq/qt/_qgvector.cpp
@@ -37,10 +37,12 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifdef HAVE_CONFIG_H
+#include <config.h>
 #endif
 
+#ifdef USING_BORROWED_QVECTOR
+
 // -------------------------------------------------------------------------
 
 #define	 QGVECTOR_CPP
@@ -661,3 +663,9 @@ QDataStream &QGVector::write( QDataStream &s ) const
     return s;
 }
 #endif // QT_NO_DATASTREAM
+
+// KWQ hacks ---------------------------------------------------------------
+
+#endif USING_BORROWED_QVECTOR
+
+// -------------------------------------------------------------------------
diff --git a/WebCore/src/kwq/qt/_qgvector.h b/WebCore/src/kwq/qt/_qgvector.h
index b679e77..f0ab5c6 100644
--- a/WebCore/src/kwq/qt/_qgvector.h
+++ b/WebCore/src/kwq/qt/_qgvector.h
@@ -40,8 +40,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QVECTOR
+#define USING_BORROWED_QVECTOR
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/src/kwq/qt/_qiodevice.cpp b/WebCore/src/kwq/qt/_qiodevice.cpp
index 81f91a5..8b83650 100644
--- a/WebCore/src/kwq/qt/_qiodevice.cpp
+++ b/WebCore/src/kwq/qt/_qiodevice.cpp
@@ -35,6 +35,16 @@
 **
 **********************************************************************/
 
+// KWQ hacks ---------------------------------------------------------------
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef USING_BORROWED_QFILE
+
+// -------------------------------------------------------------------------
+
 #include "_qiodevice.h"
 
 // NOT REVISED
@@ -636,3 +646,9 @@ int QIODevice::readLine( char *data, uint maxlen )
 
   \sa getch(), putch()
 */
+
+// KWQ hacks ---------------------------------------------------------------
+
+#endif USING_BORROWED_QFILE
+
+// -------------------------------------------------------------------------
diff --git a/WebCore/src/kwq/qt/_qlist.h b/WebCore/src/kwq/qt/_qlist.h
index c607b43..62824f1 100644
--- a/WebCore/src/kwq/qt/_qlist.h
+++ b/WebCore/src/kwq/qt/_qlist.h
@@ -40,8 +40,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QLIST
+#define USING_BORROWED_QLIST
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/src/kwq/qt/_qmap.cpp b/WebCore/src/kwq/qt/_qmap.cpp
index 643fbe5..8d61dcd 100644
--- a/WebCore/src/kwq/qt/_qmap.cpp
+++ b/WebCore/src/kwq/qt/_qmap.cpp
@@ -35,16 +35,14 @@
 **
 **********************************************************************/
 
+#include <qmap.h>
+
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
-#endif
+#ifdef USING_BORROWED_QMAP
 
 // -------------------------------------------------------------------------
 
-#include "qmap.h"
-
 typedef QMapNodeBase* NodePtr;
 typedef QMapNodeBase Node;
 
@@ -261,3 +259,4 @@ NodePtr QMapPrivateBase::removeAndRebalance( NodePtr z, NodePtr& root,
     return y;
 }
 
+#endif // USING_BORROWED_QMAP
diff --git a/WebCore/src/kwq/qt/_qpoint.cpp b/WebCore/src/kwq/qt/_qpoint.cpp
index da705f8..338ef59 100644
--- a/WebCore/src/kwq/qt/_qpoint.cpp
+++ b/WebCore/src/kwq/qt/_qpoint.cpp
@@ -10,12 +10,6 @@
  *
  ***********************************************************************/
 
-// KWQ hacks ---------------------------------------------------------------
-
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
-#endif
-
 // -------------------------------------------------------------------------
 
 #include "qpoint.h"
@@ -78,9 +72,11 @@ ostream &operator<<(ostream &o, const QPoint &p)
 }
 #endif
 
-// KWQ_COMPLETE implementations ------------------------------------------
+// KWQ hacks ---------------------------------------------------------------
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QPOINT
+
+// -------------------------------------------------------------------------
 
 bool QPoint::isNull() const
 { 
@@ -190,4 +186,8 @@ QPoint operator/(const QPoint &p, double d)
     return QPoint((QCOORD)(p.xx / d), (QCOORD)(p.yy / d)); 
 }
 
-#endif // _KWQ_COMPLETE_
+// KWQ hacks ---------------------------------------------------------------
+
+#endif USING_BORROWED_QPOINT
+
+// -------------------------------------------------------------------------
diff --git a/WebCore/src/kwq/qt/_qptrdict.h b/WebCore/src/kwq/qt/_qptrdict.h
index 6ac8cc5..87df229 100644
--- a/WebCore/src/kwq/qt/_qptrdict.h
+++ b/WebCore/src/kwq/qt/_qptrdict.h
@@ -40,8 +40,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QPTRDICT
+#define USING_BORROWED_QPTRDICT
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/src/kwq/qt/_qrect.cpp b/WebCore/src/kwq/qt/_qrect.cpp
index 84e08ba..cd7c3a8 100644
--- a/WebCore/src/kwq/qt/_qrect.cpp
+++ b/WebCore/src/kwq/qt/_qrect.cpp
@@ -12,8 +12,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifdef HAVE_CONFIG_H
+#include <config.h>
 #endif
 
 // -------------------------------------------------------------------------
@@ -117,6 +117,16 @@ bool QRect::intersects(const QRect &r) const
             QMAX(y1, r.y1) <= QMIN(y2, r.y2));
 }
 
+QRect QRect::operator&(const QRect &r) const
+{
+    QRect tmp;
+    tmp.x1 = QMAX(x1, r.x1);
+    tmp.x2 = QMIN(x2, r.x2);
+    tmp.y1 = QMAX(y1, r.y1);
+    tmp.y2 = QMIN(y2, r.y2);
+    return tmp;
+}
+
 #ifdef _KWQ_IOSTREAM_
 ostream &operator<<(ostream &o, const QRect &r)
 {
@@ -133,10 +143,11 @@ ostream &operator<<(ostream &o, const QRect &r)
 }
 #endif
 
+// KWQ hacks ---------------------------------------------------------------
 
-// KWQ_COMPLETE implementations ------------------------------------------
+#ifdef USING_BORROWED_QRECT
 
-#ifdef _KWQ_COMPLETE_
+// -------------------------------------------------------------------------
 
 QRect::QRect( const QPoint &topLeft, const QPoint &bottomRight )
 {
@@ -393,16 +404,6 @@ QRect QRect::operator|(const QRect &r) const
     }
 }
 
-QRect QRect::operator&(const QRect &r) const
-{
-    QRect tmp;
-    tmp.x1 = QMAX(x1, r.x1);
-    tmp.x2 = QMIN(x2, r.x2);
-    tmp.y1 = QMAX(y1, r.y1);
-    tmp.y2 = QMIN(y2, r.y2);
-    return tmp;
-}
-
 bool operator==(const QRect &r1, const QRect &r2)
 {
     return r1.x1==r2.x1 && r1.x2==r2.x2 && r1.y1==r2.y1 && r1.y2==r2.y2;
@@ -413,4 +414,8 @@ bool operator!=(const QRect &r1, const QRect &r2)
     return r1.x1!=r2.x1 || r1.x2!=r2.x2 || r1.y1!=r2.y1 || r1.y2!=r2.y2;
 }
 
-#endif // _KWQ_COMPLETE_
+// KWQ hacks ---------------------------------------------------------------
+
+#endif // USING_BORROWED_QRECT
+
+// -------------------------------------------------------------------------
diff --git a/WebCore/src/kwq/qt/_qregexp.cpp b/WebCore/src/kwq/qt/_qregexp.cpp
index 5127c56..361322d 100644
--- a/WebCore/src/kwq/qt/_qregexp.cpp
+++ b/WebCore/src/kwq/qt/_qregexp.cpp
@@ -37,10 +37,12 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifdef HAVE_CONFIG_H
+#include <config.h>
 #endif
 
+#ifdef USING_BORROWED_QREGEXP
+
 // -------------------------------------------------------------------------
 
 #include "qregexp.h"
@@ -1098,4 +1100,9 @@ void QRegExp::compile()
 #endif
 }
 
+// KWQ hacks ---------------------------------------------------------------
+
+#endif // USING_BORROWED_QREGION
+
+// -------------------------------------------------------------------------
 
diff --git a/WebCore/src/kwq/qt/_qregexp.h b/WebCore/src/kwq/qt/_qregexp.h
index 4b3db10..87c7221 100644
--- a/WebCore/src/kwq/qt/_qregexp.h
+++ b/WebCore/src/kwq/qt/_qregexp.h
@@ -40,8 +40,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QREGEXP
+#define USING_BORROWED_QREGEXP
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/src/kwq/qt/_qregion.cpp b/WebCore/src/kwq/qt/_qregion.cpp
index 2f3f154..f0f752b 100644
--- a/WebCore/src/kwq/qt/_qregion.cpp
+++ b/WebCore/src/kwq/qt/_qregion.cpp
@@ -37,10 +37,12 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifdef HAVE_CONFIG_H
+#include <config.h>
 #endif
 
+#ifdef USING_BORROWED_QREGION
+
 // -------------------------------------------------------------------------
 
 #include "qregion.h"
@@ -345,3 +347,8 @@ QRegion& QRegion::operator-=( const QRegion &r )
 QRegion& QRegion::operator^=( const QRegion &r )
     { return *this = *this ^ r; }
 
+// KWQ hacks ---------------------------------------------------------------
+
+#endif // USING_BORROWED_QREGION
+
+// -------------------------------------------------------------------------
diff --git a/WebCore/src/kwq/qt/_qregion.h b/WebCore/src/kwq/qt/_qregion.h
index 71db1b7..f0a4a8e 100644
--- a/WebCore/src/kwq/qt/_qregion.h
+++ b/WebCore/src/kwq/qt/_qregion.h
@@ -40,8 +40,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QREGION
+#define USING_BORROWED_QREGION
 #endif
 
 #include <KWQDef.h>
@@ -66,7 +66,7 @@ public:
     QRegion( const QPointArray &, bool winding=FALSE );
     QRegion( const QRegion & );
 // FIXME: Take this out until such time as bitmaps are implemented
-#ifndef _KWQ_COMPLETE_    
+#ifndef USING_BORROWED_QREGION
     QRegion( const QBitmap & );
 #endif
    ~QRegion();
diff --git a/WebCore/src/kwq/qt/_qshared.h b/WebCore/src/kwq/qt/_qshared.h
index e24bcdb..f2bf40a 100644
--- a/WebCore/src/kwq/qt/_qshared.h
+++ b/WebCore/src/kwq/qt/_qshared.h
@@ -19,10 +19,6 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
-#endif
-
 #include <KWQDef.h>
 
 // -------------------------------------------------------------------------
diff --git a/WebCore/src/kwq/qt/_qsize.cpp b/WebCore/src/kwq/qt/_qsize.cpp
index e7cee09..f77e221 100644
--- a/WebCore/src/kwq/qt/_qsize.cpp
+++ b/WebCore/src/kwq/qt/_qsize.cpp
@@ -12,8 +12,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifdef HAVE_CONFIG_H
+#include <config.h>
 #endif
 
 // -------------------------------------------------------------------------
@@ -100,9 +100,11 @@ ostream &operator<<(ostream &o, const QSize &s)
 }
 #endif
 
-// KWQ_COMPLETE implementations ------------------------------------------
+// KWQ hacks ---------------------------------------------------------------
+
+#ifdef USING_BORROWED_QSIZE
 
-#ifdef _KWQ_COMPLETE_
+// -------------------------------------------------------------------------
 
 bool QSize::isNull() const
 {
@@ -211,4 +213,8 @@ QSize operator/(const QSize &s, double d)
     return QSize((QCOORD)(s.w / d), (QCOORD)(s.h / d));
 }
 
-#endif // _KWQ_COMPLETE_
+// KWQ hacks ---------------------------------------------------------------
+
+#endif // USING_BORROWED_QSIZE
+
+// -------------------------------------------------------------------------
diff --git a/WebCore/src/kwq/qt/_qsortedlist.h b/WebCore/src/kwq/qt/_qsortedlist.h
index cb78bee..21f47b5 100644
--- a/WebCore/src/kwq/qt/_qsortedlist.h
+++ b/WebCore/src/kwq/qt/_qsortedlist.h
@@ -40,8 +40,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QSORTEDLIST
+#define USING_BORROWED_QSORTEDLIST
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/src/kwq/qt/_qstack.h b/WebCore/src/kwq/qt/_qstack.h
index 55f3446..db29522 100644
--- a/WebCore/src/kwq/qt/_qstack.h
+++ b/WebCore/src/kwq/qt/_qstack.h
@@ -40,8 +40,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QSTACK
+#define USING_BORROWED_QSTACK
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/src/kwq/qt/_qstring.cpp b/WebCore/src/kwq/qt/_qstring.cpp
index 07a845a..58921a6 100644
--- a/WebCore/src/kwq/qt/_qstring.cpp
+++ b/WebCore/src/kwq/qt/_qstring.cpp
@@ -37,10 +37,12 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifdef HAVE_CONFIG_H
+#include <config.h>
 #endif
 
+#ifdef USING_BORROWED_QSTRING
+
 // -------------------------------------------------------------------------
 
 // Don't define it while compiling this module, or USERS of Qt will
@@ -49,7 +51,7 @@
 #undef QT_NO_CAST_ASCII
 #endif
 
-#include "qstring.h"
+#include <qstring.h>
 #include "qregexp.h"
 
 #ifndef QT_NO_DATASTREAM
@@ -15273,3 +15275,9 @@ QString qt_winMB2QString( const char* mb, int mblen )
 
 
 #endif // _OS_WIN32_
+
+// KWQ hacks ---------------------------------------------------------------
+
+#endif // USING_BORROWED_QSTRING
+
+// -------------------------------------------------------------------------
diff --git a/WebCore/src/kwq/qt/_qstring.h b/WebCore/src/kwq/qt/_qstring.h
index cae347f..f60f94b 100644
--- a/WebCore/src/kwq/qt/_qstring.h
+++ b/WebCore/src/kwq/qt/_qstring.h
@@ -45,8 +45,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QSTRING
+#define USING_BORROWED_QSTRING
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/src/kwq/qt/_qstringlist.cpp b/WebCore/src/kwq/qt/_qstringlist.cpp
index 6688bb1..6b87311 100644
--- a/WebCore/src/kwq/qt/_qstringlist.cpp
+++ b/WebCore/src/kwq/qt/_qstringlist.cpp
@@ -37,10 +37,12 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifdef HAVE_CONFIG_H
+#include <config.h>
 #endif
 
+#ifdef USING_BORROWED_QSTRINGLIST
+
 // -------------------------------------------------------------------------
 
 #include "qstringlist.h"
@@ -260,10 +262,13 @@ QStringList QStringList::grep( const QString &str, bool cs ) const
 QStringList QStringList::grep( const QRegExp &expr ) const
 {
     QStringList res;
+#ifdef USING_BORROWED_QSTRING
     for ( QStringList::ConstIterator it = begin(); it != end(); ++it )
 	if ( (*it).contains( expr ) )
 	    res << *it;
-
+#else
+#warning function is not implemented
+#endif
     return res;
 }
 
@@ -312,3 +317,9 @@ QStringList QStringList::fromStrList(const QStrList& ascii)
 }
 
 #endif //QT_NO_STRINGLIST
+
+// KWQ hacks ---------------------------------------------------------------
+
+#endif USING_BORROWED_QSTRINGLIST
+
+// -------------------------------------------------------------------------
diff --git a/WebCore/src/kwq/qt/_qstringlist.h b/WebCore/src/kwq/qt/_qstringlist.h
index 7018c09..0b54fac 100644
--- a/WebCore/src/kwq/qt/_qstringlist.h
+++ b/WebCore/src/kwq/qt/_qstringlist.h
@@ -40,8 +40,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QSTRINGLIST
+#define USING_BORROWED_QSTRINGLIST
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/src/kwq/qt/_qstrlist.h b/WebCore/src/kwq/qt/_qstrlist.h
index f7700f2..ffcd178 100644
--- a/WebCore/src/kwq/qt/_qstrlist.h
+++ b/WebCore/src/kwq/qt/_qstrlist.h
@@ -40,12 +40,19 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QSTRINGLIST
+#define USING_BORROWED_QSTRINGLIST
 #endif
 
 #include <KWQDef.h>
 
+#ifndef USING_BORROWED_QSTRING
+#include <string.h>
+#define qstrcmp(s1,s2) strcmp((s1),(s2))
+#define qstricmp(s1,s2) strcasecmp((s1),(s2))
+#define qstrdup(s) strdup((s))
+#endif
+
 // -------------------------------------------------------------------------
 
 #ifndef QT_H
diff --git a/WebCore/src/kwq/qt/_qtextcodec.h b/WebCore/src/kwq/qt/_qtextcodec.h
index 4e6ac8b..f2ba71e 100644
--- a/WebCore/src/kwq/qt/_qtextcodec.h
+++ b/WebCore/src/kwq/qt/_qtextcodec.h
@@ -40,10 +40,6 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
-#endif
-
 #include <KWQDef.h>
 
 // -------------------------------------------------------------------------
diff --git a/WebCore/src/kwq/qt/_qtl.h b/WebCore/src/kwq/qt/_qtl.h
index e1e2d1e..4b9c462 100644
--- a/WebCore/src/kwq/qt/_qtl.h
+++ b/WebCore/src/kwq/qt/_qtl.h
@@ -39,8 +39,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QSTRINGLIST
+#define USING_BORROWED_QSTRINGLIST
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/src/kwq/qt/_qvaluelist.h b/WebCore/src/kwq/qt/_qvaluelist.h
index 1132929..ed1b8ce 100644
--- a/WebCore/src/kwq/qt/_qvaluelist.h
+++ b/WebCore/src/kwq/qt/_qvaluelist.h
@@ -40,8 +40,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QVALUELIST
+#define USING_BORROWED_QVALUELIST
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/src/kwq/qt/_qvector.h b/WebCore/src/kwq/qt/_qvector.h
index 6b55f28..b9c37a7 100644
--- a/WebCore/src/kwq/qt/_qvector.h
+++ b/WebCore/src/kwq/qt/_qvector.h
@@ -40,8 +40,8 @@
 
 // KWQ hacks ---------------------------------------------------------------
 
-#ifndef _KWQ_COMPLETE_
-#define _KWQ_COMPLETE_
+#ifndef USING_BORROWED_QVECTOR
+#define USING_BORROWED_QVECTOR
 #endif
 
 #include <KWQDef.h>
diff --git a/WebCore/src/kwq/qt/qarray.h b/WebCore/src/kwq/qt/qarray.h
index f0bf2db..37ab082 100644
--- a/WebCore/src/kwq/qt/qarray.h
+++ b/WebCore/src/kwq/qt/qarray.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QARRAY =======================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QARRAY
 #include <_qarray.h>
 #else
 
@@ -77,6 +77,6 @@ public:
 
 }; // class QArray =============================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QARRAY
 
 #endif
diff --git a/WebCore/src/kwq/qt/qcolor.h b/WebCore/src/kwq/qt/qcolor.h
index 022f8c5..5603b82 100644
--- a/WebCore/src/kwq/qt/qcolor.h
+++ b/WebCore/src/kwq/qt/qcolor.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QCOLOR =======================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QCOLOR
 #include <_qcolor.h>
 #else
 
@@ -94,6 +94,6 @@ public:
 
 }; // class QColor =============================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QCOLOR
 
 #endif
diff --git a/WebCore/src/kwq/qt/qcstring.h b/WebCore/src/kwq/qt/qcstring.h
index a42f93b..8e68252 100644
--- a/WebCore/src/kwq/qt/qcstring.h
+++ b/WebCore/src/kwq/qt/qcstring.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QSTRING ======================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QSTRING
 #include <_qcstring.h>
 #else
 
@@ -83,7 +83,7 @@ public:
     QCString &operator=(const QCString &);
     QCString &operator=(const char *);
     QCString &operator+=(const char *);
-    QCString &operator+=(const QCString &);
+    QCString &operator+=(char);
 
 #ifdef _KWQ_IOSTREAM_
     friend ostream &operator<<(ostream &, const QCString &);
@@ -92,6 +92,9 @@ public:
 // protected -------------------------------------------------------------------
 // private ---------------------------------------------------------------------
 
+private:
+    bool resize(uint);
+
 }; // class QCString ===========================================================
 
 
@@ -102,6 +105,6 @@ bool operator==(const QCString &s1, const char *s2);
 bool operator!=(const char *s1, const QCString &s2);
 bool operator!=(const QCString &s1, const char *s2);
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QSTRING
 
 #endif
diff --git a/WebCore/src/kwq/qt/qdatetime.h b/WebCore/src/kwq/qt/qdatetime.h
index f185d3f..3570888 100644
--- a/WebCore/src/kwq/qt/qdatetime.h
+++ b/WebCore/src/kwq/qt/qdatetime.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QDATETIME ====================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QDATETIME
 #include <_qdatetime.h>
 #else
 
@@ -159,6 +159,6 @@ public:
 
 }; // class QDateTime ==========================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QDATETIME
 
 #endif
diff --git a/WebCore/src/kwq/qt/qdict.h b/WebCore/src/kwq/qt/qdict.h
index fd7d0d6..4234247 100644
--- a/WebCore/src/kwq/qt/qdict.h
+++ b/WebCore/src/kwq/qt/qdict.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QDICT ========================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QDICT
 #include <_qdict.h>
 #else
 
@@ -124,6 +124,6 @@ private:
 
 }; // class QDictIterator ======================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QDICT
 
 #endif
diff --git a/WebCore/src/kwq/qt/qfile.h b/WebCore/src/kwq/qt/qfile.h
index f67b7df..7034859 100644
--- a/WebCore/src/kwq/qt/qfile.h
+++ b/WebCore/src/kwq/qt/qfile.h
@@ -32,7 +32,9 @@
 
 #include <KWQDef.h>
 
-#ifdef _KWQ_COMPLETE_
+// USING_BORROWED_QFILE =======================================================
+
+#ifdef USING_BORROWED_QFILE
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -116,7 +118,7 @@ struct QFileInfoCache
 };
 
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QFILE
 
 
 #include "_qiodevice.h"
@@ -131,7 +133,7 @@ public:
 
     // typedefs ----------------------------------------------------------------
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QFILE
     typedef QCString(*EncoderFn)(const QString &);
     typedef QString(*DecoderFn)(const QCString &);
 #endif
@@ -140,7 +142,7 @@ public:
     // constants ---------------------------------------------------------------
     // static member functions -------------------------------------------------
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QFILE
     static QCString encodeName(const QString &);
     static QString decodeName(const QCString &);
     static void setEncodingFunction(EncoderFn);
@@ -164,7 +166,7 @@ public:
     uint size() const;
 
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QFILE
     bool remove();
 
     QString	name() const;
@@ -194,7 +196,7 @@ public:
 
 // protected -------------------------------------------------------------------
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QFILE
 protected:
     QString fn;
     FILE *fh;
@@ -213,14 +215,14 @@ private:
     QFile(const QFile &);
     QFile &operator=(const QFile &);
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QFILE
     void init();
     QCString ungetchBuffer;
 #endif
 
 }; // class QFile ==============================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QFILE
 
 inline int QFile::at() const
 {
@@ -230,6 +232,7 @@ inline int QFile::at() const
 inline QString QFile::name() const
 { return fn; }
 
-#endif
+
+#endif // USING_BORROWED_QFILE
 
 #endif
diff --git a/WebCore/src/kwq/qt/qlist.h b/WebCore/src/kwq/qt/qlist.h
index 7d6bdf5..f0cdb1b 100644
--- a/WebCore/src/kwq/qt/qlist.h
+++ b/WebCore/src/kwq/qt/qlist.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QLIST ========================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QLIST
 #include <_qlist.h>
 #else
 
@@ -142,6 +142,6 @@ private:
 
 }; // class QListIterator ======================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QLIST
 
 #endif
diff --git a/WebCore/src/kwq/qt/qmap.h b/WebCore/src/kwq/qt/qmap.h
index 1c30401..b21233b 100644
--- a/WebCore/src/kwq/qt/qmap.h
+++ b/WebCore/src/kwq/qt/qmap.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QMAP =========================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QMAP
 #include <_qmap.h>
 #else
 
@@ -173,6 +173,6 @@ public:
 
 }; // class QMap ===============================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QMAP
 
 #endif
diff --git a/WebCore/src/kwq/qt/qpoint.h b/WebCore/src/kwq/qt/qpoint.h
index 7607f39..4408964 100644
--- a/WebCore/src/kwq/qt/qpoint.h
+++ b/WebCore/src/kwq/qt/qpoint.h
@@ -64,7 +64,7 @@ public:
 
     int manhattanLength() const;
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QPOINT
     bool isNull() const;
     void setX(int);
     void setY(int);
@@ -79,7 +79,7 @@ public:
     friend QPoint operator+(const QPoint &, const QPoint &);
     friend QPoint operator-(const QPoint &, const QPoint &);
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QPOINT
     QPoint &operator+=(const QPoint &);
     QPoint &operator-=(const QPoint &);
     QPoint &operator*=(int);
diff --git a/WebCore/src/kwq/qt/qptrdict.h b/WebCore/src/kwq/qt/qptrdict.h
index cf80222..3f0c240 100644
--- a/WebCore/src/kwq/qt/qptrdict.h
+++ b/WebCore/src/kwq/qt/qptrdict.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QPTRDICT =====================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QPTRDICT
 #include <_qptrdict.h>
 #else
 
@@ -123,6 +123,6 @@ private:
 
 }; // class QPtrDictIterator ===================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QPTRDICT
 
 #endif
diff --git a/WebCore/src/kwq/qt/qrect.h b/WebCore/src/kwq/qt/qrect.h
index 5aa018e..3ae421d 100644
--- a/WebCore/src/kwq/qt/qrect.h
+++ b/WebCore/src/kwq/qt/qrect.h
@@ -53,7 +53,7 @@ public:
     QRect(int, int, int, int);
     QRect(const QRect &);
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QRECT
     QRect(const QPoint &, const QPoint &);
     QRect(const QPoint &, const QSize &);
 #endif
@@ -83,7 +83,7 @@ public:
     QRect intersect(const QRect &) const;
     bool intersects(const QRect &) const;
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QRECT
     bool isEmpty() const;
     QRect normalize() const;
 
@@ -118,7 +118,7 @@ public:
     bool contains(int, int, bool proper=FALSE) const;
     bool contains(const QRect &, bool proper=FALSE) const;
     QRect unite(const QRect &) const;
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QRECT
 
     // operators ---------------------------------------------------------------
 
@@ -126,12 +126,13 @@ public:
      * QRect &operator=(const QRect &);
      */
 
-#ifdef _KWQ_COMPLETE_
+    QRect operator&(const QRect &) const;
+
+#ifdef USING_BORROWED_QRECT
     friend bool operator==(const QRect &, const QRect &);
     friend bool operator!=(const QRect &, const QRect &);
 
     QRect operator|(const QRect &) const;
-    QRect operator&(const QRect &) const;
     QRect& operator|=(const QRect &);
     QRect& operator&=(const QRect &);
 #endif
diff --git a/WebCore/src/kwq/qt/qregexp.h b/WebCore/src/kwq/qt/qregexp.h
index 64a1e5b..89633aa 100644
--- a/WebCore/src/kwq/qt/qregexp.h
+++ b/WebCore/src/kwq/qt/qregexp.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QREGEXP ======================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QREGEXP
 #include <_qregexp.h>
 #else
 
@@ -66,6 +66,6 @@ public:
 
 }; // class QRegExp ============================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QREGEXP
 
 #endif
diff --git a/WebCore/src/kwq/qt/qregion.h b/WebCore/src/kwq/qt/qregion.h
index b1d6a17..142f2d8 100644
--- a/WebCore/src/kwq/qt/qregion.h
+++ b/WebCore/src/kwq/qt/qregion.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QREGION ======================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QREGION
 #include <_qregion.h>
 #include "qpoint.h"
 #include "qimage.h"
@@ -81,6 +81,6 @@ public:
 
 }; // class QRegion ============================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QREGION
 
 #endif
diff --git a/WebCore/src/kwq/qt/qsize.h b/WebCore/src/kwq/qt/qsize.h
index db80871..8e6014d 100644
--- a/WebCore/src/kwq/qt/qsize.h
+++ b/WebCore/src/kwq/qt/qsize.h
@@ -64,7 +64,7 @@ public:
     void setHeight(int);
     QSize expandedTo(const QSize &) const;
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QSIZE
     bool isNull() const;
     bool isEmpty() const;
     void transpose();
@@ -81,7 +81,7 @@ public:
     friend bool operator==(const QSize &, const QSize &);
     friend bool operator!=(const QSize &, const QSize &);
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QSIZE
     QSize &operator+=(const QSize &);
     QSize &operator-=(const QSize &);
     QSize &operator*=(int);
diff --git a/WebCore/src/kwq/qt/qsortedlist.h b/WebCore/src/kwq/qt/qsortedlist.h
index eee362a..bda8bb3 100644
--- a/WebCore/src/kwq/qt/qsortedlist.h
+++ b/WebCore/src/kwq/qt/qsortedlist.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QSORTEDLIST ==================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QSORTEDLIST
 #include <_qsortedlist.h>
 #else
 
@@ -65,6 +65,6 @@ public:
 
 }; // class QSortedList ========================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QSORTEDLIST
 
 #endif
diff --git a/WebCore/src/kwq/qt/qstack.h b/WebCore/src/kwq/qt/qstack.h
index 49e342d..247832b 100644
--- a/WebCore/src/kwq/qt/qstack.h
+++ b/WebCore/src/kwq/qt/qstack.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QSTACK =======================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QSTACK
 #include <_qstack.h>
 #else
 
@@ -66,6 +66,6 @@ public:
 
 }; // class QStack =============================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QSTACK
 
 #endif
diff --git a/WebCore/src/kwq/qt/qstring.h b/WebCore/src/kwq/qt/qstring.h
index ed94e9e..6373a5e 100644
--- a/WebCore/src/kwq/qt/qstring.h
+++ b/WebCore/src/kwq/qt/qstring.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QSTRING ======================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QSTRING
 #include <_qstring.h>
 #else
 
@@ -128,7 +128,7 @@ public:
 
 class QString {
 public:
-    static QString fromLatin1(const char*, int len=-1);
+    static QString fromLatin1(const char *, int len=-1);
 
     // typedefs ----------------------------------------------------------------
     // enums -------------------------------------------------------------------
@@ -177,8 +177,7 @@ public:
     QString &append(const char *);
     QString &append(const QString &);
 
-    int contains(const char *, bool) const;
-    int contains(const char *) const;
+    int contains(const char *, bool cs=TRUE) const;
     int contains(char) const;
 
     int find(char, int index=0) const;
@@ -299,6 +298,6 @@ private:
 
 }; // class QConstString =======================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QSTRING
 
 #endif
diff --git a/WebCore/src/kwq/qt/qstringlist.h b/WebCore/src/kwq/qt/qstringlist.h
index 5f339a6..f6f0c6c 100644
--- a/WebCore/src/kwq/qt/qstringlist.h
+++ b/WebCore/src/kwq/qt/qstringlist.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QSTRINGLIST ==================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QSTRINGLIST
 #include <_qstringlist.h>
 #else
 
@@ -75,6 +75,6 @@ public:
 
 }; // class QStringList ========================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QSTRINGLIST
 
 #endif
diff --git a/WebCore/src/kwq/qt/qtextstream.h b/WebCore/src/kwq/qt/qtextstream.h
index c001c38..816e03f 100644
--- a/WebCore/src/kwq/qt/qtextstream.h
+++ b/WebCore/src/kwq/qt/qtextstream.h
@@ -30,12 +30,13 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QTEXTSTREAM ==================================================
 
 // FIXME: Need a hack here to give the xml tokenizer text stream
 // defines from Qt. The NEED_BOGUS_TEXTSTREAMS symbol
 // can be removed when we have Qt text streams implemented
-#if defined _KWQ_COMPLETE_ && ! defined NEED_BOGUS_TEXTSTREAMS
+
+#if defined USING_BORROWED_QTEXTSTREAM && ! defined NEED_BOGUS_TEXTSTREAMS
 #include <_qtextstream.h>
 #else
 
@@ -168,6 +169,6 @@ private:
 
 }; // class QTextOStream =======================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QTEXTSTREAM
 
 #endif
diff --git a/WebCore/src/kwq/qt/qvaluelist.h b/WebCore/src/kwq/qt/qvaluelist.h
index ed60c14..098c10d 100644
--- a/WebCore/src/kwq/qt/qvaluelist.h
+++ b/WebCore/src/kwq/qt/qvaluelist.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QVALUELIST ===================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QVALUELIST
 #include <_qvaluelist.h>
 #else
 
@@ -164,6 +164,6 @@ public:
 
 }; // class QValueList =========================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QVALUELIST
 
 #endif
diff --git a/WebCore/src/kwq/qt/qvector.h b/WebCore/src/kwq/qt/qvector.h
index bf212cd..6a5cc73 100644
--- a/WebCore/src/kwq/qt/qvector.h
+++ b/WebCore/src/kwq/qt/qvector.h
@@ -30,9 +30,9 @@
 #include <config.h>
 #endif
 
-// _KWQ_COMPLETE_ ==============================================================
+// USING_BORROWED_QVECTOR ======================================================
 
-#ifdef _KWQ_COMPLETE_
+#ifdef USING_BORROWED_QVECTOR
 #include <_qvector.h>
 #else
 
@@ -110,6 +110,6 @@ public:
 
 }; // class QVector ============================================================
 
-#endif // _KWQ_COMPLETE_
+#endif // USING_BORROWED_QVECTOR
 
 #endif
diff --git a/WebCore/src/kwq/tests/qt/Makefile.in b/WebCore/src/kwq/tests/qt/Makefile.in
index d0836c9..a872762 100644
--- a/WebCore/src/kwq/tests/qt/Makefile.in
+++ b/WebCore/src/kwq/tests/qt/Makefile.in
@@ -16,8 +16,9 @@ include $(TOPSRCDIR)/Makefile.vars
 # Set variables for this directory
 
 CXXOBJECTS = $(patsubst %.cpp,%.o,$(wildcard *.cpp))
+CMMOBJECTS = objc-dummy.o
 
-OBJECTS = $(CXXOBJECTS)
+OBJECTS = $(CMMOBJECTS) $(CXXOBJECTS)
 
 PROGRAMS = \
     qpoint-test \
@@ -50,19 +51,25 @@ CLEAN_FILES = *.o \
 
 CXXFLAGS = $(BASECXXFLAGS) \
     -Wall \
-    -DQ_DELETING_VOID_UNDEFINED \
-    -DQT_NO_TEXTCODEC \
-    -DQT_NO_DATASTREAM \
-    -D_KWQ_COMPLETE_ \
-    -D_KWQ_IOSTREAM_ \
+    -I$(TOPSRCDIR) \
     -I../../qt \
     -I../.. \
     -I. \
     $(NULL)
 
+CMMFLAGS = $(BASECMMFLAGS)
+
+LIBS = objc-dummy.o \
+    -framework Cocoa \
+    -lkwq \
+    -l_qt \
+    -lkwq \
+    -l_qt \
+    $(NULL)
+
 LDFLAGS = $(BASELDFLAGS) \
+    -L../.. \
     -L../../qt \
-    -l_qt \
     $(NULL)
 
 DEPFLAGS = $(CXXFLAGS)
@@ -73,61 +80,61 @@ DEPFLAGS = $(CXXFLAGS)
 all: $(OBJECTS) $(PROGRAMS)
 
 qpoint-test: qpoint-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qsize-test: qsize-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qrect-test: qrect-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qcstring-test: qcstring-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qarray-test: qarray-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qmap-test: qmap-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qvaluelist-test: qvaluelist-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qstringlist-test: qstringlist-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qlist-test: qlist-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qvector-test: qvector-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qdict-test: qdict-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qptrdict-test: qptrdict-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qstack-test: qstack-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qregexp-test: qregexp-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qchar-test: qchar-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qstring-test: qstring-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qdate-test: qdate-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qtime-test: qtime-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 qdatetime-test: qdatetime-test.o
-	$(CXX) -o $@ $< $(LDFLAGS)
+	$(CXX) -o $@ $< $(LDFLAGS) $(LIBS)
 
 depend: 
 
diff --git a/WebCore/src/kwq/tests/qt/objc-dummy.mm b/WebCore/src/kwq/tests/qt/objc-dummy.mm
new file mode 100644
index 0000000..531a44a
--- /dev/null
+++ b/WebCore/src/kwq/tests/qt/objc-dummy.mm
@@ -0,0 +1,6 @@
+#import <Cocoa/Cocoa.h>
+
+void objective_c_hack()
+{
+    NSObject *o = [NSObject alloc];
+}
diff --git a/WebCore/src/kwq/tests/qt/qchar-test.cpp b/WebCore/src/kwq/tests/qt/qchar-test.cpp
index 6e3d8a3..f672093 100644
--- a/WebCore/src/kwq/tests/qt/qchar-test.cpp
+++ b/WebCore/src/kwq/tests/qt/qchar-test.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 
 #include <qstring.h>
diff --git a/WebCore/src/kwq/tests/qt/qdate-test.cpp b/WebCore/src/kwq/tests/qt/qdate-test.cpp
index f8f40c5..e460937 100644
--- a/WebCore/src/kwq/tests/qt/qdate-test.cpp
+++ b/WebCore/src/kwq/tests/qt/qdate-test.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 
 #include <qdatetime.h>
diff --git a/WebCore/src/kwq/tests/qt/qdatetime-test.cpp b/WebCore/src/kwq/tests/qt/qdatetime-test.cpp
index 8279cd7..426bd92 100644
--- a/WebCore/src/kwq/tests/qt/qdatetime-test.cpp
+++ b/WebCore/src/kwq/tests/qt/qdatetime-test.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 
 #include <qdatetime.h>
diff --git a/WebCore/src/kwq/tests/qt/qdict-test.cpp b/WebCore/src/kwq/tests/qt/qdict-test.cpp
index 325e375..5358d0e 100644
--- a/WebCore/src/kwq/tests/qt/qdict-test.cpp
+++ b/WebCore/src/kwq/tests/qt/qdict-test.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 
 #include <qstring.h>
diff --git a/WebCore/src/kwq/tests/qt/qmap-test.cpp b/WebCore/src/kwq/tests/qt/qmap-test.cpp
index fc6a1e3..24cd8f1 100644
--- a/WebCore/src/kwq/tests/qt/qmap-test.cpp
+++ b/WebCore/src/kwq/tests/qt/qmap-test.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 
 #include <qmap.h>
diff --git a/WebCore/src/kwq/tests/qt/qpoint-test.cpp b/WebCore/src/kwq/tests/qt/qpoint-test.cpp
index 98283c5..d2cd76b 100644
--- a/WebCore/src/kwq/tests/qt/qpoint-test.cpp
+++ b/WebCore/src/kwq/tests/qt/qpoint-test.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 
 #include <qpoint.h>
diff --git a/WebCore/src/kwq/tests/qt/qrect-test.cpp b/WebCore/src/kwq/tests/qt/qrect-test.cpp
index 85c6314..7a6106a 100644
--- a/WebCore/src/kwq/tests/qt/qrect-test.cpp
+++ b/WebCore/src/kwq/tests/qt/qrect-test.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 
 #include <qrect.h>
diff --git a/WebCore/src/kwq/tests/qt/qregexp-test.cpp b/WebCore/src/kwq/tests/qt/qregexp-test.cpp
index 34f10cc..b03c492 100644
--- a/WebCore/src/kwq/tests/qt/qregexp-test.cpp
+++ b/WebCore/src/kwq/tests/qt/qregexp-test.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 
 #include <qstring.h>
diff --git a/WebCore/src/kwq/tests/qt/qsize-test.cpp b/WebCore/src/kwq/tests/qt/qsize-test.cpp
index a81ce9d..ec2d814 100644
--- a/WebCore/src/kwq/tests/qt/qsize-test.cpp
+++ b/WebCore/src/kwq/tests/qt/qsize-test.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 
 #include <qsize.h>
diff --git a/WebCore/src/kwq/tests/qt/qstack-test.cpp b/WebCore/src/kwq/tests/qt/qstack-test.cpp
index 2a95c3a..c200770 100644
--- a/WebCore/src/kwq/tests/qt/qstack-test.cpp
+++ b/WebCore/src/kwq/tests/qt/qstack-test.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 
 #include <qstack.h>
diff --git a/WebCore/src/kwq/tests/qt/qstring-test.cpp b/WebCore/src/kwq/tests/qt/qstring-test.cpp
index 4ceff11..71fc3eb 100644
--- a/WebCore/src/kwq/tests/qt/qstring-test.cpp
+++ b/WebCore/src/kwq/tests/qt/qstring-test.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 #include <qstring.h>
 #include <qregexp.h>
@@ -64,23 +68,23 @@ int main() {
     cout << s7.find(s12, 0, TRUE) << endl;
     cout << s7.find("string", 0) << endl;
     cout << s7.find("string", 0, TRUE) << endl;
-    cout << s7.findRev(c[0], 10, TRUE) << endl;
-    cout << s7.findRev(qre, 10) << endl;
-    cout << s7.findRev(s12, -1, TRUE) << endl;
-    cout << s7.findRev('t', 10) << endl;
-    cout << s7.findRev('t', 10, TRUE) << endl;
-    
-    cout << s7.contains(c[0], TRUE) << endl;
-    cout << s7.contains(qre) << endl;
+    //cout << s7.findRev(c[0], 10, TRUE) << endl;
+    //cout << s7.findRev(qre, 10) << endl;
+    //cout << s7.findRev(s12, -1, TRUE) << endl;
+    //cout << s7.findRev('t', 10) << endl;
+    //cout << s7.findRev('t', 10, TRUE) << endl;
+    
+    //cout << s7.contains(c[0], TRUE) << endl;
+    //cout << s7.contains(qre) << endl;
     cout << s13.contains(s14, TRUE) << endl;
-    cout << s13.contains('b', TRUE) << endl;
+    //cout << s13.contains('b', TRUE) << endl;
     cout << s13.contains(blah, TRUE) << endl;
     
     cout << s13.left(4) << endl;
     cout << s13.right(4) << endl;
     cout << s13.mid(5,4) << endl;
-    cout << s14.leftJustify(8,'.') << endl;
-    cout << s14.rightJustify(8,'.') << endl;
+    //cout << s14.leftJustify(8,'.') << endl;
+    //cout << s14.rightJustify(8,'.') << endl;
     
     QString s15 = "Hello %1. How has your %2 been?";
     double my_double =22.45;
@@ -94,7 +98,7 @@ int main() {
     
     cout << s15.arg(s14).arg(s14) << endl;
     cout << s15.arg(s14, 5).arg(s14, 5) << endl; // fieldwidth only add one extra space. hmmmm.
-    cout << s15.arg(c[2]).arg(c[2]) << endl;
+    //cout << s15.arg(c[2]).arg(c[2]) << endl;
     cout << s15.arg("Gramps").arg("morning") << endl;
     cout << s15.arg(my_double).arg(my_double) << endl;
     cout << s15.arg(my_int).arg(my_long) << endl;
@@ -104,21 +108,21 @@ int main() {
     QString s16 = "THIS WAS A STRING IN UPPERCASE";
     QString s17 = "this was a string in lowercase";
     cout << s16.lower() << endl;
-    cout << s17.upper() << endl;
+    //cout << s17.upper() << endl;
     
     QString s18 =" This    was a  string   with a lot of       spaces ";
     cout << s18.stripWhiteSpace() << endl; //why is white space still there?
     cout << s18.simplifyWhiteSpace() << endl; //this works
     
     QString s19 = "221545";
-    cout << s19.toDouble() << endl;   //Am I properly testing this?
+    //cout << s19.toDouble() << endl;   //Am I properly testing this?
     cout << s19.toFloat() << endl;
     cout << s19.toInt() << endl;
     cout << s19.toLong() << endl;
-    cout << s19.toShort() << endl;
+    //cout << s19.toShort() << endl;
     cout << s19.toUInt() << endl;
-    cout << s19.toULong() << endl;
-    cout << s19.toUShort() << endl;
+    //cout << s19.toULong() << endl;
+    //cout << s19.toUShort() << endl;
     
     QString s20;
     cout << s20.sprintf("This is a %s. %d, %f", "test", 44, 56.78) << endl;
@@ -132,22 +136,22 @@ int main() {
     QString s24 = "The answer is: ";
     QChar c2 = '2';
     cout << s24.insert(15, c2) << endl;
-    cout << s24.insert(15, c, 4) << endl;
-    cout << s24.insert(15, s22) << endl;
-    cout << s24.insert(15, 'c') << endl;
+    //cout << s24.insert(15, c, 4) << endl;
+    //cout << s24.insert(15, s22) << endl;
+    //cout << s24.insert(15, 'c') << endl;
     cout << s24.append(c2) << endl;
-    cout << s24.append('c') << endl;
+    //cout << s24.append('c') << endl;
     cout << s24.append(s22) << endl;    
     cout << s24.prepend(c2) << endl;
-    cout << s24.prepend('c') << endl;
+    //cout << s24.prepend('c') << endl;
     cout << s24.prepend(s22) << endl;
     cout << s24.remove(0, 7) << endl;
     
     QString s25 = "There are a lot of a's in a sentence such as this one";
     QString s26 = "bell";
     cout << s25.replace( QRegExp("a"), "e" ) << endl; 
-    cout << s25.replace(1, 4, c, 4) << endl;
-    cout << s25.replace(12, 4, s26) << endl;
+    //cout << s25.replace(1, 4, c, 4) << endl;
+    //cout << s25.replace(12, 4, s26) << endl;
     
     QString s27;
     cout << s27.setNum(my_double) << endl;
diff --git a/WebCore/src/kwq/tests/qt/qstringlist-test.cpp b/WebCore/src/kwq/tests/qt/qstringlist-test.cpp
index 132a169..c234072 100644
--- a/WebCore/src/kwq/tests/qt/qstringlist-test.cpp
+++ b/WebCore/src/kwq/tests/qt/qstringlist-test.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 
 #include <qstring.h>
diff --git a/WebCore/src/kwq/tests/qt/qtime-test.cpp b/WebCore/src/kwq/tests/qt/qtime-test.cpp
index 67acba9..2ce19a8 100644
--- a/WebCore/src/kwq/tests/qt/qtime-test.cpp
+++ b/WebCore/src/kwq/tests/qt/qtime-test.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 
 #include <qdatetime.h>
diff --git a/WebCore/src/kwq/tests/qt/qvaluelist-test.cpp b/WebCore/src/kwq/tests/qt/qvaluelist-test.cpp
index e2e8161..5e13474 100644
--- a/WebCore/src/kwq/tests/qt/qvaluelist-test.cpp
+++ b/WebCore/src/kwq/tests/qt/qvaluelist-test.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 
 #include <qvaluelist.h>
diff --git a/WebCore/src/kwq/tests/qt/qvector-test.cpp b/WebCore/src/kwq/tests/qt/qvector-test.cpp
index 7fceda2..56e8387 100644
--- a/WebCore/src/kwq/tests/qt/qvector-test.cpp
+++ b/WebCore/src/kwq/tests/qt/qvector-test.cpp
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <iostream>
 
 #include <qvector.h>

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list